Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 43 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +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: 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: 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: Enable corepack
run: corepack enable
- 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: yarn install
run: pnpm install

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

- name: Build Storybook
run: |
yarn run build-storybook
run: pnpm build-storybook
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +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

- name: Enable corepack
run: corepack enable
cache: 'pnpm'

- name: Install dependencies
run: yarn install
run: pnpm install

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
yarn run release
pnpm run release
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ storybook-static/
build-storybook.log
.DS_Store
.env
!yarn.lock
.yarn/install-state.gz
.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
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

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,
];
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@
"eject-ts": "zx scripts/eject-typescript.js",
"postinstall": "node scripts/welcome.js",
"format": "prettier --write .",
"lint": "eslint --cache .",
"lint:fix": "pnpm lint --fix",
"prerelease": "zx scripts/prepublish-checks.js",
"release": "npm run build && auto shipit",
"start": "run-p build:watch \"storybook --quiet\"",
"storybook": "storybook dev -p 6006",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@storybook/addon-docs": "next",
"@storybook/icons": "^1.4.0",
"@storybook/react-vite": "next",
Expand All @@ -55,6 +58,11 @@
"@vitejs/plugin-react": "^4.7.0",
"auto": "^11.3.0",
"boxen": "^8.0.1",
"eslint": "^9.36.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-storybook": "next",
"npm-run-all2": "^8.0.4",
"prettier": "^3.6.2",
"prompts": "^2.4.2",
Expand All @@ -64,6 +72,7 @@
"ts-dedent": "^2.2.0",
"tsup": "^8.5.0",
"typescript": "^5.8.3",
"typescript-eslint": "^8.44.1",
"vite": "^7.0.5",
"zx": "^8.7.1"
},
Expand Down Expand Up @@ -92,5 +101,10 @@
],
"icon": "https://user-images.githubusercontent.com/321738/63501763-88dbf600-c4cc-11e9-96cd-94adadc2fd72.png"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]",
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
}
}
Loading