Skip to content

Commit

Permalink
fix(ui): build step + improve DX (#1336)
Browse files Browse the repository at this point in the history
* fix(ui): build step + improve DX

* chore: changeset

* fix: `clean-package` flow; move `clean-package` top level

* chore: up packages; switch to bun v1.1.0
  • Loading branch information
SutuSebastian committed Apr 1, 2024
1 parent 45930ef commit b6ebb31
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 57 deletions.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-ravens-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-flowbite-react": patch
---

fix `clean-package` flow
5 changes: 5 additions & 0 deletions .changeset/old-flies-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"flowbite-react": patch
---

fix build step, export types and improve DX
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.31
bun-version: 1.1.0

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules

# misc
.DS_Store
*.backup
*.pem

# typescript
Expand Down
32 changes: 16 additions & 16 deletions apps/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
"react-dom": "18.2.0"
},
"devDependencies": {
"@storybook/addon-essentials": "8.0.2",
"@storybook/addon-interactions": "8.0.2",
"@storybook/addon-links": "8.0.2",
"@storybook/addon-themes": "8.0.2",
"@storybook/blocks": "8.0.2",
"@storybook/react": "8.0.2",
"@storybook/react-vite": "8.0.2",
"@storybook/test": "8.0.2",
"@types/react": "18.2.67",
"@types/react-dom": "18.2.22",
"@storybook/addon-essentials": "8.0.5",
"@storybook/addon-interactions": "8.0.5",
"@storybook/addon-links": "8.0.5",
"@storybook/addon-themes": "8.0.5",
"@storybook/blocks": "8.0.5",
"@storybook/react": "8.0.5",
"@storybook/react-vite": "8.0.5",
"@storybook/test": "8.0.5",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"@vitejs/plugin-react": "4.2.1",
"autoprefixer": "10.4.18",
"postcss": "8.4.37",
"storybook": "8.0.2",
"tailwindcss": "3.4.1",
"typescript": "5.4.2",
"vite": "5.2.2"
"autoprefixer": "10.4.19",
"postcss": "8.4.38",
"storybook": "8.0.5",
"tailwindcss": "3.4.3",
"typescript": "5.4.3",
"vite": "5.2.7"
}
}
16 changes: 8 additions & 8 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@
},
"devDependencies": {
"@docsearch/react": "3.6.0",
"@types/mdx": "2.0.11",
"@types/mdx": "2.0.12",
"@types/prismjs": "1.26.3",
"@types/react": "18.2.67",
"@types/react-dom": "18.2.22",
"autoprefixer": "10.4.18",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"autoprefixer": "10.4.19",
"eslint-config-next": "14.1.4",
"markdown-toc": "1.2.0",
"next": "14.1.4",
"next-contentlayer": "0.3.4",
"postcss": "8.4.37",
"postcss": "8.4.38",
"prismjs": "1.29.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-markdown": "9.0.1",
"rehype-autolink-headings": "7.1.0",
"rehype-prism-plus": "2.0.0",
"rehype-slug": "6.0.0",
"sharp": "0.33.2",
"tailwindcss": "3.4.1",
"typescript": "5.4.2"
"sharp": "0.33.3",
"tailwindcss": "3.4.3",
"typescript": "5.4.3"
}
}
Binary file modified bun.lockb
Binary file not shown.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dev:web": "turbo dev --filter=web",
"format": "turbo format",
"format:check": "turbo format:check",
"postinstall": "bun build:ui",
"lint": "turbo lint",
"lint:fix": "turbo lint:fix",
"release": "changeset publish",
Expand All @@ -33,17 +34,18 @@
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@ianvs/prettier-plugin-sort-imports": "4.2.1",
"@types/bun": "1.0.10",
"@types/bun": "1.0.12",
"@types/web": "0.0.142",
"clean-package": "2.2.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-tailwindcss": "3.15.1",
"npm-check-updates": "16.14.17",
"npm-check-updates": "16.14.18",
"prettier": "3.2.5",
"prettier-plugin-packagejson": "2.4.12",
"prettier-plugin-tailwindcss": "0.5.12",
"prettier-plugin-packagejson": "2.4.14",
"prettier-plugin-tailwindcss": "0.5.13",
"rimraf": "5.0.5",
"turbo": "latest"
},
"packageManager": "bun@1.0.31"
"packageManager": "bun@1.1.0"
}
12 changes: 7 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"format": "prettier . --write",
"format:check": "prettier . --check",
"prepack": "clean-package",
"postpack": "clean-package restore",
"prepublishOnly": "bun run build",
"start": "bun run dist/index.js",
"typecheck": "tsc --noEmit"
Expand All @@ -53,18 +52,21 @@
"rimraf": "5.0.5"
},
"devDependencies": {
"clean-package": "2.2.0",
"tsup": "8.0.2",
"typescript": "5.4.2"
"typescript": "5.4.3"
},
"engines": {
"node": ">=18.0.0"
},
"clean-package": {
"remove": [
"scripts",
"devDependencies",
"clean-package"
]
],
"replace": {
"scripts": {
"postpublish": "clean-package restore"
}
}
}
}
46 changes: 25 additions & 21 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@
"license": "MIT",
"exports": {
".": {
"types": "./lib/esm/index.d.ts",
"types": "./lib/types/index.d.ts",
"import": "./lib/esm/index.js",
"require": "./lib/cjs/index.js"
},
"./components/*": {
"types": "./lib/esm/components/*/index.d.ts",
"types": "./lib/types/components/*/index.d.ts",
"import": "./lib/esm/components/*/index.js",
"require": "./lib/cjs/components/*/index.js"
}
},
"./package.json": "./package.json"
},
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand All @@ -38,61 +39,64 @@
"lib"
],
"scripts": {
"build": "rimraf coverage lib && bun build:cjs && bun build:esm",
"build": "rimraf lib && bun build:fast",
"build:cjs": "tsc -p tsconfig.build.json --module CommonJS --outDir lib/cjs",
"build:esm": "tsc -p tsconfig.build.json --module ESNext --declaration --outDir lib/esm",
"build:esm": "tsc -p tsconfig.build.json --module ESNext --outDir lib/esm",
"build:fast": "bun build:cjs && bun build:esm && bun build:types",
"build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir lib/types",
"clean": "rimraf .turbo coverage lib node_modules tsconfig.tsbuildinfo",
"dev": "",
"dev": "bun build:fast --watch",
"format": "prettier . --write",
"format:check": "prettier . --check",
"postinstall": "bun run build",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"prepack": "clean-package",
"postpack": "clean-package restore",
"prepublishOnly": "bun run build",
"test": "vitest",
"test:coverage": "vitest run --coverage",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@floating-ui/core": "1.6.0",
"@floating-ui/react": "0.26.9",
"@floating-ui/react": "0.26.10",
"classnames": "2.5.1",
"debounce": "2.0.0",
"flowbite": "2.3.0",
"react-icons": "5.0.1",
"react-indiana-drag-scroll": "2.2.0",
"tailwind-merge": "2.2.2"
},
"devDependencies": {
"@testing-library/jest-dom": "6.4.2",
"@testing-library/react": "14.2.2",
"@testing-library/user-event": "14.5.2",
"@types/react": "18.2.67",
"@types/react-dom": "18.2.22",
"@typescript-eslint/eslint-plugin": "7.3.1",
"@typescript-eslint/parser": "7.3.1",
"@types/react": "18.2.73",
"@types/react-dom": "18.2.23",
"@typescript-eslint/eslint-plugin": "7.4.0",
"@typescript-eslint/parser": "7.4.0",
"@vitejs/plugin-react": "4.2.1",
"@vitest/coverage-v8": "1.4.0",
"clean-package": "2.2.0",
"eslint-plugin-react": "7.34.1",
"eslint-plugin-storybook": "0.8.0",
"eslint-plugin-vitest": "0.3.26",
"eslint-plugin-vitest": "0.4.1",
"jsdom": "24.0.0",
"typescript": "5.4.2",
"mime": "^4.0.1",
"typescript": "5.4.3",
"vitest": "1.4.0"
},
"peerDependencies": {
"react": "^18",
"react-dom": "^18",
"react": ">=18",
"react-dom": ">=18",
"tailwindcss": "^3"
},
"clean-package": {
"remove": [
"scripts",
"devDependencies",
"clean-package"
]
],
"replace": {
"scripts": {
"postpublish": "clean-package restore"
}
}
}
}
3 changes: 2 additions & 1 deletion packages/ui/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"incremental": false,
"sourceMap": true,
"jsx": "react-jsx"
},
"include": ["src"],
"exclude": ["dist", "**/*.spec.ts", "**/*.spec.tsx", "**/*.stories.tsx"]
"exclude": ["lib", "**/*.spec.ts", "**/*.spec.tsx", "**/*.stories.tsx"]
}

0 comments on commit b6ebb31

Please sign in to comment.