@discord/intl-loader-core 0.5.2 → 0.6.1

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": "@discord/intl-loader-core",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "license": "MIT",
5
5
  "description": "Core utilities for writing loaders and transformers using @discord/intl",
6
6
  "author": "Jon Egeland",
@@ -22,7 +22,7 @@
22
22
  "chokidar": "^3.6.0",
23
23
  "debug": "^4.3.6",
24
24
  "fast-glob": "^3.3.2",
25
- "@discord/intl-message-database": "0.5.2"
25
+ "@discord/intl-message-database": "0.6.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/debug": "^4.1.12"
package/src/processing.js CHANGED
@@ -121,7 +121,7 @@ function processTranslationsFile(sourcePath, sourceContent, options = {}) {
121
121
  * @returns {Buffer | void}
122
122
  */
123
123
  function precompileFileForLocale(sourcePath, locale, options = {}) {
124
- const { format = IntlCompiledMessageFormat.Json, outputFile } = options;
124
+ const { format = IntlCompiledMessageFormat.KeylessJson, outputFile } = options;
125
125
  return outputFile != null
126
126
  ? database.precompile(sourcePath, locale, outputFile, format)
127
127
  : database.precompileToBuffer(sourcePath, locale, format);
package/src/watcher.js CHANGED
@@ -35,10 +35,17 @@ function processFile(filePath, assetExtension) {
35
35
  // Convert the file name from `.messages.js` to `.compiled.messages.jsona` for output.
36
36
  const outputPath = filePath.replace(/\.messages\.js$/, `.compiled.messages.${assetExtension}`);
37
37
  const result = processDefinitionsFile(filePath);
38
- precompileFileForLocale(filePath, result.locale, { format: IntlCompiledMessageFormat.Json });
38
+ precompileFileForLocale(filePath, result.locale, {
39
+ format: IntlCompiledMessageFormat.KeylessJson,
40
+ });
39
41
 
40
42
  database.processDefinitionsFile(filePath);
41
- database.precompile(filePath, DEFAULT_LOCALE, outputPath, IntlCompiledMessageFormat.Json);
43
+ database.precompile(
44
+ filePath,
45
+ DEFAULT_LOCALE,
46
+ outputPath,
47
+ IntlCompiledMessageFormat.KeylessJson,
48
+ );
42
49
  debug(`Wrote definitions to: ${outputPath}`);
43
50
  } catch (e) {
44
51
  debug('[INTL Error] Failed to compile messages');