-
Notifications
You must be signed in to change notification settings - Fork 2
/
boilerplates.config.js
63 lines (61 loc) · 1.43 KB
/
boilerplates.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
[
{
name: 'react',
variants: ['componentName'],
template: [
[
'{{componentName}sc}/{{componentName}pc}.tsx',
`import './style/index.scss';
interface {{componentName}pc}Props {}
export default function {{componentName}pc}({}: {{componentName}pc}Props) {
return <div className="{{componentName}kc}"></div>;
}
`,
],
[
'{{componentName}sc}/index.ts',
`import {{componentName}pc} from './{{componentName}pc}';
export default {{componentName}pc};
`,
],
[
'{{componentName}sc}/style/index.scss',
`@use '~styles/appColors' as *;
.{{componentName}kc} {
}
`,
],
[
'{{componentName}sc}/{{componentName}pc}.stories.tsx',
`import { ComponentProps } from 'react';
import type { Story } from '@storybook/react';
import {{componentName}pc} from './{{componentName}pc}';
export default {
title: '{{componentName}pc}',
component: {{componentName}pc},
};
const Template: Story<ComponentProps<typeof {{componentName}pc}>> = (args) => (
<{{componentName}pc} {...args} />
);
export const FirstStory = Template
FirstStory.args = {};
`,
],
],
},
{
name: 'zustand',
variants: ['storeName'],
template: [
[
'{{storeName}cc}Store.ts',
`import create from 'zustand';
interface {{storeName}pc}State {}
export const use{{storeName}pc}Store = create<{{storeName}pc}State>(
(set) => ({}),
);
`,
],
],
},
];