ics-builder 4.1.93 → 4.1.97

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.93",
3
+ "version": "4.1.97",
4
4
  "description": "",
5
5
  "main": "./src/app.js",
6
6
  "preferGlobal": true,
@@ -28,6 +28,7 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
28
28
  var _this = _super.call(this, config) || this;
29
29
  _this.modules = new Array();
30
30
  _this.allProjects = [];
31
+ _this.emptyModulesWithConfig = new Map();
31
32
  _this.configFile = "appsettings.json";
32
33
  _this.buildApiFolder = path.join(_this.config.paths.build, "api");
33
34
  shell.config.silent = true;
@@ -56,7 +57,6 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
56
57
  dotnetUtils_1.DotnetUtils.createTempSln(slnDir, slnName);
57
58
  for (var _i = 0, _b = this.modules; _i < _b.length; _i++) {
58
59
  var m = _b[_i];
59
- utils_1.Utils.copyFile(m.Project, m.TempProject);
60
60
  var csproj = new csprojFile_1.CsprojFile(m.Project);
61
61
  csproj.setPublishPath(m.OutputPath);
62
62
  csproj.save(m.Project);
@@ -72,13 +72,12 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
72
72
  var projectDir = path.dirname(m.Project);
73
73
  _this.copyModuleConfig(projectDir, m.OutputPath, _this.configFile);
74
74
  });
75
+ this.emptyModulesWithConfig.forEach(function (val, key) {
76
+ _this.copyModuleConfig(val, path.join(_this.buildApiFolder, "modules", key), _this.configFile);
77
+ });
75
78
  }
76
79
  finally {
77
80
  utils_1.Utils.deleteFile(tempSlnPath);
78
- this.modules.forEach(function (m) {
79
- utils_1.Utils.copyFile(m.TempProject, m.Project);
80
- utils_1.Utils.deleteFile(m.TempProject);
81
- });
82
81
  }
83
82
  };
84
83
  Net5ApiBuilder.prototype.collectModuleInfo = function (pkg) {
@@ -88,10 +87,8 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
88
87
  _this.writeModulesProjects(pkg.name, pkg.modules.find(function (m) { return m.name == moduleName; }), sourcePath);
89
88
  });
90
89
  };
91
- Net5ApiBuilder.prototype.writeModulesProjects = function (pkg, md, modulePath) {
92
- var _this = this;
90
+ Net5ApiBuilder.prototype.writeModulesProjects = function (packageName, module, modulePath) {
93
91
  var _a;
94
- var projectFile = new Array();
95
92
  var moduleConfig = this.parsePackageInfoLegacy(path.join(modulePath, "module.yml"));
96
93
  if ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.api) === null || _a === void 0 ? void 0 : _a.project) {
97
94
  var csprojPath = path.join(modulePath, moduleConfig.api.project);
@@ -99,24 +96,31 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
99
96
  utils_1.Logger.error(csprojPath + " does not exist");
100
97
  return;
101
98
  }
102
- this.modules.push(new ApiModuleInfo(pkg, md, csprojPath, this.buildApiFolder));
103
- projectFile.push(csprojPath);
99
+ this.modules.push(new ApiModuleInfo(packageName, module, csprojPath, this.buildApiFolder));
104
100
  }
