nuxt-intlayer 8.9.7 → 8.10.0-canary.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/README.md
CHANGED
|
@@ -67,6 +67,7 @@ With **per-locale content files**, **TypeScript autocompletion**, **tree-shakabl
|
|
|
67
67
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/mcp.png?raw=true" alt="Feature" width="700"> | **MCP Server Integration**<br><br>Provides an MCP (Model Context Protocol) server for IDE automation, enabling seamless content management and i18n workflows directly within your development environment. <br><br> - [MCP Server](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) |
|
|
68
68
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/vscode_extension.png?raw=true" alt="Feature" width="700"> | **VSCode Extension**<br><br>Intlayer provides a VSCode extension to help you manage your content and translations, building your dictionaries, translating your content, and more. <br><br> - [VSCode Extension](https://intlayer.org/doc/vs-code-extension) |
|
|
69
69
|
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/interoperability.png?raw=true" alt="Feature" width="700"> | **Interoperability**<br><br>Allow interoperability with react-i18next, next-i18next, next-intl, react-intl, vue-i18n. <br><br> - [Intlayer and react-intl](https://intlayer.org/blog/intlayer-with-react-intl) <br> - [Intlayer and next-intl](https://intlayer.org/blog/intlayer-with-next-intl) <br> - [Intlayer and next-i18next](https://intlayer.org/blog/intlayer-with-next-i18next) <br> - [Intlayer and vue-i18n](https://intlayer.org/blog/intlayer-with-vue-i18n) |
|
|
70
|
+
| <img src="https://github.com/aymericzip/intlayer/blob/main/docs/assets/benchmark.png?raw=true" alt="Feature" width="700"> | **Performances & Benchmark**<br><br>Uses advanced tree-shaking and dynamic loading to boost performances and keep the solution as light as possible. <br><br> - [Performances & Benchmark](https://intlayer.org/doc/benchmark) |
|
|
70
71
|
|
|
71
72
|
---
|
|
72
73
|
|
|
@@ -249,6 +250,19 @@ Explore our comprehensive documentation to get started with Intlayer and learn h
|
|
|
249
250
|
</ul>
|
|
250
251
|
</details>
|
|
251
252
|
|
|
253
|
+
## Multilingual content management system
|
|
254
|
+
|
|
255
|
+
More than an i18n library, Intlayer is a complete **multilingual content management system**. A full CMS is available for free at [app.intlayer.org](https://app.intlayer.org).
|
|
256
|
+
|
|
257
|
+
Intlayer connects **developers**, **copywriters**, and **AI agents** in one workflow for creating and maintaining multilingual websites effortlessly.Intlayer replaces the following stack in a single solution:
|
|
258
|
+
|
|
259
|
+
- i18n solutions (e.g. `i18next`, `next-intl`, `vue-i18n`)
|
|
260
|
+
- TMSs (Translation Management Systems) (e.g. Crowdin, Phrase, Lokalise)
|
|
261
|
+
- Feature flags
|
|
262
|
+
- Headless CMSs (e.g. Contentful, Strapi, Sanity)
|
|
263
|
+
|
|
264
|
+

|
|
265
|
+
|
|
252
266
|
## 🌐 Readme in other languages
|
|
253
267
|
|
|
254
268
|
<p align="center">
|
package/dist/esm/module.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.mjs","names":[],"sources":["../../src/module.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/node';\nimport { getPrefix } from '@intlayer/core/localization';\nimport { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport type { NuxtModule } from '@nuxt/schema';\nimport { intlayer, intlayerProxy } from 'vite-intlayer';\n\n/**\n * Nuxt module that integrates Intlayer into Nuxt applications.\n *\n * It handles:\n * 1. Configuring TypeScript to include Intlayer's generated types.\n * 2. Registering runtime plugins for Vue Intlayer and HTML lang management.\n * 3. Extending Vite configuration with Intlayer and Intlayer Proxy plugins.\n * 4. Extending Nuxt pages to support locale-aware routing based on the configuration.\n *\n * @example\n * ```ts\n * // nuxt.config.ts\n * export default defineNuxtConfig({\n * modules: ['nuxt-intlayer'],\n * });\n * ```\n */\nexport const module: NuxtModule = defineNuxtModule({\n meta: {\n name: 'nuxt-intlayer',\n },\n setup(_options, nuxt) {\n const configuration = getConfiguration();\n\n nuxt.options.typescript = nuxt.options.typescript || {};\n nuxt.options.typescript.tsConfig = nuxt.options.typescript.tsConfig || {};\n nuxt.options.typescript.tsConfig.include =\n nuxt.options.typescript.tsConfig.include || [];\n\n if (\n !nuxt.options.typescript.tsConfig.include.includes(\n '../.intlayer/types/**/*.ts'\n )\n ) {\n nuxt.options.typescript.tsConfig.include.push(\n '../.intlayer/types/**/*.ts'\n );\n }\n\n /**\n * -------------------------------------------------\n * RUNTIME PLUGIN REGISTRATION\n * -------------------------------------------------\n * Automatically install `vue-intlayer` on the client\n * so developers don't need to add the plugin manually\n * in every Nuxt project.\n */\n const resolver = createResolver(import.meta.url);\n\n addPlugin({\n src: resolver.resolve('./runtime/intlayer-plugin'),\n mode: 'all',\n });\n\n addPlugin({\n src: resolver.resolve('./runtime/html-lang'),\n mode: 'all',\n });\n\n // // Inject the intlayer middleware plugin into Nuxt's Vite config\n nuxt.hook('vite:extendConfig', (viteConfig, { isServer }) => {\n if (isServer) {\n // We only need the middleware on the server side during development\n // viteConfig.plugins can be undefined at this stage\n (viteConfig.plugins ?? []).push(intlayerProxy());\n }\n\n viteConfig.plugins?.push(intlayer());\n });\n\n // After setting up aliases, extend Nuxt pages with locale-aware routes\n nuxt.hook('pages:extend', (pages) => {\n const {\n internationalization: { locales, defaultLocale },\n routing: { mode },\n } = configuration;\n\n // Build a RegExp string with supported locales (e.g. \"en|fr|de\") to ensure the param only accepts known locales\n const filteredLocales = locales.filter((locale) => {\n const { localePrefix } = getPrefix(locale, {\n mode,\n defaultLocale,\n });\n return localePrefix !== undefined;\n });\n const localeGroupRegex = filteredLocales.map(String).join('|');\n\n // If no locales remain to prefix (e.g., only default locale and prefixDefault is false) skip extension\n if (!localeGroupRegex) return;\n\n // Clone the original page list to avoid infinite loops when pushing\n const originalPages = [...pages];\n\n for (const page of originalPages) {\n // Skip already localised routes (prevent double processing)\n if (page.path.startsWith('/:locale')) continue;\n\n // Determine the paths we need to add depending on prefixDefault flag\n // We always add the dynamic \":locale\" prefixed variant so that `/fr/about` works\n const dynPathPrefix = `/:locale(${localeGroupRegex})`;\n const isIndex = page.path === '/';\n const prefixedPath = isIndex\n ? `${dynPathPrefix}`\n : `${dynPathPrefix}${page.path}`;\n\n // If prefixDefault is false and this is the default locale, we keep the original\n // route (already in pages) and add the dynamic variant which will match non default\n // locales. When prefixDefault is true, we still keep the original route for SSR\n // convenience (middleware will redirect anyway) but also expose locale variants.\n\n // Create a shallow copy of the page with the new path\n pages.push({\n ...page,\n path: prefixedPath,\n name: page.name ? `${page.name}___i18n` : undefined,\n });\n }\n });\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,SAAqB,iBAAiB;CACjD,MAAM,EACJ,MAAM,
|
|
1
|
+
{"version":3,"file":"module.mjs","names":[],"sources":["../../src/module.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config/node';\nimport { getPrefix } from '@intlayer/core/localization';\nimport { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit';\nimport type { NuxtModule } from '@nuxt/schema';\nimport { intlayer, intlayerProxy } from 'vite-intlayer';\n\n/**\n * Nuxt module that integrates Intlayer into Nuxt applications.\n *\n * It handles:\n * 1. Configuring TypeScript to include Intlayer's generated types.\n * 2. Registering runtime plugins for Vue Intlayer and HTML lang management.\n * 3. Extending Vite configuration with Intlayer and Intlayer Proxy plugins.\n * 4. Extending Nuxt pages to support locale-aware routing based on the configuration.\n *\n * @example\n * ```ts\n * // nuxt.config.ts\n * export default defineNuxtConfig({\n * modules: ['nuxt-intlayer'],\n * });\n * ```\n */\nexport const module: NuxtModule = defineNuxtModule({\n meta: {\n name: 'nuxt-intlayer',\n },\n setup(_options, nuxt) {\n const configuration = getConfiguration();\n\n nuxt.options.typescript = nuxt.options.typescript || {};\n nuxt.options.typescript.tsConfig = nuxt.options.typescript.tsConfig || {};\n nuxt.options.typescript.tsConfig.include =\n nuxt.options.typescript.tsConfig.include || [];\n\n if (\n !nuxt.options.typescript.tsConfig.include.includes(\n '../.intlayer/types/**/*.ts'\n )\n ) {\n nuxt.options.typescript.tsConfig.include.push(\n '../.intlayer/types/**/*.ts'\n );\n }\n\n /**\n * -------------------------------------------------\n * RUNTIME PLUGIN REGISTRATION\n * -------------------------------------------------\n * Automatically install `vue-intlayer` on the client\n * so developers don't need to add the plugin manually\n * in every Nuxt project.\n */\n const resolver = createResolver(import.meta.url);\n\n addPlugin({\n src: resolver.resolve('./runtime/intlayer-plugin'),\n mode: 'all',\n });\n\n addPlugin({\n src: resolver.resolve('./runtime/html-lang'),\n mode: 'all',\n });\n\n // // Inject the intlayer middleware plugin into Nuxt's Vite config\n nuxt.hook('vite:extendConfig', (viteConfig, { isServer }) => {\n if (isServer) {\n // We only need the middleware on the server side during development\n // viteConfig.plugins can be undefined at this stage\n (viteConfig.plugins ?? []).push(intlayerProxy());\n }\n\n viteConfig.plugins?.push(intlayer());\n });\n\n // After setting up aliases, extend Nuxt pages with locale-aware routes\n nuxt.hook('pages:extend', (pages) => {\n const {\n internationalization: { locales, defaultLocale },\n routing: { mode },\n } = configuration;\n\n // Build a RegExp string with supported locales (e.g. \"en|fr|de\") to ensure the param only accepts known locales\n const filteredLocales = locales.filter((locale) => {\n const { localePrefix } = getPrefix(locale, {\n mode,\n defaultLocale,\n });\n return localePrefix !== undefined;\n });\n const localeGroupRegex = filteredLocales.map(String).join('|');\n\n // If no locales remain to prefix (e.g., only default locale and prefixDefault is false) skip extension\n if (!localeGroupRegex) return;\n\n // Clone the original page list to avoid infinite loops when pushing\n const originalPages = [...pages];\n\n for (const page of originalPages) {\n // Skip already localised routes (prevent double processing)\n if (page.path.startsWith('/:locale')) continue;\n\n // Determine the paths we need to add depending on prefixDefault flag\n // We always add the dynamic \":locale\" prefixed variant so that `/fr/about` works\n const dynPathPrefix = `/:locale(${localeGroupRegex})`;\n const isIndex = page.path === '/';\n const prefixedPath = isIndex\n ? `${dynPathPrefix}`\n : `${dynPathPrefix}${page.path}`;\n\n // If prefixDefault is false and this is the default locale, we keep the original\n // route (already in pages) and add the dynamic variant which will match non default\n // locales. When prefixDefault is true, we still keep the original route for SSR\n // convenience (middleware will redirect anyway) but also expose locale variants.\n\n // Create a shallow copy of the page with the new path\n pages.push({\n ...page,\n path: prefixedPath,\n name: page.name ? `${page.name}___i18n` : undefined,\n });\n }\n });\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,SAAqB,iBAAiB;CACjD,MAAM,EACJ,MAAM,gBACR;CACA,MAAM,UAAU,MAAM;EACpB,MAAM,gBAAgB,iBAAiB;EAEvC,KAAK,QAAQ,aAAa,KAAK,QAAQ,cAAc,CAAC;EACtD,KAAK,QAAQ,WAAW,WAAW,KAAK,QAAQ,WAAW,YAAY,CAAC;EACxE,KAAK,QAAQ,WAAW,SAAS,UAC/B,KAAK,QAAQ,WAAW,SAAS,WAAW,CAAC;EAE/C,IACE,CAAC,KAAK,QAAQ,WAAW,SAAS,QAAQ,SACxC,4BACF,GAEA,KAAK,QAAQ,WAAW,SAAS,QAAQ,KACvC,4BACF;;;;;;;;;EAWF,MAAM,WAAW,eAAe,OAAO,KAAK,GAAG;EAE/C,UAAU;GACR,KAAK,SAAS,QAAQ,2BAA2B;GACjD,MAAM;EACR,CAAC;EAED,UAAU;GACR,KAAK,SAAS,QAAQ,qBAAqB;GAC3C,MAAM;EACR,CAAC;EAGD,KAAK,KAAK,sBAAsB,YAAY,EAAE,eAAe;GAC3D,IAAI,UAGF,CAAC,WAAW,WAAW,CAAC,GAAG,KAAK,cAAc,CAAC;GAGjD,WAAW,SAAS,KAAK,SAAS,CAAC;EACrC,CAAC;EAGD,KAAK,KAAK,iBAAiB,UAAU;GACnC,MAAM,EACJ,sBAAsB,EAAE,SAAS,iBACjC,SAAS,EAAE,WACT;GAUJ,MAAM,mBAPkB,QAAQ,QAAQ,WAAW;IACjD,MAAM,EAAE,iBAAiB,UAAU,QAAQ;KACzC;KACA;IACF,CAAC;IACD,OAAO,iBAAiB;GAC1B,CACuC,EAAE,IAAI,MAAM,EAAE,KAAK,GAAG;GAG7D,IAAI,CAAC,kBAAkB;GAGvB,MAAM,gBAAgB,CAAC,GAAG,KAAK;GAE/B,KAAK,MAAM,QAAQ,eAAe;IAEhC,IAAI,KAAK,KAAK,WAAW,UAAU,GAAG;IAItC,MAAM,gBAAgB,YAAY,iBAAiB;IAEnD,MAAM,eADU,KAAK,SAAS,MAE1B,GAAG,kBACH,GAAG,gBAAgB,KAAK;IAQ5B,MAAM,KAAK;KACT,GAAG;KACH,MAAM;KACN,MAAM,KAAK,OAAO,GAAG,KAAK,KAAK,WAAW;IAC5C,CAAC;GACH;EACF,CAAC;CACH;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-lang.mjs","names":[],"sources":["../../../src/runtime/html-lang.ts"],"sourcesContent":["// @ts-nocheck -- Nuxt runtime types are provided at application level\n\nimport { getHTMLTextDir } from '@intlayer/core/localization';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { defineNuxtPlugin } from '#app';\nimport { useRoute } from '#imports';\n\nexport default defineNuxtPlugin((nuxtApp) => {\n nuxtApp.hook('page:finish', () => {\n const locale = useRoute().params.locale as Locale;\n document.documentElement.lang = locale;\n document.documentElement.dir = getHTMLTextDir(locale);\n });\n});\n"],"mappings":";;;;;AAOA,wBAAe,kBAAkB,YAAY;CAC3C,QAAQ,KAAK,qBAAqB;EAChC,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"html-lang.mjs","names":[],"sources":["../../../src/runtime/html-lang.ts"],"sourcesContent":["// @ts-nocheck -- Nuxt runtime types are provided at application level\n\nimport { getHTMLTextDir } from '@intlayer/core/localization';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { defineNuxtPlugin } from '#app';\nimport { useRoute } from '#imports';\n\nexport default defineNuxtPlugin((nuxtApp) => {\n nuxtApp.hook('page:finish', () => {\n const locale = useRoute().params.locale as Locale;\n document.documentElement.lang = locale;\n document.documentElement.dir = getHTMLTextDir(locale);\n });\n});\n"],"mappings":";;;;;AAOA,wBAAe,kBAAkB,YAAY;CAC3C,QAAQ,KAAK,qBAAqB;EAChC,MAAM,SAAS,SAAS,EAAE,OAAO;EACjC,SAAS,gBAAgB,OAAO;EAChC,SAAS,gBAAgB,MAAM,eAAe,MAAM;CACtD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intlayer-plugin.mjs","names":[],"sources":["../../../src/runtime/intlayer-plugin.ts"],"sourcesContent":["// @ts-nocheck -- Nuxt runtime types are provided at application level\n\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { createIntlayerClient, installIntlayer } from 'vue-intlayer';\nimport { defineNuxtPlugin } from '#app';\nimport { useRoute } from '#imports';\n\n/**\n * Nuxt client plugin injected by `nuxt-intlayer` module.\n * It installs the Intlayer Vue composables in the current Nuxt application and keeps\n * the active locale in sync with the current route (e.g. `/fr/about` → `fr`).\n */\nexport default defineNuxtPlugin((nuxtApp) => {\n /**\n * Register the Intlayer provider. We don't pass an explicit locale here so it\n * will fallback to the `defaultLocale` defined in the user configuration.\n * We will synchronise the active locale afterwards, once the current route\n * information is reliably available.\n */\n installIntlayer(nuxtApp.vueApp);\n\n // Obtain a reference to the singleton Intlayer client so we can update the\n // locale reactively whenever the route changes.\n const { setLocale } = createIntlayerClient();\n\n const route = useRoute();\n\n // Helper that applies the `:locale` route param (if any) to Intlayer.\n const syncLocale = () => {\n const localeParam = route.params.locale as Locale | undefined;\n if (localeParam) setLocale(localeParam);\n };\n\n // Initial sync (client & server) once the plugin is executed.\n syncLocale();\n\n // Keep Intlayer locale in sync on every navigation.\n nuxtApp.hook('page:start', () => {\n syncLocale();\n });\n});\n"],"mappings":";;;;;;;;;;AAYA,8BAAe,kBAAkB,YAAY;;;;;;;CAO3C,gBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"intlayer-plugin.mjs","names":[],"sources":["../../../src/runtime/intlayer-plugin.ts"],"sourcesContent":["// @ts-nocheck -- Nuxt runtime types are provided at application level\n\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { createIntlayerClient, installIntlayer } from 'vue-intlayer';\nimport { defineNuxtPlugin } from '#app';\nimport { useRoute } from '#imports';\n\n/**\n * Nuxt client plugin injected by `nuxt-intlayer` module.\n * It installs the Intlayer Vue composables in the current Nuxt application and keeps\n * the active locale in sync with the current route (e.g. `/fr/about` → `fr`).\n */\nexport default defineNuxtPlugin((nuxtApp) => {\n /**\n * Register the Intlayer provider. We don't pass an explicit locale here so it\n * will fallback to the `defaultLocale` defined in the user configuration.\n * We will synchronise the active locale afterwards, once the current route\n * information is reliably available.\n */\n installIntlayer(nuxtApp.vueApp);\n\n // Obtain a reference to the singleton Intlayer client so we can update the\n // locale reactively whenever the route changes.\n const { setLocale } = createIntlayerClient();\n\n const route = useRoute();\n\n // Helper that applies the `:locale` route param (if any) to Intlayer.\n const syncLocale = () => {\n const localeParam = route.params.locale as Locale | undefined;\n if (localeParam) setLocale(localeParam);\n };\n\n // Initial sync (client & server) once the plugin is executed.\n syncLocale();\n\n // Keep Intlayer locale in sync on every navigation.\n nuxtApp.hook('page:start', () => {\n syncLocale();\n });\n});\n"],"mappings":";;;;;;;;;;AAYA,8BAAe,kBAAkB,YAAY;;;;;;;CAO3C,gBAAgB,QAAQ,MAAM;CAI9B,MAAM,EAAE,cAAc,qBAAqB;CAE3C,MAAM,QAAQ,SAAS;CAGvB,MAAM,mBAAmB;EACvB,MAAM,cAAc,MAAM,OAAO;EACjC,IAAI,aAAa,UAAU,WAAW;CACxC;CAGA,WAAW;CAGX,QAAQ,KAAK,oBAAoB;EAC/B,WAAW;CACb,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","names":[],"sources":["../../src/module.ts"],"mappings":";;;;;AAuBA
|
|
1
|
+
{"version":3,"file":"module.d.ts","names":[],"sources":["../../src/module.ts"],"mappings":";;;;;AAuBA;;;;AAsGE;;;;;;;;;;;cAtGW,MAAA,EAAQ,UAsGnB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Nuxt applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@intlayer/config": "8.
|
|
81
|
-
"@intlayer/core": "8.
|
|
82
|
-
"@intlayer/types": "8.
|
|
83
|
-
"vite-intlayer": "8.
|
|
84
|
-
"vue-intlayer": "8.
|
|
80
|
+
"@intlayer/config": "8.10.0-canary.0",
|
|
81
|
+
"@intlayer/core": "8.10.0-canary.0",
|
|
82
|
+
"@intlayer/types": "8.10.0-canary.0",
|
|
83
|
+
"vite-intlayer": "8.10.0-canary.0",
|
|
84
|
+
"vue-intlayer": "8.10.0-canary.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
|
-
"@types/node": "25.
|
|
87
|
+
"@types/node": "25.9.0",
|
|
88
88
|
"@utils/ts-config": "1.0.4",
|
|
89
89
|
"@utils/ts-config-types": "1.0.4",
|
|
90
90
|
"@utils/tsdown-config": "1.0.4",
|