@repodog/storybook-config 0.0.3 → 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.
Files changed (3) hide show
  1. package/README.md +19 -3
  2. package/index.mjs +14 -3
  3. package/package.json +1 -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/react @storybook/react-webpack5 @storybook/test eslint-plugin-storybook --save-dev
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 repodogConfig } from '@repodog/storybook-config';
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
- ...repodogConfig
67
+ ...storybookConfig({ compiler: 'babel' })
52
68
  };
53
69
 
54
70
  export default config;
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export const config = {
1
+ export const config = ({ compiler } = {}) => ({
2
2
  addons: [
3
3
  '@storybook/addon-links',
4
4
  '@storybook/addon-essentials',
@@ -9,6 +9,17 @@ export const config = {
9
9
  docs: {
10
10
  autodocs: 'tag',
11
11
  },
12
- framework: '@storybook/nextjs',
12
+ framework: {
13
+ name: '@storybook/nextjs',
14
+ ...(compiler === 'swc'
15
+ ? {
16
+ options: {
17
+ builder: {
18
+ useSWC: true,
19
+ },
20
+ },
21
+ }
22
+ : {}),
23
+ },
13
24
  stories: ['../**/*.stories.*'],
14
- };
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.3",
4
+ "version": "0.0.4",
5
5
  "author": "Dylan Aubrey",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/badbatch/repodog",