create-rslib 0.7.1 → 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.
- package/dist/index.js +64 -5
- package/package.json +5 -5
- package/template-[node-dual]-[]-ts/package.json +1 -1
- package/template-[node-dual]-[vitest]-js/package.json +1 -1
- package/template-[node-dual]-[vitest]-ts/package.json +2 -2
- package/template-[node-esm]-[]-ts/package.json +1 -1
- package/template-[node-esm]-[vitest]-js/package.json +1 -1
- package/template-[node-esm]-[vitest]-ts/package.json +2 -2
- package/template-[react]-[]-ts/package.json +1 -1
- package/template-[react]-[storybook,vitest]-js/package.json +10 -10
- package/template-[react]-[storybook,vitest]-ts/package.json +11 -11
- package/template-[react]-[storybook]-js/package.json +9 -9
- package/template-[react]-[storybook]-ts/package.json +10 -10
- package/template-[react]-[vitest]-js/package.json +1 -1
- package/template-[react]-[vitest]-ts/package.json +2 -2
- package/template-[vue]-[]-js/package.json +27 -0
- package/template-[vue]-[]-js/rslib.config.ts +15 -0
- package/template-[vue]-[]-js/src/Button.vue +43 -0
- package/template-[vue]-[]-js/src/index.js +1 -0
- package/template-[vue]-[]-js/src/style.css +34 -0
- package/template-[vue]-[]-ts/package.json +29 -0
- package/template-[vue]-[]-ts/rslib.config.ts +15 -0
- package/template-[vue]-[]-ts/src/Button.vue +35 -0
- package/template-[vue]-[]-ts/src/index.ts +1 -0
- package/template-[vue]-[]-ts/src/style.css +34 -0
- package/template-[vue]-[]-ts/tsconfig.json +25 -0
- package/template-[vue]-[storybook,vitest]-js/.storybook/main.js +37 -0
- package/template-[vue]-[storybook,vitest]-js/.storybook/preview.js +12 -0
- package/template-[vue]-[storybook,vitest]-js/package.json +46 -0
- package/template-[vue]-[storybook,vitest]-js/rslib.config.ts +15 -0
- package/template-[vue]-[storybook,vitest]-js/src/Button.vue +43 -0
- package/template-[vue]-[storybook,vitest]-js/src/index.js +1 -0
- package/template-[vue]-[storybook,vitest]-js/src/style.css +34 -0
- package/template-[vue]-[storybook,vitest]-js/stories/Button.stories.js +50 -0
- package/template-[vue]-[storybook,vitest]-js/tests/index.test.js +16 -0
- package/template-[vue]-[storybook,vitest]-js/vitest.config.js +13 -0
- package/template-[vue]-[storybook,vitest]-js/vitest.setup.js +1 -0
- package/template-[vue]-[storybook,vitest]-ts/.storybook/main.ts +38 -0
- package/template-[vue]-[storybook,vitest]-ts/.storybook/preview.ts +12 -0
- package/template-[vue]-[storybook,vitest]-ts/package.json +48 -0
- package/template-[vue]-[storybook,vitest]-ts/rslib.config.ts +15 -0
- package/template-[vue]-[storybook,vitest]-ts/src/Button.vue +35 -0
- package/template-[vue]-[storybook,vitest]-ts/src/index.ts +1 -0
- package/template-[vue]-[storybook,vitest]-ts/src/style.css +34 -0
- package/template-[vue]-[storybook,vitest]-ts/stories/Button.stories.js +50 -0
- package/template-[vue]-[storybook,vitest]-ts/tests/index.test.ts +16 -0
- package/template-[vue]-[storybook,vitest]-ts/tsconfig.json +25 -0
- package/template-[vue]-[storybook,vitest]-ts/vitest.config.js +13 -0
- package/template-[vue]-[storybook,vitest]-ts/vitest.setup.js +1 -0
- package/template-[vue]-[storybook]-js/.storybook/main.js +37 -0
- package/template-[vue]-[storybook]-js/.storybook/preview.js +12 -0
- package/template-[vue]-[storybook]-js/package.json +40 -0
- package/template-[vue]-[storybook]-js/rslib.config.ts +15 -0
- package/template-[vue]-[storybook]-js/src/Button.vue +43 -0
- package/template-[vue]-[storybook]-js/src/index.js +1 -0
- package/template-[vue]-[storybook]-js/src/style.css +34 -0
- package/template-[vue]-[storybook]-js/stories/Button.stories.js +50 -0
- package/template-[vue]-[storybook]-ts/.storybook/main.ts +38 -0
- package/template-[vue]-[storybook]-ts/.storybook/preview.ts +12 -0
- package/template-[vue]-[storybook]-ts/package.json +42 -0
- package/template-[vue]-[storybook]-ts/rslib.config.ts +15 -0
- package/template-[vue]-[storybook]-ts/src/Button.vue +35 -0
- package/template-[vue]-[storybook]-ts/src/index.ts +1 -0
- package/template-[vue]-[storybook]-ts/src/style.css +34 -0
- package/template-[vue]-[storybook]-ts/stories/Button.stories.js +50 -0
- package/template-[vue]-[storybook]-ts/tsconfig.json +25 -0
- package/template-[vue]-[vitest]-js/package.json +33 -0
- package/template-[vue]-[vitest]-js/rslib.config.ts +15 -0
- package/template-[vue]-[vitest]-js/src/Button.vue +43 -0
- package/template-[vue]-[vitest]-js/src/index.js +1 -0
- package/template-[vue]-[vitest]-js/src/style.css +34 -0
- package/template-[vue]-[vitest]-js/tests/index.test.js +16 -0
- package/template-[vue]-[vitest]-js/vitest.config.js +13 -0
- package/template-[vue]-[vitest]-js/vitest.setup.js +1 -0
- package/template-[vue]-[vitest]-ts/package.json +35 -0
- package/template-[vue]-[vitest]-ts/rslib.config.ts +15 -0
- package/template-[vue]-[vitest]-ts/src/Button.vue +35 -0
- package/template-[vue]-[vitest]-ts/src/index.ts +1 -0
- package/template-[vue]-[vitest]-ts/src/style.css +34 -0
- package/template-[vue]-[vitest]-ts/tests/index.test.ts +16 -0
- package/template-[vue]-[vitest]-ts/tsconfig.json +25 -0
- package/template-[vue]-[vitest]-ts/vitest.config.js +13 -0
- package/template-[vue]-[vitest]-ts/vitest.setup.js +1 -0
|
@@ -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,16 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/vue';
|
|
2
|
+
import { expect, test } from 'vitest';
|
|
3
|
+
import Button from '../src/Button.vue';
|
|
4
|
+
|
|
5
|
+
test('The button should have correct background color', async () => {
|
|
6
|
+
render(Button, {
|
|
7
|
+
props: {
|
|
8
|
+
backgroundColor: '#ccc',
|
|
9
|
+
label: 'Demo Button',
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
const button = screen.getByText('Demo Button');
|
|
13
|
+
expect(button).toHaveStyle({
|
|
14
|
+
backgroundColor: '#ccc',
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -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,13 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
|
|
3
|
+
import pluginVue from '@vitejs/plugin-vue';
|
|
4
|
+
import { defineConfig } from 'vitest/config';
|
|
5
|
+
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
// Configure Vitest (https://vitest.dev/config/)
|
|
8
|
+
test: {
|
|
9
|
+
environment: 'jsdom',
|
|
10
|
+
setupFiles: './vitest.setup.js',
|
|
11
|
+
},
|
|
12
|
+
plugins: [pluginVue()],
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@testing-library/jest-dom/vitest';
|