@cabin-icarus/tooltip_generator 1.8.2 → 1.8.3

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/fsWatcher.ts CHANGED
@@ -44,11 +44,7 @@ watcher.on("ready", () => {
44
44
 
45
45
  Promise.all(files.map(x =>
46
46
  {
47
- const temp = fs.readFileSync(x);
48
- fs.writeFile(x, ' ', err =>
49
- {
50
- fs.writeFileSync(x, temp);
51
- });
47
+ watcher.emit("change", "update", x);
52
48
  }
53
49
  ))
54
50
  })
@@ -60,11 +56,20 @@ function getDataFromFile(filePath: string): LocalizationData | undefined {
60
56
  return;
61
57
  }
62
58
  delete require.cache[require.resolve(filePath)]
63
- let file = require(filePath);
64
- if (file["GenerateLocalizationData"]) {
65
- const localizationArr: LocalizationData = file["GenerateLocalizationData"]();
66
- return localizationArr;
59
+ try
60
+ {
61
+ let file = require(filePath);
62
+ if (file["GenerateLocalizationData"]) {
63
+ const localizationArr: LocalizationData = file["GenerateLocalizationData"]();
64
+ return localizationArr;
65
+ }
67
66
  }
67
+ catch (error)
68
+ {
69
+ console.error("[Language] Error occurred while reading file:", filePath);
70
+ console.error(error);
71
+ }
72
+
68
73
  return;
69
74
  }
70
75
 
@@ -44,12 +44,12 @@ export class LocalizationCompiler
44
44
  //let Talents: Array<HeroTalents> = new Array<HeroTalents>();
45
45
 
46
46
  const localization_info: LocalizationData =
47
- {
48
- AbilityArray: Abilities,
49
- ModifierArray: Modifiers,
50
- StandardArray: StandardTooltips,
51
- // TalentArray: Talents,
52
- };
47
+ {
48
+ AbilityArray: Abilities,
49
+ ModifierArray: Modifiers,
50
+ StandardArray: StandardTooltips,
51
+ // TalentArray: Talents,
52
+ };
53
53
 
54
54
  const refMap: Map<Language, string[]> = new Map<Language, string[]>();
55
55
 
package/package.json CHANGED
@@ -44,5 +44,5 @@
44
44
  "dev:runlocalizationWatcher": "ts-node -P node_modules/~resource/tsconfig.json node_modules/~generator/fsWatcher.ts",
45
45
  "init": "link-module-alias && ts-node node_modules/~generator/init.ts"
46
46
  },
47
- "version": "1.8.2"
47
+ "version": "1.8.3"
48
48
  }
package/tsconfig.json CHANGED
@@ -1,4 +1,7 @@
1
1
  {
2
+ "include": [
3
+ "../../shared/**/*",
4
+ ],
2
5
  "compilerOptions": {
3
6
  /* Visit https://aka.ms/tsconfig.json to read more about this file */
4
7
 
@@ -67,7 +70,11 @@
67
70
  "skipDefaultLibCheck":true,
68
71
  "forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
69
72
  "types": [
70
- "@types/node"
71
- ],
73
+ "@types/node"
74
+ ]
72
75
  },
76
+ "ts-node": {
77
+ "files": true,
78
+ "transpileOnly": true
79
+ }
73
80
  }