nuxt-i18n-micro 2.15.0 → 2.15.1

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.
@@ -7,5 +7,5 @@
7
7
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CaEXoJJV.js">
8
8
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DqTJYfAv.css">
9
9
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CF4LIYi0.js">
10
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765188916029,false]</script>
11
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"36729240-903e-4958-ba5a-dcf36e9686ab",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
10
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765190870686,false]</script>
11
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"d58d7411-6eae-4a0c-9c8e-39409cbca715",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -7,5 +7,5 @@
7
7
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CaEXoJJV.js">
8
8
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DqTJYfAv.css">
9
9
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CF4LIYi0.js">
10
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765188916030,false]</script>
11
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"36729240-903e-4958-ba5a-dcf36e9686ab",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
10
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765190870687,false]</script>
11
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"d58d7411-6eae-4a0c-9c8e-39409cbca715",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
@@ -1 +1 @@
1
- {"id":"36729240-903e-4958-ba5a-dcf36e9686ab","timestamp":1765188912798}
1
+ {"id":"d58d7411-6eae-4a0c-9c8e-39409cbca715","timestamp":1765190867728}
@@ -0,0 +1 @@
1
+ {"id":"d58d7411-6eae-4a0c-9c8e-39409cbca715","timestamp":1765190867728,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -1 +1 @@
1
- {"id":"dev","timestamp":1765188914646,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
1
+ {"id":"dev","timestamp":1765190869473,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -7,5 +7,5 @@
7
7
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CaEXoJJV.js">
8
8
  <link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/error-500.DqTJYfAv.css">
9
9
  <link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/CF4LIYi0.js">
10
- <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765188916030,false]</script>
11
- <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"36729240-903e-4958-ba5a-dcf36e9686ab",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
10
+ <script type="module" src="/__NUXT_DEVTOOLS_I18N_BASE__/_nuxt/DS5b1XNW.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},1765190870687,false]</script>
11
+ <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_I18N_BASE__/",buildId:"d58d7411-6eae-4a0c-9c8e-39409cbca715",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": "2.15.0",
4
+ "version": "2.15.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -5,14 +5,13 @@ import { useNuxt, defineNuxtModule, useLogger, createResolver, addTemplate, addI
5
5
  import { isPrefixAndDefaultStrategy, isPrefixStrategy, isNoPrefixStrategy, isPrefixExceptDefaultStrategy, defaultPlural, withPrefixStrategy } from '@i18n-micro/core';
6
6
  import { fileURLToPath } from 'node:url';
7
7
  import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
8
- import sirv from 'sirv';
9
8
  import { isInternalPath } from '../dist/runtime/utils/path-utils.js';
10
9
  import { globby } from 'globby';
11
10
 
12
11
  const DEVTOOLS_UI_PORT = 3030;
13
12
  const DEVTOOLS_UI_ROUTE = "/__nuxt-i18n-micro";
14
13
  const distDir = resolve(fileURLToPath(import.meta.url), "..");
15
- const clientDir = resolve(distDir, "client");
14
+ resolve(distDir, "client");
16
15
  function setupDevToolsUI(options, resolve2) {
17
16
  const nuxt = useNuxt();
18
17
  const clientPath = resolve2("./client");
@@ -21,45 +20,20 @@ function setupDevToolsUI(options, resolve2) {
21
20
  const ROUTE_PATH = `${nuxt.options.app.baseURL || "/"}/__nuxt-i18n-micro`.replace(/\/+/g, "/");
22
21
  const ROUTE_CLIENT = `${ROUTE_PATH}/client`;
23
22
  if (clientDirExists) {
24
- nuxt.hook("vite:serverCreated", (server) => {
25
- const actualClientDir = fs.existsSync(clientDir) ? clientDir : devtoolsUiDistPath;
26
- const indexHtmlPath = path.join(actualClientDir, "index.html");
27
- if (!fs.existsSync(indexHtmlPath)) {
28
- return;
29
- }
30
- const indexContent = fs.readFileSync(indexHtmlPath);
31
- const handleStatic = sirv(actualClientDir, {
32
- dev: true,
33
- single: false
34
- });
35
- const handleIndex = async (res) => {
36
- res.setHeader("Content-Type", "text/html");
37
- res.statusCode = 200;
38
- res.write((await indexContent).toString().replace(/\/__NUXT_DEVTOOLS_I18N_BASE__\//g, `${ROUTE_CLIENT}/`));
39
- res.end();
40
- };
41
- server.middlewares.use(ROUTE_CLIENT, (req, res) => {
42
- if (req.url === "/")
43
- return handleIndex(res);
44
- return handleStatic(req, res, () => handleIndex(res));
45
- });
46
- });
47
23
  nuxt.hook("vite:extendConfig", (config) => {
48
24
  config.server = config.server || {};
49
25
  config.server.proxy = config.server.proxy || {};
50
26
  const proxyConfig = {
51
- target: "http://localhost:5173",
27
+ target: `http://localhost:${DEVTOOLS_UI_PORT}`,
52
28
  changeOrigin: true,
53
29
  ws: true,
54
30
  // Enable WebSocket proxying for HMR
55
- rewrite: (path2) => {
56
- return path2.replace(ROUTE_CLIENT, "");
57
- }
31
+ // Don't rewrite - keep the full path since client server expects /__nuxt-i18n-micro/client/*
32
+ rewrite: (path2) => path2
58
33
  };
59
- const proxyPath = `${ROUTE_CLIENT}/_nuxt`;
60
- config.server.proxy[proxyPath] = proxyConfig;
61
- config.server.proxy[`${proxyPath}/`] = proxyConfig;
62
- config.server.proxy[`${proxyPath}/*`] = proxyConfig;
34
+ config.server.proxy[`${ROUTE_CLIENT}`] = proxyConfig;
35
+ config.server.proxy[`${ROUTE_CLIENT}/`] = proxyConfig;
36
+ config.server.proxy[`${ROUTE_CLIENT}/*`] = proxyConfig;
63
37
  });
64
38
  } else {
65
39
  nuxt.hook("vite:extendConfig", (config) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-i18n-micro",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
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",
@@ -59,7 +59,6 @@
59
59
  "@nuxt/kit": "^3.18.1 || ^4.0.0",
60
60
  "chokidar": "^3.6.0",
61
61
  "globby": "^14.1.0",
62
- "sirv": "^2.0.4",
63
62
  "ufo": "^1.5.4",
64
63
  "@i18n-micro/core": "1.0.27",
65
64
  "@i18n-micro/test-utils": "1.0.7",
@@ -1 +0,0 @@
1
- {"id":"36729240-903e-4958-ba5a-dcf36e9686ab","timestamp":1765188912798,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}