diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index e550e78..0000000 --- a/.eslintrc +++ /dev/null @@ -1,15 +0,0 @@ -{ - "env": { - "browser": true, - "es2021": true, - "node": true - }, - "extends": [ - "eslint:recommended", - "plugin:prettier/recommended" - ], - "parserOptions": { - "ecmaVersion": 12, - "sourceType": "module" - }, -} diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..2bf444c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + env: { + browser: true, + es2021: true, + node: true, + }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 2021, + sourceType: 'module', + }, + plugins: ['@typescript-eslint'], + rules: { + 'prettier/prettier': 'error', + }, + ignorePatterns: ['node_modules', 'dist', '.eslintrc.js'], +}; diff --git a/.husky/pre-commit b/.husky/pre-commit index 58b1861..a5a29d9 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -pnpm exec lint-staged +pnpm lint-staged diff --git a/nx.json b/nx.json index 9c25769..33251f8 100644 --- a/nx.json +++ b/nx.json @@ -9,5 +9,5 @@ } } }, - "nxCloudAccessToken": "MDYyZWU5OGUtNTU5ZS00YWQyLTk4YzItOGY4NTJjMzMyZWU4fHJlYWQtd3JpdGU=" -} + "nxCloudAccessToken": "ZDA1YmQzMTEtYWQ1MS00MjkzLWEzNjgtMzYzMTdlNTRjMTQyfHJlYWQtd3JpdGU=" +} \ No newline at end of file diff --git a/package.json b/package.json index 7ee195d..a11c6f9 100644 --- a/package.json +++ b/package.json @@ -10,20 +10,25 @@ "prepare": "husky" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": [ + "*.{js,jsx}": [ "prettier --write", "eslint --fix" + ], + "*.{ts,tsx}": [ + "prettier --write" ] }, "devDependencies": { "@commitlint/cli": "^19.4.0", "@commitlint/config-conventional": "^19.2.2", - "eslint": "^8.53.0", + "@typescript-eslint/eslint-plugin": "^7.1.0", + "@typescript-eslint/parser": "^7.1.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.0", "husky": "^9.1.4", "lint-staged": "^15.2.8", - "prettier": "^3.2.5", + "prettier": "^3.3.3", "turbo": "^2.0.12", "typescript": "^5.4.5", "nx": "19.5.7" @@ -32,4 +37,4 @@ "engines": { "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/ui/.eslintrc.js b/packages/ui/.eslintrc.js index 4646413..a3bbd7c 100644 --- a/packages/ui/.eslintrc.js +++ b/packages/ui/.eslintrc.js @@ -1,10 +1,10 @@ /** @type {import("eslint").Linter.Config} */ module.exports = { root: true, - extends: ["@repo/eslint-config/react-internal.js"], - parser: "@typescript-eslint/parser", + extends: ['@jjoing/eslint-config/react-internal.js'], + parser: '@typescript-eslint/parser', parserOptions: { - project: "./tsconfig.lint.json", + project: './tsconfig.lint.json', tsconfigRootDir: __dirname, }, }; diff --git a/packages/ui/tsconfig.lint.json b/packages/ui/tsconfig.lint.json index df2762e..621854f 100644 --- a/packages/ui/tsconfig.lint.json +++ b/packages/ui/tsconfig.lint.json @@ -1,5 +1,5 @@ { - "extends": "@repo/typescript-config/react-library.json", + "extends": "@jjoing/typescript-config/react-library.json", "compilerOptions": { "outDir": "dist" }, diff --git a/packages/ui/turbo/generators/config.ts b/packages/ui/turbo/generators/config.ts deleted file mode 100644 index 40100ba..0000000 --- a/packages/ui/turbo/generators/config.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { PlopTypes } from "@turbo/gen"; - -// Learn more about Turborepo Generators at https://turbo.build/repo/docs/core-concepts/monorepos/code-generation - -export default function generator(plop: PlopTypes.NodePlopAPI): void { - // A simple generator to add a new React component to the internal UI library - plop.setGenerator("react-component", { - description: "Adds a new react component", - prompts: [ - { - type: "input", - name: "name", - message: "What is the name of the component?", - }, - ], - actions: [ - { - type: "add", - path: "src/{{kebabCase name}}.tsx", - templateFile: "templates/component.hbs", - }, - { - type: "append", - path: "package.json", - pattern: /"exports": {(?)/g, - template: ' "./{{kebabCase name}}": "./src/{{kebabCase name}}.tsx",', - }, - ], - }); -} diff --git a/packages/ui/turbo/generators/templates/component.hbs b/packages/ui/turbo/generators/templates/component.hbs deleted file mode 100644 index d968b9e..0000000 --- a/packages/ui/turbo/generators/templates/component.hbs +++ /dev/null @@ -1,8 +0,0 @@ -export const {{ pascalCase name }} = ({ children }: { children: React.ReactNode }) => { - return ( -
-

{{ pascalCase name }} Component

- {children} -
- ); -}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a301c2..cfc341a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,15 +14,21 @@ importers: '@commitlint/config-conventional': specifier: ^19.2.2 version: 19.2.2 + '@typescript-eslint/eslint-plugin': + specifier: ^7.1.0 + version: 7.1.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': + specifier: ^7.1.0 + version: 7.1.0(eslint@8.57.0)(typescript@5.4.5) eslint: - specifier: ^8.53.0 + specifier: ^8.57.0 version: 8.57.0 eslint-config-prettier: specifier: ^9.0.0 version: 9.1.0(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.0.0 - version: 5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) + version: 5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3) husky: specifier: ^9.1.4 version: 9.1.4 @@ -33,8 +39,8 @@ importers: specifier: 19.5.7 version: 19.5.7 prettier: - specifier: ^3.2.5 - version: 3.2.5 + specifier: ^3.3.3 + version: 3.3.3 turbo: specifier: ^2.0.12 version: 2.0.12 @@ -132,7 +138,7 @@ importers: version: 7.1.0(eslint@8.57.0)(typescript@5.4.5) '@vercel/style-guide': specifier: ^5.2.0 - version: 5.2.0(eslint@8.57.0)(prettier@3.2.5)(typescript@5.4.5) + version: 5.2.0(eslint@8.57.0)(prettier@3.3.3)(typescript@5.4.5) eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@8.57.0) @@ -223,7 +229,7 @@ packages: '@babel/parser': 7.23.3 '@babel/template': 7.22.15 '@babel/traverse': 7.23.3 - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 convert-source-map: 2.0.0 debug: 4.3.6 gensync: 1.0.0-beta.2 @@ -251,7 +257,7 @@ packages: resolution: {integrity: sha512-keeZWAV4LU3tW0qRi19HRpabC/ilM0HRBBzf9/k8FFiG4KVpiv0FIy4hHfLfFQZNhziCTPTmd59zoyv6DNISzg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.20 jsesc: 2.5.2 @@ -278,21 +284,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.15 - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/helper-module-imports@7.22.15: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/helper-module-transforms@7.23.3(@babel/core@7.23.3): @@ -306,25 +312,25 @@ packages: '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.7 dev: true /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true - /@babel/helper-string-parser@7.22.5: - resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} + /@babel/helper-string-parser@7.24.8: + resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} dev: true @@ -333,6 +339,11 @@ packages: engines: {node: '>=6.9.0'} dev: true + /@babel/helper-validator-identifier@7.24.7: + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/helper-validator-option@7.22.15: resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} @@ -344,7 +355,7 @@ packages: dependencies: '@babel/template': 7.22.15 '@babel/traverse': 7.23.3 - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 transitivePeerDependencies: - supports-color dev: true @@ -353,7 +364,7 @@ packages: resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.7 chalk: 2.4.2 js-tokens: 4.0.0 dev: true @@ -363,7 +374,7 @@ packages: engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/runtime-corejs3@7.22.10: @@ -387,7 +398,7 @@ packages: dependencies: '@babel/code-frame': 7.22.13 '@babel/parser': 7.23.3 - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 dev: true /@babel/traverse@7.23.3: @@ -401,19 +412,19 @@ packages: '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.23.3 - '@babel/types': 7.23.3 + '@babel/types': 7.25.2 debug: 4.3.6 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.23.3: - resolution: {integrity: sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==} + /@babel/types@7.25.2: + resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-string-parser': 7.24.8 + '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 dev: true @@ -591,19 +602,19 @@ packages: resolution: {integrity: sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w==} dependencies: '@emnapi/wasi-threads': 1.0.1 - tslib: 2.6.2 + tslib: 2.6.3 dev: true /@emnapi/runtime@1.2.0: resolution: {integrity: sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ==} requiresBuild: true dependencies: - tslib: 2.6.2 + tslib: 2.6.3 /@emnapi/wasi-threads@1.0.1: resolution: {integrity: sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw==} dependencies: - tslib: 2.6.2 + tslib: 2.6.3 dev: true /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): @@ -626,7 +637,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.6 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -646,9 +657,10 @@ packages: /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} + deprecated: Use @eslint/config-array instead dependencies: '@humanwhocodes/object-schema': 2.0.2 - debug: 4.3.4 + debug: 4.3.6 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -661,6 +673,7 @@ packages: /@humanwhocodes/object-schema@2.0.2: resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} + deprecated: Use @eslint/object-schema instead dev: true /@img/sharp-darwin-arm64@0.33.4: @@ -1051,7 +1064,7 @@ packages: hasBin: true dependencies: nx: 19.5.7 - tslib: 2.6.2 + tslib: 2.6.3 transitivePeerDependencies: - '@swc-node/register' - '@swc/core' @@ -1183,7 +1196,7 @@ packages: /@swc/helpers@0.5.11: resolution: {integrity: sha512-YNlnKRWF2sVojTpIyzwou9XoTNbzbzONwRhOoniEioF1AtaitTvVZblaQRrAzChWQ1bLYyYSWzM18y4WwgzJ+A==} dependencies: - tslib: 2.6.2 + tslib: 2.6.3 dev: false /@tootallnate/quickjs-emscripten@0.23.0: @@ -1248,7 +1261,7 @@ packages: /@tybys/wasm-util@0.9.0: resolution: {integrity: sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw==} dependencies: - tslib: 2.6.2 + tslib: 2.6.3 dev: true /@types/conventional-commits-parser@5.0.0: @@ -1670,7 +1683,7 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vercel/style-guide@5.2.0(eslint@8.57.0)(prettier@3.2.5)(typescript@5.4.5): + /@vercel/style-guide@5.2.0(eslint@8.57.0)(prettier@3.3.3)(typescript@5.4.5): resolution: {integrity: sha512-fNSKEaZvSkiBoF6XEefs8CcgAV9K9e+MbcsDZjUsktHycKdA0jvjAzQi1W/FzLS+Nr5zZ6oejCwq/97dHUKe0g==} engines: {node: '>=16'} peerDependencies: @@ -1698,7 +1711,7 @@ packages: eslint-import-resolver-alias: 1.1.2(eslint-plugin-import@2.29.0) eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.17.0)(eslint-plugin-import@2.29.0)(eslint@8.57.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-playwright: 0.16.0(eslint-plugin-jest@27.6.0)(eslint@8.57.0) @@ -1707,8 +1720,8 @@ packages: eslint-plugin-testing-library: 6.1.2(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-tsdoc: 0.2.17 eslint-plugin-unicorn: 48.0.1(eslint@8.57.0) - prettier: 3.2.5 - prettier-plugin-packagejson: 2.4.6(prettier@3.2.5) + prettier: 3.3.3 + prettier-plugin-packagejson: 2.4.6(prettier@3.3.3) typescript: 5.4.5 transitivePeerDependencies: - eslint-import-resolver-node @@ -1726,7 +1739,7 @@ packages: engines: {node: '>=14.15.0'} dependencies: js-yaml: 3.14.1 - tslib: 2.6.2 + tslib: 2.6.3 dev: true /@zkochan/js-yaml@0.0.7: @@ -1760,13 +1773,14 @@ packages: /acorn@8.10.0: resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} + hasBin: true dev: true /agent-base@7.1.0: resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} engines: {node: '>= 14'} dependencies: - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -2044,13 +2058,6 @@ packages: balanced-match: 1.0.2 dev: true - /braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} - engines: {node: '>=8'} - dependencies: - fill-range: 7.0.1 - dev: true - /braces@3.0.3: resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} @@ -2799,6 +2806,7 @@ packages: /escodegen@2.1.0: resolution: {integrity: sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==} engines: {node: '>=6.0'} + hasBin: true dependencies: esprima: 4.0.1 estraverse: 5.3.0 @@ -2856,7 +2864,7 @@ packages: peerDependencies: eslint-plugin-import: '>=1.4.0' dependencies: - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) dev: true /eslint-import-resolver-node@0.3.9: @@ -2880,7 +2888,7 @@ packages: enhanced-resolve: 5.15.0 eslint: 8.57.0 eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.1 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -2987,41 +2995,6 @@ packages: dev: true /eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.1.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): - resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} - engines: {node: '>=4'} - peerDependencies: - '@typescript-eslint/parser': '*' - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - peerDependenciesMeta: - '@typescript-eslint/parser': - optional: true - dependencies: - '@typescript-eslint/parser': 7.1.0(eslint@8.57.0)(typescript@5.4.5) - array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.3 - array.prototype.flat: 1.3.2 - array.prototype.flatmap: 1.3.2 - debug: 3.2.7 - doctrine: 2.1.0 - eslint: 8.57.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.17.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - hasown: 2.0.0 - is-core-module: 2.13.1 - is-glob: 4.0.3 - minimatch: 3.1.2 - object.fromentries: 2.0.7 - object.groupby: 1.0.1 - object.values: 1.1.7 - semver: 6.3.1 - tsconfig-paths: 3.14.2 - transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack - - supports-color - dev: true - - /eslint-plugin-import@2.29.0(@typescript-eslint/parser@7.1.0)(eslint@8.57.0): resolution: {integrity: sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg==} engines: {node: '>=4'} peerDependencies: @@ -3120,7 +3093,7 @@ packages: eslint-plugin-jest: 27.6.0(@typescript-eslint/eslint-plugin@6.17.0)(eslint@8.57.0)(typescript@5.4.5) dev: true - /eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5): + /eslint-plugin-prettier@5.2.1(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.3): resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -3136,7 +3109,7 @@ packages: dependencies: eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) - prettier: 3.2.5 + prettier: 3.3.3 prettier-linter-helpers: 1.0.0 synckit: 0.9.1 dev: true @@ -3257,6 +3230,7 @@ packages: /eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + hasBin: true dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@eslint-community/regexpp': 4.11.0 @@ -3312,6 +3286,7 @@ packages: /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} + hasBin: true dev: true /esquery@1.5.0: @@ -3417,7 +3392,7 @@ packages: '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.5 + micromatch: 4.0.7 dev: true /fast-json-stable-stringify@2.1.0: @@ -3452,13 +3427,6 @@ packages: flat-cache: 3.0.4 dev: true - /fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} - engines: {node: '>=8'} - dependencies: - to-regex-range: 5.0.1 - dev: true - /fill-range@7.1.1: resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} @@ -3707,6 +3675,7 @@ packages: /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -3809,7 +3778,7 @@ packages: source-map: 0.6.1 wordwrap: 1.0.0 optionalDependencies: - uglify-js: 3.17.4 + uglify-js: 3.19.1 dev: true /has-bigints@1.0.2: @@ -3872,7 +3841,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -3882,7 +3851,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color dev: true @@ -3948,6 +3917,7 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -4361,6 +4331,7 @@ packages: /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true dependencies: argparse: 2.0.1 dev: true @@ -4400,6 +4371,7 @@ packages: /json5@1.0.2: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} + hasBin: true dependencies: minimist: 1.2.8 dev: true @@ -4600,6 +4572,7 @@ packages: /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true dependencies: js-tokens: 4.0.0 @@ -4654,14 +4627,6 @@ packages: engines: {node: '>= 8'} dev: true - /micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} - engines: {node: '>=8.6'} - dependencies: - braces: 3.0.2 - picomatch: 2.3.1 - dev: true - /micromatch@4.0.7: resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} @@ -4902,7 +4867,7 @@ packages: tar-stream: 2.2.0 tmp: 0.2.3 tsconfig-paths: 4.2.0 - tslib: 2.6.2 + tslib: 2.6.3 yargs: 17.7.2 yargs-parser: 21.1.1 optionalDependencies: @@ -5153,7 +5118,7 @@ packages: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 get-uri: 6.0.1 http-proxy-agent: 7.0.0 https-proxy-agent: 7.0.1 @@ -5290,7 +5255,7 @@ packages: fast-diff: 1.3.0 dev: true - /prettier-plugin-packagejson@2.4.6(prettier@3.2.5): + /prettier-plugin-packagejson@2.4.6(prettier@3.3.3): resolution: {integrity: sha512-5JGfzkJRL0DLNyhwmiAV9mV0hZLHDwddFCs2lc9CNxOChpoWUQVe8K4qTMktmevmDlMpok2uT10nvHUyU59sNw==} peerDependencies: prettier: '>= 1.16.0' @@ -5298,14 +5263,15 @@ packages: prettier: optional: true dependencies: - prettier: 3.2.5 + prettier: 3.3.3 sort-package-json: 2.6.0 synckit: 0.8.5 dev: true - /prettier@3.2.5: - resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==} + /prettier@3.3.3: + resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==} engines: {node: '>=14'} + hasBin: true dev: true /pretty-format@29.7.0: @@ -5504,6 +5470,7 @@ packages: /resolve@1.22.8: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} + hasBin: true dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 @@ -5512,6 +5479,7 @@ packages: /resolve@2.0.0-next.5: resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} + hasBin: true dependencies: is-core-module: 2.13.1 path-parse: 1.0.7 @@ -5545,6 +5513,8 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported + hasBin: true dependencies: glob: 7.2.3 dev: true @@ -5617,6 +5587,7 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true dev: true /semver@7.5.4: @@ -5768,7 +5739,7 @@ packages: engines: {node: '>= 14'} dependencies: agent-base: 7.1.0 - debug: 4.3.4 + debug: 4.3.6 socks: 2.7.1 transitivePeerDependencies: - supports-color @@ -6177,6 +6148,11 @@ packages: /tslib@2.6.2: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true + + /tslib@2.6.3: + resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + requiresBuild: true /tsutils@3.21.0(typescript@5.4.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} @@ -6321,11 +6297,13 @@ packages: /typescript@5.4.5: resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} + hasBin: true dev: true - /uglify-js@3.17.4: - resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} + /uglify-js@3.19.1: + resolution: {integrity: sha512-y/2wiW+ceTYR2TSSptAhfnEtpLaQ4Ups5zrjB2d3kuVxHj16j/QJwPl5PvuGy9uARb39J0+iKxcRPvtpsx4A4A==} engines: {node: '>=0.8.0'} + hasBin: true requiresBuild: true dev: true optional: true @@ -6476,6 +6454,7 @@ packages: /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} + hasBin: true dependencies: isexe: 2.0.0 dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 96b0bb9..e2df72e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,5 @@ packages: - 'apps/*' - 'packages/*' - - 'configs/*' \ No newline at end of file + - 'configs/*' + - 'storybook/*' \ No newline at end of file diff --git a/storybook/.eslintrc.cjs b/storybook/.eslintrc.cjs new file mode 100644 index 0000000..71c58aa --- /dev/null +++ b/storybook/.eslintrc.cjs @@ -0,0 +1,5 @@ +/** @type {import("eslint").Linter.Config} */ +module.exports = { + root: true, + extends: ['@jjoing/eslint-config/react-internal.js'], +}; diff --git a/storybook/.storybook/main.ts b/storybook/.storybook/main.ts new file mode 100644 index 0000000..27bbfb0 --- /dev/null +++ b/storybook/.storybook/main.ts @@ -0,0 +1,26 @@ +import type { StorybookConfig } from '@storybook/react-vite'; + +import { join, dirname } from 'path'; + +/** + * This function is used to resolve the absolute path of a package. + * It is needed in projects that use Yarn PnP or are set up within a monorepo. + */ +function getAbsolutePath(value: string): any { + return dirname(require.resolve(join(value, 'package.json'))); +} +const config: StorybookConfig = { + stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], + addons: [ + getAbsolutePath('@storybook/addon-onboarding'), + getAbsolutePath('@storybook/addon-links'), + getAbsolutePath('@storybook/addon-essentials'), + getAbsolutePath('@chromatic-com/storybook'), + getAbsolutePath('@storybook/addon-interactions'), + ], + framework: { + name: getAbsolutePath('@storybook/react-vite'), + options: {}, + }, +}; +export default config; diff --git a/storybook/.storybook/preview.ts b/storybook/.storybook/preview.ts new file mode 100644 index 0000000..adcda96 --- /dev/null +++ b/storybook/.storybook/preview.ts @@ -0,0 +1,14 @@ +import type { Preview } from '@storybook/react'; + +const preview: Preview = { + parameters: { + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i, + }, + }, + }, +}; + +export default preview; diff --git a/storybook/package.json b/storybook/package.json new file mode 100644 index 0000000..03c694e --- /dev/null +++ b/storybook/package.json @@ -0,0 +1,49 @@ +{ + "name": "storybook", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build" + }, + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@chromatic-com/storybook": "^1.6.1", + "@eslint/js": "^9.8.0", + "@jjoing/eslint-config": "workspace:*", + "@jjoing/typescript-config": "workspace:*", + "@storybook/addon-essentials": "^8.2.8", + "@storybook/addon-interactions": "^8.2.8", + "@storybook/addon-links": "^8.2.8", + "@storybook/addon-onboarding": "^8.2.8", + "@storybook/blocks": "^8.2.8", + "@storybook/react": "^8.2.8", + "@storybook/react-vite": "^8.2.8", + "@storybook/test": "^8.2.8", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "eslint": "^9.8.0", + "eslint-plugin-react-hooks": "^5.1.0-rc.0", + "eslint-plugin-react-refresh": "^0.4.9", + "eslint-plugin-storybook": "^0.8.0", + "globals": "^15.9.0", + "storybook": "^8.2.8", + "typescript": "^5.5.4", + "typescript-eslint": "^8.0.0", + "vite": "^5.4.0" + }, + "eslintConfig": { + "extends": [ + "plugin:storybook/recommended" + ] + } +} \ No newline at end of file diff --git a/storybook/tsconfig.json b/storybook/tsconfig.json new file mode 100644 index 0000000..a264863 --- /dev/null +++ b/storybook/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "@jjoing/typescript-config/react-library.json", + "compilerOptions": { + "outDir": "dist", + "moduleResolution": "NodeNext", + "module": "NodeNext" + }, + "include": [".", ".eslintrc.js"], + "exclude": ["dist", "build", "node_modules"] +} \ No newline at end of file diff --git a/storybook/vite.config.ts b/storybook/vite.config.ts new file mode 100644 index 0000000..4e7004e --- /dev/null +++ b/storybook/vite.config.ts @@ -0,0 +1,7 @@ +import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite'; + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()], +});