@ldo/cli 1.0.0-alpha.36 → 1.0.0-alpha.38
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/create.js +3 -3
- package/dist/generateReadme.js +1 -1
- package/dist/index.js +4 -4
- package/dist/init.js +2 -2
- package/dist/templates/readme/projectIndex.ejs +1 -1
- package/package.json +4 -4
- package/src/create.ts +3 -3
- package/src/generateReadme.ts +1 -1
- package/src/index.ts +4 -4
- package/src/init.ts +2 -2
- package/src/templates/readme/projectIndex.ejs +1 -1
package/dist/create.js
CHANGED
|
@@ -83,15 +83,15 @@ export async function create(directory) {
|
|
|
83
83
|
packageJson.scripts = {};
|
|
84
84
|
packageJson.scripts.prepublish =
|
|
85
85
|
"npm run build:ldo && npm run generate-readme";
|
|
86
|
-
packageJson.scripts["generate-readme"] = `ldo generate-readme --project ./ --shapes
|
|
86
|
+
packageJson.scripts["generate-readme"] = `ldo generate-readme --project ./ --shapes ./_shapes --ldo ./_ldo`;
|
|
87
87
|
return packageJson;
|
|
88
88
|
});
|
|
89
89
|
// Generate ReadMe
|
|
90
90
|
load.text = "Generating README";
|
|
91
91
|
await generateReadme({
|
|
92
92
|
project: directory,
|
|
93
|
-
shapes: path.join(directory, "
|
|
94
|
-
ldo: path.join(directory, "
|
|
93
|
+
shapes: path.join(directory, "_shapes"),
|
|
94
|
+
ldo: path.join(directory, "_ldo"),
|
|
95
95
|
});
|
|
96
96
|
// Create .gitignore
|
|
97
97
|
load.text = "Create .gitignore";
|
package/dist/generateReadme.js
CHANGED
|
@@ -53,7 +53,7 @@ function listInterfaces(filePath) {
|
|
|
53
53
|
return interfaces;
|
|
54
54
|
}
|
|
55
55
|
export async function generateIndex(options) {
|
|
56
|
-
const ldoDir = await fs.readdir(path.join(options.project, "
|
|
56
|
+
const ldoDir = await fs.readdir(path.join(options.project, "./_ldo"), {
|
|
57
57
|
withFileTypes: true,
|
|
58
58
|
});
|
|
59
59
|
const indexText = await renderFile(path.join(__dirname, "./templates/readme/projectIndex.ejs"), { fileNames: ldoDir.map((file) => file.name) });
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,8 @@ program
|
|
|
11
11
|
program
|
|
12
12
|
.command("build")
|
|
13
13
|
.description("Build contents of a shex folder into Shape Types")
|
|
14
|
-
.option("-i, --input <inputPath>", "Provide the input path", "
|
|
15
|
-
.option("-o, --output <outputPath>", "Provide the output path", "
|
|
14
|
+
.option("-i, --input <inputPath>", "Provide the input path", "./_shapes")
|
|
15
|
+
.option("-o, --output <outputPath>", "Provide the output path", "./_ldo")
|
|
16
16
|
.action(build);
|
|
17
17
|
program
|
|
18
18
|
.command("init")
|
|
@@ -28,8 +28,8 @@ program
|
|
|
28
28
|
.command("generate-readme")
|
|
29
29
|
.description("Create a ReadMe from the shapes and generated code.")
|
|
30
30
|
.requiredOption("-p, --project <projectPath>", "Provide the path to the root project", "./")
|
|
31
|
-
.requiredOption("-s, --shapes <shapesPath>", "Provide the path to the shapes folder", "
|
|
32
|
-
.requiredOption("-s, --ldo <ldoPath>", "Provide the path to the ldo folder", "
|
|
31
|
+
.requiredOption("-s, --shapes <shapesPath>", "Provide the path to the shapes folder", "./_shapes")
|
|
32
|
+
.requiredOption("-s, --ldo <ldoPath>", "Provide the path to the ldo folder", "./_ldo")
|
|
33
33
|
.action(generateReadme);
|
|
34
34
|
program.parse();
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/dist/init.js
CHANGED
|
@@ -8,8 +8,8 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
9
9
|
// @ts-ignore
|
|
10
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
|
-
const DEFAULT_SHAPES_FOLDER = "
|
|
12
|
-
const DEFAULT_LDO_FOLDER = "
|
|
11
|
+
const DEFAULT_SHAPES_FOLDER = "./_shapes";
|
|
12
|
+
const DEFAULT_LDO_FOLDER = "./_ldo";
|
|
13
13
|
const POTENTIAL_PARENT_DIRECTORIES = ["src", "lib", "bin"];
|
|
14
14
|
export async function init(directory) {
|
|
15
15
|
// Find folder to save to
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<% fileNames.forEach((fileName) => { %>export * from "
|
|
1
|
+
<% fileNames.forEach((fileName) => { %>export * from "./_ldo/<%- fileName %>";
|
|
2
2
|
<% }); %>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.38",
|
|
4
4
|
"description": "A Command Line Interface for Linked Data Objects",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@jeswr/shacl2shex": "^1.1.0",
|
|
44
|
-
"@ldo/ldo": "^1.0.0-alpha.
|
|
45
|
-
"@ldo/schema-converter-shex": "^1.0.0-alpha.
|
|
44
|
+
"@ldo/ldo": "^1.0.0-alpha.38",
|
|
45
|
+
"@ldo/schema-converter-shex": "^1.0.0-alpha.38",
|
|
46
46
|
"@shexjs/parser": "^1.0.0-alpha.24",
|
|
47
47
|
"child-process-promise": "^2.2.1",
|
|
48
48
|
"commander": "^9.3.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c09a1e1c1c5eee9682e141e0657e4bef3b9973b9"
|
|
67
67
|
}
|
package/src/create.ts
CHANGED
|
@@ -99,7 +99,7 @@ export async function create(directory: string) {
|
|
|
99
99
|
"npm run build:ldo && npm run generate-readme";
|
|
100
100
|
packageJson.scripts[
|
|
101
101
|
"generate-readme"
|
|
102
|
-
] = `ldo generate-readme --project ./ --shapes
|
|
102
|
+
] = `ldo generate-readme --project ./ --shapes ./_shapes --ldo ./_ldo`;
|
|
103
103
|
return packageJson;
|
|
104
104
|
});
|
|
105
105
|
|
|
@@ -107,8 +107,8 @@ export async function create(directory: string) {
|
|
|
107
107
|
load.text = "Generating README";
|
|
108
108
|
await generateReadme({
|
|
109
109
|
project: directory,
|
|
110
|
-
shapes: path.join(directory, "
|
|
111
|
-
ldo: path.join(directory, "
|
|
110
|
+
shapes: path.join(directory, "_shapes"),
|
|
111
|
+
ldo: path.join(directory, "_ldo"),
|
|
112
112
|
});
|
|
113
113
|
|
|
114
114
|
// Create .gitignore
|
package/src/generateReadme.ts
CHANGED
|
@@ -96,7 +96,7 @@ interface GenerateIndexOptions {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export async function generateIndex(options: GenerateIndexOptions) {
|
|
99
|
-
const ldoDir = await fs.readdir(path.join(options.project, "
|
|
99
|
+
const ldoDir = await fs.readdir(path.join(options.project, "./_ldo"), {
|
|
100
100
|
withFileTypes: true,
|
|
101
101
|
});
|
|
102
102
|
const indexText = await renderFile(
|
package/src/index.ts
CHANGED
|
@@ -14,8 +14,8 @@ program
|
|
|
14
14
|
program
|
|
15
15
|
.command("build")
|
|
16
16
|
.description("Build contents of a shex folder into Shape Types")
|
|
17
|
-
.option("-i, --input <inputPath>", "Provide the input path", "
|
|
18
|
-
.option("-o, --output <outputPath>", "Provide the output path", "
|
|
17
|
+
.option("-i, --input <inputPath>", "Provide the input path", "./_shapes")
|
|
18
|
+
.option("-o, --output <outputPath>", "Provide the output path", "./_ldo")
|
|
19
19
|
.action(build);
|
|
20
20
|
|
|
21
21
|
program
|
|
@@ -41,12 +41,12 @@ program
|
|
|
41
41
|
.requiredOption(
|
|
42
42
|
"-s, --shapes <shapesPath>",
|
|
43
43
|
"Provide the path to the shapes folder",
|
|
44
|
-
"
|
|
44
|
+
"./_shapes",
|
|
45
45
|
)
|
|
46
46
|
.requiredOption(
|
|
47
47
|
"-s, --ldo <ldoPath>",
|
|
48
48
|
"Provide the path to the ldo folder",
|
|
49
|
-
"
|
|
49
|
+
"./_ldo",
|
|
50
50
|
)
|
|
51
51
|
.action(generateReadme);
|
|
52
52
|
|
package/src/init.ts
CHANGED
|
@@ -10,8 +10,8 @@ import { fileURLToPath } from "node:url";
|
|
|
10
10
|
// @ts-ignore
|
|
11
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
|
|
13
|
-
const DEFAULT_SHAPES_FOLDER = "
|
|
14
|
-
const DEFAULT_LDO_FOLDER = "
|
|
13
|
+
const DEFAULT_SHAPES_FOLDER = "./_shapes";
|
|
14
|
+
const DEFAULT_LDO_FOLDER = "./_ldo";
|
|
15
15
|
const POTENTIAL_PARENT_DIRECTORIES = ["src", "lib", "bin"];
|
|
16
16
|
|
|
17
17
|
export async function init(directory?: string) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
<% fileNames.forEach((fileName) => { %>export * from "
|
|
1
|
+
<% fileNames.forEach((fileName) => { %>export * from "./_ldo/<%- fileName %>";
|
|
2
2
|
<% }); %>
|