ics-builder 4.1.97 → 4.2.1

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.1.97",
3
+ "version": "4.2.1",
4
4
  "description": "",
5
5
  "main": "./src/app.js",
6
6
  "preferGlobal": true,
package/src/app.js CHANGED
File without changes
@@ -87,10 +87,8 @@ var DotnetApiBuilder = /** @class */ (function (_super) {
87
87
  var configuration = (this.config.api && this.config.api.configuration) || "debug";
88
88
  moduleDir = path.dirname(projectFile);
89
89
  var projectBinDir_1 = path.join(moduleDir, "bin");
90
- var projectObjDir = path.join(moduleDir, "obj");
91
90
  var webAppPath = path.join(moduleDir, "global.asax");
92
- utils_1.Utils.clearFolder(projectBinDir_1);
93
- utils_1.Utils.clearFolder(projectObjDir);
91
+ this.clearCache(moduleDir);
94
92
  if (utils_1.Utils.ensurePath(webAppPath)) {
95
93
  utils_1.Utils.copyFile(path.join(moduleDir, "web.config.template"), path.join(moduleDir, "web.config"));
96
94
  }
@@ -136,6 +134,10 @@ var DotnetApiBuilder = /** @class */ (function (_super) {
136
134
  skipLog: true
137
135
  });
138
136
  };
137
+ DotnetApiBuilder.prototype.clearCache = function (folderPath) {
138
+ utils_1.Utils.deleteAllFoldersRecursively(folderPath, "bin");
139
+ utils_1.Utils.deleteAllFoldersRecursively(folderPath, "obj");
140
+ };
139
141
  return DotnetApiBuilder;
140
142
  }(baseBuilder_1.BaseBuilder));
141
143
  exports.DotnetApiBuilder = DotnetApiBuilder;
@@ -127,8 +127,8 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
127
127
  });
128
128
  };
129
129
  Net5ApiBuilder.prototype.clearCache = function (folderPath) {
130
- utils_1.Utils.clearFolder(path.join(folderPath, "bin"));
131
- utils_1.Utils.clearFolder(path.join(folderPath, "obj"));
130
+ utils_1.Utils.deleteAllFoldersRecursively(folderPath, "bin");
131
+ utils_1.Utils.deleteAllFoldersRecursively(folderPath, "obj");
132
132
  };
133
133
  return Net5ApiBuilder;
134
134
  }(baseBuilder_1.BaseBuilder));
@@ -61,7 +61,6 @@ var autoprefixer = require("autoprefixer");
61
61
  var webpack = require("webpack");
62
62
  var WebpackDevServer = require("webpack-dev-server");
63
63
  var path = require("path");
64
- var shell = require("shelljs");
65
64
  var glob = require("glob");
66
65
  var yaml = require("yamljs");
67
66
  var fs = require("fs");
@@ -72,7 +71,6 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
72
71
  __extends(WebpackUiBuilder, _super);
73
72
  function WebpackUiBuilder(config) {
74
73
  var _this = _super.call(this, config) || this;
75
- _this.nodeModulesPaths = new Array();
76
74
  _this.isLegacy = false;
77
75
  return _this;
78
76
  }
@@ -126,6 +124,9 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
126
124
  .getModuleSourcePaths(p, "ui", _this.config)
127
125
  .forEach(function (_a) {
128
126
  var moduleName = _a.moduleName, sourcePath = _a.sourcePath;
127
+ var packagePath = path.join(sourcePath, "package.json");
128
+ if (!utils_1.Utils.ensurePath(packagePath))
129
+ return;
129
130
  utils_1.Utils.exec("npm run build", { cwd: sourcePath });
130
131
  var moduleFile = path.join(sourcePath, "dist/module.js");
131
132
  var outputModuleFile = path.join(outputModulesPath, p.name, p.isSingleModule ? "index.js" : path.join(moduleName, "index.js"));
@@ -353,36 +354,6 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
353
354
  }
354
355
  };
355
356
  };
