lincd-cli 0.2.38 → 0.2.41

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,8 +1,9 @@
1
1
  {
2
- "_main" : {
2
+ "_main": {
3
3
  "DATA_ROOT": "https://app.${hyphen_name}.com/data",
4
+ "APP_PREFIX": "${underscore_name}",
4
5
  "APP_NAME": "${name}",
5
- "SOURCE_PATH" : "./src"
6
+ "SOURCE_PATH": "./src"
6
7
  },
7
8
  "development": {
8
9
  "NODE_ENV": "development",
@@ -10,6 +11,6 @@
10
11
  },
11
12
  "production": {
12
13
  "NODE_ENV": "production",
13
- "SITE_ROOT": "https://app.${hyphen_name}.com/data"
14
+ "SITE_ROOT": "https://app.${hyphen_name}.com"
14
15
  }
15
- }
16
+ }
@@ -18,5 +18,6 @@ packages/**/.yarn/*
18
18
  !packages/**/.yarn/releases
19
19
  !packages/**/.yarn/sdks
20
20
  !packages/**/.yarn/versions
21
+ .idea
21
22
  android/app/build
22
23
  ios/App/App/public
@@ -0,0 +1 @@
1
+ mrgit.json
@@ -35,7 +35,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
35
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
36
  };
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.executeCommandForPackage = exports.addCapacitor = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishPackage = exports.publishUpdated = exports.buildPackage = exports.buildMetadata = exports.register = exports.createPackage = exports.depCheck = exports.createComponent = exports.createSetComponent = exports.createShape = exports.createOntology = exports.getLincdPackages = exports.buildAll = exports.developPackage = exports.createApp = void 0;
38
+ exports.executeCommandForPackage = exports.addCapacitor = exports.addLinesToFile = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishPackage = exports.publishUpdated = exports.buildPackage = exports.buildMetadata = exports.register = exports.createPackage = exports.depCheck = exports.createComponent = exports.createSetComponent = exports.createShape = exports.setNameVariables = exports.createOntology = exports.getLincdPackages = exports.buildAll = exports.developPackage = exports.createApp = void 0;
39
39
  const path_1 = __importDefault(require("path"));
40
40
  const fs_extra_1 = __importDefault(require("fs-extra"));
41
41
  const utils_1 = require("./utils");
