@roku-ui/nuxt 0.30.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 +22 -0
- package/dist/module.d.ts +21 -0
- package/dist/module.js +111 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Roku UI Nuxt Module
|
|
2
|
+
|
|
3
|
+
Nuxt module that auto-registers Roku UI Vue components with an `R` prefix.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @roku-ui/nuxt @roku-ui/vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// nuxt.config.ts
|
|
13
|
+
export default defineNuxtConfig({
|
|
14
|
+
modules: ['@roku-ui/nuxt'],
|
|
15
|
+
rokuUi: {
|
|
16
|
+
// Optional: customize the prefix
|
|
17
|
+
prefix: 'R',
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
If `@unocss/nuxt` is present, this module will automatically add `rokuPreset()` to the UnoCSS configuration, so you do not need to include it manually.
|
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { UserConfig } from 'unocss';
|
|
2
|
+
export interface RokuUiNuxtOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Prefix applied to every auto-registered component.
|
|
5
|
+
* Defaults to `R`.
|
|
6
|
+
*/
|
|
7
|
+
prefix?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("@nuxt/schema").NuxtModule<RokuUiNuxtOptions, RokuUiNuxtOptions, false>;
|
|
10
|
+
export default _default;
|
|
11
|
+
declare module '@nuxt/schema' {
|
|
12
|
+
interface NuxtConfig {
|
|
13
|
+
rokuUi?: RokuUiNuxtOptions;
|
|
14
|
+
}
|
|
15
|
+
interface NuxtOptions {
|
|
16
|
+
rokuUi?: RokuUiNuxtOptions;
|
|
17
|
+
}
|
|
18
|
+
interface NuxtHooks {
|
|
19
|
+
'unocss:config': (config: UserConfig) => void;
|
|
20
|
+
}
|
|
21
|
+
}
|
package/dist/module.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { addComponent, createResolver, defineNuxtModule } from '@nuxt/kit';
|
|
2
|
+
import { rokuPreset } from '@roku-ui/preset';
|
|
3
|
+
const components = [
|
|
4
|
+
'AppShell',
|
|
5
|
+
'AppShellAside',
|
|
6
|
+
'AppShellFooter',
|
|
7
|
+
'AppShellHeader',
|
|
8
|
+
'AppShellMain',
|
|
9
|
+
'AppShellNavbar',
|
|
10
|
+
'AspectRatio',
|
|
11
|
+
'AutoHeightTransition',
|
|
12
|
+
'Avatar',
|
|
13
|
+
'Btn',
|
|
14
|
+
'BtnGroup',
|
|
15
|
+
'Calendar',
|
|
16
|
+
'CalendarInput',
|
|
17
|
+
'ChatContainer',
|
|
18
|
+
'ChatMessage',
|
|
19
|
+
'ChatSystem',
|
|
20
|
+
'Checkbox',
|
|
21
|
+
'Chip',
|
|
22
|
+
'ColorInput',
|
|
23
|
+
'ColorSwatch',
|
|
24
|
+
'Drawer',
|
|
25
|
+
'Dropzone',
|
|
26
|
+
'FullscreenOverlay',
|
|
27
|
+
'Icon',
|
|
28
|
+
'Image',
|
|
29
|
+
'Indicator',
|
|
30
|
+
'Menu',
|
|
31
|
+
'MenuItem',
|
|
32
|
+
'Modal',
|
|
33
|
+
'ModalSystem',
|
|
34
|
+
'Notification',
|
|
35
|
+
'NotificationSystem',
|
|
36
|
+
'NumberField',
|
|
37
|
+
'Overlay',
|
|
38
|
+
'Paper',
|
|
39
|
+
'PinInput',
|
|
40
|
+
'Popover',
|
|
41
|
+
'Progress',
|
|
42
|
+
'Rating',
|
|
43
|
+
'RokuProvider',
|
|
44
|
+
'SchemeSwitch',
|
|
45
|
+
'ScrollArea',
|
|
46
|
+
'Select',
|
|
47
|
+
'SelectArea',
|
|
48
|
+
'Slider',
|
|
49
|
+
'Step',
|
|
50
|
+
'Switch',
|
|
51
|
+
'TabItem',
|
|
52
|
+
'Tabs',
|
|
53
|
+
'Tag',
|
|
54
|
+
'TextField',
|
|
55
|
+
'ThemeProvider',
|
|
56
|
+
'Tooltip',
|
|
57
|
+
'TreeList',
|
|
58
|
+
'VirtualWaterfall',
|
|
59
|
+
'Waterfall',
|
|
60
|
+
];
|
|
61
|
+
export default defineNuxtModule({
|
|
62
|
+
meta: {
|
|
63
|
+
name: '@roku-ui/nuxt',
|
|
64
|
+
configKey: 'rokuUi',
|
|
65
|
+
},
|
|
66
|
+
defaults: {
|
|
67
|
+
prefix: 'R',
|
|
68
|
+
},
|
|
69
|
+
setup(options, nuxt) {
|
|
70
|
+
const prefix = options.prefix ?? 'R';
|
|
71
|
+
const { resolve } = createResolver(import.meta.url);
|
|
72
|
+
for (const component of components) {
|
|
73
|
+
addComponent({
|
|
74
|
+
name: `${prefix}${component}`,
|
|
75
|
+
export: component,
|
|
76
|
+
filePath: '@roku-ui/vue',
|
|
77
|
+
global: true,
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const css = nuxt.options.css ?? [];
|
|
81
|
+
if (!css.includes('@roku-ui/vue/style.css')) {
|
|
82
|
+
css.push('@roku-ui/vue/style.css');
|
|
83
|
+
nuxt.options.css = css;
|
|
84
|
+
}
|
|
85
|
+
const transpile = nuxt.options.build.transpile ?? [];
|
|
86
|
+
if (!transpile.includes('@roku-ui/vue')) {
|
|
87
|
+
transpile.push('@roku-ui/vue');
|
|
88
|
+
nuxt.options.build.transpile = transpile;
|
|
89
|
+
}
|
|
90
|
+
nuxt.hook('prepare:types', ({ references }) => {
|
|
91
|
+
references.push({
|
|
92
|
+
path: resolve('./module.d.ts'),
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
nuxt.hook('unocss:config', (config) => {
|
|
96
|
+
const presets = config.presets || [];
|
|
97
|
+
const filteredPresets = presets.filter((preset) => {
|
|
98
|
+
const name = preset.name;
|
|
99
|
+
return !(name && name.startsWith('preset-wind'));
|
|
100
|
+
});
|
|
101
|
+
config.presets = filteredPresets;
|
|
102
|
+
const hasRokuPreset = config.presets.some((preset) => {
|
|
103
|
+
const name = preset.name;
|
|
104
|
+
return name === '@roku-ui/preset';
|
|
105
|
+
});
|
|
106
|
+
if (!hasRokuPreset) {
|
|
107
|
+
config.presets.push(rokuPreset());
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@roku-ui/nuxt",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.30.0",
|
|
5
|
+
"author": "Jianqi Pan <jannchie@gmail.com>",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/roku-ui/roku-ui-vue"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public",
|
|
12
|
+
"registry": "https://registry.npmjs.org/"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/module.d.ts",
|
|
17
|
+
"import": "./dist/module.js",
|
|
18
|
+
"require": "./dist/module.js"
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/module.js",
|
|
23
|
+
"module": "./dist/module.js",
|
|
24
|
+
"types": "./dist/module.d.ts",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@nuxt/kit": "^3.0.0 || ^4.0.0",
|
|
30
|
+
"nuxt": "^3.0.0 || ^4.0.0",
|
|
31
|
+
"@roku-ui/vue": "^0.30.0"
|
|
32
|
+
},
|
|
33
|
+
"peerDependenciesMeta": {
|
|
34
|
+
"@nuxt/kit": {
|
|
35
|
+
"optional": true
|
|
36
|
+
},
|
|
37
|
+
"nuxt": {
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@roku-ui/preset": "^0.30.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@nuxt/kit": "^4.2.1",
|
|
46
|
+
"@nuxt/schema": "^4.2.1",
|
|
47
|
+
"typescript": "5.9.3",
|
|
48
|
+
"unocss": "66.5.10"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc -p tsconfig.json"
|
|
52
|
+
}
|
|
53
|
+
}
|