@byyuurin/ui 0.0.11 → 0.2.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/README.md +170 -58
- package/dist/module.d.mts +4 -13
- package/dist/module.json +4 -4
- package/dist/module.mjs +54 -20
- package/dist/runtime/components/Accordion.vue +28 -23
- package/dist/runtime/components/Accordion.vue.d.ts +51 -29
- package/dist/runtime/components/Alert.vue +47 -27
- package/dist/runtime/components/Alert.vue.d.ts +37 -25
- package/dist/runtime/components/App.vue +9 -8
- package/dist/runtime/components/App.vue.d.ts +22 -20
- package/dist/runtime/components/Avatar.vue +65 -21
- package/dist/runtime/components/Avatar.vue.d.ts +27 -13
- package/dist/runtime/components/AvatarGroup.vue +14 -10
- package/dist/runtime/components/AvatarGroup.vue.d.ts +12 -9
- package/dist/runtime/components/Badge.vue +64 -32
- package/dist/runtime/components/Badge.vue.d.ts +30 -29
- package/dist/runtime/components/Breadcrumb.vue +40 -22
- package/dist/runtime/components/Breadcrumb.vue.d.ts +48 -21
- package/dist/runtime/components/Button.vue +113 -52
- package/dist/runtime/components/Button.vue.d.ts +36 -20
- package/dist/runtime/components/Calendar.vue +50 -43
- package/dist/runtime/components/Calendar.vue.d.ts +58 -31
- package/dist/runtime/components/Card.vue +18 -14
- package/dist/runtime/components/Card.vue.d.ts +18 -14
- package/dist/runtime/components/Carousel.vue +99 -46
- package/dist/runtime/components/Carousel.vue.d.ts +46 -25
- package/dist/runtime/components/Checkbox.vue +60 -35
- package/dist/runtime/components/Checkbox.vue.d.ts +35 -28
- package/dist/runtime/components/CheckboxGroup.vue +131 -0
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +89 -0
- package/dist/runtime/components/Chip.vue +35 -32
- package/dist/runtime/components/Chip.vue.d.ts +33 -15
- package/dist/runtime/components/Collapsible.vue +13 -9
- package/dist/runtime/components/Collapsible.vue.d.ts +16 -8
- package/dist/runtime/components/Drawer.vue +80 -70
- package/dist/runtime/components/Drawer.vue.d.ts +51 -28
- package/dist/runtime/components/DropdownMenu.vue +23 -16
- package/dist/runtime/components/DropdownMenu.vue.d.ts +77 -36
- package/dist/runtime/components/DropdownMenuContent.vue +136 -106
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +38 -26
- package/dist/runtime/components/FieldGroup.vue +33 -0
- package/dist/runtime/components/FieldGroup.vue.d.ts +33 -0
- package/dist/runtime/components/Form.vue +172 -88
- package/dist/runtime/components/Form.vue.d.ts +69 -44
- package/dist/runtime/components/FormField.vue +108 -0
- package/dist/runtime/components/FormField.vue.d.ts +63 -0
- package/dist/runtime/components/Icon.vue +20 -0
- package/dist/runtime/components/Icon.vue.d.ts +9 -0
- package/dist/runtime/components/Input.vue +84 -79
- package/dist/runtime/components/Input.vue.d.ts +55 -43
- package/dist/runtime/components/InputNumber.vue +66 -52
- package/dist/runtime/components/InputNumber.vue.d.ts +50 -109
- package/dist/runtime/components/InputTags.vue +155 -0
- package/dist/runtime/components/InputTags.vue.d.ts +85 -0
- package/dist/runtime/components/Kbd.vue +11 -5
- package/dist/runtime/components/Kbd.vue.d.ts +17 -11
- package/dist/runtime/components/Link.vue +54 -197
- package/dist/runtime/components/Link.vue.d.ts +17 -17
- package/dist/runtime/components/LinkBase.vue +11 -33
- package/dist/runtime/components/LinkBase.vue.d.ts +8 -3
- package/dist/runtime/components/Marquee.vue +38 -0
- package/dist/runtime/components/Marquee.vue.d.ts +54 -0
- package/dist/runtime/components/Modal.vue +53 -39
- package/dist/runtime/components/Modal.vue.d.ts +64 -34
- package/dist/runtime/components/NavigationMenu.vue +345 -0
- package/dist/runtime/components/NavigationMenu.vue.d.ts +216 -0
- package/dist/runtime/components/OverlayProvider.vue +3 -3
- package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -1
- package/dist/runtime/components/Pagination.vue +39 -47
- package/dist/runtime/components/Pagination.vue.d.ts +54 -31
- package/dist/runtime/components/PinInput.vue +46 -32
- package/dist/runtime/components/PinInput.vue.d.ts +40 -21
- package/dist/runtime/components/Popover.vue +33 -19
- package/dist/runtime/components/Popover.vue.d.ts +57 -32
- package/dist/runtime/components/Progress.vue +31 -26
- package/dist/runtime/components/Progress.vue.d.ts +32 -23
- package/dist/runtime/components/RadioGroup.vue +75 -48
- package/dist/runtime/components/RadioGroup.vue.d.ts +58 -36
- package/dist/runtime/components/ScrollArea.vue +33 -31
- package/dist/runtime/components/ScrollArea.vue.d.ts +9 -5
- package/dist/runtime/components/Select.vue +166 -76
- package/dist/runtime/components/Select.vue.d.ts +206 -65
- package/dist/runtime/components/Separator.vue +42 -16
- package/dist/runtime/components/Separator.vue.d.ts +35 -14
- package/dist/runtime/components/Skeleton.vue +18 -6
- package/dist/runtime/components/Skeleton.vue.d.ts +4 -4
- package/dist/runtime/components/Slider.vue +42 -24
- package/dist/runtime/components/Slider.vue.d.ts +43 -27
- package/dist/runtime/components/Switch.vue +40 -31
- package/dist/runtime/components/Switch.vue.d.ts +36 -27
- package/dist/runtime/components/Table.vue +329 -79
- package/dist/runtime/components/Table.vue.d.ts +152 -66
- package/dist/runtime/components/Tabs.vue +70 -23
- package/dist/runtime/components/Tabs.vue.d.ts +61 -29
- package/dist/runtime/components/Textarea.vue +102 -54
- package/dist/runtime/components/Textarea.vue.d.ts +57 -41
- package/dist/runtime/components/Timeline.vue +102 -0
- package/dist/runtime/components/Timeline.vue.d.ts +74 -0
- package/dist/runtime/components/Toast.vue +84 -38
- package/dist/runtime/components/Toast.vue.d.ts +48 -27
- package/dist/runtime/components/ToastProvider.vue +31 -22
- package/dist/runtime/components/ToastProvider.vue.d.ts +30 -17
- package/dist/runtime/components/Tooltip.vue +33 -21
- package/dist/runtime/components/Tooltip.vue.d.ts +37 -15
- package/dist/runtime/composables/defineShortcuts.d.ts +16 -0
- package/dist/runtime/composables/defineShortcuts.js +129 -0
- package/dist/runtime/composables/useAvatarGroup.d.ts +8 -3
- package/dist/runtime/composables/useAvatarGroup.js +10 -3
- package/dist/runtime/composables/useComponentIcons.d.ts +9 -6
- package/dist/runtime/composables/useComponentIcons.js +4 -4
- package/dist/runtime/composables/useFieldGroup.d.ts +8 -0
- package/dist/runtime/composables/useFieldGroup.js +14 -0
- package/dist/runtime/composables/useFormField.d.ts +62 -0
- package/dist/runtime/composables/useFormField.js +99 -0
- package/dist/runtime/composables/useKbd.d.ts +3 -2
- package/dist/runtime/composables/useKbd.js +3 -2
- package/dist/runtime/composables/useLocale.d.ts +68 -5
- package/dist/runtime/composables/useLocale.js +11 -11
- package/dist/runtime/composables/useOverlay.d.ts +51 -15
- package/dist/runtime/composables/useOverlay.js +44 -30
- package/dist/runtime/composables/usePortal.d.ts +6 -0
- package/dist/runtime/composables/usePortal.js +17 -0
- package/dist/runtime/composables/useToast.d.ts +12 -5
- package/dist/runtime/composables/useToast.js +12 -7
- package/dist/runtime/locale/en.d.ts +30 -1
- package/dist/runtime/locale/en.js +2 -1
- package/dist/runtime/locale/index.d.ts +2 -2
- package/dist/runtime/locale/index.js +1 -1
- package/dist/runtime/locale/zh_tw.d.ts +31 -0
- package/dist/runtime/locale/{zh-tw.js → zh_tw.js} +2 -1
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/colors.js +50 -0
- package/dist/runtime/types/app.config.d.ts +6 -0
- package/dist/runtime/types/form.d.ts +58 -17
- package/dist/runtime/types/form.js +11 -0
- package/dist/runtime/types/index.d.ts +56 -8
- package/dist/runtime/types/index.js +49 -1
- package/dist/runtime/types/input.d.ts +8 -0
- package/dist/runtime/types/locale.d.ts +5 -0
- package/dist/runtime/types/style.d.ts +33 -0
- package/dist/runtime/types/style.js +0 -0
- package/dist/runtime/types/unocss.d.ts +4 -0
- package/dist/runtime/types/utils.d.ts +41 -37
- package/dist/runtime/utils/form.d.ts +5 -1
- package/dist/runtime/utils/form.js +49 -0
- package/dist/runtime/utils/index.d.ts +10 -13
- package/dist/runtime/utils/index.js +41 -48
- package/dist/runtime/utils/link.d.ts +3 -2
- package/dist/runtime/utils/link.js +16 -2
- package/dist/runtime/utils/locale.d.ts +5 -0
- package/dist/runtime/utils/locale.js +10 -0
- package/dist/runtime/utils/style.d.ts +94 -0
- package/dist/runtime/utils/style.js +37 -0
- package/dist/runtime/vue/components/Icon.vue +15 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +7 -0
- package/dist/runtime/vue/components/Link.vue +163 -0
- package/dist/runtime/vue/components/Link.vue.d.ts +95 -0
- package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
- package/dist/runtime/vue/composables/useAppConfig.js +4 -0
- package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
- package/dist/runtime/vue/plugins/color-mode.js +6 -0
- package/dist/runtime/vue/plugins/head.d.ts +4 -0
- package/dist/runtime/vue/plugins/head.js +9 -0
- package/dist/runtime/vue/stubs.d.ts +16 -1
- package/dist/runtime/vue/stubs.js +32 -1
- package/dist/setup.d.mts +13 -0
- package/dist/setup.mjs +12 -0
- package/dist/shared/ui.CzIlLITK.mjs +51 -0
- package/dist/shared/ui.DLOxhmP0.mjs +4242 -0
- package/dist/shared/ui.DpbffTXs.d.mts +84 -0
- package/dist/shared/ui.IulR-OYx.d.mts +64 -0
- package/dist/types.d.mts +3 -1
- package/dist/unocss.d.mts +12 -52
- package/dist/unocss.mjs +144 -254
- package/dist/unplugin.d.mts +13 -26
- package/dist/unplugin.mjs +193 -18
- package/dist/vite.d.mts +10 -1
- package/dist/vite.mjs +12 -3
- package/package.json +154 -87
- package/vue-plugin.d.ts +5 -0
- package/dist/module.d.ts +0 -13
- package/dist/module.mjs.map +0 -1
- package/dist/runtime/app/injections.d.ts +0 -9331
- package/dist/runtime/app/injections.js +0 -61
- package/dist/runtime/components/ButtonGroup.vue +0 -26
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -26
- package/dist/runtime/components/FormItem.vue +0 -90
- package/dist/runtime/components/FormItem.vue.d.ts +0 -60
- package/dist/runtime/composables/useButtonGroup.d.ts +0 -5
- package/dist/runtime/composables/useButtonGroup.js +0 -9
- package/dist/runtime/composables/useFormItem.d.ts +0 -27
- package/dist/runtime/composables/useFormItem.js +0 -64
- package/dist/runtime/composables/useTheme.d.ts +0 -9
- package/dist/runtime/composables/useTheme.js +0 -23
- package/dist/runtime/index.d.ts +0 -44
- package/dist/runtime/index.js +0 -44
- package/dist/runtime/locale/zh-tw.d.ts +0 -2
- package/dist/runtime/theme/accordion.d.ts +0 -50
- package/dist/runtime/theme/accordion.js +0 -28
- package/dist/runtime/theme/alert.d.ts +0 -119
- package/dist/runtime/theme/alert.js +0 -47
- package/dist/runtime/theme/app.d.ts +0 -19
- package/dist/runtime/theme/app.js +0 -19
- package/dist/runtime/theme/avatar-group.d.ts +0 -46
- package/dist/runtime/theme/avatar-group.js +0 -32
- package/dist/runtime/theme/avatar.d.ts +0 -50
- package/dist/runtime/theme/avatar.js +0 -34
- package/dist/runtime/theme/badge.d.ts +0 -76
- package/dist/runtime/theme/badge.js +0 -92
- package/dist/runtime/theme/breadcrumb.d.ts +0 -61
- package/dist/runtime/theme/breadcrumb.js +0 -44
- package/dist/runtime/theme/button-group.d.ts +0 -60
- package/dist/runtime/theme/button-group.js +0 -42
- package/dist/runtime/theme/button.d.ts +0 -184
- package/dist/runtime/theme/button.js +0 -164
- package/dist/runtime/theme/calendar.d.ts +0 -58
- package/dist/runtime/theme/calendar.js +0 -86
- package/dist/runtime/theme/card.d.ts +0 -56
- package/dist/runtime/theme/card.js +0 -37
- package/dist/runtime/theme/carousel.d.ts +0 -107
- package/dist/runtime/theme/carousel.js +0 -43
- package/dist/runtime/theme/checkbox.d.ts +0 -82
- package/dist/runtime/theme/checkbox.js +0 -54
- package/dist/runtime/theme/chip.d.ts +0 -61
- package/dist/runtime/theme/chip.js +0 -66
- package/dist/runtime/theme/collapsible.d.ts +0 -32
- package/dist/runtime/theme/collapsible.js +0 -10
- package/dist/runtime/theme/drawer.d.ts +0 -142
- package/dist/runtime/theme/drawer.js +0 -113
- package/dist/runtime/theme/dropdown-menu.d.ts +0 -65
- package/dist/runtime/theme/dropdown-menu.js +0 -83
- package/dist/runtime/theme/form-item.d.ts +0 -70
- package/dist/runtime/theme/form-item.js +0 -34
- package/dist/runtime/theme/form.d.ts +0 -2
- package/dist/runtime/theme/form.js +0 -7
- package/dist/runtime/theme/index.d.ts +0 -41
- package/dist/runtime/theme/index.js +0 -41
- package/dist/runtime/theme/input-number.d.ts +0 -115
- package/dist/runtime/theme/input-number.js +0 -95
- package/dist/runtime/theme/input.d.ts +0 -172
- package/dist/runtime/theme/input.js +0 -151
- package/dist/runtime/theme/kbd.d.ts +0 -33
- package/dist/runtime/theme/kbd.js +0 -26
- package/dist/runtime/theme/link.d.ts +0 -38
- package/dist/runtime/theme/link.js +0 -26
- package/dist/runtime/theme/modal.d.ts +0 -42
- package/dist/runtime/theme/modal.js +0 -55
- package/dist/runtime/theme/pagination.d.ts +0 -74
- package/dist/runtime/theme/pagination.js +0 -17
- package/dist/runtime/theme/pinInput.d.ts +0 -94
- package/dist/runtime/theme/pinInput.js +0 -111
- package/dist/runtime/theme/popover.d.ts +0 -32
- package/dist/runtime/theme/popover.js +0 -13
- package/dist/runtime/theme/progress.d.ts +0 -180
- package/dist/runtime/theme/progress.js +0 -95
- package/dist/runtime/theme/radio-group.d.ts +0 -104
- package/dist/runtime/theme/radio-group.js +0 -61
- package/dist/runtime/theme/scroll-area.d.ts +0 -67
- package/dist/runtime/theme/scroll-area.js +0 -33
- package/dist/runtime/theme/select.d.ts +0 -186
- package/dist/runtime/theme/select.js +0 -173
- package/dist/runtime/theme/separator.d.ts +0 -74
- package/dist/runtime/theme/separator.js +0 -53
- package/dist/runtime/theme/skeleton.d.ts +0 -2
- package/dist/runtime/theme/skeleton.js +0 -7
- package/dist/runtime/theme/slider.d.ts +0 -70
- package/dist/runtime/theme/slider.js +0 -52
- package/dist/runtime/theme/switch.d.ts +0 -116
- package/dist/runtime/theme/switch.js +0 -78
- package/dist/runtime/theme/table.d.ts +0 -86
- package/dist/runtime/theme/table.js +0 -36
- package/dist/runtime/theme/tabs.d.ts +0 -129
- package/dist/runtime/theme/tabs.js +0 -146
- package/dist/runtime/theme/textarea.d.ts +0 -90
- package/dist/runtime/theme/textarea.js +0 -116
- package/dist/runtime/theme/toast-provider.d.ts +0 -116
- package/dist/runtime/theme/toast-provider.js +0 -97
- package/dist/runtime/theme/toast.d.ts +0 -83
- package/dist/runtime/theme/toast.js +0 -35
- package/dist/runtime/theme/tooltip.d.ts +0 -38
- package/dist/runtime/theme/tooltip.js +0 -11
- package/dist/runtime/types/components.d.ts +0 -42
- package/dist/runtime/utils/extend-theme.d.ts +0 -9
- package/dist/runtime/utils/extend-theme.js +0 -27
- package/dist/runtime/utils/styler.d.ts +0 -4
- package/dist/runtime/utils/styler.js +0 -10
- package/dist/runtime/utils/translator.d.ts +0 -18
- package/dist/runtime/utils/translator.js +0 -8
- package/dist/shared/ui.D1BTWZFB.mjs +0 -5
- package/dist/shared/ui.D1BTWZFB.mjs.map +0 -1
- package/dist/unocss.d.ts +0 -52
- package/dist/unocss.mjs.map +0 -1
- package/dist/unplugin.d.ts +0 -26
- package/dist/unplugin.mjs.map +0 -1
- package/dist/vite.d.ts +0 -9
- package/dist/vite.mjs.map +0 -1
- /package/dist/runtime/types/{components.js → input.js} +0 -0
package/dist/unplugin.mjs
CHANGED
|
@@ -1,13 +1,46 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
|
+
import { defu } from 'defu';
|
|
2
3
|
import { join, normalize } from 'pathe';
|
|
3
4
|
import { createUnplugin } from 'unplugin';
|
|
4
|
-
import {
|
|
5
|
+
import { g as getTemplates, n as name } from './shared/ui.DLOxhmP0.mjs';
|
|
6
|
+
import { d as defaultOptions, r as resolveColors, g as getDefaultUIConfig } from './shared/ui.CzIlLITK.mjs';
|
|
5
7
|
import AutoImport from 'unplugin-auto-import';
|
|
6
8
|
import { globSync } from 'tinyglobby';
|
|
7
9
|
import AutoImportComponents from 'unplugin-vue-components';
|
|
8
10
|
import MagicString from 'magic-string';
|
|
9
11
|
import { resolvePathSync } from 'mlly';
|
|
10
|
-
import {
|
|
12
|
+
import { genSafeVariableName } from 'knitwork';
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import process from 'node:process';
|
|
16
|
+
import '@nuxt/kit';
|
|
17
|
+
import '@unocss/config';
|
|
18
|
+
import 'scule';
|
|
19
|
+
import '@byyuurin/ui-kit';
|
|
20
|
+
import '../dist/runtime/utils/index.js';
|
|
21
|
+
|
|
22
|
+
function AppConfigPlugin(options, appConfig) {
|
|
23
|
+
const name = "byyuurin:ui:app-config";
|
|
24
|
+
const resolve = {
|
|
25
|
+
id: "#build/app.config",
|
|
26
|
+
filename: "virtual:byyuurin-ui-app-config"
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
name,
|
|
30
|
+
enforce: "pre",
|
|
31
|
+
resolveId(id) {
|
|
32
|
+
if (id === resolve.id)
|
|
33
|
+
return resolve.filename;
|
|
34
|
+
},
|
|
35
|
+
loadInclude(id) {
|
|
36
|
+
return id === resolve.filename;
|
|
37
|
+
},
|
|
38
|
+
load() {
|
|
39
|
+
return `// @unocss-include
|
|
40
|
+
export default ${JSON.stringify(appConfig, null, 2)}`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
11
44
|
|
|
12
45
|
function AutoImportPlugin(options, meta) {
|
|
13
46
|
const pluginOptions = defu(options.autoImport, {
|
|
@@ -17,32 +50,64 @@ function AutoImportPlugin(options, meta) {
|
|
|
17
50
|
return AutoImport.raw(pluginOptions, meta);
|
|
18
51
|
}
|
|
19
52
|
|
|
53
|
+
const RELATIVE_IMPORT_RE = /^\.{1,2}\//;
|
|
20
54
|
function ComponentImportPlugin(options, meta) {
|
|
21
55
|
const { prefix = "U" } = options;
|
|
22
|
-
const components = globSync("**/*.vue", {
|
|
56
|
+
const components = globSync("**/*.vue", {
|
|
57
|
+
cwd: join(runtimeDir, "components")
|
|
58
|
+
});
|
|
23
59
|
const componentNames = new Set(components.map((c) => `${prefix}${c.replace(/\.vue$/, "")}`));
|
|
60
|
+
const overrides = globSync("**/*.vue", {
|
|
61
|
+
cwd: join(runtimeDir, "vue/components")
|
|
62
|
+
});
|
|
63
|
+
const overrideNames = new Set(overrides.map((c) => `${prefix}${c.replace(/\.vue$/, "")}`));
|
|
24
64
|
const pluginOptions = defu(options.components, {
|
|
25
65
|
dts: options.dts ?? true,
|
|
66
|
+
exclude: [
|
|
67
|
+
/[\\/]\.git[\\/]/,
|
|
68
|
+
/[\\/]\.nuxt[\\/]/
|
|
69
|
+
],
|
|
26
70
|
resolvers: [
|
|
27
71
|
(componentName) => {
|
|
72
|
+
if (overrideNames.has(componentName))
|
|
73
|
+
return { name: "default", from: join(runtimeDir, "vue/components", `${componentName.slice(prefix.length)}.vue`) };
|
|
28
74
|
if (componentNames.has(componentName))
|
|
29
75
|
return { name: "default", from: join(runtimeDir, "components", `${componentName.slice(prefix.length)}.vue`) };
|
|
30
76
|
}
|
|
31
77
|
]
|
|
32
78
|
});
|
|
33
|
-
return
|
|
79
|
+
return [
|
|
80
|
+
{
|
|
81
|
+
name: "byyuurin:ui:components",
|
|
82
|
+
enforce: "pre",
|
|
83
|
+
resolveId(id, importer) {
|
|
84
|
+
if (!importer)
|
|
85
|
+
return;
|
|
86
|
+
if (!normalize(importer).includes(runtimeDir))
|
|
87
|
+
return;
|
|
88
|
+
if (!RELATIVE_IMPORT_RE.test(id) && !id.startsWith("@byyuurin/ui/components/"))
|
|
89
|
+
return;
|
|
90
|
+
const filename = id.match(/([^/]+)\.vue$/)?.[1];
|
|
91
|
+
if (filename && overrideNames.has(`${prefix}${filename}`))
|
|
92
|
+
return join(runtimeDir, "vue/components", `${filename}.vue`);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
AutoImportComponents.raw(pluginOptions, meta)
|
|
96
|
+
];
|
|
34
97
|
}
|
|
35
98
|
|
|
36
99
|
function NuxtEnvironmentPlugin() {
|
|
37
|
-
const stubPath = resolvePathSync("../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url });
|
|
38
100
|
const name = "byyuurin:ui";
|
|
39
|
-
const
|
|
101
|
+
const resolve = {
|
|
102
|
+
id: "#imports",
|
|
103
|
+
filename: resolvePathSync("../runtime/vue/stubs", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url })
|
|
104
|
+
};
|
|
40
105
|
return {
|
|
41
106
|
name,
|
|
42
107
|
enforce: "pre",
|
|
43
108
|
resolveId(id) {
|
|
44
|
-
if (id ===
|
|
45
|
-
return
|
|
109
|
+
if (id === resolve.id)
|
|
110
|
+
return resolve.filename;
|
|
46
111
|
},
|
|
47
112
|
transformInclude(id) {
|
|
48
113
|
return normalize(id).includes(runtimeDir);
|
|
@@ -62,22 +127,133 @@ function NuxtEnvironmentPlugin() {
|
|
|
62
127
|
};
|
|
63
128
|
}
|
|
64
129
|
|
|
130
|
+
function PluginsPlugin(options) {
|
|
131
|
+
const name = "byyuurin:ui:plugins";
|
|
132
|
+
const resolve = {
|
|
133
|
+
id: "@byyuurin/ui/vue-plugin",
|
|
134
|
+
filename: "virtual:byyuurin-ui-plugins"
|
|
135
|
+
};
|
|
136
|
+
const plugins = globSync(["**/*", "!*.d.ts"], { cwd: join(runtimeDir, "plugins"), absolute: true });
|
|
137
|
+
plugins.unshift(resolvePathSync("../runtime/vue/plugins/head", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url }));
|
|
138
|
+
if (options.colorMode)
|
|
139
|
+
plugins.push(resolvePathSync("../runtime/vue/plugins/color-mode", { extensions: [".ts", ".mjs", ".js"], url: import.meta.url }));
|
|
140
|
+
return {
|
|
141
|
+
name,
|
|
142
|
+
enforce: "pre",
|
|
143
|
+
resolveId(id) {
|
|
144
|
+
if (id === resolve.id)
|
|
145
|
+
return resolve.filename;
|
|
146
|
+
},
|
|
147
|
+
transform(code, id) {
|
|
148
|
+
const targetCode = "import.meta.client";
|
|
149
|
+
if (plugins.some((p) => id.startsWith(p)) && code.includes(targetCode)) {
|
|
150
|
+
const s = new MagicString(code);
|
|
151
|
+
s.replaceAll(targetCode, "true");
|
|
152
|
+
if (s.hasChanged()) {
|
|
153
|
+
return {
|
|
154
|
+
code: s.toString(),
|
|
155
|
+
map: s.generateMap({ hires: true })
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
loadInclude(id) {
|
|
161
|
+
return id === resolve.filename;
|
|
162
|
+
},
|
|
163
|
+
load() {
|
|
164
|
+
return `${plugins.map((p) => `import ${genSafeVariableName(p)} from "${p}"`).join("\n")}
|
|
165
|
+
|
|
166
|
+
export default {
|
|
167
|
+
install(app) {
|
|
168
|
+
${plugins.map((p) => ` app.use(${genSafeVariableName(p)})`).join("\n")}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`;
|
|
172
|
+
},
|
|
173
|
+
// Argument Vite specific configuration
|
|
174
|
+
vite: {
|
|
175
|
+
config() {
|
|
176
|
+
return {
|
|
177
|
+
// Opt-out Nuxt UI from Vite's pre-bundling,
|
|
178
|
+
// as we need Vite's pipeline to resolve imports like `#imports`
|
|
179
|
+
optimizeDeps: {
|
|
180
|
+
exclude: ["@byyuurin/ui"]
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function TemplatePlugin(options, _appConfig) {
|
|
189
|
+
const name = "byyuurin:ui:templates";
|
|
190
|
+
const templateKeyPrefix = "#build/";
|
|
191
|
+
const templateFilenamePrefix = "virtual:byyuurin-ui-templates/";
|
|
192
|
+
const templates = getTemplates(options, {});
|
|
193
|
+
const templateKeys = new Set(templates.map((t) => `${templateKeyPrefix}${t.filename}`));
|
|
194
|
+
async function writeTemplates(root) {
|
|
195
|
+
const map = {};
|
|
196
|
+
const dir = path.join(root, "node_modules", ".nuxt");
|
|
197
|
+
for (const template of templates) {
|
|
198
|
+
if (!template.write || !template.filename)
|
|
199
|
+
continue;
|
|
200
|
+
const filePath = path.join(dir, template.filename);
|
|
201
|
+
if (!fs.existsSync(path.dirname(filePath)))
|
|
202
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
203
|
+
fs.writeFileSync(filePath, await template.getContents({}));
|
|
204
|
+
map[`#build/${template.filename}`] = filePath;
|
|
205
|
+
}
|
|
206
|
+
return map;
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
name,
|
|
210
|
+
enforce: "pre",
|
|
211
|
+
vite: {
|
|
212
|
+
async config(config) {
|
|
213
|
+
const alias = await writeTemplates(config.root || process.cwd());
|
|
214
|
+
return {
|
|
215
|
+
resolve: {
|
|
216
|
+
alias
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
resolveId(id) {
|
|
222
|
+
if (templateKeys.has(`${id}.ts`))
|
|
223
|
+
return `${id.replace(templateKeyPrefix, templateFilenamePrefix)}.ts`;
|
|
224
|
+
},
|
|
225
|
+
loadInclude(id) {
|
|
226
|
+
return templateKeys.has(id.replace(templateFilenamePrefix, templateKeyPrefix));
|
|
227
|
+
},
|
|
228
|
+
load(id) {
|
|
229
|
+
const templateID = id.replace(templateFilenamePrefix, templateKeyPrefix);
|
|
230
|
+
return templates.find((t) => `${templateKeyPrefix}${t.filename}` === templateID).getContents({});
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
65
235
|
const runtimeDir = normalize(fileURLToPath(new URL("runtime", import.meta.url)));
|
|
66
|
-
const unplugin = createUnplugin((
|
|
236
|
+
const unplugin = createUnplugin((userOptions = {}, meta) => {
|
|
237
|
+
const options = defu(userOptions, defaultOptions);
|
|
238
|
+
options.theme ||= {};
|
|
239
|
+
options.theme.colors = resolveColors(options.theme.colors);
|
|
240
|
+
const appConfig = defu(
|
|
241
|
+
{
|
|
242
|
+
ui: options.ui,
|
|
243
|
+
colorMode: options.colorMode
|
|
244
|
+
},
|
|
245
|
+
{ ui: getDefaultUIConfig(options.theme.colors) }
|
|
246
|
+
);
|
|
67
247
|
return [
|
|
68
248
|
NuxtEnvironmentPlugin(),
|
|
69
249
|
ComponentImportPlugin(options, meta),
|
|
70
250
|
AutoImportPlugin(options, meta),
|
|
251
|
+
PluginsPlugin(options),
|
|
252
|
+
TemplatePlugin(options),
|
|
253
|
+
AppConfigPlugin(options, appConfig),
|
|
71
254
|
{
|
|
72
255
|
name: "byyuurin:ui:plugins-duplication-detection",
|
|
73
256
|
vite: {
|
|
74
|
-
config() {
|
|
75
|
-
return {
|
|
76
|
-
optimizeDeps: {
|
|
77
|
-
include: [`${name}/unocss`]
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
257
|
configResolved(config) {
|
|
82
258
|
const checkPluginNames = [
|
|
83
259
|
"unplugin-auto-import",
|
|
@@ -92,8 +268,7 @@ const unplugin = createUnplugin((options = {}, meta) => {
|
|
|
92
268
|
}
|
|
93
269
|
}
|
|
94
270
|
}
|
|
95
|
-
];
|
|
271
|
+
].flat(1);
|
|
96
272
|
});
|
|
97
273
|
|
|
98
274
|
export { runtimeDir, unplugin };
|
|
99
|
-
//# sourceMappingURL=unplugin.mjs.map
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { UIOptions } from './
|
|
2
|
+
import { U as UIOptions } from './shared/ui.DpbffTXs.mjs';
|
|
3
3
|
import 'unplugin';
|
|
4
4
|
import 'unplugin-auto-import/types';
|
|
5
5
|
import 'unplugin-vue-components/types';
|
|
6
|
+
import './shared/ui.IulR-OYx.mjs';
|
|
7
|
+
import '@nuxt/schema';
|
|
8
|
+
import '@unocss/preset-wind4/colors';
|
|
9
|
+
import '../dist/runtime/types/index.js';
|
|
10
|
+
import '#build/ui';
|
|
11
|
+
import '../dist/runtime/types/style.js';
|
|
12
|
+
import './unocss.mjs';
|
|
13
|
+
import '@unocss/core';
|
|
14
|
+
import '@unocss/preset-wind4/theme';
|
|
6
15
|
|
|
7
16
|
declare const _default: (options?: UIOptions | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
|
|
8
17
|
|
package/dist/vite.mjs
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { unplugin } from './unplugin.mjs';
|
|
2
2
|
import 'node:url';
|
|
3
|
+
import 'defu';
|
|
3
4
|
import 'pathe';
|
|
4
5
|
import 'unplugin';
|
|
5
|
-
import '
|
|
6
|
+
import './shared/ui.DLOxhmP0.mjs';
|
|
7
|
+
import 'node:process';
|
|
8
|
+
import '@nuxt/kit';
|
|
9
|
+
import '@unocss/config';
|
|
10
|
+
import 'knitwork';
|
|
11
|
+
import 'scule';
|
|
12
|
+
import './shared/ui.CzIlLITK.mjs';
|
|
13
|
+
import '../dist/runtime/utils/index.js';
|
|
14
|
+
import '@byyuurin/ui-kit';
|
|
6
15
|
import 'unplugin-auto-import';
|
|
7
16
|
import 'tinyglobby';
|
|
8
17
|
import 'unplugin-vue-components';
|
|
9
18
|
import 'magic-string';
|
|
10
19
|
import 'mlly';
|
|
11
|
-
import '
|
|
20
|
+
import 'node:fs';
|
|
21
|
+
import 'node:path';
|
|
12
22
|
|
|
13
23
|
const vite = unplugin.vite;
|
|
14
24
|
|
|
15
25
|
export { vite as default };
|
|
16
|
-
//# sourceMappingURL=vite.mjs.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byyuurin/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
5
|
-
"packageManager": "pnpm@10.12.4",
|
|
4
|
+
"version": "0.2.0",
|
|
6
5
|
"description": "",
|
|
7
6
|
"author": "Yuurin <byyuurin@gmail.com>",
|
|
8
7
|
"license": "MIT",
|
|
@@ -13,76 +12,135 @@
|
|
|
13
12
|
},
|
|
14
13
|
"bugs": "https://github.com/byyuurin/ui/issues",
|
|
15
14
|
"keywords": [],
|
|
16
|
-
"sideEffects": false,
|
|
17
15
|
"exports": {
|
|
18
16
|
".": {
|
|
19
|
-
"types": "./dist/
|
|
20
|
-
"
|
|
17
|
+
"types": "./dist/module.d.mts",
|
|
18
|
+
"import": "./dist/module.mjs"
|
|
19
|
+
},
|
|
20
|
+
"./setup": {
|
|
21
|
+
"types": "./dist/setup.d.mts",
|
|
22
|
+
"import": "./dist/setup.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./unocss": {
|
|
25
|
+
"types": "./dist/unocss.d.mts",
|
|
26
|
+
"import": "./dist/unocss.mjs"
|
|
21
27
|
},
|
|
22
28
|
"./unplugin": {
|
|
23
29
|
"types": "./dist/unplugin.d.mts",
|
|
24
|
-
"
|
|
30
|
+
"import": "./dist/unplugin.mjs"
|
|
31
|
+
},
|
|
32
|
+
"./vue-plugin": {
|
|
33
|
+
"types": "./vue-plugin.d.ts"
|
|
25
34
|
},
|
|
26
35
|
"./vite": {
|
|
27
36
|
"types": "./dist/vite.d.mts",
|
|
28
|
-
"
|
|
29
|
-
},
|
|
30
|
-
"./nuxt": {
|
|
31
|
-
"types": "./dist/module.d.mts",
|
|
32
|
-
"default": "./dist/module.mjs"
|
|
33
|
-
},
|
|
34
|
-
"./unocss": {
|
|
35
|
-
"types": "./dist/unocss.d.mts",
|
|
36
|
-
"default": "./dist/unocss.mjs"
|
|
37
|
-
},
|
|
38
|
-
"./runtime/index": {
|
|
39
|
-
"types": "./dist/runtime/index.d.ts",
|
|
40
|
-
"default": "./dist/runtime/index.js"
|
|
37
|
+
"import": "./dist/vite.mjs"
|
|
41
38
|
},
|
|
42
39
|
"./runtime/*": "./dist/runtime/*",
|
|
40
|
+
"./components/*": "./dist/runtime/components/*",
|
|
41
|
+
"./composables/*": "./dist/runtime/composables/*",
|
|
42
|
+
"./utils": {
|
|
43
|
+
"types": "./dist/runtime/utils/index.d.ts",
|
|
44
|
+
"import": "./dist/runtime/utils/index.js"
|
|
45
|
+
},
|
|
43
46
|
"./utils/*": {
|
|
44
47
|
"types": "./dist/runtime/utils/*.d.ts",
|
|
45
|
-
"
|
|
48
|
+
"import": "./dist/runtime/utils/*.js"
|
|
46
49
|
},
|
|
47
50
|
"./locale": {
|
|
48
51
|
"types": "./dist/runtime/locale/index.d.ts",
|
|
49
|
-
"
|
|
52
|
+
"import": "./dist/runtime/locale/index.js"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"main": "./dist/module.mjs",
|
|
56
|
+
"typesVersions": {
|
|
57
|
+
"*": {
|
|
58
|
+
".": [
|
|
59
|
+
"./dist/module.d.mts"
|
|
60
|
+
],
|
|
61
|
+
"setup": [
|
|
62
|
+
"./dist/setup.d.mts"
|
|
63
|
+
],
|
|
64
|
+
"unocss": [
|
|
65
|
+
"./dist/unocss.d.mts"
|
|
66
|
+
],
|
|
67
|
+
"unplugin": [
|
|
68
|
+
"./dist/unplugin.d.mts"
|
|
69
|
+
],
|
|
70
|
+
"vue-plugin": [
|
|
71
|
+
"./vue-plugin.d.ts"
|
|
72
|
+
],
|
|
73
|
+
"vite": [
|
|
74
|
+
"./dist/vite.d.mts"
|
|
75
|
+
],
|
|
76
|
+
"runtime/*": [
|
|
77
|
+
"./dist/runtime/*"
|
|
78
|
+
],
|
|
79
|
+
"components/*": [
|
|
80
|
+
"./dist/runtime/components/*"
|
|
81
|
+
],
|
|
82
|
+
"composables/*": [
|
|
83
|
+
"./dist/runtime/composables/*"
|
|
84
|
+
],
|
|
85
|
+
"utils": [
|
|
86
|
+
"./dist/runtime/utils/index.d.ts"
|
|
87
|
+
],
|
|
88
|
+
"utils/*": [
|
|
89
|
+
"./dist/runtime/utils/*.d.ts"
|
|
90
|
+
],
|
|
91
|
+
"locale": [
|
|
92
|
+
"./dist/runtime/locale/index.d.ts"
|
|
93
|
+
]
|
|
50
94
|
}
|
|
51
95
|
},
|
|
52
|
-
"main": "dist/runtime/index.js",
|
|
53
|
-
"module": "dist/runtime/index.js",
|
|
54
|
-
"types": "dist/runtime/index.d.ts",
|
|
55
96
|
"files": [
|
|
56
|
-
"
|
|
57
|
-
"
|
|
97
|
+
"dist",
|
|
98
|
+
"vue-plugin.d.ts"
|
|
58
99
|
],
|
|
59
|
-
"scripts": {
|
|
60
|
-
"dev": "nuxi dev playground/nuxt",
|
|
61
|
-
"dev:build": "nuxi build playground/nuxt",
|
|
62
|
-
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground/nuxt",
|
|
63
|
-
"dev:vue": "pnpm --filter \"./playground/vue\" run dev",
|
|
64
|
-
"lint": "eslint .",
|
|
65
|
-
"release": "bumpp && pnpm publish",
|
|
66
|
-
"start": "esno src/index.ts",
|
|
67
|
-
"test": "vitest",
|
|
68
|
-
"test:types": "vue-tsc --noEmit && nuxi typecheck playground/nuxt",
|
|
69
|
-
"prepare": "simple-git-hooks",
|
|
70
|
-
"prepack": "nuxt-module-build build"
|
|
71
|
-
},
|
|
72
100
|
"peerDependencies": {
|
|
73
|
-
"
|
|
101
|
+
"joi": "^18.0.0",
|
|
102
|
+
"superstruct": "^2.0.2",
|
|
103
|
+
"valibot": "^1.0.0",
|
|
104
|
+
"vue-router": "^4.5.0",
|
|
105
|
+
"yup": "^1.7.0",
|
|
106
|
+
"zod": "^3.24.0 || ^4.0.0"
|
|
107
|
+
},
|
|
108
|
+
"peerDependenciesMeta": {
|
|
109
|
+
"joi": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"superstruct": {
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"valibot": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"vue-router": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"yup": {
|
|
122
|
+
"optional": true
|
|
123
|
+
},
|
|
124
|
+
"zod": {
|
|
125
|
+
"optional": true
|
|
126
|
+
}
|
|
74
127
|
},
|
|
75
128
|
"dependencies": {
|
|
76
|
-
"@byyuurin/ui-kit": "^0.
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
129
|
+
"@byyuurin/ui-kit": "^0.7.2",
|
|
130
|
+
"@byyuurin/uno-merge": "^0.2.1",
|
|
131
|
+
"@iconify/vue": "^5.0.0",
|
|
132
|
+
"@internationalized/date": "^3.10.0",
|
|
133
|
+
"@nuxt/fonts": "^0.11.4",
|
|
134
|
+
"@nuxt/icon": "^1.15.0",
|
|
135
|
+
"@nuxt/kit": "^4.2.1",
|
|
136
|
+
"@nuxtjs/color-mode": "^3.5.2",
|
|
79
137
|
"@standard-schema/spec": "^1.0.0",
|
|
80
138
|
"@tanstack/vue-table": "^8.21.3",
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@unocss/
|
|
84
|
-
"@vue/shared": "^3.5.
|
|
85
|
-
"@vueuse/core": "^13.
|
|
139
|
+
"@tanstack/vue-virtual": "^3.13.12",
|
|
140
|
+
"@unhead/vue": "^2.0.19",
|
|
141
|
+
"@unocss/nuxt": "^66.5.5",
|
|
142
|
+
"@vue/shared": "^3.5.24",
|
|
143
|
+
"@vueuse/core": "^13.9.0",
|
|
86
144
|
"defu": "^6.1.4",
|
|
87
145
|
"embla-carousel": "^8.6.0",
|
|
88
146
|
"embla-carousel-auto-height": "^8.6.0",
|
|
@@ -91,53 +149,49 @@
|
|
|
91
149
|
"embla-carousel-class-names": "^8.6.0",
|
|
92
150
|
"embla-carousel-fade": "^8.6.0",
|
|
93
151
|
"embla-carousel-vue": "^8.6.0",
|
|
94
|
-
"embla-carousel-wheel-gestures": "^8.0
|
|
95
|
-
"
|
|
96
|
-
"
|
|
152
|
+
"embla-carousel-wheel-gestures": "^8.1.0",
|
|
153
|
+
"knitwork": "^1.2.0",
|
|
154
|
+
"magic-string": "^0.30.21",
|
|
155
|
+
"mlly": "^1.8.0",
|
|
97
156
|
"ohash": "^2.0.11",
|
|
98
157
|
"pathe": "^2.0.3",
|
|
99
|
-
"reka-ui": "^2.
|
|
158
|
+
"reka-ui": "^2.6.0",
|
|
100
159
|
"scule": "^1.3.0",
|
|
101
|
-
"tinyglobby": "^0.2.
|
|
160
|
+
"tinyglobby": "^0.2.15",
|
|
102
161
|
"ufo": "^1.6.1",
|
|
103
|
-
"unplugin": "^2.3.
|
|
104
|
-
"unplugin-auto-import": "^
|
|
105
|
-
"unplugin-vue-components": "^
|
|
106
|
-
"vue-component-type-helpers": "^
|
|
107
|
-
"vue-router": "^4.5.1"
|
|
162
|
+
"unplugin": "^2.3.10",
|
|
163
|
+
"unplugin-auto-import": "^20.2.0",
|
|
164
|
+
"unplugin-vue-components": "^30.0.0",
|
|
165
|
+
"vue-component-type-helpers": "^3.1.3"
|
|
108
166
|
},
|
|
109
167
|
"devDependencies": {
|
|
110
|
-
"@
|
|
111
|
-
"@
|
|
112
|
-
"@nuxt/eslint-config": "^1.
|
|
113
|
-
"@nuxt/module-builder": "^1.0.
|
|
114
|
-
"@nuxt/schema": "^
|
|
115
|
-
"@nuxt/test-utils": "^3.
|
|
116
|
-
"@types/node": "^22.
|
|
117
|
-
"@unocss/
|
|
118
|
-
"@
|
|
119
|
-
"
|
|
120
|
-
"
|
|
168
|
+
"@byyuurin/eslint-config": "^1.9.0",
|
|
169
|
+
"@iconify-json/lucide": "^1.2.72",
|
|
170
|
+
"@nuxt/eslint-config": "^1.10.0",
|
|
171
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
172
|
+
"@nuxt/schema": "^4.2.1",
|
|
173
|
+
"@nuxt/test-utils": "^3.20.1",
|
|
174
|
+
"@types/node": "^22.19.0",
|
|
175
|
+
"@unocss/core": "^66.5.5",
|
|
176
|
+
"@unocss/preset-wind4": "^66.5.5",
|
|
177
|
+
"@unocss/reset": "^66.5.5",
|
|
178
|
+
"@vitejs/plugin-vue": "^6.0.1",
|
|
179
|
+
"bumpp": "^10.3.1",
|
|
180
|
+
"eslint": "^9.39.1",
|
|
121
181
|
"eslint-plugin-format": "1.0.1",
|
|
122
182
|
"esno": "^4.8.0",
|
|
123
|
-
"lint-staged": "^16.
|
|
124
|
-
"nuxt": "^
|
|
125
|
-
"simple-git-hooks": "^2.13.
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"vite
|
|
183
|
+
"lint-staged": "^16.2.6",
|
|
184
|
+
"nuxt": "^4.2.1",
|
|
185
|
+
"simple-git-hooks": "^2.13.1",
|
|
186
|
+
"superstruct": "^2.0.2",
|
|
187
|
+
"typescript": "^5.9.3",
|
|
188
|
+
"unocss": "^66.5.5",
|
|
189
|
+
"vite": "^7.2.2",
|
|
190
|
+
"vite-plugin-inspect": "^11.3.3",
|
|
130
191
|
"vitest": "^3.2.4",
|
|
131
|
-
"vue": "^3.5.
|
|
132
|
-
"vue-tsc": "^
|
|
133
|
-
"zod": "^3.25.
|
|
134
|
-
},
|
|
135
|
-
"pnpm": {
|
|
136
|
-
"overrides": {
|
|
137
|
-
"is-core-module": "npm:@nolyfill/is-core-module@^1.0.39",
|
|
138
|
-
"isarray": "npm:@nolyfill/isarray@^1.0.44",
|
|
139
|
-
"safe-buffer": "npm:@nolyfill/safe-buffer@^1.0.44"
|
|
140
|
-
}
|
|
192
|
+
"vue": "^3.5.24",
|
|
193
|
+
"vue-tsc": "^3.1.3",
|
|
194
|
+
"zod": "^3.25.76"
|
|
141
195
|
},
|
|
142
196
|
"resolutions": {
|
|
143
197
|
"@byyuurin/ui": "workspace:*"
|
|
@@ -147,5 +201,18 @@
|
|
|
147
201
|
},
|
|
148
202
|
"lint-staged": {
|
|
149
203
|
"*": "eslint --fix"
|
|
204
|
+
},
|
|
205
|
+
"scripts": {
|
|
206
|
+
"dev": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi dev playground/nuxt --uiDev",
|
|
207
|
+
"dev:build": "nuxi build playground/nuxt",
|
|
208
|
+
"dev:preview": "nuxi preview playground/nuxt",
|
|
209
|
+
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground/nuxt && pnpm dev:vue:build",
|
|
210
|
+
"dev:vue": "pnpm --filter \"./playground/vue\" dev -- --uiDev",
|
|
211
|
+
"dev:vue:build": "pnpm --filter \"./playground/vue\" build",
|
|
212
|
+
"dev:vue:preview": "pnpm --filter \"./playground/vue\" preview",
|
|
213
|
+
"release": "bumpp && pnpm publish",
|
|
214
|
+
"lint": "eslint .",
|
|
215
|
+
"test": "vitest",
|
|
216
|
+
"test:types": "vue-tsc --noEmit && nuxi typecheck playground/nuxt"
|
|
150
217
|
}
|
|
151
|
-
}
|
|
218
|
+
}
|
package/vue-plugin.d.ts
ADDED
package/dist/module.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
/**
|
|
5
|
-
* prefix for components used in templates
|
|
6
|
-
*
|
|
7
|
-
* @default "U"
|
|
8
|
-
*/
|
|
9
|
-
prefix?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
12
|
-
|
|
13
|
-
export { type ModuleOptions, _default as default };
|
package/dist/module.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.mjs","sources":["../src/module.ts"],"sourcesContent":["import { addComponentsDir, addImportsDir, createResolver, defineNuxtModule, hasNuxtModule, useLogger } from '@nuxt/kit'\nimport { packageName, packageVersion } from './shared'\n\nexport interface ModuleOptions {\n /**\n * prefix for components used in templates\n *\n * @default \"U\"\n */\n prefix?: string\n}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: packageName,\n version: packageVersion,\n configKey: 'ui',\n compatibility: {\n nuxt: '>=3.13.1',\n },\n },\n defaults: {\n prefix: 'U',\n },\n setup(options, nuxt) {\n const logger = useLogger(packageName)\n const { resolve } = createResolver(import.meta.url)\n\n // Make sure the UnoCSS Nuxt module is installed\n if (!hasNuxtModule('@unocss/nuxt')) {\n logger.error(`\\`${packageName}\\` requires the \\`@unocss/nuxt\\` module to be installed.`)\n return\n }\n\n nuxt.options.vite.optimizeDeps ??= {}\n nuxt.options.vite.optimizeDeps.include ??= []\n nuxt.options.vite.optimizeDeps.include.push(`${packageName}/unocss`)\n\n nuxt.options.alias['#ui'] = resolve('./runtime')\n\n addComponentsDir({\n path: resolve('./runtime/components'),\n prefix: options.prefix,\n pathPrefix: false,\n })\n\n addImportsDir(resolve('./runtime/composables'))\n },\n})\n"],"names":["packageName","packageVersion"],"mappings":";;;AAYA,eAAe,gBAAgC,CAAA;AAAA,EAC7C,IAAM,EAAA;AAAA,IACJ,IAAM,EAAAA,IAAA;AAAA,IACN,OAAS,EAAAC,OAAA;AAAA,IACT,SAAW,EAAA,IAAA;AAAA,IACX,aAAe,EAAA;AAAA,MACb,IAAM,EAAA;AAAA;AACR,GACF;AAAA,EACA,QAAU,EAAA;AAAA,IACR,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,KAAA,CAAM,SAAS,IAAM,EAAA;AACnB,IAAM,MAAA,MAAA,GAAS,UAAUD,IAAW,CAAA;AACpC,IAAA,MAAM,EAAE,OAAA,EAAY,GAAA,cAAA,CAAe,YAAY,GAAG,CAAA;AAGlD,IAAI,IAAA,CAAC,aAAc,CAAA,cAAc,CAAG,EAAA;AAClC,MAAO,MAAA,CAAA,KAAA,CAAM,CAAK,EAAA,EAAAA,IAAW,CAA0D,wDAAA,CAAA,CAAA;AACvF,MAAA;AAAA;AAGF,IAAK,IAAA,CAAA,OAAA,CAAQ,IAAK,CAAA,YAAA,KAAiB,EAAC;AACpC,IAAA,IAAA,CAAK,OAAQ,CAAA,IAAA,CAAK,YAAa,CAAA,OAAA,KAAY,EAAC;AAC5C,IAAA,IAAA,CAAK,QAAQ,IAAK,CAAA,YAAA,CAAa,QAAQ,IAAK,CAAA,CAAA,EAAGA,IAAW,CAAS,OAAA,CAAA,CAAA;AAEnE,IAAA,IAAA,CAAK,OAAQ,CAAA,KAAA,CAAM,KAAK,CAAA,GAAI,QAAQ,WAAW,CAAA;AAE/C,IAAiB,gBAAA,CAAA;AAAA,MACf,IAAA,EAAM,QAAQ,sBAAsB,CAAA;AAAA,MACpC,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,UAAY,EAAA;AAAA,KACb,CAAA;AAED,IAAc,aAAA,CAAA,OAAA,CAAQ,uBAAuB,CAAC,CAAA;AAAA;AAElD,CAAC,CAAA;;;;"}
|