create-rslib 0.8.0 → 0.9.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.
Files changed (80) hide show
  1. package/dist/index.js +64 -5
  2. package/package.json +4 -4
  3. package/template-[node-dual]-[]-ts/package.json +1 -1
  4. package/template-[node-dual]-[vitest]-ts/package.json +1 -1
  5. package/template-[node-esm]-[]-ts/package.json +1 -1
  6. package/template-[node-esm]-[vitest]-ts/package.json +1 -1
  7. package/template-[react]-[]-ts/package.json +1 -1
  8. package/template-[react]-[storybook,vitest]-js/package.json +1 -1
  9. package/template-[react]-[storybook,vitest]-ts/package.json +2 -2
  10. package/template-[react]-[storybook]-js/package.json +1 -1
  11. package/template-[react]-[storybook]-ts/package.json +2 -2
  12. package/template-[react]-[vitest]-ts/package.json +1 -1
  13. package/template-[vue]-[]-js/package.json +27 -0
  14. package/template-[vue]-[]-js/rslib.config.ts +15 -0
  15. package/template-[vue]-[]-js/src/Button.vue +43 -0
  16. package/template-[vue]-[]-js/src/index.js +1 -0
  17. package/template-[vue]-[]-js/src/style.css +34 -0
  18. package/template-[vue]-[]-ts/package.json +29 -0
  19. package/template-[vue]-[]-ts/rslib.config.ts +15 -0
  20. package/template-[vue]-[]-ts/src/Button.vue +35 -0
  21. package/template-[vue]-[]-ts/src/index.ts +1 -0
  22. package/template-[vue]-[]-ts/src/style.css +34 -0
  23. package/template-[vue]-[]-ts/tsconfig.json +25 -0
  24. package/template-[vue]-[storybook,vitest]-js/.storybook/main.js +37 -0
  25. package/template-[vue]-[storybook,vitest]-js/.storybook/preview.js +12 -0
  26. package/template-[vue]-[storybook,vitest]-js/package.json +46 -0
  27. package/template-[vue]-[storybook,vitest]-js/rslib.config.ts +15 -0
  28. package/template-[vue]-[storybook,vitest]-js/src/Button.vue +43 -0
  29. package/template-[vue]-[storybook,vitest]-js/src/index.js +1 -0
  30. package/template-[vue]-[storybook,vitest]-js/src/style.css +34 -0
  31. package/template-[vue]-[storybook,vitest]-js/stories/Button.stories.js +50 -0
  32. package/template-[vue]-[storybook,vitest]-js/tests/index.test.js +16 -0
  33. package/template-[vue]-[storybook,vitest]-js/vitest.config.js +13 -0
  34. package/template-[vue]-[storybook,vitest]-js/vitest.setup.js +1 -0
  35. package/template-[vue]-[storybook,vitest]-ts/.storybook/main.ts +38 -0
  36. package/template-[vue]-[storybook,vitest]-ts/.storybook/preview.ts +12 -0
  37. package/template-[vue]-[storybook,vitest]-ts/package.json +48 -0
  38. package/template-[vue]-[storybook,vitest]-ts/rslib.config.ts +15 -0
  39. package/template-[vue]-[storybook,vitest]-ts/src/Button.vue +35 -0
  40. package/template-[vue]-[storybook,vitest]-ts/src/index.ts +1 -0
  41. package/template-[vue]-[storybook,vitest]-ts/src/style.css +34 -0
  42. package/template-[vue]-[storybook,vitest]-ts/stories/Button.stories.js +50 -0
  43. package/template-[vue]-[storybook,vitest]-ts/tests/index.test.ts +16 -0
  44. package/template-[vue]-[storybook,vitest]-ts/tsconfig.json +25 -0
  45. package/template-[vue]-[storybook,vitest]-ts/vitest.config.js +13 -0
  46. package/template-[vue]-[storybook,vitest]-ts/vitest.setup.js +1 -0
  47. package/template-[vue]-[storybook]-js/.storybook/main.js +37 -0
  48. package/template-[vue]-[storybook]-js/.storybook/preview.js +12 -0
  49. package/template-[vue]-[storybook]-js/package.json +40 -0
  50. package/template-[vue]-[storybook]-js/rslib.config.ts +15 -0
  51. package/template-[vue]-[storybook]-js/src/Button.vue +43 -0
  52. package/template-[vue]-[storybook]-js/src/index.js +1 -0
  53. package/template-[vue]-[storybook]-js/src/style.css +34 -0
  54. package/template-[vue]-[storybook]-js/stories/Button.stories.js +50 -0
  55. package/template-[vue]-[storybook]-ts/.storybook/main.ts +38 -0
  56. package/template-[vue]-[storybook]-ts/.storybook/preview.ts +12 -0
  57. package/template-[vue]-[storybook]-ts/package.json +42 -0
  58. package/template-[vue]-[storybook]-ts/rslib.config.ts +15 -0
  59. package/template-[vue]-[storybook]-ts/src/Button.vue +35 -0
  60. package/template-[vue]-[storybook]-ts/src/index.ts +1 -0
  61. package/template-[vue]-[storybook]-ts/src/style.css +34 -0
  62. package/template-[vue]-[storybook]-ts/stories/Button.stories.js +50 -0
  63. package/template-[vue]-[storybook]-ts/tsconfig.json +25 -0
  64. package/template-[vue]-[vitest]-js/package.json +33 -0
  65. package/template-[vue]-[vitest]-js/rslib.config.ts +15 -0
  66. package/template-[vue]-[vitest]-js/src/Button.vue +43 -0
  67. package/template-[vue]-[vitest]-js/src/index.js +1 -0
  68. package/template-[vue]-[vitest]-js/src/style.css +34 -0
  69. package/template-[vue]-[vitest]-js/tests/index.test.js +16 -0
  70. package/template-[vue]-[vitest]-js/vitest.config.js +13 -0
  71. package/template-[vue]-[vitest]-js/vitest.setup.js +1 -0
  72. package/template-[vue]-[vitest]-ts/package.json +35 -0
  73. package/template-[vue]-[vitest]-ts/rslib.config.ts +15 -0
  74. package/template-[vue]-[vitest]-ts/src/Button.vue +35 -0
  75. package/template-[vue]-[vitest]-ts/src/index.ts +1 -0
  76. package/template-[vue]-[vitest]-ts/src/style.css +34 -0
  77. package/template-[vue]-[vitest]-ts/tests/index.test.ts +16 -0
  78. package/template-[vue]-[vitest]-ts/tsconfig.json +25 -0
  79. package/template-[vue]-[vitest]-ts/vitest.config.js +13 -0
  80. package/template-[vue]-[vitest]-ts/vitest.setup.js +1 -0
