@intlayer/chokidar 4.0.4 → 4.0.5

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.
Files changed (31) hide show
  1. package/dist/cjs/index.cjs +3 -0
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +4 -3
  4. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  5. package/dist/esm/chokidar/index.mjs +1 -1
  6. package/dist/esm/chokidar/watcher.mjs +7 -7
  7. package/dist/esm/cleanOutputDir.mjs +1 -1
  8. package/dist/esm/fetchDistantDictionaries.mjs +1 -1
  9. package/dist/esm/index.mjs +7 -5
  10. package/dist/esm/index.mjs.map +1 -1
  11. package/dist/esm/loadDictionaries/index.mjs +4 -4
  12. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +5 -4
  13. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  14. package/dist/esm/loadDictionaries/loadDictionaries.mjs +6 -6
  15. package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +1 -1
  16. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -1
  17. package/dist/esm/log.mjs +1 -1
  18. package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/buildI18nextDictionary.mjs +2 -2
  19. package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/convertContentDeclarationInto18nDictionaries.mjs +1 -1
  20. package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/index.mjs +1 -1
  21. package/dist/esm/transpiler/declaration_file_to_dictionary/index.mjs +2 -2
  22. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs +1 -1
  23. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/index.mjs +2 -2
  24. package/dist/esm/transpiler/dictionary_to_main/createDictionaryList.mjs +2 -2
  25. package/dist/esm/transpiler/dictionary_to_main/index.mjs +1 -1
  26. package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +1 -1
  27. package/dist/esm/transpiler/dictionary_to_type/index.mjs +2 -2
  28. package/dist/types/index.d.ts +1 -0
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  31. package/package.json +12 -12
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var index_exports = {};
20
20
  __export(index_exports, {
21
+ buildDictionary: () => import_declaration_file_to_dictionary.buildDictionary,
21
22
  createDictionaryList: () => import_createDictionaryList.createDictionaryList,
22
23
  createModuleAugmentation: () => import_createModuleAugmentation.createModuleAugmentation,
23
24
  fetchDistantDictionaries: () => import_fetchDistantDictionaries.fetchDistantDictionaries,
@@ -28,12 +29,14 @@ __export(index_exports, {
28
29
  });
29
30
  module.exports = __toCommonJS(index_exports);
30
31
  var import_watcher = require('./chokidar/watcher.cjs');
32
+ var import_declaration_file_to_dictionary = require('./transpiler/declaration_file_to_dictionary/index.cjs');
31
33
  var import_createDictionaryList = require('./transpiler/dictionary_to_main/createDictionaryList.cjs');
32
34
  var import_createModuleAugmentation = require('./transpiler/dictionary_to_type/createModuleAugmentation.cjs');
33
35
  var import_fetchDistantDictionaries = require('./fetchDistantDictionaries.cjs');
34
36
  var import_loadDictionaries = require('./loadDictionaries/index.cjs');
35
37
  // Annotate the CommonJS export names for ESM import in node:
36
38
  0 && (module.exports = {
39
+ buildDictionary,
37
40
  createDictionaryList,
38
41
  createModuleAugmentation,
39
42
  fetchDistantDictionaries,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { watch } from './chokidar/watcher';\nexport { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';\nexport { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';\nexport { fetchDistantDictionaries } from './fetchDistantDictionaries';\nexport {\n loadDistantDictionaries,\n loadDictionaries,\n loadLocalDictionaries,\n} from './loadDictionaries/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAsB;AACtB,kCAAqC;AACrC,sCAAyC;AACzC,sCAAyC;AACzC,8BAIO;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { watch } from './chokidar/watcher';\nexport { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';\nexport { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';\nexport { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';\nexport { fetchDistantDictionaries } from './fetchDistantDictionaries';\nexport {\n loadDistantDictionaries,\n loadDictionaries,\n loadLocalDictionaries,\n} from './loadDictionaries/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAsB;AACtB,4CAAgC;AAChC,kCAAqC;AACrC,sCAAyC;AACzC,sCAAyC;AACzC,8BAIO;","names":[]}
@@ -91,9 +91,10 @@ const loadContentDeclaration = (contentDeclarationFilePath) => {
91
91
  }
92
92
  };
93
93
  const loadContentDeclarations = async (contentDeclarationFilePath) => {
94
- const contentDeclarations = contentDeclarationFilePath.map(
95
- loadContentDeclaration
96
- );
94
+ const contentDeclarations = contentDeclarationFilePath.map((path) => ({
95
+ ...loadContentDeclaration(path),
96
+ filePath: path
97
+ }));
97
98
  const resultDictionariesPaths = [];
98
99
  for await (const contentDeclaration of contentDeclarations) {
99
100
  if (!contentDeclaration) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'vm';\nimport { ESMxCJSRequire } from '@intlayer/config';\nimport type { DeclarationContent, Dictionary } from '@intlayer/core';\nimport { type BuildOptions, buildSync, type BuildResult } from 'esbuild';\nimport { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration';\n\nconst sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n console,\n require: ESMxCJSRequire,\n};\n\nconst transformationOption: BuildOptions = {\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n};\n\nconst filterValidContentDeclaration = (\n contentDeclaration: DeclarationContent\n): DeclarationContent => {\n // @TODO Implement filtering of valid content declaration\n return contentDeclaration as unknown as DeclarationContent;\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nconst loadContentDeclaration = (\n contentDeclarationFilePath: string\n): DeclarationContent | undefined => {\n let contentDeclaration: DeclarationContent | undefined = undefined;\n\n const fileExtension = contentDeclarationFilePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Assume JSON\n return ESMxCJSRequire(contentDeclarationFilePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [contentDeclarationFilePath],\n\n ...transformationOption,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n contentDeclaration = sandboxContext.module.exports;\n }\n\n if (typeof contentDeclaration === 'undefined') {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n return filterValidContentDeclaration(contentDeclaration);\n } catch (error) {\n console.error('Error:', error);\n }\n};\n\nexport const loadContentDeclarations = async (\n contentDeclarationFilePath: string[]\n): Promise<Dictionary[]> => {\n const contentDeclarations = contentDeclarationFilePath.map(\n loadContentDeclaration\n );\n const resultDictionariesPaths: Dictionary[] = [];\n\n for await (const contentDeclaration of contentDeclarations) {\n if (!contentDeclaration) {\n continue;\n }\n\n const processedContentDeclaration =\n await processContentDeclaration(contentDeclaration);\n\n if (!processedContentDeclaration) {\n continue;\n }\n\n resultDictionariesPaths.push(processedContentDeclaration);\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA8C;AAC9C,oBAA+B;AAE/B,qBAA+D;AAC/D,uCAA0C;AAE1C,MAAM,iBAA0B;AAAA,EAC9B,SAAS;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA,SAAS;AACX;AAEA,MAAM,uBAAqC;AAAA,EACzC,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,gCAAgC,CACpC,uBACuB;AAEvB,SAAO;AACT;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C,CAAC;AAE/C,mBAAiB,sBAAsB,qBAAqB;AAC1D,QAAI,CAAC,oBAAoB;AACvB;AAAA,IACF;AAEA,UAAM,8BACJ,UAAM,4DAA0B,kBAAkB;AAEpD,QAAI,CAAC,6BAA6B;AAChC;AAAA,IACF;AAEA,4BAAwB,KAAK,2BAA2B;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'vm';\nimport { ESMxCJSRequire } from '@intlayer/config';\nimport type { DeclarationContent, Dictionary } from '@intlayer/core';\nimport { type BuildOptions, buildSync, type BuildResult } from 'esbuild';\nimport { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration';\n\nconst sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n console,\n require: ESMxCJSRequire,\n};\n\nconst transformationOption: BuildOptions = {\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n};\n\nconst filterValidContentDeclaration = (\n contentDeclaration: DeclarationContent\n): DeclarationContent => {\n // @TODO Implement filtering of valid content declaration\n return contentDeclaration as unknown as DeclarationContent;\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nconst loadContentDeclaration = (\n contentDeclarationFilePath: string\n): DeclarationContent | undefined => {\n let contentDeclaration: DeclarationContent | undefined = undefined;\n\n const fileExtension = contentDeclarationFilePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Assume JSON\n return ESMxCJSRequire(contentDeclarationFilePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [contentDeclarationFilePath],\n\n ...transformationOption,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n contentDeclaration = sandboxContext.module.exports;\n }\n\n if (typeof contentDeclaration === 'undefined') {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n return filterValidContentDeclaration(contentDeclaration);\n } catch (error) {\n console.error('Error:', error);\n }\n};\n\nexport const loadContentDeclarations = async (\n contentDeclarationFilePath: string[]\n): Promise<Dictionary[]> => {\n const contentDeclarations = contentDeclarationFilePath.map((path) => ({\n ...loadContentDeclaration(path),\n filePath: path,\n }));\n const resultDictionariesPaths: Dictionary[] = [];\n\n for await (const contentDeclaration of contentDeclarations) {\n if (!contentDeclaration) {\n continue;\n }\n\n const processedContentDeclaration =\n await processContentDeclaration(contentDeclaration);\n\n if (!processedContentDeclaration) {\n continue;\n }\n\n resultDictionariesPaths.push(processedContentDeclaration);\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA8C;AAC9C,oBAA+B;AAE/B,qBAA+D;AAC/D,uCAA0C;AAE1C,MAAM,iBAA0B;AAAA,EAC9B,SAAS;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAAA,EACA,QAAQ;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,OAAO,WACtB,OAAO,KAAK,eAAe,OAAO,OAAO,EAAE,SAAS,GACpD;AAEA,2BAAqB,eAAe,OAAO;AAAA,IAC7C;AAEA,QAAI,OAAO,uBAAuB,aAAa;AAC7C,cAAQ,MAAM,yCAAyC;AACvD,aAAO;AAAA,IACT;AAEA,WAAO,8BAA8B,kBAAkB;AAAA,EACzD,SAAS,OAAO;AACd,YAAQ,MAAM,UAAU,KAAK;AAAA,EAC/B;AACF;AAEO,MAAM,0BAA0B,OACrC,+BAC0B;AAC1B,QAAM,sBAAsB,2BAA2B,IAAI,CAAC,UAAU;AAAA,IACpE,GAAG,uBAAuB,IAAI;AAAA,IAC9B,UAAU;AAAA,EACZ,EAAE;AACF,QAAM,0BAAwC,CAAC;AAE/C,mBAAiB,sBAAsB,qBAAqB;AAC1D,QAAI,CAAC,oBAAoB;AACvB;AAAA,IACF;AAEA,UAAM,8BACJ,UAAM,4DAA0B,kBAAkB;AAEpD,QAAI,CAAC,6BAA6B;AAChC;AAAA,IACF;AAEA,4BAAwB,KAAK,2BAA2B;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}
@@ -1,2 +1,2 @@
1
- export * from './watcher.mjs';
1
+ export * from "./watcher.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -2,16 +2,16 @@ import { relative } from "path";
2
2
  import { appLogger, getConfiguration } from "@intlayer/config";
3
3
  import { watch as chokidarWatch } from "chokidar";
4
4
  import fg from "fast-glob";
5
- import { cleanOutputDir } from '../cleanOutputDir.mjs';
6
- import { getDictionariesPath } from '../getDictionariesPath.mjs';
7
- import { loadDictionaries } from '../loadDictionaries/loadDictionaries.mjs';
8
- import { loadLocalDictionaries } from '../loadDictionaries/loadLocalDictionaries.mjs';
9
- import { buildDictionary } from '../transpiler/declaration_file_to_dictionary/index.mjs';
10
- import { createDictionaryList } from '../transpiler/dictionary_to_main/createDictionaryList.mjs';
5
+ import { cleanOutputDir } from "../cleanOutputDir.mjs";
6
+ import { getDictionariesPath } from "../getDictionariesPath.mjs";
7
+ import { loadDictionaries } from "../loadDictionaries/loadDictionaries.mjs";
8
+ import { loadLocalDictionaries } from "../loadDictionaries/loadLocalDictionaries.mjs";
9
+ import { buildDictionary } from "../transpiler/declaration_file_to_dictionary/index.mjs";
10
+ import { createDictionaryList } from "../transpiler/dictionary_to_main/createDictionaryList.mjs";
11
11
  import {
12
12
  createTypes,
13
13
  createModuleAugmentation
14
- } from '../transpiler/dictionary_to_type/index.mjs';
14
+ } from "../transpiler/dictionary_to_type/index.mjs";
15
15
  const watch = (options) => {
16
16
  const { content } = getConfiguration({
17
17
  verbose: true
@@ -1,6 +1,6 @@
1
1
  import { existsSync, rmSync } from "fs";
2
2
  import { getConfiguration } from "@intlayer/config";
3
- import { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList.mjs';
3
+ import { createDictionaryList } from "./transpiler/dictionary_to_main/createDictionaryList.mjs";
4
4
  const cleanOutputDir = () => {
5
5
  const { content } = getConfiguration();
6
6
  const { resultDir, typesDir, dictionariesDir } = content;
@@ -1,7 +1,7 @@
1
1
  import { getIntlayerAPI } from "@intlayer/api";
2
2
  import { appLogger, getConfiguration } from "@intlayer/config";
3
3
  import pLimit from "p-limit";
4
- import { logger } from './log.mjs';
4
+ import { logger } from "./log.mjs";
5
5
  const fetchDistantDictionaries = async (options) => {
6
6
  try {
7
7
  const config = getConfiguration();
@@ -1,13 +1,15 @@
1
- import { watch } from './chokidar/watcher.mjs';
2
- import { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList.mjs';
3
- import { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation.mjs';
4
- import { fetchDistantDictionaries } from './fetchDistantDictionaries.mjs';
1
+ import { watch } from "./chokidar/watcher.mjs";
2
+ import { buildDictionary } from "./transpiler/declaration_file_to_dictionary/index.mjs";
3
+ import { createDictionaryList } from "./transpiler/dictionary_to_main/createDictionaryList.mjs";
4
+ import { createModuleAugmentation } from "./transpiler/dictionary_to_type/createModuleAugmentation.mjs";
5
+ import { fetchDistantDictionaries } from "./fetchDistantDictionaries.mjs";
5
6
  import {
6
7
  loadDistantDictionaries,
7
8
  loadDictionaries,
8
9
  loadLocalDictionaries
9
- } from './loadDictionaries/index.mjs';
10
+ } from "./loadDictionaries/index.mjs";
10
11
  export {
12
+ buildDictionary,
11
13
  createDictionaryList,
12
14
  createModuleAugmentation,
13
15
  fetchDistantDictionaries,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { watch } from './chokidar/watcher';\nexport { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';\nexport { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';\nexport { fetchDistantDictionaries } from './fetchDistantDictionaries';\nexport {\n loadDistantDictionaries,\n loadDictionaries,\n loadLocalDictionaries,\n} from './loadDictionaries/index';\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAS,4BAA4B;AACrC,SAAS,gCAAgC;AACzC,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export { watch } from './chokidar/watcher';\nexport { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';\nexport { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';\nexport { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';\nexport { fetchDistantDictionaries } from './fetchDistantDictionaries';\nexport {\n loadDistantDictionaries,\n loadDictionaries,\n loadLocalDictionaries,\n} from './loadDictionaries/index';\n"],"mappings":"AAAA,SAAS,aAAa;AACtB,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,gCAAgC;AACzC,SAAS,gCAAgC;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
@@ -1,5 +1,5 @@
1
- export * from './loadDictionaries.mjs';
2
- export * from './loadDistantDictionaries.mjs';
3
- export * from './loadLocalDictionaries.mjs';
4
- export * from './loadContentDeclaration.mjs';
1
+ export * from "./loadDictionaries.mjs";
2
+ export * from "./loadDistantDictionaries.mjs";
3
+ export * from "./loadLocalDictionaries.mjs";
4
+ export * from "./loadContentDeclaration.mjs";
5
5
  //# sourceMappingURL=index.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { runInNewContext } from "vm";
2
2
  import { ESMxCJSRequire } from "@intlayer/config";
3
3
  import { buildSync } from "esbuild";
4
- import { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs';
4
+ import { processContentDeclaration } from "../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration.mjs";
5
5
  const sandboxContext = {
6
6
  exports: {
7
7
  default: {}
@@ -68,9 +68,10 @@ const loadContentDeclaration = (contentDeclarationFilePath) => {
68
68
  }
69
69
  };
70
70
  const loadContentDeclarations = async (contentDeclarationFilePath) => {
71
- const contentDeclarations = contentDeclarationFilePath.map(
72
- loadContentDeclaration
73
- );
71
+ const contentDeclarations = contentDeclarationFilePath.map((path) => ({
72
+ ...loadContentDeclaration(path),
73
+ filePath: path
74
+ }));
74
75
  const resultDictionariesPaths = [];
75
76
  for await (const contentDeclaration of contentDeclarations) {
76
77
  if (!contentDeclaration) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'vm';\nimport { ESMxCJSRequire } from '@intlayer/config';\nimport type { DeclarationContent, Dictionary } from '@intlayer/core';\nimport { type BuildOptions, buildSync, type BuildResult } from 'esbuild';\nimport { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration';\n\nconst sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n console,\n require: ESMxCJSRequire,\n};\n\nconst transformationOption: BuildOptions = {\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n};\n\nconst filterValidContentDeclaration = (\n contentDeclaration: DeclarationContent\n): DeclarationContent => {\n // @TODO Implement filtering of valid content declaration\n return contentDeclaration as unknown as DeclarationContent;\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nconst loadContentDeclaration = (\n contentDeclarationFilePath: string\n): DeclarationContent | undefined => {\n let contentDeclaration: DeclarationContent | undefined = undefined;\n\n const fileExtension = contentDeclarationFilePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Assume JSON\n return ESMxCJSRequire(contentDeclarationFilePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [contentDeclarationFilePath],\n\n ...transformationOption,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n contentDeclaration = sandboxContext.module.exports;\n }\n\n if (typeof contentDeclaration === 'undefined') {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n return filterValidContentDeclaration(contentDeclaration);\n } catch (error) {\n console.error('Error:', error);\n }\n};\n\nexport const loadContentDeclarations = async (\n contentDeclarationFilePath: string[]\n): Promise<Dictionary[]> => {\n const contentDeclarations = contentDeclarationFilePath.map(\n loadContentDeclaration\n );\n const resultDictionariesPaths: Dictionary[] = [];\n\n for await (const contentDeclaration of contentDeclarations) {\n if (!contentDeclaration) {\n continue;\n }\n\n const processedContentDeclaration =\n await processContentDeclaration(contentDeclaration);\n\n if (!processedContentDeclaration) {\n continue;\n }\n\n resultDictionariesPaths.push(processedContentDeclaration);\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAuB,uBAAuB;AAC9C,SAAS,sBAAsB;AAE/B,SAA4B,iBAAmC;AAC/D,SAAS,iCAAiC;AAE1C,MAAM,iBAA0B;AAAA,EAC9B,SAAS;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA,SAAS;AACX;AAEA,MAAM,uBAAqC;AAAA,EACzC,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,gCAAgC,CACpC,uBACuB;AAEvB,SAAO;AACT;AAOA,MAAM,yBAAyB,CAC7B,+BACmC;AACnC,MAAI,qBAAqD;AAEzD,QAAM,gBAAgB,2BAA2B,MAAM,GAAG,EAAE,IAAI,KAAK;AAErE,MAAI;AACF,QAAI,kBAAkB,QAAQ;AAE5B,aAAO,eAAe,0BAA0B;AAAA,IAClD;AAIA,UAAM,eAA4B,UAAU;AAAA,MAC1C,aAAa,CAAC,0BAA0B;AAAA,MAExC,GAAG;AAAA,IACL,CAAC;AAED,UAAM,qBAAqB,aAAa,cAAc,CAAC,EAAE;AAEzD,QAAI,CAAC,oBAAoB;AACvB,cAAQ,MAAM,yCAAyC;AACvD,aAAO;AAAA,IACT;AAEA,oBAAgB,oBAAoB,cAAc;AAElD,QACE,eAAe,QAAQ,WACvB,OAAO,KAAK,eAAe,QAAQ,OAAO,EAAE,SAAS,GACrD;AAEA,2BAAqB,eAAe,QAAQ;AAAA,IAC9C,WACE,eAAe,OAAO,QAAQ,YAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,QAAQ,EAAE,SAAS,GAC7D;AAEA,2BAAqB,eAAe,OAAO,QAAQ;AAAA,IACrD,WACE,eAAe,OAAO,QAAQ,WAC9B,OAAO,KAAK,eAAe,OAAO,QAAQ,OAAO,EAAE,SAAS,GAC5D;AAEA,2BAAqB,eAAe,OAAO,QAAQ;AAAA,IACrD,WACE,eAAe,OAAO,WACtB,OAAO,KAAK,eAAe,OAAO,OAAO,EAAE,SAAS,GACpD;AAEA,2BAAqB,eAAe,OAAO;AAAA,IAC7C;AAEA,QAAI,OAAO,uBAAuB,aAAa;AAC7C,cAAQ,MAAM,yCAAyC;AACvD,aAAO;AAAA,IACT;AAEA,WAAO,8BAA8B,kBAAkB;AAAA,EACzD,SAAS,OAAO;AACd,YAAQ,MAAM,UAAU,KAAK;AAAA,EAC/B;AACF;AAEO,MAAM,0BAA0B,OACrC,+BAC0B;AAC1B,QAAM,sBAAsB,2BAA2B;AAAA,IACrD;AAAA,EACF;AACA,QAAM,0BAAwC,CAAC;AAE/C,mBAAiB,sBAAsB,qBAAqB;AAC1D,QAAI,CAAC,oBAAoB;AACvB;AAAA,IACF;AAEA,UAAM,8BACJ,MAAM,0BAA0B,kBAAkB;AAEpD,QAAI,CAAC,6BAA6B;AAChC;AAAA,IACF;AAEA,4BAAwB,KAAK,2BAA2B;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"sourcesContent":["import { type Context, runInNewContext } from 'vm';\nimport { ESMxCJSRequire } from '@intlayer/config';\nimport type { DeclarationContent, Dictionary } from '@intlayer/core';\nimport { type BuildOptions, buildSync, type BuildResult } from 'esbuild';\nimport { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration';\n\nconst sandboxContext: Context = {\n exports: {\n default: {},\n },\n module: {\n exports: {},\n },\n console,\n require: ESMxCJSRequire,\n};\n\nconst transformationOption: BuildOptions = {\n loader: {\n '.js': 'js',\n '.jsx': 'jsx',\n '.mjs': 'js',\n '.ts': 'ts',\n '.tsx': 'tsx',\n '.cjs': 'js',\n '.json': 'json',\n },\n format: 'cjs', // Output format as commonjs\n target: 'es2017',\n packages: 'external',\n write: false,\n bundle: true,\n};\n\nconst filterValidContentDeclaration = (\n contentDeclaration: DeclarationContent\n): DeclarationContent => {\n // @TODO Implement filtering of valid content declaration\n return contentDeclaration as unknown as DeclarationContent;\n};\n\n/**\n * Load the content declaration from the given path\n *\n * Accepts JSON, JS, MJS and TS files as configuration\n */\nconst loadContentDeclaration = (\n contentDeclarationFilePath: string\n): DeclarationContent | undefined => {\n let contentDeclaration: DeclarationContent | undefined = undefined;\n\n const fileExtension = contentDeclarationFilePath.split('.').pop() ?? '';\n\n try {\n if (fileExtension === 'json') {\n // Assume JSON\n return ESMxCJSRequire(contentDeclarationFilePath);\n }\n\n // Rest is JS, MJS or TS\n\n const moduleResult: BuildResult = buildSync({\n entryPoints: [contentDeclarationFilePath],\n\n ...transformationOption,\n });\n\n const moduleResultString = moduleResult.outputFiles?.[0].text;\n\n if (!moduleResultString) {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n runInNewContext(moduleResultString, sandboxContext);\n\n if (\n sandboxContext.exports.default &&\n Object.keys(sandboxContext.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.exports.default;\n } else if (\n sandboxContext.module.exports.defaults &&\n Object.keys(sandboxContext.module.exports.defaults).length > 0\n ) {\n // CommonJS\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports.default &&\n Object.keys(sandboxContext.module.exports.default).length > 0\n ) {\n // ES Module\n contentDeclaration = sandboxContext.module.exports.default;\n } else if (\n sandboxContext.module.exports &&\n Object.keys(sandboxContext.module.exports).length > 0\n ) {\n // Other\n contentDeclaration = sandboxContext.module.exports;\n }\n\n if (typeof contentDeclaration === 'undefined') {\n console.error('Configuration file could not be loaded.');\n return undefined;\n }\n\n return filterValidContentDeclaration(contentDeclaration);\n } catch (error) {\n console.error('Error:', error);\n }\n};\n\nexport const loadContentDeclarations = async (\n contentDeclarationFilePath: string[]\n): Promise<Dictionary[]> => {\n const contentDeclarations = contentDeclarationFilePath.map((path) => ({\n ...loadContentDeclaration(path),\n filePath: path,\n }));\n const resultDictionariesPaths: Dictionary[] = [];\n\n for await (const contentDeclaration of contentDeclarations) {\n if (!contentDeclaration) {\n continue;\n }\n\n const processedContentDeclaration =\n await processContentDeclaration(contentDeclaration);\n\n if (!processedContentDeclaration) {\n continue;\n }\n\n resultDictionariesPaths.push(processedContentDeclaration);\n }\n\n return resultDictionariesPaths;\n};\n"],"mappings":"AAAA,SAAuB,uBAAuB;AAC9C,SAAS,sBAAsB;AAE/B,SAA4B,iBAAmC;AAC/D,SAAS,iCAAiC;AAE1C,MAAM,iBAA0B;AAAA,EAC9B,SAAS;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,SAAS,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,EACA,SAAS;AACX;AAEA,MAAM,uBAAqC;AAAA,EACzC,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AAAA,EACA,QAAQ;AAAA;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,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,IAAI,CAAC,UAAU;AAAA,IACpE,GAAG,uBAAuB,IAAI;AAAA,IAC9B,UAAU;AAAA,EACZ,EAAE;AACF,QAAM,0BAAwC,CAAC;AAE/C,mBAAiB,sBAAsB,qBAAqB;AAC1D,QAAI,CAAC,oBAAoB;AACvB;AAAA,IACF;AAEA,UAAM,8BACJ,MAAM,0BAA0B,kBAAkB;AAEpD,QAAI,CAAC,6BAA6B;AAChC;AAAA,IACF;AAEA,4BAAwB,KAAK,2BAA2B;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}
@@ -1,11 +1,11 @@
1
1
  import { appLogger, getConfiguration } from "@intlayer/config";
2
2
  import merge from "deepmerge";
3
- import { fetchDistantDictionaryKeys } from '../fetchDistantDictionaryKeys.mjs';
4
- import { logger } from '../log.mjs';
5
- import { mergeByKey } from '../mergeDictionaries.mjs';
6
- import { sortAlphabetically } from '../utils.mjs';
7
- import { loadContentDeclarations } from './loadContentDeclaration.mjs';
8
- import { loadDistantDictionaries } from './loadDistantDictionaries.mjs';
3
+ import { fetchDistantDictionaryKeys } from "../fetchDistantDictionaryKeys.mjs";
4
+ import { logger } from "../log.mjs";
5
+ import { mergeByKey } from "../mergeDictionaries.mjs";
6
+ import { sortAlphabetically } from "../utils.mjs";
7
+ import { loadContentDeclarations } from "./loadContentDeclaration.mjs";
8
+ import { loadDistantDictionaries } from "./loadDistantDictionaries.mjs";
9
9
  const loadDictionaries = async (contentDeclarationsPaths) => {
10
10
  try {
11
11
  const { editor } = getConfiguration();
@@ -1,4 +1,4 @@
1
- import { fetchDistantDictionaries } from '../fetchDistantDictionaries.mjs';
1
+ import { fetchDistantDictionaries } from "../fetchDistantDictionaries.mjs";
2
2
  const loadDistantDictionaries = async (options) => {
3
3
  try {
4
4
  const distantDictionaries = await fetchDistantDictionaries(options);
@@ -1,7 +1,7 @@
1
1
  import { mkdir } from "fs/promises";
2
2
  import { resolve, relative } from "path";
3
3
  import { getConfiguration } from "@intlayer/config";
4
- import { loadContentDeclarations } from './loadContentDeclaration.mjs';
4
+ import { loadContentDeclarations } from "./loadContentDeclaration.mjs";
5
5
  const loadLocalDictionaries = async (contentDeclarationsPaths) => {
6
6
  const { content } = getConfiguration();
7
7
  const { dictionariesDir, baseDir } = content;
package/dist/esm/log.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import readline from "readline";
2
- import { sortAlphabetically } from './utils.mjs';
2
+ import { sortAlphabetically } from "./utils.mjs";
3
3
  import { getConfiguration } from "@intlayer/config";
4
4
  const LINE_DETECTOR = "\u200B\u200B\u200B";
5
5
  const SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
@@ -1,7 +1,7 @@
1
- import { createI18nextDictionaries } from './convertContentDeclarationInto18nDictionaries.mjs';
1
+ import { createI18nextDictionaries } from "./convertContentDeclarationInto18nDictionaries.mjs";
2
2
  import {
3
3
  writeDictionary
4
- } from './writeDictionary.mjs';
4
+ } from "./writeDictionary.mjs";
5
5
  const buildI18nDictionary = async (contentDeclarations) => {
6
6
  const dictionariesDeclaration = contentDeclarations.reduce((acc, dictionary) => {
7
7
  const { key, content } = dictionary;
@@ -2,7 +2,7 @@ import { getConfiguration } from "@intlayer/config";
2
2
  import {
3
3
  NodeType
4
4
  } from "@intlayer/core";
5
- import { convertPluralsValues } from './convertPluralsValues.mjs';
5
+ import { convertPluralsValues } from "./convertPluralsValues.mjs";
6
6
  const {
7
7
  internationalization: { locales }
8
8
  } = getConfiguration();
@@ -1,2 +1,2 @@
1
- export * from './buildI18nextDictionary.mjs';
1
+ export * from "./buildI18nextDictionary.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1,6 +1,6 @@
1
1
  import { getConfiguration } from "@intlayer/config";
2
- import { buildI18nDictionary } from './i18next_dictionary/index.mjs';
3
- import { buildIntlayerDictionary } from './intlayer_dictionary/index.mjs';
2
+ import { buildI18nDictionary } from "./i18next_dictionary/index.mjs";
3
+ import { buildIntlayerDictionary } from "./intlayer_dictionary/index.mjs";
4
4
  const {
5
5
  content: { dictionaryOutput }
6
6
  } = getConfiguration();
@@ -1,7 +1,7 @@
1
1
  import { mkdir } from "fs/promises";
2
2
  import { resolve } from "path";
3
3
  import { getConfiguration } from "@intlayer/config";
4
- import { writeDictionary } from './writeDictionary.mjs';
4
+ import { writeDictionary } from "./writeDictionary.mjs";
5
5
  const { content } = getConfiguration();
6
6
  const { dictionariesDir } = content;
7
7
  const buildIntlayerDictionary = async (contentDeclarations) => {
@@ -1,3 +1,3 @@
1
- export * from './processContentDeclaration.mjs';
2
- export * from './buildIntlayerDictionary.mjs';
1
+ export * from "./processContentDeclaration.mjs";
2
+ export * from "./buildIntlayerDictionary.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { existsSync, mkdirSync, writeFileSync } from "fs";
2
2
  import { basename, extname, relative, resolve } from "path";
3
3
  import { getConfiguration } from "@intlayer/config";
4
- import { getDictionariesPath } from '../../getDictionariesPath.mjs';
5
- import { getFileHash } from '../../utils.mjs';
4
+ import { getDictionariesPath } from "../../getDictionariesPath.mjs";
5
+ import { getFileHash } from "../../utils.mjs";
6
6
  const { content } = getConfiguration();
7
7
  const { mainDir } = content;
8
8
  const generateDictionaryListContent = (dictionaries, format = "esm") => {
@@ -1,2 +1,2 @@
1
- export * from './createDictionaryList.mjs';
1
+ export * from "./createDictionaryList.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, writeFileSync } from "fs";
2
2
  import { basename, join, relative } from "path";
3
3
  import { Locales, getConfiguration } from "@intlayer/config";
4
4
  import fg from "fast-glob";
5
- import { getFileHash, transformToCamelCase } from '../../utils.mjs';
5
+ import { getFileHash, transformToCamelCase } from "../../utils.mjs";
6
6
  const { content, internationalization } = getConfiguration();
7
7
  const { typesDir, moduleAugmentationDir } = content;
8
8
  const { locales, strictMode } = internationalization;
@@ -1,3 +1,3 @@
1
- export * from './createModuleAugmentation.mjs';
2
- export * from './createType.mjs';
1
+ export * from "./createModuleAugmentation.mjs";
2
+ export * from "./createType.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1,4 +1,5 @@
1
1
  export { watch } from './chokidar/watcher';
2
+ export { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';
2
3
  export { createDictionaryList } from './transpiler/dictionary_to_main/createDictionaryList';
3
4
  export { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';
4
5
  export { fetchDistantDictionaries } from './fetchDistantDictionaries';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA+GrE,eAAO,MAAM,uBAAuB,+BACN,MAAM,EAAE,KACnC,OAAO,CAAC,UAAU,EAAE,CAsBtB,CAAC"}
1
+ {"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAsB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA+GrE,eAAO,MAAM,uBAAuB,+BACN,MAAM,EAAE,KACnC,OAAO,CAAC,UAAU,EAAE,CAuBtB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/chokidar",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "private": false,
5
5
  "description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
6
6
  "keywords": [
@@ -64,10 +64,10 @@
64
64
  "p-limit": "^3.1.0",
65
65
  "quicktype-core": "^23.0.170",
66
66
  "react": "^18.3.1",
67
- "@intlayer/api": "4.0.4",
68
- "@intlayer/config": "4.0.4",
69
- "intlayer": "4.0.4",
70
- "@intlayer/core": "4.0.4"
67
+ "@intlayer/api": "4.0.5",
68
+ "@intlayer/config": "4.0.5",
69
+ "@intlayer/core": "4.0.5",
70
+ "intlayer": "4.0.5"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@changesets/cli": "2.27.11",
@@ -81,18 +81,18 @@
81
81
  "tsc-alias": "^1.8.10",
82
82
  "tsup": "^8.3.5",
83
83
  "typescript": "^5.7.3",
84
- "@intlayer/backend": "4.0.4",
85
- "@utils/ts-config": "1.0.4",
84
+ "@intlayer/backend": "4.0.5",
86
85
  "@utils/eslint-config": "1.0.4",
86
+ "@utils/tsup-config": "1.0.4",
87
87
  "@utils/ts-config-types": "1.0.4",
88
- "@utils/tsup-config": "1.0.4"
88
+ "@utils/ts-config": "1.0.4"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "fast-glob": "^3.3.3",
92
- "@intlayer/config": "4.0.4",
93
- "@intlayer/core": "4.0.4",
94
- "@intlayer/api": "4.0.4",
95
- "intlayer": "^4.0.4"
92
+ "@intlayer/config": "4.0.5",
93
+ "@intlayer/core": "4.0.5",
94
+ "@intlayer/api": "4.0.5",
95
+ "intlayer": "^4.0.5"
96
96
  },
97
97
  "engines": {
98
98
  "node": ">=14.18"