@intlayer/cli 8.4.5 → 8.4.7
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/fill/fill.cjs +9 -4
- package/dist/cjs/fill/fill.cjs.map +1 -1
- package/dist/cjs/fill/formatFillData.cjs +38 -34
- package/dist/cjs/fill/formatFillData.cjs.map +1 -1
- package/dist/cjs/fill/translateDictionary.cjs +2 -1
- package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
- package/dist/cjs/fill/writeFill.cjs +3 -5
- package/dist/cjs/fill/writeFill.cjs.map +1 -1
- package/dist/cjs/reviewDoc/reviewDoc.cjs +1 -1
- package/dist/cjs/test/listMissingTranslations.cjs +18 -4
- package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
- package/dist/cjs/translateDoc/translateDoc.cjs +1 -1
- package/dist/cjs/utils/getOutputFilePath.cjs +34 -0
- package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
- package/dist/cjs/watch.cjs +4 -3
- package/dist/cjs/watch.cjs.map +1 -1
- package/dist/esm/fill/fill.mjs +11 -6
- package/dist/esm/fill/fill.mjs.map +1 -1
- package/dist/esm/fill/formatFillData.mjs +39 -35
- package/dist/esm/fill/formatFillData.mjs.map +1 -1
- package/dist/esm/fill/translateDictionary.mjs +2 -1
- package/dist/esm/fill/translateDictionary.mjs.map +1 -1
- package/dist/esm/fill/writeFill.mjs +3 -5
- package/dist/esm/fill/writeFill.mjs.map +1 -1
- package/dist/esm/reviewDoc/reviewDoc.mjs +1 -1
- package/dist/esm/test/listMissingTranslations.mjs +18 -4
- package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
- package/dist/esm/translateDoc/translateDoc.mjs +1 -1
- package/dist/esm/utils/getOutputFilePath.mjs +33 -1
- package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
- package/dist/esm/watch.mjs +4 -3
- package/dist/esm/watch.mjs.map +1 -1
- package/dist/types/fill/fill.d.ts.map +1 -1
- package/dist/types/fill/formatFillData.d.ts.map +1 -1
- package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
- package/dist/types/utils/getOutputFilePath.d.ts +18 -1
- package/dist/types/utils/getOutputFilePath.d.ts.map +1 -1
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setupAI } from "../utils/setupAI.mjs";
|
|
2
|
-
import { checkFileModifiedRange } from "../utils/checkFileModifiedRange.mjs";
|
|
3
2
|
import { getOutputFilePath } from "../utils/getOutputFilePath.mjs";
|
|
3
|
+
import { checkFileModifiedRange } from "../utils/checkFileModifiedRange.mjs";
|
|
4
4
|
import { translateFile } from "./translateFile.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, join } from "node:path";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { resolveRelativePath } from "@intlayer/chokidar/utils";
|
|
2
|
+
import { parseStringPattern } from "@intlayer/config/utils";
|
|
3
|
+
|
|
1
4
|
//#region src/utils/getOutputFilePath.ts
|
|
2
5
|
/**
|
|
3
6
|
* Get the output file path by replacing the base locale with the target locale
|
|
@@ -67,7 +70,36 @@ const getOutputFilePath = (filePath, locale, baseLocale) => {
|
|
|
67
70
|
}
|
|
68
71
|
return outputFilePath;
|
|
69
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Get the effective FilePathPattern for a given locale from a Fill/CompilerOutput value.
|
|
75
|
+
*
|
|
76
|
+
* - If Fill is an object, returns the pattern for that locale (or `false` if disabled/missing).
|
|
77
|
+
* - If Fill is a string/function, returns it as-is (applies to all locales).
|
|
78
|
+
* - If Fill is `false`, returns `false` (disabled for all locales).
|
|
79
|
+
* - If Fill is `true` or a locale entry is `true`, returns `undefined` (use default).
|
|
80
|
+
*/
|
|
81
|
+
const getPatternForLocale = (output, locale) => {
|
|
82
|
+
if (output === false) return false;
|
|
83
|
+
if (output === true) return void 0;
|
|
84
|
+
if (typeof output === "string" || typeof output === "function") return output;
|
|
85
|
+
if (typeof output === "object" && output !== null) {
|
|
86
|
+
const entry = output[locale];
|
|
87
|
+
if (entry === void 0 || entry === false) return false;
|
|
88
|
+
if (entry === true) return void 0;
|
|
89
|
+
return entry;
|
|
90
|
+
}
|
|
91
|
+
return false;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Resolve a Fill/CompilerOutput pattern to an absolute file path for a given locale.
|
|
95
|
+
* Returns `false` if the locale is disabled or no pattern is configured.
|
|
96
|
+
*/
|
|
97
|
+
const resolveOutputPattern = async (output, locale, context, sourceFilePath, baseDir) => {
|
|
98
|
+
const pattern = getPatternForLocale(output, locale);
|
|
99
|
+
if (pattern === false || pattern === void 0) return false;
|
|
100
|
+
return resolveRelativePath(typeof pattern === "function" ? await pattern(context) : parseStringPattern(pattern, context), sourceFilePath, baseDir);
|
|
101
|
+
};
|
|
70
102
|
|
|
71
103
|
//#endregion
|
|
72
|
-
export { getOutputFilePath };
|
|
104
|
+
export { getOutputFilePath, getPatternForLocale, resolveOutputPattern };
|
|
73
105
|
//# sourceMappingURL=getOutputFilePath.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutputFilePath.mjs","names":[],"sources":["../../../src/utils/getOutputFilePath.ts"],"sourcesContent":["import type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Get the output file path by replacing the base locale with the target locale\n *\n * This function handles two types of replacements:\n * 1. Actual locale values (e.g., `/en/` → `/fr/`)\n * 2. Template placeholders (e.g., `{{baseLocale}}` → `{{locale}}`, `{{baseLocaleName}}` → `{{localeName}}`)\n *\n * Replacement patterns:\n * - `/baseLocale/` → `/locale/`\n * - `\\baseLocale\\` → `\\locale\\`\n * - `_baseLocale.` → `_locale.`\n * - `baseLocale_` → `locale_`\n * - `.baseLocaleName.` → `.localeName.`\n * - `{{baseLocale}}` → `{{locale}}`\n * - `{{baseLocaleName}}` → `{{localeName}}`\n *\n * If no patterns match, appends `.locale` to the file extension.\n *\n * @param filePath - The input file path\n * @param locale - The target locale\n * @param baseLocale - The base locale to replace\n * @returns The output file path with locale replacements\n */\nexport const getOutputFilePath = (\n filePath: string,\n locale: LocalesValues,\n baseLocale: LocalesValues\n): string => {\n if (!filePath || !locale || !baseLocale) {\n throw new Error('filePath, locale, and baseLocale are required');\n }\n\n let outputFilePath = filePath;\n\n // Define replacement patterns with global flag to replace all occurrences\n const replacements = [\n // Template placeholders (processed first)\n {\n pattern: /\\{\\{baseLocale\\}\\}/g,\n replacement: '{{locale}}',\n },\n {\n pattern: /\\{\\{baseLocaleName\\}\\}/g,\n replacement: '{{localeName}}',\n },\n\n // Path separators (most specific first)\n {\n // Unix path separators\n pattern: new RegExp(`/${baseLocale}/`, 'g'),\n replacement: `/${locale}/`,\n },\n {\n // Windows path separators\n pattern: new RegExp(`\\\\\\\\${baseLocale}\\\\\\\\`, 'g'),\n replacement: `\\\\${locale}\\\\`,\n },\n\n // File naming patterns\n {\n // file_en.md → file_fr.md\n pattern: new RegExp(`_${baseLocale}\\\\.`, 'g'),\n replacement: `_${locale}.`,\n },\n {\n // /file_en.md → /file_fr.md\n pattern: new RegExp(`/${baseLocale}_`, 'g'),\n replacement: `/${locale}_`,\n },\n {\n // Start of filename pattern en_guide.md → fr_guide.md (or after path separator)\n pattern: new RegExp(`(^|[\\\\/])${baseLocale}_`, 'g'),\n replacement: `$1${locale}_`,\n },\n {\n // Dot delimited pattern guide.en.md → guide.fr.md\n pattern: new RegExp(`\\\\.${baseLocale}\\\\.`, 'g'),\n replacement: `.${locale}.`,\n },\n ];\n\n // Apply all replacements\n for (const { pattern, replacement } of replacements) {\n outputFilePath = outputFilePath.replace(pattern, replacement);\n }\n\n // If no changes were made, append locale as extension\n if (outputFilePath === filePath) {\n const lastDotIndex = filePath.lastIndexOf('.');\n if (lastDotIndex > 0) {\n // Insert locale before the file extension\n return `${filePath.slice(0, lastDotIndex)}.${locale}${filePath.slice(lastDotIndex)}`;\n } else {\n // No extension found, just append\n return `${filePath}.${locale}`;\n }\n }\n\n return outputFilePath;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOutputFilePath.mjs","names":[],"sources":["../../../src/utils/getOutputFilePath.ts"],"sourcesContent":["import { resolveRelativePath } from '@intlayer/chokidar/utils';\nimport { parseStringPattern } from '@intlayer/config/utils';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { Fill } from '@intlayer/types/dictionary';\nimport type {\n FilePathPattern,\n FilePathPatternContext,\n} from '@intlayer/types/filePathPattern';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\n/**\n * Get the output file path by replacing the base locale with the target locale\n *\n * This function handles two types of replacements:\n * 1. Actual locale values (e.g., `/en/` → `/fr/`)\n * 2. Template placeholders (e.g., `{{baseLocale}}` → `{{locale}}`, `{{baseLocaleName}}` → `{{localeName}}`)\n *\n * Replacement patterns:\n * - `/baseLocale/` → `/locale/`\n * - `\\baseLocale\\` → `\\locale\\`\n * - `_baseLocale.` → `_locale.`\n * - `baseLocale_` → `locale_`\n * - `.baseLocaleName.` → `.localeName.`\n * - `{{baseLocale}}` → `{{locale}}`\n * - `{{baseLocaleName}}` → `{{localeName}}`\n *\n * If no patterns match, appends `.locale` to the file extension.\n *\n * @param filePath - The input file path\n * @param locale - The target locale\n * @param baseLocale - The base locale to replace\n * @returns The output file path with locale replacements\n */\nexport const getOutputFilePath = (\n filePath: string,\n locale: LocalesValues,\n baseLocale: LocalesValues\n): string => {\n if (!filePath || !locale || !baseLocale) {\n throw new Error('filePath, locale, and baseLocale are required');\n }\n\n let outputFilePath = filePath;\n\n // Define replacement patterns with global flag to replace all occurrences\n const replacements = [\n // Template placeholders (processed first)\n {\n pattern: /\\{\\{baseLocale\\}\\}/g,\n replacement: '{{locale}}',\n },\n {\n pattern: /\\{\\{baseLocaleName\\}\\}/g,\n replacement: '{{localeName}}',\n },\n\n // Path separators (most specific first)\n {\n // Unix path separators\n pattern: new RegExp(`/${baseLocale}/`, 'g'),\n replacement: `/${locale}/`,\n },\n {\n // Windows path separators\n pattern: new RegExp(`\\\\\\\\${baseLocale}\\\\\\\\`, 'g'),\n replacement: `\\\\${locale}\\\\`,\n },\n\n // File naming patterns\n {\n // file_en.md → file_fr.md\n pattern: new RegExp(`_${baseLocale}\\\\.`, 'g'),\n replacement: `_${locale}.`,\n },\n {\n // /file_en.md → /file_fr.md\n pattern: new RegExp(`/${baseLocale}_`, 'g'),\n replacement: `/${locale}_`,\n },\n {\n // Start of filename pattern en_guide.md → fr_guide.md (or after path separator)\n pattern: new RegExp(`(^|[\\\\/])${baseLocale}_`, 'g'),\n replacement: `$1${locale}_`,\n },\n {\n // Dot delimited pattern guide.en.md → guide.fr.md\n pattern: new RegExp(`\\\\.${baseLocale}\\\\.`, 'g'),\n replacement: `.${locale}.`,\n },\n ];\n\n // Apply all replacements\n for (const { pattern, replacement } of replacements) {\n outputFilePath = outputFilePath.replace(pattern, replacement);\n }\n\n // If no changes were made, append locale as extension\n if (outputFilePath === filePath) {\n const lastDotIndex = filePath.lastIndexOf('.');\n if (lastDotIndex > 0) {\n // Insert locale before the file extension\n return `${filePath.slice(0, lastDotIndex)}.${locale}${filePath.slice(lastDotIndex)}`;\n } else {\n // No extension found, just append\n return `${filePath}.${locale}`;\n }\n }\n\n return outputFilePath;\n};\n\n/**\n * Get the effective FilePathPattern for a given locale from a Fill/CompilerOutput value.\n *\n * - If Fill is an object, returns the pattern for that locale (or `false` if disabled/missing).\n * - If Fill is a string/function, returns it as-is (applies to all locales).\n * - If Fill is `false`, returns `false` (disabled for all locales).\n * - If Fill is `true` or a locale entry is `true`, returns `undefined` (use default).\n */\nexport const getPatternForLocale = (\n output: Fill,\n locale: Locale\n): FilePathPattern | false | undefined => {\n if (output === false) return false;\n if (output === true) return undefined;\n if (typeof output === 'string' || typeof output === 'function')\n return output as FilePathPattern;\n if (typeof output === 'object' && output !== null) {\n const entry = (output as Record<string, boolean | FilePathPattern>)[locale];\n if (entry === undefined || entry === false) return false;\n if (entry === true) return undefined;\n return entry as FilePathPattern;\n }\n return false;\n};\n\n/**\n * Resolve a Fill/CompilerOutput pattern to an absolute file path for a given locale.\n * Returns `false` if the locale is disabled or no pattern is configured.\n */\nexport const resolveOutputPattern = async (\n output: Fill,\n locale: Locale,\n context: FilePathPatternContext,\n sourceFilePath: string,\n baseDir: string\n): Promise<string | false> => {\n const pattern = getPatternForLocale(output, locale);\n if (pattern === false || pattern === undefined) return false;\n\n const rawPath =\n typeof pattern === 'function'\n ? await pattern(context)\n : parseStringPattern(pattern, context);\n\n return resolveRelativePath(rawPath, sourceFilePath, baseDir);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAa,qBACX,UACA,QACA,eACW;AACX,KAAI,CAAC,YAAY,CAAC,UAAU,CAAC,WAC3B,OAAM,IAAI,MAAM,gDAAgD;CAGlE,IAAI,iBAAiB;CAGrB,MAAM,eAAe;EAEnB;GACE,SAAS;GACT,aAAa;GACd;EACD;GACE,SAAS;GACT,aAAa;GACd;EAGD;GAEE,SAAS,IAAI,OAAO,IAAI,WAAW,IAAI,IAAI;GAC3C,aAAa,IAAI,OAAO;GACzB;EACD;GAEE,SAAS,IAAI,OAAO,OAAO,WAAW,OAAO,IAAI;GACjD,aAAa,KAAK,OAAO;GAC1B;EAGD;GAEE,SAAS,IAAI,OAAO,IAAI,WAAW,MAAM,IAAI;GAC7C,aAAa,IAAI,OAAO;GACzB;EACD;GAEE,SAAS,IAAI,OAAO,IAAI,WAAW,IAAI,IAAI;GAC3C,aAAa,IAAI,OAAO;GACzB;EACD;GAEE,SAAS,IAAI,OAAO,YAAY,WAAW,IAAI,IAAI;GACnD,aAAa,KAAK,OAAO;GAC1B;EACD;GAEE,SAAS,IAAI,OAAO,MAAM,WAAW,MAAM,IAAI;GAC/C,aAAa,IAAI,OAAO;GACzB;EACF;AAGD,MAAK,MAAM,EAAE,SAAS,iBAAiB,aACrC,kBAAiB,eAAe,QAAQ,SAAS,YAAY;AAI/D,KAAI,mBAAmB,UAAU;EAC/B,MAAM,eAAe,SAAS,YAAY,IAAI;AAC9C,MAAI,eAAe,EAEjB,QAAO,GAAG,SAAS,MAAM,GAAG,aAAa,CAAC,GAAG,SAAS,SAAS,MAAM,aAAa;MAGlF,QAAO,GAAG,SAAS,GAAG;;AAI1B,QAAO;;;;;;;;;;AAWT,MAAa,uBACX,QACA,WACwC;AACxC,KAAI,WAAW,MAAO,QAAO;AAC7B,KAAI,WAAW,KAAM,QAAO;AAC5B,KAAI,OAAO,WAAW,YAAY,OAAO,WAAW,WAClD,QAAO;AACT,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,QAAS,OAAqD;AACpE,MAAI,UAAU,UAAa,UAAU,MAAO,QAAO;AACnD,MAAI,UAAU,KAAM,QAAO;AAC3B,SAAO;;AAET,QAAO;;;;;;AAOT,MAAa,uBAAuB,OAClC,QACA,QACA,SACA,gBACA,YAC4B;CAC5B,MAAM,UAAU,oBAAoB,QAAQ,OAAO;AACnD,KAAI,YAAY,SAAS,YAAY,OAAW,QAAO;AAOvD,QAAO,oBAJL,OAAO,YAAY,aACf,MAAM,QAAQ,QAAQ,GACtB,mBAAmB,SAAS,QAAQ,EAEN,gBAAgB,QAAQ"}
|
package/dist/esm/watch.mjs
CHANGED
|
@@ -24,13 +24,14 @@ const watchContentDeclaration = async (options) => {
|
|
|
24
24
|
persistent: true,
|
|
25
25
|
skipPrepare: options?.skipPrepare ?? false
|
|
26
26
|
});
|
|
27
|
+
let isShuttingDown = false;
|
|
27
28
|
const handleShutdown = async () => {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
if (isShuttingDown) return;
|
|
30
|
+
isShuttingDown = true;
|
|
30
31
|
appLogger("Stopping Intlayer watcher...");
|
|
31
32
|
try {
|
|
33
|
+
if (parallelProcess) parallelProcess.kill();
|
|
32
34
|
await watcher.close();
|
|
33
|
-
if (parallelProcess && "child" in parallelProcess) parallelProcess.child?.kill("SIGTERM");
|
|
34
35
|
} catch (error) {
|
|
35
36
|
console.error("Error during shutdown:", error);
|
|
36
37
|
} finally {
|
package/dist/esm/watch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n
|
|
1
|
+
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n let isShuttingDown = false;\n const handleShutdown = async () => {\n // Prevent multiple calls\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Kill the parallel process (e.g., Next.js) before closing the watcher\n if (parallelProcess) {\n parallelProcess.kill();\n }\n\n // Close the file watcher to stop \"esbuild service not running\" errors\n await watcher.close();\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,SAAS,iBAAiB,SAAS,cAAc;AACvD,kBAAiB,SAAS,cAAc;CAExC,MAAM,YAAY,aAAa,OAAO;CAGtC,IAAI;AAEJ,KAAI,SAAS,MAAM;AACjB,oBAAkB,YAAY,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAEjC,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,UAAU,MAAM;EACpB,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,IAAI,iBAAiB;CACrB,MAAM,iBAAiB,YAAY;AAEjC,MAAI,eAAgB;AACpB,mBAAiB;AAEjB,YAAU,+BAA+B;AAEzC,MAAI;AAEF,OAAI,gBACF,iBAAgB,MAAM;AAIxB,SAAM,QAAQ,OAAO;WACd,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"mappings":";;;;;;KA0CY,WAAA;EACV,YAAA,GAAe,MAAA;EACf,aAAA,GAAgB,MAAA,GAAS,MAAA;EACzB,IAAA;EACA,UAAA,GAAa,mBAAA;EACb,SAAA,GAAY,SAAA;EACZ,OAAA;EACA,wBAAA;EACA,iBAAA;EACA,KAAA;EACA,YAAA;AAAA,IACE,0BAAA;;;;cAKS,IAAA,GAAc,OAAA,GAAU,WAAA,KAAc,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatFillData.d.ts","names":[],"sources":["../../../src/fill/formatFillData.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"formatFillData.d.ts","names":[],"sources":["../../../src/fill/formatFillData.ts"],"mappings":";;;;;KAWY,QAAA;EACV,UAAA,EAAY,MAAA;EACZ,QAAA;EACA,WAAA;AAAA;AAAA,cAmBW,cAAA,GACX,SAAA,EAAW,IAAA,EACX,UAAA,EAAY,MAAA,IACZ,QAAA,UACA,aAAA,EAAe,aAAA,EACf,aAAA,EAAe,cAAA,KACd,OAAA,CAAQ,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listMissingTranslations.d.ts","names":[],"sources":["../../../src/test/listMissingTranslations.ts"],"mappings":";;;;;cAYa,iCAAA,GACX,aAAA,EAAe,cAAA;;;;;aASJ,MAAA;EAAA;;;;
|
|
1
|
+
{"version":3,"file":"listMissingTranslations.d.ts","names":[],"sources":["../../../src/test/listMissingTranslations.ts"],"mappings":";;;;;cAYa,iCAAA,GACX,aAAA,EAAe,cAAA;;;;;aASJ,MAAA;EAAA;;;;cAmGA,uBAAA,GACX,oBAAA,GAAuB,uBAAA;;;;;aApGZ,MAAA;EAAA"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { FilePathPattern, FilePathPatternContext } from "@intlayer/types/filePathPattern";
|
|
2
|
+
import { Locale } from "@intlayer/types/allLocales";
|
|
3
|
+
import { Fill } from "@intlayer/types/dictionary";
|
|
1
4
|
import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
5
|
|
|
3
6
|
//#region src/utils/getOutputFilePath.d.ts
|
|
@@ -25,6 +28,20 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
25
28
|
* @returns The output file path with locale replacements
|
|
26
29
|
*/
|
|
27
30
|
declare const getOutputFilePath: (filePath: string, locale: LocalesValues, baseLocale: LocalesValues) => string;
|
|
31
|
+
/**
|
|
32
|
+
* Get the effective FilePathPattern for a given locale from a Fill/CompilerOutput value.
|
|
33
|
+
*
|
|
34
|
+
* - If Fill is an object, returns the pattern for that locale (or `false` if disabled/missing).
|
|
35
|
+
* - If Fill is a string/function, returns it as-is (applies to all locales).
|
|
36
|
+
* - If Fill is `false`, returns `false` (disabled for all locales).
|
|
37
|
+
* - If Fill is `true` or a locale entry is `true`, returns `undefined` (use default).
|
|
38
|
+
*/
|
|
39
|
+
declare const getPatternForLocale: (output: Fill, locale: Locale) => FilePathPattern | false | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Resolve a Fill/CompilerOutput pattern to an absolute file path for a given locale.
|
|
42
|
+
* Returns `false` if the locale is disabled or no pattern is configured.
|
|
43
|
+
*/
|
|
44
|
+
declare const resolveOutputPattern: (output: Fill, locale: Locale, context: FilePathPatternContext, sourceFilePath: string, baseDir: string) => Promise<string | false>;
|
|
28
45
|
//#endregion
|
|
29
|
-
export { getOutputFilePath };
|
|
46
|
+
export { getOutputFilePath, getPatternForLocale, resolveOutputPattern };
|
|
30
47
|
//# sourceMappingURL=getOutputFilePath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOutputFilePath.d.ts","names":[],"sources":["../../../src/utils/getOutputFilePath.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOutputFilePath.d.ts","names":[],"sources":["../../../src/utils/getOutputFilePath.ts"],"mappings":";;;;;;;;AAiCA;;;;;;;;;;;AAsFA;;;;;;;;;;cAtFa,iBAAA,GACX,QAAA,UACA,MAAA,EAAQ,aAAA,EACR,UAAA,EAAY,aAAA;;;;;AAwGd;;;;cArBa,mBAAA,GACX,MAAA,EAAQ,IAAA,EACR,MAAA,EAAQ,MAAA,KACP,eAAA;;;;;cAkBU,oBAAA,GACX,MAAA,EAAQ,IAAA,EACR,MAAA,EAAQ,MAAA,EACR,OAAA,EAAS,sBAAA,EACT,cAAA,UACA,OAAA,aACC,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/cli",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@clack/prompts": "0.11.0",
|
|
70
|
-
"@intlayer/ai": "8.4.
|
|
71
|
-
"@intlayer/api": "8.4.
|
|
72
|
-
"@intlayer/babel": "8.4.
|
|
73
|
-
"@intlayer/chokidar": "8.4.
|
|
74
|
-
"@intlayer/config": "8.4.
|
|
75
|
-
"@intlayer/core": "8.4.
|
|
76
|
-
"@intlayer/dictionaries-entry": "8.4.
|
|
77
|
-
"@intlayer/remote-dictionaries-entry": "8.4.
|
|
78
|
-
"@intlayer/types": "8.4.
|
|
79
|
-
"@intlayer/unmerged-dictionaries-entry": "8.4.
|
|
70
|
+
"@intlayer/ai": "8.4.7",
|
|
71
|
+
"@intlayer/api": "8.4.7",
|
|
72
|
+
"@intlayer/babel": "8.4.7",
|
|
73
|
+
"@intlayer/chokidar": "8.4.7",
|
|
74
|
+
"@intlayer/config": "8.4.7",
|
|
75
|
+
"@intlayer/core": "8.4.7",
|
|
76
|
+
"@intlayer/dictionaries-entry": "8.4.7",
|
|
77
|
+
"@intlayer/remote-dictionaries-entry": "8.4.7",
|
|
78
|
+
"@intlayer/types": "8.4.7",
|
|
79
|
+
"@intlayer/unmerged-dictionaries-entry": "8.4.7",
|
|
80
80
|
"commander": "14.0.3",
|
|
81
81
|
"enquirer": "^2.4.1",
|
|
82
82
|
"eventsource": "4.1.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"vitest": "4.1.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@intlayer/ai": "8.4.
|
|
96
|
+
"@intlayer/ai": "8.4.7"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|
|
99
99
|
"@intlayer/ai": {
|