ics-builder 4.2.8 → 4.4.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.8",
3
+ "version": "4.4.0",
4
4
  "description": "",
5
5
  "main": "./src/app.js",
6
6
  "preferGlobal": true,
@@ -87,6 +87,7 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
87
87
  this.buildModules();
88
88
  return;
89
89
  }
90
+ this.executePreBuildTask();
90
91
  var webpackStylesConfig = this.getWebpackStylesConfig();
91
92
  var webpackConfig = this.getWebpackConfig();
92
93
  return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
@@ -134,6 +135,20 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
134
135
  });
135
136
  });
136
137
  };
138
+ WebpackUiBuilder.prototype.executePreBuildTask = function () {
139
+ var _this = this;
140
+ this.config.packages.forEach(function (pkg) {
141
+ var _a;
142
+ var uiDirectory = path.join(_this.config.paths.source, pkg.name, "ui");
143
+ var packageJsonPath = path.join(uiDirectory, "package.json");
144
+ if (!utils_1.Utils.ensurePath(packageJsonPath))
145
+ return;
146
+ var packageJsonContent = require(packageJsonPath);
147
+ var preBuildTask = (_a = packageJsonContent === null || packageJsonContent === void 0 ? void 0 : packageJsonContent.scripts) === null || _a === void 0 ? void 0 : _a.preBuild;
148
+ if (preBuildTask)
149
+ utils_1.Utils.exec(preBuildTask, { cwd: uiDirectory });
150
+ });
151
+ };
137
152
  WebpackUiBuilder.prototype.saveUiSettings = function () {
138
153
  var settings = {
139
154
  builder: this.config.version || "4.1",
@@ -256,9 +271,7 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
256
271
  },
257
272
  {
258
273
  test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
259
- exclude: [
260
- /monaco-editor/gi
261
- ],
274
+ exclude: [/monaco-editor/gi],
262
275
  use: {
263
276
  loader: "file-loader",
264
277
  options: {
@@ -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
  };