Skip to content

Commit

Permalink
Merge pull request #462 from sohosai/feat/storybook
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
appare45 authored Feb 7, 2025
2 parents 99746dc + daa9200 commit 93f737a
Show file tree
Hide file tree
Showing 52 changed files with 10,904 additions and 6,145 deletions.
18 changes: 14 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"extends": ["next/core-web-vitals", "prettier", "plugin:jsx-a11y/recommended"],
"plugins": ["unused-imports", "jsx-a11y"],
"extends": [
"next/core-web-vitals",
"prettier",
"plugin:jsx-a11y/recommended",
"plugin:storybook/recommended"
],
"plugins": [
"unused-imports",
"jsx-a11y"
],
"rules": {
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
Expand All @@ -17,8 +25,10 @@
"no-restricted-imports": [
"error",
{
"patterns": ["../*"]
"patterns": [
"../*"
]
}
]
}
}
}
4 changes: 2 additions & 2 deletions .github/workflows/cd-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
ln -s ${{ github.workspace }} /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: "lts/*"
check-latest: true
- name: cache
uses: actions/cache@v4
Expand All @@ -48,7 +48,7 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm ci
- name: build
id: build
run: npx @cloudflare/next-on-pages@1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-feture-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
ln -s ${{ github.workspace }} /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: "lts/*"
check-latest: true
- name: cache
uses: actions/cache@v4
Expand All @@ -44,11 +44,11 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm ci
- name: build (branch preview)
if: ${{ ((github.head_ref || github.ref_name) != env.PRODUCTION_BRANCH) }}
id: build-preview
run: npx @cloudflare/next-on-pages@1
run: npx @cloudflare/next-on-pages@1.13.7
env:
NEXT_PUBLIC_API_ENDPOINT: ${{vars.DEV_API_ENDPOINT}}
NEXT_PUBLIC_FIREBASE_API_KEY: ${{vars.DEV_FIREBASE_API_KEY}}
Expand All @@ -62,7 +62,7 @@ jobs:
- name: build (production)
if: ${{ ((github.head_ref || github.ref_name) == env.PRODUCTION_BRANCH) && github.event.pull_request.merged == true }}
id: build-production
run: npx @cloudflare/next-on-pages@1
run: npx @cloudflare/next-on-pages@1.13.7
env:
NEXT_PUBLIC_API_ENDPOINT: ${{secrets.PROD_API_ENDPOINT}}
NEXT_PUBLIC_FIREBASE_API_KEY: ${{secrets.PROD_FIREBASE_API_KEY}}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cd-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
ln -s ${{ github.workspace }} /home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: "lts/*"
check-latest: true
- name: cache
uses: actions/cache@v4
Expand All @@ -53,11 +53,11 @@ jobs:
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}
- run: npm install
- run: npm ci
- name: build (branch preview)
if: ${{ ((github.head_ref || github.ref_name) != env.PRODUCTION_BRANCH) }}
id: build-preview
run: npx @cloudflare/next-on-pages@1
run: npx @cloudflare/next-on-pages@1.13.7
env:
NEXT_PUBLIC_API_ENDPOINT: ${{vars.DEV_API_ENDPOINT}}
NEXT_PUBLIC_FIREBASE_API_KEY: ${{vars.DEV_FIREBASE_API_KEY}}
Expand All @@ -71,7 +71,7 @@ jobs:
- name: build (production)
if: ${{ ((github.head_ref || github.ref_name) == env.PRODUCTION_BRANCH) && github.event.pull_request.merged == true }}
id: build-production
run: npx @cloudflare/next-on-pages@1
run: npx @cloudflare/next-on-pages@1.13.7
env:
NEXT_PUBLIC_API_ENDPOINT: ${{secrets.PROD_API_ENDPOINT}}
NEXT_PUBLIC_FIREBASE_API_KEY: ${{secrets.PROD_FIREBASE_API_KEY}}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ styled-system-studio
# sentry example
src/app/sentry-example-page
src/app/api/sentry-example-api

*storybook.log
storybook-static
30 changes: 30 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { StorybookConfig } from "@storybook/nextjs";
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
"@storybook/addon-onboarding",
"@storybook/addon-essentials",
"@chromatic-com/storybook",
"@storybook/addon-interactions",
],
framework: {
name: "@storybook/nextjs",
options: {},
},
staticDirs: ["../public"],
// https://storybook.js.org/docs/builders/webpack#typescript-modules-are-not-resolved-within-storybook
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.plugins = [
...(config.resolve.plugins || []),
new TsconfigPathsPlugin({
extensions: config.resolve.extensions,
}),
];
}
return config;
},
};
export default config;
15 changes: 15 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { Preview } from "@storybook/react";
import "../src/app/globals.css";

const preview: Preview = {
parameters: {
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
};

export default preview;
Loading

0 comments on commit 93f737a

Please sign in to comment.