@open-norantec/herbal 1.0.2-alpha.25 → 1.0.2-alpha.27

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.
@@ -218,18 +218,19 @@ command
218
218
  ].join('\n');
219
219
  },
220
220
  rewriteOutputFile: function (code) { return __awaiter(void 0, void 0, void 0, function () {
221
- var generateCodeMethod, _a;
222
- return __generator(this, function (_b) {
223
- switch (_b.label) {
221
+ var generateCodeMethod, error_1;
222
+ return __generator(this, function (_a) {
223
+ switch (_a.label) {
224
224
  case 0:
225
- _b.trys.push([0, 2, , 3]);
225
+ _a.trys.push([0, 2, , 3]);
226
226
  generateCodeMethod = requireFromString(code);
227
227
  if (typeof generateCodeMethod !== 'function')
228
228
  return [2, ''];
229
229
  return [4, Promise.resolve(generateCodeMethod({ group: options === null || options === void 0 ? void 0 : options.group })).then(function (generatedCode) { return generatedCode !== null && generatedCode !== void 0 ? generatedCode : ''; })];
230
- case 1: return [2, _b.sent()];
230
+ case 1: return [2, _a.sent()];
231
231
  case 2:
232
- _a = _b.sent();
232
+ error_1 = _a.sent();
233
+ log('error', "Failed to generate client code:", error_1 instanceof Error ? error_1.message : String(error_1));
233
234
  return [2, ''];
234
235
  case 3: return [2];
235
236
  }
@@ -210,7 +210,7 @@ var TypeScriptClient = (function (_super) {
210
210
  return __generator(this, function (_a) {
211
211
  switch (_a.label) {
212
212
  case 0:
213
- interfaceName = "Interface_".concat(Math.random().toString(36).slice(2));
213
+ interfaceName = "Interface".concat(Math.random().toString(36).slice(2));
214
214
  return [4, (0, json_schema_to_typescript_1.compile)(schema, interfaceName, {
215
215
  format: true,
216
216
  bannerComment: '',
@@ -226,7 +226,7 @@ var TypeScriptClient = (function (_super) {
226
226
  .split('\n')
227
227
  .map(function (line, index) { return "".concat(index === 0 ? '' : ' ').concat(line.trim()); })
228
228
  .join('')
229
- .slice("export interface ".concat(interfaceName, " ").length);
229
+ .replace(/^export\s+interface\s+Interface[a-zA-Z0-9-_]+\s+\{/, '{');
230
230
  })];
231
231
  case 1: return [2, _a.sent()];
232
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-norantec/herbal",
3
- "version": "1.0.2-alpha.25",
3
+ "version": "1.0.2-alpha.27",
4
4
  "description": "Herbal is a builder and toolchain for Nest.js applications",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {