vite-intlayer 6.1.6 → 7.0.0-canary.2
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/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/cjs/index.cjs +11 -27
- package/dist/cjs/intlayerMiddlewarePlugin.cjs +217 -224
- package/dist/cjs/intlayerMiddlewarePlugin.cjs.map +1 -1
- package/dist/cjs/intlayerPlugin.cjs +85 -100
- package/dist/cjs/intlayerPlugin.cjs.map +1 -1
- package/dist/cjs/intlayerPrunePlugin.cjs +81 -123
- package/dist/cjs/intlayerPrunePlugin.cjs.map +1 -1
- package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
- package/dist/esm/index.mjs +5 -4
- package/dist/esm/intlayerMiddlewarePlugin.mjs +210 -197
- package/dist/esm/intlayerMiddlewarePlugin.mjs.map +1 -1
- package/dist/esm/intlayerPlugin.mjs +78 -63
- package/dist/esm/intlayerPlugin.mjs.map +1 -1
- package/dist/esm/intlayerPrunePlugin.mjs +75 -87
- package/dist/esm/intlayerPrunePlugin.mjs.map +1 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/intlayerMiddlewarePlugin.d.ts +9 -4
- package/dist/types/intlayerMiddlewarePlugin.d.ts.map +1 -1
- package/dist/types/intlayerPlugin.d.ts +10 -4
- package/dist/types/intlayerPlugin.d.ts.map +1 -1
- package/dist/types/intlayerPrunePlugin.d.ts +7 -3
- package/dist/types/intlayerPrunePlugin.d.ts.map +1 -1
- package/package.json +45 -44
- package/LICENSE +0 -202
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
|
@@ -1,68 +1,83 @@
|
|
|
1
|
-
import { prepareIntlayer, runOnce, watch } from "@intlayer/chokidar";
|
|
2
|
-
import intlayerConfig from "@intlayer/config/built";
|
|
3
|
-
import { join, resolve } from "path";
|
|
4
|
-
import { getAlias, getAppLogger } from "@intlayer/config";
|
|
5
1
|
import { intlayerPrune } from "./intlayerPrunePlugin.mjs";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return plugins;
|
|
2
|
+
import { getAlias, getConfiguration } from "@intlayer/config";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { prepareIntlayer, watch } from "@intlayer/chokidar";
|
|
5
|
+
|
|
6
|
+
//#region src/intlayerPlugin.ts
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Rename to intlayer instead
|
|
9
|
+
*
|
|
10
|
+
* A Vite plugin that integrates Intlayer configuration into the build process
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* // Example usage of the plugin in a Vite configuration
|
|
14
|
+
* export default defineConfig({
|
|
15
|
+
* plugins: [ intlayer() ],
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
* */
|
|
19
|
+
const intlayerPlugin = (configOptions) => {
|
|
20
|
+
const intlayerConfig = getConfiguration(configOptions);
|
|
21
|
+
const { watch: isWatchMode } = intlayerConfig.content;
|
|
22
|
+
const { optimize } = intlayerConfig.build;
|
|
23
|
+
const plugins = [{
|
|
24
|
+
name: "vite-intlayer-plugin",
|
|
25
|
+
config: (config) => {
|
|
26
|
+
config.resolve = {
|
|
27
|
+
...config.resolve,
|
|
28
|
+
alias: {
|
|
29
|
+
...config.resolve?.alias,
|
|
30
|
+
...getAlias({
|
|
31
|
+
configuration: intlayerConfig,
|
|
32
|
+
formatter: (value) => resolve(value)
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
if (isWatchMode) config.optimizeDeps = {
|
|
37
|
+
...config.optimizeDeps,
|
|
38
|
+
exclude: [
|
|
39
|
+
...config.optimizeDeps?.exclude ?? [],
|
|
40
|
+
"@intlayer/dictionaries-entry",
|
|
41
|
+
"@intlayer/config/built"
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
return config;
|
|
45
|
+
},
|
|
46
|
+
configureServer: async (_server) => {
|
|
47
|
+
if (intlayerConfig.content.watch) watch({ configuration: intlayerConfig });
|
|
48
|
+
},
|
|
49
|
+
buildStart: async () => {
|
|
50
|
+
await prepareIntlayer(intlayerConfig);
|
|
51
|
+
}
|
|
52
|
+
}];
|
|
53
|
+
if (optimize) plugins.push(intlayerPrune(intlayerConfig));
|
|
54
|
+
return plugins;
|
|
60
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* A Vite plugin that integrates Intlayer configuration into the build process
|
|
58
|
+
*
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Example usage of the plugin in a Vite configuration
|
|
61
|
+
* export default defineConfig({
|
|
62
|
+
* plugins: [ intlayer() ],
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
61
66
|
const intlayer = intlayerPlugin;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Rename to intlayer instead
|
|
69
|
+
*
|
|
70
|
+
* A Vite plugin that integrates Intlayer configuration into the build process
|
|
71
|
+
*
|
|
72
|
+
* ```ts
|
|
73
|
+
* // Example usage of the plugin in a Vite configuration
|
|
74
|
+
* export default defineConfig({
|
|
75
|
+
* plugins: [ intlayer() ],
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
62
79
|
const intLayerPlugin = intlayerPlugin;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
intlayerPlugin
|
|
67
|
-
};
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
export { intLayerPlugin, intlayer, intlayerPlugin };
|
|
68
83
|
//# sourceMappingURL=intlayerPlugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intlayerPlugin.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"intlayerPlugin.mjs","names":["plugins: PluginOption[]"],"sources":["../../src/intlayerPlugin.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { prepareIntlayer, watch } from '@intlayer/chokidar';\nimport {\n type GetConfigurationOptions,\n getAlias,\n getConfiguration,\n} from '@intlayer/config';\n// @ts-ignore - Fix error Module '\"vite\"' has no exported member\nimport type { PluginOption } from 'vite';\nimport { intlayerPrune } from './intlayerPrunePlugin';\n\n/**\n * @deprecated Rename to intlayer instead\n *\n * A Vite plugin that integrates Intlayer configuration into the build process\n *\n * ```ts\n * // Example usage of the plugin in a Vite configuration\n * export default defineConfig({\n * plugins: [ intlayer() ],\n * });\n * ```\n * */\nexport const intlayerPlugin = (\n configOptions?: GetConfigurationOptions\n): PluginOption => {\n const intlayerConfig = getConfiguration(configOptions);\n const { watch: isWatchMode } = intlayerConfig.content;\n const { optimize } = intlayerConfig.build;\n\n const plugins: PluginOption[] = [\n {\n name: 'vite-intlayer-plugin',\n\n config: (config) => {\n // Update Vite's resolve alias\n config.resolve = {\n ...config.resolve,\n alias: {\n ...config.resolve?.alias,\n ...getAlias({\n configuration: intlayerConfig,\n formatter: (value: string) => resolve(value),\n }),\n },\n };\n\n if (isWatchMode) {\n config.optimizeDeps = {\n ...config.optimizeDeps,\n exclude: [\n ...(config.optimizeDeps?.exclude ?? []),\n '@intlayer/dictionaries-entry',\n '@intlayer/config/built',\n ],\n };\n }\n\n return config;\n },\n\n configureServer: async (_server) => {\n if (intlayerConfig.content.watch) {\n // Start watching (assuming watch is also async)\n watch({ configuration: intlayerConfig });\n }\n },\n\n buildStart: async () => {\n // Code to run when Vite build starts\n await prepareIntlayer(intlayerConfig);\n },\n },\n ];\n\n // Add Babel transform plugin if enabled\n if (optimize) {\n plugins.push(intlayerPrune(intlayerConfig));\n }\n\n return plugins;\n};\n\n/**\n * A Vite plugin that integrates Intlayer configuration into the build process\n *\n * ```ts\n * // Example usage of the plugin in a Vite configuration\n * export default defineConfig({\n * plugins: [ intlayer() ],\n * });\n * ```\n */\nexport const intlayer = intlayerPlugin;\n/**\n * @deprecated Rename to intlayer instead\n *\n * A Vite plugin that integrates Intlayer configuration into the build process\n *\n * ```ts\n * // Example usage of the plugin in a Vite configuration\n * export default defineConfig({\n * plugins: [ intlayer() ],\n * });\n * ```\n */\nexport const intLayerPlugin = intlayerPlugin;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAa,kBACX,kBACiB;CACjB,MAAM,iBAAiB,iBAAiB,cAAc;CACtD,MAAM,EAAE,OAAO,gBAAgB,eAAe;CAC9C,MAAM,EAAE,aAAa,eAAe;CAEpC,MAAMA,UAA0B,CAC9B;EACE,MAAM;EAEN,SAAS,WAAW;AAElB,UAAO,UAAU;IACf,GAAG,OAAO;IACV,OAAO;KACL,GAAG,OAAO,SAAS;KACnB,GAAG,SAAS;MACV,eAAe;MACf,YAAY,UAAkB,QAAQ,MAAM;MAC7C,CAAC;KACH;IACF;AAED,OAAI,YACF,QAAO,eAAe;IACpB,GAAG,OAAO;IACV,SAAS;KACP,GAAI,OAAO,cAAc,WAAW,EAAE;KACtC;KACA;KACD;IACF;AAGH,UAAO;;EAGT,iBAAiB,OAAO,YAAY;AAClC,OAAI,eAAe,QAAQ,MAEzB,OAAM,EAAE,eAAe,gBAAgB,CAAC;;EAI5C,YAAY,YAAY;AAEtB,SAAM,gBAAgB,eAAe;;EAExC,CACF;AAGD,KAAI,SACF,SAAQ,KAAK,cAAc,eAAe,CAAC;AAG7C,QAAO;;;;;;;;;;;;AAaT,MAAa,WAAW;;;;;;;;;;;;;AAaxB,MAAa,iBAAiB"}
|
|
@@ -1,92 +1,80 @@
|
|
|
1
|
+
import { __require } from "./_virtual/rolldown_runtime.mjs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { intlayerBabelPlugin } from "@intlayer/babel";
|
|
2
|
-
import {
|
|
3
|
-
import dictionaries from "@intlayer/dictionaries-entry";
|
|
4
|
+
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
4
5
|
import fg from "fast-glob";
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
//#region src/intlayerPrunePlugin.ts
|
|
6
8
|
const intlayerPrune = (intlayerConfig) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (result?.code) {
|
|
77
|
-
return {
|
|
78
|
-
code: result.code,
|
|
79
|
-
map: result.map
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.warn("Failed to transform with Babel plugin:", error);
|
|
84
|
-
}
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export {
|
|
90
|
-
intlayerPrune
|
|
9
|
+
try {
|
|
10
|
+
const babel = __require("@babel/core");
|
|
11
|
+
const { optimize, importMode, traversePattern } = intlayerConfig.build;
|
|
12
|
+
const { dictionariesDir, dynamicDictionariesDir, fetchDictionariesDir, mainDir, baseDir } = intlayerConfig.content;
|
|
13
|
+
const filesListPattern = fg.sync(traversePattern, { cwd: baseDir }).map((file) => join(baseDir, file));
|
|
14
|
+
const dictionariesEntryPath = join(mainDir, "dictionaries.mjs");
|
|
15
|
+
const dynamicDictionariesEntryPath = join(mainDir, "dynamic_dictionaries.mjs");
|
|
16
|
+
const filesList = [...filesListPattern, dictionariesEntryPath];
|
|
17
|
+
const dictionaries = getDictionaries();
|
|
18
|
+
const liveSyncKeys = Object.values(dictionaries).filter((dictionary) => dictionary.live).map((dictionary) => dictionary.key);
|
|
19
|
+
return {
|
|
20
|
+
name: "vite-intlayer-babel-transform",
|
|
21
|
+
enforce: "post",
|
|
22
|
+
transform(code, id) {
|
|
23
|
+
/**
|
|
24
|
+
* Transform file as
|
|
25
|
+
* .../HelloWorld.vue?vue&type=script&setup=true&lang.ts
|
|
26
|
+
* Into
|
|
27
|
+
* .../HelloWorld.vue
|
|
28
|
+
*
|
|
29
|
+
* Prevention for virtual file
|
|
30
|
+
*/
|
|
31
|
+
const filename = id.split("?", 1)[0];
|
|
32
|
+
if (!filesList.includes(filename)) return null;
|
|
33
|
+
if (!optimize) return null;
|
|
34
|
+
const result = babel.transformSync(code, {
|
|
35
|
+
filename,
|
|
36
|
+
plugins: [[intlayerBabelPlugin, {
|
|
37
|
+
dictionariesDir,
|
|
38
|
+
dictionariesEntryPath,
|
|
39
|
+
dynamicDictionariesDir,
|
|
40
|
+
dynamicDictionariesEntryPath,
|
|
41
|
+
fetchDictionariesDir,
|
|
42
|
+
importMode,
|
|
43
|
+
filesList,
|
|
44
|
+
replaceDictionaryEntry: false,
|
|
45
|
+
liveSyncKeys
|
|
46
|
+
}]],
|
|
47
|
+
parserOpts: {
|
|
48
|
+
sourceType: "module",
|
|
49
|
+
allowImportExportEverywhere: true,
|
|
50
|
+
plugins: [
|
|
51
|
+
"typescript",
|
|
52
|
+
"jsx",
|
|
53
|
+
"decorators-legacy",
|
|
54
|
+
"classProperties",
|
|
55
|
+
"objectRestSpread",
|
|
56
|
+
"asyncGenerators",
|
|
57
|
+
"functionBind",
|
|
58
|
+
"exportDefaultFrom",
|
|
59
|
+
"exportNamespaceFrom",
|
|
60
|
+
"dynamicImport",
|
|
61
|
+
"nullishCoalescingOperator",
|
|
62
|
+
"optionalChaining"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
if (result?.code) return {
|
|
67
|
+
code: result.code,
|
|
68
|
+
map: result.map
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.warn("Failed to transform with Babel plugin:", error);
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
91
76
|
};
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { intlayerPrune };
|
|
92
80
|
//# sourceMappingURL=intlayerPrunePlugin.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"intlayerPrunePlugin.mjs","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { intlayerBabelPlugin } from '@intlayer/babel';\nimport { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport type { PluginOption } from 'vite';\n\nexport const intlayerPrune = (intlayerConfig: IntlayerConfig): PluginOption => {\n try {\n const babel = require('@babel/core');\n\n const { optimize, importMode, traversePattern } = intlayerConfig.build;\n\n const {\n dictionariesDir,\n dynamicDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n baseDir,\n } = intlayerConfig.content;\n\n const filesListPattern = fg\n .sync(traversePattern, {\n cwd: baseDir,\n })\n .map((file) => join(baseDir, file));\n\n const dictionariesEntryPath = join(mainDir, 'dictionaries.mjs');\n const dynamicDictionariesEntryPath = join(\n mainDir,\n 'dynamic_dictionaries.mjs'\n );\n\n const filesList = [\n ...filesListPattern,\n dictionariesEntryPath, // should add dictionariesEntryPath to replace it by a empty object if import made dynamic\n ];\n\n const dictionaries = getDictionaries();\n const liveSyncKeys = Object.values(dictionaries)\n .filter((dictionary) => dictionary.live)\n .map((dictionary) => dictionary.key);\n\n return {\n name: 'vite-intlayer-babel-transform',\n enforce: 'post', // Run after other transformations as vue\n transform(code, id) {\n /**\n * Transform file as\n * .../HelloWorld.vue?vue&type=script&setup=true&lang.ts\n * Into\n * .../HelloWorld.vue\n *\n * Prevention for virtual file\n */\n const filename = id.split('?', 1)[0];\n if (!filesList.includes(filename)) return null;\n if (!optimize) return null;\n\n const result = babel.transformSync(code, {\n filename,\n plugins: [\n [\n intlayerBabelPlugin,\n {\n dictionariesDir,\n dictionariesEntryPath,\n dynamicDictionariesDir,\n dynamicDictionariesEntryPath,\n fetchDictionariesDir,\n importMode,\n filesList,\n replaceDictionaryEntry: false,\n liveSyncKeys,\n },\n ],\n ],\n parserOpts: {\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 if (result?.code) {\n return {\n code: result.code,\n map: result.map,\n };\n }\n },\n };\n } catch (error) {\n console.warn('Failed to transform with Babel plugin:', error);\n\n return null;\n }\n};\n"],"mappings":";;;;;;;AAOA,MAAa,iBAAiB,mBAAiD;AAC7E,KAAI;EACF,MAAM,kBAAgB,cAAc;EAEpC,MAAM,EAAE,UAAU,YAAY,oBAAoB,eAAe;EAEjE,MAAM,EACJ,iBACA,wBACA,sBACA,SACA,YACE,eAAe;EAEnB,MAAM,mBAAmB,GACtB,KAAK,iBAAiB,EACrB,KAAK,SACN,CAAC,CACD,KAAK,SAAS,KAAK,SAAS,KAAK,CAAC;EAErC,MAAM,wBAAwB,KAAK,SAAS,mBAAmB;EAC/D,MAAM,+BAA+B,KACnC,SACA,2BACD;EAED,MAAM,YAAY,CAChB,GAAG,kBACH,sBACD;EAED,MAAM,eAAe,iBAAiB;EACtC,MAAM,eAAe,OAAO,OAAO,aAAa,CAC7C,QAAQ,eAAe,WAAW,KAAK,CACvC,KAAK,eAAe,WAAW,IAAI;AAEtC,SAAO;GACL,MAAM;GACN,SAAS;GACT,UAAU,MAAM,IAAI;;;;;;;;;IASlB,MAAM,WAAW,GAAG,MAAM,KAAK,EAAE,CAAC;AAClC,QAAI,CAAC,UAAU,SAAS,SAAS,CAAE,QAAO;AAC1C,QAAI,CAAC,SAAU,QAAO;IAEtB,MAAM,SAAS,MAAM,cAAc,MAAM;KACvC;KACA,SAAS,CACP,CACE,qBACA;MACE;MACA;MACA;MACA;MACA;MACA;MACA;MACA,wBAAwB;MACxB;MACD,CACF,CACF;KACD,YAAY;MACV,YAAY;MACZ,6BAA6B;MAC7B,SAAS;OACP;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACD;MACF;KACF,CAAC;AAEF,QAAI,QAAQ,KACV,QAAO;KACL,MAAM,OAAO;KACb,KAAK,OAAO;KACb;;GAGN;UACM,OAAO;AACd,UAAQ,KAAK,0CAA0C,MAAM;AAE7D,SAAO"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { intLayerMiddleware, intlayerMiddleware, intlayerMiddlewarePlugin } from "./intlayerMiddlewarePlugin.js";
|
|
2
|
+
import { intLayerPlugin, intlayer, intlayerPlugin } from "./intlayerPlugin.js";
|
|
3
|
+
import { intlayerPrune } from "./intlayerPrunePlugin.js";
|
|
4
|
+
export { intLayerMiddleware, intLayerPlugin, intlayer, intlayerMiddleware, intlayerMiddlewarePlugin, intlayerPlugin, intlayerPrune };
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Plugin } from "vite";
|
|
2
|
+
|
|
3
|
+
//#region src/intlayerMiddlewarePlugin.d.ts
|
|
4
|
+
|
|
2
5
|
/**
|
|
3
6
|
* @deprecated Rename to intlayerMiddleware instead
|
|
4
7
|
*
|
|
@@ -9,7 +12,7 @@ import type { Plugin } from 'vite';
|
|
|
9
12
|
* plugins: [ intlayerMiddleware() ],
|
|
10
13
|
* });
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
declare const intlayerMiddlewarePlugin: () => Plugin;
|
|
13
16
|
/**
|
|
14
17
|
* A Vite plugin that integrates a logic similar to the Next.js intlayer middleware.
|
|
15
18
|
*
|
|
@@ -20,7 +23,7 @@ export declare const intlayerMiddlewarePlugin: () => Plugin;
|
|
|
20
23
|
* });
|
|
21
24
|
* ```
|
|
22
25
|
*/
|
|
23
|
-
|
|
26
|
+
declare const intlayerMiddleware: () => Plugin;
|
|
24
27
|
/**
|
|
25
28
|
* @deprecated Rename to intlayerMiddleware instead
|
|
26
29
|
*
|
|
@@ -33,5 +36,7 @@ export declare const intlayerMiddleware: () => Plugin;
|
|
|
33
36
|
* });
|
|
34
37
|
* ```
|
|
35
38
|
*/
|
|
36
|
-
|
|
39
|
+
declare const intLayerMiddleware: () => Plugin;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { intLayerMiddleware, intlayerMiddleware, intlayerMiddlewarePlugin };
|
|
37
42
|
//# sourceMappingURL=intlayerMiddlewarePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerMiddlewarePlugin.d.ts","
|
|
1
|
+
{"version":3,"file":"intlayerMiddlewarePlugin.d.ts","names":[],"sources":["../../src/intlayerMiddlewarePlugin.ts"],"sourcesContent":[],"mappings":";;;;;;AAqCA;AAqbA;AAcA;;;;;;cAnca,gCAA+B;;;;;;;;;;;cAqb/B,0BArb+B;;;;;;;;;;;;;cAmc/B,0BAnc+B"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PluginOption } from "vite";
|
|
2
|
+
import { GetConfigurationOptions } from "@intlayer/config";
|
|
3
|
+
|
|
4
|
+
//#region src/intlayerPlugin.d.ts
|
|
5
|
+
|
|
2
6
|
/**
|
|
3
7
|
* @deprecated Rename to intlayer instead
|
|
4
8
|
*
|
|
@@ -11,7 +15,7 @@ import { type PluginOption } from 'vite';
|
|
|
11
15
|
* });
|
|
12
16
|
* ```
|
|
13
17
|
* */
|
|
14
|
-
|
|
18
|
+
declare const intlayerPlugin: (configOptions?: GetConfigurationOptions) => PluginOption;
|
|
15
19
|
/**
|
|
16
20
|
* A Vite plugin that integrates Intlayer configuration into the build process
|
|
17
21
|
*
|
|
@@ -22,7 +26,7 @@ export declare const intlayerPlugin: () => PluginOption;
|
|
|
22
26
|
* });
|
|
23
27
|
* ```
|
|
24
28
|
*/
|
|
25
|
-
|
|
29
|
+
declare const intlayer: (configOptions?: GetConfigurationOptions) => PluginOption;
|
|
26
30
|
/**
|
|
27
31
|
* @deprecated Rename to intlayer instead
|
|
28
32
|
*
|
|
@@ -35,5 +39,7 @@ export declare const intlayer: () => PluginOption;
|
|
|
35
39
|
* });
|
|
36
40
|
* ```
|
|
37
41
|
*/
|
|
38
|
-
|
|
42
|
+
declare const intLayerPlugin: (configOptions?: GetConfigurationOptions) => PluginOption;
|
|
43
|
+
//#endregion
|
|
44
|
+
export { intLayerPlugin, intlayer, intlayerPlugin };
|
|
39
45
|
//# sourceMappingURL=intlayerPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerPlugin.d.ts","
|
|
1
|
+
{"version":3,"file":"intlayerPlugin.d.ts","names":[],"sources":["../../src/intlayerPlugin.ts"],"sourcesContent":[],"mappings":";;;;;;;AAuBA;AAsEA;AAaA;;;;;;;;cAnFa,iCACK,4BACf;;;;;;;;;;;cAoEU,2BArEK,4BACf;;;;;;;;;;;;;cAiFU,iCAlFK,4BACf"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { PluginOption } from "vite";
|
|
2
|
+
import { IntlayerConfig } from "@intlayer/types";
|
|
3
|
+
|
|
4
|
+
//#region src/intlayerPrunePlugin.d.ts
|
|
5
|
+
declare const intlayerPrune: (intlayerConfig: IntlayerConfig) => PluginOption;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { intlayerPrune };
|
|
4
8
|
//# sourceMappingURL=intlayerPrunePlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayerPrunePlugin.d.ts","
|
|
1
|
+
{"version":3,"file":"intlayerPrunePlugin.d.ts","names":[],"sources":["../../src/intlayerPrunePlugin.ts"],"sourcesContent":[],"mappings":";;;;cAOa,gCAAiC,mBAAiB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-intlayer",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-canary.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Vite plugin for seamless internationalization (i18n), providing locale detection, redirection, and environment-based configuration",
|
|
6
6
|
"keywords": [
|
|
@@ -57,58 +57,59 @@
|
|
|
57
57
|
"./dist",
|
|
58
58
|
"./package.json"
|
|
59
59
|
],
|
|
60
|
+
"scripts": {
|
|
61
|
+
"build": "tsdown --config tsdown.config.ts",
|
|
62
|
+
"build:ci": "tsdown --config tsdown.config.ts",
|
|
63
|
+
"clean": "rimraf ./dist .turbo",
|
|
64
|
+
"dev": "tsdown --config tsdown.config.ts --watch",
|
|
65
|
+
"format": "biome format . --check",
|
|
66
|
+
"format:fix": "biome format --write .",
|
|
67
|
+
"lint": "biome lint .",
|
|
68
|
+
"lint:fix": "biome lint --write .",
|
|
69
|
+
"prepublish": "cp -f ../../README.md ./README.md",
|
|
70
|
+
"test": "vitest run",
|
|
71
|
+
"test:watch": "vitest",
|
|
72
|
+
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
73
|
+
},
|
|
60
74
|
"dependencies": {
|
|
61
|
-
"@babel/core": "
|
|
62
|
-
"
|
|
63
|
-
"@intlayer/chokidar": "
|
|
64
|
-
"@intlayer/config": "
|
|
65
|
-
"@intlayer/core": "
|
|
66
|
-
"@intlayer/dictionaries-entry": "
|
|
67
|
-
"@intlayer/
|
|
75
|
+
"@babel/core": "7.28.4",
|
|
76
|
+
"@intlayer/babel": "7.0.0-canary.2",
|
|
77
|
+
"@intlayer/chokidar": "7.0.0-canary.2",
|
|
78
|
+
"@intlayer/config": "7.0.0-canary.2",
|
|
79
|
+
"@intlayer/core": "7.0.0-canary.2",
|
|
80
|
+
"@intlayer/dictionaries-entry": "7.0.0-canary.2",
|
|
81
|
+
"@intlayer/types": "7.0.0-canary.2",
|
|
82
|
+
"fast-glob": "3.3.3",
|
|
83
|
+
"intlayer": "7.0.0-canary.2"
|
|
68
84
|
},
|
|
69
85
|
"devDependencies": {
|
|
70
|
-
"@types/node": "
|
|
71
|
-
"@
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"typescript": "^5.9.2",
|
|
79
|
-
"vitest": "^3.2.4",
|
|
80
|
-
"@utils/ts-config": "1.0.4",
|
|
81
|
-
"@utils/eslint-config": "1.0.4",
|
|
82
|
-
"@utils/ts-config-types": "1.0.4",
|
|
83
|
-
"@utils/tsup-config": "1.0.4"
|
|
86
|
+
"@types/node": "24.9.1",
|
|
87
|
+
"@utils/ts-config": "7.0.0-canary.2",
|
|
88
|
+
"@utils/ts-config-types": "7.0.0-canary.2",
|
|
89
|
+
"@utils/tsdown-config": "7.0.0-canary.2",
|
|
90
|
+
"rimraf": "6.0.1",
|
|
91
|
+
"tsdown": "0.15.9",
|
|
92
|
+
"typescript": "5.9.3",
|
|
93
|
+
"vitest": "4.0.3"
|
|
84
94
|
},
|
|
85
95
|
"peerDependencies": {
|
|
86
|
-
"
|
|
87
|
-
"@intlayer/chokidar": "
|
|
88
|
-
"@intlayer/config": "
|
|
89
|
-
"@intlayer/core": "
|
|
90
|
-
"@intlayer/dictionaries-entry": "
|
|
96
|
+
"@babel/core": ">=6.0.0",
|
|
97
|
+
"@intlayer/chokidar": "7.0.0-canary.2",
|
|
98
|
+
"@intlayer/config": "7.0.0-canary.2",
|
|
99
|
+
"@intlayer/core": "7.0.0-canary.2",
|
|
100
|
+
"@intlayer/dictionaries-entry": "7.0.0-canary.2",
|
|
101
|
+
"@intlayer/types": "7.0.0-canary.2",
|
|
102
|
+
"vite": ">=4.0.0"
|
|
103
|
+
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"@babel/core": {
|
|
106
|
+
"optional": true
|
|
107
|
+
}
|
|
91
108
|
},
|
|
92
109
|
"engines": {
|
|
93
110
|
"node": ">=14.18"
|
|
94
111
|
},
|
|
95
112
|
"bug": {
|
|
96
113
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
97
|
-
},
|
|
98
|
-
"scripts": {
|
|
99
|
-
"build": "pnpm clean & pnpm build:ci",
|
|
100
|
-
"build:ci": "pnpm build:package & pnpm build:types",
|
|
101
|
-
"build:package": "tsup",
|
|
102
|
-
"build:types": "tsc --project ./tsconfig.types.json && tsc-alias --project ./tsconfig.types.json",
|
|
103
|
-
"clean": "rimraf ./dist",
|
|
104
|
-
"dev": "concurrently --prefix none \"tsup --watch\" \"tsc --project ./tsconfig.types.json --watch\" \"tsc-alias --project ./tsconfig.types.json --watch\"",
|
|
105
|
-
"lint": "eslint . --cache",
|
|
106
|
-
"lint:fix": "eslint . --cache --fix",
|
|
107
|
-
"prettier": "prettier . --check",
|
|
108
|
-
"prettier:fix": "prettier . --write",
|
|
109
|
-
"prepublish": "cp -f ../../README.md ./README.md",
|
|
110
|
-
"test": "vitest run",
|
|
111
|
-
"test:watch": "vitest",
|
|
112
|
-
"typecheck": "tsup --project ./tsconfig.json --noEmit"
|
|
113
114
|
}
|
|
114
|
-
}
|
|
115
|
+
}
|