ics-builder 4.1.96 → 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.96",
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;
@@ -71,6 +72,9 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
71
72
  var projectDir = path.dirname(m.Project);
72
73
  _this.copyModuleConfig(projectDir, m.OutputPath, _this.configFile);
73
74
  });
75
+ this.emptyModulesWithConfig.forEach(function (val, key) {
76
+ _this.copyModuleConfig(val, path.join(_this.buildApiFolder, "modules", key), _this.configFile);
77
+ });
74
78
  }
75
79
  finally {
76
80
  utils_1.Utils.deleteFile(tempSlnPath);
@@ -83,10 +87,8 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
83
87
  _this.writeModulesProjects(pkg.name, pkg.modules.find(function (m) { return m.name == moduleName; }), sourcePath);
84
88
  });
85
89
  };
86
- Net5ApiBuilder.prototype.writeModulesProjects = function (pkg, md, modulePath) {
87
- var _this = this;
90
+ Net5ApiBuilder.prototype.writeModulesProjects = function (packageName, module, modulePath) {
88
91
  var _a;
89
- var projectFile = new Array();
90
92
  var moduleConfig = this.parsePackageInfoLegacy(path.join(modulePath, "module.yml"));
91
93
  if ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.api) === null || _a === void 0 ? void 0 : _a.project) {
92
94
  var csprojPath = path.join(modulePath, moduleConfig.api.project);
@@ -94,24 +96,31 @@ var Net5ApiBuilder = /** @class */ (function (_super) {
94
96
  utils_1.Logger.error(csprojPath + " does not exist");
95
97
  return;
96
98
  }
97
- this.modules.push(new ApiModuleInfo(pkg, md, csprojPath, this.buildApiFolder));
98
- projectFile.push(csprojPath);
99
+ this.modules.push(new ApiModuleInfo(packageName, module, csprojPath, this.buildApiFolder));
99
100
  }
100
101
  else {
101
- var files_1 = shell.ls(path.join(modulePath, "*.sln"));
102
- if (files_1.length) {
103
- this.modules.push(new ApiModuleInfo(pkg, md, files_1[0], this.buildApiFolder));
104
- return;
105
- }
106
- files_1 = shell.ls(path.join(modulePath, "*.csproj"));
107
- if (files_1.length) {
108
- 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));
109
105
  }
110
106
  else {
111
- utils_1.Logger.warn("Module " + md.name + " does not have .csproj file and will be skipped");
112
- 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
+ }
113
118
  }
114
119
  }
120
+ this.addProjectFiles(modulePath);
121
+ };
122
+ Net5ApiBuilder.prototype.addProjectFiles = function (modulePath) {
123
+ var _this = this;
115
124
  var files = shell.ls(path.join(modulePath, "*.csproj"), path.join(modulePath, "*", "*.csproj"));
116
125
  files.forEach(function (f) {
117
126
  _this.allProjects.push(f);
@@ -129,7 +138,6 @@ var ApiModuleInfo = /** @class */ (function () {
129
138
  this.Package = pkg;
130
139
  this.Module = module;
131
140
  this.Project = project;
132
- var dir = path.dirname(project);
133
141
  this.IsCoreModule = module.name == "_core" && pkg == "mdt";
134
142
  this.OutputPath = this.IsCoreModule
135
143
  ? buildApiFolder