Skip to content

Commit

Permalink
Merge pull request #190 from brainstormforce/next-js-fix
Browse files Browse the repository at this point in the history
fix: Use `use client` after importing components from @bsf/force-ui in Nextjs
  • Loading branch information
vrundakansara authored Nov 18, 2024
2 parents bacc5f4 + c671dad commit d134f70
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 116 deletions.
17 changes: 15 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

225 changes: 113 additions & 112 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,116 +17,117 @@
"require": "./dist/withTW.cjs"
}
},
"scripts": {
"build": "cross-env tsc -b && vite build",
"start": "cross-env tsc -b && vite build -w",
"pretty-fix": "prettier --write .",
"pretty-lint": "prettier --check .",
"lint:js": "eslint ./src",
"eslint:js-fix": "eslint ./src --fix",
"lint:js-fix": "npm run pretty-fix && npm run eslint:js-fix",
"lint:css": "stylelint **/*.{scss,css}",
"lint:css-fix": "stylelint **/*.{scss,css} --fix",
"storybook": "storybook dev -p 6006",
"test": "test-storybook",
"test:watch": "test-storybook --watch",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token CHROMATIC_PROJECT_TOKEN",
"package": "sh bin/build.sh",
"release": "npm run build && npm run package ",
"deploy-storybook": "storybook-to-ghpages"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rahulvarma722/bsf-admin-ui.git"
},
"volta": {
"node": "18.15.0"
},
"keywords": [
"bsf",
"components",
"library"
],
"license": "ISC",
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@floating-ui/react": "^0.26.20",
"@lexical/react": "^0.17.0",
"@lexical/utils": "^0.17.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"deepmerge": "^4.3.1",
"framer-motion": "^11.3.29",
"lexical": "^0.17.0",
"lucide-react": "^0.417.0",
"nanoid": "^5.0.7",
"react-day-picker": "^9.1.3",
"styled-components": "^6.1.12",
"tailwind-merge": "^2.4.0",
"tailwindcss-scoped-preflight": "^3.4.3",
"lodash": "^4.17.21",
"recharts": "^2.13.0"
},
"devDependencies": {
"@chromatic-com/storybook": "^2.0.2",
"@playwright/test": "^1.48.1",
"@storybook/addon-a11y": "^8.3.5",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-onboarding": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/react-vite": "^8.3.5",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/test": "^8.3.5",
"@storybook/test-runner": "^0.19.1",
"@tailwindcss/container-queries": "^0.1.1",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@types/node": "^22.7.6",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@vitejs/plugin-react": "^4.3.2",
"@wordpress/eslint-plugin": "^20.3.0",
"@wordpress/prettier-config": "^4.4.0",
"@wordpress/stylelint-config": "^23.2.0",
"autoprefixer": "^10.4.19",
"axe-playwright": "^2.0.3",
"chromatic": "^11.7.1",
"cross-env": "^7.0.3",
"eslint": "^8.41.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-storybook": "^0.9.0",
"globals": "^15.9.0",
"postcss": "^8.4.39",
"prettier": "^3.2.5",
"storybook": "^8.3.5",
"storybook-addon-paddings": "^6.0.2",
"stylelint": "^16.8.2",
"tailwindcss": "^3.4.10",
"typescript": "5.4.2",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.3",
"@types/lodash": "^4.17.13"
},
"browserslist": [
"last 1 version",
"> 1%",
"IE 10"
],
"bugs": {
"url": "https://github.com/rahulvarma722/bsf-admin-ui/issues"
},
"homepage": "https://github.com/rahulvarma722/bsf-admin-ui#readme"
"scripts": {
"build": "cross-env tsc -b && vite build",
"start": "cross-env tsc -b && vite build -w",
"pretty-fix": "prettier --write .",
"pretty-lint": "prettier --check .",
"lint:js": "eslint ./src",
"eslint:js-fix": "eslint ./src --fix",
"lint:js-fix": "npm run pretty-fix && npm run eslint:js-fix",
"lint:css": "stylelint **/*.{scss,css}",
"lint:css-fix": "stylelint **/*.{scss,css} --fix",
"storybook": "storybook dev -p 6006",
"test": "test-storybook",
"test:watch": "test-storybook --watch",
"build-storybook": "storybook build",
"chromatic": "npx chromatic --project-token CHROMATIC_PROJECT_TOKEN",
"package": "sh bin/build.sh",
"release": "npm run build && npm run package ",
"deploy-storybook": "storybook-to-ghpages"
},
"repository": {
"type": "git",
"url": "git+https://github.com/rahulvarma722/bsf-admin-ui.git"
},
"volta": {
"node": "18.15.0"
},
"keywords": [
"bsf",
"components",
"library"
],
"license": "ISC",
"peerDependencies": {
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"dependencies": {
"@emotion/is-prop-valid": "^1.3.0",
"@floating-ui/react": "^0.26.20",
"@lexical/react": "^0.17.0",
"@lexical/utils": "^0.17.0",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"deepmerge": "^4.3.1",
"framer-motion": "^11.3.29",
"lexical": "^0.17.0",
"lodash": "^4.17.21",
"lucide-react": "^0.417.0",
"nanoid": "^5.0.7",
"react-day-picker": "^9.1.3",
"recharts": "^2.13.0",
"styled-components": "^6.1.12",
"tailwind-merge": "^2.4.0",
"tailwindcss-scoped-preflight": "^3.4.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^2.0.2",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.13.0",
"@playwright/test": "^1.48.1",
"@storybook/addon-a11y": "^8.3.5",
"@storybook/addon-essentials": "^8.3.5",
"@storybook/addon-interactions": "^8.3.5",
"@storybook/addon-links": "^8.3.5",
"@storybook/addon-onboarding": "^8.3.5",
"@storybook/blocks": "^8.3.5",
"@storybook/react": "^8.3.5",
"@storybook/react-vite": "^8.3.5",
"@storybook/storybook-deployer": "^2.8.16",
"@storybook/test": "^8.3.5",
"@storybook/test-runner": "^0.19.1",
"@tailwindcss/container-queries": "^0.1.1",
"@types/lodash": "^4.17.13",
"@types/node": "^22.7.6",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@vitejs/plugin-react": "^4.3.2",
"@wordpress/eslint-plugin": "^20.3.0",
"@wordpress/prettier-config": "^4.4.0",
"@wordpress/stylelint-config": "^23.2.0",
"autoprefixer": "^10.4.19",
"axe-playwright": "^2.0.3",
"chromatic": "^11.7.1",
"cross-env": "^7.0.3",
"eslint": "^8.41.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"eslint-plugin-storybook": "^0.9.0",
"globals": "^15.9.0",
"postcss": "^8.4.39",
"prettier": "^3.2.5",
"rollup-preserve-directives": "^1.1.2",
"storybook": "^8.3.5",
"storybook-addon-paddings": "^6.0.2",
"stylelint": "^16.8.2",
"tailwindcss": "^3.4.10",
"typescript": "5.4.2",
"typescript-eslint": "^8.7.0",
"vite": "^5.4.8",
"vite-plugin-dts": "^4.2.3"
},
"browserslist": [
"last 1 version",
"> 1%",
"IE 10"
],
"bugs": {
"url": "https://github.com/rahulvarma722/bsf-admin-ui/issues"
},
"homepage": "https://github.com/rahulvarma722/bsf-admin-ui#readme"
}
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

export { default as Button } from './button';
export { default as Switch } from './switch';
export { default as Checkbox } from './checkbox';
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "ES2020",
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

Expand Down
2 changes: 2 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import preserveDirectives from 'rollup-preserve-directives';
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolve } from 'path';
Expand Down Expand Up @@ -34,5 +35,6 @@ export default defineConfig({
plugins: [
react(),
dts({ rollupTypes: true, tsconfigPath: './tsconfig.app.json' }),
preserveDirectives(),
],
});

0 comments on commit d134f70

Please sign in to comment.