@shaclmate/cli 4.0.6 → 4.0.8

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.
Files changed (2) hide show
  1. package/dist/cli.js +18 -3
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import * as fs from "node:fs";
3
3
  import PrefixMap from "@rdfjs/prefix-map/PrefixMap.js";
4
- import { AstJsonGenerator, Compiler, ShapesGraph, TsGenerator, } from "@shaclmate/compiler";
4
+ import { AstJsonGenerator, Compiler, ShapesGraph, TsGenerator, ZodGenerator, } from "@shaclmate/compiler";
5
5
  import { command, option, restPositionals, run, string, subcommands, } from "cmd-ts";
6
6
  import { ExistingPath } from "cmd-ts/dist/cjs/batteries/fs.js";
7
7
  import { DataFactory, Parser, Store, Writer } from "n3";
@@ -86,7 +86,7 @@ run(subcommands({
86
86
  cmds: {
87
87
  "ast-json": command({
88
88
  name: "ast-json",
89
- description: "generate AST JSON for the SHACL Shapes Graph AST",
89
+ description: "generate AST JSON for the SHACL shapes graph",
90
90
  args: {
91
91
  inputFilePaths,
92
92
  outputFilePath,
@@ -101,7 +101,7 @@ run(subcommands({
101
101
  }),
102
102
  ts: command({
103
103
  name: "ts",
104
- description: "generate TypeScript for the SHACL Shapes Graph AST",
104
+ description: "generate TypeScript for the SHACL shapes graph",
105
105
  args: {
106
106
  inputFilePaths,
107
107
  outputFilePath,
@@ -114,6 +114,21 @@ run(subcommands({
114
114
  });
115
115
  },
116
116
  }),
117
+ zod: command({
118
+ name: "zod",
119
+ description: "generate Zod schemas for the SHACL shapes graph",
120
+ args: {
121
+ inputFilePaths,
122
+ outputFilePath,
123
+ },
124
+ handler: async ({ inputFilePaths, outputFilePath }) => {
125
+ generate({
126
+ generator: new ZodGenerator(),
127
+ inputFilePaths,
128
+ outputFilePath,
129
+ });
130
+ },
131
+ }),
117
132
  },
118
133
  name: "generate",
119
134
  }),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "shaclmate": "dist/cli.js"
4
4
  },
5
5
  "dependencies": {
6
- "@shaclmate/compiler": "4.0.6",
6
+ "@shaclmate/compiler": "4.0.8",
7
7
  "@rdfjs/prefix-map": "~0.1.2",
8
8
  "@rdfjs/types": "~2.0.1",
9
9
  "@types/n3": "~1.26.0",
@@ -51,5 +51,5 @@
51
51
  },
52
52
  "type": "module",
53
53
  "types": "./dist/index.d.ts",
54
- "version": "4.0.6"
54
+ "version": "4.0.8"
55
55
  }