nuxt-i18n-micro 1.19.0 → 1.19.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.
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CnNUpwZL.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BKcmVa-6.js">
11
- <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727275888771,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"b8eb231b-8168-4246-ad06-5549b1d35f8d",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727301063290,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"74119d58-be1e-4be5-a7fe-d3487dd8d646",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CnNUpwZL.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BKcmVa-6.js">
11
- <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727275888772,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"b8eb231b-8168-4246-ad06-5549b1d35f8d",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727301063291,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"74119d58-be1e-4be5-a7fe-d3487dd8d646",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"b8eb231b-8168-4246-ad06-5549b1d35f8d","timestamp":1727275878351}
1
+ {"id":"74119d58-be1e-4be5-a7fe-d3487dd8d646","timestamp":1727301052646}
@@ -0,0 +1 @@
1
+ {"id":"74119d58-be1e-4be5-a7fe-d3487dd8d646","timestamp":1727301052646,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -8,5 +8,5 @@
8
8
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/CnNUpwZL.js">
9
9
  <link rel="prefetch" as="style" crossorigin href="/__nuxt-i18n-micro/_nuxt/error-500.CBAEdpZV.css">
10
10
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-i18n-micro/_nuxt/BKcmVa-6.js">
11
- <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727275888772,false]</script>
12
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"b8eb231b-8168-4246-ad06-5549b1d35f8d",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
11
+ <script type="module" src="/__nuxt-i18n-micro/_nuxt/CeFL7aT9.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1727301063291,false]</script>
12
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-i18n-micro",buildId:"74119d58-be1e-4be5-a7fe-d3487dd8d646",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
3
  "configKey": "i18n",
4
- "version": "1.19.0",
4
+ "version": "1.19.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -88,11 +88,21 @@ function setupDevToolsUI(options, resolve) {
88
88
  });
89
89
  }
90
90
 
91
+ function normalizeLocales(localesArray) {
92
+ const localesObject = {};
93
+ for (const locale of localesArray) {
94
+ localesObject[locale] = {};
95
+ }
96
+ return localesObject;
97
+ }
91
98
  function extractDefineI18nRouteConfig(content, filePath) {
92
99
  const match = content.match(/^[ \t]*\$defineI18nRoute\((\{[\s\S]*?\})\)/m);
93
100
  if (match && match[1]) {
94
101
  try {
95
102
  const parsedObject = Function('"use strict";return (' + match[1] + ")")();
103
+ if (parsedObject.locales && Array.isArray(parsedObject.locales)) {
104
+ parsedObject.locales = normalizeLocales(parsedObject.locales);
105
+ }
96
106
  if (validateDefineI18nRouteConfig(parsedObject)) {
97
107
  return parsedObject;
98
108
  } else {
@@ -504,7 +514,7 @@ const module = defineNuxtModule({
504
514
  logger.log("\u21BB update store item: " + path2);
505
515
  nuxt.callHook("restart");
506
516
  };
507
- const watcher = watch(translationPath, { depth: 1, persistent: true }).on("change", watcherEvent);
517
+ const watcher = watch(translationPath, { depth: 2, persistent: true }).on("change", watcherEvent);
508
518
  nuxt.hook("close", () => {
509
519
  watcher.close();
510
520
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "description": "Nuxt I18n Micro is a lightweight, high-performance internationalization module for Nuxt, designed to handle multi-language support with minimal overhead, fast build times, and efficient runtime performance.",
5
5
  "repository": "s00d/nuxt-i18n-micro",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"id":"b8eb231b-8168-4246-ad06-5549b1d35f8d","timestamp":1727275878351,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}