lincd-cli 0.1.4 → 0.1.7

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.
Files changed (47) hide show
  1. package/LICENSE +373 -373
  2. package/README.md +24 -24
  3. package/defaults/app/index.html +12 -0
  4. package/defaults/app/package.json +30 -0
  5. package/defaults/app/src/App.tsx +5 -0
  6. package/defaults/app/src/index.tsx +10 -0
  7. package/defaults/create_migration.ts +3 -3
  8. package/defaults/defaultModule/Index.scss +16 -16
  9. package/defaults/defaultModule/Index.tsx +31 -24
  10. package/defaults/defaultModule/data.json +54 -54
  11. package/defaults/defaultModule/defaultOntology.json +21 -21
  12. package/defaults/defaultModule/index.ts +16 -12
  13. package/defaults/defaultModule/ontology.ts +18 -15
  14. package/defaults/gitignorefile +3 -3
  15. package/defaults/index.ts +17 -13
  16. package/defaults/module/package.json +30 -29
  17. package/defaults/module/src/components/ExampleComponent.tsx +10 -14
  18. package/defaults/module/src/data/example-ontology.json +18 -18
  19. package/defaults/module/src/module.ts +3 -8
  20. package/defaults/module/src/ontologies/example-ontology.ts +8 -10
  21. package/defaults/module/src/shapes/ExampleShapeClass.ts +20 -21
  22. package/defaults/ontology.ts +18 -15
  23. package/defaults/package.json +28 -28
  24. package/defaults/site/package.json +38 -38
  25. package/defaults/site/storage/filestores/settings-production-template.jsonld +128 -128
  26. package/defaults/site/web/.htaccess +19 -19
  27. package/lib/cli.js +332 -258
  28. package/lib/config-grunt.js +39 -45
  29. package/lib/config-webpack.js +34 -39
  30. package/lib/index.js +5 -1
  31. package/lib/plugins/declaration-plugin.js +22 -64
  32. package/lib/plugins/externalise-modules.js +23 -13
  33. package/lib/plugins/watch-run.js +1 -1
  34. package/lib/utils.js +7 -3
  35. package/package.json +76 -72
  36. package/defaults/.npmignore +0 -11
  37. package/defaults/Gruntfile.js +0 -16
  38. package/defaults/module/Gruntfile.js +0 -16
  39. package/defaults/module/tsconfig-es5.json +0 -19
  40. package/defaults/module/tsconfig.json +0 -19
  41. package/defaults/site/.gitignore +0 -8
  42. package/defaults/site/.npmignore +0 -10
  43. package/defaults/site/lib/start-server.js +0 -22
  44. package/defaults/site/lib/test-server.js +0 -10
  45. package/defaults/site/storage/filestores/settings-development.jsonld +0 -117
  46. package/defaults/tsconfig-es5.json +0 -18
  47. package/defaults/tsconfig.json +0 -20
@@ -2,11 +2,13 @@ import {NamedNode} from 'lincd/lib/models';
2
2
  import {JSONLD} from 'lincd-jsonld/lib/JSONLD';
3
3
  import {createNameSpace} from 'lincd/lib/utils/NameSpace';
4
4
  import {linkedOntology} from '../module';
5
+ //finally, we pass on all the exports, plus the namespace, prefix and data loading function
6
+ // as we register this ontology in the LINCD tree
7
+ import * as _this from './example-ontology';
5
8
 
9
+ let dataFile = '../data/example-ontology.json';
6
10
  export var loadData = () => {
7
- return import('../data/example-ontology.json').then((data) =>
8
- JSONLD.parse(data),
9
- );
11
+ return import(dataFile).then((data) => JSONLD.parse(data));
10
12
  };
11
13
 
12
14
  export var ns = createNameSpace('${uri_base}');
@@ -20,14 +22,10 @@ export var ExampleClass: NamedNode = ns('ExampleClass');
20
22
  export var exampleName: NamedNode = ns('exampleName');
21
23
 
22
24
  export const exampleOntology = {
23
- ExampleClass,
24
- exampleName,
25
+ ExampleClass,
26
+ exampleName,
25
27
  };
