@ldo/cli 0.0.1-alpha.16 → 0.0.1-alpha.18
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/LICENSE.txt +21 -0
- package/README.md +53 -11
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +2 -2
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Jackson Morgan
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,26 +1,68 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ldo/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `@ldo/cli` is a command line interface for initializing LDO and building ShapeTypes.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
### Automatic Setup
|
|
8
|
+
To setup LDO, `cd` into your typescript project and run `npx @ldo/cli init`.
|
|
7
9
|
|
|
8
10
|
```bash
|
|
9
|
-
|
|
11
|
+
cd my-typescript-project
|
|
12
|
+
npx @ldo/cli init
|
|
10
13
|
```
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
### Manual Setup
|
|
16
|
+
The following is handled by the __automatic setup__:
|
|
17
|
+
|
|
18
|
+
Install the LDO dependencies.
|
|
19
|
+
```bash
|
|
20
|
+
npm install @ldo/ldo
|
|
21
|
+
npm install @ldo/cli --save-dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Create a folder to store your ShEx shapes:
|
|
13
25
|
```bash
|
|
14
26
|
mkdir shapes
|
|
15
27
|
```
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
Create a script to build ShEx shapes and convert them into Linked Data Objects. You can put this script in `package.json`
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
...
|
|
33
|
+
scripts: {
|
|
34
|
+
...
|
|
35
|
+
"build:ldo": "ldo build --input ./shapes --output ./ldo"
|
|
36
|
+
...
|
|
37
|
+
}
|
|
38
|
+
...
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Generating a ShapeType
|
|
43
|
+
|
|
44
|
+
@ldo/cli generates shape types using the `*.shex` files in the "input" folder. If you followed the instructions above, run the following command:
|
|
18
45
|
|
|
19
46
|
```bash
|
|
20
|
-
|
|
47
|
+
npm run build:ldo
|
|
21
48
|
```
|
|
22
49
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
50
|
+
This will generate five files:
|
|
51
|
+
- `./ldo/foafProfile.shapeTypes.ts` <-- This is the important file
|
|
52
|
+
- `./ldo/foafProfile.typings.ts`
|
|
53
|
+
- `./ldo/foafProfile.schema.ts`
|
|
54
|
+
- `./ldo/foafProfile.context.ts`
|
|
55
|
+
|
|
56
|
+
## API Details
|
|
57
|
+
- [`init` command](https://ldo.js.org/api/cli/init/)
|
|
58
|
+
- [`build` command](https://ldo.js.org/api/cli/build/)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Sponsorship
|
|
62
|
+
This project was made possible by a grant from NGI Zero Entrust via nlnet. Learn more on the [NLnet project page](https://nlnet.nl/project/SolidUsableApps/).
|
|
63
|
+
|
|
64
|
+
[<img src="https://nlnet.nl/logo/banner.png" alt="nlnet foundation logo" width="300" />](https://nlnet.nl/)
|
|
65
|
+
[<img src="https://nlnet.nl/image/logos/NGI0Entrust_tag.svg" alt="NGI Zero Entrust Logo" width="300" />](https://nlnet.nl/)
|
|
66
|
+
|
|
67
|
+
## Liscense
|
|
68
|
+
MIT
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,8 @@ commander_1.program
|
|
|
11
11
|
commander_1.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_1.build);
|
|
17
17
|
commander_1.program
|
|
18
18
|
.command("init")
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,mCAAgC;AAChC,iCAA8B;AAE9B,mBAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,yCAAyC,CAAC;KACtD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,mBAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,yBAAyB,EAAE,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,mCAAgC;AAChC,iCAA8B;AAE9B,mBAAO;KACJ,IAAI,CAAC,SAAS,CAAC;KACf,WAAW,CAAC,yCAAyC,CAAC;KACtD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,mBAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,kDAAkD,CAAC;KAC/D,MAAM,CAAC,yBAAyB,EAAE,wBAAwB,EAAE,WAAW,CAAC;KACxE,MAAM,CAAC,2BAA2B,EAAE,yBAAyB,EAAE,QAAQ,CAAC;KACxE,MAAM,CAAC,aAAK,CAAC,CAAC;AAEjB,mBAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,MAAM,CAAC,iBAAiB,EAAE,kCAAkC,CAAC;KAC7D,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,WAAI,CAAC,CAAC;AAEhB,mBAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/cli",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.18",
|
|
4
4
|
"description": "A Command Line Interface for Linked Data Objects",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"start": "node dist/index.js build",
|
|
11
11
|
"start:init": "node dist/index.js init",
|
|
12
12
|
"dev": "npm run build && npm run start:init",
|
|
13
|
-
"build": "npm run clean && npm run build:ts && npm run copy-files
|
|
13
|
+
"build": "npm run clean && npm run build:ts && npm run copy-files",
|
|
14
14
|
"build:ts": "tsc --project tsconfig.build.json",
|
|
15
15
|
"clean": "rimraf dist/",
|
|
16
16
|
"copy-files": "copyfiles -u 1 \"./src/**/*.ejs\" dist/",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"ts-jest": "^27.0.7"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ldo/schema-converter-shex": "^0.0.1-alpha.
|
|
46
|
+
"@ldo/schema-converter-shex": "^0.0.1-alpha.17",
|
|
47
47
|
"@shexjs/parser": "^1.0.0-alpha.24",
|
|
48
48
|
"child-process-promise": "^2.2.1",
|
|
49
49
|
"commander": "^9.3.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "c06ff354da1183415c4139224123925c351b83fd"
|
|
63
63
|
}
|
package/src/index.ts
CHANGED
|
@@ -12,8 +12,8 @@ program
|
|
|
12
12
|
program
|
|
13
13
|
.command("build")
|
|
14
14
|
.description("Build contents of a shex folder into Shape Types")
|
|
15
|
-
.option("-i, --input <inputPath>", "Provide the input path", "
|
|
16
|
-
.option("-o, --output <outputPath>", "Provide the output path", "
|
|
15
|
+
.option("-i, --input <inputPath>", "Provide the input path", "./.shapes")
|
|
16
|
+
.option("-o, --output <outputPath>", "Provide the output path", "./.ldo")
|
|
17
17
|
.action(build);
|
|
18
18
|
|
|
19
19
|
program
|