@jctrans-materials/nuxt 1.0.23 → 1.0.25

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/module.cjs CHANGED
@@ -26,10 +26,7 @@ const module$1 = kit.defineNuxtModule({
26
26
  }
27
27
  );
28
28
  if (options.addStyle) {
29
- const cssPath = await kit.resolvePath(
30
- "@jctrans-materials/comps-vue3/index.css"
31
- );
32
- nuxt.options.css.push(cssPath);
29
+ nuxt.options.css.push("@jctrans-materials/comps-vue3/index.css");
33
30
  }
34
31
  [
35
32
  "JcSearch",
@@ -59,6 +56,14 @@ const module$1 = kit.defineNuxtModule({
59
56
  // 生成在宿主 .nuxt/types 下的文件名,不重名即可
60
57
  src: resolve("./runtime/types.d.ts")
61
58
  });
59
+ kit.addRouteMiddleware({
60
+ name: "jctrans-global-auth",
61
+ // 中间件的唯一标识名称
62
+ path: resolve("./runtime/middleware/auth"),
63
+ // 指向源文件
64
+ global: true
65
+ // 强制设置为全局中间件
66
+ });
62
67
  }
63
68
  });
64
69
 
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "1.0.23",
7
+ "version": "1.0.25",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineNuxtModule, createResolver, resolvePath, addComponent, addPlugin, addTypeTemplate } from 'nuxt/kit';
1
+ import { defineNuxtModule, createResolver, addComponent, addPlugin, addTypeTemplate, addRouteMiddleware } from 'nuxt/kit';
2
2
  import { defu } from 'defu';
3
3
 
4
4
  const module$1 = defineNuxtModule({
@@ -23,10 +23,7 @@ const module$1 = defineNuxtModule({
23
23
  }
24
24
  );
25
25
  if (options.addStyle) {
26
- const cssPath = await resolvePath(
27
- "@jctrans-materials/comps-vue3/index.css"
28
- );
29
- nuxt.options.css.push(cssPath);
26
+ nuxt.options.css.push("@jctrans-materials/comps-vue3/index.css");
30
27
  }
31
28
  [
32
29
  "JcSearch",
@@ -56,6 +53,14 @@ const module$1 = defineNuxtModule({
56
53
  // 生成在宿主 .nuxt/types 下的文件名,不重名即可
57
54
  src: resolve("./runtime/types.d.ts")
58
55
  });
56
+ addRouteMiddleware({
57
+ name: "jctrans-global-auth",
58
+ // 中间件的唯一标识名称
59
+ path: resolve("./runtime/middleware/auth"),
60
+ // 指向源文件
61
+ global: true
62
+ // 强制设置为全局中间件
63
+ });
59
64
  }
60
65
  });
61
66
 
@@ -0,0 +1,2 @@
1
+ declare const _default: import("#app").RouteMiddleware;
2
+ export default _default;
@@ -0,0 +1,4 @@
1
+ import { defineNuxtRouteMiddleware } from "#app";
2
+ export default defineNuxtRouteMiddleware((to, from) => {
3
+ console.log("\u5168\u5C40\u4E2D\u95F4\u4EF6\u8FD0\u884C\u4E2D...");
4
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jctrans-materials/nuxt",
3
3
  "type": "module",
4
- "version": "1.0.23",
4
+ "version": "1.0.25",
5
5
  "description": "Nuxt module for JCtrans UI components",
6
6
  "exports": {
7
7
  ".": {
@@ -22,11 +22,11 @@
22
22
  "nuxt": "^3.0.0",
23
23
  "vue": "^3.5.26",
24
24
  "vue-router": "^4.6.4",
25
- "@jctrans-materials/comps-vue3": "1.0.23"
25
+ "@jctrans-materials/comps-vue3": "1.0.25"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "nuxt": "^3.0.0",
29
- "@jctrans-materials/comps-vue3": "1.0.23"
29
+ "@jctrans-materials/comps-vue3": "1.0.25"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@nuxt/module-builder": "latest",