26
28
 
27
- //finally, we pass on all the exports, plus the namespace, prefix and data loading function
28
- // as we register this ontology in the LINCD tree
29
- import * as _this from './example-ontology';
30
-
31
29
  //as third parameter, provide a prefix (string) that can be used to refer to the full ontology URL.
32
30
  //for example: 'schema' refers to https://www.schema.org/
33
- linkedOntology(_this, ns, 'exampl', loadData);
31
+ linkedOntology(_this, ns, 'exampl', loadData, dataFile);
@@ -1,30 +1,29 @@
1
1
  import {Shape} from 'lincd/lib/shapes/Shape';
2
- import {NamedNode} from 'lincd/lib/models';
2
+ import {Literal, NamedNode} from 'lincd/lib/models';
3
3
  import {linkedShape} from '../module';
4
4
  import {literalProperty} from 'lincd/lib/utils/ShapeDecorators';
5
- import {Literal} from 'lincd/lib/models';
6
- import {schema} from 'lincd-schema/lib/ontologies/schema';
7
5
  import {exampleOntology} from '../ontologies/example-ontology';
8
6
 
9
7
  @linkedShape
10
8
  export class ExampleShapeClass extends Shape {
11
- /**
12
- * indicates that instances of this shape need to have this rdf.type
13
- */
14
- static targetClass: NamedNode = exampleOntology.ExampleClass;
9
+ /**
10
+ * indicates that instances of this shape need to have this rdf.type
11
+ */
12
+ static targetClass: NamedNode = exampleOntology.ExampleClass;
15
13
 
16
- /**
17
- * instances of this shape need to have exactly one value defined for the given property
18
- */
19
- @literalProperty({
20
- path: exampleOntology.exampleName,
21
- required: true,
22
- maxCount: 1,
23
- })
24
- get name() {
25
- return this.getValue(exampleOntology.exampleName);
26
- }
27
- set name(val: string) {
28
- this.overwrite(exampleOntology.exampleName, new Literal(val));
29
- }
14
+ /**
15
+ * instances of this shape need to have exactly one value defined for the given property
16
+ */
17
+ @literalProperty({
18
+ path: exampleOntology.exampleName,
19
+ required: true,
20
+ maxCount: 1,
21
+ })
22
+ get name() {
23
+ return this.getValue(exampleOntology.exampleName);
24
+ }
25
+
26
+ set name(val: string) {
27
+ this.overwrite(exampleOntology.exampleName, new Literal(val));
28
+ }
30
29
  }
@@ -1,16 +1,19 @@
1
- import {UriResource} from "@dacore/core/lib/models";
2
-
3
- declare var require:any;
4
- import {JSONLD} from "@dacore/core/lib/utils/JSONLD";
5
- var base:string = "${uri_base}/ontology/${ontology_name}/";
6
- export var _ontologyResource:UriResource = UriResource.getOrCreate(base);
7
-
8
- var json = require('../../data/ontologies/${ontology_name}.json');
9
- export var _parsePromise:[UriResource,Promise<any>] = [_ontologyResource,JSONLD.parse(json,true,true) as Promise<any>];
10
-
11
- //add your ontology resources here
12
- // export var node:UriResource = UriResource.getOrCreate(base+"node");
13
-
14
- //make sure every node is also exported here
15
- var ${camel_ontology_name} = {};
1
+ import { UriResource } from "@dacore/core/lib/models";
2
+ import { JSONLD } from "@dacore/core/lib/utils/JSONLD";
3
+
4
+ declare var require: any;
5
+
6
+ var base: string = "${uri_base}/ontology/${ontology_name}/";
7
+ export var _ontologyResource: UriResource = UriResource.getOrCreate(base);
8
+
9
+ var json = require("../../data/ontologies/${ontology_name}.json");
10
+ export var _parsePromise: [UriResource,Promise<any>] = [_ontologyResource,JSONLD.parse(json,true,true) as Promise<any>];
11
+
12
+ //add your ontology resources here
13
+ // export var node:UriResource = UriResource.getOrCreate(base+"node");
14
+
15
+ //make sure every node is also exported here
16
+ var ${camel_ontology_name} =;
17
+ {}
18
+ ;
16
19
  export default ${camel_ontology_name};
