Generate script works

main
Jackson Morgan 9 months ago
parent f0c9b2b19c
commit c762abbb67
  1. 2
      packages/cli/.gitignore
  2. 19
      packages/cli/example-create/.shapes/foafProfile.shex
  3. 1601
      packages/cli/example-create/package-lock.json
  4. 21
      packages/cli/example-create/package.json
  5. 2
      packages/cli/src/generateReadme.ts
  6. 2
      packages/cli/src/init.ts

@ -1,2 +1,2 @@
./example-create
example-create
./example-init

@ -1,19 +0,0 @@
# This shape is provided by default as an example
# You can create your own shape to fit your needs using ShEx (https://shex.io)
# Also check out https://shaperepo.com for examples of more shapes.
PREFIX ex: <https://example.com/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
ex:FoafProfile EXTRA a {
a [ foaf:Person ]
// rdfs:comment "Defines the node as a Person (from foaf)" ;
foaf:name xsd:string ?
// rdfs:comment "Define a person's name." ;
foaf:img xsd:string ?
// rdfs:comment "Photo link but in string form" ;
foaf:knows @ex:FoafProfile *
// rdfs:comment "A list of WebIds for all the people this user knows." ;
}

File diff suppressed because it is too large Load Diff

@ -1,21 +0,0 @@
{
"name": "example-create",
"version": "1.0.0",
"description": "",
"keywords": [
""
],
"author": "",
"license": "MIT",
"dependencies": {
"@ldo/ldo": "^0.0.1-alpha.28"
},
"devDependencies": {
"@ldo/cli": "^0.0.1-alpha.28",
"@types/jsonld": "^1.5.15",
"@types/shexj": "^2.1.7"
},
"scripts": {
"build:ldo": "ldo build --input example-create/.shapes --output example-create/.ldo"
}
}

@ -32,7 +32,7 @@ export async function generateReadme(options: GenerateReadmeOptions) {
const shapes: ReadmeEjsOptions["shapes"] = [];
await forAllShapes(options.shapes, async (fileName, shexC) => {
const typeFilePath = path.join(options.shapes, `${fileName}.typings.ts`);
const typeFilePath = path.join(options.ldo, `${fileName}.typings.ts`);
const typesRaw = await fs.readFile(typeFilePath, "utf8");

@ -73,5 +73,5 @@ export async function init(initOptions: InitOptions) {
});
// Build LDO
await exec("npm run build:ldo");
await exec(`cd ${parentDirectory} && npm run build:ldo`);
}

Loading…
Cancel
Save