package/dist/index.js CHANGED
@@ -103,6 +103,58 @@ const TEMPLATES = [
103
103
  storybook: 'storybook-react-ts',
104
104
  vitest: 'vitest-react-ts'
105
105
  }
106
+ },
107
+ {
108
+ template: 'vue',
109
+ lang: 'js'
110
+ },
111
+ {
112
+ template: 'vue',
113
+ lang: 'js',
114
+ tools: {
115
+ storybook: 'storybook-vue-js'
116
+ }
117
+ },
118
+ {
119
+ template: 'vue',
120
+ lang: 'js',
121
+ tools: {
122
+ vitest: 'vitest-vue-js'
123
+ }
124
+ },
125
+ {
126
+ template: 'vue',
127
+ lang: 'js',
128
+ tools: {
129
+ storybook: 'storybook-vue-js',
130
+ vitest: 'vitest-vue-js'
131
+ }
132
+ },
133
+ {
134
+ template: 'vue',
135
+ lang: 'ts'
136
+ },
137
+ {
138
+ template: 'vue',
139
+ lang: 'ts',
140
+ tools: {
141
+ storybook: 'storybook-vue-ts'
142
+ }
143
+ },
144
+ {
145
+ template: 'vue',
146
+ lang: 'ts',
147
+ tools: {
148
+ vitest: 'vitest-vue-ts'
149
+ }
150
+ },
151
+ {
152
+ template: 'vue',
153
+ lang: 'ts',
154
+ tools: {
155
+ storybook: 'storybook-vue-ts',
156
+ vitest: 'vitest-vue-ts'
157
+ }
106
158
  }
107
159
  ];
108
160
  const src_dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url));
