Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
chinhld12 committed Aug 9, 2024
1 parent ddda459 commit 7b24389
Show file tree
Hide file tree
Showing 15 changed files with 12,049 additions and 13,897 deletions.
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit ""
pnpm dlx commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18
46 changes: 0 additions & 46 deletions .storybook/main.js

This file was deleted.

56 changes: 56 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import type { StorybookConfig } from '@storybook/nextjs'
import path from 'path'
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')

const storybookConfig: StorybookConfig = {
framework: {
name: '@storybook/nextjs',
options: { builder: { useSWC: true } },
},
staticDirs: ['../public'],
stories: [
'../src/components/**/*.stories.mdx',
'../src/components/**/*.stories.@(js|jsx|ts|tsx)',
],
addons: [
'@storybook/addon-essentials',
'@storybook/addon-storysource',
'@storybook/addon-styling-webpack',
],
webpackFinal: async (config) => {
if (config.resolve) {
config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../tsconfig.json'),
}),
]
}

if (config.module?.rules) {
// This modifies the existing image rule to exclude `.svg` files
// since we handle those with `@svgr/webpack`.
const imageRule = config.module.rules.find((rule: any) => {
if (typeof rule !== 'string' && rule.test instanceof RegExp) {
return rule.test.test('.svg')
}
})
if (typeof imageRule !== 'string') {
;(imageRule as any).exclude = /\.svg$/
}

config.module.rules.push({
test: /\.svg$/,
use: ['@svgr/webpack'],
})
}

config.module?.rules?.push({
test: /\.mjs$/,
include: [/node_modules/],
type: 'javascript/auto',
})

return config
},
}
export default storybookConfig
4 changes: 0 additions & 4 deletions .storybook/manager.js

This file was deleted.

7 changes: 4 additions & 3 deletions .storybook/preview.js → .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { RouterContext } from 'next/dist/shared/lib/router-context' // next 11.2
import './index.css'
import { RouterContext } from 'next/dist/shared/lib/router-context.shared-runtime'
import './styles.css'
import { Parameters } from '@storybook/react'

export const parameters = {
export const parameters: Parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
nextRouter: {
Provider: RouterContext.Provider,
Expand Down
File renamed without changes.
61 changes: 28 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"format": "prettier -c --write \"*/**\"",
"lint": "eslint . --ext .ts,.tsx,.js && stylelint '**/*.css'",
"lint:fix": "eslint . --ext .ts,.tsx,.js --fix && stylelint '**/*.css' --fix",
"postinstall": "husky install",
"storybook": "storybook dev -p 6006 -s ./public",
"build-storybook": "storybook build -s ./public",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"cypress:open": "cypress open",
"release": "standard-version -a",
"preinstall": "npx only-allow pnpm",
"generate:api": "orval --config ./orval.config.js"
"generate:api": "orval --config ./orval.config.js",
"prepare": "husky"
},
"dependencies": {
"@babel/eslint-parser": "^7.25.1",
"@babel/eslint-parser": "^7.22.10",
"@dwarvesf/react-hooks": "^0.8.2",
"@dwarvesf/react-utils": "^0.4.2",
"@hookform/resolvers": "^3.9.0",
Expand Down Expand Up @@ -54,7 +54,8 @@
"@storybook/addon-essentials": "^8.2.8",
"@storybook/addon-links": "^8.2.8",
"@storybook/addon-storysource": "8.2.8",
"@storybook/addon-styling": "^1.3.7",
"@storybook/addon-styling-webpack": "^1.0.0",
"@storybook/addon-themes": "^8.2.8",
"@storybook/nextjs": "^8.2.8",
"@storybook/react": "^8.2.8",
"@svgr/webpack": "^8.1.0",
Expand All @@ -66,56 +67,51 @@
"@types/nprogress": "^0.2.3",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "8.0.1",
"@typescript-eslint/parser": "8.0.1",
"@typescript-eslint/eslint-plugin": "6.4.0",
"@typescript-eslint/parser": "6.4.0",
"autoprefixer": "^10.4.20",
"axios": "^1.7.3",
"babel-jest": "^29.7.0",
"cypress": "^13.13.2",
"eslint": "9.8.0",
"dotenv": "^16.4.5",
"eslint": "8.30.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-airbnb-typescript": "18.0.0",
"eslint-config-next": "^14.2.5",
"eslint-config-prettier": "9.1.0",
"eslint-config-airbnb-typescript": "17.0.0",
"eslint-config-next": "^13.1.1",
"eslint-config-prettier": "9.0.0",
"eslint-config-react": "1.x",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-cypress": "^3.4.0",
"eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-react": "7.35.0",
"eslint-plugin-react-hooks": "4.6.2",
"eslint-plugin-storybook": "^0.8.0",
"eslint-plugin-testing-library": "6.2.2",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.31.11",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-storybook": "^0.6.13",
"eslint-plugin-testing-library": "6.0.0",
"glob": "^11.0.0",
"husky": "^9.1.4",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.8",
"msw": "^2.3.5",
"msw": "^1.2.3",
"orval": "^7.0.1",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"prettier": "^2.8.1",
"rimraf": "^6.0.1",
"standard-version": "^9.5.0",
"storybook": "^8.2.8",
"stylelint": "^16.8.1",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-standard": "^36.0.1",
"stylelint": "^15.10.2",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^34.0.0",
"tailwindcss": "3.4.9",
"tailwindcss-animate": "^1.0.7",
"ts-jest": "^29.2.4",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"typescript": "5.5.4"
"typescript": "5.1.6"
},
"license": "ISC",
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"**/*.{json,css,scss,md}": [
"prettier --write"
Expand All @@ -126,11 +122,10 @@
"eslint --fix"
]
},
"packageManager": "[email protected]",
"engines": {
"pnpm": ">=8.2.0"
},
"msw": {
"workerDirectory": "public"
}
}
}
Loading

0 comments on commit 7b24389

Please sign in to comment.