@shaclmate/compiler 2.0.12
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/ShapesGraphToAstTransformer.d.ts +32 -0
- package/ShapesGraphToAstTransformer.js +461 -0
- package/ast/Ast.d.ts +5 -0
- package/ast/Ast.js +2 -0
- package/ast/IdentifierType.d.ts +13 -0
- package/ast/IdentifierType.js +2 -0
- package/ast/IntersectionType.d.ts +9 -0
- package/ast/IntersectionType.js +2 -0
- package/ast/LiteralType.d.ts +13 -0
- package/ast/LiteralType.js +2 -0
- package/ast/MintingStrategy.d.ts +8 -0
- package/ast/MintingStrategy.js +9 -0
- package/ast/Name.d.ts +13 -0
- package/ast/Name.js +2 -0
- package/ast/ObjectType.d.ts +88 -0
- package/ast/ObjectType.js +2 -0
- package/ast/OptionType.d.ts +11 -0
- package/ast/OptionType.js +2 -0
- package/ast/SetType.d.ts +12 -0
- package/ast/SetType.js +2 -0
- package/ast/Type.d.ts +9 -0
- package/ast/Type.js +2 -0
- package/ast/UnionType.d.ts +9 -0
- package/ast/UnionType.js +2 -0
- package/ast/index.d.ts +10 -0
- package/ast/index.js +10 -0
- package/generators/index.d.ts +3 -0
- package/generators/index.js +3 -0
- package/generators/json/AstJsonGenerator.d.ts +7 -0
- package/generators/json/AstJsonGenerator.js +103 -0
- package/generators/json/index.d.ts +2 -0
- package/generators/json/index.js +2 -0
- package/generators/ts/BooleanType.d.ts +7 -0
- package/generators/ts/BooleanType.js +13 -0
- package/generators/ts/Configuration.d.ts +29 -0
- package/generators/ts/Configuration.js +40 -0
- package/generators/ts/IdentifierType.d.ts +23 -0
- package/generators/ts/IdentifierType.js +83 -0
- package/generators/ts/IntersectionType.d.ts +14 -0
- package/generators/ts/IntersectionType.js +26 -0
- package/generators/ts/ListType.d.ts +26 -0
- package/generators/ts/ListType.js +119 -0
- package/generators/ts/LiteralType.d.ts +14 -0
- package/generators/ts/LiteralType.js +61 -0
- package/generators/ts/NumberType.d.ts +7 -0
- package/generators/ts/NumberType.js +13 -0
- package/generators/ts/ObjectType.d.ts +71 -0
- package/generators/ts/ObjectType.js +160 -0
- package/generators/ts/OptionType.d.ts +17 -0
- package/generators/ts/OptionType.js +83 -0
- package/generators/ts/PrimitiveType.d.ts +11 -0
- package/generators/ts/PrimitiveType.js +41 -0
- package/generators/ts/RdfjsTermType.d.ts +25 -0
- package/generators/ts/RdfjsTermType.js +46 -0
- package/generators/ts/SetType.d.ts +19 -0
- package/generators/ts/SetType.js +76 -0
- package/generators/ts/StringType.d.ts +7 -0
- package/generators/ts/StringType.js +13 -0
- package/generators/ts/TsGenerator.d.ts +15 -0
- package/generators/ts/TsGenerator.js +119 -0
- package/generators/ts/Type.d.ts +108 -0
- package/generators/ts/Type.js +83 -0
- package/generators/ts/TypeFactory.d.ts +15 -0
- package/generators/ts/TypeFactory.js +198 -0
- package/generators/ts/UnionType.d.ts +18 -0
- package/generators/ts/UnionType.js +165 -0
- package/generators/ts/_ObjectType/IdentifierProperty.d.ts +23 -0
- package/generators/ts/_ObjectType/IdentifierProperty.js +82 -0
- package/generators/ts/_ObjectType/Property.d.ts +38 -0
- package/generators/ts/_ObjectType/Property.js +11 -0
- package/generators/ts/_ObjectType/ShaclProperty.d.ts +25 -0
- package/generators/ts/_ObjectType/ShaclProperty.js +106 -0
- package/generators/ts/_ObjectType/TypeDiscriminatorProperty.d.ts +29 -0
- package/generators/ts/_ObjectType/TypeDiscriminatorProperty.js +53 -0
- package/generators/ts/_ObjectType/classDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/classDeclaration.js +154 -0
- package/generators/ts/_ObjectType/equalsFunctionDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/equalsFunctionDeclaration.js +27 -0
- package/generators/ts/_ObjectType/fromRdfFunctionDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/fromRdfFunctionDeclaration.js +72 -0
- package/generators/ts/_ObjectType/hashFunctionDeclaration.d.ts +5 -0
- package/generators/ts/_ObjectType/hashFunctionDeclaration.js +64 -0
- package/generators/ts/_ObjectType/index.d.ts +12 -0
- package/generators/ts/_ObjectType/index.js +12 -0
- package/generators/ts/_ObjectType/interfaceDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/interfaceDeclaration.js +12 -0
- package/generators/ts/_ObjectType/sparqlGraphPatternsClassDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/sparqlGraphPatternsClassDeclaration.js +46 -0
- package/generators/ts/_ObjectType/toRdfFunctionDeclaration.d.ts +4 -0
- package/generators/ts/_ObjectType/toRdfFunctionDeclaration.js +53 -0
- package/generators/ts/index.d.ts +2 -0
- package/generators/ts/index.js +2 -0
- package/generators/ts/rdfjsTermExpression.d.ts +5 -0
- package/generators/ts/rdfjsTermExpression.js +15 -0
- package/generators/ts/stringToValidTsIdentifier.d.ts +2 -0
- package/generators/ts/stringToValidTsIdentifier.js +14 -0
- package/generators/ts/tsName.d.ts +3 -0
- package/generators/ts/tsName.js +22 -0
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/logger.d.ts +2 -0
- package/logger.js +8 -0
- package/package.json +71 -0
- package/vocabularies/dashDataset.d.ts +3 -0
- package/vocabularies/dashDataset.js +2370 -0
- package/vocabularies/index.d.ts +2 -0
- package/vocabularies/index.js +2 -0
- package/vocabularies/shaclmate.d.ts +15 -0
- package/vocabularies/shaclmate.js +6 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Resource } from "rdfjs-resource";
|
|
2
|
+
import { stringToValidTsIdentifier } from "./stringToValidTsIdentifier.js";
|
|
3
|
+
export function tsName(astName) {
|
|
4
|
+
for (const tsNameAlternative of [
|
|
5
|
+
astName.shaclmateName.extract(),
|
|
6
|
+
astName.shName.extract()?.replace(" ", "_"),
|
|
7
|
+
astName.curie.map((curie) => curie.replace(":", "_")).extract(),
|
|
8
|
+
astName.propertyPath
|
|
9
|
+
.chain((propertyPath) => propertyPath.curie.map((curie) => curie.replace(":", "_")))
|
|
10
|
+
.extract(),
|
|
11
|
+
astName.propertyPath
|
|
12
|
+
.map((propertyPath) => Resource.Identifier.toString(propertyPath.identifier))
|
|
13
|
+
.extract(),
|
|
14
|
+
Resource.Identifier.toString(astName.identifier),
|
|
15
|
+
]) {
|
|
16
|
+
if (tsNameAlternative) {
|
|
17
|
+
return stringToValidTsIdentifier(tsNameAlternative);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
throw new Error("should never reach this point");
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=tsName.js.map
|
package/index.d.ts
ADDED
package/index.js
ADDED
package/logger.d.ts
ADDED
package/logger.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { pino } from "pino";
|
|
2
|
+
export const logger = pino({
|
|
3
|
+
level: process.env["NODE_ENV"] === "development" ||
|
|
4
|
+
process.env["NODE_ENV"] === "test"
|
|
5
|
+
? "debug"
|
|
6
|
+
: "info",
|
|
7
|
+
}, pino["destination"] ? pino.destination(2) : undefined);
|
|
8
|
+
//# sourceMappingURL=logger.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"@rdfjs/prefix-map": "^0.1.2",
|
|
4
|
+
"@rdfjs/term-map": "^2.0.2",
|
|
5
|
+
"@rdfjs/term-set": "^2.0.3",
|
|
6
|
+
"@rdfjs/types": "^1.1.0",
|
|
7
|
+
"@sindresorhus/base62": "^0.1.0",
|
|
8
|
+
"@tpluscode/rdf-ns-builders": "^4.3.0",
|
|
9
|
+
"@types/n3": "^1.21.1",
|
|
10
|
+
"@types/rdfjs__prefix-map": "^0.1.5",
|
|
11
|
+
"@types/rdfjs__term-map": "^2.0.10",
|
|
12
|
+
"@types/rdfjs__term-set": "^2.0.9",
|
|
13
|
+
"change-case": "^5.4.4",
|
|
14
|
+
"n3": "^1.21.3",
|
|
15
|
+
"pino": "^9.1.0",
|
|
16
|
+
"reserved-identifiers": "^1.0.0",
|
|
17
|
+
"shacl-ast": "2.0.12",
|
|
18
|
+
"ts-invariant": "^0.10.3",
|
|
19
|
+
"ts-morph": "^24.0.0",
|
|
20
|
+
"typescript-memoize": "^1.1.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@shaclmate/runtime": "2.0.12"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"*.d.ts",
|
|
27
|
+
"*.js",
|
|
28
|
+
"ast/*.d.ts",
|
|
29
|
+
"ast/*.js",
|
|
30
|
+
"generators/*.d.ts",
|
|
31
|
+
"generators/*.js",
|
|
32
|
+
"generators/json/*.d.ts",
|
|
33
|
+
"generators/json/*.js",
|
|
34
|
+
"generators/ts/*.d.ts",
|
|
35
|
+
"generators/ts/*.js",
|
|
36
|
+
"generators/ts/_ObjectType/*.d.ts",
|
|
37
|
+
"generators/ts/_ObjectType/*.js",
|
|
38
|
+
"vocabularies/*.d.ts",
|
|
39
|
+
"vocabularies/*.js"
|
|
40
|
+
],
|
|
41
|
+
"main": "index.js",
|
|
42
|
+
"license": "Apache-2.0",
|
|
43
|
+
"name": "@shaclmate/compiler",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -b",
|
|
46
|
+
"check": "biome check",
|
|
47
|
+
"check:write": "biome check --write",
|
|
48
|
+
"check:write:unsafe": "biome check --write --unsafe",
|
|
49
|
+
"clean": "rimraf -g **/*.d.ts* **/*.js **/*.js.map tsconfig.tsbuildinfo",
|
|
50
|
+
"format": "biome format",
|
|
51
|
+
"format:write": "biome format --write",
|
|
52
|
+
"format:write:unsafe": "biome format --write --unsafe",
|
|
53
|
+
"rebuild": "run-s clean build",
|
|
54
|
+
"link-dependencies": "npm link purify-ts-helpers rdfjs-resource",
|
|
55
|
+
"lint": "biome lint",
|
|
56
|
+
"lint:write": "biome lint --write",
|
|
57
|
+
"lint:write:unsafe": "biome lint --write --unsafe",
|
|
58
|
+
"test": "biome check && vitest run",
|
|
59
|
+
"test:coverage": "biome check && vitest run --coverage",
|
|
60
|
+
"test:watch": "vitest watch",
|
|
61
|
+
"unlink": "npm unlink -g @shaclmate/compiler",
|
|
62
|
+
"watch": "tsc -w --preserveWatchOutput"
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "git+https://github.com/minorg/shaclmate"
|
|
67
|
+
},
|
|
68
|
+
"type": "module",
|
|
69
|
+
"types": "index.d.ts",
|
|
70
|
+
"version": "2.0.12"
|
|
71
|
+
}
|