lincd-cli 0.1.19 → 0.1.20
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/defaults/app/package.json +1 -1
- package/defaults/app/tsconfig.json +6 -3
- package/defaults/app-with-backend/package.json +1 -1
- package/defaults/app-with-backend/tsconfig.json +3 -0
- package/defaults/module/package.json +1 -1
- package/defaults/module/src/components/ExampleComponent.tsx +1 -1
- package/defaults/module/src/ontologies/example-ontology.ts +1 -1
- package/defaults/module/src/{module.ts → package.ts} +2 -2
- package/defaults/module/src/shapes/ExampleShapeClass.ts +1 -1
- package/defaults/module/tsconfig.json +8 -4
- package/defaults/shape.ts +1 -1
- package/lib/cli.js +49 -18
- package/lib/config-grunt.js +17 -1
- package/lib/config-webpack.js +1 -1
- package/lib/plugins/declaration-plugin.js +10 -7
- package/lib/plugins/externalise-modules.js +17 -1
- package/lib/utils.js +43 -22
- package/package.json +3 -3
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
"sourceMap": true,
|
|
5
5
|
"target": "es6",
|
|
6
6
|
"outDir": "lib",
|
|
7
|
-
"declaration":
|
|
7
|
+
"declaration": false,
|
|
8
8
|
"esModuleInterop": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
9
10
|
"resolveJsonModule": true,
|
|
10
11
|
"downlevelIteration": true,
|
|
11
12
|
"experimentalDecorators": true,
|
|
12
13
|
"skipLibCheck": true,
|
|
13
14
|
"jsx": "react",
|
|
14
|
-
"
|
|
15
|
-
|
|
15
|
+
"paths": {
|
|
16
|
+
"react": ["../node_modules/@types/react","../../../node_modules/@types/react"]
|
|
17
|
+
},
|
|
18
|
+
"baseUrl": "./src"
|
|
16
19
|
},
|
|
17
20
|
"files": ["./src/index.tsx"]
|
|
18
21
|
}
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"resolveJsonModule": true,
|
|
12
12
|
"jsx": "react-jsx",
|
|
13
13
|
"types": ["node", "react", "react-dom"],
|
|
14
|
+
"paths": {
|
|
15
|
+
"react": ["../node_modules/@types/react","../../../node_modules/@types/react"]
|
|
16
|
+
},
|
|
14
17
|
"pretty": true
|
|
15
18
|
},
|
|
16
19
|
"files": ["./frontend/src/index.tsx"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import {ExampleShapeClass} from "../shapes/ExampleShapeClass";
|
|
3
|
-
import {linkedComponentClass,linkedComponent} from '../
|
|
3
|
+
import {linkedComponentClass,linkedComponent} from '../package';
|
|
4
4
|
import {LinkedComponentClass} from 'lincd/lib/utils/LinkedComponentClass';
|
|
5
5
|
|
|
6
6
|
export const ExampleComponent = linkedComponent<ExampleShapeClass>(ExampleShapeClass, ({source, sourceShape}) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {NamedNode} from 'lincd/lib/models';
|
|
2
2
|
import {JSONLD} from 'lincd-jsonld/lib/utils/JSONLD';
|
|
3
3
|
import {createNameSpace} from 'lincd/lib/utils/NameSpace';
|
|
4
|
-
import {linkedOntology} from '../
|
|
4
|
+
import {linkedOntology} from '../package';
|
|
5
5
|
//import all the exports of this file as one variable called _this (we need this at the end)
|
|
6
6
|
import * as _this from './${hyphen_name}';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {linkedPackage} from 'lincd/lib/utils/Module';
|
|
2
2
|
|
|
3
3
|
export const {linkedComponent, linkedComponentClass, linkedShape, linkedUtil, linkedOntology} =
|
|
4
|
-
|
|
4
|
+
linkedPackage('${module_name}');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Shape} from 'lincd/lib/shapes/Shape';
|
|
2
2
|
import {Literal, NamedNode} from 'lincd/lib/models';
|
|
3
|
-
import {linkedShape} from '../
|
|
3
|
+
import {linkedShape} from '../package';
|
|
4
4
|
import {literalProperty} from 'lincd/lib/utils/ShapeDecorators';
|
|
5
5
|
import {${camel_name}} from '../ontologies/${hyphen_name}';
|
|
6
6
|
|
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
"module": "commonjs",
|
|
4
4
|
"sourceMap": true,
|
|
5
5
|
"target": "es6",
|
|
6
|
+
"moduleResolution": "node",
|
|
6
7
|
"outDir": "lib",
|
|
7
8
|
"declaration": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"emitDecoratorMetadata": true,
|
|
8
11
|
"esModuleInterop": true,
|
|
9
12
|
"resolveJsonModule": true,
|
|
10
13
|
"downlevelIteration": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"skipLibCheck": true,
|
|
13
14
|
"jsx": "react",
|
|
14
|
-
"
|
|
15
|
-
"
|
|
15
|
+
"types": ["node"],
|
|
16
|
+
"paths": {
|
|
17
|
+
"react": ["../node_modules/@types/react","../../../node_modules/@types/react"]
|
|
18
|
+
},
|
|
19
|
+
"baseUrl": "./src"
|
|
16
20
|
},
|
|
17
21
|
"files": ["./src/index.ts"]
|
|
18
22
|
}
|
package/defaults/shape.ts
CHANGED
package/lib/cli.js
CHANGED
|
@@ -36,6 +36,22 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
40
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
41
|
+
if (!m) return o;
|
|
42
|
+
var i = m.call(o), r, ar = [], e;
|
|
43
|
+
try {
|
|
44
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
45
|
+
}
|
|
46
|
+
catch (error) { e = { error: error }; }
|
|
47
|
+
finally {
|
|
48
|
+
try {
|
|
49
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
50
|
+
}
|
|
51
|
+
finally { if (e) throw e.error; }
|
|
52
|
+
}
|
|
53
|
+
return ar;
|
|
54
|
+
};
|
|
39
55
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
40
56
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
41
57
|
if (ar || !(i in from)) {
|
|
@@ -324,7 +340,7 @@ function buildAll(target, target2) {
|
|
|
324
340
|
});
|
|
325
341
|
if (dependentModules.length > 0) {
|
|
326
342
|
failedModules.push(module.moduleName);
|
|
327
|
-
|
|
343
|
+
printBuildResults(failedModules, done);
|
|
328
344
|
console.log(chalk.magenta('Stopping build process because an error occurred whilst building ' +
|
|
329
345
|
module.moduleName +
|
|
330
346
|
', which ' +
|
|
@@ -341,11 +357,19 @@ function buildAll(target, target2) {
|
|
|
341
357
|
}
|
|
342
358
|
})
|
|
343
359
|
.then(function (res) {
|
|
360
|
+
// console.log("RESULT: ",res);
|
|
361
|
+
// if(res && res.includes("Aborted due to warnings"))
|
|
362
|
+
// {
|
|
363
|
+
// failedModules.push(module.moduleName);
|
|
364
|
+
// }
|
|
365
|
+
// else
|
|
366
|
+
// {
|
|
344
367
|
done.add(module);
|
|
368
|
+
// }
|
|
345
369
|
modulesLeft--;
|
|
346
370
|
log(chalk.magenta(modulesLeft + ' modules left'));
|
|
347
|
-
if (modulesLeft == 0
|
|
348
|
-
|
|
371
|
+
if (modulesLeft == 0) {
|
|
372
|
+
printBuildResults(failedModules, done);
|
|
349
373
|
}
|
|
350
374
|
return res;
|
|
351
375
|
});
|
|
@@ -450,7 +474,7 @@ function getLincdModules(rootPath) {
|
|
|
450
474
|
var pack = (0, utils_1.getPackageJSON)();
|
|
451
475
|
if (!pack || !pack.workspaces) {
|
|
452
476
|
for (var i = 0; i <= 3; i++) {
|
|
453
|
-
rootPath = path.join.apply(path, __spreadArray([process.cwd()], Array(i).fill('..'), false));
|
|
477
|
+
rootPath = path.join.apply(path, __spreadArray([process.cwd()], __read(Array(i).fill('..')), false));
|
|
454
478
|
pack = (0, utils_1.getPackageJSON)(rootPath);
|
|
455
479
|
if (pack && pack.workspaces) {
|
|
456
480
|
// log('Found workspace at '+packagePath);
|
|
@@ -660,7 +684,7 @@ var replaceVariablesInFilesWithRoot = function (root) {
|
|
|
660
684
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
661
685
|
files[_i - 1] = arguments[_i];
|
|
662
686
|
}
|
|
663
|
-
return replaceVariablesInFiles.apply(void 0, files.map(function (f) { return path.join(root, f); }));
|
|
687
|
+
return replaceVariablesInFiles.apply(void 0, __spreadArray([], __read(files.map(function (f) { return path.join(root, f); })), false));
|
|
664
688
|
};
|
|
665
689
|
var hasYarnInstalled = function () {
|
|
666
690
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -756,7 +780,7 @@ var createModule = function (name, uriBase, basePath) {
|
|
|
756
780
|
console.warn('Please provide a name as the first argument');
|
|
757
781
|
return [2 /*return*/];
|
|
758
782
|
}
|
|
759
|
-
_a = name.match(/(@[\w\-]+\/)?([\w\-]+)/), packageName = _a[0], scope = _a[1], cleanPackageName = _a[2];
|
|
783
|
+
_a = __read(name.match(/(@[\w\-]+\/)?([\w\-]+)/), 3), packageName = _a[0], scope = _a[1], cleanPackageName = _a[2];
|
|
760
784
|
targetFolder = ensureFolderExists(basePath, cleanPackageName);
|
|
761
785
|
if (!uriBase) {
|
|
762
786
|
uriBase = 'http://lincd.org/ont/' + name;
|
|
@@ -779,7 +803,7 @@ var createModule = function (name, uriBase, basePath) {
|
|
|
779
803
|
'src/index.ts',
|
|
780
804
|
'package.json',
|
|
781
805
|
'Gruntfile.js',
|
|
782
|
-
'src/
|
|
806
|
+
'src/package.ts',
|
|
783
807
|
'src/shapes/ExampleShapeClass.ts',
|
|
784
808
|
'src/ontologies/example-ontology.ts',
|
|
785
809
|
'src/data/example-ontology.json',
|
|
@@ -798,11 +822,11 @@ var createModule = function (name, uriBase, basePath) {
|
|
|
798
822
|
'src/data/example-ontology.json.d.ts',
|
|
799
823
|
].forEach(function (f) {
|
|
800
824
|
var parts = f.split('/');
|
|
801
|
-
var newParts = __spreadArray([], parts,
|
|
802
|
-
var _a = newParts.pop().split('.'), name = _a[0], extensions = _a.slice(1);
|
|
825
|
+
var newParts = __spreadArray([], __read(parts), false);
|
|
826
|
+
var _a = __read(newParts.pop().split('.')), name = _a[0], extensions = _a.slice(1);
|
|
803
827
|
var newName = hyphenName + '.' + extensions.join('.');
|
|
804
|
-
console.log('rename ', path.join(targetFolder, f), path.join.apply(path, __spreadArray(__spreadArray([targetFolder], newParts, false), [newName], false)));
|
|
805
|
-
fs.renameSync(path.join(targetFolder, f), path.join.apply(path, __spreadArray(__spreadArray([targetFolder], newParts, false), [newName], false)));
|
|
828
|
+
console.log('rename ', path.join(targetFolder, f), path.join.apply(path, __spreadArray(__spreadArray([targetFolder], __read(newParts), false), [newName], false)));
|
|
829
|
+
fs.renameSync(path.join(targetFolder, f), path.join.apply(path, __spreadArray(__spreadArray([targetFolder], __read(newParts), false), [newName], false)));
|
|
806
830
|
});
|
|
807
831
|
return [4 /*yield*/, execPromise('yarn --version')["catch"](function (err) {
|
|
808
832
|
console.log('yarn probably not working');
|
|
@@ -893,17 +917,17 @@ var buildFailed = function (output) {
|
|
|
893
917
|
// require('lincd');
|
|
894
918
|
//TODO: replace with actual index file from package.json, or tsconfig
|
|
895
919
|
let indexExports = require(process.cwd() + '/lib/index.js');
|
|
896
|
-
if(indexExports.
|
|
920
|
+
if(indexExports.packageExports)
|
|
897
921
|
{
|
|
898
|
-
let shapeJSONLD = await getShapesJSONLD(indexExports.
|
|
899
|
-
console.log(indexExports.
|
|
922
|
+
let shapeJSONLD = await getShapesJSONLD(indexExports.packageExports);
|
|
923
|
+
console.log(indexExports.packageExports);
|
|
900
924
|
console.log(shapeJSONLD);
|
|
901
925
|
console.log(chalk.bold(chalk.green(moduleName+'/dist/shapes.json')));
|
|
902
926
|
return fs.writeFile(path.join('dist', 'shapes.json'), shapeJSONLD);
|
|
903
927
|
}
|
|
904
928
|
else
|
|
905
929
|
{
|
|
906
|
-
console.warn("Invalid LINCD module. Index file should export a
|
|
930
|
+
console.warn("Invalid LINCD module. Index file should export a packageExports object. See examples.")
|
|
907
931
|
}
|
|
908
932
|
|
|
909
933
|
} else {
|
|
@@ -917,7 +941,11 @@ var register = function (registryURL) {
|
|
|
917
941
|
var moduleName = pack.name;
|
|
918
942
|
var author = pack.author;
|
|
919
943
|
var description = pack.description;
|
|
920
|
-
|
|
944
|
+
var authorName = pack.author;
|
|
945
|
+
if (pack.author.name) {
|
|
946
|
+
authorName = pack.author.name;
|
|
947
|
+
}
|
|
948
|
+
console.log(chalk.cyan('registering ' + authorName + "'s module, " + moduleName + ' ' + version + ' in the LINCD registry'));
|
|
921
949
|
return fetch(registryURL + '/register', {
|
|
922
950
|
method: 'POST',
|
|
923
951
|
headers: {
|
|
@@ -1189,8 +1217,11 @@ var buildUpdated = function (back, target, target2, test) {
|
|
|
1189
1217
|
});
|
|
1190
1218
|
// });
|
|
1191
1219
|
};
|
|
1192
|
-
var
|
|
1193
|
-
log('
|
|
1220
|
+
var printBuildResults = function (failed, done) {
|
|
1221
|
+
log('Build results: '
|
|
1222
|
+
+ chalk.green(__spreadArray([], __read(done), false).map(function (m) { return m.moduleName; }).join(', '))
|
|
1223
|
+
+ (failed.length > 0 ? (', ' + chalk.red(failed.join(', '))) : '')
|
|
1224
|
+
+ '\n');
|
|
1194
1225
|
};
|
|
1195
1226
|
var executeCommandForEachModule = function (modules, command, includedSpaces, excludedSpaces) {
|
|
1196
1227
|
//if a specific set of modules is given
|
package/lib/config-grunt.js
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
2
18
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
19
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
20
|
if (ar || !(i in from)) {
|
|
@@ -56,7 +72,7 @@ function setupGrunt(grunt, moduleName, config) {
|
|
|
56
72
|
grunt.registerTask('dev', targetES6 ? ['prepare-build', 'dev-es6'] : ['prepare-build', 'dev-es5']);
|
|
57
73
|
grunt.registerTask('build', targets.map(function (target) { return 'build-' + target; }));
|
|
58
74
|
if (buildFrontend) {
|
|
59
|
-
grunt.registerTask('build-frontend', __spreadArray(['prepare-build'], targets.map(function (target) { return 'webpack:build-' + target; }),
|
|
75
|
+
grunt.registerTask('build-frontend', __spreadArray(['prepare-build'], __read(targets.map(function (target) { return 'webpack:build-' + target; })), false));
|
|
60
76
|
}
|
|
61
77
|
grunt.registerTask('build-production', (0, utils_1.flatten)([
|
|
62
78
|
'clean:lib',
|
package/lib/config-webpack.js
CHANGED
|
@@ -110,7 +110,7 @@ function generateWebpackConfig(buildName, moduleName, config) {
|
|
|
110
110
|
if (config.analyse) {
|
|
111
111
|
plugins.push(new BundleAnalyzerPlugin());
|
|
112
112
|
}
|
|
113
|
-
if (es6 || config.declarations === true) {
|
|
113
|
+
if ((es6 || config.declarations === true) && !config.declarations === false) {
|
|
114
114
|
plugins.push(new declaration_plugin_1["default"]({
|
|
115
115
|
out: (config.filename ? config.filename : cleanModuleName) + '.d.ts',
|
|
116
116
|
root: config.outputPath ? config.outputPath : './lib/',
|
|
@@ -60,13 +60,16 @@ var DeclarationPlugin = /** @class */ (function () {
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
if (Object.keys(_this.declarationFiles).length == 0) {
|
|
63
|
-
_this.
|
|
64
|
-
_this.
|
|
65
|
-
_this.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
_this.debug('Didn\'t build .d.ts file because no declaration assets were emitted during build process.'.yellow);
|
|
64
|
+
_this.debug('This is likely because webpack is using cache.'.yellow);
|
|
65
|
+
_this.debug('In watch mode, declaration assets will be emitted once you change a ts(x) source file'.yellow);
|
|
66
|
+
// this.log('Make sure to run '.yellow + 'tsc'.blue + ' before running webpack'.yellow);
|
|
67
|
+
// this.log(
|
|
68
|
+
// 'Make sure to test for '.yellow +
|
|
69
|
+
// '/(?!.*.d.ts).ts(x?)$/'.blue.bold['underline'] +
|
|
70
|
+
// ' in the ts-loader in webpack.config.json'.yellow,
|
|
71
|
+
// );
|
|
72
|
+
// this.log(('Assets: ' + Object.keys(compilation.assets).toString()).yellow);
|
|
70
73
|
// callback();
|
|
71
74
|
return;
|
|
72
75
|
}
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
2
18
|
exports.__esModule = true;
|
|
3
19
|
/// <reference path="colors.d.ts" />
|
|
4
20
|
var colors = require("colors");
|
|
@@ -94,7 +110,7 @@ var externaliseModules = function (config, es5) {
|
|
|
94
110
|
// --> match[0] = @dacore/some-mod
|
|
95
111
|
// --> match[1] = @dacore
|
|
96
112
|
// --> match[2] = some-mod
|
|
97
|
-
var _b = request.match(/(@[\w\-]+\/)?([\w\-]+)/), packageName = _b[0], scope = _b[1], cleanPackageName = _b[2];
|
|
113
|
+
var _b = __read(request.match(/(@[\w\-]+\/)?([\w\-]+)/), 3), packageName = _b[0], scope = _b[1], cleanPackageName = _b[2];
|
|
98
114
|
//if this module is listed as internal module in the config (or if we internalize all modules with '*')
|
|
99
115
|
if (config && config.internals && (config.internals.indexOf(packageName) !== -1 || config.internals === '*')) {
|
|
100
116
|
//then don't exclude and don't continue this function
|
package/lib/utils.js
CHANGED
|
@@ -22,16 +22,38 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
42
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
43
|
+
if (ar || !(i in from)) {
|
|
44
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
45
|
+
ar[i] = from[i];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
49
|
+
};
|
|
25
50
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
51
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
52
|
};
|
|
28
53
|
exports.__esModule = true;
|
|
29
|
-
exports.flatten = exports.warn = exports.debug = exports.log = exports.generateScopedName = exports.
|
|
54
|
+
exports.flatten = exports.warn = exports.debug = exports.log = exports.generateScopedName = exports.getPackageJSON = void 0;
|
|
30
55
|
var fs = __importStar(require("fs"));
|
|
31
56
|
var path = __importStar(require("path"));
|
|
32
|
-
var SHACL_1 = require("lincd/lib/shapes/SHACL");
|
|
33
|
-
var CoreSet_1 = require("lincd/lib/collections/CoreSet");
|
|
34
|
-
var JSONLDWriter_1 = require("lincd-jsonld/lib/utils/JSONLDWriter");
|
|
35
57
|
var chalk_1 = __importDefault(require("chalk"));
|
|
36
58
|
var getPackageJSON = function (root, error) {
|
|
37
59
|
if (root === void 0) { root = process.cwd(); }
|
|
@@ -48,25 +70,24 @@ var getPackageJSON = function (root, error) {
|
|
|
48
70
|
}
|
|
49
71
|
};
|
|
50
72
|
exports.getPackageJSON = getPackageJSON;
|
|
51
|
-
function getShapesJSONLD(
|
|
52
|
-
|
|
73
|
+
/*export function getShapesJSONLD(packageExports): Promise<string> {
|
|
74
|
+
// return JSONLDWriter.stringify(getShapes(packageExports));
|
|
53
75
|
}
|
|
54
|
-
|
|
55
|
-
function getShapes(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
76
|
+
|
|
77
|
+
export function getShapes(packageExports): CoreSet<SHACL_Shape> {
|
|
78
|
+
let shapes = new CoreSet<SHACL_Shape>();
|
|
79
|
+
for (var key in packageExports) {
|
|
80
|
+
let moduleExport = packageExports[key];
|
|
81
|
+
// console.log(key, Object.keys(packageExports[key]));
|
|
82
|
+
if (moduleExport.shape) {
|
|
83
|
+
// console.log(Object.keys(moduleExport.shape));
|
|
84
|
+
if (moduleExport.shape && moduleExport.shape instanceof SHACL_Shape) {
|
|
85
|
+
shapes.add(moduleExport.shape);
|
|
86
|
+
}
|
|
66
87
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
88
|
+
}
|
|
89
|
+
return shapes;
|
|
90
|
+
}*/
|
|
70
91
|
function generateScopedName(name, filename, css) {
|
|
71
92
|
var path = require('path');
|
|
72
93
|
var file = path.basename(filename, '.scss');
|
|
@@ -112,7 +133,7 @@ function debug(config) {
|
|
|
112
133
|
messages[_i - 1] = arguments[_i];
|
|
113
134
|
}
|
|
114
135
|
if (config.debug) {
|
|
115
|
-
log.apply(void 0, messages);
|
|
136
|
+
log.apply(void 0, __spreadArray([], __read(messages), false));
|
|
116
137
|
}
|
|
117
138
|
}
|
|
118
139
|
exports.debug = debug;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lincd-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Command line tools for the lincd.js library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"grunt-ts": "^6.0.0-beta.22",
|
|
52
52
|
"grunt-webpack": "^5.0.0",
|
|
53
53
|
"license-info-webpack-plugin": "^3.0.0",
|
|
54
|
-
"lincd": "^0.3",
|
|
54
|
+
"lincd": "^0.3.6",
|
|
55
55
|
"lincd-jsonld": "^0.1.4",
|
|
56
56
|
"load-grunt-tasks": "^5.1.0",
|
|
57
57
|
"mini-css-extract-plugin": "^2.6.1",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"ts-node": "10.7",
|
|
73
73
|
"tsc-hooks": "^1.1.1",
|
|
74
74
|
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
75
|
-
"typescript": "4.
|
|
75
|
+
"typescript": "4.8.4",
|
|
76
76
|
"webpack": "^5.74.0",
|
|
77
77
|
"webpack-bundle-analyzer": "^4.6.1",
|
|
78
78
|
"webpack-license-plugin": "^4.2.2"
|