lincd-cli 0.2.58 → 0.2.60

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 (81) hide show
  1. package/.husky/post-merge +3 -3
  2. package/.husky/pre-commit +4 -4
  3. package/.prettierignore +3 -3
  4. package/.prettierrc.json +23 -23
  5. package/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -0
  6. package/.yarn/versions/d035ef78.yml +0 -0
  7. package/LICENSE +373 -373
  8. package/README.md +24 -24
  9. package/defaults/app/Gruntfile.js +5 -5
  10. package/defaults/app/index.html +12 -12
  11. package/defaults/app/package.json +30 -30
  12. package/defaults/app/src/App.scss +2 -2
  13. package/defaults/app/src/App.tsx +4 -4
  14. package/defaults/app/src/index.tsx +10 -10
  15. package/defaults/app/tsconfig-es5.json +18 -18
  16. package/defaults/app/tsconfig.json +21 -21
  17. package/defaults/app-static/capacitor.config.ts +48 -48
  18. package/defaults/app-static/src/index-static.tsx +27 -27
  19. package/defaults/app-static/web/index.html +21 -21
  20. package/defaults/app-with-backend/.env-cmdrc.json +16 -16
  21. package/defaults/app-with-backend/.eslintignore +2 -2
  22. package/defaults/app-with-backend/.eslintrc.json +40 -40
  23. package/defaults/app-with-backend/.husky/post-merge +3 -3
  24. package/defaults/app-with-backend/.husky/pre-commit +4 -4
  25. package/defaults/app-with-backend/.prettierignore +3 -3
  26. package/defaults/app-with-backend/.prettierrc.json +27 -27
  27. package/defaults/app-with-backend/.run/start.run.xml +11 -11
  28. package/defaults/app-with-backend/.vscode/launch.json +11 -11
  29. package/defaults/app-with-backend/.yarn/plugins/@yarnpkg/plugin-version.cjs +550 -550
  30. package/defaults/app-with-backend/.yarn/releases/yarn-3.6.1.cjs +874 -874
  31. package/defaults/app-with-backend/babel.config.js +4 -4
  32. package/defaults/app-with-backend/gitignore.template +22 -22
  33. package/defaults/app-with-backend/lincd.config.js +7 -7
  34. package/defaults/app-with-backend/package.json +92 -92
  35. package/defaults/app-with-backend/pm2.config.js +12 -12
  36. package/defaults/app-with-backend/readme.md +8 -8
  37. package/defaults/app-with-backend/scripts/build.js +41 -42
  38. package/defaults/app-with-backend/scripts/setup_storage.js +6 -6
  39. package/defaults/app-with-backend/scripts/start-server.js +11 -11
  40. package/defaults/app-with-backend/src/App.scss +6 -6
  41. package/defaults/app-with-backend/src/App.tsx +34 -34
  42. package/defaults/app-with-backend/src/backend.ts +1 -1
  43. package/defaults/app-with-backend/src/components/Error.scss +9 -9
  44. package/defaults/app-with-backend/src/components/Error.tsx +14 -14
  45. package/defaults/app-with-backend/src/components/Spinner.scss +17 -17
  46. package/defaults/app-with-backend/src/components/Spinner.tsx +12 -12
  47. package/defaults/app-with-backend/src/index.tsx +32 -32
  48. package/defaults/app-with-backend/src/layout/DefaultLayout.scss +6 -6
  49. package/defaults/app-with-backend/src/layout/DefaultLayout.tsx +13 -13
  50. package/defaults/app-with-backend/src/layout/Header.scss +10 -10
  51. package/defaults/app-with-backend/src/layout/Header.tsx +23 -23
  52. package/defaults/app-with-backend/src/package.ts +14 -14
  53. package/defaults/app-with-backend/src/pages/Home.scss +15 -15
  54. package/defaults/app-with-backend/src/pages/Home.tsx +21 -21
  55. package/defaults/app-with-backend/src/pages/Page1.tsx +11 -11
  56. package/defaults/app-with-backend/src/pages/PageNotFound.tsx +11 -11
  57. package/defaults/app-with-backend/src/pages/Signin.tsx +12 -12
  58. package/defaults/app-with-backend/src/routes.tsx +72 -72
  59. package/defaults/app-with-backend/src/scss/global-overwrites.scss +11 -11
  60. package/defaults/app-with-backend/src/scss/variables.scss +23 -23
  61. package/defaults/app-with-backend/tsconfig.json +21 -21
  62. package/defaults/app-with-backend/yarnrc.yml.template +8 -8
  63. package/defaults/capacitor/scripts/fix-namespace.js +41 -41
  64. package/defaults/component.scss +2 -2
  65. package/defaults/component.tsx +11 -11
  66. package/defaults/package/package.json +38 -38
  67. package/defaults/package/src/components/ExampleComponent.tsx +8 -8
  68. package/defaults/package/src/data/example-ontology.json +20 -20
  69. package/defaults/package/src/data/example-ontology.json.d.ts +1 -1
  70. package/defaults/package/src/index.ts +7 -7
  71. package/defaults/package/src/ontologies/example-ontology.ts +36 -36
  72. package/defaults/package/src/package.ts +4 -4
  73. package/defaults/package/src/shapes/ExampleShapeClass.ts +29 -29
  74. package/defaults/set-component.tsx +15 -15
  75. package/defaults/shape.ts +8 -8
  76. package/expose-grunt.js +1 -1
  77. package/lib/cli-methods.js +50 -22
  78. package/lib/cli.js +5 -3
  79. package/lib/config-grunt.js +7 -7
  80. package/lib/plugins/check-imports.js +1 -1
  81. package/package.json +1 -1
