ics-builder 4.1.82 → 4.1.86

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.82",
3
+ "version": "4.1.86",
4
4
  "description": "",
5
5
  "main": "./src/app.js",
6
6
  "preferGlobal": true,
package/src/app.js CHANGED
File without changes
@@ -123,13 +123,8 @@ var DotnetApiBuilder = /** @class */ (function (_super) {
123
123
  if (/(\.svc)$/.test(fileName))
124
124
  utils_1.Utils.copyFile(path.join(moduleDir, fileName), path.join(targetDir, fileName));
125
125
  });
126
- var moduleConfigFile = path.join(moduleDir, "app.config");
127
- if (utils_1.Utils.ensurePath(moduleConfigFile)) {
128
- var baseDir = path.basename(moduleDir);
129
- if (baseDir.endsWith("api"))
130
- baseDir = path.basename(path.dirname(moduleDir));
131
- utils_1.Utils.copyFile(moduleConfigFile, path.join(targetDir, moduleName + ".app.config"));
132
- }
126
+ var moduleConfigFileName = "app.config";
127
+ this.copyModuleConfig(moduleDir, targetDir, moduleConfigFileName, moduleName + "." + moduleConfigFileName);
133
128
  utils_1.Utils.deleteFiles(targetDir, ["packages.config", "web.config.template"]);
134
129
  utils_1.Logger.info(moduleName.replace("._core", "") + ": " + info.join(", "));
135
130
  }
@@ -16,10 +16,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.Net5ApiBuilder = void 0;
17
17
  var path = require("path");
18
18
  var shell = require("shelljs");
19
- var fs = require("fs");
20
19
  var baseBuilder_1 = require("../baseBuilder");
21
20
  var utils_1 = require("../../utils");
22
- var just_task_1 = require("just-task");
23
21
  var dotnetUtils_1 = require("../../dotnetUtils");
24
22
  var packageStructureManager_1 = require("../../services/packageStructure/packageStructureManager");
25
23
  var Net5ApiBuilder = /** @class */ (function (_super) {
@@ -28,13 +26,12 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
28
26
  var _this = _super.call(this, config) || this;
29
27
  _this.modules = new Array();
30
28
  _this.allProjects = [];
29
+ _this.configFile = "appsettings.json";
31
30
  _this.buildApiFolder = path.join(_this.config.paths.build, "api");
32
31
  shell.config.silent = true;
33
32
  return _this;
34
- // this.slnFilePath = path.join(this.config.paths.source);
35
33
  }
36
34
  Net5ApiBuilder.prototype.run = function () {
37
- // DotnetUtils.createTempSln(this.slnFilePath, this.slnName);
38
35
  var _this = this;
39
36
  var _a;
40
37
  this.config.packages.forEach(function (pkg) {
@@ -44,35 +41,20 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
44
41
  this.allProjects.forEach(function (p) {
45
42
  _this.clearCache(path.dirname(p));
46
43
  });
47
- // let projectFilesString = "";
48
- // this.modulesProjectFiles.forEach(pf => {
49
- // projectFilesString += `"${pf}" `;
50
- // });
51
- // projectFilesString = projectFilesString.trim();
52
- // Utils.exec(`dotnet sln "${path.join(this.slnFilePath, this.slnName)}.sln" add ${projectFilesString}`);
53
44
  var configuration = ((_a = this.config.api) === null || _a === void 0 ? void 0 : _a.configuration) || "Debug";
54
45
  this.modules.forEach(function (m) {
55
46
  dotnetUtils_1.DotnetUtils.restoreNugetPackages(m.Project);
56
- var isCoreModule = m.Module.name == "_core" && !_this.config.packages.find(function (p) { return p.name == m.Package; }).isSingleModule;
47
+ var isCoreModule = m.Module.name == "_core" && m.Package == "mdt";
57
48
  var outputPath = isCoreModule ? _this.buildApiFolder : path.join(_this.buildApiFolder, "modules", utils_1.Utils.getFileName(m.Project));
58
49
  utils_1.Utils.exec("dotnet publish " + m.Project + " --no-restore -c " + configuration + " -o " + outputPath + " -nologo -v q", {
59
50
  silent: false,
60
51
  skipLog: true
61
52
  });
53
+ if (!isCoreModule) {
54
+ var projectDir = path.dirname(m.Project);
55
+ _this.copyModuleConfig(projectDir, outputPath, _this.configFile);
56
+ }
62
57
  });
63
- // this.patchMainAppSettingsJson();
64
- };
65
- Net5ApiBuilder.prototype.patchMainAppSettingsJson = function () {
66
- var _a;
67
- var appsettingsJsonPath = path.join(this.buildApiFolder, "appsettings.json");
68
- utils_1.Logger.info("Start patching " + appsettingsJsonPath);
69
- var appSettingsJsonObject = JSON.parse(fs.readFileSync(appsettingsJsonPath, { encoding: "utf-8" }).replace(/^\uFEFF/, ""));
70
- if (!((_a = appSettingsJsonObject === null || appSettingsJsonObject === void 0 ? void 0 : appSettingsJsonObject.Mdt) === null || _a === void 0 ? void 0 : _a.Modules)) {
71
- just_task_1.logger.error("appsettings.json does not have modules section");
72
- return;
73
- }
74
- // (<ModuleAppSettings[]>appSettingsJsonObject.Mdt.Modules).push(...this.modulesAppSettings);
75
- // fs.writeFileSync(appsettingsJsonPath, JSON.stringify(appSettingsJsonObject, null, "\t"));
76
58
  };
77
59
  Net5ApiBuilder.prototype.collectModuleInfo = function (pkg) {
78
60
  var _this = this;
@@ -86,7 +68,6 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
86
68
  var _a;
87
69
  var projectFile = new Array();
88
70
  var moduleConfig = this.parsePackageInfoLegacy(path.join(modulePath, "module.yml"));
89
- var appsettings = new Array();
90
71
  if ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.api) === null || _a === void 0 ? void 0 : _a.project) {
91
72
  var csprojPath = path.join(modulePath, moduleConfig.api.project);
92
73
  if (!utils_1.Utils.ensurePath(csprojPath)) {
@@ -95,11 +76,6 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
95
76
  }
96
77
  this.modules.push({ Module: md, Package: pkg, Project: csprojPath });
97
78
  projectFile.push(csprojPath);
98
- // shell.ls(modulePath + "/*/appsettings.json").forEach(sh => {
99
- // if (typeof sh === "string") {
100
- // appsettings.push(sh);
101
- // }
102
- // });
103
79
  }
104
80
  else {
105
81
  var files_1 = shell.ls(path.join(modulePath, "*.sln"));
@@ -115,34 +91,16 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
115
91
  utils_1.Logger.warn("Module " + md.name + " does not have .csproj file and will be skipped");
116
92
  return;
117
93
  }
118
- // shell.ls(path.join(modulePath, "appsettings.json")).forEach(sh => {
119
- // if (typeof sh === "string") {
120
- // appsettings.push(sh);
121
- // }
122
- // });
123
94
  }
124
95
  var files = shell.ls(path.join(modulePath, "*.csproj"), path.join(modulePath, "*", "*.csproj"));
125
96
  files.forEach(function (f) {
126
97
  _this.allProjects.push(f);
127
98
  });
128
- // if (appsettings.length > 0) {
129
- // this.readAppSettingsAndPush(appsettings);
130
- // }
131
99
  };
