Skip to content

Commit

Permalink
Add chromatic
Browse files Browse the repository at this point in the history
  • Loading branch information
slvstr-dev committed Mar 29, 2024
1 parent fc20cc4 commit 7432d9a
Show file tree
Hide file tree
Showing 6 changed files with 291 additions and 382 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ yarn-error.log*
next-env.d.ts

# storybook
/storybook-static
/storybook-static
build-storybook.log
14 changes: 4 additions & 10 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import path from 'path';
import type { StorybookConfig } from '@storybook/nextjs';

const config: StorybookConfig = {
stories: ['../src/components/**/*.stories.@(ts|tsx)'],
stories: ['../src/components/**/*.stories.tsx'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@chromatic-com/storybook'
],
framework: {
name: '@storybook/nextjs',
Expand All @@ -15,14 +15,8 @@ const config: StorybookConfig = {
docs: {
autodocs: 'tag',
},
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.alias = {
...config.resolve.alias,
'@': path.resolve(__dirname, '../src'),
};
}
return config;
core: {
disableTelemetry: true,
},
};

Expand Down
1 change: 0 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import translations from '@/translations/en';

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
Expand Down
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "portfolio",
"description": "Portfolio site created with Next.js, TypeScript & Tailwind.",
"author": "Sylvester Hofstra <hello@slvstr.dev>",
"author": {
"name": "Sylvester Hofstra",
"email": "hello@slvstr.dev"
},
"version": "1.0.0",
"private": true,
"scripts": {
Expand All @@ -16,12 +19,15 @@
"types:watch": "tsc --noEmit --watch",
"codegen": "source .env.local && npx genql --endpoint https://api.github.com/graphql --output ./src/graphql/generated -H \"Authorization: Bearer $GRAPHQL_API_TOKEN\" && pnpm format:fix",
"check": "pnpm types && pnpm lint && pnpm format",
"storybook": "storybook dev -p 6006 --no-open",
"storybook:build": "storybook build",
"storybook": "sb dev -p 6006 --no-open",
"storybook:build": "sb build",
"chromatic": "npx chromatic --build-script-name=storybook:build",
"upgrade": "pnpm upgrade --interactive",
"upgrade:latest": "pnpm upgrade --interactive --latest"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@genql/cli": "^6.3.2",
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-accordion": "^1.1.2",
Expand All @@ -40,6 +46,7 @@
"zod": "3.22.4"
},
"devDependencies": {
"@chromatic-com/storybook": "^1.2.25",
"@storybook/addon-essentials": "^8.0.5",
"@storybook/addon-interactions": "^8.0.5",
"@storybook/addon-links": "^8.0.5",
Expand All @@ -51,6 +58,7 @@
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"autoprefixer": "10.4.19",
"chromatic": "^11.2.0",
"clsx": "^2.1.0",
"eslint": "8.57.0",
"eslint-config-next": "14.1.4",
Expand All @@ -65,5 +73,5 @@
"tailwindcss": "3.4.3",
"typescript": "5.4.3"
},
"packageManager": "pnpm@8.15.1"
"packageManager": "pnpm@8.15.5"
}
Loading

0 comments on commit 7432d9a

Please sign in to comment.