lincd-cli 0.2.62 → 0.2.63

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.
@@ -1210,7 +1210,7 @@ var buildUpdated = function (back, target, target2, useGitForLastModified = fals
1210
1210
  // let packages = getLocalLincdModules();
1211
1211
  let packages = getLocalLincdPackageMap();
1212
1212
  // console.log(packages);
1213
- let jsonldPkgUpdated = yield needsRebuilding(packages.get('lincd-jsonld'), useGitForLastModified);
1213
+ let jsonldPkgUpdated = yield (0, utils_1.needsRebuilding)(packages.get('lincd-jsonld'), useGitForLastModified);
1214
1214
  // let cliPkgUpdated = await needsRebuilding(packages.get('lincd-cli'), useGitForLastModified);
1215
1215
  //if either cli or jsonldPkg needs to be rebuilt
1216
1216
  // if (jsonldPkgUpdated || cliPkgUpdated) {
@@ -1229,7 +1229,7 @@ var buildUpdated = function (back, target, target2, useGitForLastModified = fals
1229
1229
  packagesLeft = packagesLeft - packageGroup.length;
1230
1230
  return (pkg) => __awaiter(this, void 0, void 0, function* () {
1231
1231
  // debugInfo('# Checking package ' + pkg.packageName);
1232
- let needRebuild = yield needsRebuilding(pkg, useGitForLastModified, true);
1232
+ let needRebuild = yield (0, utils_1.needsRebuilding)(pkg, useGitForLastModified, true);
1233
1233
  if (pkg.packageName === 'lincd-jsonld' && jsonldPkgUpdated) {
1234
1234
  needRebuild = true;
1235
1235
  }
@@ -1278,36 +1278,6 @@ var buildUpdated = function (back, target, target2, useGitForLastModified = fals
1278
1278
  });
1279
1279
  };
1280
1280
  exports.buildUpdated = buildUpdated;
1281
- const needsRebuilding = function (pkg, useGitForLastModified, log = false) {
1282
- return __awaiter(this, void 0, void 0, function* () {
1283
- let lastModifiedSourceDate;
1284
- let lastModifiedSourceName;
1285
- if (useGitForLastModified) {
1286
- const { changes, commitId, date } = yield (0, utils_1.getLastCommitTime)(pkg.path);
1287
- lastModifiedSourceDate = date;
1288
- lastModifiedSourceName = commitId;
1289
- }
1290
- else {
1291
- const { lastModified, lastModifiedName, lastModifiedTime } = (0, utils_1.getLastModifiedSourceTime)(pkg.path);
1292
- lastModifiedSourceName = lastModifiedName;
1293
- lastModifiedSourceDate = lastModified;
1294
- }
1295
- let lastModifiedBundle = (0, utils_1.getLastBuildTime)(pkg.path);
1296
- let result = lastModifiedSourceDate.getTime() > lastModifiedBundle.lastModifiedTime;
1297
- if (log) {
1298
- console.log(chalk_1.default.cyan('Last modified source: ' +
1299
- lastModifiedSourceName +
1300
- ' on ' +
1301
- lastModifiedSourceDate.toString()));
1302
- console.log(chalk_1.default.cyan('Last build: ' +
1303
- (lastModifiedBundle &&
1304
- typeof lastModifiedBundle.lastModified !== 'undefined'
1305
- ? lastModifiedBundle.lastModified.toString()
1306
- : 'never')));
1307
- }
1308
- return result;
1309
- });
1310
- };
1311
1281
  const printBuildResults = function (failed, done) {
1312
1282
  log('Successfully built: ' +
1313
1283
  chalk_1.default.green([...done].map((m) => m.packageName).join(', ')) +
package/lib/utils.js CHANGED
@@ -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.getLinkedTailwindColors = exports.flatten = exports.warn = exports.debugInfo = exports.debug = exports.log = exports.generateScopedName = exports.execPromise = exports.execp = exports.getGruntConfig = exports.getModulePackageJSON = exports.getLastModifiedFile = exports.getLastCommitTime = exports.getLastModifiedSourceTime = exports.getLastBuildTime = exports.getLINCDDependencies = exports.getPackageJSON = void 0;
38
+ exports.getLinkedTailwindColors = exports.flatten = exports.warn = exports.debugInfo = exports.debug = exports.log = exports.needsRebuilding = exports.generateScopedName = exports.execPromise = exports.execp = exports.getGruntConfig = exports.getModulePackageJSON = exports.getLastModifiedFile = exports.getLastCommitTime = exports.getLastModifiedSourceTime = exports.getLastBuildTime = exports.getLINCDDependencies = exports.getPackageJSON = void 0;
39
39
  const fs = __importStar(require("fs"));
40
40
  const path = __importStar(require("path"));
41
41
  const chalk_1 = __importDefault(require("chalk"));
@@ -362,6 +362,37 @@ function generateScopedName(isProduction, isWebpack, cssClassName, filepath, css
362
362
  cssClassName);
363
363
  }
364
364
  exports.generateScopedName = generateScopedName;
365
+ const needsRebuilding = function (pkg, useGitForLastModified, log = false) {
366
+ return __awaiter(this, void 0, void 0, function* () {
367
+ let lastModifiedSourceDate;
368
+ let lastModifiedSourceName;
369
+ if (useGitForLastModified) {
370
+ const { changes, commitId, date } = yield (0, exports.getLastCommitTime)(pkg.path);
371
+ lastModifiedSourceDate = date;
372
+ lastModifiedSourceName = commitId;
373
+ }
374
+ else {
375
+ const { lastModified, lastModifiedName, lastModifiedTime } = (0, exports.getLastModifiedSourceTime)(pkg.path);
376
+ lastModifiedSourceName = lastModifiedName;
377
+ lastModifiedSourceDate = lastModified;
378
+ }
379
+ let lastModifiedBundle = (0, exports.getLastBuildTime)(pkg.path);
380
+ let result = lastModifiedSourceDate.getTime() > lastModifiedBundle.lastModifiedTime;
381
+ if (log) {
382
+ console.log(chalk_1.default.cyan('Last modified source: ' +
383
+ lastModifiedSourceName +
384
+ ' on ' +
385
+ lastModifiedSourceDate.toString()));
386
+ console.log(chalk_1.default.cyan('Last build: ' +
387
+ (lastModifiedBundle &&
388
+ typeof lastModifiedBundle.lastModified !== 'undefined'
389
+ ? lastModifiedBundle.lastModified.toString()
390
+ : 'never')));
391
+ }
392
+ return result;
393
+ });
394
+ };
395
+ exports.needsRebuilding = needsRebuilding;
365
396
  function log(...messages) {
366
397
  messages.forEach((message) => {
367
398
  console.log(chalk_1.default.cyan(message));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lincd-cli",
3
- "version": "0.2.62",
3
+ "version": "0.2.63",
4
4
  "description": "Command line tools for the lincd.js library",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {