astro-intlayer 9.0.0-canary.8 → 9.0.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/index.cjs +4 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let node_path = require("node:path");
|
|
3
|
-
let _intlayer_chokidar_build = require("@intlayer/chokidar/build");
|
|
4
|
-
let _intlayer_chokidar_watcher = require("@intlayer/chokidar/watcher");
|
|
5
3
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
6
4
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
5
|
+
let _intlayer_engine_build = require("@intlayer/engine/build");
|
|
6
|
+
let _intlayer_engine_watcher = require("@intlayer/engine/watcher");
|
|
7
7
|
let vite_intlayer = require("vite-intlayer");
|
|
8
8
|
|
|
9
9
|
//#region src/index.ts
|
|
@@ -34,7 +34,7 @@ const intlayer = () => ({
|
|
|
34
34
|
hooks: {
|
|
35
35
|
"astro:config:setup": async ({ updateConfig }) => {
|
|
36
36
|
const configuration = (0, _intlayer_config_node.getConfiguration)();
|
|
37
|
-
await (0,
|
|
37
|
+
await (0, _intlayer_engine_build.prepareIntlayer)(configuration);
|
|
38
38
|
updateConfig({ vite: {
|
|
39
39
|
plugins: [(0, vite_intlayer.intlayer)(), (0, vite_intlayer.intlayerProxy)()],
|
|
40
40
|
resolve: { alias: { ...(0, _intlayer_config_utils.getAlias)({
|
|
@@ -45,7 +45,7 @@ const intlayer = () => ({
|
|
|
45
45
|
},
|
|
46
46
|
"astro:server:setup": async () => {
|
|
47
47
|
const configuration = (0, _intlayer_config_node.getConfiguration)();
|
|
48
|
-
if (configuration.content.watch) await (0,
|
|
48
|
+
if (configuration.content.watch) await (0, _intlayer_engine_watcher.watch)({ configuration });
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
});
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { AstroIntegration } from 'astro';\nimport type { PluginOption } from 'vite';\nimport {\n intlayer as viteIntlayerPlugin,\n intlayerProxy as viteIntlayerProxyPlugin,\n} from 'vite-intlayer';\n\n/**\n * Astro integration for Intlayer.\n *\n * It handles:\n * 1. Preparing Intlayer resources (dictionaries) at config setup.\n * 2. Injecting Vite plugins for aliases, locale-based routing (middleware), and build optimizations (prune).\n * 3. Configuring Vite aliases for dictionary access.\n * 4. Starting a file watcher for dictionary changes during development.\n *\n * @returns An Astro integration object.\n *\n * @example\n * ```ts\n * // astro.config.mjs\n * import { defineConfig } from 'astro/config';\n * import { intlayer } from 'astro-intlayer';\n *\n * export default defineConfig({\n * integrations: [intlayer()],\n * });\n * ```\n */\nexport const intlayer = (): AstroIntegration =>\n ({\n name: 'astro-intlayer',\n hooks: {\n 'astro:config:setup': async ({ updateConfig }) => {\n const configuration = getConfiguration();\n\n // Prepare once per process start to ensure generated entries exist\n await prepareIntlayer(configuration);\n\n updateConfig({\n vite: {\n plugins: [\n // Aliases + watcher + buildStart prep\n // (also handles optimize/prune/minify internally)\n viteIntlayerPlugin(),\n // Dev-time middleware for locale routing\n viteIntlayerProxyPlugin(),\n ] as PluginOption[],\n resolve: {\n alias: {\n ...getAlias({\n configuration,\n formatter: (value) => resolve(value),\n }),\n },\n },\n },\n });\n },\n\n 'astro:server:setup': async () => {\n const configuration = getConfiguration();\n\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n },\n },\n }) satisfies AstroIntegration;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,kBACV;CACC,MAAM;CACN,OAAO;EACL,sBAAsB,OAAO,EAAE,mBAAmB;GAChD,MAAM,4DAAiC;GAGvC,kDAAsB,aAAa;GAEnC,aAAa,EACX,MAAM;IACJ,SAAS,6BAGY,oCAEK,CAC1B;IACA,SAAS,EACP,OAAO,EACL,wCAAY;KACV;KACA,YAAY,iCAAkB,KAAK;IACrC,CAAC,EACH,EACF;GACF,EACF,CAAC;EACH;EAEA,sBAAsB,YAAY;GAChC,MAAM,4DAAiC;GAEvC,IAAI,cAAc,QAAQ,OACxB,0CAAY,EAAE,cAAc,CAAC;EAEjC;CACF;AACF"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
|
-
import { prepareIntlayer } from "@intlayer/chokidar/build";
|
|
3
|
-
import { watch } from "@intlayer/chokidar/watcher";
|
|
4
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
5
3
|
import { getAlias } from "@intlayer/config/utils";
|
|
4
|
+
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
5
|
+
import { watch } from "@intlayer/engine/watcher";
|
|
6
6
|
import { intlayer as intlayer$1, intlayerProxy } from "vite-intlayer";
|
|
7
7
|
|
|
8
8
|
//#region src/index.ts
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["viteIntlayerPlugin","viteIntlayerProxyPlugin"],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["viteIntlayerPlugin","viteIntlayerProxyPlugin"],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport { prepareIntlayer } from '@intlayer/engine/build';\nimport { watch } from '@intlayer/engine/watcher';\nimport type { AstroIntegration } from 'astro';\nimport type { PluginOption } from 'vite';\nimport {\n intlayer as viteIntlayerPlugin,\n intlayerProxy as viteIntlayerProxyPlugin,\n} from 'vite-intlayer';\n\n/**\n * Astro integration for Intlayer.\n *\n * It handles:\n * 1. Preparing Intlayer resources (dictionaries) at config setup.\n * 2. Injecting Vite plugins for aliases, locale-based routing (middleware), and build optimizations (prune).\n * 3. Configuring Vite aliases for dictionary access.\n * 4. Starting a file watcher for dictionary changes during development.\n *\n * @returns An Astro integration object.\n *\n * @example\n * ```ts\n * // astro.config.mjs\n * import { defineConfig } from 'astro/config';\n * import { intlayer } from 'astro-intlayer';\n *\n * export default defineConfig({\n * integrations: [intlayer()],\n * });\n * ```\n */\nexport const intlayer = (): AstroIntegration =>\n ({\n name: 'astro-intlayer',\n hooks: {\n 'astro:config:setup': async ({ updateConfig }) => {\n const configuration = getConfiguration();\n\n // Prepare once per process start to ensure generated entries exist\n await prepareIntlayer(configuration);\n\n updateConfig({\n vite: {\n plugins: [\n // Aliases + watcher + buildStart prep\n // (also handles optimize/prune/minify internally)\n viteIntlayerPlugin(),\n // Dev-time middleware for locale routing\n viteIntlayerProxyPlugin(),\n ] as PluginOption[],\n resolve: {\n alias: {\n ...getAlias({\n configuration,\n formatter: (value) => resolve(value),\n }),\n },\n },\n },\n });\n },\n\n 'astro:server:setup': async () => {\n const configuration = getConfiguration();\n\n if (configuration.content.watch) {\n await watch({ configuration });\n }\n },\n },\n }) satisfies AstroIntegration;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,kBACV;CACC,MAAM;CACN,OAAO;EACL,sBAAsB,OAAO,EAAE,mBAAmB;GAChD,MAAM,gBAAgB,iBAAiB;GAGvC,MAAM,gBAAgB,aAAa;GAEnC,aAAa,EACX,MAAM;IACJ,SAAS,CAGPA,WAAmB,GAEnBC,cAAwB,CAC1B;IACA,SAAS,EACP,OAAO,EACL,GAAG,SAAS;KACV;KACA,YAAY,UAAU,QAAQ,KAAK;IACrC,CAAC,EACH,EACF;GACF,EACF,CAAC;EACH;EAEA,sBAAsB,YAAY;GAChC,MAAM,gBAAgB,iBAAiB;GAEvC,IAAI,cAAc,QAAQ,OACxB,MAAM,MAAM,EAAE,cAAc,CAAC;EAEjC;CACF;AACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;cAkCa,gBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-intlayer",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Astro applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -78,22 +78,22 @@
|
|
|
78
78
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@intlayer/
|
|
82
|
-
"@intlayer/
|
|
83
|
-
"@intlayer/
|
|
84
|
-
"@intlayer/types": "9.0.0
|
|
85
|
-
"vite-intlayer": "9.0.0
|
|
81
|
+
"@intlayer/config": "9.0.0",
|
|
82
|
+
"@intlayer/core": "9.0.0",
|
|
83
|
+
"@intlayer/engine": "9.0.0",
|
|
84
|
+
"@intlayer/types": "9.0.0",
|
|
85
|
+
"vite-intlayer": "9.0.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@types/node": "
|
|
88
|
+
"@types/node": "26.1.1",
|
|
89
89
|
"@utils/ts-config": "1.0.4",
|
|
90
90
|
"@utils/ts-config-types": "1.0.4",
|
|
91
91
|
"@utils/tsdown-config": "1.0.4",
|
|
92
92
|
"fast-glob": "3.3.3",
|
|
93
93
|
"rimraf": "6.1.3",
|
|
94
|
-
"tsdown": "0.
|
|
95
|
-
"typescript": "
|
|
96
|
-
"vitest": "4.1.
|
|
94
|
+
"tsdown": "0.22.13",
|
|
95
|
+
"typescript": "7.0.2",
|
|
96
|
+
"vitest": "4.1.10"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"astro": ">=4.0.0",
|