lincd-cli 0.2.18 → 0.2.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-with-backend/frontend/src/index.tsx +2 -2
- package/lib/cli-methods.js +63 -32
- package/lib/cli.js +3 -0
- package/lib/config-webpack.js +18 -1
- package/lib/utils.js +8 -1
- package/package.json +1 -1
|
@@ -6,10 +6,10 @@ import {BrowserRouter} from 'react-router-dom';
|
|
|
6
6
|
import App from './App';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import {Storage} from 'lincd/lib/utils/Storage';
|
|
9
|
-
import {
|
|
9
|
+
import {BackendFileStore} from 'lincd-server/lib/shapes/BackendFileStore';
|
|
10
10
|
|
|
11
11
|
//store all quads in a file on the backend named 'main'
|
|
12
|
-
export const store = new
|
|
12
|
+
export const store = new BackendFileStore('main');
|
|
13
13
|
Storage.setDefaultStore(store);
|
|
14
14
|
|
|
15
15
|
hydrateRoot(
|
package/lib/cli-methods.js
CHANGED
|
@@ -75,7 +75,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
75
75
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
76
76
|
};
|
|
77
77
|
exports.__esModule = true;
|
|
78
|
-
exports.executeCommandForPackage = exports.addCapacitor = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishUpdated = exports.buildPackage = exports.buildMetadata = exports.register = exports.createPackage = exports.createComponent = exports.createSetComponent = exports.createShape = exports.createOntology = exports.getLincdPackages = exports.buildAll = exports.developPackage = exports.createApp = void 0;
|
|
78
|
+
exports.executeCommandForPackage = exports.addCapacitor = exports.executeCommandForEachPackage = exports.buildUpdated = exports.publishPackage = exports.publishUpdated = exports.buildPackage = exports.buildMetadata = exports.register = exports.createPackage = exports.createComponent = exports.createSetComponent = exports.createShape = exports.createOntology = exports.getLincdPackages = exports.buildAll = exports.developPackage = exports.createApp = void 0;
|
|
79
79
|
var path_1 = __importDefault(require("path"));
|
|
80
80
|
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
81
81
|
var utils_1 = require("./utils");
|
|
@@ -88,6 +88,7 @@ var env_cmd_1 = require("env-cmd");
|
|
|
88
88
|
var JSONLDWriter_1 = require("lincd-jsonld/lib/utils/JSONLDWriter");
|
|
89
89
|
var NameSpace_1 = require("lincd/lib/utils/NameSpace");
|
|
90
90
|
var Prefix_1 = require("lincd/lib/utils/Prefix");
|
|
91
|
+
var get_env_vars_1 = require("env-cmd/dist/get-env-vars");
|
|
91
92
|
var glob = require('glob');
|
|
92
93
|
var variables = {};
|
|
93
94
|
var open = require('open');
|
|
@@ -1274,7 +1275,7 @@ var publishUpdated = function (test) {
|
|
|
1274
1275
|
return [2 /*return*/, chalk_1["default"].red(pckg.packageName + ' failed: ' + err_1.message)];
|
|
1275
1276
|
case 4:
|
|
1276
1277
|
if (shouldPublish) {
|
|
1277
|
-
res = publishPackage(pckg, test, info, version);
|
|
1278
|
+
res = (0, exports.publishPackage)(pckg, test, info, version);
|
|
1278
1279
|
if (pckg.packageName == 'browser-core') {
|
|
1279
1280
|
browserCoreBuilt = true;
|
|
1280
1281
|
}
|
|
@@ -1283,7 +1284,7 @@ var publishUpdated = function (test) {
|
|
|
1283
1284
|
browserModule = packages.find(function (m) { return m.packageName == 'browser-core'; });
|
|
1284
1285
|
return [2 /*return*/, Promise.resolve(res).then(function (previousResult) {
|
|
1285
1286
|
log('# Automatically also publishing package browser-core');
|
|
1286
|
-
return publishPackage(browserModule, test);
|
|
1287
|
+
return (0, exports.publishPackage)(browserModule, test);
|
|
1287
1288
|
})];
|
|
1288
1289
|
}
|
|
1289
1290
|
return [2 /*return*/, res];
|
|
@@ -1329,38 +1330,68 @@ var publishUpdated = function (test) {
|
|
|
1329
1330
|
};
|
|
1330
1331
|
exports.publishUpdated = publishUpdated;
|
|
1331
1332
|
var publishPackage = function (pkg, test, info, publishVersion) {
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1333
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1334
|
+
var localPackageJson, path, envCmdFile, i, envFile;
|
|
1335
|
+
return __generator(this, function (_a) {
|
|
1336
|
+
switch (_a.label) {
|
|
1337
|
+
case 0:
|
|
1338
|
+
if (!pkg) {
|
|
1339
|
+
localPackageJson = (0, utils_1.getPackageJSON)();
|
|
1340
|
+
pkg = {
|
|
1341
|
+
path: process.cwd(),
|
|
1342
|
+
packageName: localPackageJson.name
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
if (!publishVersion) {
|
|
1346
|
+
publishVersion = info ? getNextVersion(info.version) : 'patch';
|
|
1347
|
+
}
|
|
1348
|
+
if (test) {
|
|
1349
|
+
debugInfo('should publish ' + pkg.packageName + ' ' + publishVersion);
|
|
1350
|
+
//when testing what needs to be published
|
|
1351
|
+
return [2 /*return*/, chalk_1["default"].blue(pkg.packageName + ' should publish')];
|
|
1352
|
+
}
|
|
1353
|
+
console.log(chalk_1["default"].blue('publishing ' + pkg.packageName + ' ' + publishVersion));
|
|
1354
|
+
path = './';
|
|
1355
|
+
envCmdFile = '';
|
|
1356
|
+
i = 0;
|
|
1357
|
+
_a.label = 1;
|
|
1358
|
+
case 1:
|
|
1359
|
+
if (!(i <= 10)) return [3 /*break*/, 4];
|
|
1360
|
+
return [4 /*yield*/, (0, get_env_vars_1.getEnvFile)({ filePath: path + '.env.json' })["catch"](function (err) {
|
|
1361
|
+
return null;
|
|
1362
|
+
})];
|
|
1363
|
+
case 2:
|
|
1364
|
+
envFile = _a.sent();
|
|
1365
|
+
if (envFile) {
|
|
1366
|
+
//note: we're getting the actual contents here, so we could also use that more directly?
|
|
1367
|
+
envCmdFile = path + '.env.json';
|
|
1368
|
+
return [3 /*break*/, 4];
|
|
1369
|
+
}
|
|
1370
|
+
path += '../';
|
|
1371
|
+
_a.label = 3;
|
|
1372
|
+
case 3:
|
|
1373
|
+
i++;
|
|
1374
|
+
return [3 /*break*/, 1];
|
|
1375
|
+
case 4: return [2 /*return*/, (0, utils_1.execPromise)("cd ".concat(pkg.path, " && ").concat(envCmdFile ? "env-cmd -f ".concat(envCmdFile, " --use-shell \"") : '', "yarn version ").concat(publishVersion, " && yarn npm publish").concat(envCmdFile ? "\"" : ''), true, false, {}, true)
|
|
1376
|
+
.then(function (res) {
|
|
1377
|
+
if (res.indexOf('Aborted due to warnings') !== -1 ||
|
|
1378
|
+
res.indexOf('Could not publish') !== -1 ||
|
|
1379
|
+
res.indexOf("Couldn't publish") !== -1) {
|
|
1380
|
+
console.log(res);
|
|
1381
|
+
return chalk_1["default"].red(pkg.packageName + ' failed\n');
|
|
1382
|
+
}
|
|
1383
|
+
console.log(chalk_1["default"].green('Successfully published ' + pkg.path + ' ' + publishVersion));
|
|
1384
|
+
return chalk_1["default"].green(pkg.packageName + ' published ' + publishVersion + '\n');
|
|
1385
|
+
})["catch"](function (_a) {
|
|
1386
|
+
var error = _a.error, stdout = _a.stdout, stderr = _a.stderr;
|
|
1387
|
+
console.log(chalk_1["default"].red('Failed to publish: ' + error.message));
|
|
1388
|
+
return chalk_1["default"].red(pkg.packageName + ' failed to publish\n');
|
|
1389
|
+
})];
|
|
1350
1390
|
}
|
|
1351
|
-
console.log(chalk_1["default"].green('Successfully published ' + pkg.path + ' ' + publishVersion));
|
|
1352
|
-
return chalk_1["default"].green(pkg.packageName + ' published ' + publishVersion + '\n');
|
|
1353
|
-
})["catch"](function (_a) {
|
|
1354
|
-
var error = _a.error, stdout = _a.stdout, stderr = _a.stderr;
|
|
1355
|
-
console.log(chalk_1["default"].red('Failed to publish: ' + error.message));
|
|
1356
|
-
return chalk_1["default"].red(pkg.packageName + ' failed to publish\n');
|
|
1357
1391
|
});
|
|
1358
|
-
}
|
|
1359
|
-
else {
|
|
1360
|
-
//when testing what needs to be published
|
|
1361
|
-
return chalk_1["default"].blue(pkg.packageName + ' should publish');
|
|
1362
|
-
}
|
|
1392
|
+
});
|
|
1363
1393
|
};
|
|
1394
|
+
exports.publishPackage = publishPackage;
|
|
1364
1395
|
var buildUpdated = function (back, target, target2, test) {
|
|
1365
1396
|
if (test === void 0) { test = false; }
|
|
1366
1397
|
return __awaiter(this, void 0, void 0, function () {
|
package/lib/cli.js
CHANGED
|
@@ -82,6 +82,9 @@ program.command('build-metadata').action(function () {
|
|
|
82
82
|
program.command('publish-updated').action(function () {
|
|
83
83
|
return (0, cli_methods_1.publishUpdated)();
|
|
84
84
|
});
|
|
85
|
+
program.command('publish [version]').action(function (version) {
|
|
86
|
+
return (0, cli_methods_1.publishPackage)(null, false, null, version);
|
|
87
|
+
});
|
|
85
88
|
program.command('status').action(function () {
|
|
86
89
|
//log which packages need to be published
|
|
87
90
|
return (0, cli_methods_1.publishUpdated)(true).then(function () {
|
package/lib/config-webpack.js
CHANGED
|
@@ -69,6 +69,7 @@ var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlug
|
|
|
69
69
|
var TerserPlugin = require('terser-webpack-plugin');
|
|
70
70
|
var exec = require('child_process').exec;
|
|
71
71
|
var CopyPlugin = require('copy-webpack-plugin');
|
|
72
|
+
var tailwindPlugin = require('tailwindcss/plugin');
|
|
72
73
|
var NODE_ENV = process.env.NODE_ENV;
|
|
73
74
|
var nodeProduction = NODE_ENV == 'production';
|
|
74
75
|
// const libraryName = 'lincd';
|
|
@@ -245,6 +246,7 @@ function generateWebpackConfig(buildName, moduleName, config) {
|
|
|
245
246
|
postcssPlugins.push([
|
|
246
247
|
'tailwindcss',
|
|
247
248
|
{
|
|
249
|
+
content: __spreadArray(['./src/**/*.{tsx,ts}'], __read(lincdPackagePaths), false),
|
|
248
250
|
safelist: productionMode
|
|
249
251
|
? {}
|
|
250
252
|
: {
|
|
@@ -252,7 +254,22 @@ function generateWebpackConfig(buildName, moduleName, config) {
|
|
|
252
254
|
pattern: /./,
|
|
253
255
|
variants: ['sm', 'md', 'lg', 'xl', '2xl']
|
|
254
256
|
},
|
|
255
|
-
|
|
257
|
+
theme: {
|
|
258
|
+
extend: {
|
|
259
|
+
colors: (0, utils_1.getLinkedTailwindColors)()
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
plugins: [
|
|
263
|
+
tailwindPlugin(function (_a) {
|
|
264
|
+
var addBase = _a.addBase, config = _a.config;
|
|
265
|
+
//we can use LINCD CSS variables for default font color, size etc.
|
|
266
|
+
// addBase({
|
|
267
|
+
// 'h1': { fontSize: config('theme.fontSize.2xl') },
|
|
268
|
+
// 'h2': { fontSize: config('theme.fontSize.xl') },
|
|
269
|
+
// 'h3': { fontSize: config('theme.fontSize.lg') },
|
|
270
|
+
// })
|
|
271
|
+
}),
|
|
272
|
+
]
|
|
256
273
|
},
|
|
257
274
|
]);
|
|
258
275
|
}
|
package/lib/utils.js
CHANGED
|
@@ -73,7 +73,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
73
73
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
74
|
};
|
|
75
75
|
exports.__esModule = true;
|
|
76
|
-
exports.flatten = exports.warn = exports.debug = exports.log = exports.generateScopedName = exports.execPromise = exports.execp = exports.getGruntConfig = exports.getModulePackageJSON = exports.getLINCDDependencies = exports.getPackageJSON = void 0;
|
|
76
|
+
exports.getLinkedTailwindColors = exports.flatten = exports.warn = exports.debug = exports.log = exports.generateScopedName = exports.execPromise = exports.execp = exports.getGruntConfig = exports.getModulePackageJSON = exports.getLINCDDependencies = exports.getPackageJSON = void 0;
|
|
77
77
|
var fs = __importStar(require("fs"));
|
|
78
78
|
var path = __importStar(require("path"));
|
|
79
79
|
var chalk_1 = __importDefault(require("chalk"));
|
|
@@ -339,3 +339,10 @@ function flatten(arr) {
|
|
|
339
339
|
}, []);
|
|
340
340
|
}
|
|
341
341
|
exports.flatten = flatten;
|
|
342
|
+
function getLinkedTailwindColors() {
|
|
343
|
+
return {
|
|
344
|
+
'primary-color': 'var(--primary-color)',
|
|
345
|
+
'font-color': 'var(--font-color)'
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
exports.getLinkedTailwindColors = getLinkedTailwindColors;
|