@i18n-micro/types-generator 1.0.0 → 1.1.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/nuxt.cjs +1 -1
- package/dist/nuxt.d.ts.map +1 -1
- package/dist/nuxt.mjs +12 -13
- package/package.json +10 -10
package/dist/nuxt.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@nuxt/kit"),c=require("./generator-D2pTueXl.cjs"),d=a.defineNuxtModule({meta:{name:"@i18n-micro/types-generator",configKey:"i18nTypes"},defaults:{translationDir:"locales"},async setup(o,t){const i=t.options.i18n,n=o.translationDir||i?.translationDir||"locales";a.addTypeTemplate({filename:"types/i18n-micro.d.ts",getContents:async()=>{try{return await c.getTypesString({srcDir:t.options.rootDir,translationDir:n})}catch(e){return console.warn("[i18n-types] Failed to generate types:",e),`// Failed to generate types: ${e instanceof Error?e.message:String(e)}`}}}),t.hook("builder:watch",async(e,s)=>{const r=s.replace(/\\/g,"/"),l=n.replace(/\\/g,"/");r.includes(l)&&r.endsWith(".json")&&await t.callHook("builder:generateApp")})}});exports.default=d;
|
package/dist/nuxt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;;AAED,
|
|
1
|
+
{"version":3,"file":"nuxt.d.ts","sourceRoot":"","sources":["../src/nuxt.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,yBAAyB;IACxC,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;;AAED,wBAkDE"}
|
package/dist/nuxt.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineNuxtModule as
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
1
|
+
import { defineNuxtModule as l, addTypeTemplate as c } from "@nuxt/kit";
|
|
2
|
+
import { a as p } from "./generator-D56a37C-.js";
|
|
3
|
+
const g = l({
|
|
4
4
|
meta: {
|
|
5
5
|
name: "@i18n-micro/types-generator",
|
|
6
6
|
configKey: "i18nTypes"
|
|
@@ -8,27 +8,26 @@ const u = p({
|
|
|
8
8
|
defaults: {
|
|
9
9
|
translationDir: "locales"
|
|
10
10
|
},
|
|
11
|
-
async setup(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
d({
|
|
11
|
+
async setup(r, t) {
|
|
12
|
+
const o = t.options.i18n, n = r.translationDir || o?.translationDir || "locales";
|
|
13
|
+
c({
|
|
15
14
|
filename: "types/i18n-micro.d.ts",
|
|
16
15
|
getContents: async () => {
|
|
17
16
|
try {
|
|
18
|
-
return await
|
|
17
|
+
return await p({
|
|
19
18
|
srcDir: t.options.rootDir,
|
|
20
|
-
translationDir:
|
|
19
|
+
translationDir: n
|
|
21
20
|
});
|
|
22
21
|
} catch (e) {
|
|
23
22
|
return console.warn("[i18n-types] Failed to generate types:", e), `// Failed to generate types: ${e instanceof Error ? e.message : String(e)}`;
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
|
-
}), t.hook("builder:watch", async (e,
|
|
27
|
-
const
|
|
28
|
-
|
|
25
|
+
}), t.hook("builder:watch", async (e, i) => {
|
|
26
|
+
const a = i.replace(/\\/g, "/"), s = n.replace(/\\/g, "/");
|
|
27
|
+
a.includes(s) && a.endsWith(".json") && await t.callHook("builder:generateApp");
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
});
|
|
32
31
|
export {
|
|
33
|
-
|
|
32
|
+
g as default
|
|
34
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@i18n-micro/types-generator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Type generator for i18n-micro translation keys",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
"url": "https://github.com/s00d/nuxt-i18n-micro"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"globby": "^14.
|
|
44
|
+
"globby": "^14.1.0",
|
|
45
45
|
"chokidar": "^3.6.0",
|
|
46
|
-
"unplugin": "^1.
|
|
46
|
+
"unplugin": "^1.16.1"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@nuxt/kit": "^3.0.0"
|
|
49
|
+
"@nuxt/kit": "^3.18.1 || ^4.0.0"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=18.17.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@types/node": "^20.
|
|
56
|
-
"vite": "^
|
|
57
|
-
"vite-plugin-dts": "^4.
|
|
58
|
-
"typescript": "^5.
|
|
55
|
+
"@types/node": "^20.19.26",
|
|
56
|
+
"vite": "^7.3.1",
|
|
57
|
+
"vite-plugin-dts": "^4.5.4",
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
59
|
"jest": "^29.7.0",
|
|
60
|
-
"ts-jest": "^29.
|
|
61
|
-
"@types/jest": "^29.5.
|
|
60
|
+
"ts-jest": "^29.4.6",
|
|
61
|
+
"@types/jest": "^29.5.14"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "vite build",
|