@@ -1,28 +1,28 @@
1
- {
2
- "name": "@dacore/",
3
- "version": "0.1.0",
4
- "description": "",
5
- "lincd": true,
6
- "main": "lib/index.js",
7
- "author": "",
8
- "license": "ISC",
9
- "scripts": {
10
- "build": "npm exec lincd build",
11
- "dev": "npm exec lincd dev",
12
- "prepare": "npm exec lincd build production",
13
- "postpublish": "npm exec lincd publish"
14
- },
15
- "keywords": [
16
- "lincd",
17
- "linked data",
18
- "interoperable",
19
- "semantic web",
20
- "web3"
21
- ],
22
- "dependencies": {
23
- "lincd": "^0.1"
24
- },
25
- "devDependencies": {
26
- "lincd-cli": "^0.1"
27
- }
28
- }
1
+ {
2
+ "name": "@dacore/",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "lincd": true,
6
+ "main": "lib/index.js",
7
+ "author": "",
8
+ "license": "ISC",
9
+ "scripts": {
10
+ "build": "npm exec lincd build",
11
+ "dev": "npm exec lincd dev",
12
+ "prepare": "npm exec lincd build production",
13
+ "postpublish": "npm exec lincd publish"
14
+ },
15
+ "keywords": [
16
+ "lincd",
17
+ "linked data",
18
+ "interoperable",
19
+ "semantic web",
20
+ "web3"
21
+ ],
22
+ "dependencies": {
23
+ "lincd": "^0.2"
24
+ },
25
+ "devDependencies": {
26
+ "lincd-cli": "^0.1"
27
+ }
28
+ }
@@ -1,40 +1,40 @@
1
1
  {
2
- "private": true,
3
- "name": "${packageName}",
4
- "version": "0.2.0",
5
- "description": "Server for ${browserTitle}",
6
- "main": "lib/index.js",
7
- "license": "UNLICENSED",
8
- "scripts": {
9
- "dev": "node ./lib/start-server.js",
10
- "production": "set NODE_ENV=production&& node ./lib/start-server.js"
11
- },
12
- "directories": {
13
- "lib": "lib"
14
- },
15
- "workspaces": [
16
- "modules/*"
17
- ],
18
- "dependencies": {
19
- "@dacore/admin": "^0.2",
20
- "@dacore/auth": "^0.2",
21
- "@dacore/browser-core": "^0.2",
22
- "@dacore/core": "1.x",
23
- "@dacore/core-editors": "^0.2",
24
- "@dacore/coreviews": "^0.2",
25
- "@dacore/core-ui": "^0.2",
26
- "@dacore/dcterms": "^0.2",
27
- "@dacore/forms": "^0.2",
28
- "@dacore/html": "^0.2",
29
- "@dacore/icons": "^0.2",
30
- "@dacore/rdf4j": "^0.2",
31
- "@dacore/server-core": "^0.2",
32
- "@dacore/website": "^0.2",
33
- "@dacore/website-editors": "^0.2",
34
- "react": "^18.1",
35
- "react-dom": "^18.1"
36
- },
37
- "devDependencies": {
38
- "@dacore/build-tools": "1.x"
39
- }
2
+ "private": true,
3
+ "name": "${packageName}",
4
+ "version": "0.2.0",
5
+ "description": "Server for ${browserTitle}",
6
+ "main": "lib/index.js",
7
+ "license": "UNLICENSED",
8
+ "scripts": {
9
+ "dev": "node ./lib/start-server.js",
10
+ "production": "set NODE_ENV=production&& node ./lib/start-server.js"
11
+ },
12
+ "directories": {
13
+ "lib": "lib"
14
+ },
15
+ "workspaces": [
16
+ "modules/*"
17
+ ],
18
+ "dependencies": {
19
+ "@dacore/admin": "^0.2",
20
+ "@dacore/auth": "^0.2",
21
+ "@dacore/browser-core": "^0.2",
22
+ "@dacore/core": "1.x",
23
+ "@dacore/core-editors": "^0.2",
24
+ "@dacore/coreviews": "^0.2",
25
+ "@dacore/core-ui": "^0.2",
26
+ "@dacore/dcterms": "^0.2",
27
+ "@dacore/forms": "^0.2",
28
+ "@dacore/html": "^0.2",
29
+ "@dacore/icons": "^0.2",
30
+ "@dacore/rdf4j": "^0.2",
31
+ "@dacore/server-core": "^0.2",
32
+ "@dacore/website": "^0.2",
33
+ "@dacore/website-editors": "^0.2",
34
+ "react": "^18.1",
35
+ "react-dom": "^18.1"
36
+ },
37
+ "devDependencies": {
38
+ "@dacore/build-tools": "1.x"
39
+ }
40
40
  }
