lincd-cli 0.2.74 → 0.2.75

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.
Files changed (2) hide show
  1. package/lib/cli-methods.js +12 -8
  2. package/package.json +1 -1
@@ -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("Checking dependencies of packages whos' files are staged in GIT");
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
- //WHAT EVER YOU SO PLEASE
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
- const pack = JSON.parse(fs_extra_1.default.readFileSync(root.path, 'utf8'));
790
- const srcPath = root.path.replace('package.json', '');
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' + missing.join(',\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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lincd-cli",
3
- "version": "0.2.74",
3
+ "version": "0.2.75",
4
4
  "description": "Command line tools for the lincd.js library",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {