@i18n-micro/types-generator 1.0.0 → 1.0.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.
package/dist/nuxt.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("@nuxt/kit"),p=require("./generator-D2pTueXl.cjs"),u=s.defineNuxtModule({meta:{name:"@i18n-micro/types-generator",configKey:"i18nTypes"},defaults:{translationDir:"locales"},async setup(l,t){var o;const n=(o=t.options.runtimeConfig)==null?void 0:o.public,r=n==null?void 0:n.i18nConfig,a=l.translationDir||(r==null?void 0:r.translationDir)||"locales";s.addTypeTemplate({filename:"types/i18n-micro.d.ts",getContents:async()=>{try{return await p.getTypesString({srcDir:t.options.rootDir,translationDir:a})}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,c)=>{const i=c.replace(/\\/g,"/"),d=a.replace(/\\/g,"/");i.includes(d)&&i.endsWith(".json")&&await t.callHook("builder:generateApp")})}});exports.default=u;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@nuxt/kit"),c=require("./generator-D2pTueXl.cjs"),u=r.defineNuxtModule({meta:{name:"@i18n-micro/types-generator",configKey:"i18nTypes"},defaults:{translationDir:"locales"},async setup(o,t){const a=t.options.runtimeConfig?.public?.i18nConfig,n=o.translationDir||a?.translationDir||"locales";r.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 i=s.replace(/\\/g,"/"),l=n.replace(/\\/g,"/");i.includes(l)&&i.endsWith(".json")&&await t.callHook("builder:generateApp")})}});exports.default=u;
package/dist/nuxt.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { defineNuxtModule as p, addTypeTemplate as d } from "@nuxt/kit";
2
- import { a as m } from "./generator-D56a37C-.js";
3
- const u = p({
1
+ import { defineNuxtModule as l, addTypeTemplate as c } from "@nuxt/kit";
2
+ import { a as p } from "./generator-D56a37C-.js";
3
+ const u = l({
4
4
  meta: {
5
5
  name: "@i18n-micro/types-generator",
6
6
  configKey: "i18nTypes"
@@ -8,24 +8,23 @@ const u = p({
8
8
  defaults: {
9
9
  translationDir: "locales"
10
10
  },
11
- async setup(s, t) {
12
- var o;
13
- const n = (o = t.options.runtimeConfig) == null ? void 0 : o.public, a = n == null ? void 0 : n.i18nConfig, r = s.translationDir || (a == null ? void 0 : a.translationDir) || "locales";
14
- d({
11
+ async setup(o, n) {
12
+ const r = n.options.runtimeConfig?.public?.i18nConfig, t = o.translationDir || r?.translationDir || "locales";
13
+ c({
15
14
  filename: "types/i18n-micro.d.ts",
16
15
  getContents: async () => {
17
16
  try {
18
- return await m({
19
- srcDir: t.options.rootDir,
20
- translationDir: r
17
+ return await p({
18
+ srcDir: n.options.rootDir,
19
+ translationDir: t
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, l) => {
27
- const i = l.replace(/\\/g, "/"), c = r.replace(/\\/g, "/");
28
- i.includes(c) && i.endsWith(".json") && await t.callHook("builder:generateApp");
25
+ }), n.hook("builder:watch", async (e, a) => {
26
+ const i = a.replace(/\\/g, "/"), s = t.replace(/\\/g, "/");
27
+ i.includes(s) && i.endsWith(".json") && await n.callHook("builder:generateApp");
29
28
  });
30
29
  }
31
30
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i18n-micro/types-generator",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Type generator for i18n-micro translation keys",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -41,9 +41,9 @@
41
41
  "url": "https://github.com/s00d/nuxt-i18n-micro"
42
42
  },
43
43
  "dependencies": {
44
- "globby": "^14.0.0",
44
+ "globby": "^14.1.0",
45
45
  "chokidar": "^3.6.0",
46
- "unplugin": "^1.0.0"
46
+ "unplugin": "^1.16.1"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@nuxt/kit": "^3.0.0"
@@ -52,13 +52,13 @@
52
52
  "node": ">=18.17.0"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "^20.17.10",
56
- "vite": "^5.0.0",
57
- "vite-plugin-dts": "^4.3.0",
58
- "typescript": "^5.0.0",
55
+ "@types/node": "^20.19.26",
56
+ "vite": "^7.2.7",
57
+ "vite-plugin-dts": "^4.5.4",
58
+ "typescript": "^5.9.3",
59
59
  "jest": "^29.7.0",
60
- "ts-jest": "^29.1.2",
61
- "@types/jest": "^29.5.0"
60
+ "ts-jest": "^29.4.6",
61
+ "@types/jest": "^29.5.14"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "vite build",