Skip to content

Commit c0290a9

Browse files
authored
Storybook resurrect (#371)
* rip out existing * install and set up storybook, get Navigation story working sort of * gh pages? * try different deploy id * try deploy * arbitrary change * branch name fix * tidy up, fix linter * last tweaks * chlog, v++ * depas * menu
1 parent 291ef09 commit c0290a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5568
-9665
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy Storybook to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
permissions:
7+
contents: read
8+
pages: write
9+
id-token: write
10+
11+
concurrency:
12+
group: "storybook"
13+
cancel-in-progress: false
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- run: yarn install
26+
27+
- run: yarn build-storybook
28+
29+
- uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: ./storybook-static
32+
33+
deploy:
34+
needs: build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
steps:
40+
- uses: actions/deploy-pages@v4
41+
id: deployment

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ yarn-error.log*
3232
sh.exe.stackdump
3333
/dist
3434
/.vscode
35+
36+
*storybook.log
37+
storybook-static

.storybook/main.js

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
module.exports = {
2-
core: {
3-
builder: 'webpack5',
4-
},
5-
stories: ['../src/**/*.stories.@(js|mdx)'],
6-
addons: [
7-
{
8-
name: '@storybook/addon-docs',
9-
options: {
10-
configureJSX: true,
11-
babelOptions: {},
12-
sourceLoaderOptions: null
13-
}
14-
},
15-
'@storybook/addon-essentials',
16-
'@storybook/addon-actions'
17-
]
1+
/** @type { import('@storybook/react-webpack5').StorybookConfig } */
2+
const config = {
3+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
4+
addons: ['@storybook/addon-webpack5-compiler-swc', '@storybook/addon-docs'],
5+
framework: {
6+
name: '@storybook/react-webpack5',
7+
options: {}
8+
}
189
};
10+
export default config;

.storybook/manager.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

.storybook/preview.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type { import('@storybook/react-webpack5').Preview } */
2+
const preview = {
3+
parameters: {
4+
controls: {
5+
matchers: {
6+
color: /(background|color)$/i,
7+
date: /Date$/i,
8+
},
9+
},
10+
},
11+
};
12+
13+
export default preview;

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
2+
## [31.0.0] - 2025-07-04
3+
- resurrect storybook
4+
- simplify Navigation notifications prop - now just accepts one 'notifications' list, as opposed to seen and unseen lists. No longer accepts markNotificationSeen function
25
## [30.1.1] - 2025-07-03
36
- make InputField and Dropdown dark mode friendlier
47
## [30.1.0] - 2025-07-03

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ In the project directory, you can run:
2525
which runs the storybook dev server.
2626

2727
Make a new branch and add your new components, tests and stories in the relevant directories and view them in your local storybook.
28-
When you are ready to share your new component, add it to the rollup.config.js following the existing syntax and it will be transpiled and presented as a module export by the build command. Up the version number in package.json and then make a pull request for review.
28+
When you are ready to share your new component, add it to the index.js following the existing syntax and it will be bundled and presented as a module export by the build command. Up the version number in package.json and then make a pull request for review.
2929

3030
## Build, Test, Package and Deploy
3131
The build and tests will run automatically on commits to your branch if you have a pull request open.

eslint.config.js renamed to eslint.config.cjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2+
const storybook = require("eslint-plugin-storybook");
13
const react = require('eslint-plugin-react');
24
const globals = require('globals');
35
const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
@@ -6,11 +8,12 @@ const unusedImports = require('eslint-plugin-unused-imports');
68

79
module.exports = [
810
{
9-
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,test.js}'],
11+
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx,test.js,stories.js}'],
1012
plugins: {
1113
react,
1214
'react-hooks': reactHooks,
13-
'unused-imports': unusedImports
15+
'unused-imports': unusedImports,
16+
storybook
1417
},
1518
languageOptions: {
1619
parserOptions: {

0 commit comments

Comments
 (0)