lincd-cli 0.1.4 → 0.1.5

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.
@@ -1,30 +1,30 @@
1
- 'use strict';
2
- exports.__esModule = true;
3
- exports.$ = void 0;
4
- var Core_1 = require('@dacore/core/lib/types/Core');
5
- var UriResource_1 = require('@dacore/core/lib/models/UriResource');
6
- var JSONLD_1 = require('@dacore/core/lib/utils/JSONLD');
7
- var $ = require();
8
- exports.$ = $;
9
- from;
10
- ('./ontologies/${ontology_name}');
11
- var Index = require('./views/Index');
12
- var _dataPromise = JSONLD_1.JSONLD.parse(
13
- require('../data/data.json'),
14
- true,
15
- true,
16
- );
17
- var moduleResource = UriResource_1.UriResource.getOrCreate(
18
- '${uri_base}/module/${module_name}',
19
- );
20
- Core_1.Core.app().registerModule(
21
- '${module_name}',
22
- this,
23
- moduleResource,
24
- _dataPromise,
25
- [$, {underscore_ontology_name: underscore_ontology_name}._parsePromise],
26
- );
27
- {
28
- underscore_ontology_name;
29
- }
30
- Index;
1
+ 'use strict';
2
+ exports.__esModule = true;
3
+ exports.$ = void 0;
4
+ var Core_1 = require('@dacore/core/lib/types/Core');
5
+ var UriResource_1 = require('@dacore/core/lib/models/UriResource');
6
+ var JSONLD_1 = require('@dacore/core/lib/utils/JSONLD');
7
+ var $ = require();
8
+ exports.$ = $;
9
+ from;
10
+ ('./ontologies/${ontology_name}');
11
+ var Index = require('./views/Index');
12
+ var _dataPromise = JSONLD_1.JSONLD.parse(
13
+ require('../data/data.json'),
14
+ true,
15
+ true,
16
+ );
17
+ var moduleResource = UriResource_1.UriResource.getOrCreate(
18
+ '${uri_base}/module/${module_name}',
19
+ );
20
+ Core_1.Core.app().registerModule(
21
+ '${module_name}',
22
+ this,
23
+ moduleResource,
24
+ _dataPromise,
25
+ [$, {underscore_ontology_name: underscore_ontology_name}._parsePromise],
26
+ );
27
+ {
28
+ underscore_ontology_name;
29
+ }
30
+ Index;
@@ -1,21 +1,21 @@
1
- 'use strict';
2
- exports.__esModule = true;
3
- exports.Index = exports._parsePromise = exports._ontologyResource = void 0;
4
- var UriResource_1 = require('@dacore/core/lib/models/UriResource');
5
- var JSONLD_1 = require('@dacore/core/lib/utils/JSONLD');
6
- var base = '${uri_base}/ontology/${ontology_name}/';
7
- exports._ontologyResource = UriResource_1.UriResource.getOrCreate(base);
8
- var json = require('../../data/ontologies/${ontology_name}.json');
9
- exports._parsePromise = [
10
- exports._ontologyResource,
11
- JSONLD_1.JSONLD.parse(json, true, true),
12
- ];
13
- //add your ontology resources here
14
- exports.Index = UriResource_1.UriResource.getOrCreate(base + 'Index');
15
- //make sure every resource is also exported here
16
- var $,
17
- camel_ontology_name = {Index: exports.Index}.camel_ontology_name;
18
- exports['default'] = $;
19
- {
20
- camel_ontology_name;
21
- }
1
+ 'use strict';
2
+ exports.__esModule = true;
3
+ exports.Index = exports._parsePromise = exports._ontologyResource = void 0;
4
+ var UriResource_1 = require('@dacore/core/lib/models/UriResource');
5
+ var JSONLD_1 = require('@dacore/core/lib/utils/JSONLD');
6
+ var base = '${uri_base}/ontology/${ontology_name}/';
7
+ exports._ontologyResource = UriResource_1.UriResource.getOrCreate(base);
8
+ var json = require('../../data/ontologies/${ontology_name}.json');
9
+ exports._parsePromise = [
10
+ exports._ontologyResource,
11
+ JSONLD_1.JSONLD.parse(json, true, true),
12
+ ];
13
+ //add your ontology resources here
14
+ exports.Index = UriResource_1.UriResource.getOrCreate(base + 'Index');
15
+ //make sure every resource is also exported here
16
+ var $,
17
+ camel_ontology_name = {Index: exports.Index}.camel_ontology_name;
18
+ exports['default'] = $;
19
+ {
20
+ camel_ontology_name;
21
+ }
@@ -1,16 +1,16 @@
1
- var buildTools = require('lincd-cli');
2
- module.exports = buildTools.generateGruntConfig('${module_name}', {
3
- externals: {
4
- react: 'React',
5
- 'react-dom': 'ReactDOM',
6
- }, //list of non lincd modules that are already loaded and made globally available by one of the dependencies of this module
7
- //internals: [],//list of lincd modules that you want to INCLUDE in the bundle (as opposed to the module its own bundle being a dependency)
8
- //alias:{},//webpack alias -> maps on type of npm path to another
9
- //target:"es5"|"es6",
10
- //environment:"server"|"frontend",
11
- //outputPath:string,
12
- //es5Server:boolean
13
- //es5:{},//es5 specific config, use same properties as above
14
- //es6:{},//es6 specific config, use same properties as above
15
- //debug:false,//debug the build process
16
- });
1
+ var buildTools = require('lincd-cli');
2
+ module.exports = buildTools.generateGruntConfig('${module_name}', {
3
+ externals: {
4
+ react: 'React',
5
+ 'react-dom': 'ReactDOM',
6
+ }, //list of non lincd modules that are already loaded and made globally available by one of the dependencies of this module
7
+ //internals: [],//list of lincd modules that you want to INCLUDE in the bundle (as opposed to the module its own bundle being a dependency)
8
+ //alias:{},//webpack alias -> maps on type of npm path to another
9
+ //target:"es5"|"es6",
10
+ //environment:"server"|"frontend",
11
+ //outputPath:string,
12
+ //es5Server:boolean
13
+ //es5:{},//es5 specific config, use same properties as above
14
+ //es6:{},//es6 specific config, use same properties as above
15
+ //debug:false,//debug the build process
16
+ });
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "${module_name}",
3
+ "displayName": "${module_name}",
3
4
  "version": "0.1.0",
