astro-intlayer 8.7.0-canary.0 → 8.7.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
CHANGED
|
@@ -34,14 +34,9 @@ const intlayer = () => ({
|
|
|
34
34
|
hooks: {
|
|
35
35
|
"astro:config:setup": async ({ updateConfig }) => {
|
|
36
36
|
const configuration = (0, _intlayer_config_node.getConfiguration)();
|
|
37
|
-
const { optimize } = configuration.build;
|
|
38
37
|
await (0, _intlayer_chokidar_build.prepareIntlayer)(configuration);
|
|
39
38
|
updateConfig({ vite: {
|
|
40
|
-
plugins: [
|
|
41
|
-
(0, vite_intlayer.intlayer)(),
|
|
42
|
-
(0, vite_intlayer.intlayerMiddleware)(),
|
|
43
|
-
...optimize ? [(0, vite_intlayer.intlayerPrune)(configuration)] : []
|
|
44
|
-
],
|
|
39
|
+
plugins: [(0, vite_intlayer.intlayer)(), (0, vite_intlayer.intlayerProxy)()],
|
|
45
40
|
resolve: { alias: { ...(0, _intlayer_config_utils.getAlias)({
|
|
46
41
|
configuration,
|
|
47
42
|
formatter: (value) => (0, node_path.resolve)(value)
|
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 { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport type { AstroIntegration } from 'astro';\nimport {\n
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport type { AstroIntegration } from 'astro';\nimport {\n intlayerProxy as viteIntlayerMiddlewarePlugin,\n intlayer as viteIntlayerPlugin,\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 viteIntlayerMiddlewarePlugin(),\n ],\n resolve: {\n alias: {\n ...getAlias({\n configuration,\n formatter: (value: string) => resolve(value),\n }),\n },\n },\n },\n });\n },\n\n 'astro:server:setup': async () => {\n const configuration = getConfiguration();\n if (configuration.content.watch) {\n watch({ configuration });\n }\n },\n },\n }) satisfies AstroIntegration;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAa,kBACV;CACC,MAAM;CACN,OAAO;EACL,sBAAsB,OAAO,EAAE,mBAAmB;GAChD,MAAM,6DAAkC;AAGxC,uDAAsB,cAAc;AAEpC,gBAAa,EACX,MAAM;IACJ,SAAS,8BAGa,oCAEU,CAC/B;IACD,SAAS,EACP,OAAO,EACL,wCAAY;KACV;KACA,YAAY,iCAA0B,MAAM;KAC7C,CAAC,EACH,EACF;IACF,EACF,CAAC;;EAGJ,sBAAsB,YAAY;GAChC,MAAM,6DAAkC;AACxC,OAAI,cAAc,QAAQ,MACxB,uCAAM,EAAE,eAAe,CAAC;;EAG7B;CACF"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { prepareIntlayer } from "@intlayer/chokidar/build";
|
|
|
3
3
|
import { watch } from "@intlayer/chokidar/watcher";
|
|
4
4
|
import { getConfiguration } from "@intlayer/config/node";
|
|
5
5
|
import { getAlias } from "@intlayer/config/utils";
|
|
6
|
-
import { intlayer as intlayer$1,
|
|
6
|
+
import { intlayer as intlayer$1, intlayerProxy } from "vite-intlayer";
|
|
7
7
|
|
|
8
8
|
//#region src/index.ts
|
|
9
9
|
/**
|
|
@@ -33,14 +33,9 @@ const intlayer = () => ({
|
|
|
33
33
|
hooks: {
|
|
34
34
|
"astro:config:setup": async ({ updateConfig }) => {
|
|
35
35
|
const configuration = getConfiguration();
|
|
36
|
-
const { optimize } = configuration.build;
|
|
37
36
|
await prepareIntlayer(configuration);
|
|
38
37
|
updateConfig({ vite: {
|
|
39
|
-
plugins: [
|
|
40
|
-
intlayer$1(),
|
|
41
|
-
intlayerMiddleware(),
|
|
42
|
-
...optimize ? [intlayerPrune(configuration)] : []
|
|
43
|
-
],
|
|
38
|
+
plugins: [intlayer$1(), intlayerProxy()],
|
|
44
39
|
resolve: { alias: { ...getAlias({
|
|
45
40
|
configuration,
|
|
46
41
|
formatter: (value) => resolve(value)
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["viteIntlayerPlugin","viteIntlayerMiddlewarePlugin"],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport type { AstroIntegration } from 'astro';\nimport {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["viteIntlayerPlugin","viteIntlayerMiddlewarePlugin"],"sources":["../../src/index.ts"],"sourcesContent":["import { resolve } from 'node:path';\nimport { prepareIntlayer } from '@intlayer/chokidar/build';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getAlias } from '@intlayer/config/utils';\nimport type { AstroIntegration } from 'astro';\nimport {\n intlayerProxy as viteIntlayerMiddlewarePlugin,\n intlayer as viteIntlayerPlugin,\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 viteIntlayerMiddlewarePlugin(),\n ],\n resolve: {\n alias: {\n ...getAlias({\n configuration,\n formatter: (value: string) => resolve(value),\n }),\n },\n },\n },\n });\n },\n\n 'astro:server:setup': async () => {\n const configuration = getConfiguration();\n if (configuration.content.watch) {\n watch({ configuration });\n }\n },\n },\n }) satisfies AstroIntegration;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAa,kBACV;CACC,MAAM;CACN,OAAO;EACL,sBAAsB,OAAO,EAAE,mBAAmB;GAChD,MAAM,gBAAgB,kBAAkB;AAGxC,SAAM,gBAAgB,cAAc;AAEpC,gBAAa,EACX,MAAM;IACJ,SAAS,CAGPA,YAAoB,EAEpBC,eAA8B,CAC/B;IACD,SAAS,EACP,OAAO,EACL,GAAG,SAAS;KACV;KACA,YAAY,UAAkB,QAAQ,MAAM;KAC7C,CAAC,EACH,EACF;IACF,EACF,CAAC;;EAGJ,sBAAsB,YAAY;GAChC,MAAM,gBAAgB,kBAAkB;AACxC,OAAI,cAAc,QAAQ,MACxB,OAAM,EAAE,eAAe,CAAC;;EAG7B;CACF"}
|
|
@@ -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":";;;;;AAiCA;;;;;;;;;;;;;;;;;;;;cAAa,QAAA,QAAe,gBAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-intlayer",
|
|
3
|
-
"version": "8.7.0
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Astro applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@intlayer/chokidar": "8.7.0
|
|
82
|
-
"@intlayer/config": "8.7.0
|
|
83
|
-
"@intlayer/core": "8.7.0
|
|
84
|
-
"@intlayer/types": "8.7.0
|
|
85
|
-
"vite-intlayer": "8.7.0
|
|
81
|
+
"@intlayer/chokidar": "8.7.0",
|
|
82
|
+
"@intlayer/config": "8.7.0",
|
|
83
|
+
"@intlayer/core": "8.7.0",
|
|
84
|
+
"@intlayer/types": "8.7.0",
|
|
85
|
+
"vite-intlayer": "8.7.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@types/node": "25.5.2",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"rimraf": "6.1.3",
|
|
94
94
|
"tsdown": "0.21.7",
|
|
95
95
|
"typescript": "6.0.2",
|
|
96
|
-
"vitest": "4.1.
|
|
96
|
+
"vitest": "4.1.4"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"astro": ">=4.0.0"
|