@repodog/storybook-config 0.0.2 → 0.0.4
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 +19 -3
- package/index.mjs +15 -3
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @repodog/storybook-config --save-dev
|
|
|
16
16
|
|
|
17
17
|
```shell
|
|
18
18
|
# terminal
|
|
19
|
-
npm install @storybook/addon-essentials @storybook/addon-interactions @storybook/addon-links @storybook/addon-onboarding @storybook/cli @storybook/
|
|
19
|
+
npm install @storybook/addon-essentials @storybook/addon-interactions @storybook/addon-links @storybook/addon-onboarding @storybook/cli @storybook/nextjs @storybook/react @storybook/test eslint-plugin-storybook --save-dev
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Use package
|
|
@@ -42,13 +42,29 @@ module.exports = {
|
|
|
42
42
|
};
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
### With SWC
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// .storybook/main.ts
|
|
49
|
+
import { config as storybookConfig } from '@repodog/storybook-config';
|
|
50
|
+
import { type StorybookConfig } from '@storybook/your-framework';
|
|
51
|
+
|
|
52
|
+
const config: StorybookConfig = {
|
|
53
|
+
...storybookConfig({ compiler: 'swc' })
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default config;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### With Babel
|
|
60
|
+
|
|
45
61
|
```typescript
|
|
46
62
|
// .storybook/main.ts
|
|
47
|
-
import { config as
|
|
63
|
+
import { config as storybookConfig } from '@repodog/storybook-config';
|
|
48
64
|
import { type StorybookConfig } from '@storybook/your-framework';
|
|
49
65
|
|
|
50
66
|
const config: StorybookConfig = {
|
|
51
|
-
...
|
|
67
|
+
...storybookConfig({ compiler: 'babel' })
|
|
52
68
|
};
|
|
53
69
|
|
|
54
70
|
export default config;
|
package/index.mjs
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
export const config = {
|
|
1
|
+
export const config = ({ compiler } = {}) => ({
|
|
2
2
|
addons: [
|
|
3
3
|
'@storybook/addon-links',
|
|
4
4
|
'@storybook/addon-essentials',
|
|
5
5
|
'@storybook/addon-onboarding',
|
|
6
|
+
'@storybook/addon-a11y',
|
|
6
7
|
'@storybook/addon-interactions',
|
|
7
8
|
],
|
|
8
9
|
docs: {
|
|
9
10
|
autodocs: 'tag',
|
|
10
11
|
},
|
|
11
|
-
framework:
|
|
12
|
+
framework: {
|
|
13
|
+
name: '@storybook/nextjs',
|
|
14
|
+
...(compiler === 'swc'
|
|
15
|
+
? {
|
|
16
|
+
options: {
|
|
17
|
+
builder: {
|
|
18
|
+
useSWC: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}
|
|
22
|
+
: {}),
|
|
23
|
+
},
|
|
12
24
|
stories: ['../**/*.stories.*'],
|
|
13
|
-
};
|
|
25
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repodog/storybook-config",
|
|
3
3
|
"description": "The RepoDog Storybook config module.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/repodog",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
+
"@storybook/addon-a11y": "<8",
|
|
29
30
|
"@storybook/addon-essentials": "<8",
|
|
30
31
|
"@storybook/addon-interactions": "<8",
|
|
31
32
|
"@storybook/addon-links": "<8",
|