4
5
  "description": "",
5
6
  "lincd": true,
6
7
  "main": "lib/index.js",
7
- "types": "dist/lincd.${name}.d.ts",
8
+ "types": "dist/${module_name}.d.ts",
8
9
  "author": "",
9
10
  "license": "ISC",
10
11
  "scripts": {
@@ -21,7 +22,7 @@
21
22
  "web3"
22
23
  ],
23
24
  "dependencies": {
24
- "lincd": "^0.1"
25
+ "lincd": "^0.2"
25
26
  },
26
27
  "devDependencies": {
27
28
  "lincd-cli": "^0.1"
@@ -1,22 +1,22 @@
1
- import React from 'react';
2
- import {ReactComponent} from 'lincd/lib/shapes/ReactComponent';
3
- import {ExampleShapeClass} from '../shapes/ExampleShapeClass';
4
- import {linkedComponent} from '../module';
5
-
6
- /**
7
- * By linking this component to a Shape class (a class that extends Shape) you ensure this.source will be an instance of that class
8
- */
9
- @linkedComponent(ExampleShapeClass)
10
- //for correct typings, please provide the same class as third type parameter of ReactComponent, after property & state interfaces
11
- export class ExampleComponent extends ReactComponent<
12
- any,
13
- any,
14
- ExampleShapeClass
15
- > {
16
- render() {
17
- let exampleInstance = this.source;
18
-
19
- //get the name of this item from the graph
20
- return <h1>Hello {exampleInstance.name}!</h1>;
21
- }
22
- }
1
+ import React from 'react';
2
+ import {ReactComponent} from 'lincd/lib/shapes/ReactComponent';
3
+ import {ExampleShapeClass} from '../shapes/ExampleShapeClass';
4
+ import {linkedComponent} from '../module';
5
+
6
+ /**
7
+ * By linking this component to a Shape class (a class that extends Shape) you ensure this.source will be an instance of that class
8
+ */
9
+ @linkedComponent(ExampleShapeClass)
10
+ //for correct typings, please provide the same class as third type parameter of ReactComponent, after property & state interfaces
11
+ export class ExampleComponent extends ReactComponent<
12
+ any,
13
+ any,
14
+ ExampleShapeClass
15
+ > {
16
+ render() {
17
+ let exampleInstance = this.source;
18
+
19
+ //get the name of this item from the graph
20
+ return <h1>Hello {exampleInstance.name}!</h1>;
21
+ }
22
+ }
@@ -1,20 +1,20 @@
1
- {
2
- "@context": {
3
- "dc": "http://purl.org/dc/elements/1.1/",
4
- "owl": "http://www.w3.org/2002/07/owl#",
5
- "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
6
- "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7
- "test": "http://www.example.com/"
8
- },
9
- "@graph": [
10
- {
11
- "@id": "example:ExampleClass",
12
- "@type": "rdfs:Class",
13
- "rdfs:comment": "This is an example class. You can remove or rename it",
14
- "rdfs:isDefinedBy": {
15
- "@id": "example:"
16
- },
17
- "rdfs:label": "Example Class"
18
- }
19
- ]
20
- }
1
+ {
2
+ "@context": {
3
+ "dc": "http://purl.org/dc/elements/1.1/",
4
+ "owl": "http://www.w3.org/2002/07/owl#",
5
+ "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
6
+ "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
7
+ "test": "http://www.example.com/"
8
+ },
9
+ "@graph": [
10
+ {
11
+ "@id": "example:ExampleClass",
12
+ "@type": "rdfs:Class",
13
+ "rdfs:comment": "This is an example class. You can remove or rename it",
14
+ "rdfs:isDefinedBy": {
15
+ "@id": "example:"
16
+ },
17
+ "rdfs:label": "Example Class"
18
+ }
19
+ ]
20
+ }
@@ -1 +1 @@
1
- export var json: string;
1
+ export var json: string;
@@ -1,7 +1,7 @@
1
- import './ontologies/example-ontology';
2
-
3
- //SHAPES FIRST
4
- import './shapes/ExampleShapeClass';
5
-
6
- //THEN COMPONENTS
7
- import './components/ExampleComponent';
1
+ import './ontologies/example-ontology';
2
+
3
+ //SHAPES FIRST
4
+ import './shapes/ExampleShapeClass';
5
+
6
+ //THEN COMPONENTS
7
+ import './components/ExampleComponent';
@@ -1,9 +1,9 @@
1
- import {linkedModule} from 'lincd/lib/utils/Module';
2
- export const {
3
- linkedComponent,
4
- linkedShape,
5
- linkedUtil,
6
- linkedOntology,
7
- registerModuleExport,
8
- moduleExports,
9
- } = linkedModule('${module_name}');
1
+ import {linkedModule} from 'lincd/lib/utils/Module';
2
+ export const {
3
+ linkedComponent,
4
+ linkedShape,
5
+ linkedUtil,
6
+ linkedOntology,
7
+ registerModuleExport,
8
+ moduleExports,
9
+ } = linkedModule('${module_name}');
@@ -1,33 +1,33 @@
1
- import {NamedNode} from 'lincd/lib/models';
2
- import {JSONLD} from 'lincd-jsonld/lib/JSONLD';
3
- import {createNameSpace} from 'lincd/lib/utils/NameSpace';
4
- import {linkedOntology} from '../module';
5
-
6
- export var loadData = () => {
7
- return import('../data/example-ontology.json').then((data) =>
8
- JSONLD.parse(data),
9
- );
10
- };
11
-
12
- export var ns = createNameSpace('${uri_base}');
13
-
14
- //It's recommended to export a NamedNode for the ontology itself as well
15
- export var _self: NamedNode = ns('');
16
-
17
- //The main goal though of this file is to export a reference to NamedNode with the correct URI
18
- // for all the entities (Classes and properties) in the ontology
19
- export var ExampleClass: NamedNode = ns('ExampleClass');
20
- export var exampleName: NamedNode = ns('exampleName');
21
-
22
- export const exampleOntology = {
23
- ExampleClass,
24
- exampleName,
25
- };
26
-
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
- //as third parameter, provide a prefix (string) that can be used to refer to the full ontology URL.
32
- //for example: 'schema' refers to https://www.schema.org/
33
- linkedOntology(_this, ns, 'exampl', loadData);
1
+ import {NamedNode} from 'lincd/lib/models';
2
+ import {JSONLD} from 'lincd-jsonld/lib/JSONLD';
3
+ import {createNameSpace} from 'lincd/lib/utils/NameSpace';
4
+ import {linkedOntology} from '../module';
5
+
6
+ export var loadData = () => {
7
+ return import('../data/example-ontology.json').then((data) =>
8
+ JSONLD.parse(data),
9
+ );
10
+ };
11
+
12
+ export var ns = createNameSpace('${uri_base}');
13
+
14
+ //It's recommended to export a NamedNode for the ontology itself as well
15
+ export var _self: NamedNode = ns('');
16
+
17
+ //The main goal though of this file is to export a reference to NamedNode with the correct URI
18
+ // for all the entities (Classes and properties) in the ontology
19
+ export var ExampleClass: NamedNode = ns('ExampleClass');
20
+ export var exampleName: NamedNode = ns('exampleName');
21
+
22
+ export const exampleOntology = {
23
+ ExampleClass,
24
+ exampleName,
25
+ };
26
+
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
+ //as third parameter, provide a prefix (string) that can be used to refer to the full ontology URL.
32
+ //for example: 'schema' refers to https://www.schema.org/
33
+ linkedOntology(_this, ns, 'exampl', loadData);
@@ -1,30 +1,30 @@
1
- import {Shape} from 'lincd/lib/shapes/Shape';
2
- import {NamedNode} from 'lincd/lib/models';
3
- import {linkedShape} from '../module';
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
- import {exampleOntology} from '../ontologies/example-ontology';
8
-
9
- @linkedShape
10
- 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;
15
-
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
- }
30
- }
1
+ import {Shape} from 'lincd/lib/shapes/Shape';
2
+ import {NamedNode} from 'lincd/lib/models';
3
+ import {linkedShape} from '../module';
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
+ import {exampleOntology} from '../ontologies/example-ontology';
8
+
9
+ @linkedShape
10
+ 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;
15
+
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
+ }
30
+ }
@@ -6,12 +6,14 @@
6
6
  "outDir": "lib",