@@ -1,129 +1,129 @@
1
- {
2
- "@context": {
3
- "owl": "http://www.w3.org/2002/07/owl#",
4
- "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
5
- "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
6
- "xsd": "http://www.w3.org/2001/XMLSchema#",
7
- "core": "http://data.dacore.org/ontologies/core/",
8
- "module": "http://data.dacore.org/ontologies/module/",
9
- "storage": "http://data.dacore.org/ontologies/storage/",
10
- "rdf4j": "http://data.dacore.org/ontologies/rdf4j/",
11
- "node-core": "http://data.dacore.org/ontologies/node-core/",
12
- "server-core": "http://data.dacore.org/ontologies/server-core/",
13
- "browser-core": "http://data.dacore.org/ontologies/browser-core/"
14
- },
15
- "@graph": [
16
- {
17
- "@id": "dacore://store/main",
18
- "@type": [
19
- "rdf4j:RDF4JStore"
20
- ],
21
- "storage:publicEndPoint": [
22
- {
23
- "@value": "http://127.0.0.1:7200/repositories/${repositoryName}"
24
- }
25
- ]
26
- },
27
- {
28
- "@id": "dacore://system",
29
- "@type": "server-core:ServerCore",
30
- "rdfs:label" : "${projectName}",
31
- "server-core:serves": {
32
- "@id": "${uriBase}"
33
- },
34
- "server-core:port": "${port}",
35
- "core:uriBase": "${uriBase}",
36
- "storage:defaultStore": {
37
- "@id": "dacore://store/main"
38
- },
39
- "node-core:includeAtStartup": [
40
- "@dacore/node-core",
41
- "@dacore/rdf4j"
42
- ],
43
- "core:adminEmail": "${email}",
44
- "core:deployment": "development",
45
- "core:requiresSetup": {
46
- "@type": "xsd:boolean",
47
- "@value": "true"
48
- },
49
- "core:defaultModule": {
50
- "@id": "${defaultModuleUri}"
51
- },
52
- "core:defaultOntology": {
53
- "@id": "${defaultOntologyUri}"
54
- },
55
- "module:maintainsModule": [
56
- {
57
- "@id": "${defaultModuleUri}"
58
- }
59
- ],
60
- "module:installedModule": [
61
- {
62
- "@id": "http://data.dacore.org/module/core"
63
- },
64
- {
65
- "@id": "http://data.dacore.org/module/browser-core"
66
- },
67
- {
68
- "@id": "http://data.dacore.org/module/core-editors"
69
- },
70
- {
71
- "@id": "http://data.dacore.org/module/coreviews"
72
- },
73
- {
74
- "@id": "http://data.dacore.org/module/icons"
75
- },
76
- {
77
- "@id": "http://data.dacore.org/module/website"
78
- },
79
- {
80
- "@id": "http://data.dacore.org/module/bootstrap"
81
- },
82
- {
83
- "@id": "http://data.dacore.org/module/core-ui"
84
- },
85
- {
86
- "@id": "http://data.dacore.org/module/forms"
87
- },
88
- {
89
- "@id": "http://data.dacore.org/module/dcterms"
90
- },
91
- {
92
- "@id": "http://data.dacore.org/module/html"
93
- },
94
- {
95
- "@id": "http://data.dacore.org/module/rdf4j"
96
- },
97
- {
98
- "@id": "http://data.dacore.org/module/sparql"
99
- },
100
- {
101
- "@id": "http://data.dacore.org/module/typescript"
102
- },
103
- {
104
- "@id": "http://data.dacore.org/module/cli"
105
- },
106
- {
107
- "@id": "http://data.dacore.org/module/dacode"
108
- },
109
- {
110
- "@id": "http://data.dacore.org/module/server-core"
111
- },
112
- {
113
- "@id": "http://data.dacore.org/module/node-core"
114
- },
115
- {
116
- "@id": "http://data.dacore.org/module/admin"
117
- }
118
- ]
119
- },
120
- {
121
- "@id": "${uriBase}",
122
- "@type": "browser-core:BrowserCore",
123
- "core:uriBase": "${uriBase}",
124
- "core:deployment": "development",
125
- "browser-core:publicRoot": "${publicRoot}",
126
- "browser-core:browserTitle": "${projectName}"
127
- }
128
- ]
1
+ {
2
+ "@context": {
3
+ "owl": "http://www.w3.org/2002/07/owl#",
4
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
5
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
6
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
7
+ "core": "http://data.dacore.org/ontologies/core/",
8
+ "module": "http://data.dacore.org/ontologies/module/",
9
+ "storage": "http://data.dacore.org/ontologies/storage/",
10
+ "rdf4j": "http://data.dacore.org/ontologies/rdf4j/",
11
+ "node-core": "http://data.dacore.org/ontologies/node-core/",
12
+ "server-core": "http://data.dacore.org/ontologies/server-core/",
13
+ "browser-core": "http://data.dacore.org/ontologies/browser-core/"
14
+ },
15
+ "@graph": [
16
+ {
17
+ "@id": "dacore://store/main",
18
+ "@type": [
19
+ "rdf4j:RDF4JStore"
20
+ ],
21
+ "storage:publicEndPoint": [
22
+ {
23
+ "@value": "http://127.0.0.1:7200/repositories/${repositoryName}"
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "@id": "dacore://system",
29
+ "@type": "server-core:ServerCore",
30
+ "rdfs:label" : "${projectName}",
31
+ "server-core:serves": {
32
+ "@id": "${uriBase}"
33
+ },
34
+ "server-core:port": "${port}",
35
+ "core:uriBase": "${uriBase}",
36
+ "storage:defaultStore": {
37
+ "@id": "dacore://store/main"
38
+ },
39
+ "node-core:includeAtStartup": [
40
+ "@dacore/node-core",
41
+ "@dacore/rdf4j"
42
+ ],
43
+ "core:adminEmail": "${email}",
44
+ "core:deployment": "development",
45
+ "core:requiresSetup": {
46
+ "@type": "xsd:boolean",
47
+ "@value": "true"
48
+ },
49
+ "core:defaultModule": {
50
+ "@id": "${defaultModuleUri}"
51
+ },
52
+ "core:defaultOntology": {
53
+ "@id": "${defaultOntologyUri}"
54
+ },
55
+ "module:maintainsModule": [
56
+ {
57
+ "@id": "${defaultModuleUri}"
58
+ }
59
+ ],
60
+ "module:installedModule": [
61
+ {
62
+ "@id": "http://data.dacore.org/module/core"
63
+ },
64
+ {
65
+ "@id": "http://data.dacore.org/module/browser-core"
66
+ },
67
+ {
68
+ "@id": "http://data.dacore.org/module/core-editors"
69
+ },
70
+ {
71
+ "@id": "http://data.dacore.org/module/coreviews"
72
+ },
73
+ {
74
+ "@id": "http://data.dacore.org/module/icons"
75
+ },
76
+ {
77
+ "@id": "http://data.dacore.org/module/website"
78
+ },
79
+ {
80
+ "@id": "http://data.dacore.org/module/bootstrap"
81
+ },
82
+ {
83
+ "@id": "http://data.dacore.org/module/core-ui"
84
+ },
85
+ {
86
+ "@id": "http://data.dacore.org/module/forms"
87
+ },
88
+ {
89
+ "@id": "http://data.dacore.org/module/dcterms"
90
+ },
91
+ {
92
+ "@id": "http://data.dacore.org/module/html"
93
+ },
94
+ {
95
+ "@id": "http://data.dacore.org/module/rdf4j"
96
+ },
97
+ {
98
+ "@id": "http://data.dacore.org/module/sparql"
99
+ },
100
+ {
101
+ "@id": "http://data.dacore.org/module/typescript"
102
+ },
103
+ {
104
+ "@id": "http://data.dacore.org/module/cli"
105
+ },
106
+ {
107
+ "@id": "http://data.dacore.org/module/dacode"
108
+ },
109
+ {
110
+ "@id": "http://data.dacore.org/module/server-core"
111
+ },
112
+ {
113
+ "@id": "http://data.dacore.org/module/node-core"
114
+ },
115
+ {
116
+ "@id": "http://data.dacore.org/module/admin"
117
+ }
118
+ ]
119
+ },
120
+ {
121
+ "@id": "${uriBase}",
122
+ "@type": "browser-core:BrowserCore",
123
+ "core:uriBase": "${uriBase}",
124
+ "core:deployment": "development",
125
+ "browser-core:publicRoot": "${publicRoot}",
126
+ "browser-core:browserTitle": "${projectName}"
127
+ }
128
+ ]
129
129
  }
@@ -1,19 +1,19 @@
1
- # enable symbolic links
2
- Options +FollowSymLinks
3
-
4
- RewriteEngine On
5
- #RewriteLogLevel 8
6
-
7
- RewriteCond %{REQUEST_FILENAME} !-f
8
- RewriteCond %{REQUEST_FILENAME} !-d
9
- RewriteCond %{REQUEST_FILENAME} !-l
10
-
11
- #rewrite bundle urls to the actual files in node_modules
12
- RewriteRule ^js/modules/dacore.([\w\-\_]+).(.[\w.]*) node_modules/@dacore/$1/builds/dacore.$1.$2 [NC]
13
- RewriteRule ^css/modules/dacore.([\w\-\_]+).(.[\w.]*) node_modules/@dacore/$1/builds/dacore.$1.$2 [NC]
14
- RewriteRule ^js/modules/@dacore/([\w\-\_]+)/(.*) node_modules/@dacore/$1/includes/$2 [NC]
15
- RewriteRule ^css/modules/@dacore/([\w\-\_]+)/(.*) node_modules/@dacore/$1/includes/$2 [NC]
16
-
17
- #rewrite sourcemap URLS whichCon do not really exist to the actual files
18
- RewriteRule ^js/modules/(.*)\.(tsx|jsx|ts|js) node_modules/@dacore/$1.$2 [ENV=JS:true]
19
- Header set Content-Type "application/javascript" env=JS
1
+ # enable symbolic links
2
+ Options +FollowSymLinks
3
+
4
+ RewriteEngine On
5
+ #RewriteLogLevel 8
6
+
7
+ RewriteCond %{REQUEST_FILENAME} !-f
8
+ RewriteCond %{REQUEST_FILENAME} !-d
9
+ RewriteCond %{REQUEST_FILENAME} !-l
10
+
11
+ #rewrite bundle urls to the actual files in node_modules
12
+ RewriteRule ^js/modules/dacore.([\w\-\_]+).(.[\w.]*) node_modules/@dacore/$1/builds/dacore.$1.$2 [NC]
13
+ RewriteRule ^css/modules/dacore.([\w\-\_]+).(.[\w.]*) node_modules/@dacore/$1/builds/dacore.$1.$2 [NC]
14
+ RewriteRule ^js/modules/@dacore/([\w\-\_]+)/(.*) node_modules/@dacore/$1/includes/$2 [NC]
15
+ RewriteRule ^css/modules/@dacore/([\w\-\_]+)/(.*) node_modules/@dacore/$1/includes/$2 [NC]
16
+
17
+ #rewrite sourcemap URLS whichCon do not really exist to the actual files
18
+ RewriteRule ^js/modules/(.*)\.(tsx|jsx|ts|js) node_modules/@dacore/$1.$2 [ENV=JS:true]
19
+ Header set Content-Type "application/javascript" env=JS