@shaclmate/cli 4.0.19 → 4.0.20
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/dist/cli.js +3 -2
- package/dist/commands/generate.js +2 -1
- package/dist/commands/parseInputs.js +4 -4
- package/dist/logger.js +2 -1
- package/package.json +4 -5
package/dist/cli.js
CHANGED
|
@@ -6,6 +6,7 @@ import { ExistingPath } from "cmd-ts/dist/cjs/batteries/fs.js";
|
|
|
6
6
|
import { generate } from "./commands/generate.js";
|
|
7
7
|
import { merge } from "./commands/merge.js";
|
|
8
8
|
import { validate } from "./commands/validate.js";
|
|
9
|
+
import { logger } from "./logger.js";
|
|
9
10
|
const inputPaths = restPositionals({
|
|
10
11
|
displayName: "inputPaths",
|
|
11
12
|
description: "paths to RDF files or directories of RDF files containing SHACL shapes",
|
|
@@ -71,7 +72,7 @@ run(subcommands({
|
|
|
71
72
|
},
|
|
72
73
|
handler: async ({ inputPaths, outputFilePath }) => {
|
|
73
74
|
(await generate({
|
|
74
|
-
generator: new TsGenerator(),
|
|
75
|
+
generator: new TsGenerator({ logger }),
|
|
75
76
|
inputPaths,
|
|
76
77
|
outputFilePath,
|
|
77
78
|
})).unsafeCoerce();
|
|
@@ -86,7 +87,7 @@ run(subcommands({
|
|
|
86
87
|
},
|
|
87
88
|
handler: async ({ inputPaths, outputFilePath }) => {
|
|
88
89
|
(await generate({
|
|
89
|
-
generator: new ZodGenerator(),
|
|
90
|
+
generator: new ZodGenerator({ logger }),
|
|
90
91
|
inputPaths,
|
|
91
92
|
outputFilePath,
|
|
92
93
|
})).unsafeCoerce();
|
|
@@ -3,6 +3,7 @@ import Serializer from "@rdfjs/serializer-turtle";
|
|
|
3
3
|
import { Compiler, ShapesGraph } from "@shaclmate/compiler";
|
|
4
4
|
import { EitherAsync } from "purify-ts";
|
|
5
5
|
import SHACLValidator from "rdf-validate-shacl";
|
|
6
|
+
import { logger } from "../logger.js";
|
|
6
7
|
import { parseInputs } from "./parseInputs.js";
|
|
7
8
|
import { shaclShaclDataset } from "./shaclShaclDataset.js";
|
|
8
9
|
export async function generate({ generator, inputPaths, outputFilePath, }) {
|
|
@@ -24,7 +25,7 @@ export async function generate({ generator, inputPaths, outputFilePath, }) {
|
|
|
24
25
|
const output = await liftEither(ShapesGraph.builder()
|
|
25
26
|
.parseDataset(dataset, { prefixMap })
|
|
26
27
|
.map((_) => _.build())
|
|
27
|
-
.chain((shapesGraph) => new Compiler({ generator }).compile(shapesGraph)));
|
|
28
|
+
.chain((shapesGraph) => new Compiler({ generator, logger }).compile(shapesGraph)));
|
|
28
29
|
if (outputFilePath.length === 0) {
|
|
29
30
|
process.stdout.write(output);
|
|
30
31
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import DatasetFactory from "@rdfjs/dataset";
|
|
1
|
+
import datasetFactory from "@rdfjs/dataset";
|
|
3
2
|
import PrefixMap from "@rdfjs/prefix-map/PrefixMap.js";
|
|
3
|
+
import dataFactory from "@rdfx/data-factory";
|
|
4
4
|
import { RdfDirectory, RdfFileSystemEntry } from "@rdfx/fs";
|
|
5
5
|
import { Either, EitherAsync, Left } from "purify-ts";
|
|
6
6
|
import { logger } from "../logger.js";
|
|
7
7
|
export async function parseInputs(inputPaths) {
|
|
8
8
|
return EitherAsync(async ({ liftEither }) => {
|
|
9
|
-
const dataset =
|
|
9
|
+
const dataset = datasetFactory.dataset();
|
|
10
10
|
const prefixMapInit = [];
|
|
11
11
|
for (const inputPath of inputPaths) {
|
|
12
12
|
const parseInputFileSystemEntry = async (inputFileSystemEntry) => {
|
|
@@ -42,7 +42,7 @@ export async function parseInputs(inputPaths) {
|
|
|
42
42
|
}
|
|
43
43
|
return {
|
|
44
44
|
dataset,
|
|
45
|
-
prefixMap: new PrefixMap(prefixMapInit, { factory:
|
|
45
|
+
prefixMap: new PrefixMap(prefixMapInit, { factory: dataFactory }),
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
48
|
}
|
package/dist/logger.js
CHANGED
package/package.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"shaclmate": "dist/cli.js"
|
|
4
4
|
},
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@shaclmate/compiler": "4.0.
|
|
7
|
-
"@rdfjs/data-model": "~2.1.1",
|
|
6
|
+
"@shaclmate/compiler": "4.0.20",
|
|
8
7
|
"@rdfjs/dataset": "~2.0.2",
|
|
9
8
|
"@rdfjs/prefix-map": "~0.1.2",
|
|
10
9
|
"@rdfjs/serializer-turtle": "~1.1.5",
|
|
11
|
-
"@rdfx/
|
|
10
|
+
"@rdfx/data-factory": "0.0.11",
|
|
11
|
+
"@rdfx/fs": "0.0.11",
|
|
12
12
|
"cmd-ts": "~0.15.0",
|
|
13
13
|
"pino": "~9.1.0",
|
|
14
14
|
"pino-pretty": "~13.1.2",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"description": "Command line program to generate TypeScript code from SHACL shapes",
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@rdfjs/types": "~2.0.1",
|
|
23
|
-
"@types/rdfjs__data-model": "~2.0.9",
|
|
24
23
|
"@types/rdfjs__dataset": "~2.0.7",
|
|
25
24
|
"@types/rdfjs__prefix-map": "~0.1.5",
|
|
26
25
|
"@types/which": "~3.0.4"
|
|
@@ -56,5 +55,5 @@
|
|
|
56
55
|
},
|
|
57
56
|
"type": "module",
|
|
58
57
|
"types": "./dist/index.d.ts",
|
|
59
|
-
"version": "4.0.
|
|
58
|
+
"version": "4.0.20"
|
|
60
59
|
}
|