7
7
  "declaration": false,
8
8
  "esModuleInterop": true,
9
+ "resolveJsonModule": true,
9
10
  "downlevelIteration": true,
10
11
  "experimentalDecorators": true,
11
12
  "skipLibCheck": true,
12
13
  "jsx": "react",
13
14
  "baseUrl": "./",
14
- "rootDir": "src"
15
+ "rootDir": "src",
16
+ "plugins" : [{ "name": "typescript-plugin-css-modules" }]
15
17
  },
16
18
  "files": [
17
19
  "./src/index.ts"
@@ -6,12 +6,14 @@
6
6
  "outDir": "lib",
7
7
  "declaration": true,
8
8
  "esModuleInterop": true,
9
+ "resolveJsonModule": true,
9
10
  "downlevelIteration": true,
10
11
  "experimentalDecorators": true,
11
12
  "skipLibCheck": true,
12
13
  "jsx": "react",
13
14
  "baseUrl": "./",
14
- "rootDir": "src"
15
+ "rootDir": "src",
16
+ "plugins" : [{ "name": "typescript-plugin-css-modules" }]
15
17
  },
16
18
  "files": [
17
19
  "./src/index.ts"
@@ -20,7 +20,7 @@
20
20
  "web3"
21
21
  ],
22
22
  "dependencies": {
23
- "lincd": "^0.1"
23
+ "lincd": "^0.2"
24
24
  },
25
25
  "devDependencies": {
26
26
  "lincd-cli": "^0.1"
@@ -1,40 +1,40 @@
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
- }
40
- }
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
+ }
40
+ }