definition-generator-framework 1.12.6 → 1.12.8

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.
@@ -30,8 +30,6 @@ const helpers_lib_1 = require("helpers-lib");
30
30
  const context_1 = require("../context");
31
31
  const START_COMMAND = '// ---- INDEX OUTPUT ----';
32
32
  const END_COMMAND = '// ---- END ----';
33
- const NEW_LINE_LENGTH = 2;
34
- const FILE_EXTENSION_LENGTH = 3;
35
33
  class IndexFileGenerator {
36
34
  static { this.premadeInterfaces = []; }
37
35
  static addPremadeInterface(value) {
@@ -70,7 +68,7 @@ class IndexFileGenerator {
70
68
  }
71
69
  static generateExportsContent() {
72
70
  return context_1.Context.exports
73
- .map(exportItem => `export { ${exportItem.variableName} } from '.${exportItem.path.substring(0, exportItem.path.length - FILE_EXTENSION_LENGTH)}';`)
71
+ .map(exportItem => `export { ${exportItem.variableName} } from '.${exportItem.path.substring(0, exportItem.path.lastIndexOf('.'))}';`)
74
72
  .join('\n');
75
73
  }
76
74
  static generateInterfacesContent(fileUrls) {
@@ -108,7 +106,7 @@ class IndexFileGenerator {
108
106
  if (endIndex === -1) {
109
107
  throw new Error(`No end command found.`);
110
108
  }
111
- contents.push(fileContent.substring(index + START_COMMAND.length + NEW_LINE_LENGTH, endIndex));
109
+ contents.push(fileContent.substring(fileContent.indexOf('\n', index + START_COMMAND.length) + 1, endIndex));
112
110
  index = fileContent.indexOf(START_COMMAND, endIndex);
113
111
  }
114
112
  if (definitionsFound) {
@@ -85,11 +85,12 @@ class Kernel {
85
85
  helpers_lib_1.ConsoleHelper.log(`Changes:`, 'gray');
86
86
  helpers_lib_1.ConsoleHelper.newLine();
87
87
  }
88
+ let startPathsFrom = context_1.Context.compilerExecutionPath.substring(0, context_1.Context.compilerExecutionPath.lastIndexOf('/')).length;
88
89
  let erasedFileCount = 0;
89
90
  if (context_1.Context.successful) {
90
91
  filesInOutputFolder.forEach(filePath => {
91
92
  erasedFileCount++;
92
- console.info(`${helpers_lib_1.ConsoleHelper.red}Erasing file:${helpers_lib_1.ConsoleHelper.gray} "${filePath.substring(outputPath.length)}"${helpers_lib_1.ConsoleHelper.default}`);
93
+ console.info(`${helpers_lib_1.ConsoleHelper.red}Erasing file:${helpers_lib_1.ConsoleHelper.gray} "${filePath.substring(startPathsFrom).replace(/\//g, '\\')}"${helpers_lib_1.ConsoleHelper.default}`);
93
94
  fs.unlinkSync(filePath);
94
95
  });
95
96
  }
@@ -103,11 +104,11 @@ class Kernel {
103
104
  if (content !== outputFile.content) {
104
105
  if (exists) {
105
106
  modifiedFileCount++;
106
- console.info(`${helpers_lib_1.ConsoleHelper.blue}Modifying file:${helpers_lib_1.ConsoleHelper.gray} "${outputFile.path.substring(outputPath.length)}"${helpers_lib_1.ConsoleHelper.default}`);
107
+ console.info(`${helpers_lib_1.ConsoleHelper.blue}Modifying file:${helpers_lib_1.ConsoleHelper.gray} "${outputFile.path.substring(startPathsFrom).replace(/\//g, '\\')}"${helpers_lib_1.ConsoleHelper.default}`);
107
108
  }
108
109
  else {
109
110
  createdFileCount++;
110
- console.info(`${helpers_lib_1.ConsoleHelper.cyan}Creating file:${helpers_lib_1.ConsoleHelper.gray} "${outputFile.path.substring(outputPath.length)}"${helpers_lib_1.ConsoleHelper.default}`);
111
+ console.info(`${helpers_lib_1.ConsoleHelper.cyan}Creating file:${helpers_lib_1.ConsoleHelper.gray} "${outputFile.path.substring(startPathsFrom).replace(/\//g, '\\')}"${helpers_lib_1.ConsoleHelper.default}`);
111
112
  }
112
113
  fs.writeFileSync(outputFile.path, outputFile.content);
113
114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "definition-generator-framework",
3
- "version": "1.12.6",
3
+ "version": "1.12.8",
4
4
  "description": "Definition Generator Framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",