@intlayer/babel 9.1.3 → 9.3.0
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-field-rename.cjs +32 -0
- package/dist/cjs/babel-plugin-intlayer-field-rename.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-optimize.cjs +26 -10
- package/dist/cjs/babel-plugin-intlayer-optimize.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-purge.cjs +161 -16
- package/dist/cjs/babel-plugin-intlayer-purge.cjs.map +1 -1
- package/dist/cjs/babel-plugin-intlayer-usage-analyzer.cjs +45 -0
- package/dist/cjs/babel-plugin-intlayer-usage-analyzer.cjs.map +1 -1
- package/dist/cjs/getOptimizePluginOptions.cjs +2 -0
- package/dist/cjs/getOptimizePluginOptions.cjs.map +1 -1
- package/dist/cjs/getPurgePluginOptions.cjs +3 -0
- package/dist/cjs/getPurgePluginOptions.cjs.map +1 -1
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/transformers.cjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-field-rename.mjs +32 -1
- package/dist/esm/babel-plugin-intlayer-field-rename.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-optimize.mjs +26 -10
- package/dist/esm/babel-plugin-intlayer-optimize.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-purge.mjs +160 -18
- package/dist/esm/babel-plugin-intlayer-purge.mjs.map +1 -1
- package/dist/esm/babel-plugin-intlayer-usage-analyzer.mjs +45 -1
- package/dist/esm/babel-plugin-intlayer-usage-analyzer.mjs.map +1 -1
- package/dist/esm/getOptimizePluginOptions.mjs +2 -0
- package/dist/esm/getOptimizePluginOptions.mjs.map +1 -1
- package/dist/esm/getPurgePluginOptions.mjs +3 -0
- package/dist/esm/getPurgePluginOptions.mjs.map +1 -1
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/transformers.mjs.map +1 -1
- package/dist/types/babel-plugin-intlayer-field-rename.d.ts +29 -1
- package/dist/types/babel-plugin-intlayer-field-rename.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-optimize.d.ts +15 -0
- package/dist/types/babel-plugin-intlayer-optimize.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-purge.d.ts +36 -1
- package/dist/types/babel-plugin-intlayer-purge.d.ts.map +1 -1
- package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts +30 -1
- package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts.map +1 -1
- package/dist/types/getOptimizePluginOptions.d.ts.map +1 -1
- package/dist/types/getPurgePluginOptions.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/transformers.d.ts +2 -2
- package/dist/types/transformers.d.ts.map +1 -1
- package/package.json +11 -10
|
@@ -47,6 +47,21 @@ type OptimizePluginOptions = {
|
|
|
47
47
|
* If true, the plugin will replace the dictionary entry file with `export default {}`.
|
|
48
48
|
*/
|
|
49
49
|
replaceDictionaryEntry: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Keys of the dictionaries that reference other dictionaries through
|
|
52
|
+
* `nest()`.
|
|
53
|
+
*
|
|
54
|
+
* For those, the injected static import points at the generated companion
|
|
55
|
+
* module (`<dictionariesDir>/nested/<key>.mjs`) instead of the raw JSON. The
|
|
56
|
+
* companion re-exports the dictionary with its nest targets attached, so
|
|
57
|
+
* `getNesting` resolves them from that local reference rather than from the
|
|
58
|
+
* global registry this plugin empties — and each target lands in the chunk of
|
|
59
|
+
* the dictionary referencing it.
|
|
60
|
+
*
|
|
61
|
+
* Dynamic and fetch modes need nothing here: their generated loaders already
|
|
62
|
+
* attach the same targets per locale.
|
|
63
|
+
*/
|
|
64
|
+
nestingDictionaryKeys?: string[];
|
|
50
65
|
/**
|
|
51
66
|
* If true, the plugin will activate the dynamic import of the dictionaries. It will rely on Suspense to load the dictionaries.
|
|
52
67
|
*/
|
|
@@ -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":";;;;cA8BM;;;;KAqDM;;;;EAIV;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;;;;;;;;;;;;EAeA;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiTW,8BAA2B;EACtC,cAAc;MACZ,aAAa"}
|
|
@@ -1,6 +1,8 @@
|
|
|
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
|
+
import { IntlayerConfig } from "@intlayer/types/config";
|
|
5
|
+
import { NestedFieldReferences } from "@intlayer/core/dictionaryManipulator";
|
|
4
6
|
//#region src/babel-plugin-intlayer-purge.d.ts
|
|
5
7
|
/**
|
|
6
8
|
* Pre-resolved options accepted by {@link intlayerPurgeBabelPlugin}.
|
|
@@ -54,6 +56,14 @@ type PurgePluginOptions = {
|
|
|
54
56
|
* `content` glob patterns.
|
|
55
57
|
*/
|
|
56
58
|
componentFilesList: string[];
|
|
59
|
+
/**
|
|
60
|
+
* Dictionaries referenced through `nest()`, mapped to the top-level fields
|
|
61
|
+
* those references read (`'all'` when the whole dictionary is nested).
|
|
62
|
+
*
|
|
63
|
+
* Those fields are resolved at runtime by `getNesting` using their original
|
|
64
|
+
* names, so they must survive purging and must never be renamed.
|
|
65
|
+
*/
|
|
66
|
+
nestedDictionaryReferences?: Map<string, NestedFieldReferences>;
|
|
57
67
|
/**
|
|
58
68
|
* Per-dictionary import-mode overrides, keyed by dictionary `key`.
|
|
59
69
|
* Dictionaries with mode `'fetch'` are excluded from field renaming because
|
|
@@ -72,6 +82,13 @@ type PurgePluginOptions = {
|
|
|
72
82
|
* Defaults to `[]` (no compat callers) when omitted.
|
|
73
83
|
*/
|
|
74
84
|
compatCallers?: CompatCallerConfig[];
|
|
85
|
+
/**
|
|
86
|
+
* Logging configuration used to report what the pipeline purged and
|
|
87
|
+
* minified, so a Babel- or SWC-driven build prints the same summary as the
|
|
88
|
+
* Vite one. Mirrors `log` in `intlayer.config.ts`; omit to fall back to the
|
|
89
|
+
* logger defaults.
|
|
90
|
+
*/
|
|
91
|
+
logConfig?: Pick<IntlayerConfig, 'log'>;
|
|
75
92
|
};
|
|
76
93
|
/**
|
|
77
94
|
* Returns the shared {@link PruneContext} for the given base directory, or
|
|
@@ -82,6 +99,24 @@ type PurgePluginOptions = {
|
|
|
82
99
|
* creating a circular dependency.
|
|
83
100
|
*/
|
|
84
101
|
declare const getSharedPruneContext: (baseDir: string) => PruneContext | null;
|
|
102
|
+
/**
|
|
103
|
+
* Runs the full purge/minify pipeline for the given options, using a
|
|
104
|
+
* module-level cache so the work happens at most once per process per
|
|
105
|
+
* unique `baseDir`.
|
|
106
|
+
*
|
|
107
|
+
* Exported so bundler integrations that do not go through Babel can drive the
|
|
108
|
+
* same pipeline. The Next.js integration is the main consumer: its SWC plugin
|
|
109
|
+
* runs as a per-file Wasm transform with no filesystem access, so the analysis
|
|
110
|
+
* and the dictionary rewrite happen here, in Node, and only the resulting
|
|
111
|
+
* field-rename tables (see {@link serializeFieldRenameMap}) are forwarded to
|
|
112
|
+
* the plugin.
|
|
113
|
+
*
|
|
114
|
+
* **This performs file I/O**: it reads every source file listed in
|
|
115
|
+
* `componentFilesList` and overwrites the compiled dictionary JSON files
|
|
116
|
+
* in-place. Call it at most once per build, after the dictionaries have been
|
|
117
|
+
* built.
|
|
118
|
+
*/
|
|
119
|
+
declare const runIntlayerPurgePipeline: (options: PurgePluginOptions) => PruneContext;
|
|
85
120
|
/**
|
|
86
121
|
* Babel plugin that analyses all project source files and rewrites compiled
|
|
87
122
|
* dictionary JSON files in-place to remove unused content fields
|
|
@@ -134,5 +169,5 @@ declare const intlayerPurgeBabelPlugin: (_babel: {
|
|
|
134
169
|
types: typeof BabelTypes;
|
|
135
170
|
}) => PluginObject;
|
|
136
171
|
//#endregion
|
|
137
|
-
export { PurgePluginOptions, getSharedPruneContext, intlayerPurgeBabelPlugin };
|
|
172
|
+
export { PurgePluginOptions, getSharedPruneContext, intlayerPurgeBabelPlugin, runIntlayerPurgePipeline };
|
|
138
173
|
//# sourceMappingURL=babel-plugin-intlayer-purge.d.ts.map
|
|
@@ -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":";;;;;;;;;;;;;KA2CY;;;;;;EAMV;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;;;;EASA,6BAA6B,YAAY;;;;;;EAOzC,8BAA8B;;;;;;;;;;;;EAgB9B,gBAAgB;;;;;;;EAQhB,YAAY,KAAK;;;;;;;;;;cAwBN,wBAAqB,oBAAsB;;;;;;;;;;;;;;;;;;cAssB3C,2BAAwB,SAC1B,uBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2HU,2BAAwB;EACnC,cAAc;MACZ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
+
import { NestedFieldReferences } from "@intlayer/core/dictionaryManipulator";
|
|
4
5
|
//#region src/babel-plugin-intlayer-usage-analyzer.d.ts
|
|
5
6
|
/**
|
|
6
7
|
* Dictionary field usage result for a single dictionary key.
|
|
@@ -117,6 +118,34 @@ type PruneContext = {
|
|
|
117
118
|
}[]>;
|
|
118
119
|
};
|
|
119
120
|
declare const createPruneContext: () => PruneContext;
|
|
121
|
+
/**
|
|
122
|
+
* Records `nest()` references in a prune context so nest targets stay
|
|
123
|
+
* resolvable — and no larger than they need to be — after purge and minify.
|
|
124
|
+
*
|
|
125
|
+
* A nested node stores the ORIGINAL dot path of the field it reads
|
|
126
|
+
* (`nest('common', 'period')` → `'period'`) and `getNesting` resolves it at
|
|
127
|
+
* runtime against the compiled JSON. That drives three adjustments:
|
|
128
|
+
*
|
|
129
|
+
* - Nest targets never take part in field renaming, since the stored path
|
|
130
|
+
* would no longer match the renamed keys.
|
|
131
|
+
* - A target already consumed by a call site keeps its analysed fields plus
|
|
132
|
+
* the nested ones, so neither consumer loses content.
|
|
133
|
+
* - A target reached *only* through `nest()` is given a usage entry holding
|
|
134
|
+
* exactly the nested fields. Without one, the purge pass leaves the whole
|
|
135
|
+
* dictionary untouched; with one, it trims the dictionary down to what the
|
|
136
|
+
* nest references actually read. This matters most for `dynamic` / `fetch`
|
|
137
|
+
* dictionaries, whose full static snapshot would otherwise be pulled into
|
|
138
|
+
* the eager bundle just to satisfy a single nested field.
|
|
139
|
+
*
|
|
140
|
+
* Seeding is skipped when a source file failed to parse: that file could
|
|
141
|
+
* reference the dictionary in a way the analysis never saw, which is the same
|
|
142
|
+
* guard the purge pass applies to keys with no usage entry.
|
|
143
|
+
*
|
|
144
|
+
* @param pruneContext - Shared analysis state to update in place.
|
|
145
|
+
* @param nestedDictionaryReferences - Nest-target key → referenced top-level
|
|
146
|
+
* fields, as returned by `getNestedDictionaryReferences`.
|
|
147
|
+
*/
|
|
148
|
+
declare const preserveNestedDictionaryFields: (pruneContext: PruneContext, nestedDictionaryReferences: Map<string, NestedFieldReferences>) => void;
|
|
120
149
|
/** Canonical intlayer caller names that trigger usage analysis. */
|
|
121
150
|
declare const INTLAYER_CALLER_NAMES: readonly ['useIntlayer', 'getIntlayer'];
|
|
122
151
|
type IntlayerCallerName = (typeof INTLAYER_CALLER_NAMES)[number];
|
|
@@ -158,5 +187,5 @@ declare const makeUsageAnalyzerBabelPlugin: (pruneContext: PruneContext, options
|
|
|
158
187
|
types: typeof BabelTypes;
|
|
159
188
|
}) => PluginObject;
|
|
160
189
|
//#endregion
|
|
161
|
-
export { type CallerDescriptor, type CallerResultShape, type CallerValueSource, CompatCallerConfig, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, INTLAYER_CALLER_NAMES, IntlayerCallerName, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, PruneContext, createPruneContext, makeUsageAnalyzerBabelPlugin };
|
|
190
|
+
export { type CallerDescriptor, type CallerResultShape, type CallerValueSource, CompatCallerConfig, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, INTLAYER_CALLER_NAMES, IntlayerCallerName, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, PruneContext, createPruneContext, makeUsageAnalyzerBabelPlugin, preserveNestedDictionaryFields };
|
|
162
191
|
//# sourceMappingURL=babel-plugin-intlayer-usage-analyzer.d.ts.map
|
|
@@ -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":";;;;;;;;;;;;KAiBY,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyCzB,iCAA8B,cAC3B,cAAY,4BACE,YAAY;;cAwC7B;KACD,6BAA6B;;;;;;;KAmB7B,qBAAqB;;;;;;;;;;;cAYpB,wBAAwB;;;;;;;;;;;;;;;cAmiCxB,+BAA4B,cAEvB,cAAY;EACd,gBAAgB;SAAsB,OAAA;EAE1B,cAAc;MAAe"}
|
|
@@ -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":";;;;KAWK;;;;EAIH,gBAAgB;;;;EAIhB,eAAe;;;;;;EAMf;;;;EAIA,YAAY,QAAQ;;;;;;;cAyBT,2BAAwB,SAC1B,mCACR"}
|
|
@@ -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":";;;;;KAmCK;;;;;;EAMH,gBAAgB;;;;;;EAOhB,eAAe;;;;EAKf,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;cA0BT,wBAAqB,SACvB,gCACR;KA8CE;;;;EAIH,gBAAgB;;;;EAKhB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;cAwBT,yBAAsB,SACxB,iCACR"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ATTRIBUTES_TO_EXTRACT, PackageName, SERVER_CAPABLE_PACKAGES, packageList } from "./extractContent/utils/constants.js";
|
|
2
2
|
import { ExtractPluginOptions, ExtractResult, intlayerExtractBabelPlugin } from "./babel-plugin-intlayer-extract.js";
|
|
3
|
-
import { CallerDescriptor, CallerResultShape, CallerValueSource, CompatCallerConfig, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, INTLAYER_CALLER_NAMES, IntlayerCallerName, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, PruneContext, createPruneContext, makeUsageAnalyzerBabelPlugin } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
4
|
-
import { buildNestedRenameMapFromContent, generateShortFieldName, getNestedRenameEntryAtPath, makeFieldRenameBabelPlugin, renameIntlayerFieldAccesses } from "./babel-plugin-intlayer-field-rename.js";
|
|
3
|
+
import { CallerDescriptor, CallerResultShape, CallerValueSource, CompatCallerConfig, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, INTLAYER_CALLER_NAMES, IntlayerCallerName, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, PruneContext, createPruneContext, makeUsageAnalyzerBabelPlugin, preserveNestedDictionaryFields } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
4
|
+
import { SerializedFieldRenameEntry, SerializedFieldRenameMap, buildNestedRenameMapFromContent, generateShortFieldName, getNestedRenameEntryAtPath, makeFieldRenameBabelPlugin, renameIntlayerFieldAccesses, serializeFieldRenameMap } from "./babel-plugin-intlayer-field-rename.js";
|
|
5
5
|
import { MinifyPluginOptions, intlayerMinifyBabelPlugin } from "./babel-plugin-intlayer-minify.js";
|
|
6
6
|
import { OptimizePluginOptions, intlayerOptimizeBabelPlugin } from "./babel-plugin-intlayer-optimize.js";
|
|
7
|
-
import { PurgePluginOptions, getSharedPruneContext, intlayerPurgeBabelPlugin } from "./babel-plugin-intlayer-purge.js";
|
|
7
|
+
import { PurgePluginOptions, getSharedPruneContext, intlayerPurgeBabelPlugin, runIntlayerPurgePipeline } from "./babel-plugin-intlayer-purge.js";
|
|
8
8
|
import { detectPackageName } from "./extractContent/utils/detectPackageName.js";
|
|
9
9
|
import { ExtractDictionaryInfoOptions, ResolveContentFilePaths, extractDictionaryInfo, getOutput, resolveContentFilePaths } from "./extractContent/utils/extractDictionaryInfo.js";
|
|
10
10
|
import { extractDictionaryKey, extractDictionaryKeyFromPath } from "./extractContent/utils/extractDictionaryKey.js";
|
|
@@ -18,4 +18,4 @@ import { CompilerMode, getExtractPluginOptions } from "./getExtractPluginOptions
|
|
|
18
18
|
import { getOptimizePluginOptions } from "./getOptimizePluginOptions.js";
|
|
19
19
|
import { getMinifyPluginOptions, getPurgePluginOptions } from "./getPurgePluginOptions.js";
|
|
20
20
|
import { BABEL_PARSER_OPTIONS, INTLAYER_USAGE_REGEX, SOURCE_FILE_REGEX, analyzeFieldUsageInFile, buildUsageCheckRegex, getUsageCheckRegex, optimizeSourceFile, renameFieldsInCode, renameFieldsInSourceFile } from "./transformers.js";
|
|
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 };
|
|
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, SerializedFieldRenameEntry, SerializedFieldRenameMap, 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, preserveNestedDictionaryFields, renameFieldsInCode, renameFieldsInSourceFile, renameIntlayerFieldAccesses, resolveContentFilePaths, runIntlayerPurgePipeline, serializeFieldRenameMap, writeContentHelper };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CompatCallerConfig, PruneContext } from "./babel-plugin-intlayer-usage-analyzer.js";
|
|
2
2
|
import { OptimizePluginOptions } from "./babel-plugin-intlayer-optimize.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ParserOptions } from "@babel/parser";
|
|
4
4
|
//#region src/transformers.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Babel parser options covering the superset of syntaxes used across all
|
|
7
7
|
* supported frameworks (React / Vue / Svelte / Angular / …).
|
|
8
8
|
*/
|
|
9
|
-
declare const BABEL_PARSER_OPTIONS:
|
|
9
|
+
declare const BABEL_PARSER_OPTIONS: ParserOptions;
|
|
10
10
|
/**
|
|
11
11
|
* Fast pre-check: matches files that could contain native intlayer calls
|
|
12
12
|
* (`useIntlayer` / `getIntlayer`). Used by the optimize/transform pass, which
|
|
@@ -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":";;;;;;;;cAyBa,sBAAsB;;;;;;cAwBtB,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/babel",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Babel plugin for Intlayer that transforms declaration files and provides internationalization features during the build process according to the Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -89,19 +89,20 @@
|
|
|
89
89
|
"@babel/plugin-syntax-jsx": "8.0.1",
|
|
90
90
|
"@babel/traverse": "8.0.4",
|
|
91
91
|
"@babel/types": "8.0.4",
|
|
92
|
-
"@intlayer/config": "9.
|
|
93
|
-
"@intlayer/core": "9.
|
|
94
|
-
"@intlayer/dictionaries-entry": "9.
|
|
95
|
-
"@intlayer/engine": "9.
|
|
96
|
-
"@intlayer/types": "9.
|
|
97
|
-
"@intlayer/unmerged-dictionaries-entry": "9.
|
|
92
|
+
"@intlayer/config": "9.3.0",
|
|
93
|
+
"@intlayer/core": "9.3.0",
|
|
94
|
+
"@intlayer/dictionaries-entry": "9.3.0",
|
|
95
|
+
"@intlayer/engine": "9.3.0",
|
|
96
|
+
"@intlayer/types": "9.3.0",
|
|
97
|
+
"@intlayer/unmerged-dictionaries-entry": "9.3.0"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"@babel/plugin-syntax-jsx": "8.0.1",
|
|
101
101
|
"@types/babel__core": "7.20.5",
|
|
102
102
|
"@types/babel__generator": "7.27.0",
|
|
103
103
|
"@types/babel__traverse": "7.28.0",
|
|
104
|
-
"@types/
|
|
104
|
+
"@types/convert-source-map": "^2.0.3",
|
|
105
|
+
"@types/node": "26.2.0",
|
|
105
106
|
"@utils/ts-config": "1.0.4",
|
|
106
107
|
"@utils/ts-config-types": "1.0.4",
|
|
107
108
|
"@utils/tsdown-config": "1.0.4",
|
|
@@ -112,8 +113,8 @@
|
|
|
112
113
|
"vitest": "4.1.10"
|
|
113
114
|
},
|
|
114
115
|
"peerDependencies": {
|
|
115
|
-
"@intlayer/svelte-compiler": "9.
|
|
116
|
-
"@intlayer/vue-compiler": "9.
|
|
116
|
+
"@intlayer/svelte-compiler": "9.3.0",
|
|
117
|
+
"@intlayer/vue-compiler": "9.3.0"
|
|
117
118
|
},
|
|
118
119
|
"peerDependenciesMeta": {
|
|
119
120
|
"@intlayer/svelte-compiler": {
|