ics-builder 4.2.7 → 4.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ics-builder",
3
- "version": "4.2.7",
3
+ "version": "4.3.0",
4
4
  "description": "",
5
5
  "main": "./src/app.js",
6
6
  "preferGlobal": true,
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.CustomUiBuilder = void 0;
17
17
  var path = require("path");
18
18
  var utils_1 = require("../../utils");
19
+ var yaml = require("yamljs");
19
20
  var baseBuilder_1 = require("../baseBuilder");
20
21
  var CustomUiBuilder = /** @class */ (function (_super) {
21
22
  __extends(CustomUiBuilder, _super);
@@ -27,7 +28,8 @@ var CustomUiBuilder = /** @class */ (function (_super) {
27
28
  this.config.packages.forEach(function (pkg) {
28
29
  var _a, _b, _c, _d;
29
30
  var packageDir = path.join(_this.config.paths.source, pkg.name);
30
- var pkgInfo = pkg.packageInfo;
31
+ var packageYamlPath = path.join(packageDir, "package.yml");
32
+ var pkgInfo = utils_1.Utils.ensurePath(packageYamlPath) ? yaml.load(packageYamlPath) : {};
31
33
  var buildDir = path.join(packageDir, (((_b = (_a = pkgInfo === null || pkgInfo === void 0 ? void 0 : pkgInfo.builder) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.path) || "").replace(pkg.name, ""));
32
34
  var cmd = ((_d = (_c = pkgInfo === null || pkgInfo === void 0 ? void 0 : pkgInfo.builder) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.cmd) || "";
33
35
  var envArgs = _this.prepareEnvArgs();
@@ -31,7 +31,9 @@ var UIDependencyBuilder = /** @class */ (function (_super) {
31
31
  _this.runNpmInstall(sourcePath);
32
32
  return;
33
33
  }
34
- packageStructureManager_1.packageStructureManager.getModuleSourcePaths(pkg, "ui", _this.config).forEach(function (_a) {
34
+ packageStructureManager_1.packageStructureManager
35
+ .getModuleSourcePaths(pkg, "ui", _this.config)
36
+ .forEach(function (_a) {
35
37
  var moduleName = _a.moduleName, sourcePath = _a.sourcePath;
36
38
  _this.runNpmInstall(sourcePath);
37
39
  });
@@ -45,11 +47,7 @@ var UIDependencyBuilder = /** @class */ (function (_super) {
45
47
  }
46
48
  var packageLockPath = Path.join(cwd, "package-lock.json");
47
49
  var hasPackageLockPath = utils_1.Utils.ensurePath(packageLockPath);
48
- utils_1.Utils.exec("npm " + (hasPackageLockPath && this.isCi() ? "ci" : "install"), { silent: true, cwd: cwd });
49
- };
50
- UIDependencyBuilder.prototype.isCi = function () {
51
- var _a;
52
- return ((_a = this.config.options.uiInstall) === null || _a === void 0 ? void 0 : _a.mode) === "ci";
50
+ utils_1.Utils.exec("npm " + (hasPackageLockPath ? "ci" : "install") + " --force", { silent: true, cwd: cwd });
53
51
  };
54
52
  return UIDependencyBuilder;
55
53
  }(baseBuilder_1.BaseBuilder));
@@ -61,7 +61,6 @@ var CommandManager = /** @class */ (function () {
61
61
  index_1.task("webpack-build", function () { return _this.runBuilder(_this.builderManager.buildUi({ ui: { mode: "prod" } })); });
62
62
  index_1.task("webpack-build:dev", function () { return _this.runBuilder(_this.builderManager.buildUi({ ui: { mode: "dev" } })); });
63
63
  index_1.task("install-ui", function () { return _this.runBuilder(_this.builderManager.buildUIdependency()); });
64
- index_1.task("install-ui:ci", function () { return _this.runBuilder(_this.builderManager.buildUIdependency({ uiInstall: { mode: "ci" } })); });
65
64
  index_1.task("build-ui", index_1.series("generate-schema", "webpack-build"));
66
65
  index_1.task("install-build-ui", index_1.series("install-ui", "build-ui"));
67
66
  index_1.task("build-ui:dev", index_1.series("generate-schema", "webpack-build:dev"));
@@ -37,11 +37,11 @@ var PackageStructureManager = /** @class */ (function () {
37
37
  pkg.isSingleModule = true;
38
38
  return;
39
39
  }
40
- var moduleFolder = fs.readdirSync(packageDir).find(function (d) { return fs.statSync(Path.join(packageDir, d)).isDirectory(); });
41
- if (!moduleFolder)
40
+ var moduleFolders = fs.readdirSync(packageDir).filter(function (d) { return !d.startsWith(".") && fs.statSync(Path.join(packageDir, d)).isDirectory(); });
41
+ if (moduleFolders.length == 0)
42
42
  return;
43
- var modulePath = Path.join(packageDir, moduleFolder);
44
- if (!moduleConfigFiles.some(function (f) { return utils_1.Utils.ensurePath(Path.join(modulePath, f)); }))
43
+ var modulePaths = moduleFolders.map(function (f) { return Path.join(packageDir, f); });
44
+ if (!moduleConfigFiles.some(function (f) { return modulePaths.some(function (mp) { return utils_1.Utils.ensurePath(Path.join(mp, f)); }); }))
45
45
  pkg.isLegacy = true;
46
46
  return;
47
47
  };