132
100
  Net5ApiBuilder.prototype.clearCache = function (folderPath) {
133
101
  utils_1.Utils.clearFolder(path.join(folderPath, "bin"));
134
102
  utils_1.Utils.clearFolder(path.join(folderPath, "obj"));
135
103
  };
136
- Net5ApiBuilder.prototype.readAppSettingsAndPush = function (appSettingsPath) {
137
- appSettingsPath.forEach(function (appSet) {
138
- if (utils_1.Utils.ensurePath(appSet)) {
139
- var appSettingsJson = JSON.parse(fs.readFileSync(appSet, { encoding: "utf-8" }).replace(/^\uFEFF/, ""));
140
- // if (appSettingsJson?.Mdt?.Modules) {
141
- // this.modulesAppSettings.push(...(<ModuleAppSettings[]>appSettingsJson.Mdt.Modules));
142
- // }
143
- }
144
- });
145
- };
146
104
  return Net5ApiBuilder;
147
105
  }(baseBuilder_1.BaseBuilder));
148
106
  exports.Net5ApiBuilder = Net5ApiBuilder;
@@ -38,6 +38,12 @@ var BaseBuilder = /** @class */ (function () {
38
38
  utils_1.Logger.info("Tests successfully passed. Coverage report: \n" + stdout);
39
39
  }
40
40
  };
41
+ BaseBuilder.prototype.copyModuleConfig = function (sourceDir, targetDir, configFileName, newConfigFileName) {
42
+ var moduleConfigFile = path.join(sourceDir, configFileName);
43
+ if (utils_1.Utils.ensurePath(moduleConfigFile)) {
44
+ utils_1.Utils.copyFile(moduleConfigFile, path.join(targetDir, newConfigFileName !== null && newConfigFileName !== void 0 ? newConfigFileName : configFileName));
45
+ }
46
+ };
41
47
  return BaseBuilder;
42
48
  }());
43
49
  exports.BaseBuilder = BaseBuilder;
@@ -33,6 +33,7 @@ var DataBuilder = /** @class */ (function (_super) {
33
33
  var moduleName = _a.moduleName, sourcePath = _a.sourcePath;
34
34
  var moduleDestinationDir = path.join(targetDir, pkg.name.concat(".", moduleName));
35
35
  utils_1.Utils.copyAllFilesByPattern(sourcePath, moduleDestinationDir, "*.{yaml,yml}");
36
+ utils_1.Utils.copyAllFolders(sourcePath, moduleDestinationDir);
36
37
  });
37
38
  });
38
39
  utils_1.Utils.removeEmptyFolders(targetDir);
@@ -325,6 +325,7 @@ var WebpackUiBuilder = /** @class */ (function (_super) {
325
325
  options: {
326
326
  modifyVars: { "@fa-css-prefix": "icon" },
327
327
  relativeUrls: this.isLegacy ? false : true,
328
+ javascriptEnabled: true,
328
329
  plugins: [
329
330
  {
330
331
  install: function (lessObj, pluginManager) {
package/src/utils.js CHANGED
@@ -65,6 +65,12 @@ var Utils = /** @class */ (function () {
65
65
  _this.copyFile(path.join(sourcePath, file), path.join(destinationPath, file));
66
66
  });
67
67
  };
68
+ Utils.copyAllFolders = function (sourcePath, destinationPath) {
69
+ var _this = this;
70
+ glob.sync("**/", { cwd: sourcePath }).forEach(function (folder) {
71
+ _this.copyFolder(path.join(sourcePath, folder), path.join(destinationPath, folder));
72
+ });
73
+ };
68
74
  Utils.copyFile = function (from, to) {
69
75
  if (Utils.ensurePath(from)) {
70
76
  Utils.ensureFolder(path.dirname(to));