356
- WebpackUiBuilder.prototype.checkNpm = function (dir) {
357
- var _this = this;
358
- var packageJsons = glob.sync(dir).filter(function (x) { return x; });
359
- if (packageJsons.length) {
360
- packageJsons.forEach(function (pkg) {
361
- utils_1.Logger.info("Found package.json at path " + path.dirname(pkg) + ", install dependecies...");
362
- var nodeModulesPath = path.join(path.dirname(pkg), "node_modules");
363
- _this.nodeModulesPaths.push(nodeModulesPath);
364
- });
365
- if (this.nodeModulesPaths.every(function (dir) {
366
- return utils_1.Utils.ensurePath(dir);
367
- }))
368
- return true;
369
- this.nodeModulesPaths
370
- .filter(function (dir) {
371
- return !utils_1.Utils.ensurePath(dir);
372
- })
373
- .forEach(function (dir) {
374
- utils_1.Utils.exec("npm install --no-save", { cwd: path.dirname(dir), silent: true });
375
- });
376
- return true;
377
- }
378
- return false;
379
- };
380
- WebpackUiBuilder.prototype.removeNodeModules = function (paths) {
381
- utils_1.Logger.info("Removing " + paths.join("\n"));
382
- paths.forEach(function (p) {
383
- shell.rm("-rf", p);
384
- });
385
- };
386
357
  WebpackUiBuilder.prototype.importThemes = function (modules, theme) {
387
358
  var themesDir = "_core/themes";
388
359
  return ("@import '" + path.join(themesDir, "_base/vars.less") + "';\n").concat("@import '" + path.join(themesDir, theme + "/vars.less") + "';\n", modules.map(function (module) { return "@import '" + module + "';"; }).join("\n") + "\n", "@import '" + path.join(themesDir, "_base/theme.less") + "';\n", "@import '" + path.join(themesDir, theme + "/theme.less") + "';\n");
@@ -54,6 +54,7 @@ var CommandManager = /** @class */ (function () {
54
54
  CommandManager.prototype.initTasks = function () {
55
55
  var _this = this;
56
56
  index_1.task("source", function () { return _this.packageManager.loadAllPackages(); });
57
+ index_1.task("source:ci", function () { return _this.packageManager.loadAllPackages(false, true); });
57
58
  index_1.task("build-api", function () { return _this.runBuilder(_this.builderManager.buildApi()); });
58
59
  index_1.task("build-db", function () { return _this.runBuilder(_this.builderManager.buildDb()); });
59
60
  index_1.task("generate-schema", function () { return _this.runBuilder(_this.builderManager.buildSchema()); });
@@ -19,8 +19,9 @@ var PackageManager = /** @class */ (function () {
19
19
  }
20
20
  return PackageManager.instance;
21
21
  };
22
- PackageManager.prototype.loadAllPackages = function (skipLoad) {
23
- this.loadPackages(null, null, skipLoad);
22
+ PackageManager.prototype.loadAllPackages = function (skipLoad, mainPackageSkipLoad) {
23
+ if (!mainPackageSkipLoad)
24
+ this.loadPackages(null, null, skipLoad);
24
25
  if (this.config.using) {
25
26
  this.loadPackages(this.config.using, "build.yml", skipLoad);
26
27
  }
@@ -68,7 +68,7 @@ var PackageStructureManager = /** @class */ (function () {
68
68
  if (!moduleInfoPath)
69
69
  return [];
70
70
  var moduleInfo = yaml.load(moduleInfoPath);
71
- return (_a = moduleInfo.dependencies) !== null && _a !== void 0 ? _a : [];
71
+ return (_a = moduleInfo === null || moduleInfo === void 0 ? void 0 : moduleInfo.dependencies) !== null && _a !== void 0 ? _a : [];
72
72
  };
73
73
  return PackageStructureManager;
74
74
  }());
package/src/utils.js CHANGED
@@ -188,6 +188,20 @@ var Utils = /** @class */ (function () {
188
188
  }
189
189
  return res;
190
190
  };
191
+ Utils.deleteAllFoldersRecursively = function (cwd, folderName) {
192
+ var _this = this;
193
+ var files = fs.readdirSync(cwd, { withFileTypes: true });
194
+ files.forEach(function (f) {
195
+ if (!f.isDirectory())
196
+ return;
197
+ var dirFullPath = path.join(cwd, f.name);
198
+ if (f.name == folderName) {
199
+ Utils.clearFolder(dirFullPath);
200
+ return;
201
+ }
202
+ _this.deleteAllFoldersRecursively(dirFullPath, folderName);
203
+ });
204
+ };
191
205
  Utils.getFileName = function (path) {
192
206
  var _a, _b;
193
207
  return (_b = (_a = path.match(/([^\\/]+?)(\.[^.\\/]+)?$/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : "";