lincd-cli 0.2.74 → 0.2.76
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/lib/cli-methods.js +13 -9
- package/package.json +1 -1
package/lib/cli-methods.js
CHANGED
|
@@ -779,22 +779,25 @@ invalidImports = new Map()) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
779
779
|
});
|
|
780
780
|
exports.checkImports = checkImports;
|
|
781
781
|
const depCheckStaged = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
782
|
-
console.log(
|
|
782
|
+
console.log('Checking dependencies of staged files');
|
|
783
783
|
stagedGitFiles(function (err, results) {
|
|
784
784
|
return __awaiter(this, void 0, void 0, function* () {
|
|
785
|
-
|
|
786
|
-
yield results.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
785
|
+
const packages = new Set();
|
|
786
|
+
yield Promise.all(results.map((file) => __awaiter(this, void 0, void 0, function* () {
|
|
787
787
|
// console.log('STAGED: ', file.filename);
|
|
788
788
|
let root = yield (0, find_nearest_package_json_1.findNearestPackageJson)(file.filename);
|
|
789
|
-
|
|
790
|
-
|
|
789
|
+
packages.add(root.path);
|
|
790
|
+
})));
|
|
791
|
+
[...packages].forEach((packageRoot) => {
|
|
792
|
+
const pack = JSON.parse(fs_extra_1.default.readFileSync(packageRoot, 'utf8'));
|
|
793
|
+
const srcPath = packageRoot.replace('package.json', '');
|
|
791
794
|
console.log('Checking dependencies of ' + chalk_1.default.blue(pack.name) + ':');
|
|
792
795
|
return (0, exports.depCheck)(process.cwd() + '/' + srcPath);
|
|
793
796
|
// console.log('check dependencies of ' + pack.name);
|
|
794
797
|
//
|
|
795
798
|
// console.log('ROOT of ' + file.filename + ': ' + root.path);
|
|
796
799
|
// console.log('ROOT of ' + file.filename + ': ' + root.data);
|
|
797
|
-
})
|
|
800
|
+
});
|
|
798
801
|
});
|
|
799
802
|
});
|
|
800
803
|
});
|
|
@@ -816,12 +819,13 @@ const depCheck = (path = process.cwd()) => __awaiter(void 0, void 0, void 0, fun
|
|
|
816
819
|
});
|
|
817
820
|
//currently just missing LINCD packages cause a hard failure exit code
|
|
818
821
|
if (missingLincdPackages.length > 0) {
|
|
819
|
-
console.warn(chalk_1.default.red('These LINCD packages are imported but they are not listed in package.json:\n- ' +
|
|
822
|
+
console.warn(chalk_1.default.red('[ERROR] These LINCD packages are imported but they are not listed in package.json:\n- ' +
|
|
820
823
|
missingLincdPackages.join(',\n- ')));
|
|
821
824
|
process.exit(1);
|
|
822
825
|
}
|
|
823
826
|
else if (missing.length > 0) {
|
|
824
|
-
console.warn(chalk_1.default.magenta('Missing dependencies:\n\t' +
|
|
827
|
+
console.warn(chalk_1.default.magenta('Missing dependencies (for now a warning, soon an error):\n\t' +
|
|
828
|
+
missing.join(',\n\t')));
|
|
825
829
|
}
|
|
826
830
|
}
|
|
827
831
|
// if(Object.keys(results.invalidFiles).length > 0) {
|
|
@@ -1300,7 +1304,7 @@ var buildUpdated = function (back, target, target2, useGitForLastModified = fals
|
|
|
1300
1304
|
packagesLeft = packagesLeft - packageGroup.length;
|
|
1301
1305
|
return (pkg) => __awaiter(this, void 0, void 0, function* () {
|
|
1302
1306
|
// debugInfo('# Checking package ' + pkg.packageName);
|
|
1303
|
-
let needRebuild = yield (0, utils_1.needsRebuilding)(pkg, useGitForLastModified
|
|
1307
|
+
let needRebuild = yield (0, utils_1.needsRebuilding)(pkg, useGitForLastModified);
|
|
1304
1308
|
if (pkg.packageName === 'lincd-jsonld' && jsonldPkgUpdated) {
|
|
1305
1309
|
needRebuild = true;
|
|
1306
1310
|
}
|