@gjsify/example-node-cli-deepkit-validation 0.1.3
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 +21 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @gjsify/example-cli-deepkit-validation
|
|
2
|
+
|
|
3
|
+
This example demonstrates the runtime type validation system of [@deepkit/type](https://deepkit.io/library/type) running on GJS via Gjsify.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Basic type guards** — `is<string>()`, `is<number>()` at runtime
|
|
8
|
+
- **Interface validation** — validate complex objects against TypeScript interfaces
|
|
9
|
+
- **Type constraints** — `MinLength`, `MaxLength`, `Positive`, `Email`, `Pattern`, etc.
|
|
10
|
+
- **Custom validators** — build your own validation logic with `Validate<>`
|
|
11
|
+
- **assert()** — throw on invalid data for input validation
|
|
12
|
+
- **Nested objects** — deep validation with dotted error paths
|
|
13
|
+
- **Union & literal types** — validate discriminated unions and string literals
|
|
14
|
+
|
|
15
|
+
## Build & Run
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
yarn build
|
|
19
|
+
yarn start:node # Run on Node.js
|
|
20
|
+
yarn start:gjs # Run on GJS
|
|
21
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gjsify/example-node-cli-deepkit-validation",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Demonstrates Deepkit runtime type validation with constraints on GJS",
|
|
5
|
+
"main": "dist/index.gjs.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "16",
|
|
12
|
+
"gjs": "1.72.x"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"clear": "rm -rf dist tsconfig.tsbuildinfo",
|
|
16
|
+
"check": "tsc --noEmit",
|
|
17
|
+
"start": "yarn start:node && yarn start:gjs",
|
|
18
|
+
"start:gjs": "gjs -m dist/index.gjs.js",
|
|
19
|
+
"start:node": "node dist/index.node.mjs",
|
|
20
|
+
"build": "yarn build:gjs && yarn build:node",
|
|
21
|
+
"build:gjs": "gjsify build src/index.ts --app gjs --outfile dist/index.gjs.js",
|
|
22
|
+
"build:node": "gjsify build src/index.ts --app node --outfile dist/index.node.mjs",
|
|
23
|
+
"test": "yarn start"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@deepkit/core": "^1.0.19",
|
|
27
|
+
"@deepkit/type": "^1.0.19",
|
|
28
|
+
"@gjsify/cli": "^0.1.3",
|
|
29
|
+
"@gjsify/node-globals": "^0.1.3",
|
|
30
|
+
"@types/node": "^25.5.2",
|
|
31
|
+
"typescript": "^6.0.2"
|
|
32
|
+
},
|
|
33
|
+
"author": "Pascal Garber <pascal@artandcode.studio>",
|
|
34
|
+
"license": "MIT"
|
|
35
|
+
}
|