@@ -119,17 +171,21 @@ async function getTemplateName({ template }) {
119
171
  const templateName = (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.checkCancel)(await (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.select)({
120
172
  message: 'Select template',
121
173
  options: [
122
- {
123
- value: 'node-dual',
124
- label: 'Node.js dual ESM/CJS package'
125
- },
126
174
  {
127
175
  value: 'node-esm',
128
176
  label: 'Node.js pure ESM package'
129
177
  },
178
+ {
179
+ value: 'node-dual',
180
+ label: 'Node.js dual ESM/CJS package'
181
+ },
130
182
  {
131
183
  value: 'react',
132
184
  label: 'React'
185
+ },
186
+ {
187
+ value: 'vue',
188
+ label: 'Vue'
133
189
  }
134
190
  ]
135
191
  }));
@@ -146,7 +202,10 @@ async function getTemplateName({ template }) {
146
202
  }
147
203
  ]
148
204
  }));
149
- const supportStorybook = 'react' === templateName;
205
+ const supportStorybook = [
206
+ 'react',
207
+ 'vue'
208
+ ].includes(templateName);
150
209
  const tools = (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.checkCancel)(await (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.multiselect)({
151
210
  message: 'Select development tools (Use <space> to select, <enter> to continue)',
152
211
  required: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rslib",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Create a new Rslib project",
5
5
  "homepage": "https://lib.rsbuild.dev",
6
6
  "repository": {
@@ -26,10 +26,10 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/fs-extra": "^11.0.4",
29
- "@types/node": "^22.8.1",
29
+ "@types/node": "^22.15.21",
30
30
  "fs-extra": "^11.3.0",
31
31
  "rsbuild-plugin-publint": "^0.3.2",
32
- "rslib": "npm:@rslib/core@0.7.1",
32
+ "rslib": "npm:@rslib/core@0.8.0",
33
33
  "tsx": "^4.19.4",
34
34
  "typescript": "^5.8.3",
35
35
  "@rslib/tsconfig": "0.0.1"
@@ -43,7 +43,7 @@
43
43
  "registry": "https://registry.npmjs.org/"
44
44
  },
45
45
  "scripts": {
46
- "build": "rslib build && pnpm generate-templates",
46
+ "build": "rslib build",
47
47
  "dev": "rslib build --watch",
48
48
  "generate-templates": "pnpm tsx ./src/genTemplates.ts",
49
49
  "start": "node ./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@rslib/core": "workspace:*",
23
- "@types/node": "^22.8.1",
23
+ "@types/node": "^22.15.21",
24
24
  "typescript": "^5.8.3"
25
25
  }
26
26
  }
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@rslib/core": "workspace:*",
24
- "@types/node": "^22.8.1",
24
+ "@types/node": "^22.15.21",
25
25
  "typescript": "^5.8.3",
26
26
  "vitest": "^3.1.4"
27
27
  }
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rslib/core": "workspace:*",
21
- "@types/node": "^22.8.1",
21
+ "@types/node": "^22.15.21",
22
22
  "typescript": "^5.8.3"
23
23
  }
24
24
  }
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rslib/core": "workspace:*",
22
- "@types/node": "^22.8.1",
22
+ "@types/node": "^22.15.21",
23
23
  "typescript": "^5.8.3",
24
24
  "vitest": "^3.1.4"
25
25
  }
@@ -19,7 +19,7 @@
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-react": "^1.3.1",
21
21
  "@rslib/core": "workspace:*",
22
- "@types/react": "^19.1.4",
22
+ "@types/react": "^19.1.5",
23
23
  "react": "^19.1.0",
24
24
  "typescript": "^5.8.3"
25
25
  },
@@ -18,7 +18,7 @@
18
18
  "test": "vitest run"
19
19
  },
20
20
  "devDependencies": {
21
- "@rsbuild/core": "^1.3.20",
21
+ "@rsbuild/core": "^1.3.21",
22
22
  "@rsbuild/plugin-react": "^1.3.1",
23
23
  "@rslib/core": "workspace:*",
24
24
  "@storybook/addon-essentials": "^8.6.14",
@@ -20,7 +20,7 @@
20
20
  "test": "vitest run"
21
21
  },
22
22
  "devDependencies": {
23
- "@rsbuild/core": "^1.3.20",
23
+ "@rsbuild/core": "^1.3.21",
24
24
  "@rsbuild/plugin-react": "^1.3.1",
25
25
  "@rslib/core": "workspace:*",
26
26
  "@storybook/addon-essentials": "^8.6.14",
@@ -32,7 +32,7 @@
32
32
  "@storybook/test": "^8.6.14",
33
33
  "@testing-library/jest-dom": "^6.6.3",
34
34
  "@testing-library/react": "^16.3.0",
35
- "@types/react": "^19.1.4",
35
+ "@types/react": "^19.1.5",
36
36
  "jsdom": "^26.1.0",
37
37
  "react": "^19.1.0",
38
38
  "storybook": "^8.6.14",
@@ -17,7 +17,7 @@
17
17
  "storybook": "storybook dev"
18
18
  },
