@intlayer/chokidar 7.5.0-canary.0 → 7.5.0-canary.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/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +14 -9
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +2 -2
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/index.cjs +1 -1
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +14 -9
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +2 -2
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
- package/dist/esm/utils/runParallel/index.mjs +1 -1
- package/dist/esm/utils/runParallel/index.mjs.map +1 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
- package/dist/types/listDictionariesPath.d.ts +2 -2
- package/dist/types/listDictionariesPath.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +2 -2
- package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -1
- package/package.json +13 -13
|
@@ -12,8 +12,8 @@ let __intlayer_config = require("@intlayer/config");
|
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
|
|
14
14
|
//#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts
|
|
15
|
-
const writeDictionaryFiles = async (paths, fileName, functionName, format, configuration = (0, __intlayer_config.getConfiguration)()) => {
|
|
16
|
-
const content = require_createDictionaryEntryPoint_generateDictionaryListContent.generateDictionaryListContent(await paths, functionName, format, configuration);
|
|
15
|
+
const writeDictionaryFiles = async (paths, fileName, importType, functionName, format, configuration = (0, __intlayer_config.getConfiguration)()) => {
|
|
16
|
+
const content = require_createDictionaryEntryPoint_generateDictionaryListContent.generateDictionaryListContent(await paths, functionName, importType, format, configuration);
|
|
17
17
|
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
18
18
|
const { mainDir } = configuration.content;
|
|
19
19
|
await require_writeFileIfChanged.writeFileIfChanged((0, node_path.resolve)(mainDir, `${fileName}.${extension}`), content);
|
|
@@ -26,37 +26,42 @@ const createDictionaryEntryPoint = async (configuration = (0, __intlayer_config.
|
|
|
26
26
|
const { mainDir } = configuration.content;
|
|
27
27
|
await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
28
28
|
await require_utils_parallelize.parallelize([
|
|
29
|
-
...outputFormats.map((format) => ({
|
|
30
|
-
paths: require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath.getBuiltRemoteDictionariesPath(configuration),
|
|
31
|
-
functionName: "getRemoteDictionaries",
|
|
32
|
-
fileName: "remote_dictionaries",
|
|
33
|
-
format
|
|
34
|
-
})),
|
|
35
29
|
...outputFormats.map((format) => ({
|
|
36
30
|
paths: require_createDictionaryEntryPoint_getBuiltDictionariesPath.getBuiltDictionariesPath(configuration),
|
|
31
|
+
importType: "json",
|
|
37
32
|
functionName: "getDictionaries",
|
|
38
33
|
fileName: "dictionaries",
|
|
39
34
|
format
|
|
40
35
|
})),
|
|
41
36
|
...outputFormats.map((format) => ({
|
|
42
37
|
paths: require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath.getBuiltUnmergedDictionariesPath(configuration),
|
|
38
|
+
importType: "json",
|
|
43
39
|
functionName: "getUnmergedDictionaries",
|
|
44
40
|
fileName: "unmerged_dictionaries",
|
|
45
41
|
format
|
|
46
42
|
})),
|
|
47
43
|
...outputFormats.map((format) => ({
|
|
48
44
|
paths: require_createDictionaryEntryPoint_getBuiltDynamicDictionariesPath.getBuiltDynamicDictionariesPath(configuration, format),
|
|
45
|
+
importType: "javascript",
|
|
49
46
|
functionName: "getDynamicDictionaries",
|
|
50
47
|
fileName: "dynamic_dictionaries",
|
|
51
48
|
format
|
|
52
49
|
})),
|
|
53
50
|
...outputFormats.map((format) => ({
|
|
54
51
|
paths: require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath.getBuiltFetchDictionariesPath(configuration, format),
|
|
52
|
+
importType: "javascript",
|
|
55
53
|
functionName: "getFetchDictionaries",
|
|
56
54
|
fileName: "fetch_dictionaries",
|
|
57
55
|
format
|
|
56
|
+
})),
|
|
57
|
+
...outputFormats.map((format) => ({
|
|
58
|
+
paths: require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath.getBuiltRemoteDictionariesPath(configuration),
|
|
59
|
+
importType: "json",
|
|
60
|
+
functionName: "getRemoteDictionaries",
|
|
61
|
+
fileName: "remote_dictionaries",
|
|
62
|
+
format
|
|
58
63
|
}))
|
|
59
|
-
], async ({ paths, fileName, format, functionName }) => writeDictionaryFiles(paths, fileName, functionName, format, configuration));
|
|
64
|
+
], async ({ paths, fileName, format, functionName, importType }) => writeDictionaryFiles(paths, fileName, importType, functionName, format, configuration));
|
|
60
65
|
};
|
|
61
66
|
|
|
62
67
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDictionaryEntryPoint.cjs","names":["generateDictionaryListContent","writeFileIfChanged","parallelize","
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.cjs","names":["generateDictionaryListContent","writeFileIfChanged","parallelize","getBuiltDictionariesPath","getBuiltUnmergedDictionariesPath","getBuiltDynamicDictionariesPath","getBuiltFetchDictionariesPath","getBuiltRemoteDictionariesPath"],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.content;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n formats?: ('cjs' | 'esm')[]\n) => {\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.content;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(configuration, format),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(configuration, format),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAM,uBAAuB,OAC3B,OACA,UACA,YACA,cACA,QACA,yDAAkC,KAC/B;CACH,MAAM,UAAUA,+FACd,MAAM,OACN,cACA,YACA,QACA,cACD;CACD,MAAM,YAAY,WAAW,QAAQ,QAAQ;CAE7C,MAAM,EAAE,YAAY,cAAc;AAElC,OAAMC,qEACI,SAAS,GAAG,SAAS,GAAG,YAAY,EAC5C,QACD;;;;;AAMH,MAAa,6BAA6B,OACxC,yDAAkC,EAClC,YACG;CACH,MAAM,gBAAgB,WAAW,cAAc,MAAM;CACrD,MAAM,EAAE,YAAY,cAAc;AAElC,mCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;AAuDzC,OAAMC,sCArDkB;EACtB,GAAG,cAAc,KACd,YACE;GACC,OAAOC,qFAAyB,cAAc;GAC9C,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,qGAAiC,cAAc;GACtD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,mGAAgC,eAAe,OAAO;GAC7D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,+FAA8B,eAAe,OAAO;GAC3D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,iGAA+B,cAAc;GACpD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACF,EAIC,OAAO,EAAE,OAAO,UAAU,QAAQ,cAAc,iBAC9C,qBACE,OACA,UACA,YACA,cACA,QACA,cACD,CACJ"}
|
|
@@ -7,7 +7,7 @@ let node_path = require("node:path");
|
|
|
7
7
|
/**
|
|
8
8
|
* This function generates the content of the dictionary list file
|
|
9
9
|
*/
|
|
10
|
-
const generateDictionaryListContent = (dictionaries, functionName, format = "esm", configuration = (0, __intlayer_config.getConfiguration)()) => {
|
|
10
|
+
const generateDictionaryListContent = (dictionaries, functionName, importType, format = "esm", configuration = (0, __intlayer_config.getConfiguration)()) => {
|
|
11
11
|
const { mainDir } = configuration.content;
|
|
12
12
|
let content = "";
|
|
13
13
|
const dictionariesRef = dictionaries.map((dictionaryPath) => ({
|
|
@@ -16,7 +16,7 @@ const generateDictionaryListContent = (dictionaries, functionName, format = "esm
|
|
|
16
16
|
hash: `_${require_utils_getFileHash.getFileHash(dictionaryPath)}`
|
|
17
17
|
}));
|
|
18
18
|
dictionariesRef.forEach((dictionary) => {
|
|
19
|
-
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}' with { type: 'json' };\n`;
|
|
19
|
+
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === "json" ? " with { type: 'json' }" : ""};\n`;
|
|
20
20
|
if (format === "cjs") content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\n`;
|
|
21
21
|
});
|
|
22
22
|
content += "\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDictionaryListContent.cjs","names":["getFileHash","formattedDictionaryMap: string"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration, normalizePath } from '@intlayer/config';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.content;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}' with { type: 'json' };\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,iCACX,cACA,cACA,SAAwB,OACxB,yDAAkC,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,2EAAqC,SAAS,eAAe,CAAC;EAC9D,4BAAa,uCAAwB,eAAe,CAAC;EACrD,MAAM,IAAIA,sCAAY,eAAe;EACtC,EAAE;AAGH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.cjs","names":["getFileHash","formattedDictionaryMap: string"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration, normalizePath } from '@intlayer/config';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n importType: 'json' | 'javascript',\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.content;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === 'json' ? \" with { type: 'json' }\" : ''};\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;;AAOA,MAAa,iCACX,cACA,cACA,YACA,SAAwB,OACxB,yDAAkC,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,2EAAqC,SAAS,eAAe,CAAC;EAC9D,4BAAa,uCAAwB,eAAe,CAAC;EACrD,MAAM,IAAIA,sCAAY,eAAe;EACtC,EAAE;AAGH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa,GAAG,eAAe,SAAS,2BAA2B,GAAG;AACjI,MAAI,WAAW,MACb,YAAW,SAAS,WAAW,KAAK,cAAc,WAAW,aAAa;GAC5E;AAEF,YAAW;CAGX,MAAMC,yBAAiC,gBACpC,KAAK,eAAe,MAAM,WAAW,GAAG,KAAK,WAAW,OAAO,CAC/D,KAAK,MAAM;AAEd,YAAW,2BAA2B,uBAAuB;AAC7D,YAAW,SAAS,aAAa;AAEjC,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,YAAY,aAAa;AACpC,aAAW;;AAGb,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,kBAAkB,aAAa,KAAK,aAAa;AAC5D,aAAW;;AAGb,QAAO"}
|
|
@@ -27,7 +27,7 @@ const runParallel = (proc) => {
|
|
|
27
27
|
cwd: process.cwd(),
|
|
28
28
|
stdio: "inherit",
|
|
29
29
|
env: childEnv,
|
|
30
|
-
shell:
|
|
30
|
+
shell: isWin
|
|
31
31
|
};
|
|
32
32
|
const child = isArray ? args.length === 0 && /\s/.test(command) ? isWin ? spawnFunc(process.env.ComSpec ?? "cmd.exe", [
|
|
33
33
|
"/d",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix","signalHandlers: { event: string; handler: (...args: any[]) => void }[]"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell:
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix","signalHandlers: { event: string; handler: (...args: any[]) => void }[]"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0 || (signal && gracefulSignals.includes(signal))) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n const signalHandlers: { event: string; handler: (...args: any[]) => void }[] =\n [\n { event: 'SIGINT', handler: cleanup },\n { event: 'SIGTERM', handler: cleanup },\n { event: 'SIGQUIT', handler: cleanup },\n { event: 'SIGHUP', handler: cleanup },\n ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;;AAcA,MAAa,eAAe,SAA6C;AACvE,KAAI,CAAC,QAAS,MAAM,QAAQ,KAAK,IAAI,KAAK,WAAW,EACnD,OAAM,IAAI,MAAM,kBAAkB;CAEpC,MAAM,cAAc,MAAM,QAAQ,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG;CAE3D,MAAM,UAAU,MAAM,QAAQ,KAAK;CACnC,MAAM,UAAU,UAAW,KAAkB,KAAK;CAClD,MAAM,OAAO,UAAW,KAAkB,MAAM,EAAE,GAAG,EAAE;CAGvD,MAAM,6BAAc,QAAQ,KAAK,EAAE,gBAAgB,OAAO;CAC1D,MAAM,WACJ,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,QAAQ,IAAI,aAAa,KAAK,OAAO,IACpE;CAEF,MAAM,eAAe,CAAC,QAAQ,QAAQ,IAAI,aAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAKA,oBAAU;CAElB,MAAM,WAAW;EACf,GAAG,QAAQ;GACV,WAAW;EACb;CAED,MAAM,QAAQ,QAAQ,aAAa;CACnC,MAAM,YAAY,QAAQC,kDAAaC;CAGvC,MAAM,eAAe;EACnB,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,KAAK;EACL,OAAO;EACR;CAGD,MAAM,QAAQ,UAEV,KAAK,WAAW,KAAK,KAAK,KAAK,QAAQ,GACrC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAQ,EAC3B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,QAAQ,EACf,aACD,GACH,UAAU,SAAS,MAAM,aAAa,GACxC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAY,EAC/B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,YAAY,EACnB,aACD;CAEP,MAAM,SAAS,IAAI,SAAe,SAAS,WAAW;AACpD,QAAM,GAAG,UAAU,QAAQ;AACzB,OAAI;AACF,YAAQ,MACN,kCAAkC,KAAK,WAAW,OAAO,IAAI,GAC9D;WACK;AACR,oBAAiB;AACjB,UAAO,IAAI;IACX;AAEF,QAAM,GAAG,SAAS,MAAM,WAAW;AACjC,oBAAiB;AAIjB,OAAI,SAAS,KAAM,UADK;IAAC;IAAU;IAAW;IAAW;IAAS,CACrB,SAAS,OAAO,CAC3D,UAAS;OAET,QACE,OAAO,uBAAO,IAAI,MAAM,0BAA0B,EAAE;IAAE;IAAM;IAAQ,CAAC,CACtE;IAEH;GACF;CAEF,MAAM,gBAAgB;AACpB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;CAKV,MAAMC,iBACJ;EACE;GAAE,OAAO;GAAU,SAAS;GAAS;EACrC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAU,SAAS;GAAS;EACtC;AAGH,gBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,UAAQ,GAAG,OAAc,QAAe;GACxC;CAEF,MAAM,wBAAwB;AAC5B,iBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,WAAQ,IAAI,OAAc,QAAe;IACzC;;CAGJ,MAAM,aAAa;AACjB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;AAKV,QAAO;EAAE;EAAM;EAAQ;EAAa"}
|
|
@@ -11,8 +11,8 @@ import { getConfiguration } from "@intlayer/config";
|
|
|
11
11
|
import { resolve } from "node:path";
|
|
12
12
|
|
|
13
13
|
//#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts
|
|
14
|
-
const writeDictionaryFiles = async (paths, fileName, functionName, format, configuration = getConfiguration()) => {
|
|
15
|
-
const content = generateDictionaryListContent(await paths, functionName, format, configuration);
|
|
14
|
+
const writeDictionaryFiles = async (paths, fileName, importType, functionName, format, configuration = getConfiguration()) => {
|
|
15
|
+
const content = generateDictionaryListContent(await paths, functionName, importType, format, configuration);
|
|
16
16
|
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
17
17
|
const { mainDir } = configuration.content;
|
|
18
18
|
await writeFileIfChanged(resolve(mainDir, `${fileName}.${extension}`), content);
|
|
@@ -25,37 +25,42 @@ const createDictionaryEntryPoint = async (configuration = getConfiguration(), fo
|
|
|
25
25
|
const { mainDir } = configuration.content;
|
|
26
26
|
await mkdir(mainDir, { recursive: true });
|
|
27
27
|
await parallelize([
|
|
28
|
-
...outputFormats.map((format) => ({
|
|
29
|
-
paths: getBuiltRemoteDictionariesPath(configuration),
|
|
30
|
-
functionName: "getRemoteDictionaries",
|
|
31
|
-
fileName: "remote_dictionaries",
|
|
32
|
-
format
|
|
33
|
-
})),
|
|
34
28
|
...outputFormats.map((format) => ({
|
|
35
29
|
paths: getBuiltDictionariesPath(configuration),
|
|
30
|
+
importType: "json",
|
|
36
31
|
functionName: "getDictionaries",
|
|
37
32
|
fileName: "dictionaries",
|
|
38
33
|
format
|
|
39
34
|
})),
|
|
40
35
|
...outputFormats.map((format) => ({
|
|
41
36
|
paths: getBuiltUnmergedDictionariesPath(configuration),
|
|
37
|
+
importType: "json",
|
|
42
38
|
functionName: "getUnmergedDictionaries",
|
|
43
39
|
fileName: "unmerged_dictionaries",
|
|
44
40
|
format
|
|
45
41
|
})),
|
|
46
42
|
...outputFormats.map((format) => ({
|
|
47
43
|
paths: getBuiltDynamicDictionariesPath(configuration, format),
|
|
44
|
+
importType: "javascript",
|
|
48
45
|
functionName: "getDynamicDictionaries",
|
|
49
46
|
fileName: "dynamic_dictionaries",
|
|
50
47
|
format
|
|
51
48
|
})),
|
|
52
49
|
...outputFormats.map((format) => ({
|
|
53
50
|
paths: getBuiltFetchDictionariesPath(configuration, format),
|
|
51
|
+
importType: "javascript",
|
|
54
52
|
functionName: "getFetchDictionaries",
|
|
55
53
|
fileName: "fetch_dictionaries",
|
|
56
54
|
format
|
|
55
|
+
})),
|
|
56
|
+
...outputFormats.map((format) => ({
|
|
57
|
+
paths: getBuiltRemoteDictionariesPath(configuration),
|
|
58
|
+
importType: "json",
|
|
59
|
+
functionName: "getRemoteDictionaries",
|
|
60
|
+
fileName: "remote_dictionaries",
|
|
61
|
+
format
|
|
57
62
|
}))
|
|
58
|
-
], async ({ paths, fileName, format, functionName }) => writeDictionaryFiles(paths, fileName, functionName, format, configuration));
|
|
63
|
+
], async ({ paths, fileName, format, functionName, importType }) => writeDictionaryFiles(paths, fileName, importType, functionName, format, configuration));
|
|
59
64
|
};
|
|
60
65
|
|
|
61
66
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDictionaryEntryPoint.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.content;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n formats?: ('cjs' | 'esm')[]\n) => {\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.content;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map((format)
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.content;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n formats?: ('cjs' | 'esm')[]\n) => {\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.content;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(configuration, format),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(configuration, format),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,uBAAuB,OAC3B,OACA,UACA,YACA,cACA,QACA,gBAAgB,kBAAkB,KAC/B;CACH,MAAM,UAAU,8BACd,MAAM,OACN,cACA,YACA,QACA,cACD;CACD,MAAM,YAAY,WAAW,QAAQ,QAAQ;CAE7C,MAAM,EAAE,YAAY,cAAc;AAElC,OAAM,mBACJ,QAAQ,SAAS,GAAG,SAAS,GAAG,YAAY,EAC5C,QACD;;;;;AAMH,MAAa,6BAA6B,OACxC,gBAAgB,kBAAkB,EAClC,YACG;CACH,MAAM,gBAAgB,WAAW,cAAc,MAAM;CACrD,MAAM,EAAE,YAAY,cAAc;AAElC,OAAM,MAAM,SAAS,EAAE,WAAW,MAAM,CAAC;AAuDzC,OAAM,YArDkB;EACtB,GAAG,cAAc,KACd,YACE;GACC,OAAO,yBAAyB,cAAc;GAC9C,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,iCAAiC,cAAc;GACtD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,gCAAgC,eAAe,OAAO;GAC7D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,8BAA8B,eAAe,OAAO;GAC3D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,+BAA+B,cAAc;GACpD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACF,EAIC,OAAO,EAAE,OAAO,UAAU,QAAQ,cAAc,iBAC9C,qBACE,OACA,UACA,YACA,cACA,QACA,cACD,CACJ"}
|
|
@@ -6,7 +6,7 @@ import { basename, extname, relative } from "node:path";
|
|
|
6
6
|
/**
|
|
7
7
|
* This function generates the content of the dictionary list file
|
|
8
8
|
*/
|
|
9
|
-
const generateDictionaryListContent = (dictionaries, functionName, format = "esm", configuration = getConfiguration()) => {
|
|
9
|
+
const generateDictionaryListContent = (dictionaries, functionName, importType, format = "esm", configuration = getConfiguration()) => {
|
|
10
10
|
const { mainDir } = configuration.content;
|
|
11
11
|
let content = "";
|
|
12
12
|
const dictionariesRef = dictionaries.map((dictionaryPath) => ({
|
|
@@ -15,7 +15,7 @@ const generateDictionaryListContent = (dictionaries, functionName, format = "esm
|
|
|
15
15
|
hash: `_${getFileHash(dictionaryPath)}`
|
|
16
16
|
}));
|
|
17
17
|
dictionariesRef.forEach((dictionary) => {
|
|
18
|
-
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}' with { type: 'json' };\n`;
|
|
18
|
+
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === "json" ? " with { type: 'json' }" : ""};\n`;
|
|
19
19
|
if (format === "cjs") content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\n`;
|
|
20
20
|
});
|
|
21
21
|
content += "\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDictionaryListContent.mjs","names":["formattedDictionaryMap: string"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration, normalizePath } from '@intlayer/config';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.content;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}' with { type: 'json' };\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,iCACX,cACA,cACA,SAAwB,OACxB,gBAAgB,kBAAkB,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,cAAc,cAAc,SAAS,SAAS,eAAe,CAAC;EAC9D,IAAI,SAAS,gBAAgB,QAAQ,eAAe,CAAC;EACrD,MAAM,IAAI,YAAY,eAAe;EACtC,EAAE;AAGH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa;
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.mjs","names":["formattedDictionaryMap: string"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration, normalizePath } from '@intlayer/config';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n importType: 'json' | 'javascript',\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.content;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === 'json' ? \" with { type: 'json' }\" : ''};\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,iCACX,cACA,cACA,YACA,SAAwB,OACxB,gBAAgB,kBAAkB,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,cAAc,cAAc,SAAS,SAAS,eAAe,CAAC;EAC9D,IAAI,SAAS,gBAAgB,QAAQ,eAAe,CAAC;EACrD,MAAM,IAAI,YAAY,eAAe;EACtC,EAAE;AAGH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa,GAAG,eAAe,SAAS,2BAA2B,GAAG;AACjI,MAAI,WAAW,MACb,YAAW,SAAS,WAAW,KAAK,cAAc,WAAW,aAAa;GAC5E;AAEF,YAAW;CAGX,MAAMA,yBAAiC,gBACpC,KAAK,eAAe,MAAM,WAAW,GAAG,KAAK,WAAW,OAAO,CAC/D,KAAK,MAAM;AAEd,YAAW,2BAA2B,uBAAuB;AAC7D,YAAW,SAAS,aAAa;AAEjC,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,YAAY,aAAa;AACpC,aAAW;;AAGb,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,kBAAkB,aAAa,KAAK,aAAa;AAC5D,aAAW;;AAGb,QAAO"}
|
|
@@ -26,7 +26,7 @@ const runParallel = (proc) => {
|
|
|
26
26
|
cwd: process.cwd(),
|
|
27
27
|
stdio: "inherit",
|
|
28
28
|
env: childEnv,
|
|
29
|
-
shell:
|
|
29
|
+
shell: isWin
|
|
30
30
|
};
|
|
31
31
|
const child = isArray ? args.length === 0 && /\s/.test(command) ? isWin ? spawnFunc(process.env.ComSpec ?? "cmd.exe", [
|
|
32
32
|
"/d",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["signalHandlers: { event: string; handler: (...args: any[]) => void }[]"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell:
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["signalHandlers: { event: string; handler: (...args: any[]) => void }[]"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using npm-run-all approach.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\n );\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0 || (signal && gracefulSignals.includes(signal))) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n const signalHandlers: { event: string; handler: (...args: any[]) => void }[] =\n [\n { event: 'SIGINT', handler: cleanup },\n { event: 'SIGTERM', handler: cleanup },\n { event: 'SIGQUIT', handler: cleanup },\n { event: 'SIGHUP', handler: cleanup },\n ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;AAcA,MAAa,eAAe,SAA6C;AACvE,KAAI,CAAC,QAAS,MAAM,QAAQ,KAAK,IAAI,KAAK,WAAW,EACnD,OAAM,IAAI,MAAM,kBAAkB;CAEpC,MAAM,cAAc,MAAM,QAAQ,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG;CAE3D,MAAM,UAAU,MAAM,QAAQ,KAAK;CACnC,MAAM,UAAU,UAAW,KAAkB,KAAK;CAClD,MAAM,OAAO,UAAW,KAAkB,MAAM,EAAE,GAAG,EAAE;CAGvD,MAAM,SAAS,KAAK,QAAQ,KAAK,EAAE,gBAAgB,OAAO;CAC1D,MAAM,WACJ,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,QAAQ,IAAI,aAAa,KAAK,OAAO,IACpE;CAEF,MAAM,eAAe,CAAC,QAAQ,QAAQ,IAAI,aAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAK,UAAU;CAElB,MAAM,WAAW;EACf,GAAG,QAAQ;GACV,WAAW;EACb;CAED,MAAM,QAAQ,QAAQ,aAAa;CACnC,MAAM,YAAY,QAAQ,aAAa;CAGvC,MAAM,eAAe;EACnB,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,KAAK;EACL,OAAO;EACR;CAGD,MAAM,QAAQ,UAEV,KAAK,WAAW,KAAK,KAAK,KAAK,QAAQ,GACrC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAQ,EAC3B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,QAAQ,EACf,aACD,GACH,UAAU,SAAS,MAAM,aAAa,GACxC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAY,EAC/B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,YAAY,EACnB,aACD;CAEP,MAAM,SAAS,IAAI,SAAe,WAAS,WAAW;AACpD,QAAM,GAAG,UAAU,QAAQ;AACzB,OAAI;AACF,YAAQ,MACN,kCAAkC,KAAK,WAAW,OAAO,IAAI,GAC9D;WACK;AACR,oBAAiB;AACjB,UAAO,IAAI;IACX;AAEF,QAAM,GAAG,SAAS,MAAM,WAAW;AACjC,oBAAiB;AAIjB,OAAI,SAAS,KAAM,UADK;IAAC;IAAU;IAAW;IAAW;IAAS,CACrB,SAAS,OAAO,CAC3D,YAAS;OAET,QACE,OAAO,uBAAO,IAAI,MAAM,0BAA0B,EAAE;IAAE;IAAM;IAAQ,CAAC,CACtE;IAEH;GACF;CAEF,MAAM,gBAAgB;AACpB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;CAKV,MAAMA,iBACJ;EACE;GAAE,OAAO;GAAU,SAAS;GAAS;EACrC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAU,SAAS;GAAS;EACtC;AAGH,gBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,UAAQ,GAAG,OAAc,QAAe;GACxC;CAEF,MAAM,wBAAwB;AAC5B,iBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,WAAQ,IAAI,OAAc,QAAe;IACzC;;CAGJ,MAAM,aAAa;AACjB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;AAKV,QAAO;EAAE;EAAM;EAAQ;EAAa"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { UnmergedDictionaryOutput } from "./writeUnmergedDictionary.js";
|
|
2
2
|
import { MergedDictionaryOutput } from "./writeMergedDictionary.js";
|
|
3
3
|
import { LocalizedDictionaryOutput } from "./writeDynamicDictionary.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _intlayer_types20 from "@intlayer/types";
|
|
5
5
|
import { Dictionary } from "@intlayer/types";
|
|
6
6
|
|
|
7
7
|
//#region src/buildIntlayerDictionary/buildIntlayerDictionary.d.ts
|
|
8
8
|
/**
|
|
9
9
|
* This function transpile the bundled code to to make dictionaries as JSON files
|
|
10
10
|
*/
|
|
11
|
-
declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?:
|
|
11
|
+
declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?: _intlayer_types20.IntlayerConfig, formats?: ("cjs" | "esm")[], importOtherDictionaries?: boolean) => Promise<{
|
|
12
12
|
unmergedDictionaries: UnmergedDictionaryOutput;
|
|
13
13
|
mergedDictionaries: MergedDictionaryOutput;
|
|
14
14
|
dynamicDictionaries: LocalizedDictionaryOutput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MergedDictionaryOutput } from "./writeMergedDictionary.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _intlayer_types16 from "@intlayer/types";
|
|
3
3
|
import { Dictionary, Locale } from "@intlayer/types";
|
|
4
4
|
|
|
5
5
|
//#region src/buildIntlayerDictionary/writeDynamicDictionary.d.ts
|
|
@@ -12,7 +12,7 @@ type LocalizedDictionaryOutput = Record<string, LocalizedDictionaryResult>;
|
|
|
12
12
|
/**
|
|
13
13
|
* This function generates the content of the dictionary list file
|
|
14
14
|
*/
|
|
15
|
-
declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?:
|
|
15
|
+
declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types16.IntlayerConfig) => string;
|
|
16
16
|
/**
|
|
17
17
|
* Write the localized dictionaries to the dictionariesDir
|
|
18
18
|
* @param mergedDictionaries - The merged dictionaries
|
|
@@ -29,7 +29,7 @@ declare const generateDictionaryEntryPoint: (localizedDictionariesPathsRecord: L
|
|
|
29
29
|
* // { key: 'home', content: { ... } },
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
declare const writeDynamicDictionary: (mergedDictionaries: MergedDictionaryOutput, configuration?:
|
|
32
|
+
declare const writeDynamicDictionary: (mergedDictionaries: MergedDictionaryOutput, configuration?: _intlayer_types16.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { DictionaryResult, LocalizedDictionaryOutput, LocalizedDictionaryResult, generateDictionaryEntryPoint, writeDynamicDictionary };
|
|
35
35
|
//# sourceMappingURL=writeDynamicDictionary.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { LocalizedDictionaryOutput, LocalizedDictionaryResult } from "./writeDynamicDictionary.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _intlayer_types21 from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/buildIntlayerDictionary/writeFetchDictionary.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* This function generates the content of the dictionary list file
|
|
7
7
|
*/
|
|
8
|
-
declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?:
|
|
8
|
+
declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: _intlayer_types21.IntlayerConfig) => string;
|
|
9
9
|
/**
|
|
10
10
|
* Write the localized dictionaries to the dictionariesDir
|
|
11
11
|
* @param mergedDictionaries - The merged dictionaries
|
|
@@ -22,7 +22,7 @@ declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: Loc
|
|
|
22
22
|
* // { key: 'home', content: { ... } },
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const writeFetchDictionary: (dynamicDictionaries: LocalizedDictionaryOutput, configuration?:
|
|
25
|
+
declare const writeFetchDictionary: (dynamicDictionaries: LocalizedDictionaryOutput, configuration?: _intlayer_types21.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
|
|
26
26
|
//#endregion
|
|
27
27
|
export { generateDictionaryEntryPoint, writeFetchDictionary };
|
|
28
28
|
//# sourceMappingURL=writeFetchDictionary.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnmergedDictionaryOutput } from "./writeUnmergedDictionary.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _intlayer_types19 from "@intlayer/types";
|
|
3
3
|
import { Dictionary } from "@intlayer/types";
|
|
4
4
|
|
|
5
5
|
//#region src/buildIntlayerDictionary/writeMergedDictionary.d.ts
|
|
@@ -24,7 +24,7 @@ type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;
|
|
|
24
24
|
* // { key: 'home', content: { ... } },
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
declare const writeMergedDictionaries: (groupedDictionaries: UnmergedDictionaryOutput, configuration?:
|
|
27
|
+
declare const writeMergedDictionaries: (groupedDictionaries: UnmergedDictionaryOutput, configuration?: _intlayer_types19.IntlayerConfig) => Promise<MergedDictionaryOutput>;
|
|
28
28
|
//#endregion
|
|
29
29
|
export { MergedDictionaryOutput, MergedDictionaryResult, writeMergedDictionaries };
|
|
30
30
|
//# sourceMappingURL=writeMergedDictionary.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types18 from "@intlayer/types";
|
|
2
2
|
import { Dictionary } from "@intlayer/types";
|
|
3
3
|
|
|
4
4
|
//#region src/buildIntlayerDictionary/writeRemoteDictionary.d.ts
|
|
@@ -23,7 +23,7 @@ type RemoteDictionaryOutput = Record<string, RemoteDictionaryResult>;
|
|
|
23
23
|
* // { key: 'home', content: { ... } },
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?:
|
|
26
|
+
declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?: _intlayer_types18.IntlayerConfig) => Promise<RemoteDictionaryOutput>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { RemoteDictionaryOutput, RemoteDictionaryResult, writeRemoteDictionary };
|
|
29
29
|
//# sourceMappingURL=writeRemoteDictionary.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _intlayer_types14 from "@intlayer/types";
|
|
2
2
|
|
|
3
3
|
//#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* This function generates a list of dictionaries in the main directory
|
|
6
6
|
*/
|
|
7
|
-
declare const createDictionaryEntryPoint: (configuration?:
|
|
7
|
+
declare const createDictionaryEntryPoint: (configuration?: _intlayer_types14.IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<void>;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { createDictionaryEntryPoint };
|
|
10
10
|
//# sourceMappingURL=createDictionaryEntryPoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDictionaryEntryPoint.d.ts","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.d.ts","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":[],"mappings":";;;;;;AAwCa,cAAA,0BA0EZ,EAAA,CAAA,aAxE4B,CAD3B,EAyED,iBAAA,CAzEC,cAC2B,EAAA,OAAA,CAAA,EAAA,CAAA,KAAA,GAAA,KAAA,CAAA,EAAA,EAAA,GAAA,OAAA,CAAA,IAAA,CAAA"}
|
|
@@ -4,7 +4,7 @@ import * as _intlayer_types13 from "@intlayer/types";
|
|
|
4
4
|
/**
|
|
5
5
|
* This function generates the content of the dictionary list file
|
|
6
6
|
*/
|
|
7
|
-
declare const generateDictionaryListContent: (dictionaries: string[], functionName: string, format?: "cjs" | "esm", configuration?: _intlayer_types13.IntlayerConfig) => string;
|
|
7
|
+
declare const generateDictionaryListContent: (dictionaries: string[], functionName: string, importType: "json" | "javascript", format?: "cjs" | "esm", configuration?: _intlayer_types13.IntlayerConfig) => string;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { generateDictionaryListContent };
|
|
10
10
|
//# sourceMappingURL=generateDictionaryListContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDictionaryListContent.d.ts","names":[],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":[],"mappings":";;;;;;AAOa,cAAA,
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.d.ts","names":[],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":[],"mappings":";;;;;;AAOa,cAAA,6BAgDZ,EAAA,CAAA,YAAA,EA3CC,MAAA,EAAA,EAAA,YAAkC,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,GAAA,YAAA,EAAA,MAAA,CAAA,EAAA,KAAA,GAAA,KAAA,EAAA,aAAA,CAAA,EA2CnC,iBAAA,CA3CC,cAAkC,EAAA,GAAA,MAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IntlayerConfig } from "@intlayer/types";
|
|
2
|
-
import * as
|
|
2
|
+
import * as node_fs0 from "node:fs";
|
|
3
3
|
|
|
4
4
|
//#region src/listDictionariesPath.d.ts
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ import * as fs0 from "fs";
|
|
|
11
11
|
declare const listDictionaries: (configuration: IntlayerConfig) => Promise<string[]>;
|
|
12
12
|
declare const listDictionariesWithStats: (configuration: IntlayerConfig) => Promise<{
|
|
13
13
|
path: string;
|
|
14
|
-
stats:
|
|
14
|
+
stats: node_fs0.Stats;
|
|
15
15
|
}[]>;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { listDictionaries, listDictionariesWithStats };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listDictionariesPath.d.ts","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AAaA;AACiB,cAdJ,gBAcI,EAAA,CAAA,aAAA,EAbA,cAaA,EAAA,GAZd,OAYc,CAAA,MAAA,EAAA,CAAA;AAAc,cADlB,yBACkB,EAAA,CAAA,aAAA,EAAd,cAAc,EAAA,GAAA,OAAA,CAAA;EAAA,IAAA,EAAA,MAAA;EAAA,KAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"listDictionariesPath.d.ts","names":[],"sources":["../../src/listDictionariesPath.ts"],"sourcesContent":[],"mappings":";;;;;;;;AASA;AAaA;AACiB,cAdJ,gBAcI,EAAA,CAAA,aAAA,EAbA,cAaA,EAAA,GAZd,OAYc,CAAA,MAAA,EAAA,CAAA;AAAc,cADlB,yBACkB,EAAA,CAAA,aAAA,EAAd,cAAc,EAAA,GAAA,OAAA,CAAA;EAAA,IAAA,EAAA,MAAA;EAAA,KAAA,EAAA,QAAA,CAAA,KAAA"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DictionariesStatus } from "./loadDictionaries.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _intlayer_types15 from "@intlayer/types";
|
|
3
3
|
import { Dictionary } from "@intlayer/types";
|
|
4
4
|
import { DictionaryAPI } from "@intlayer/backend";
|
|
5
5
|
|
|
6
6
|
//#region src/loadDictionaries/loadRemoteDictionaries.d.ts
|
|
7
7
|
declare const formatDistantDictionaries: (dictionaries: (DictionaryAPI | Dictionary)[]) => Dictionary[];
|
|
8
|
-
declare const loadRemoteDictionaries: (configuration?:
|
|
8
|
+
declare const loadRemoteDictionaries: (configuration?: _intlayer_types15.IntlayerConfig, onStatusUpdate?: (status: DictionariesStatus[]) => void, options?: {
|
|
9
9
|
onStartRemoteCheck?: () => void;
|
|
10
10
|
onStopRemoteCheck?: () => void;
|
|
11
11
|
onError?: (error: Error) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFormatFromExtension.d.ts","names":[],"sources":["../../../src/utils/getFormatFromExtension.ts"],"sourcesContent":[],"mappings":";KAAY,MAAA;AAAA,KACA,SAAA,GADM,KAAA,GAAA,MAAA,GAAA,KAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,OAAA,GAAA,OAAA,GAAA,QAAA;AACN,cAYC,sBAZQ,EAAA,CAAA,SAAA,EAY6B,SAZ7B,EAAA,GAYyC,MAZzC;AAYR,cAkBA,sBAlBqC,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"getFormatFromExtension.d.ts","names":[],"sources":["../../../src/utils/getFormatFromExtension.ts"],"sourcesContent":[],"mappings":";KAAY,MAAA;AAAA,KACA,SAAA,GADM,KAAA,GAAA,MAAA,GAAA,KAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,MAAA,GAAA,OAAA,GAAA,OAAA,GAAA,QAAA;AACN,cAYC,sBAZQ,EAAA,CAAA,SAAA,EAY6B,SAZ7B,EAAA,GAYyC,MAZzC;AAYR,cAkBA,sBAlBqC,EAAA,CAAA,MAAA,EAkBH,MAF9C,EAAA,GAEuD,SAFvD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/chokidar",
|
|
3
|
-
"version": "7.5.0-canary.
|
|
3
|
+
"version": "7.5.0-canary.1",
|
|
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": [
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@intlayer/api": "7.5.0-canary.
|
|
79
|
-
"@intlayer/config": "7.5.0-canary.
|
|
80
|
-
"@intlayer/core": "7.5.0-canary.
|
|
81
|
-
"@intlayer/dictionaries-entry": "7.5.0-canary.
|
|
82
|
-
"@intlayer/remote-dictionaries-entry": "7.5.0-canary.
|
|
83
|
-
"@intlayer/types": "7.5.0-canary.
|
|
84
|
-
"@intlayer/unmerged-dictionaries-entry": "7.5.0-canary.
|
|
78
|
+
"@intlayer/api": "7.5.0-canary.1",
|
|
79
|
+
"@intlayer/config": "7.5.0-canary.1",
|
|
80
|
+
"@intlayer/core": "7.5.0-canary.1",
|
|
81
|
+
"@intlayer/dictionaries-entry": "7.5.0-canary.1",
|
|
82
|
+
"@intlayer/remote-dictionaries-entry": "7.5.0-canary.1",
|
|
83
|
+
"@intlayer/types": "7.5.0-canary.1",
|
|
84
|
+
"@intlayer/unmerged-dictionaries-entry": "7.5.0-canary.1",
|
|
85
85
|
"chokidar": "3.6.0",
|
|
86
86
|
"crypto-js": "4.2.0",
|
|
87
87
|
"defu": "6.1.4",
|
|
@@ -91,18 +91,18 @@
|
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@types/crypto-js": "4.2.2",
|
|
94
|
-
"@types/node": "
|
|
94
|
+
"@types/node": "25.0.2",
|
|
95
95
|
"@utils/ts-config": "1.0.4",
|
|
96
96
|
"@utils/ts-config-types": "1.0.4",
|
|
97
97
|
"@utils/tsdown-config": "1.0.4",
|
|
98
98
|
"rimraf": "6.1.2",
|
|
99
|
-
"tsdown": "0.
|
|
99
|
+
"tsdown": "0.18.0",
|
|
100
100
|
"typescript": "5.9.3",
|
|
101
|
-
"vitest": "4.0.
|
|
101
|
+
"vitest": "4.0.16"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@intlayer/svelte-transformer": "7.5.0-canary.
|
|
105
|
-
"@intlayer/vue-transformer": "7.5.0-canary.
|
|
104
|
+
"@intlayer/svelte-transformer": "7.5.0-canary.1",
|
|
105
|
+
"@intlayer/vue-transformer": "7.5.0-canary.1"
|
|
106
106
|
},
|
|
107
107
|
"peerDependenciesMeta": {
|
|
108
108
|
"@intlayer/svelte-transformer": {
|