Skip to content

Commit e19567f

Browse files
authored
Merge pull request #33 from MaxLikesCode/main
Upgrade addon to be compatible with Storybook v10
2 parents c9bc67c + 4262b95 commit e19567f

File tree

18 files changed

+237
-221
lines changed

18 files changed

+237
-221
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ jobs:
1111
with:
1212
fetch-depth: 0
1313

14-
- name: Use Node.js 20.x
14+
- name: Use Node.js 22.x
1515
uses: actions/setup-node@v3
16-
with:
17-
node-version: 20.x
1816

1917
- uses: pnpm/action-setup@v4
2018

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22.12

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{}
1+
{
2+
"trailingComma": "es5",
3+
"singleQuote": true,
4+
"printWidth": 120,
5+
"tabWidth": 2
6+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Get started in Storybook 7 faster with popular styling tools.
1212
- 🧩 Configuration templates for popular tools
1313
- ⚡️ Options for CSS modules, PostCSS, Sass, Less, and Vanilla-extract
1414

15-
## 🏁 Getting
15+
## 🏁 Getting Started
1616

1717
### 🤖 Automatic configuration
1818

@@ -78,9 +78,11 @@ It can also take Webpack plugins to add to the Storybook config.
7878
```
7979

8080
### 🧩 Popular Configurations
81+
8182
Below are a few popular configurations for common styling tools to get you started. More complex configurations are possible by combining the different rules below.
8283

8384
#### PostCSS
85+
8486
```js
8587
// Often used for tailwind
8688
{
@@ -99,7 +101,7 @@ Below are a few popular configurations for common styling tools to get you start
99101
{
100102
// Gets options from `postcss.config.js` in your project root
101103
loader: 'postcss-loader',
102-
options: { implementation: require.resolve('postcss') }
104+
options: { implementation: import.meta.resolve('postcss') }
103105
}
104106
],
105107
}
@@ -111,6 +113,7 @@ Below are a few popular configurations for common styling tools to get you start
111113
You can also take a look at this [example project](https://stackblitz.com/edit/github-5njuww?file=.storybook%2Fmain.ts) that uses PostCSS for **Tailwind** with Storybook:
112114
113115
#### CSS Modules
116+
114117
```js
115118
{
116119
name: '@storybook/addon-styling-webpack',
@@ -138,6 +141,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
138141
```
139142
140143
#### Sass
144+
141145
```js
142146
{
143147
name: '@storybook/addon-styling-webpack',
@@ -151,7 +155,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
151155
"css-loader",
152156
{
153157
loader: "sass-loader",
154-
options: { implementation: require.resolve("sass") }
158+
options: { implementation: import.meta.resolve("sass") }
155159
},
156160
],
157161
},
@@ -161,6 +165,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
161165
```
162166
163167
#### Less
168+
164169
```js
165170
{
166171
name: '@storybook/addon-styling-webpack',
@@ -174,7 +179,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
174179
"css-loader",
175180
{
176181
loader: "less-loader",
177-
options: { implementation: require.resolve("less") }
182+
options: { implementation: import.meta.resolve("less") }
178183
},
179184
],
180185
},
@@ -184,6 +189,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
184189
```
185190
186191
#### Vanilla-extract
192+
187193
```js
188194
{
189195
name: '@storybook/addon-styling-webpack',
@@ -197,9 +203,9 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
197203
test: /\.css$/,
198204
sideEffects: true,
199205
use: [
200-
require.resolve("style-loader"),
206+
import.meta.resolve("style-loader"),
201207
{
202-
loader: require.resolve("css-loader"),
208+
loader: import.meta.resolve("css-loader"),
203209
options: {},
204210
},
205211
],
@@ -212,7 +218,7 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
212218
use: [
213219
MiniCssExtractPlugin.loader,
214220
{
215-
loader: require.resolve('css-loader'),
221+
loader: import.meta.resolve('css-loader'),
216222
options: {
217223
// Required as image imports should be handled via JS/TS import statements
218224
url: false,
@@ -232,8 +238,8 @@ You can also take a look at this [example project](https://stackblitz.com/edit/g
232238
This isn't working in my monorepo.
233239
</summary>
234240
235-
Monorepos are a more advanced setup that may require a bit more configuration. To find out more. Refer to the Storybook FAQs on [monorepos](https://storybook.js.org/docs/faq#how-do-i-fix-module-resolution-in-special-environments).
236-
241+
Monorepos are a more advanced setup that may require a bit more configuration. To find out more. Refer to the Storybook FAQs on [monorepos](https://storybook.js.org/docs/faq#how-do-i-fix-module-resolution-in-special-environments).
242+
237243
</details>
238244
239245
## 🤝 Contributing

auto.config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
module.exports = {
2-
baseBranch: "main",
1+
export default {
2+
baseBranch: 'main',
33
labels: [
44
{
5-
name: "documentation",
6-
releaseType: "none",
5+
name: 'documentation',
6+
releaseType: 'none',
77
},
88
],
9-
prereleaseBranches: ["next", "prerelease"],
9+
prereleaseBranches: ['next', 'prerelease'],
1010
versionBranches: true,
1111
};

package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,19 @@
1818
"name": "Shaun Evening",
1919
"email": "goodeveningshaun@gmail.com"
2020
},
21+
"type": "module",
2122
"exports": {
2223
".": {
2324
"types": "./dist/index.d.ts",
24-
"require": "./dist/index.js",
25-
"import": "./dist/index.mjs"
25+
"default": "./dist/index.js"
2626
},
2727
"./preset": {
2828
"types": "./dist/preset.d.ts",
29-
"require": "./dist/preset.js",
30-
"import": "./dist/preset.mjs"
29+
"default": "./dist/preset.js"
3130
},
3231
"./package.json": "./package.json",
3332
"./postinstall": "./postinstall.js"
3433
},
35-
"main": "dist/index.js",
36-
"module": "dist/index.mjs",
37-
"types": "dist/index.d.ts",
3834
"files": [
3935
"bin/**/*",
4036
"dist/**/*",
@@ -45,20 +41,22 @@
4541
"scripts": {
4642
"build": "tsup",
4743
"build:watch": "pnpm build --watch",
44+
"format": "prettier --write .",
4845
"release": "auto shipit"
4946
},
5047
"devDependencies": {
5148
"@types/node": "^22.15.29",
5249
"auto": "^11.3.0",
50+
"picocolors": "^1.1.0",
5351
"prettier": "^3.5.3",
5452
"rimraf": "^6.0.1",
55-
"storybook": "^9.0.4",
53+
"storybook": "^10.0.0",
5654
"tsup": "^8.5.0",
57-
"typescript": "^5.8.3",
55+
"typescript": "^5.9.3",
5856
"webpack": "^5.99.9"
5957
},
6058
"peerDependencies": {
61-
"storybook": "^9.0.0",
59+
"storybook": "^10.0.0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0",
6260
"webpack": "^5.0.0"
6361
},
6462
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6",

0 commit comments

Comments
 (0)