105
101
  else {
106
- var files_1 = shell.ls(path.join(modulePath, "*.sln"));
107
- if (files_1.length) {
108
- this.modules.push(new ApiModuleInfo(pkg, md, files_1[0], this.buildApiFolder));
109
- return;
110
- }
111
- files_1 = shell.ls(path.join(modulePath, "*.csproj"));
112
- if (files_1.length) {
113
- this.modules.push(new ApiModuleInfo(pkg, md, files_1[0], this.buildApiFolder));
102
+ var files = shell.ls(path.join(modulePath, "*.sln"));
103
+ if (files.length) {
104
+ this.modules.push(new ApiModuleInfo(packageName, module, files[0], this.buildApiFolder));
114
105
  }
115
106
  else {
116
- utils_1.Logger.warn("Module " + md.name + " does not have .csproj file and will be skipped");
117
- return;
107
+ files = shell.ls(path.join(modulePath, "*.csproj"));
108
+ if (files.length) {
109
+ this.modules.push(new ApiModuleInfo(packageName, module, files[0], this.buildApiFolder));
110
+ }
111
+ else {
112
+ utils_1.Logger.warn("Module " + module.name + " does not have .csproj file and will be skipped");
113
+ var configFile = path.join(modulePath, this.configFile);
114
+ if (utils_1.Utils.ensurePath(configFile))
115
+ this.emptyModulesWithConfig.set(packageName + "." + module.name, modulePath);
116
+ return;
117
+ }
118
118
  }
119
119
  }
120
+ this.addProjectFiles(modulePath);
121
+ };
122
+ Net5ApiBuilder.prototype.addProjectFiles = function (modulePath) {
123
+ var _this = this;
120
124
  var files = shell.ls(path.join(modulePath, "*.csproj"), path.join(modulePath, "*", "*.csproj"));
121
125
  files.forEach(function (f) {
122
126
  _this.allProjects.push(f);
@@ -134,8 +138,6 @@ var ApiModuleInfo = /** @class */ (function () {
134
138
  this.Package = pkg;
135
139
  this.Module = module;
136
140
  this.Project = project;
137
- var dir = path.dirname(project);
138
- this.TempProject = path.join(dir, utils_1.Utils.getFileName(project) + "_temp.csproj");
139
141
  this.IsCoreModule = module.name == "_core" && pkg == "mdt";
140
142
  this.OutputPath = this.IsCoreModule
141
143
  ? buildApiFolder
@@ -43,7 +43,13 @@ var UIDependencyBuilder = /** @class */ (function (_super) {
43
43
  utils_1.Logger.warn("File package.json not found!");
44
44
  return;
45
45
  }
46
- utils_1.Utils.exec("npm install", { silent: true, cwd: cwd });
46
+ var packageLockPath = Path.join(cwd, "package-lock.json");
47
+ 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";
47
53
  };
48
54
  return UIDependencyBuilder;
49
55
  }(baseBuilder_1.BaseBuilder));
@@ -79,36 +79,17 @@ var BuildManager = /** @class */ (function () {
79
79
  if (utils_1.Utils.ensurePath(packageInfoPath)) {
80
80
  var packageInfo = yaml.load(packageInfoPath);
81
81
  packageInfo = packageInfo || {};
82
- // old version of package.yml -> use first builder for this layer in this.builders
83
- if (packageInfo.api) {
84
- var builderType = _this.getDefaultBuilder(layer);
85
- _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
86
- return;
87
- // new version of package.yml
88
- }
89
- else if (packageInfo.builder) {
82
+ var newVersionOfPackageYaml = !packageInfo.api;
83
+ if (newVersionOfPackageYaml && packageInfo.builder && packageInfo.builder[layer]) {
90
84
  var layerInfo = packageInfo.builder[layer];
91
- if (!layerInfo) {
92
- var builderType = _this.getDefaultBuilder(layer);
93
- _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
94
- return;
95
- }
96
- else if (layerInfo) {
97
- layerInfo.path = layerInfo.path || layer;
98
- var builderType = layerInfo.type || _this.getDefaultBuilder(layer);
99
- _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
100
- return;
101
- }
102
- }
103
- else {
104
- var builderType = _this.getDefaultBuilder(layer);
105
- _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
85
+ layerInfo.path = layerInfo.path || layer;
86
+ var builderType_1 = layerInfo.type || _this.getDefaultBuilder(layer);
87
+ _this.updateLayerBuilder(layer, builderType_1, layerBuilders, pkg);
88
+ return;
106
89
  }
107
90
  }
108
- else {
109
- var builderType = _this.getDefaultBuilder(layer);
110
- _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
111
- }
91
+ var builderType = _this.getDefaultBuilder(layer);
92
+ _this.updateLayerBuilder(layer, builderType, layerBuilders, pkg);
112
93
  });
113
94
  if (!buildOptions)
114
95
  buildOptions = {};
@@ -60,6 +60,7 @@ var CommandManager = /** @class */ (function () {
60
60
  index_1.task("webpack-build", function () { return _this.runBuilder(_this.builderManager.buildUi({ ui: { mode: "prod" } })); });
61
61
  index_1.task("webpack-build:dev", function () { return _this.runBuilder(_this.builderManager.buildUi({ ui: { mode: "dev" } })); });
62
62
  index_1.task("install-ui", function () { return _this.runBuilder(_this.builderManager.buildUIdependency()); });
63
+ index_1.task("install-ui:ci", function () { return _this.runBuilder(_this.builderManager.buildUIdependency({ uiInstall: { mode: "ci" } })); });
63
64
  index_1.task("build-ui", index_1.series("generate-schema", "webpack-build"));
64
65
  index_1.task("install-build-ui", index_1.series("install-ui", "build-ui"));
65
66
  index_1.task("build-ui:dev", index_1.series("generate-schema", "webpack-build:dev"));