@intlayer/babel 9.0.0-canary.17 → 9.0.0-canary.19
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/babel-plugin-intlayer-extract.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-field-rename.cjs +1 -1
- package/dist/cjs/babel-plugin-intlayer-field-rename.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-minify.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-optimize.cjs +2 -2
- package/dist/cjs/babel-plugin-intlayer-optimize.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-purge.cjs +0 -1
- package/dist/cjs/babel-plugin-intlayer-purge.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-usage-analyzer.cjs +5 -5
- package/dist/cjs/babel-plugin-intlayer-usage-analyzer.cjs.map +1 -1
- package/dist/cjs/extractContent/babelProcessor.cjs +3 -3
- package/dist/cjs/extractContent/babelProcessor.cjs.map +1 -1
- package/dist/cjs/extractContent/contentWriter.cjs.map +1 -1
- package/dist/cjs/extractContent/extractContent.cjs.map +1 -1
- package/dist/cjs/extractContent/processTsxFile.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/constants.cjs +1 -1
- package/dist/cjs/extractContent/utils/constants.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/detectPackageName.cjs +0 -1
- package/dist/cjs/extractContent/utils/detectPackageName.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/extractDictionaryInfo.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/extractDictionaryKey.cjs +0 -1
- package/dist/cjs/extractContent/utils/extractDictionaryKey.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/generateKey.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/getComponentName.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/getExistingIntlayerInfo.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/getOrGenerateKey.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/resolveDictionaryKey.cjs +0 -1
- package/dist/cjs/extractContent/utils/resolveDictionaryKey.cjs.map +1 -1
- package/dist/cjs/extractContent/utils/shouldExtract.cjs.map +1 -1
- package/dist/cjs/extractScriptBlocks.cjs +0 -1
- package/dist/cjs/extractScriptBlocks.cjs.map +1 -1
- package/dist/cjs/getExtractPluginOptions.cjs.map +1 -1
- package/dist/cjs/getOptimizePluginOptions.cjs +0 -1
- package/dist/cjs/getOptimizePluginOptions.cjs.map +1 -1
- package/dist/cjs/getPurgePluginOptions.cjs +0 -1
- package/dist/cjs/getPurgePluginOptions.cjs.map +1 -1
- package/dist/cjs/normalizedFilesList.cjs +0 -1
- package/dist/cjs/normalizedFilesList.cjs.map +1 -1
- package/dist/cjs/transformers.cjs +0 -1
- package/dist/cjs/transformers.cjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-extract.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-field-rename.mjs +1 -1
- package/dist/esm/babel-plugin-intlayer-field-rename.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-minify.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-optimize.mjs +2 -1
- package/dist/esm/babel-plugin-intlayer-optimize.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-purge.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-usage-analyzer.mjs +5 -5
- package/dist/esm/babel-plugin-intlayer-usage-analyzer.mjs.map +1 -1
- package/dist/esm/extractContent/babelProcessor.mjs +3 -3
- package/dist/esm/extractContent/babelProcessor.mjs.map +1 -1
- package/dist/esm/extractContent/contentWriter.mjs.map +1 -1
- package/dist/esm/extractContent/extractContent.mjs.map +1 -1
- package/dist/esm/extractContent/processTsxFile.mjs.map +1 -1
- package/dist/esm/extractContent/utils/constants.mjs +1 -1
- package/dist/esm/extractContent/utils/constants.mjs.map +1 -1
- package/dist/esm/extractContent/utils/detectPackageName.mjs.map +1 -1
- package/dist/esm/extractContent/utils/extractDictionaryInfo.mjs.map +1 -1
- package/dist/esm/extractContent/utils/extractDictionaryKey.mjs.map +1 -1
- package/dist/esm/extractContent/utils/generateKey.mjs.map +1 -1
- package/dist/esm/extractContent/utils/getComponentName.mjs.map +1 -1
- package/dist/esm/extractContent/utils/getExistingIntlayerInfo.mjs.map +1 -1
- package/dist/esm/extractContent/utils/getOrGenerateKey.mjs.map +1 -1
- package/dist/esm/extractContent/utils/resolveDictionaryKey.mjs.map +1 -1
- package/dist/esm/extractContent/utils/shouldExtract.mjs.map +1 -1
- package/dist/esm/extractScriptBlocks.mjs.map +1 -1
- package/dist/esm/getExtractPluginOptions.mjs.map +1 -1
- package/dist/esm/getOptimizePluginOptions.mjs.map +1 -1
- package/dist/esm/getPurgePluginOptions.mjs.map +1 -1
- package/dist/esm/normalizedFilesList.mjs.map +1 -1
- package/dist/esm/transformers.mjs.map +1 -1
- package/dist/types/babel-plugin-intlayer-extract.d.ts +0 -1
- package/dist/types/babel-plugin-intlayer-extract.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-field-rename.d.ts +1 -4
- package/dist/types/babel-plugin-intlayer-field-rename.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-minify.d.ts +0 -1
- package/dist/types/babel-plugin-intlayer-minify.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-optimize.d.ts +17 -10
- package/dist/types/babel-plugin-intlayer-optimize.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-purge.d.ts +0 -1
- package/dist/types/babel-plugin-intlayer-purge.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts +4 -6
- package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts.map +1 -1
- package/dist/types/extractContent/babelProcessor.d.ts +3 -2
- package/dist/types/extractContent/babelProcessor.d.ts.map +1 -1
- package/dist/types/extractContent/contentWriter.d.ts +0 -1
- package/dist/types/extractContent/contentWriter.d.ts.map +1 -1
- package/dist/types/extractContent/extractContent.d.ts +1 -1
- package/dist/types/extractContent/extractContent.d.ts.map +1 -1
- package/dist/types/extractContent/processTsxFile.d.ts +1 -1
- package/dist/types/extractContent/processTsxFile.d.ts.map +1 -1
- package/dist/types/extractContent/utils/constants.d.ts +2 -2
- package/dist/types/extractContent/utils/constants.d.ts.map +1 -1
- package/dist/types/extractContent/utils/detectPackageName.d.ts +0 -1
- package/dist/types/extractContent/utils/detectPackageName.d.ts.map +1 -1
- package/dist/types/extractContent/utils/extractDictionaryInfo.d.ts +0 -1
- package/dist/types/extractContent/utils/extractDictionaryInfo.d.ts.map +1 -1
- package/dist/types/extractContent/utils/extractDictionaryKey.d.ts.map +1 -1
- package/dist/types/extractContent/utils/generateKey.d.ts.map +1 -1
- package/dist/types/extractContent/utils/getComponentName.d.ts +0 -1
- package/dist/types/extractContent/utils/getComponentName.d.ts.map +1 -1
- package/dist/types/extractContent/utils/getExistingIntlayerInfo.d.ts +8 -5
- package/dist/types/extractContent/utils/getExistingIntlayerInfo.d.ts.map +1 -1
- package/dist/types/extractContent/utils/getOrGenerateKey.d.ts.map +1 -1
- package/dist/types/extractContent/utils/resolveDictionaryKey.d.ts +0 -1
- package/dist/types/extractContent/utils/resolveDictionaryKey.d.ts.map +1 -1
- package/dist/types/extractContent/utils/shouldExtract.d.ts.map +1 -1
- package/dist/types/extractScriptBlocks.d.ts.map +1 -1
- package/dist/types/getExtractPluginOptions.d.ts +0 -1
- package/dist/types/getExtractPluginOptions.d.ts.map +1 -1
- package/dist/types/getOptimizePluginOptions.d.ts +0 -1
- package/dist/types/getOptimizePluginOptions.d.ts.map +1 -1
- package/dist/types/getPurgePluginOptions.d.ts +0 -1
- package/dist/types/getPurgePluginOptions.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/normalizedFilesList.d.ts.map +1 -1
- package/dist/types/transformers.d.ts +0 -1
- package/dist/types/transformers.d.ts.map +1 -1
- package/package.json +23 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.mjs","names":[],"sources":["../../src/transformers.ts"],"sourcesContent":["import { type TransformOptions, transformAsync } from '@babel/core';\nimport { makeFieldRenameBabelPlugin } from './babel-plugin-intlayer-field-rename';\nimport {\n intlayerOptimizeBabelPlugin,\n type OptimizePluginOptions,\n} from './babel-plugin-intlayer-optimize';\nimport {\n type CompatCallerConfig,\n makeUsageAnalyzerBabelPlugin,\n type PruneContext,\n} from './babel-plugin-intlayer-usage-analyzer';\nimport { extractScriptBlocks, injectScriptBlocks } from './extractScriptBlocks';\n\n// ── Shared Babel parser configuration ─────────────────────────────────────────\n\n/**\n * Babel parser options covering the superset of syntaxes used across all\n * supported frameworks (React / Vue / Svelte / Angular / …).\n */\nexport const BABEL_PARSER_OPTIONS: NonNullable<TransformOptions['parserOpts']> =\n {\n sourceType: 'module',\n allowImportExportEverywhere: true,\n plugins: [\n 'typescript',\n 'jsx',\n 'decorators-legacy',\n 'classProperties',\n 'objectRestSpread',\n 'asyncGenerators',\n 'functionBind',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'dynamicImport',\n 'nullishCoalescingOperator',\n 'optionalChaining',\n ],\n };\n\n/**\n * Fast pre-check: matches files that could contain native intlayer calls\n * (`useIntlayer` / `getIntlayer`). Used by the optimize/transform pass, which\n * only rewrites native calls.\n */\nexport const INTLAYER_USAGE_REGEX = /\\b(use|get)Intlayer\\b/;\n\n/**\n * Builds a fast pre-check regex that matches files potentially containing\n * native intlayer calls and/or the given compat namespace caller names.\n *\n * The result is used to skip files that definitely contain none of the\n * relevant function names, avoiding unnecessary Babel parsing.\n *\n * Compat caller names are NOT hardcoded here — they are provided at runtime by\n * the compat adapter packages that configure the usage-analysis pipeline.\n *\n * @param extraCallerNames - Additional caller function names to match\n * (e.g. `['useTranslation', 'getFixedT']` from `@intlayer/react-i18next`).\n * @returns A `RegExp` matching any of the native or provided caller names.\n */\nexport const buildUsageCheckRegex = (extraCallerNames?: string[]): RegExp => {\n const callerNames = [\n 'useIntlayer',\n 'getIntlayer',\n ...(extraCallerNames ?? []),\n ];\n const uniqueNames = [...new Set(callerNames)];\n return new RegExp(`\\\\b(${uniqueNames.join('|')})\\\\b`);\n};\n\n/** Usage-check regex covering only the native callers (no compat callers). */\nconst NATIVE_USAGE_CHECK_REGEX = buildUsageCheckRegex();\n\n/** Cache of usage-check regexes, keyed by the compat-caller array reference. */\nconst usageCheckRegexCache = new WeakMap<\n readonly CompatCallerConfig[],\n RegExp\n>();\n\n/**\n * Returns the usage-check regex for the given compat callers, memoised by the\n * array reference. Plugins pass the same options array for every analysed\n * file, so the regex is built once per build instead of once per file.\n */\nexport const getUsageCheckRegex = (\n compatCallers?: readonly CompatCallerConfig[]\n): RegExp => {\n if (!compatCallers || compatCallers.length === 0) {\n return NATIVE_USAGE_CHECK_REGEX;\n }\n\n let usageCheckRegex = usageCheckRegexCache.get(compatCallers);\n if (!usageCheckRegex) {\n usageCheckRegex = buildUsageCheckRegex(\n compatCallers.map((caller) => caller.callerName)\n );\n usageCheckRegexCache.set(compatCallers, usageCheckRegex);\n }\n return usageCheckRegex;\n};\n\n/**\n * Matches source files that are valid targets for usage analysis and Babel\n * transformation. Excludes sourcemap files, declaration files, and other\n * non-source extensions.\n */\nexport const SOURCE_FILE_REGEX = /\\.(tsx?|[mc]?jsx?|vue|svelte|astro)$/;\n\n// ── High-level transformer functions ──────────────────────────────────────────\n\n/**\n * Runs the usage-analysis Babel plugin on a single JS/TS code string.\n *\n * This is analysis-only: the transformed code output is discarded.\n * Throws if Babel cannot parse the content.\n */\nconst analyzeScriptContent = async (\n scriptContent: string,\n sourceFilePath: string,\n pruneContext: PruneContext,\n compatCallers?: CompatCallerConfig[]\n): Promise<void> => {\n await transformAsync(scriptContent, {\n filename: sourceFilePath,\n plugins: [makeUsageAnalyzerBabelPlugin(pruneContext, { compatCallers })],\n parserOpts: BABEL_PARSER_OPTIONS,\n ast: false,\n code: false, // analysis only – no output needed\n });\n};\n\n/**\n * Runs the usage-analysis Babel plugin on a source file, accumulating\n * field-usage data into `pruneContext`.\n *\n * For Vue / Svelte SFC files, script blocks are extracted before analysis so\n * Babel does not attempt to parse the full SFC syntax (templates, styles, …).\n * For plain JS/TS files, the whole file content is analysed directly.\n *\n * This is analysis-only: the transformed code output is discarded.\n * Throws if Babel cannot parse the file (caller should handle and flag\n * `pruneContext.hasUnparsableSourceFiles`).\n */\nexport const analyzeFieldUsageInFile = async (\n sourceFilePath: string,\n code: string,\n pruneContext: PruneContext,\n compatCallers?: CompatCallerConfig[]\n): Promise<void> => {\n const usageCheckRegex = getUsageCheckRegex(compatCallers);\n const scriptBlocks = extractScriptBlocks(sourceFilePath, code);\n\n // For SFC files (Vue / Svelte): scriptBlocks[0].contentStartOffset > 0\n // means we extracted actual <script> tags from the file.\n // For plain JS/TS: extractScriptBlocks returns the whole file as a single\n // block with offset 0, so we fall through to the same path.\n for (const block of scriptBlocks) {\n if (!usageCheckRegex.test(block.content)) continue;\n await analyzeScriptContent(\n block.content,\n sourceFilePath,\n pruneContext,\n compatCallers\n );\n }\n};\n\n/**\n * Applies field-renaming to a single JS/TS code string (not an SFC).\n *\n * Returns the renamed code string, or `null` if nothing changed or if\n * Babel failed to parse the input (caller should fall back to original code).\n */\nexport const renameFieldsInCode = async (\n code: string,\n sourceFilePath: string,\n pruneContext: PruneContext\n): Promise<string | null> => {\n try {\n const result = await transformAsync(code, {\n filename: sourceFilePath,\n plugins: [makeFieldRenameBabelPlugin(pruneContext)],\n parserOpts: BABEL_PARSER_OPTIONS,\n ast: false,\n });\n return result?.code ?? null;\n } catch {\n return null; // parse failure – caller falls back to original code\n }\n};\n\n/**\n * Applies field-renaming to a source file, correctly handling both plain\n * JS/TS files and SFC files (Vue / Svelte) by operating on each script block\n * individually and injecting the results back into the original source.\n *\n * Returns the renamed code string, or `null` if nothing changed.\n */\nexport const renameFieldsInSourceFile = async (\n sourceFilePath: string,\n code: string,\n pruneContext: PruneContext\n): Promise<string | null> => {\n if (pruneContext.dictionaryKeyToFieldRenameMap.size === 0) return null;\n if (!INTLAYER_USAGE_REGEX.test(code)) return null;\n\n const scriptBlocks = extractScriptBlocks(sourceFilePath, code);\n\n const isSFC =\n scriptBlocks.length > 0 &&\n ((scriptBlocks[0]?.contentStartOffset ?? 0) > 0 || scriptBlocks.length > 1);\n\n if (isSFC) {\n // Raw SFC: rename each script block individually and inject back.\n const modifications: Array<{\n block: (typeof scriptBlocks)[number];\n modifiedContent: string;\n }> = [];\n\n for (const block of scriptBlocks) {\n if (!INTLAYER_USAGE_REGEX.test(block.content)) continue;\n\n const renamedCode = await renameFieldsInCode(\n block.content,\n sourceFilePath,\n pruneContext\n );\n if (renamedCode && renamedCode !== block.content) {\n modifications.push({ block, modifiedContent: renamedCode });\n }\n }\n\n if (modifications.length === 0) return null;\n return injectScriptBlocks(code, modifications);\n }\n\n // Plain JS/TS or compiled SFC (no block delimiters) – rename the whole file.\n return renameFieldsInCode(code, sourceFilePath, pruneContext);\n};\n\n/**\n * Runs the intlayer optimize Babel plugin on a source file, transforming\n * `useIntlayer('key')` / `getIntlayer('key')` calls into `useDictionary(_hash)`\n * / `getDictionary(_hash)` and injecting the corresponding dictionary imports.\n *\n * Returns `{ code, map }` on success, or `null` if the transformation produced\n * no output.\n */\nexport const optimizeSourceFile = async (\n code: string,\n sourceFilePath: string,\n options: OptimizePluginOptions\n): Promise<{\n code: string;\n map: string | object | null | undefined;\n} | null> => {\n const result = await transformAsync(code, {\n filename: sourceFilePath,\n plugins: [[intlayerOptimizeBabelPlugin, options]],\n parserOpts: BABEL_PARSER_OPTIONS,\n });\n\n if (!result?.code) return null;\n\n return { code: result.code, map: result.map };\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"transformers.mjs","names":[],"sources":["../../src/transformers.ts"],"sourcesContent":["import { type TransformOptions, transformAsync } from '@babel/core';\nimport { makeFieldRenameBabelPlugin } from './babel-plugin-intlayer-field-rename';\nimport {\n intlayerOptimizeBabelPlugin,\n type OptimizePluginOptions,\n} from './babel-plugin-intlayer-optimize';\nimport {\n type CompatCallerConfig,\n makeUsageAnalyzerBabelPlugin,\n type PruneContext,\n} from './babel-plugin-intlayer-usage-analyzer';\nimport { extractScriptBlocks, injectScriptBlocks } from './extractScriptBlocks';\n\n// ── Shared Babel parser configuration ─────────────────────────────────────────\n\n/**\n * Babel parser options covering the superset of syntaxes used across all\n * supported frameworks (React / Vue / Svelte / Angular / …).\n */\nexport const BABEL_PARSER_OPTIONS: NonNullable<TransformOptions['parserOpts']> =\n {\n sourceType: 'module',\n allowImportExportEverywhere: true,\n plugins: [\n 'typescript',\n 'jsx',\n 'decorators-legacy',\n 'classProperties',\n 'objectRestSpread',\n 'asyncGenerators',\n 'functionBind',\n 'exportDefaultFrom',\n 'exportNamespaceFrom',\n 'dynamicImport',\n 'nullishCoalescingOperator',\n 'optionalChaining',\n ],\n };\n\n/**\n * Fast pre-check: matches files that could contain native intlayer calls\n * (`useIntlayer` / `getIntlayer`). Used by the optimize/transform pass, which\n * only rewrites native calls.\n */\nexport const INTLAYER_USAGE_REGEX = /\\b(use|get)Intlayer\\b/;\n\n/**\n * Builds a fast pre-check regex that matches files potentially containing\n * native intlayer calls and/or the given compat namespace caller names.\n *\n * The result is used to skip files that definitely contain none of the\n * relevant function names, avoiding unnecessary Babel parsing.\n *\n * Compat caller names are NOT hardcoded here — they are provided at runtime by\n * the compat adapter packages that configure the usage-analysis pipeline.\n *\n * @param extraCallerNames - Additional caller function names to match\n * (e.g. `['useTranslation', 'getFixedT']` from `@intlayer/react-i18next`).\n * @returns A `RegExp` matching any of the native or provided caller names.\n */\nexport const buildUsageCheckRegex = (extraCallerNames?: string[]): RegExp => {\n const callerNames = [\n 'useIntlayer',\n 'getIntlayer',\n ...(extraCallerNames ?? []),\n ];\n const uniqueNames = [...new Set(callerNames)];\n return new RegExp(`\\\\b(${uniqueNames.join('|')})\\\\b`);\n};\n\n/** Usage-check regex covering only the native callers (no compat callers). */\nconst NATIVE_USAGE_CHECK_REGEX = buildUsageCheckRegex();\n\n/** Cache of usage-check regexes, keyed by the compat-caller array reference. */\nconst usageCheckRegexCache = new WeakMap<\n readonly CompatCallerConfig[],\n RegExp\n>();\n\n/**\n * Returns the usage-check regex for the given compat callers, memoised by the\n * array reference. Plugins pass the same options array for every analysed\n * file, so the regex is built once per build instead of once per file.\n */\nexport const getUsageCheckRegex = (\n compatCallers?: readonly CompatCallerConfig[]\n): RegExp => {\n if (!compatCallers || compatCallers.length === 0) {\n return NATIVE_USAGE_CHECK_REGEX;\n }\n\n let usageCheckRegex = usageCheckRegexCache.get(compatCallers);\n if (!usageCheckRegex) {\n usageCheckRegex = buildUsageCheckRegex(\n compatCallers.map((caller) => caller.callerName)\n );\n usageCheckRegexCache.set(compatCallers, usageCheckRegex);\n }\n return usageCheckRegex;\n};\n\n/**\n * Matches source files that are valid targets for usage analysis and Babel\n * transformation. Excludes sourcemap files, declaration files, and other\n * non-source extensions.\n */\nexport const SOURCE_FILE_REGEX = /\\.(tsx?|[mc]?jsx?|vue|svelte|astro)$/;\n\n// ── High-level transformer functions ──────────────────────────────────────────\n\n/**\n * Runs the usage-analysis Babel plugin on a single JS/TS code string.\n *\n * This is analysis-only: the transformed code output is discarded.\n * Throws if Babel cannot parse the content.\n */\nconst analyzeScriptContent = async (\n scriptContent: string,\n sourceFilePath: string,\n pruneContext: PruneContext,\n compatCallers?: CompatCallerConfig[]\n): Promise<void> => {\n await transformAsync(scriptContent, {\n filename: sourceFilePath,\n plugins: [makeUsageAnalyzerBabelPlugin(pruneContext, { compatCallers })],\n parserOpts: BABEL_PARSER_OPTIONS,\n ast: false,\n code: false, // analysis only – no output needed\n });\n};\n\n/**\n * Runs the usage-analysis Babel plugin on a source file, accumulating\n * field-usage data into `pruneContext`.\n *\n * For Vue / Svelte SFC files, script blocks are extracted before analysis so\n * Babel does not attempt to parse the full SFC syntax (templates, styles, …).\n * For plain JS/TS files, the whole file content is analysed directly.\n *\n * This is analysis-only: the transformed code output is discarded.\n * Throws if Babel cannot parse the file (caller should handle and flag\n * `pruneContext.hasUnparsableSourceFiles`).\n */\nexport const analyzeFieldUsageInFile = async (\n sourceFilePath: string,\n code: string,\n pruneContext: PruneContext,\n compatCallers?: CompatCallerConfig[]\n): Promise<void> => {\n const usageCheckRegex = getUsageCheckRegex(compatCallers);\n const scriptBlocks = extractScriptBlocks(sourceFilePath, code);\n\n // For SFC files (Vue / Svelte): scriptBlocks[0].contentStartOffset > 0\n // means we extracted actual <script> tags from the file.\n // For plain JS/TS: extractScriptBlocks returns the whole file as a single\n // block with offset 0, so we fall through to the same path.\n for (const block of scriptBlocks) {\n if (!usageCheckRegex.test(block.content)) continue;\n await analyzeScriptContent(\n block.content,\n sourceFilePath,\n pruneContext,\n compatCallers\n );\n }\n};\n\n/**\n * Applies field-renaming to a single JS/TS code string (not an SFC).\n *\n * Returns the renamed code string, or `null` if nothing changed or if\n * Babel failed to parse the input (caller should fall back to original code).\n */\nexport const renameFieldsInCode = async (\n code: string,\n sourceFilePath: string,\n pruneContext: PruneContext\n): Promise<string | null> => {\n try {\n const result = await transformAsync(code, {\n filename: sourceFilePath,\n plugins: [makeFieldRenameBabelPlugin(pruneContext)],\n parserOpts: BABEL_PARSER_OPTIONS,\n ast: false,\n });\n return result?.code ?? null;\n } catch {\n return null; // parse failure – caller falls back to original code\n }\n};\n\n/**\n * Applies field-renaming to a source file, correctly handling both plain\n * JS/TS files and SFC files (Vue / Svelte) by operating on each script block\n * individually and injecting the results back into the original source.\n *\n * Returns the renamed code string, or `null` if nothing changed.\n */\nexport const renameFieldsInSourceFile = async (\n sourceFilePath: string,\n code: string,\n pruneContext: PruneContext\n): Promise<string | null> => {\n if (pruneContext.dictionaryKeyToFieldRenameMap.size === 0) return null;\n if (!INTLAYER_USAGE_REGEX.test(code)) return null;\n\n const scriptBlocks = extractScriptBlocks(sourceFilePath, code);\n\n const isSFC =\n scriptBlocks.length > 0 &&\n ((scriptBlocks[0]?.contentStartOffset ?? 0) > 0 || scriptBlocks.length > 1);\n\n if (isSFC) {\n // Raw SFC: rename each script block individually and inject back.\n const modifications: Array<{\n block: (typeof scriptBlocks)[number];\n modifiedContent: string;\n }> = [];\n\n for (const block of scriptBlocks) {\n if (!INTLAYER_USAGE_REGEX.test(block.content)) continue;\n\n const renamedCode = await renameFieldsInCode(\n block.content,\n sourceFilePath,\n pruneContext\n );\n if (renamedCode && renamedCode !== block.content) {\n modifications.push({ block, modifiedContent: renamedCode });\n }\n }\n\n if (modifications.length === 0) return null;\n return injectScriptBlocks(code, modifications);\n }\n\n // Plain JS/TS or compiled SFC (no block delimiters) – rename the whole file.\n return renameFieldsInCode(code, sourceFilePath, pruneContext);\n};\n\n/**\n * Runs the intlayer optimize Babel plugin on a source file, transforming\n * `useIntlayer('key')` / `getIntlayer('key')` calls into `useDictionary(_hash)`\n * / `getDictionary(_hash)` and injecting the corresponding dictionary imports.\n *\n * Returns `{ code, map }` on success, or `null` if the transformation produced\n * no output.\n */\nexport const optimizeSourceFile = async (\n code: string,\n sourceFilePath: string,\n options: OptimizePluginOptions\n): Promise<{\n code: string;\n map: string | object | null | undefined;\n} | null> => {\n const result = await transformAsync(code, {\n filename: sourceFilePath,\n plugins: [[intlayerOptimizeBabelPlugin, options]],\n parserOpts: BABEL_PARSER_OPTIONS,\n });\n\n if (!result?.code) return null;\n\n return { code: result.code, map: result.map };\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,uBACX;CACE,YAAY;CACZ,6BAA6B;CAC7B,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF;;;;;;AAOF,MAAa,uBAAuB;;;;;;;;;;;;;;;AAgBpC,MAAa,wBAAwB,qBAAwC;CAC3E,MAAM,cAAc;EAClB;EACA;EACA,GAAI,oBAAoB,CAAC;CAC3B;CACA,MAAM,cAAc,CAAC,GAAG,IAAI,IAAI,WAAW,CAAC;CAC5C,OAAO,IAAI,OAAO,OAAO,YAAY,KAAK,GAAG,EAAE,KAAK;AACtD;;AAGA,MAAM,2BAA2B,qBAAqB;;AAGtD,MAAM,uCAAuB,IAAI,QAG/B;;;;;;AAOF,MAAa,sBACX,kBACW;CACX,IAAI,CAAC,iBAAiB,cAAc,WAAW,GAC7C,OAAO;CAGT,IAAI,kBAAkB,qBAAqB,IAAI,aAAa;CAC5D,IAAI,CAAC,iBAAiB;EACpB,kBAAkB,qBAChB,cAAc,KAAK,WAAW,OAAO,UAAU,CACjD;EACA,qBAAqB,IAAI,eAAe,eAAe;CACzD;CACA,OAAO;AACT;;;;;;AAOA,MAAa,oBAAoB;;;;;;;AAUjC,MAAM,uBAAuB,OAC3B,eACA,gBACA,cACA,kBACkB;CAClB,MAAM,eAAe,eAAe;EAClC,UAAU;EACV,SAAS,CAAC,6BAA6B,cAAc,EAAE,cAAc,CAAC,CAAC;EACvE,YAAY;EACZ,KAAK;EACL,MAAM;CACR,CAAC;AACH;;;;;;;;;;;;;AAcA,MAAa,0BAA0B,OACrC,gBACA,MACA,cACA,kBACkB;CAClB,MAAM,kBAAkB,mBAAmB,aAAa;CACxD,MAAM,eAAe,oBAAoB,gBAAgB,IAAI;CAM7D,KAAK,MAAM,SAAS,cAAc;EAChC,IAAI,CAAC,gBAAgB,KAAK,MAAM,OAAO,GAAG;EAC1C,MAAM,qBACJ,MAAM,SACN,gBACA,cACA,aACF;CACF;AACF;;;;;;;AAQA,MAAa,qBAAqB,OAChC,MACA,gBACA,iBAC2B;CAC3B,IAAI;EAOF,QAAO,MANc,eAAe,MAAM;GACxC,UAAU;GACV,SAAS,CAAC,2BAA2B,YAAY,CAAC;GAClD,YAAY;GACZ,KAAK;EACP,CAAC,EACY,EAAE,QAAQ;CACzB,QAAQ;EACN,OAAO;CACT;AACF;;;;;;;;AASA,MAAa,2BAA2B,OACtC,gBACA,MACA,iBAC2B;CAC3B,IAAI,aAAa,8BAA8B,SAAS,GAAG,OAAO;CAClE,IAAI,CAAC,qBAAqB,KAAK,IAAI,GAAG,OAAO;CAE7C,MAAM,eAAe,oBAAoB,gBAAgB,IAAI;CAM7D,IAHE,aAAa,SAAS,OACpB,aAAa,EAAE,EAAE,sBAAsB,KAAK,KAAK,aAAa,SAAS,IAEhE;EAET,MAAM,gBAGD,CAAC;EAEN,KAAK,MAAM,SAAS,cAAc;GAChC,IAAI,CAAC,qBAAqB,KAAK,MAAM,OAAO,GAAG;GAE/C,MAAM,cAAc,MAAM,mBACxB,MAAM,SACN,gBACA,YACF;GACA,IAAI,eAAe,gBAAgB,MAAM,SACvC,cAAc,KAAK;IAAE;IAAO,iBAAiB;GAAY,CAAC;EAE9D;EAEA,IAAI,cAAc,WAAW,GAAG,OAAO;EACvC,OAAO,mBAAmB,MAAM,aAAa;CAC/C;CAGA,OAAO,mBAAmB,MAAM,gBAAgB,YAAY;AAC9D;;;;;;;;;AAUA,MAAa,qBAAqB,OAChC,MACA,gBACA,YAIW;CACX,MAAM,SAAS,MAAM,eAAe,MAAM;EACxC,UAAU;EACV,SAAS,CAAC,CAAC,6BAA6B,OAAO,CAAC;EAChD,YAAY;CACd,CAAC;CAED,IAAI,CAAC,QAAQ,MAAM,OAAO;CAE1B,OAAO;EAAE,MAAM,OAAO;EAAM,KAAK,OAAO;CAAI;AAC9C"}
|
|
@@ -4,7 +4,6 @@ import * as BabelTypes from "@babel/types";
|
|
|
4
4
|
import { Locale } from "@intlayer/types/allLocales";
|
|
5
5
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
6
6
|
import { FilePathPattern } from "@intlayer/types/filePathPattern";
|
|
7
|
-
|
|
8
7
|
//#region src/babel-plugin-intlayer-extract.d.ts
|
|
9
8
|
type ExtractResult = {
|
|
10
9
|
dictionaryKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-extract.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-extract.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-extract.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-extract.ts"],"mappings":";;;;;;;KAeY;EACV;EACA;EACA,SAAS;EACT,QAAQ;;KAGE;EACV,cAAc;EACd;EACA;EAEA,iBAAiB;EACjB,eAAe;;;;;;EAMf,aAAa,QAAQ,yBAAyB;;;;EAI9C,SAAS;;KAGN,QAAQ;EAAe,MAAM;;;;;;;;;;;;;;;;;;;cAmBrB,6BAA0B;EACrC,cAAc;MACZ,aAAa"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NestedRenameEntry, NestedRenameMap, PruneContext } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
2
2
|
import { NodePath, PluginObject } from "@babel/core";
|
|
3
3
|
import * as BabelTypes from "@babel/types";
|
|
4
|
-
|
|
5
4
|
//#region src/babel-plugin-intlayer-field-rename.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Converts a zero-based index to a short alphabetic identifier.
|
|
@@ -82,9 +81,7 @@ declare const renameIntlayerFieldAccesses: (babelTypes: typeof BabelTypes, progr
|
|
|
82
81
|
* `intlayerOptimizeBabelPlugin`, because the latter replaces `useIntlayer`
|
|
83
82
|
* with `useDictionary`, erasing the dictionary-key information needed here.
|
|
84
83
|
*/
|
|
85
|
-
declare const makeFieldRenameBabelPlugin: (pruneContext: PruneContext) => ({
|
|
86
|
-
types: babelTypes
|
|
87
|
-
}: {
|
|
84
|
+
declare const makeFieldRenameBabelPlugin: (pruneContext: PruneContext) => ({ types: babelTypes }: {
|
|
88
85
|
types: typeof BabelTypes;
|
|
89
86
|
}) => PluginObject;
|
|
90
87
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-field-rename.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-field-rename.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-field-rename.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-field-rename.ts"],"mappings":";;;;;;;;cA0Ba,yBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CtB,kCAA+B,0BAEzC;;;;;;;;;;;;cA2EU,6BAA0B,WAC1B,iBAAe,iCAEzB;;;;;;;;;;;;;;;;;;;;;;;;;cAiSU,8BAA2B,mBACnB,YAAU,aAChB,SAAS,WAAW,UAAQ,cAC3B;;;;;;;;;;cA8IH,6BAA0B,cACtB,oBAAY,OAAA;EACD,cAAc;MAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-minify.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-minify.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-minify.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-minify.ts"],"mappings":";;;;;;;;;;KAgBY;;;;;EAKV;;;;;;EAOA;;;;;EAMA;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkDW,4BAAyB;EACpC,cAAc;MACZ"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { PluginObject, PluginPass } from "@babel/core";
|
|
2
2
|
import * as BabelTypes from "@babel/types";
|
|
3
3
|
import { CallerDescriptor } from "@intlayer/config/callers";
|
|
4
|
-
|
|
5
4
|
//#region src/babel-plugin-intlayer-optimize.d.ts
|
|
6
|
-
declare const CALLER_LIST: readonly [
|
|
5
|
+
declare const CALLER_LIST: readonly ['useIntlayer', 'getIntlayer'];
|
|
7
6
|
/**
|
|
8
7
|
* Options for the optimization Babel plugin
|
|
9
8
|
*/
|
|
@@ -80,14 +79,22 @@ type OptimizePluginOptions = {
|
|
|
80
79
|
compatCallers?: CallerDescriptor[];
|
|
81
80
|
};
|
|
82
81
|
type State = PluginPass & {
|
|
83
|
-
opts: OptimizePluginOptions;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
82
|
+
opts: OptimizePluginOptions;
|
|
83
|
+
/** map key → generated ident (per-file) for static imports */
|
|
84
|
+
_newStaticImports?: Map<string, BabelTypes.Identifier>;
|
|
85
|
+
/** map key → generated ident (per-file) for dynamic imports */
|
|
86
|
+
_newDynamicImports?: Map<string, BabelTypes.Identifier>;
|
|
87
|
+
/** whether the current file imported *any* intlayer package */
|
|
88
|
+
_hasValidImport?: boolean;
|
|
89
|
+
/** map from local identifier name to the imported intlayer func name ('useIntlayer' | 'getIntlayer') */
|
|
90
|
+
_callerMap?: Map<string, (typeof CALLER_LIST)[number]>;
|
|
91
|
+
/** map from local identifier name to the intlayer package it was imported from */
|
|
92
|
+
_callerPackageMap?: Map<string, string>;
|
|
93
|
+
/** map from local identifier name to the compat caller descriptor it was imported as */
|
|
94
|
+
_compatCallerMap?: Map<string, CallerDescriptor>;
|
|
95
|
+
/** whether the current file *is* the dictionaries entry file */
|
|
96
|
+
_isDictEntry?: boolean;
|
|
97
|
+
/** whether the current file is included in the filesList */
|
|
91
98
|
_isIncluded?: boolean;
|
|
92
99
|
};
|
|
93
100
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-optimize.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-optimize.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-optimize.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-optimize.ts"],"mappings":";;;;cA6BM;;;;KAqDM;;;;EAIV;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA,oBAAoB;;;;EAOpB;;;;EAIA;;;;;;;;;;;;;;EAcA,gBAAgB;;KAGb,QAAQ;EACX,MAAM;;EAEN,oBAAoB,YAAY,WAAW;;EAE3C,qBAAqB,YAAY,WAAW;;EAE5C;;EAEA,aAAa,oBAAoB;;EAEjC,oBAAoB;;EAEpB,mBAAmB,YAAY;;EAE/B;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA8RW,8BAA2B;EACtC,cAAc;MACZ,aAAa"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CompatCallerConfig, PruneContext } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
2
2
|
import { PluginObject } from "@babel/core";
|
|
3
3
|
import * as BabelTypes from "@babel/types";
|
|
4
|
-
|
|
5
4
|
//#region src/babel-plugin-intlayer-purge.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Pre-resolved options accepted by {@link intlayerPurgeBabelPlugin}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-purge.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-purge.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-purge.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-purge.ts"],"mappings":";;;;;;;;;;;KAgCY;;;;;;EAMV;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;;EAOA,8BAA8B;;;;;;;;;;;;EAgB9B,gBAAgB;;;;;;;;;;cAqBL,wBAAqB,oBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwjB3C,2BAAwB;EACnC,cAAc;MACZ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PluginObject } from "@babel/core";
|
|
2
2
|
import * as BabelTypes from "@babel/types";
|
|
3
3
|
import { CallerDescriptor, CallerDescriptor as CallerDescriptor$1, CallerResultShape, CallerValueSource } from "@intlayer/config/callers";
|
|
4
|
-
|
|
5
4
|
//#region src/babel-plugin-intlayer-usage-analyzer.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Dictionary field usage result for a single dictionary key.
|
|
@@ -36,7 +35,8 @@ type OpaqueFieldOccurrence = {
|
|
|
36
35
|
* the escaping value, e.g. `['sections', 'hero']` for
|
|
37
36
|
* `<Card data={content.sections.hero} />`.
|
|
38
37
|
*/
|
|
39
|
-
fieldPath: string[];
|
|
38
|
+
fieldPath: string[];
|
|
39
|
+
/** Source locations (`filePath:line`) where the value escapes. */
|
|
40
40
|
locations: string[];
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
@@ -118,7 +118,7 @@ type PruneContext = {
|
|
|
118
118
|
};
|
|
119
119
|
declare const createPruneContext: () => PruneContext;
|
|
120
120
|
/** Canonical intlayer caller names that trigger usage analysis. */
|
|
121
|
-
declare const INTLAYER_CALLER_NAMES: readonly [
|
|
121
|
+
declare const INTLAYER_CALLER_NAMES: readonly ['useIntlayer', 'getIntlayer'];
|
|
122
122
|
type IntlayerCallerName = (typeof INTLAYER_CALLER_NAMES)[number];
|
|
123
123
|
/**
|
|
124
124
|
* Configuration entry for a single compat namespace caller.
|
|
@@ -154,9 +154,7 @@ declare const DEFAULT_COMPAT_CALLERS: CompatCallerConfig[];
|
|
|
154
154
|
*/
|
|
155
155
|
declare const makeUsageAnalyzerBabelPlugin: (pruneContext: PruneContext, options?: {
|
|
156
156
|
compatCallers?: CompatCallerConfig[];
|
|
157
|
-
}) => ({
|
|
158
|
-
types: babelTypes
|
|
159
|
-
}: {
|
|
157
|
+
}) => ({ types: babelTypes }: {
|
|
160
158
|
types: typeof BabelTypes;
|
|
161
159
|
}) => PluginObject;
|
|
162
160
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babel-plugin-intlayer-usage-analyzer.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-usage-analyzer.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"babel-plugin-intlayer-usage-analyzer.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-usage-analyzer.ts"],"mappings":";;;;;;;;;;;KAgBY,uBAAuB;;;;;;;;KASvB;EACV;EACA,UAAU;;;KAIA,kBAAkB,YAAY;;;;;;;KAQ9B;;;;;;EAMV;;EAGA;;;;;;;;;KAUU;;;;;;EAMV,8BAA8B,YAAY;;;;;EAM1C,2BAA2B;;;;;;EAO3B;;;;;;EAOA,qCAAqC;;;;;;EAOrC,+BAA+B,YAAY;;;;;;;;;;;;EAa3C,gCAAgC,YAE9B,YAAY;;;;;;;;;;;;;EAed,iCAAiC;;;;;;;;;;;EAYjC,0BAA0B;IAEtB;IAAsB;;;cAIf,0BAAyB;;cAiBzB;KACD,6BAA6B;;;;;;;KAmB7B,qBAAqB;;;;;;;;;;;cAYpB,wBAAwB;;;;;;;;;;;;;;;cAmiCxB,+BAA4B,cAEvB,cAAY;EACd,gBAAgB;SAAsB,OAAA;EAE1B,cAAc;MAAe"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ExistingIntlayerInfo } from "./utils/getExistingIntlayerInfo.js";
|
|
2
|
+
import "./utils/index.js";
|
|
2
3
|
import * as t from "@babel/types";
|
|
3
4
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
4
5
|
import { NodePath } from "@babel/traverse";
|
|
5
|
-
|
|
6
6
|
//#region src/extractContent/babelProcessor.d.ts
|
|
7
7
|
type BabelReplacement = {
|
|
8
8
|
path: NodePath;
|
|
@@ -27,7 +27,8 @@ declare const extractBabelContentForComponents: (ast: t.File, fileCode: string,
|
|
|
27
27
|
componentsNeedingHooks: Set<NodePath>;
|
|
28
28
|
componentKeyMap: Map<t.Node, string>;
|
|
29
29
|
componentPaths: NodePath[];
|
|
30
|
-
hookMap: Map<t.Node,
|
|
30
|
+
hookMap: Map<t.Node, 'useIntlayer' | 'getIntlayer'>;
|
|
31
|
+
/** Cached `getExistingIntlayerInfo` result per component node, so callers do not re-traverse. */
|
|
31
32
|
existingInfoByNode: Map<t.Node, ExistingIntlayerInfo | undefined>;
|
|
32
33
|
isSolid: boolean;
|
|
33
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelProcessor.d.ts","names":[],"sources":["../../../src/extractContent/babelProcessor.ts"],"mappings":";;;;;;KAaY
|
|
1
|
+
{"version":3,"file":"babelProcessor.d.ts","names":[],"sources":["../../../src/extractContent/babelProcessor.ts"],"mappings":";;;;;;KAaY;EACV,MAAM;EACN;EACA;EAOA;EACA,oBAAoB,EAAE;EACtB;;;;;;cA4IW,0BAAuB,MAC5B,SAAS,EAAE,aAAa,EAAE,cAAY,kBAC5B,cACF,aAAW,yBACA,MAAM,qBAAmB,kBAChC,eAAe,yBAAuB,cAC1C,oBAAkB,cAClB,IAAI,EAAE;;;;;cAwIT,mCAAgC,KACtC,EAAE,MAAI,kBACK,cACF,aAAW,oBACP,eACH,gBAAc,kBACb,uBACM;EAEtB,kBAAkB,eAAe;EACjC,cAAc;EACd,wBAAwB,IAAI;EAC5B,iBAAiB,IAAI,EAAE;EACvB,gBAAgB;EAChB,SAAS,IAAI,EAAE;;EAEf,oBAAoB,IAAI,EAAE,MAAM;EAChC;;;;;cA6ZW,mBAAgB,KACtB,EAAE,MAAI,kBACK,cACF,aAAW,eACV,gBAAc,kBACb,uBACM;EAEtB,kBAAkB;EAClB,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contentWriter.d.ts","names":[],"sources":["../../../src/extractContent/contentWriter.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"contentWriter.d.ts","names":[],"sources":["../../../src/extractContent/contentWriter.ts"],"mappings":";;;;;;KAmCK;EACH;EACA,aAAa;;;;;KAMV,uBAAuB,eAAe;;;;;;;cAa9B,0CAAuC,kBAChC,wBAAsB,oBACpB,mBAAiB,0BAEpC;;;;;;;cAkDU,uCAAoC,kBAC7B,wBAAsB,oBACpB,sBACnB;;;;cA8CU,qBAAkB,kBACX,wBAAsB,eACzB,eAAa,kBACZ,eACD,mBACd"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PackageName } from "./utils/constants.js";
|
|
2
|
+
import "./utils/index.js";
|
|
2
3
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
4
|
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
4
|
-
|
|
5
5
|
//#region src/extractContent/extractContent.d.ts
|
|
6
6
|
type ExtractIntlayerOptions = {
|
|
7
7
|
configOptions?: GetConfigurationOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractContent.d.ts","names":[],"sources":["../../../src/extractContent/extractContent.ts"],"mappings":";;;;;KA0BY
|
|
1
|
+
{"version":3,"file":"extractContent.d.ts","names":[],"sources":["../../../src/extractContent/extractContent.ts"],"mappings":";;;;;KA0BY;EACV,gBAAgB;EAChB;EACA;EACA,uBAAuB;EACvB,gBAAgB;EAChB;EACA,aAAa;IACX;IACA,SAAS;IACT;eACW;;KAsRV;EACH;EACA,qBAAqB,eAAe;;cAmCzB,iBAAc,kBACT,aACH,aAAW,UACd,2BACT,QAAQ;;;;;;;;;;;cA8EE,qBAAkB,kBACb,aACH,aAAW,UACd,2BACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processTsxFile.d.ts","names":[],"sources":["../../../src/extractContent/processTsxFile.ts"],"mappings":";;;;KAcY
|
|
1
|
+
{"version":3,"file":"processTsxFile.d.ts","names":[],"sources":["../../../src/extractContent/processTsxFile.ts"],"mappings":";;;;KAcY;EACV;EACA;EACA;;;;;cA4BW,iBAAc,kBACT,sBACI,aACP,aAAW,eACT,gBAAc,gBAChB,uBACS,yBAAuB;EAG7C,kBAAkB,eAAe;EACjC"}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* This is the single source of truth shared across all Intlayer compiler packages
|
|
5
5
|
* (@intlayer/babel, @intlayer/vue-compiler, @intlayer/svelte-compiler, @intlayer/engine).
|
|
6
6
|
*/
|
|
7
|
-
declare const ATTRIBUTES_TO_EXTRACT: readonly [
|
|
7
|
+
declare const ATTRIBUTES_TO_EXTRACT: readonly ['title', 'placeholder', 'alt', 'aria-label', 'label'];
|
|
8
8
|
/**
|
|
9
9
|
* The list of supported Intlayer integration packages.
|
|
10
10
|
* This is the single source of truth for package name validation.
|
|
11
11
|
*
|
|
12
12
|
* Order matter for resolution
|
|
13
13
|
*/
|
|
14
|
-
declare const packageList: readonly [
|
|
14
|
+
declare const packageList: readonly ['next-intlayer', 'react-intlayer', 'vue-intlayer', 'svelte-intlayer', 'preact-intlayer', 'solid-intlayer', 'angular-intlayer', 'lit-intlayer', 'express-intlayer', 'hono-intlayer', 'fastify-intlayer', 'adonis-intlayer', 'intlayer'];
|
|
15
15
|
/** Packages that support a `/server` sub-path for React Server Components. */
|
|
16
16
|
declare const SERVER_CAPABLE_PACKAGES: ReadonlySet<string>;
|
|
17
17
|
type PackageName = (typeof packageList)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../../src/extractContent/utils/constants.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../../../../src/extractContent/utils/constants.ts"],"mappings":";;;;;;cAKa;;;;;;;cAcA;;cAiBA,yBAAyB;KAI1B,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectPackageName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/detectPackageName.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"detectPackageName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/detectPackageName.ts"],"mappings":";;;;;cAOa,oBAAiB,sBAAwB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Locale } from "@intlayer/types/allLocales";
|
|
2
2
|
import { IntlayerConfig } from "@intlayer/types/config";
|
|
3
3
|
import { FilePathPatternFunction } from "@intlayer/types/filePathPattern";
|
|
4
|
-
|
|
5
4
|
//#region src/extractContent/utils/extractDictionaryInfo.d.ts
|
|
6
5
|
declare const getOutput: (configuration: IntlayerConfig, locale?: Locale) => FilePathPatternFunction | false;
|
|
7
6
|
type ResolveContentFilePaths = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractDictionaryInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryInfo.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractDictionaryInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryInfo.ts"],"mappings":";;;;cAmBa,YAAS,eACL,gBAAc,SACpB,WACR;KA0CS;EACV;EACA;EACA;;;;;;cAOW,0BAAuB,kBAClB,sBACI,eACL,gBAAc,SACpB,WACR,QAAQ;KA+GC;EACV,gBAAgB;;;;;cAML,wBAAqB,kBAChB,kBACA,eACD,mBACd;EAEC;IACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryKey.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryKey.ts"],"mappings":";;;;;;cASa,+BAA4B,kBACvB;cAkBL,uBAAoB,kBACf,kBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/generateKey.ts"],"mappings":";cAAa,
|
|
1
|
+
{"version":3,"file":"generateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/generateKey.ts"],"mappings":";cAAa,cAAW,cACV,cACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getComponentName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getComponentName.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"getComponentName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getComponentName.ts"],"mappings":";;;;;cAMa,mBAAgB,MAAU"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import * as t from "@babel/types";
|
|
2
2
|
import { NodePath } from "@babel/traverse";
|
|
3
|
-
|
|
4
3
|
//#region src/extractContent/utils/getExistingIntlayerInfo.d.ts
|
|
5
4
|
type ExistingIntlayerInfo = {
|
|
6
5
|
key: string;
|
|
7
|
-
hook: 'useIntlayer' | 'getIntlayer';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
hook: 'useIntlayer' | 'getIntlayer';
|
|
7
|
+
/** The variable name used to store the call result (e.g. `t` in `const t = useIntlayer(...)`) */
|
|
8
|
+
variableName: string;
|
|
9
|
+
/** True when the call result is destructured: `const { a, b } = getIntlayer(...)` */
|
|
10
|
+
isDestructured: boolean;
|
|
11
|
+
/** Keys already present in the destructuring pattern (empty when not destructured) */
|
|
12
|
+
existingDestructuredKeys: string[];
|
|
13
|
+
/** The ObjectPattern AST node, present only when `isDestructured` is true */
|
|
11
14
|
objectPatternNode?: t.ObjectPattern;
|
|
12
15
|
};
|
|
13
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExistingIntlayerInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getExistingIntlayerInfo.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getExistingIntlayerInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getExistingIntlayerInfo.ts"],"mappings":";;;KAGY;EACV;EACA;;EAEA;;EAEA;;EAEA;;EAEA,oBAAoB,EAAE;;;;;cAMX,0BAAuB,MAC5B,aACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrGenerateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getOrGenerateKey.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOrGenerateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getOrGenerateKey.ts"],"mappings":";;;;cAKa,mBAAgB,cACf,sBACQ,cACN,aAAW,kBACP,eAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/resolveDictionaryKey.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/resolveDictionaryKey.ts"],"mappings":";;;;;;;cAYa,uBAAoB,oBACb,kBACF,eACD,gBAAc,uBACN,yBAAuB,WACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shouldExtract.d.ts","names":[],"sources":["../../../../src/extractContent/utils/shouldExtract.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"shouldExtract.d.ts","names":[],"sources":["../../../../src/extractContent/utils/shouldExtract.ts"],"mappings":";;;;;;;;;;;cAUa,gBAAa"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractScriptBlocks.d.ts","names":[],"sources":["../../src/extractScriptBlocks.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractScriptBlocks.d.ts","names":[],"sources":["../../src/extractScriptBlocks.ts"],"mappings":";;;;;;;;;;KAWY;EACV;EACA;EACA;;;;;;;;;;;;;;;;cA8FW,sBAAmB,kBACd,iBAEf;;;;;;;;;;;cA+BU,qBAAkB,sBACT,eACL;EACb,OAAO;EACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExtractPluginOptions.d.ts","names":[],"sources":["../../src/getExtractPluginOptions.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"getExtractPluginOptions.d.ts","names":[],"sources":["../../src/getExtractPluginOptions.ts"],"mappings":";;;;;;;;KAcY;;;;;;cAOC,0BAAuB,gBACnB,gBAAc,QACtB,sCACN"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { OptimizePluginOptions } from "./babel-plugin-intlayer-optimize.js";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
3
|
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
4
|
-
|
|
5
4
|
//#region src/getOptimizePluginOptions.d.ts
|
|
6
5
|
type GetOptimizePluginOptionsParams = {
|
|
7
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOptimizePluginOptions.d.ts","names":[],"sources":["../../src/getOptimizePluginOptions.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getOptimizePluginOptions.d.ts","names":[],"sources":["../../src/getOptimizePluginOptions.ts"],"mappings":";;;;KAUK;;;;EAIH,gBAAgB;;;;EAIhB,eAAe;;;;;;EAMf;;;;EAIA,YAAY,QAAQ;;;;;;;cAyBT,2BAAwB,SAC1B,mCACR"}
|
|
@@ -2,7 +2,6 @@ import { MinifyPluginOptions } from "./babel-plugin-intlayer-minify.js";
|
|
|
2
2
|
import { PurgePluginOptions } from "./babel-plugin-intlayer-purge.js";
|
|
3
3
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
4
4
|
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
5
|
-
|
|
6
5
|
//#region src/getPurgePluginOptions.d.ts
|
|
7
6
|
type GetPurgePluginOptionsParams = {
|
|
8
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPurgePluginOptions.d.ts","names":[],"sources":["../../src/getPurgePluginOptions.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"getPurgePluginOptions.d.ts","names":[],"sources":["../../src/getPurgePluginOptions.ts"],"mappings":";;;;;KAkCK;;;;;;EAMH,gBAAgB;;;;;;EAOhB,eAAe;;;;EAKf,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;cA0BT,wBAAqB,SACvB,gCACR;KA4CE;;;;EAIH,gBAAgB;;;;EAKhB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;cAwBT,yBAAsB,SACxB,iCACR"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,9 +12,10 @@ import { generateKey } from "./extractContent/utils/generateKey.js";
|
|
|
12
12
|
import { getComponentName } from "./extractContent/utils/getComponentName.js";
|
|
13
13
|
import { mergeWithExistingMultilingualDictionary, mergeWithExistingPerLocaleDictionary, writeContentHelper } from "./extractContent/contentWriter.js";
|
|
14
14
|
import { ExtractIntlayerOptions, extractContent, extractContentSync } from "./extractContent/extractContent.js";
|
|
15
|
+
import "./extractContent/index.js";
|
|
15
16
|
import { ScriptBlock, extractScriptBlocks, injectScriptBlocks } from "./extractScriptBlocks.js";
|
|
16
17
|
import { CompilerMode, getExtractPluginOptions } from "./getExtractPluginOptions.js";
|
|
17
18
|
import { getOptimizePluginOptions } from "./getOptimizePluginOptions.js";
|
|
18
19
|
import { getMinifyPluginOptions, getPurgePluginOptions } from "./getPurgePluginOptions.js";
|
|
19
20
|
import { BABEL_PARSER_OPTIONS, INTLAYER_USAGE_REGEX, SOURCE_FILE_REGEX, analyzeFieldUsageInFile, buildUsageCheckRegex, getUsageCheckRegex, optimizeSourceFile, renameFieldsInCode, renameFieldsInSourceFile } from "./transformers.js";
|
|
20
|
-
export { ATTRIBUTES_TO_EXTRACT, BABEL_PARSER_OPTIONS, CallerDescriptor, CallerResultShape, CallerValueSource, CompatCallerConfig,
|
|
21
|
+
export { ATTRIBUTES_TO_EXTRACT, BABEL_PARSER_OPTIONS, type CallerDescriptor, type CallerResultShape, type CallerValueSource, CompatCallerConfig, CompilerMode, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, ExtractDictionaryInfoOptions, ExtractIntlayerOptions, ExtractPluginOptions, ExtractResult, INTLAYER_CALLER_NAMES, INTLAYER_USAGE_REGEX, IntlayerCallerName, MinifyPluginOptions, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, OptimizePluginOptions, PackageName, PruneContext, PurgePluginOptions, ResolveContentFilePaths, SERVER_CAPABLE_PACKAGES, SOURCE_FILE_REGEX, ScriptBlock, analyzeFieldUsageInFile, buildNestedRenameMapFromContent, buildUsageCheckRegex, createPruneContext, detectPackageName, extractContent, extractContentSync, extractDictionaryInfo, extractDictionaryKey, extractDictionaryKeyFromPath, extractScriptBlocks, generateKey, generateShortFieldName, getComponentName, getExtractPluginOptions, getMinifyPluginOptions, getNestedRenameEntryAtPath, getOptimizePluginOptions, getOutput, getPurgePluginOptions, getSharedPruneContext, getUsageCheckRegex, injectScriptBlocks, intlayerExtractBabelPlugin, intlayerMinifyBabelPlugin, intlayerOptimizeBabelPlugin, intlayerPurgeBabelPlugin, makeFieldRenameBabelPlugin, makeUsageAnalyzerBabelPlugin, mergeWithExistingMultilingualDictionary, mergeWithExistingPerLocaleDictionary, optimizeSourceFile, packageList, renameFieldsInCode, renameFieldsInSourceFile, renameIntlayerFieldAccesses, resolveContentFilePaths, writeContentHelper };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalizedFilesList.d.ts","names":[],"sources":["../../src/normalizedFilesList.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalizedFilesList.d.ts","names":[],"sources":["../../src/normalizedFilesList.ts"],"mappings":";;;;;;;;cAiBa,4BAAyB,iCAEnC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CompatCallerConfig, PruneContext } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
2
2
|
import { OptimizePluginOptions } from "./babel-plugin-intlayer-optimize.js";
|
|
3
3
|
import { TransformOptions } from "@babel/core";
|
|
4
|
-
|
|
5
4
|
//#region src/transformers.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* Babel parser options covering the superset of syntaxes used across all
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/transformers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/transformers.ts"],"mappings":";;;;;;;;cAmBa,sBAAsB,YAAY;;;;;;cAyBlC,sBAAoB;;;;;;;;;;;;;;;cAgBpB,uBAAoB,gCAAkC;;;;;;cAwBtD,qBAAkB,yBACJ,yBACxB;;;;;;cAoBU,mBAAiB;;;;;;;;;;;;;cAqCjB,0BAAuB,wBACZ,cACV,cACE,cAAY,gBACV,yBACf;;;;;;;cAyBU,qBAAkB,cACjB,wBACU,cACR,iBACb;;;;;;;;cAqBU,2BAAwB,wBACb,cACV,cACE,iBACb;;;;;;;;;cA8CU,qBAAkB,cACjB,wBACU,SACb,0BACR;EACD;EACA"}
|