Skip to content

Commit

Permalink
Merge pull request #287 from jacob-alford/ja/fix-recursive-export
Browse files Browse the repository at this point in the history
fix: schemata index re-export
  • Loading branch information
jacob-alford authored Aug 25, 2023
2 parents c88e46b + 7fa6563 commit 1163da7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
30 changes: 15 additions & 15 deletions docs/schemata/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ has_children: true

### String (17)

* Ascii ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Ascii.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Ascii.ts)) (e.g: `N>]G3"_eRiH`, `}L FB4`, `-NK<LUFY`)
* Base64 ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64.ts)) (e.g: `8+///K04++cb+F+++8/5SA95fUVzzIE/W+l+`, `b/+I//T=`, `+3w2/zZ++R/TL/VjSH/T+++bPeI+MSM+Z//=`)
* Base64Url ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64Url.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64Url.ts)) (e.g: `X03--Y-J4-`, `Q_cA2cdC`, `b9-6R-`)
* BitcoinAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/BitcoinAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/BitcoinAddress.ts)) (e.g: `2umr1KNDmbpfk3eyvT1Zq3D8g1pSuGcf`, `19JZCQ4RN7BcP9BXyLyjQmnW1pK`, `bc1193117461v687z71ec97gx260`)
* Ascii ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Ascii.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Ascii.ts)) (e.g: `1fy1`, `yze`, `N$Up* `)
* Base64 ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64.ts)) (e.g: `2YgDDw5E/D253+Ece+9W`, `T/E/vuc/J5==`, `926W/+/huCs+h63x+6+3+g+et0e+`)
* Base64Url ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Base64Url.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Base64Url.ts)) (e.g: `vX_m2d-9W`, `C-7k_1X`, `_Z--CW`)
* BitcoinAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/BitcoinAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/BitcoinAddress.ts)) (e.g: `bc1z5no31j13e89dguvx3724k801v5tzd8z2811d9y`, `bc1964n34552l843w7c5i2hl93y8hg`, `bc1b32360yy2q850kwvd7a1b9xdxt`)
* CamelCaseString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CamelCaseString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CamelCaseString.ts)) (e.g: `Camel_case-string``camelCaseString`)
* CreditCard ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CreditCard.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CreditCard.ts)) (e.g: `8292259233347204`, `6286183693101011807`, `8118910162983532`)
* EmailAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EmailAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EmailAddress.ts)) (e.g: `!+$!-'~3^&!.|&{/G~!_|8'!.6s+/+%*+@[13.003.34.23]`, `#$&^{=~-.$&%5D8?i~#|.|?*%.'$t_+.#|/^.=+'._%@[16.718.718.253]`, `#.6}6/|r~$.-|.+}==&|x*.?#&&/$%.$_^u%==}?./?-~.-}~*/$.!^}'n^/&{@6.1BlH.6-7LC9--2G.3-3v876o-1.wzJMpRy.7-z7F6H.8zE0g.8D-.l7-k.cat`)
* EthereumAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EthereumAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EthereumAddress.ts)) (e.g: `0xdEB8aEff639b061DcB78AFbECf47ebE58BC81d9D`, `0xEaeFfBABEdDB3Fc3AADCebAbAbAc4cEd5d1BbAbC`, `0x1fBD7bACC17962c7C592F5EAFc999beFa212dfB9`)
* HexColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HexColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HexColor.ts)) (e.g: `CE0Eddbb`, `#d17aC2F6`, `#39b7faBc`)
* Hexadecimal ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Hexadecimal.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Hexadecimal.ts)) (e.g: `0xB12FFEdF21e`, `0Hec1bCccf6`, `0h418bbB51bc`)
* HslColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HslColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HslColor.ts)) (e.g: `hsl(227733893639e-532deg+000000000.33938060647%00100.000000%)`, `hsla(+18,+00.238%,000.05e+45283535%)`, `hsl(4.6261e-13deg,+000100.00000%,00100.0%)`)
* Jwt ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Jwt.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Jwt.ts)) (e.g: `--_.-pA5-_`, `3j_---.aK_5c`, `HE1.__761I_`)
* LatLong ([docs](https://jacob-alford.github.io/schemata-ts/schemata/LatLong.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/LatLong.ts)) (e.g: `(88,-180.00)`, `(88,180)`, `+87.7388905040,180.0000000`)
* NonEmptyString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/NonEmptyString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/NonEmptyString.ts)) (e.g: `DW=3*lf6{`, `applyProp`, `M99CvFD=`)
* RGB ([docs](https://jacob-alford.github.io/schemata-ts/schemata/RGB.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/RGB.ts)) (e.g: `rgb(92%,100%,93%)`, `rgb(90%,90%,1%)`, `rgba(38%,100%,41%,1.0)`)
* CreditCard ([docs](https://jacob-alford.github.io/schemata-ts/schemata/CreditCard.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/CreditCard.ts)) (e.g: `6229230551984011`, `628713038750583300`, `50821732064932718`)
* EmailAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EmailAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EmailAddress.ts)) (e.g: `0-==?4}{%*.r.=-=!!!!#./$*N%{!@qj3zNH5zx-.p-.9-FFG82--1.0.u-u946.-cL2-38-.-s6-HWq.--o-MjLv4.oX.-n.d6ggJ.ItoHBnNdVxbr`, `}^~.*{$_$#{&'+?=@gv--j-.-.ng-0t--B.i9cbHI.J2----2-G.p2I.ho.D--m-7.K214UM.Fg-.904-.V.hWL`, `+|.3^d*~!!.??&?W#.{||h/{}.^?^_$.|v?.+&+{/=&.P/#V!==-^?.+*@[6.2.6.9]`)
* EthereumAddress ([docs](https://jacob-alford.github.io/schemata-ts/schemata/EthereumAddress.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/EthereumAddress.ts)) (e.g: `0xdAE1ACd0cd8aeAFEACAEABB0dEef1dcFBeE01aF3`, `0xfaCFcAa5bcB1ACDbBcdadC86ECa3cEF92BAcb13e`, `0xbDa8cff9abeEb9babedbcb2d94DaAfab5afdddFa`)
* HexColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HexColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HexColor.ts)) (e.g: `#AEcCbDAe`, `#ABdd7D`, `#ab8eE33A`)
* Hexadecimal ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Hexadecimal.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Hexadecimal.ts)) (e.g: `0XE240E`, `0HbfCb13`, `D9123D30`)
* HslColor ([docs](https://jacob-alford.github.io/schemata-ts/schemata/HslColor.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/HslColor.ts)) (e.g: `hsla(+.3413e+006353535,.9e8792%,.9974%)`, `hsl(18.865071e-6164121,0000023%,000000.6%)`, `hsl(1963372,11e6043521%,.31%)`)
* Jwt ([docs](https://jacob-alford.github.io/schemata-ts/schemata/Jwt.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/Jwt.ts)) (e.g: `M6_3_.-673_-G`, `._mF._dB`, `vHOx.84_-W4j.-`)
* LatLong ([docs](https://jacob-alford.github.io/schemata-ts/schemata/LatLong.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/LatLong.ts)) (e.g: `+83,-171`, `86,180`, `(-90,101)`)
* NonEmptyString ([docs](https://jacob-alford.github.io/schemata-ts/schemata/NonEmptyString.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/NonEmptyString.ts)) (e.g: `y+#6`, `eeStriDcallvalue`, `r3g9K9Xr2l7B`)
* RGB ([docs](https://jacob-alford.github.io/schemata-ts/schemata/RGB.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/RGB.ts)) (e.g: `rgba(96%,91%,100%,0.36852)`, `rgba(100%,1%,100%,.9801820)`, `rgba(100%,28%,81%,.875)`)
* String ([docs](https://jacob-alford.github.io/schemata-ts/schemata/String.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/String.ts))
* UUID ([docs](https://jacob-alford.github.io/schemata-ts/schemata/UUID.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/UUID.ts)) (e.g: `71f2f45B-15Dc-f6AC-fA2b-4Be8bCFF60bC`, `BBBd701e-BDF8-9b98-Ec38-e27C0C3bDc17`, `cd82fa6A-9DAd-EDfD-ADfA-DeFCf887bbff`)
* UUID ([docs](https://jacob-alford.github.io/schemata-ts/schemata/UUID.html)) ([source](https://github.com/jacob-alford/schemata-ts/tree/main/src/schemata/UUID.ts)) (e.g: `6FA9aC10-e3a0-cDAb-baFe-B3CBFbF3cDd1`, `a3fD0Fb3-aBB8-eB3B-dC86-7D1Af3CbECbd`, `DDadf9F2-481F-ea2e-6cAf-cABeBAfCDBDB`)

### Unknown (3)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "schemata-ts",
"version": "2.0.5",
"version": "2.0.6",
"description": "An all-inclusive schema engine featuring schemata inspired by io-ts and validators.js. Written for TypeScript with fp-ts",
"homepage": "https://jacob-alford.github.io/schemata-ts/",
"repository": {
Expand Down
13 changes: 11 additions & 2 deletions scripts/generate-schemata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as Cons from 'fp-ts/Console'
import { flow, pipe, tuple } from 'fp-ts/function'
import * as O from 'fp-ts/Option'
import * as Pred from 'fp-ts/Predicate'
import * as RTE from 'fp-ts/ReaderTaskEither'
import * as RA from 'fp-ts/ReadonlyArray'
import * as RNEA from 'fp-ts/ReadonlyNonEmptyArray'
Expand Down Expand Up @@ -59,10 +61,17 @@ const writeToDisk: (path: string) => (contents: string) => Build<void> =
// #endregion

/** Extracts module name, e.g. ASCII.ts -> ASCII */
const getModuleName: (file: string) => string = flow(Str.split('.'), RNEA.head)
const getModuleName: (file: string) => O.Option<string> = flow(
Str.split('.'),
RNEA.head,
O.fromPredicate(Pred.not(Str.includes('index'))),
)

const getSchemata: Build<ReadonlyArray<readonly [schemaName: string]>> = C =>
pipe(C.readFiles('./src/schemata'), TE.map(RA.map(flow(getModuleName, tuple))))
pipe(
C.readFiles('./src/schemata'),
TE.map(RA.filterMap(flow(getModuleName, O.map(tuple)))),
)

const format: Build<void> = C => C.exec('yarn format')

Expand Down
1 change: 0 additions & 1 deletion src/schemata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export * from 'schemata-ts/schemata/Hexadecimal'
export * from 'schemata-ts/schemata/HexColor'
export * from 'schemata-ts/schemata/HslColor'
export * from 'schemata-ts/schemata/Imap'
export * from 'schemata-ts/schemata/index'
export * from 'schemata-ts/schemata/Int'
export * from 'schemata-ts/schemata/Intersect'
export * from 'schemata-ts/schemata/IntFromString'
Expand Down

0 comments on commit 1163da7

Please sign in to comment.