Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44b42f3
update tsup config to only output ESM
JReinhold Jul 21, 2025
ade228b
update export map, move @storybook/icons to devDependency, upgrade de…
JReinhold Jul 21, 2025
e1cd97a
cleanup comments
JReinhold Jul 21, 2025
44a02a4
CJS > ESM in root preset.js
JReinhold Aug 21, 2025
1e3259d
Fix default keywords
shilman Sep 17, 2025
f3150a5
Merge branch 'main' of github.com:storybookjs/addon-kit into esm-only
JReinhold Sep 25, 2025
6aec678
add index entry for CSF Factories support
JReinhold Sep 25, 2025
1adaa6c
fix build targets
JReinhold Sep 25, 2025
2976b50
reintroduce presets
yannbf Oct 6, 2025
096b3c7
fix exports again
yannbf Oct 6, 2025
5d605af
Add manager-helpers example
Sidnioulz Oct 20, 2025
ada12ff
Update package dependencies to use 'next' versions and add new devDep…
ndelangen Oct 21, 2025
3115ec8
Update GitHub Actions workflows to install dependencies without ignor…
ndelangen Oct 21, 2025
ee26c8c
Refactor welcome.js for improved readability and consistency in forma…
ndelangen Oct 21, 2025
1facf8f
switch to yarn because npm has a bug with optionalDependencies
ndelangen Oct 21, 2025
a682ef5
Update GitHub Actions workflows to use Yarn for dependency management…
ndelangen Oct 21, 2025
608519b
Add corepack enable step to GitHub Actions workflows
ndelangen Oct 21, 2025
ea6de39
Update .gitignore to include yarn install state and update yarn.lock …
ndelangen Oct 21, 2025
5c101de
deal with tsconfig error
ndelangen Oct 21, 2025
b32c936
Fix default keywords (#85)
Sidnioulz Oct 27, 2025
5502295
Switch to PNPM
Sidnioulz Oct 27, 2025
8e58d2f
Add ESLint support
Sidnioulz Oct 27, 2025
211d352
Fix condition to prevent release triggers on the template repo
Sidnioulz Oct 27, 2025
b51bdc3
CI: Cancel build on PR because it duplicates jobs
Sidnioulz Oct 27, 2025
221f630
Remove irrelevant pnpm rule I was testing out
Sidnioulz Oct 27, 2025
d7e22f0
Add manager-helpers example (#86)
Sidnioulz Oct 27, 2025
c5f3840
Remove dangling yarn RC file
Sidnioulz Oct 27, 2025
ecaa79d
Merge pull request #87 from storybookjs/switch-to-pnpm
ndelangen Oct 28, 2025
bb849ea
Refactor imports in manager.ts and manager-helpers.tsx for consistency
ndelangen Oct 28, 2025
187b38b
Apply suggestion from @Sidnioulz
JReinhold Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,59 @@ name: Build
on: [push]

jobs:
release:
lint:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
node-version: [20.19, 22.12]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Check for linter errors
run: pnpm lint

build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
node-version: [20.19, 22.12]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Prepare repository
run: git fetch --unshallow --tags
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 20.x
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: ${{ matrix.node-version }}
cache: 'pnpm'

- name: Install dependencies
run: npm install --ignore-scripts
run: pnpm install

- name: Build
run: |
npm run build
- name: Build addon
run: pnpm build

- name: Build Storybook
run: |
npm run build-storybook
run: pnpm build-storybook
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@ on: [push]
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') && github.repository != 'storybookjs/addon-kit'"
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Prepare repository
run: git fetch --unshallow --tags

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'pnpm'

- name: Install dependencies
run: npm install --ignore-scripts
run: pnpm install

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm run release
pnpm run release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules/
storybook-static/
build-storybook.log
.DS_Store
.env
.env
.eslintcache
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
dist
pnpm-lock.yaml
node_modules
storybook-static
9 changes: 8 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
{}
{
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false
}
15 changes: 0 additions & 15 deletions .storybook/local-preset.cjs

This file was deleted.

14 changes: 14 additions & 0 deletions .storybook/local-preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { fileURLToPath } from 'node:url';

/**
* to load the built addon in this test Storybook
*/
export function previewAnnotations(entry = []) {
return [...entry, fileURLToPath(import.meta.resolve('../dist/preview.js'))];
}

export function managerEntries(entry = []) {
return [...entry, fileURLToPath(import.meta.resolve('../dist/manager.js'))];
}

export * from '../dist/preset.js';
8 changes: 4 additions & 4 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineMain } from "@storybook/react-vite/node";
import { defineMain } from '@storybook/react-vite/node';

const config = defineMain({
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
addons: ["@storybook/addon-docs", "./local-preset.cjs"],
framework: "@storybook/react-vite",
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-docs', import.meta.resolve('./local-preset.ts')],
framework: '@storybook/react-vite',
});

export default config;
15 changes: 15 additions & 0 deletions .storybook/manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { addons } from 'storybook/manager-api';

import { renderLabel } from '../src/manager-helpers';

/*
* This is an example of opt-in usage of addon exports. Your users can choose to
* import and use this helper, or not. Opt-in helpers should be exported in their
* own file rather than in `manager.tsx`, because importing `manager.tsx` multiple
* times can cause the addon registration code to run multiple times.
*/
addons.setConfig({
sidebar: {
renderLabel,
},
});
3 changes: 0 additions & 3 deletions .storybook/preview-head.html

This file was deleted.

4 changes: 2 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Preview } from "@storybook/react-vite";
import type { Preview } from '@storybook/react-vite';

const preview: Preview = {
parameters: {
Expand All @@ -10,7 +10,7 @@ const preview: Preview = {
},
},
initialGlobals: {
background: { value: "light" },
background: { value: 'light' },
},
};

Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ const meta: Meta<typeof Button> = {
myAddon: {
exampleParameter: true,
// See API section below for available parameters
}
}
},
},
};

export default meta;
Expand Down Expand Up @@ -183,14 +183,14 @@ registering the addon, like so:
// .storybook/main.ts

// Replace your-framework with the framework you are using (e.g., react-webpack5, vue3-vite)
import type { StorybookConfig } from "@storybook/your-framework";
import type { StorybookConfig } from '@storybook/your-framework';

const config: StorybookConfig = {
// ...rest of config
addons: [
"@storybook/addon-docs",
'@storybook/addon-docs',
{
name: "my-addon",
name: 'my-addon',
options: {
// 👈 options for my-addon go here
},
Expand Down
37 changes: 37 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import storybook from 'eslint-plugin-storybook';
import js from '@eslint/js';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import tseslint from 'typescript-eslint';

export default [
{
ignores: [
'.github/dependabot.yml',
'!.*',
'*.tgz',
'dist/',
'scripts/',
'coverage/',
'node_modules/',
'storybook-static/',
'build-storybook.log',
'.DS_Store',
'.env',
'.idea',
'.vscode',
],
},
js.configs.recommended,
reactPlugin.configs.flat.recommended,
{
settings: {
react: {
version: 'detect',
},
},
},
...tseslint.configs.recommended,
...storybook.configs['flat/recommended'],
prettierRecommended,
];
Loading