lincd-cli 0.2.8 → 0.2.9
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-with-backend/package.json +1 -0
- package/lib/cli.js +20 -16
- package/package.json +2 -2
package/lib/cli.js
CHANGED
|
@@ -116,7 +116,7 @@ program
|
|
|
116
116
|
})
|
|
117
117
|
.description('Creates a new ontology file for your package. Execute this from your package folder.')
|
|
118
118
|
.argument('<suggested-prefix>', 'The suggested prefix for your ontology. Also the shorthand code used for the file name and the exported ontology object')
|
|
119
|
-
.argument('[uribase]',
|
|
119
|
+
.argument('[uribase]', "Optional argument to set the URI base for the URI's of all entities in your ontology. Leave blank to use the URI's provided by lincd.org once you register this package");
|
|
120
120
|
program.command('register-local', { hidden: true }).action(function () {
|
|
121
121
|
register('http://localhost:4101');
|
|
122
122
|
});
|
|
@@ -136,7 +136,7 @@ program
|
|
|
136
136
|
console.log(ownPackage.version);
|
|
137
137
|
console.log('Running from: ' + __dirname);
|
|
138
138
|
})
|
|
139
|
-
.description(
|
|
139
|
+
.description("Log the version of this tool and the path that it's running from");
|
|
140
140
|
program.command('build [target] [target2]', { isDefault: true }).action(function (target, target2) {
|
|
141
141
|
buildPackage(target, target2);
|
|
142
142
|
});
|
|
@@ -704,7 +704,7 @@ var createOntology = function (prefix, uriBase, basePath) {
|
|
|
704
704
|
setVariable('uri_base', uriBase);
|
|
705
705
|
_a = setNameVariables(prefix), hyphenName = _a.hyphenName, camelCaseName = _a.camelCaseName, underscoreName = _a.underscoreName;
|
|
706
706
|
//copy ontology accessor file
|
|
707
|
-
log(
|
|
707
|
+
log("Creating files for ontology '" + prefix + "'");
|
|
708
708
|
targetFile = path.join(targetFolder, hyphenName + '.ts');
|
|
709
709
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'package', 'src', 'ontologies', 'example-ontology.ts'), targetFile);
|
|
710
710
|
targetDataFile = path.join(targetFolder, '..', 'data', hyphenName + '.json');
|
|
@@ -828,7 +828,7 @@ var createShape = function (name, basePath) {
|
|
|
828
828
|
targetFolder = ensureFolderExists(basePath, 'src', 'shapes');
|
|
829
829
|
_a = setNameVariables(name), hyphenName = _a.hyphenName, camelCaseName = _a.camelCaseName, underscoreName = _a.underscoreName;
|
|
830
830
|
//copy default shape file
|
|
831
|
-
log(
|
|
831
|
+
log("Creating files for shape '" + name + "'");
|
|
832
832
|
targetFile = path.join(targetFolder, hyphenName + '.ts');
|
|
833
833
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'shape.ts'), targetFile);
|
|
834
834
|
//replace variables in some of the copied files
|
|
@@ -853,7 +853,7 @@ var createSetComponent = function (name, basePath) {
|
|
|
853
853
|
targetFolder = ensureFolderExists(basePath, 'src', 'components');
|
|
854
854
|
_a = setNameVariables(name), hyphenName = _a.hyphenName, camelCaseName = _a.camelCaseName, underscoreName = _a.underscoreName;
|
|
855
855
|
//copy default shape file
|
|
856
|
-
log(
|
|
856
|
+
log("Creating files for set component '" + name + "'");
|
|
857
857
|
targetFile = path.join(targetFolder, hyphenName + '.tsx');
|
|
858
858
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'set-component.tsx'), targetFile);
|
|
859
859
|
targetFile2 = path.join(targetFolder, hyphenName + '.scss');
|
|
@@ -880,7 +880,7 @@ var createComponent = function (name, basePath) {
|
|
|
880
880
|
targetFolder = ensureFolderExists(basePath, 'src', 'components');
|
|
881
881
|
_a = setNameVariables(name), hyphenName = _a.hyphenName, camelCaseName = _a.camelCaseName, underscoreName = _a.underscoreName;
|
|
882
882
|
//copy default shape file
|
|
883
|
-
log(
|
|
883
|
+
log("Creating files for component '" + name + "'");
|
|
884
884
|
targetFile = path.join(targetFolder, hyphenName + '.tsx');
|
|
885
885
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'component.tsx'), targetFile);
|
|
886
886
|
targetFile2 = path.join(targetFolder, hyphenName + '.scss');
|
|
@@ -929,7 +929,7 @@ var createPackage = function (name, uriBase, basePath) {
|
|
|
929
929
|
//extra variable for clarity (will be same as 'name')
|
|
930
930
|
setVariable('output_file_name', name);
|
|
931
931
|
_b = setNameVariables(cleanPackageName), hyphenName = _b.hyphenName, camelCaseName = _b.camelCaseName, underscoreName = _b.underscoreName;
|
|
932
|
-
log(
|
|
932
|
+
log("Creating new LINCD package '" + name + "'");
|
|
933
933
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'package'), targetFolder);
|
|
934
934
|
//replace variables in some of the copied files
|
|
935
935
|
return [4 /*yield*/, Promise.all([
|
|
@@ -997,7 +997,7 @@ var createApp = function (name, basePath) {
|
|
|
997
997
|
fs.copySync(path.join(__dirname, '..', 'defaults', 'app-with-backend'), targetFolder);
|
|
998
998
|
fs.renameSync(path.join(targetFolder, '.yarnrc.yml.template'), path.join(targetFolder, '.yarnrc.yml'));
|
|
999
999
|
// fs.copySync(path.join(__dirname, '..', 'defaults', 'app'), targetFolder);
|
|
1000
|
-
log(
|
|
1000
|
+
log("Creating new LINCD application '" + name + "'");
|
|
1001
1001
|
//replace variables in some copied files
|
|
1002
1002
|
replaceVariablesInFilesWithRoot(targetFolder, 'package.json', 'frontend/src/App.tsx', 'frontend/src/App.scss.json', 'frontend/src/components/Spinner.scss.json');
|
|
1003
1003
|
return [4 /*yield*/, hasYarnInstalled()];
|
|
@@ -1126,7 +1126,7 @@ var buildPackage = function (target, target2, packagePath, logResults) {
|
|
|
1126
1126
|
nodeEnv = 'SET NODE_ENV=production&& ';
|
|
1127
1127
|
}
|
|
1128
1128
|
else {
|
|
1129
|
-
nodeEnv =
|
|
1129
|
+
nodeEnv = "NODE_ENV='production' ";
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
1132
|
if (!target) {
|
|
@@ -1204,7 +1204,8 @@ var publishUpdated = function (test) {
|
|
|
1204
1204
|
log('Checking which packages need to be published by comparing last published date with last git commit');
|
|
1205
1205
|
// p = Promise.all(packages.map((pckg) => {
|
|
1206
1206
|
packages.forEach(function (pckg) {
|
|
1207
|
-
p = p
|
|
1207
|
+
p = p
|
|
1208
|
+
.then(function (previousResult) {
|
|
1208
1209
|
// progressUpdate(packagesLeft-- + ' packages left. Now checking ' + pckg.packageName);
|
|
1209
1210
|
// log('# Checking package ' + pckg.packageName);
|
|
1210
1211
|
// log('# Requesting ' + 'yarn info '+pkg.packageName+' --json');
|
|
@@ -1274,6 +1275,8 @@ var publishUpdated = function (test) {
|
|
|
1274
1275
|
case 2: return [3 /*break*/, 4];
|
|
1275
1276
|
case 3:
|
|
1276
1277
|
err_1 = _a.sent();
|
|
1278
|
+
// var stats = fs.statSync(path.join(packageDirectory));
|
|
1279
|
+
// var files = fs.readdirSync(path.join(packageDirectory,'src'));
|
|
1277
1280
|
console.log(chalk.red(pckg.packageName + ' failed: ' + err_1.message + '\n'));
|
|
1278
1281
|
console.warn('Returned JSON from npm: ' + output);
|
|
1279
1282
|
// return previousResult + ' ' + chalk.red(pckg.packageName + ' failed: ' + err.message + '\n');
|
|
@@ -1313,7 +1316,8 @@ var publishUpdated = function (test) {
|
|
|
1313
1316
|
console.warn(chalk.red(pckg.packageName + ' failed'));
|
|
1314
1317
|
return chalk.red(pckg.packageName + ' failed');
|
|
1315
1318
|
});
|
|
1316
|
-
})
|
|
1319
|
+
})
|
|
1320
|
+
.then(function (res) {
|
|
1317
1321
|
log(res);
|
|
1318
1322
|
results.push(res);
|
|
1319
1323
|
})["catch"](function (err) {
|
|
@@ -1348,7 +1352,7 @@ var publishPackage = function (pkg, test, info, publishVersion) {
|
|
|
1348
1352
|
.then(function (res) {
|
|
1349
1353
|
if (res.indexOf('Aborted due to warnings') !== -1 ||
|
|
1350
1354
|
res.indexOf('Could not publish') !== -1 ||
|
|
1351
|
-
res.indexOf(
|
|
1355
|
+
res.indexOf("Couldn't publish") !== -1) {
|
|
1352
1356
|
console.log(res);
|
|
1353
1357
|
return chalk.red(pkg.packageName + ' failed\n');
|
|
1354
1358
|
}
|
|
@@ -1496,9 +1500,9 @@ var executeCommandForEachPackage = function (packages, command, filterMethod, fi
|
|
|
1496
1500
|
return seen_1;
|
|
1497
1501
|
});
|
|
1498
1502
|
}
|
|
1499
|
-
log(
|
|
1503
|
+
log("Executing '" +
|
|
1500
1504
|
chalk.blueBright(command) +
|
|
1501
|
-
'
|
|
1505
|
+
"' on packages " +
|
|
1502
1506
|
chalk.magenta(packages.map(function (m) { return m.packageName; }).join(', ')));
|
|
1503
1507
|
var p = Promise.resolve(true);
|
|
1504
1508
|
packages.forEach(function (pkg) {
|
|
@@ -1539,11 +1543,11 @@ var executeCommandForPackage = function (packageName, command) {
|
|
|
1539
1543
|
return modDetails.packageName.indexOf(packageName) !== -1 || modDetails.packageName.indexOf(packageName) !== -1;
|
|
1540
1544
|
});
|
|
1541
1545
|
if (packageDetails) {
|
|
1542
|
-
log(
|
|
1546
|
+
log("Executing 'cd " + packageDetails.path + ' && yarn lincd' + (command ? ' ' + command : '') + "'");
|
|
1543
1547
|
return execp('cd ' + packageDetails.path + ' && yarn lincd' + (command ? ' ' + command : ''));
|
|
1544
1548
|
}
|
|
1545
1549
|
else {
|
|
1546
|
-
warn(
|
|
1550
|
+
warn("Could not find a pkg who's name (partially) matched " + chalk.cyan(packageName));
|
|
1547
1551
|
}
|
|
1548
1552
|
};
|
|
1549
1553
|
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lincd-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "Command line tools for the lincd.js library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"postcss": "^8.4.17",
|
|
66
66
|
"postcss-import": "^15.0.0",
|
|
67
67
|
"postcss-loader": "^7.0.1",
|
|
68
|
-
"postcss-modules": "^
|
|
68
|
+
"postcss-modules": "^6.0.0",
|
|
69
69
|
"postcss-nested": "^5.0.6",
|
|
70
70
|
"postcss-scss": "^4.0.5",
|
|
71
71
|
"require-extensions": "^0.0.4",
|