ts-fortress 12.0.0 → 12.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +25 -18
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@ TypeScript-first schema validation library with static type inference.
|
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/ts-fortress)
|
|
10
10
|
[](https://www.npmjs.com/package/ts-fortress)
|
|
11
|
-
[](
|
|
12
|
-
[](https://github.com/noshiro-pf/mono/blob/main/libs/ts-fortress/LICENSE)
|
|
12
|
+
[](https://codecov.io/gh/noshiro-pf/mono)
|
|
13
13
|
|
|
14
14
|
**ts-fortress** is a runtime validation library similar to [io-ts](https://github.com/gcanti/io-ts) and [Zod](https://zod.dev/), designed to provide type-safe schema validation with excellent TypeScript integration and static type inference.
|
|
15
15
|
|
|
@@ -286,7 +286,7 @@ String constraints:
|
|
|
286
286
|
|
|
287
287
|
- `startsWith`, `endsWith`, `includes` — narrow the result to the corresponding template literal type
|
|
288
288
|
- `lowercase`, `uppercase`
|
|
289
|
-
- `nonempty` — brands the result as `NonEmptyString` (from [ts-type-forge](https://github.com/noshiro-pf/ts-type-forge))
|
|
289
|
+
- `nonempty` — brands the result as `NonEmptyString` (from [ts-type-forge](https://github.com/noshiro-pf/mono/tree/main/libs/ts-type-forge))
|
|
290
290
|
- `minLength`, `maxLength` — brand the result as `MinLengthString<N>` / `MaxLengthString<N>` (from ts-type-forge), which preserve the natural subtyping between length bounds
|
|
291
291
|
- `regex`
|
|
292
292
|
|
|
@@ -341,7 +341,7 @@ Bigint constraints mirror the numeric API but operate on `bigint` literals. When
|
|
|
341
341
|
|
|
342
342
|
While ts-fortress, [Zod](https://github.com/colinhacks/zod), and [io-ts](https://github.com/gcanti/io-ts) are all excellent TypeScript validation libraries, ts-fortress offers more readable and informative error messages than both, a more type-safe way of building validators than Zod, and addresses some critical runtime consistency issues found in io-ts.
|
|
343
343
|
|
|
344
|
-
For more information, please see [this documentation](
|
|
344
|
+
For more information, please see [this documentation](https://github.com/noshiro-pf/mono/blob/main/libs/ts-fortress/documents/why-ts-fortress-over-zod-and-io-ts.md).
|
|
345
345
|
|
|
346
346
|
### Migration from io-ts
|
|
347
347
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-fortress",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript"
|
|
7
7
|
],
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/noshiro-pf/
|
|
11
|
-
"directory": "
|
|
10
|
+
"url": "git+https://github.com/noshiro-pf/mono.git",
|
|
11
|
+
"directory": "libs/ts-fortress"
|
|
12
12
|
},
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "noshiro-pf <noshiro.pf@gmail.com>",
|
|
@@ -36,20 +36,27 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@sindresorhus/is": "8.1.0",
|
|
39
|
-
"ts-data-forge": "~14.
|
|
40
|
-
"ts-type-forge": "~9.1
|
|
39
|
+
"ts-data-forge": "~14.3.0",
|
|
40
|
+
"ts-type-forge": "~9.2.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@rollup/plugin-replace": "6.0.3",
|
|
44
|
-
"@rollup/plugin-strip": "3.0.4",
|
|
45
43
|
"@vitest/browser-playwright": "4.1.10",
|
|
46
44
|
"@vitest/ui": "4.1.10",
|
|
47
|
-
"fast-glob": "3.3.3",
|
|
48
45
|
"fp-ts": "2.16.11",
|
|
49
46
|
"io-ts": "2.2.22",
|
|
47
|
+
"playwright": "1.62.1",
|
|
48
|
+
"prettier": "3.9.6",
|
|
49
|
+
"prettier-plugin-organize-imports": "4.3.0",
|
|
50
|
+
"prettier-plugin-packagejson": "3.0.2",
|
|
51
|
+
"rollup": "4.62.4",
|
|
50
52
|
"typedoc": "0.28.20",
|
|
51
53
|
"typedoc-github-theme": "0.4.0",
|
|
52
|
-
"
|
|
54
|
+
"vite": "8.2.1",
|
|
55
|
+
"zod": "4.4.3",
|
|
56
|
+
"eslint-config-typed": "5.9.2",
|
|
57
|
+
"eslint-plugin-ts-data-forge": "0.4.7",
|
|
58
|
+
"eslint-plugin-ts-type-forge": "0.6.5",
|
|
59
|
+
"ts-repo-utils": "10.2.0"
|
|
53
60
|
},
|
|
54
61
|
"engines": {
|
|
55
62
|
"node": ">=22.22.2",
|
|
@@ -60,19 +67,19 @@
|
|
|
60
67
|
"provenance": true
|
|
61
68
|
},
|
|
62
69
|
"scripts": {
|
|
63
|
-
"build": "tsx ./scripts/cmd/build.mts",
|
|
64
|
-
"build:min": "tsx ./scripts/cmd/build.mts --skip-check",
|
|
65
|
-
"check:ext": "tsx ./scripts/cmd/check-ext.mts",
|
|
66
|
-
"doc": "tsx ./scripts/cmd/gen-docs.mts",
|
|
67
|
-
"doc:embed": "tsx ./scripts/cmd/embed-examples.mts",
|
|
68
|
-
"doc:embed:jsdoc": "tsx ./scripts/cmd/embed-examples-in-jsdoc.mts",
|
|
70
|
+
"build": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts",
|
|
71
|
+
"build:min": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/build.mts --skip-check",
|
|
72
|
+
"check:ext": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/check-ext.mts",
|
|
73
|
+
"doc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/gen-docs.mts",
|
|
74
|
+
"doc:embed": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples.mts",
|
|
75
|
+
"doc:embed:jsdoc": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ./scripts/cmd/embed-examples-in-jsdoc.mts",
|
|
69
76
|
"doc:preview": "vite preview --config ./configs/vite.doc.config.mts",
|
|
70
77
|
"doc:watch": "typedoc --options ./configs/typedoc.config.mjs --watch",
|
|
71
|
-
"fmt": "format-uncommitted --cwd .",
|
|
72
|
-
"fmt:diff": "format-diff-from origin/main --cwd .",
|
|
78
|
+
"fmt": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-uncommitted.mts --cwd .",
|
|
79
|
+
"fmt:diff": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/format-diff-from.mts origin/main --cwd .",
|
|
73
80
|
"fmt:full": "pnpm run z:prettier .",
|
|
74
81
|
"gi": "run-s gi:src fmt",
|
|
75
|
-
"gi:src": "gen-index-ts ./src --index-ext .mts --export-ext .mjs --target-ext .mts --target-ext .tsx --exclude entry-point.mts --exclude build-type.mts",
|
|
82
|
+
"gi:src": "tsx --tsconfig ../../tools/configs/tsconfig.tsx.json ../../libs/ts-repo-utils/src/cmd/gen-index-ts.mts ./src --index-ext .mts --export-ext .mjs --target-ext .mts --target-ext .tsx --exclude entry-point.mts --exclude build-type.mts",
|
|
76
83
|
"lint": "eslint .",
|
|
77
84
|
"lint:fix": "eslint . --fix",
|
|
78
85
|
"test": "pnpm run z:vitest:node run",
|