@shwfed/config 1.0.1 → 1.1.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/README.md CHANGED
@@ -11,6 +11,7 @@
11
11
  - [VueUse](https://vueuse.org)
12
12
  - [shadcn-vue](https://www.shadcn-vue.com)
13
13
  - [Vue](https://vuejs.org)
14
+ - [Unovis](https://unovis.dev)
14
15
 
15
16
  ## 目录结构
16
17
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "shwfed",
3
3
  "configKey": "shwfed",
4
- "version": "1.0.1",
4
+ "version": "1.1.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,8 +1,49 @@
1
+ import { readdirSync } from 'node:fs';
1
2
  import { defineNuxtModule, createResolver, addVitePlugin, extendViteConfig, addPlugin, addRouteMiddleware, addComponent, addImports } from '@nuxt/kit';
2
3
  import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
3
4
  import TailwindCSS from '@tailwindcss/vite';
4
5
  import { defu } from 'defu';
5
6
 
7
+ const EXPOSED_UI_FOLDERS = [
8
+ "alert-dialog",
9
+ "badge",
10
+ "breadcrumb",
11
+ "button",
12
+ "button-group",
13
+ "calendar",
14
+ "checkbox",
15
+ "collapsible",
16
+ "color-picker",
17
+ "command",
18
+ "context-menu",
19
+ "date-picker",
20
+ "date-range-picker",
21
+ "dialog",
22
+ "drawer",
23
+ "dropdown-menu",
24
+ "field",
25
+ "input",
26
+ "input-group",
27
+ "label",
28
+ "markdown",
29
+ "native-select",
30
+ "navigation-menu",
31
+ "number-field",
32
+ "popover",
33
+ "range-calendar",
34
+ "scroll-area",
35
+ "select",
36
+ "separator",
37
+ "sheet",
38
+ "sidebar",
39
+ "skeleton",
40
+ "switch",
41
+ "tabs",
42
+ "textarea",
43
+ "toggle",
44
+ "toggle-group",
45
+ "tooltip"
46
+ ];
6
47
  const module$1 = defineNuxtModule({
7
48
  meta: {
8
49
  name: "shwfed",
@@ -104,6 +145,17 @@ const module$1 = defineNuxtModule({
104
145
  name: "ShwfedConfig",
105
146
  filePath: resolver.resolve("./runtime/components/config/index.vue")
106
147
  });
148
+ for (const folder of EXPOSED_UI_FOLDERS) {
149
+ const folderPath = resolver.resolve(`./runtime/components/ui/${folder}`);
150
+ for (const file of readdirSync(folderPath)) {
151
+ if (!file.endsWith(".vue")) continue;
152
+ const baseName = file.slice(0, -".vue".length);
153
+ addComponent({
154
+ name: `ShwfedUi${baseName}`,
155
+ filePath: `${folderPath}/${file}`
156
+ });
157
+ }
158
+ }
107
159
  addImports([
108
160
  { name: "provideCELContext", from: resolver.resolve("./runtime/plugins/cel/context") },
109
161
  { name: "openModal", from: resolver.resolve("./runtime/composables/useOverlay") },
@@ -13,7 +13,7 @@ export default defineNuxtRouteMiddleware((to, from) => {
13
13
  if (!value || Array.isArray(value)) return;
14
14
  if (import.meta.client) {
15
15
  const config = useRuntimeConfig().public.shwfed;
16
- localStorage.setItem(config.ci.job, value);
16
+ localStorage.setItem(config.ci.job || "token", value);
17
17
  }
18
18
  const { [matchedKey]: _, ...remainingQuery } = to.query;
19
19
  return navigateTo({ ...to, query: remainingQuery }, { replace: true });
@@ -2,6 +2,7 @@ import type { HttpRequestBuilder } from './plugins/http/builder'
2
2
  import type { Effect, Either } from 'effect'
3
3
  import type { toast } from 'vue-sonner'
4
4
  import type { ParseError, TypeError, EvaluationError } from './vendor/cel-js/lib/errors'
5
+ import type { Ai } from './plugins/ai'
5
6
 
6
7
  interface HttpService {
7
8
  get: (endpoint: string) => HttpRequestBuilder
@@ -17,6 +18,7 @@ declare module '#app' {
17
18
  $cel: <T>(expression: string, context?: Record<string, unknown>) => Effect.Effect<T, ParseError | TypeError | EvaluationError>
18
19
  $celCheck: (expression: string) => Either.Either<string, ParseError | TypeError>
19
20
  $toast: typeof toast
21
+ $ai: Ai
20
22
  }
21
23
  }
22
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shwfed/config",
3
- "version": "1.0.1",
3
+ "version": "1.1.1",
4
4
  "description": "Configurable UI for SHWFED",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -89,6 +89,7 @@
89
89
  "typescript": "~6.0.3",
90
90
  "vitest": "^4.1.6",
91
91
  "vue": "^3.5.34",
92
+ "vue-router": "^5.0.7",
92
93
  "vue-tsc": "^3.2.8"
93
94
  },
94
95
  "lint-staged": {