@@ -56,7 +56,7 @@ const createApp = (name, basePath = process.cwd()) => __awaiter(void 0, void 0,
56
56
  if (!name) {
57
57
  console.warn('Please provide a name as the first argument');
58
58
  }
59
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(name);
59
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(name);
60
60
  let targetFolder = path_1.default.join(basePath, hyphenName);
61
61
  if (!fs_extra_1.default.existsSync(targetFolder)) {
62
62
  fs_extra_1.default.mkdirSync(targetFolder);
@@ -64,6 +64,7 @@ const createApp = (name, basePath = process.cwd()) => __awaiter(void 0, void 0,
64
64
  fs_extra_1.default.copySync(path_1.default.join(__dirname, '..', 'defaults', 'app-with-backend'), targetFolder);
65
65
  //make sure the data folder exists (even though its empty).. copying empty folders does not work with fs.copySync
66
66
  fs_extra_1.default.mkdirSync(path_1.default.join(targetFolder, 'data'), { recursive: true });
67
+ fs_extra_1.default.mkdirSync(path_1.default.join(targetFolder, 'data/uploads/resized'), { recursive: true });
67
68
  fs_extra_1.default.renameSync(path_1.default.join(targetFolder, 'gitignore.template'), path_1.default.join(targetFolder, '.gitignore'));
68
69
  fs_extra_1.default.renameSync(path_1.default.join(targetFolder, 'yarnrc.yml.template'), path_1.default.join(targetFolder, '.yarnrc.yml'));
69
70
  // fs.copySync(path.join(__dirname, '..', 'defaults', 'app'), targetFolder);
@@ -71,7 +72,9 @@ const createApp = (name, basePath = process.cwd()) => __awaiter(void 0, void 0,
71
72
  //replace variables in some copied files
72
73
  yield replaceVariablesInFolder(targetFolder);
73
74
  let hasYarn = yield hasYarnInstalled();
74
- let installCommand = hasYarn ? 'yarn install' : 'npm install';
75
+ let installCommand = hasYarn
76
+ ? 'export NODE_OPTIONS="--no-network-family-autoselection" && yarn install'
77
+ : 'npm install';
75
78
  yield (0, utils_1.execp)(`cd ${hyphenName} && ${installCommand}`, true).catch((err) => {
76
79
  console.warn('Could not install dependencies or start application');
77
80
  });
@@ -102,11 +105,11 @@ function debugInfo(...messages) {
102
105
  // console.log(gruntConfig);
103
106
  // process.exit();
104
107
  // }
105
- // if (gruntConfig && gruntConfig.analyse === true) {
106
- messages.forEach((message) => {
107
- console.log(chalk_1.default.cyan('Info: ') + message);
108
- });
109
- // }
108
+ if (gruntConfig && gruntConfig.analyse === true) {
109
+ messages.forEach((message) => {
110
+ console.log(chalk_1.default.cyan('Info: ') + message);
111
+ });
112
+ }
110
113
  }
111
114
  function warn(...messages) {
112
115
  messages.forEach((message) => {
@@ -538,7 +541,7 @@ const createOntology = (prefix, uriBase, basePath = process.cwd()) => __awaiter(
538
541
  uriBase = 'http://lincd.org/ont/' + prefix + '/';
539
542
  }
540
543
  setVariable('uri_base', uriBase);
541
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(prefix);
544
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(prefix);
542
545
  //copy ontology accessor file
543
546
  log("Creating files for ontology '" + prefix + "'");
544
547
  let targetFile = path_1.default.join(targetFolder, hyphenName + '.ts');
@@ -652,6 +655,7 @@ const setNameVariables = function (name) {
652
655
  setVariable('plain_name', plainName);
653
656
  return { hyphenName, camelCaseName, underscoreName, plainName };
654
657
  };
658
+ exports.setNameVariables = setNameVariables;
655
659
  function getSourceFolder(basePath = process.cwd()) {
656
660
  //LINCD App
657
661
  if (fs_extra_1.default.existsSync(path_1.default.join(basePath, 'frontend', 'src'))) {
@@ -669,7 +673,7 @@ function getSourceFolder(basePath = process.cwd()) {
669
673
  const createShape = (name, basePath = process.cwd()) => __awaiter(void 0, void 0, void 0, function* () {
670
674
  let sourceFolder = getSourceFolder(basePath);
671
675
  let targetFolder = ensureFolderExists(sourceFolder, 'shapes');
672
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(name);
676
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(name);
673
677
  //copy default shape file
674
678
  // log("Creating files for shape '" + name + "'");
675
679
  let targetFile = path_1.default.join(targetFolder, hyphenName + '.ts');
@@ -687,7 +691,7 @@ const createShape = (name, basePath = process.cwd()) => __awaiter(void 0, void 0
687
691
  exports.createShape = createShape;
688
692
  const createSetComponent = (name, basePath = process.cwd()) => __awaiter(void 0, void 0, void 0, function* () {
689
693
  let targetFolder = ensureFolderExists(basePath, 'src', 'components');
690
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(name);
694
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(name);
691
695
  //copy default shape file
692
696
  log("Creating files for set component '" + name + "'");
693
697
  let targetFile = path_1.default.join(targetFolder, hyphenName + '.tsx');
@@ -703,7 +707,7 @@ exports.createSetComponent = createSetComponent;
703
707
  const createComponent = (name, basePath = process.cwd()) => __awaiter(void 0, void 0, void 0, function* () {
704
708
  let sourceFolder = getSourceFolder(basePath);
705
709
  let targetFolder = ensureFolderExists(sourceFolder, 'components');
706
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(name);
710
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(name);
707
711
  //copy default shape file
708
712
  log("Creating files for component '" + name + "'");
709
713
  let targetFile = path_1.default.join(targetFolder, hyphenName + '.tsx');
@@ -769,7 +773,7 @@ const createPackage = (name, uriBase, basePath = process.cwd()) => __awaiter(voi
769
773
  setVariable('package_name', name);
770
774
  //extra variable for clarity (will be same as 'name')
771
775
  setVariable('output_file_name', name);
772
- let { hyphenName, camelCaseName, underscoreName } = setNameVariables(cleanPackageName);
776
+ let { hyphenName, camelCaseName, underscoreName } = (0, exports.setNameVariables)(cleanPackageName);
773
777
  log("Creating new LINCD package '" + name + "'");
774
778
  fs_extra_1.default.copySync(path_1.default.join(__dirname, '..', 'defaults', 'package'), targetFolder);
775
779
  //replace variables in some of the copied files
@@ -1483,7 +1487,7 @@ exports.executeCommandForEachPackage = executeCommandForEachPackage;
1483
1487
  var gitIgnore = function (...entries) {
1484
1488
  //add each entry to the .gitignore file
1485
1489
  let gitIgnorePath = path_1.default.resolve(process.cwd(), '.gitignore');
1486
- addLinesToFile(gitIgnorePath, entries);
1490
+ (0, exports.addLinesToFile)(gitIgnorePath, entries);
1487
1491
  };
1488
1492
  var addLinesToFile = function (filePath, entries) {
1489
1493
  let fileContents = fs_extra_1.default.readFileSync(filePath, { encoding: 'utf8' });
@@ -1492,6 +1496,7 @@ var addLinesToFile = function (filePath, entries) {
1492
1496
  });
1493
1497
  fs_extra_1.default.writeFileSync(filePath, fileContents);
1494
1498
  };
1499
+ exports.addLinesToFile = addLinesToFile;
1495
1500
  var addCapacitor = function (basePath = process.cwd()) {
1496
1501
  return __awaiter(this, void 0, void 0, function* () {
1497
1502
  let targetFolder = ensureFolderExists(basePath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lincd-cli",
3
- "version": "0.2.38",
3
+ "version": "0.2.41",
4
4
  "description": "Command line tools for the lincd.js library",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -41,13 +41,13 @@
41
41
  "chalk": "4.1.0",
42
42
  "child-process-promise": "^2.2.1",
43
43
  "colors": "^1.4.0",
44
- "commander": "^9.4.0",
44
+ "commander": "^11.0.0",
45
45
  "copy-webpack-plugin": "^11.0.0",
46
46
  "css-loader": "^6.7.1",
47
47
  "depcheck": "^1.4.3",
48
48
  "env-cmd": "^10.1.0",
49
49
  "find-nearest-package-json": "^2.0.1",
50
- "fs-extra": "^10.1.0",
50
+ "fs-extra": "^11.1.1",
51
51
  "glob": "^7.1.6",
52
52
  "grunt": "^1.3.0",
53
53
  "grunt-cli": "^1.4.3",
@@ -59,7 +59,7 @@
59
59
  "grunt-webpack": "^5.0.0",
60
60
  "license-info-webpack-plugin": "^3.0.0",
61
61
  "lincd": "^0.5",
62
- "lincd-jsonld": "^0.1.21",
62
+ "lincd-jsonld": "^0.1.22",
63
63
  "lincd-modules": "^0.1",
64
64
  "load-grunt-tasks": "^5.1.0",
65
65
  "mini-css-extract-plugin": "^2.7.5",
@@ -1,16 +0,0 @@
1
- const fs = require('fs');
2
- const which = require('which');
3
- const homedir = require('os').homedir();
4
- const path = require('path');
5
-
6
- which('node').then(resolved => {
7
- try {
8
- fs.writeFileSync(
9
- path.join(homedir, '.huskyrc'),
10
- `export PATH="${path.join(resolved, '..')}:$PATH"`,
11
- );
12
- } catch (err) {
13
- console.log(err);
14
- }
15
- console.log('created .huskyrc in ' + homedir);
16
- });