@@ -1,41 +1,41 @@
1
- fs = require('fs');
2
-
3
- let file = 'android/capacitor-cordova-android-plugins/build.gradle';
4
-
5
- //check if file exists
6
- if (!fs.existsSync(file)) {
7
- console.log('File does not exist.', file);
8
- } else {
9
- //read contents of "android/capacitor-cordova-android-plugins/build.gradle"
10
- let contents = fs.readFileSync(file, 'utf8');
11
-
12
- if (!contents.includes('namespace')) {
13
- //insert text on line 19
14
- contents = contents.replace(
15
- /android \{/,
16
- `android {
17
- namespace 'capacitor.android.plugins'`,
18
- );
19
-
20
- //write back to file
21
- fs.writeFileSync(file, contents, 'utf8');
22
-
23
- console.log('Added namespace to ' + file);
24
- } else {
25
- console.log('Namespace already present in ' + file);
26
- }
27
- }
28
-
29
- let file2 = 'ios/App/Pods/Pods.xcodeproj/project.pbxproj';
30
- if (!fs.existsSync(file2)) {
31
- console.log('File does not exist.', file2);
32
- } else {
33
- let contents2 = fs.readFileSync(file2, 'utf8');
34
- if (contents2.includes('IPHONEOS_DEPLOYMENT_TARGET = 12.0')) {
35
- contents2 = contents2.replace(/IPHONEOS_DEPLOYMENT_TARGET \= 12\.0/g, `IPHONEOS_DEPLOYMENT_TARGET = 13.0`);
36
- fs.writeFileSync(file2, contents2, 'utf8');
37
- console.log('Fixed IOS target version for codetrix google oauth plugin');
38
- } else {
39
- console.log("Didn't need to fix IOS target version");
40
- }
41
- }
1
+ fs = require('fs');
2
+
3
+ let file = 'android/capacitor-cordova-android-plugins/build.gradle';
4
+
5
+ //check if file exists
6
+ if (!fs.existsSync(file)) {
7
+ console.log('File does not exist.', file);
8
+ } else {
9
+ //read contents of "android/capacitor-cordova-android-plugins/build.gradle"
10
+ let contents = fs.readFileSync(file, 'utf8');
11
+
12
+ if (!contents.includes('namespace')) {
13
+ //insert text on line 19
14
+ contents = contents.replace(
15
+ /android \{/,
16
+ `android {
17
+ namespace 'capacitor.android.plugins'`,
18
+ );
19
+
20
+ //write back to file
21
+ fs.writeFileSync(file, contents, 'utf8');
22
+
23
+ console.log('Added namespace to ' + file);
24
+ } else {
25
+ console.log('Namespace already present in ' + file);
26
+ }
27
+ }
28
+
29
+ let file2 = 'ios/App/Pods/Pods.xcodeproj/project.pbxproj';
30
+ if (!fs.existsSync(file2)) {
31
+ console.log('File does not exist.', file2);
32
+ } else {
33
+ let contents2 = fs.readFileSync(file2, 'utf8');
34
+ if (contents2.includes('IPHONEOS_DEPLOYMENT_TARGET = 12.0')) {
35
+ contents2 = contents2.replace(/IPHONEOS_DEPLOYMENT_TARGET \= 12\.0/g, `IPHONEOS_DEPLOYMENT_TARGET = 13.0`);
36
+ fs.writeFileSync(file2, contents2, 'utf8');
37
+ console.log('Fixed IOS target version for codetrix google oauth plugin');
38
+ } else {
39
+ console.log("Didn't need to fix IOS target version");
40
+ }
41
+ }
@@ -1,3 +1,3 @@
1
- .${camel_name} {
2
- display:block;
1
+ .${camel_name} {
2
+ display:block;
3
3
  }
@@ -1,12 +1,12 @@
1
- import React from "react";
2
- import "./${hyphen_name}.scss";
3
- import {default as style} from "./${hyphen_name}.scss.json";
4
- import {registerPackageModule,linkedComponent} from '../package';
5
-
6
- //TODO: replace SHAPE with an actual Shape class
7
- export const ${camel_name} = linkedComponent<SHAPE>(SHAPE,({source}) => {
8
- return <div className={style.${camel_name}}></div>;
9
- });
10
-
11
- //register all components in this file
1
+ import React from "react";
2
+ import "./${hyphen_name}.scss";
3
+ import {default as style} from "./${hyphen_name}.scss.json";
4
+ import {registerPackageModule,linkedComponent} from '../package';
5
+
6
+ //TODO: replace SHAPE with an actual Shape class
7
+ export const ${camel_name} = linkedComponent<SHAPE>(SHAPE,({source}) => {
8
+ return <div className={style.${camel_name}}></div>;
9
+ });
10
+
11
+ //register all components in this file
12
12
  registerPackageModule(module);
@@ -1,38 +1,38 @@
1
- {
2
- "name": "${package_name}",
3
- "description": "",
4
- "author": {
5
- "name": "",
6
- "email": "",
7
- "url": ""
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": ""
12
- },
13
- "version": "0.1.0",
14
- "lincd": true,
15
- "main": "lib/index.js",
16
- "types": "dist/${output_file_name}.d.ts",
17
- "license": "ISC",
18
- "scripts": {
19
- "start": "npm exec lincd dev",
20
- "build": "npm exec lincd build",
21
- "prepublishOnly": "npm exec lincd build production",
22
- "postpublish": "npm exec lincd register"
23
- },
24
- "keywords": [
25
- "lincd",
26
- "linked data",
27
- "interoperable",
28
- "semantic web",
29
- "web3"
30
- ],
31
- "dependencies": {
32
- "lincd": "^0.5",
33
- "lincd-jsonld": "^0.1"
34
- },
35
- "devDependencies": {
36
- "lincd-cli": "^0.2"
37
- }
38
- }
1
+ {
2
+ "name": "${package_name}",
3
+ "description": "",
4
+ "author": {
5
+ "name": "",
6
+ "email": "",
7
+ "url": ""
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": ""
12
+ },
13
+ "version": "0.1.0",
14
+ "lincd": true,
15
+ "main": "lib/index.js",
16
+ "types": "dist/${output_file_name}.d.ts",
17
+ "license": "ISC",
18
+ "scripts": {
19
+ "start": "npm exec lincd dev",
20
+ "build": "npm exec lincd build",
21
+ "prepublishOnly": "npm exec lincd build production",
22
+ "postpublish": "npm exec lincd register"
23
+ },
24
+ "keywords": [
25
+ "lincd",
26
+ "linked data",
27
+ "interoperable",
28
+ "semantic web",
29
+ "web3"
30
+ ],
31
+ "dependencies": {
32
+ "lincd": "^0.5",
33
+ "lincd-jsonld": "^0.1"
34
+ },
35
+ "devDependencies": {
36
+ "lincd-cli": "^0.2"
37
+ }
38
+ }
@@ -1,8 +1,8 @@
1
- import React from "react";
2
- import {ExampleShapeClass} from "../shapes/ExampleShapeClass";
3
- import {linkedComponent} from '../package';
4
-
5
- export const ExampleComponent = linkedComponent<ExampleShapeClass>(ExampleShapeClass, ({source}) => {
6
- //note that typescript knows that 'source' is an instance of the Shape you linked this component to
7
- return <div></div>;
8
- });
1
+ import React from "react";
2
+ import {ExampleShapeClass} from "../shapes/ExampleShapeClass";
3
+ import {linkedComponent} from '../package';
4
+
5
+ export const ExampleComponent = linkedComponent<ExampleShapeClass>(ExampleShapeClass, ({source}) => {
6
+ //note that typescript knows that 'source' is an instance of the Shape you linked this component to
7
+ return <div></div>;
8
+ });
@@ -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
- "${hyphen_name}": "${uri_base}"
8
- },
9
- "@graph": [
10
- {
11
- "@id": "${hyphen_name}:ExampleClass",
12
- "@type": "rdfs:Class",
13
- "rdfs:comment": "This is an example class. You can remove or rename it",
14
- "rdfs:isDefinedBy": {
15
- "@id": "${hyphen_name}:"
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
+ "${hyphen_name}": "${uri_base}"
8
+ },
9
+ "@graph": [
10
+ {
11
+ "@id": "${hyphen_name}:ExampleClass",
12
+ "@type": "rdfs:Class",
13
+ "rdfs:comment": "This is an example class. You can remove or rename it",
14
+ "rdfs:isDefinedBy": {
15
+ "@id": "${hyphen_name}:"
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/${hyphen_name}';
2
-
3
- //SHAPES FIRST
4
- import './shapes/ExampleShapeClass';
5
-
6
- //THEN COMPONENTS
7
- import './components/ExampleComponent';
1
+ import './ontologies/${hyphen_name}';
2
+
3
+ //SHAPES FIRST
4
+ import './shapes/ExampleShapeClass';
5
+
6
+ //THEN COMPONENTS
7
+ import './components/ExampleComponent';
@@ -1,36 +1,36 @@
1
- import {NamedNode} from 'lincd/lib/models';
2
- import {JSONLD} from 'lincd-jsonld/lib/utils/JSONLD';
3
- import {createNameSpace} from 'lincd/lib/utils/NameSpace';
4
- import {linkedOntology} from '../package';
5
- //import all the exports of this file as one variable called _this (we need this at the end)
6
- import * as _this from './${hyphen_name}';
7
-
8
- /**
9
- * Load the data of this ontology into memory, thus adding the properties of the entities of this ontology to the local graph.
10
- */
11
- export var loadData = () => {
12
- return import('../data/${hyphen_name}.json').then((data) => JSONLD.parse(data));
13
- };
14
-
15
- /**
16
- * The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file
17
- */
18
- export var ns = createNameSpace('${uri_base}');
19
-
20
- /**
21
- * The NamedNode of the ontology itself
22
- */
23
- export var _self: NamedNode = ns('');
24
-
25
- //A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode
26
- export var ExampleClass: NamedNode = ns('ExampleClass');
27
- export var exampleProperty: NamedNode = ns('exampleProperty');
28
-
29
- //An extra grouping object so all the entities can be accessed from the prefix/name
30
- export const ${camel_name} = {
31
- ExampleClass,
32
- exampleProperty,
33
- };
34
-
35
- //Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things
36
- linkedOntology(_this, ns, '${hyphen_name}', loadData, '../data/${hyphen_name}.json');
1
+ import {NamedNode} from 'lincd/lib/models';
2
+ import {JSONLD} from 'lincd-jsonld/lib/utils/JSONLD';
3
+ import {createNameSpace} from 'lincd/lib/utils/NameSpace';
4
+ import {linkedOntology} from '../package';
5
+ //import all the exports of this file as one variable called _this (we need this at the end)
6
+ import * as _this from './${hyphen_name}';
7
+
8
+ /**
9
+ * Load the data of this ontology into memory, thus adding the properties of the entities of this ontology to the local graph.
10
+ */
11
+ export var loadData = () => {
12
+ return import('../data/${hyphen_name}.json').then((data) => JSONLD.parse(data));
13
+ };
14
+
15
+ /**
16
+ * The namespace of this ontology, which can be used to create NamedNodes with URI's not listed in this file
17
+ */
18
+ export var ns = createNameSpace('${uri_base}');
19
+
20
+ /**
21
+ * The NamedNode of the ontology itself
22
+ */
23
+ export var _self: NamedNode = ns('');
24
+
25
+ //A list of all the entities (Classes & Properties) of this ontology, each exported as a NamedNode
26
+ export var ExampleClass: NamedNode = ns('ExampleClass');
27
+ export var exampleProperty: NamedNode = ns('exampleProperty');
28
+
29
+ //An extra grouping object so all the entities can be accessed from the prefix/name
30
+ export const ${camel_name} = {
31
+ ExampleClass,
32
+ exampleProperty,
33
+ };
34
+
35
+ //Registers this ontology to LINCD.JS, so that data loading can be automated amongst other things
36
+ linkedOntology(_this, ns, '${hyphen_name}', loadData, '../data/${hyphen_name}.json');
@@ -1,4 +1,4 @@
1
- import {linkedPackage} from 'lincd/lib/utils/Module';
2
-
3
- export const {linkedComponent, linkedComponentClass, linkedShape, linkedUtil, linkedOntology, registerPackageModule, registerPackageExport, packageExports, packageName} =
4
- linkedPackage('${package_name}');
1
+ import {linkedPackage} from 'lincd/lib/utils/Module';
2
+
3
+ export const {linkedComponent, linkedComponentClass, linkedShape, linkedUtil, linkedOntology, registerPackageModule, registerPackageExport, packageExports, packageName} =
4
+ linkedPackage('${package_name}');
@@ -1,29 +1,29 @@
1
- import {Shape} from 'lincd/lib/shapes/Shape';
2
- import {Literal, NamedNode} from 'lincd/lib/models';
3
- import {linkedShape} from '../package';
4
- import {literalProperty} from 'lincd/lib/utils/ShapeDecorators';
5
- import {${camel_name}} from '../ontologies/${hyphen_name}';
6
-
7
- @linkedShape
8
- export class ExampleShapeClass extends Shape {
9
- /**
10
- * indicates that instances of this shape need to have this rdf.type
11
- */
12
- static targetClass: NamedNode = ${camel_name}.ExampleClass;
13
-
14
- /**
15
- * instances of this shape need to have exactly one value defined for the given property
16
- */
17
- @literalProperty({
18
- path: ${camel_name}.exampleProperty,
19
- required: true,
20
- maxCount: 1,
21
- })
22
- get name() {
23
- return this.getValue(${camel_name}.exampleProperty);
24
- }
25
-
26
- set name(val: string) {
27
- this.overwrite(${camel_name}.exampleProperty, new Literal(val));
28
- }
29
- }
1
+ import {Shape} from 'lincd/lib/shapes/Shape';
2
+ import {Literal, NamedNode} from 'lincd/lib/models';
3
+ import {linkedShape} from '../package';
4
+ import {literalProperty} from 'lincd/lib/utils/ShapeDecorators';
5
+ import {${camel_name}} from '../ontologies/${hyphen_name}';
6
+
7
+ @linkedShape
8
+ export class ExampleShapeClass extends Shape {
9
+ /**
10
+ * indicates that instances of this shape need to have this rdf.type
11
+ */
12
+ static targetClass: NamedNode = ${camel_name}.ExampleClass;
13
+
14
+ /**
15
+ * instances of this shape need to have exactly one value defined for the given property
16
+ */
17
+ @literalProperty({
18
+ path: ${camel_name}.exampleProperty,
19
+ required: true,
20
+ maxCount: 1,
21
+ })
22
+ get name() {
23
+ return this.getValue(${camel_name}.exampleProperty);
24
+ }
25
+
26
+ set name(val: string) {
27
+ this.overwrite(${camel_name}.exampleProperty, new Literal(val));
28
+ }
29
+ }
@@ -1,16 +1,16 @@
1
- import React from "react";
2
- import "./${hyphen_name}.scss";
3
- import {default as style} from "./${hyphen_name}.scss.json";
4
- import {registerPackageModule,linkedSetComponent} from '../package';
5
-
6
- //TODO: replace SHAPE with an actual Shape class
7
- export const ${camel_name} = linkedSetComponent<SHAPE>(SHAPE,({sources}) => {
8
- return <div className={style.${camel_name}}>
9
- {sources.map(source => {
10
- return <div key={source.toString()}></div>;
11
- })}
12
- </div>;
13
- });
14
-
15
- //register all components in this file
1
+ import React from "react";
2
+ import "./${hyphen_name}.scss";
3
+ import {default as style} from "./${hyphen_name}.scss.json";
4
+ import {registerPackageModule,linkedSetComponent} from '../package';
5
+
6
+ //TODO: replace SHAPE with an actual Shape class
7
+ export const ${camel_name} = linkedSetComponent<SHAPE>(SHAPE,({sources}) => {
8
+ return <div className={style.${camel_name}}>
9
+ {sources.map(source => {
10
+ return <div key={source.toString()}></div>;
11
+ })}
12
+ </div>;
13
+ });
14
+
15
+ //register all components in this file
16
16
  registerPackageModule(module);
package/defaults/shape.ts CHANGED
@@ -1,8 +1,8 @@
1
- import {Shape} from 'lincd/lib/shapes/Shape';
2
- import {NamedNode} from 'lincd/lib/models';
3
- import {linkedShape} from '../package';
4
-
5
- @linkedShape
6
- export class ${camel_name} extends Shape {
7
- static targetClass:NamedNode;
8
- }
1
+ import {Shape} from 'lincd/lib/shapes/Shape';
2
+ import {NamedNode} from 'lincd/lib/models';
3
+ import {linkedShape} from '../package';
4
+
5
+ @linkedShape
6
+ export class ${camel_name} extends Shape {
7
+ static targetClass:NamedNode;
8
+ }
package/expose-grunt.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- // console.log('forwarding to grunt: ', process.argv.slice(2).join(' '));
2
+ // console.log('forwarding to grunt: ', process.argv.slice(2).join(' '));
3
3
  require('grunt-cli/bin/grunt');
@@ -753,10 +753,25 @@ exports.checkImports = checkImports;
753
753
  const depCheck = () => __awaiter(void 0, void 0, void 0, function* () {
754
754
  (0, depcheck_1.default)(process.cwd(), {}, (results) => {
755
755
  if (results.missing) {
756
+ let lincdPackages = getLocalLincdModules();
756
757
  let missing = Object.keys(results.missing);
758
+ //filter out missing types, if it builds we're not too concerned about that at the moment?
759
+ //especially things like @types/react, @types/react-dom, @types/node (they are added elsewhere?)
760
+ // missing = missing.filter(m => m.indexOf('@types/') === 0);
757
761
  //currently react is not an explicit dependency, but we should add it as a peer dependency
758
- missing.splice(missing.indexOf('react'));
759
- if (missing.length > 0) {
762
+ missing.splice(missing.indexOf('react'), 1);
763
+ let missingLincdPackages = missing.filter((missingDep) => {
764
+ return lincdPackages.some((lincdPackage) => {
765
+ return lincdPackage.packageName === missingDep;
766
+ });
767
+ });
768
+ //currently just missing LINCD packages cause a hard failure exit code
769
+ if (missingLincdPackages.length > 0) {
770
+ console.warn(chalk_1.default.red('\nThese LINCD packages are imported but they are not listed in package.json:\n- ' +
771
+ missingLincdPackages.join(',\n- ')));
772
+ process.exit(1);
773
+ }
774
+ else if (missing.length > 0) {
760
775
  console.warn(chalk_1.default.red('Missing dependencies:\n\t' + missing.join(',\n\t')));
761
776
  }
762
777
  }
@@ -1250,7 +1265,7 @@ var publishPackage = function (pkg, test, info, publishVersion) {
1250
1265
  });
1251
1266
  };
1252
1267
  exports.publishPackage = publishPackage;
1253
- var buildUpdated = function (back, target, target2, test = false) {
1268
+ var buildUpdated = function (back, target, target2, useGitForLastModified = false, test = false) {
1254
1269
  return __awaiter(this, void 0, void 0, function* () {
1255
1270
  // back = back || 1;
1256
1271
  // return execPromise(`git log -${back} --format=%ci`).then((result) => {
@@ -1262,8 +1277,8 @@ var buildUpdated = function (back, target, target2, test = false) {
1262
1277
  // let packages = getLocalLincdModules();
1263
1278
  let packages = getLocalLincdPackageMap();
1264
1279
  // console.log(packages);
1265
- let jsonldPkgUpdated = needsRebuilding(packages.get('lincd-jsonld'));
1266
- // let cliPkgUpdated = needsRebuilding(packages.get('lincd-cli'));
1280
+ let jsonldPkgUpdated = yield needsRebuilding(packages.get('lincd-jsonld'), useGitForLastModified);
1281
+ // let cliPkgUpdated = await needsRebuilding(packages.get('lincd-cli'), useGitForLastModified);
1267
1282
  //if either cli or jsonldPkg needs to be rebuilt
1268
1283
  // if (jsonldPkgUpdated || cliPkgUpdated) {
1269
1284
  if (jsonldPkgUpdated) {
@@ -1281,7 +1296,7 @@ var buildUpdated = function (back, target, target2, test = false) {
1281
1296
  packagesLeft = packagesLeft - packageGroup.length;
1282
1297
  return (pkg) => __awaiter(this, void 0, void 0, function* () {
1283
1298
  // debugInfo('# Checking package ' + pkg.packageName);
1284
- let needRebuild = needsRebuilding(pkg, true);
1299
+ let needRebuild = yield needsRebuilding(pkg, useGitForLastModified, true);
1285
1300
  if (pkg.packageName === 'lincd-jsonld' && jsonldPkgUpdated) {
1286
1301
  needRebuild = true;
1287
1302
  }
@@ -1330,22 +1345,35 @@ var buildUpdated = function (back, target, target2, test = false) {
1330
1345
  });
1331
1346
  };
1332
1347
  exports.buildUpdated = buildUpdated;
1333
- const needsRebuilding = function (pkg, log = false) {
1334
- let lastModifiedSource = getLastModifiedSourceTime(pkg.path);
1335
- let lastModifiedBundle = getLastBuildTime(pkg.path);
1336
- let result = lastModifiedSource.lastModifiedTime > lastModifiedBundle.lastModifiedTime;
1337
- if (log) {
1338
- console.log(chalk_1.default.cyan('Last modified source: ' +
1339
- lastModifiedSource.lastModifiedName +
1340
- ' on ' +
1341
- lastModifiedSource.lastModified.toString()));
1342
- console.log(chalk_1.default.cyan('Last build: ' +
1343
- (lastModifiedBundle &&
1344
- typeof lastModifiedBundle.lastModified !== 'undefined'
1345
- ? lastModifiedBundle.lastModified.toString()
1346
- : 'never')));
1347
- }
1348
- return result;
1348
+ const needsRebuilding = function (pkg, useGitForLastModified, log = false) {
1349
+ return __awaiter(this, void 0, void 0, function* () {
1350
+ let lastModifiedSourceDate;
1351
+ let lastModifiedSourceName;
1352
+ if (useGitForLastModified) {
1353
+ const { changes, commitId, date } = yield getLastCommitTime(pkg.path);
1354
+ lastModifiedSourceDate = date;
1355
+ lastModifiedSourceName = commitId;
1356
+ }
1357
+ else {
1358
+ const { lastModified, lastModifiedName, lastModifiedTime } = getLastModifiedSourceTime(pkg.path);
1359
+ lastModifiedSourceName = lastModifiedName;
1360
+ lastModifiedSourceDate = lastModified;
1361
+ }
1362
+ let lastModifiedBundle = getLastBuildTime(pkg.path);
1363
+ let result = lastModifiedSourceDate.getTime() > lastModifiedBundle.lastModifiedTime;
1364
+ if (log) {
1365
+ console.log(chalk_1.default.cyan('Last modified source: ' +
1366
+ lastModifiedSourceName +
1367
+ ' on ' +
1368
+ lastModifiedSourceDate.toString()));
1369
+ console.log(chalk_1.default.cyan('Last build: ' +
1370
+ (lastModifiedBundle &&
1371
+ typeof lastModifiedBundle.lastModified !== 'undefined'
1372
+ ? lastModifiedBundle.lastModified.toString()
1373
+ : 'never')));
1374
+ }
1375
+ return result;
1376
+ });
1349
1377
  };
1350
1378
  const printBuildResults = function (failed, done) {
1351
1379
  log('Successfully built: ' +
package/lib/cli.js CHANGED
@@ -97,9 +97,11 @@ program.command('status').action(() => {
97
97
  });
98
98
  program
99
99
  .command('build-updated [target] [target2]')
100
- .action((target, target2) => {
101
- return (0, cli_methods_1.buildUpdated)(1, target, target2);
102
- });
100
+ .action((target, target2, options) => {
101
+ const { useGit } = options;
102
+ return (0, cli_methods_1.buildUpdated)(1, target, target2, useGit || false);
103
+ })
104
+ .option('--use-git', 'Use git commit timestamps to check which packages have been updated since the last build');
103
105
  program
104
106
  .command('build-updated-since [num-commits-back] [target] [target2]')
105
107
  .action((back, target, target2) => {
@@ -88,7 +88,7 @@ function setupGrunt(grunt, moduleName, config) {
88
88
  // buildFrontend ? 'webpack:build-es6' : null,
89
89
  buildServer
90
90
  ? [
91
- 'clean:lib',
91
+ // 'clean:lib',
92
92
  'exec:build-lib',
93
93
  'copy:lib',
94
94
  'exec:depcheck',
@@ -157,7 +157,7 @@ function setupGrunt(grunt, moduleName, config) {
157
157
  ].filter(Boolean),
158
158
  }),
159
159
  ],
160
- // writeDest: false,
160
+ writeDest: false,
161
161
  },
162
162
  cssjson: {
163
163
  src: 'src/**/*.scss',
@@ -269,11 +269,11 @@ function setupGrunt(grunt, moduleName, config) {
269
269
  grunt.task.loadTasks(nestedWorkspacePath);
270
270
  }
271
271
  else {
272
- (0, utils_1.warn)(`Could not load grunt task module ${taskName}
273
- Could not find task at any of these paths:
274
- ${localPath}
275
- ${localPath2}
276
- ${workspacePath}
272
+ (0, utils_1.warn)(`Could not load grunt task module ${taskName}
273
+ Could not find task at any of these paths:
274
+ ${localPath}
275
+ ${localPath2}
276
+ ${workspacePath}
277
277
  ${nestedWorkspacePath}`);
278
278
  }
279
279
  });
@@ -54,7 +54,7 @@ function handler(source) {
54
54
  if (isRelativeReq &&
55
55
  this.resourcePath.indexOf(baseUrl) !== 0 &&
56
56
  this.resourcePath.indexOf('node_modules') === -1) {
57
- this.emitError(Error(`LINCD Error: You are importing a file from outside the baseUrl ${tsconfig.compilerOptions.baseUrl}.
57
+ this.emitError(Error(`LINCD Error: You are importing a file from outside the baseUrl ${tsconfig.compilerOptions.baseUrl}.
58
58
  ${relativePath} is not in ${tsconfig.compilerOptions.baseUrl}.`));
59
59
  }
60
60
  // if (this.resourcePath.indexOf(path.resolve('./src')) !== 0) {