19
19
  "devDependencies": {
20
- "@rsbuild/core": "^1.3.20",
20
+ "@rsbuild/core": "^1.3.21",
21
21
  "@rsbuild/plugin-react": "^1.3.1",
22
22
  "@rslib/core": "workspace:*",
23
23
  "@storybook/addon-essentials": "^8.6.14",
@@ -19,7 +19,7 @@
19
19
  "storybook": "storybook dev"
20
20
  },
21
21
  "devDependencies": {
22
- "@rsbuild/core": "^1.3.20",
22
+ "@rsbuild/core": "^1.3.21",
23
23
  "@rsbuild/plugin-react": "^1.3.1",
24
24
  "@rslib/core": "workspace:*",
25
25
  "@storybook/addon-essentials": "^8.6.14",
@@ -29,7 +29,7 @@
29
29
  "@storybook/blocks": "^8.6.14",
30
30
  "@storybook/react": "^8.6.14",
31
31
  "@storybook/test": "^8.6.14",
32
- "@types/react": "^19.1.4",
32
+ "@types/react": "^19.1.5",
33
33
  "react": "^19.1.0",
34
34
  "storybook": "^8.6.14",
35
35
  "storybook-addon-rslib": "^1.0.1",
@@ -22,7 +22,7 @@
22
22
  "@rslib/core": "workspace:*",
23
23
  "@testing-library/jest-dom": "^6.6.3",
24
24
  "@testing-library/react": "^16.3.0",
25
- "@types/react": "^19.1.4",
25
+ "@types/react": "^19.1.5",
26
26
  "jsdom": "^26.1.0",
27
27
  "react": "^19.1.0",
28
28
  "typescript": "^5.8.3",
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "rslib-vue-js",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "rslib build",
17
+ "dev": "rslib build --watch"
18
+ },
19
+ "devDependencies": {
20
+ "@rslib/core": "workspace:*",
21
+ "rsbuild-plugin-unplugin-vue": "^0.1.0",
22
+ "vue": "^3.2.0"
23
+ },
24
+ "peerDependencies": {
25
+ "vue": "^3.2.0"
26
+ }
27
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from '@rslib/core';
2
+ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
3
+
4
+ export default defineConfig({
5
+ lib: [
6
+ {
7
+ bundle: false,
8
+ format: 'esm',
9
+ },
10
+ ],
11
+ output: {
12
+ target: 'web',
13
+ },
14
+ plugins: [pluginUnpluginVue()],
15
+ });
@@ -0,0 +1,43 @@
1
+ <script setup>
2
+ import { computed } from 'vue';
3
+ import './style.css';
4
+
5
+ const {
6
+ primary = false,
7
+ backgroundColor,
8
+ size = 'medium',
9
+ label,
10
+ onClick,
11
+ } = defineProps({
12
+ primary: {
13
+ type: Boolean,
14
+ },
15
+ backgroundColor: {
16
+ type: String,
17
+ },
18
+ size: {
19
+ type: String,
20
+ },
21
+ label: {
22
+ type: String,
23
+ },
24
+ onClick: {
25
+ type: Function,
26
+ },
27
+ });
28
+
29
+ const mode = computed(() =>
30
+ primary ? 'demo-button--primary' : 'demo-button--secondary',
31
+ );
32
+ </script>
33
+
34
+ <template>
35
+ <button
36
+ type="button"
37
+ :class="['demo-button', `demo-button--${size}`, mode]"
38
+ :style="{ backgroundColor }"
39
+ @click="onClick"
40
+ >
41
+ {{ label }}
42
+ </button>
43
+ </template>
@@ -0,0 +1 @@
1
+ export { default as Button } from './Button.vue';
@@ -0,0 +1,34 @@
1
+ .demo-button {
2
+ font-weight: 700;
3
+ border: 0;
4
+ border-radius: 3em;
5
+ cursor: pointer;
6
+ display: inline-block;
7
+ line-height: 1;
8
+ }
9
+
10
+ .demo-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+
15
+ .demo-button--secondary {
16
+ color: #333;
17
+ background-color: transparent;
18
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
19
+ }
20
+
21
+ .demo-button--small {
22
+ font-size: 12px;
23
+ padding: 10px 16px;
24
+ }
25
+
26
+ .demo-button--medium {
27
+ font-size: 14px;
28
+ padding: 11px 20px;
29
+ }
30
+
31
+ .demo-button--large {
32
+ font-size: 16px;
33
+ padding: 12px 24px;
34
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "rslib-vue-ts",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "rslib build && vue-tsc",
17
+ "dev": "rslib build --watch"
18
+ },
19
+ "devDependencies": {
20
+ "@rslib/core": "workspace:*",
21
+ "rsbuild-plugin-unplugin-vue": "^0.1.0",
22
+ "typescript": "^5.8.3",
23
+ "vue": "^3.2.0",
24
+ "vue-tsc": "^2.2.10"
25
+ },
26
+ "peerDependencies": {
27
+ "vue": "^3.2.0"
28
+ }
29
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from '@rslib/core';
2
+ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
3
+
4
+ export default defineConfig({
5
+ lib: [
6
+ {
7
+ bundle: false,
8
+ format: 'esm',
9
+ },
10
+ ],
11
+ output: {
12
+ target: 'web',
13
+ },
14
+ plugins: [pluginUnpluginVue()],
15
+ });
@@ -0,0 +1,35 @@
1
+ <script setup lang="ts">
2
+ import { computed } from 'vue';
3
+ import './style.css';
4
+
5
+ interface Props {
6
+ primary?: boolean;
7
+ backgroundColor?: string;
8
+ size?: 'small' | 'medium' | 'large';
9
+ label: string;
10
+ onClick?: () => void;
11
+ }
12
+
13
+ const {
14
+ primary = false,
15
+ backgroundColor = undefined,
16
+ size = 'medium',
17
+ label,
18
+ onClick = undefined,
19
+ } = defineProps<Props>();
20
+
21
+ const mode = computed(() =>
22
+ primary ? 'demo-button--primary' : 'demo-button--secondary',
23
+ );
24
+ </script>
25
+
26
+ <template>
27
+ <button
28
+ type="button"
29
+ :class="['demo-button', `demo-button--${size}`, mode]"
30
+ :style="{ backgroundColor }"
31
+ @click="onClick"
32
+ >
33
+ {{ label }}
34
+ </button>
35
+ </template>
@@ -0,0 +1 @@
1
+ export { default as Button } from './Button.vue';
@@ -0,0 +1,34 @@
1
+ .demo-button {
2
+ font-weight: 700;
3
+ border: 0;
4
+ border-radius: 3em;
5
+ cursor: pointer;
6
+ display: inline-block;
7
+ line-height: 1;
8
+ }
9
+
10
+ .demo-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+
15
+ .demo-button--secondary {
16
+ color: #333;
17
+ background-color: transparent;
18
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
19
+ }
20
+
21
+ .demo-button--small {
22
+ font-size: 12px;
23
+ padding: 10px 16px;
24
+ }
25
+
26
+ .demo-button--medium {
27
+ font-size: 14px;
28
+ padding: 11px 20px;
29
+ }
30
+
31
+ .demo-button--large {
32
+ font-size: 16px;
33
+ padding: 12px 24px;
34
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["DOM", "ES2020"],
4
+ "jsx": "preserve",
5
+ "target": "ES2020",
6
+ "skipLibCheck": true,
7
+ "jsxImportSource": "vue",
8
+ "useDefineForClassFields": true,
9
+ "declaration": true,
10
+ "outDir": "dist",
11
+ "emitDeclarationOnly": true,
12
+
13
+ /* modules */
14
+ "module": "ESNext",
15
+ "isolatedModules": true,
16
+ "resolveJsonModule": true,
17
+ "moduleResolution": "bundler",
18
+
19
+ /* type checking */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true
23
+ },
24
+ "include": ["src"]
25
+ }
@@ -0,0 +1,37 @@
1
+ import { dirname, join } from 'node:path';
2
+
3
+ /**
4
+ * This function is used to resolve the absolute path of a package.
5
+ * It is needed in projects that use Yarn PnP or are set up within a monorepo.
6
+ */
7
+ function getAbsolutePath(value) {
8
+ return dirname(require.resolve(join(value, 'package.json')));
9
+ }
10
+
11
+ const config = {
12
+ stories: [
13
+ '../stories/**/*.mdx',
14
+ '../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)',
15
+ ],
16
+ addons: [
17
+ '@storybook/addon-onboarding',
18
+ '@storybook/addon-links',
19
+ '@storybook/addon-essentials',
20
+ '@storybook/addon-interactions',
21
+ {
22
+ name: getAbsolutePath('storybook-addon-rslib'),
23
+ },
24
+ ],
25
+ framework: {
26
+ name: getAbsolutePath('storybook-vue3-rsbuild'),
27
+ options: {},
28
+ },
29
+ docs: {
30
+ autodocs: 'tag',
31
+ },
32
+ typescript: {
33
+ check: true,
34
+ },
35
+ };
36
+
37
+ export default config;
@@ -0,0 +1,12 @@
1
+ const preview = {
2
+ parameters: {
3
+ controls: {
4
+ matchers: {
5
+ color: /(background|color)$/i,
6
+ date: /Date$/i,
7
+ },
8
+ },
9
+ },
10
+ };
11
+
12
+ export default preview;
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "rslib-vue-js",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js"
9
+ }
10
+ },
11
+ "types": "./dist/index.d.ts",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "scripts": {
16
+ "build": "rslib build",
17
+ "build:storybook": "storybook build",
18
+ "dev": "rslib build --watch",
19
+ "storybook": "storybook dev",
20
+ "test": "vitest run"
21
+ },
22
+ "devDependencies": {
23
+ "@rsbuild/core": "1.3.14",
24
+ "@rslib/core": "workspace:*",
25
+ "@storybook/addon-essentials": "^8.6.12",
26
+ "@storybook/addon-interactions": "^8.6.12",
27
+ "@storybook/addon-links": "^8.6.12",
28
+ "@storybook/addon-onboarding": "^8.6.12",
29
+ "@storybook/blocks": "^8.6.12",
30
+ "@storybook/test": "^8.6.12",
31
+ "@storybook/vue3": "^8.6.12",
32
+ "@testing-library/jest-dom": "^6.6.3",
33
+ "@testing-library/vue": "^8.1.0",
34
+ "@vitejs/plugin-vue": "^5.2.3",
35
+ "jsdom": "^26.1.0",
36
+ "rsbuild-plugin-unplugin-vue": "^0.1.0",
37
+ "storybook": "^8.6.12",
38
+ "storybook-addon-rslib": "^1.0.1",
39
+ "storybook-vue3-rsbuild": "^1.0.1",
40
+ "vitest": "^3.1.2",
41
+ "vue": "^3.2.0"
42
+ },
43
+ "peerDependencies": {
44
+ "vue": "^3.2.0"
45
+ }
46
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from '@rslib/core';
2
+ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
3
+
4
+ export default defineConfig({
5
+ lib: [
6
+ {
7
+ bundle: false,
8
+ format: 'esm',
9
+ },
10
+ ],
11
+ output: {
12
+ target: 'web',
13
+ },
14
+ plugins: [pluginUnpluginVue()],
15
+ });
@@ -0,0 +1,43 @@
1
+ <script setup>
2
+ import { computed } from 'vue';
3
+ import './style.css';
4
+
5
+ const {
6
+ primary = false,
7
+ backgroundColor,
8
+ size = 'medium',
9
+ label,
10
+ onClick,
11
+ } = defineProps({
12
+ primary: {
13
+ type: Boolean,
14
+ },
15
+ backgroundColor: {
16
+ type: String,
17
+ },
18
+ size: {
19
+ type: String,
20
+ },
21
+ label: {
22
+ type: String,
23
+ },
24
+ onClick: {
25
+ type: Function,
26
+ },
27
+ });
28
+
29
+ const mode = computed(() =>
30
+ primary ? 'demo-button--primary' : 'demo-button--secondary',
31
+ );
32
+ </script>
33
+
34
+ <template>
35
+ <button
36
+ type="button"
37
+ :class="['demo-button', `demo-button--${size}`, mode]"
38
+ :style="{ backgroundColor }"
39
+ @click="onClick"
40
+ >
41
+ {{ label }}
42
+ </button>
43
+ </template>
@@ -0,0 +1 @@
1
+ export { default as Button } from './Button.vue';