Skip to content

Commit b6ebb31

Browse files
fix(ui): build step + improve DX (#1336)
* 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
1 parent 45930ef commit b6ebb31

File tree

11 files changed

+77
-57
lines changed

11 files changed

+77
-57
lines changed

.changeset/fuzzy-ravens-type.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-flowbite-react": patch
3+
---
4+
5+
fix `clean-package` flow

.changeset/old-flies-shop.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"flowbite-react": patch
3+
---
4+
5+
fix build step, export types and improve DX

.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ runs:
77
- name: Setup Bun
88
uses: oven-sh/setup-bun@v1
99
with:
10-
bun-version: 1.0.31
10+
bun-version: 1.1.0
1111

1212
- name: Setup Node
1313
uses: actions/setup-node@v4

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ node_modules
33

44
# misc
55
.DS_Store
6+
*.backup
67
*.pem
78

89
# typescript

apps/storybook/package.json

+16-16
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@
1515
"react-dom": "18.2.0"
1616
},
1717
"devDependencies": {
18-
"@storybook/addon-essentials": "8.0.2",
19-
"@storybook/addon-interactions": "8.0.2",
20-
"@storybook/addon-links": "8.0.2",
21-
"@storybook/addon-themes": "8.0.2",
22-
"@storybook/blocks": "8.0.2",
23-
"@storybook/react": "8.0.2",
24-
"@storybook/react-vite": "8.0.2",
25-
"@storybook/test": "8.0.2",
26-
"@types/react": "18.2.67",
27-
"@types/react-dom": "18.2.22",
18+
"@storybook/addon-essentials": "8.0.5",
19+
"@storybook/addon-interactions": "8.0.5",
20+
"@storybook/addon-links": "8.0.5",
21+
"@storybook/addon-themes": "8.0.5",
22+
"@storybook/blocks": "8.0.5",
23+
"@storybook/react": "8.0.5",
24+
"@storybook/react-vite": "8.0.5",
25+
"@storybook/test": "8.0.5",
26+
"@types/react": "18.2.73",
27+
"@types/react-dom": "18.2.23",
2828
"@vitejs/plugin-react": "4.2.1",
29-
"autoprefixer": "10.4.18",
30-
"postcss": "8.4.37",
31-
"storybook": "8.0.2",
32-
"tailwindcss": "3.4.1",
33-
"typescript": "5.4.2",
34-
"vite": "5.2.2"
29+
"autoprefixer": "10.4.19",
30+
"postcss": "8.4.38",
31+
"storybook": "8.0.5",
32+
"tailwindcss": "3.4.3",
33+
"typescript": "5.4.3",
34+
"vite": "5.2.7"
3535
}
3636
}

apps/web/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,25 @@
2121
},
2222
"devDependencies": {
2323
"@docsearch/react": "3.6.0",
24-
"@types/mdx": "2.0.11",
24+
"@types/mdx": "2.0.12",
2525
"@types/prismjs": "1.26.3",
26-
"@types/react": "18.2.67",
27-
"@types/react-dom": "18.2.22",
28-
"autoprefixer": "10.4.18",
26+
"@types/react": "18.2.73",
27+
"@types/react-dom": "18.2.23",
28+
"autoprefixer": "10.4.19",
2929
"eslint-config-next": "14.1.4",
3030
"markdown-toc": "1.2.0",
3131
"next": "14.1.4",
3232
"next-contentlayer": "0.3.4",
33-
"postcss": "8.4.37",
33+
"postcss": "8.4.38",
3434
"prismjs": "1.29.0",
3535
"react": "18.2.0",
3636
"react-dom": "18.2.0",
3737
"react-markdown": "9.0.1",
3838
"rehype-autolink-headings": "7.1.0",
3939
"rehype-prism-plus": "2.0.0",
4040
"rehype-slug": "6.0.0",
41-
"sharp": "0.33.2",
42-
"tailwindcss": "3.4.1",
43-
"typescript": "5.4.2"
41+
"sharp": "0.33.3",
42+
"tailwindcss": "3.4.3",
43+
"typescript": "5.4.3"
4444
}
4545
}

bun.lockb

-4.4 KB
Binary file not shown.

package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"dev:web": "turbo dev --filter=web",
2222
"format": "turbo format",
2323
"format:check": "turbo format:check",
24+
"postinstall": "bun build:ui",
2425
"lint": "turbo lint",
2526
"lint:fix": "turbo lint:fix",
2627
"release": "changeset publish",
@@ -33,17 +34,18 @@
3334
"@changesets/changelog-github": "0.5.0",
3435
"@changesets/cli": "2.27.1",
3536
"@ianvs/prettier-plugin-sort-imports": "4.2.1",
36-
"@types/bun": "1.0.10",
37+
"@types/bun": "1.0.12",
3738
"@types/web": "0.0.142",
39+
"clean-package": "2.2.0",
3840
"eslint": "8.57.0",
3941
"eslint-config-prettier": "9.1.0",
4042
"eslint-plugin-tailwindcss": "3.15.1",
41-
"npm-check-updates": "16.14.17",
43+
"npm-check-updates": "16.14.18",
4244
"prettier": "3.2.5",
43-
"prettier-plugin-packagejson": "2.4.12",
44-
"prettier-plugin-tailwindcss": "0.5.12",
45+
"prettier-plugin-packagejson": "2.4.14",
46+
"prettier-plugin-tailwindcss": "0.5.13",
4547
"rimraf": "5.0.5",
4648
"turbo": "latest"
4749
},
48-
"packageManager": "bun@1.0.31"
50+
"packageManager": "bun@1.1.0"
4951
}

packages/cli/package.json

+7-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
"format": "prettier . --write",
4040
"format:check": "prettier . --check",
4141
"prepack": "clean-package",
42-
"postpack": "clean-package restore",
4342
"prepublishOnly": "bun run build",
4443
"start": "bun run dist/index.js",
4544
"typecheck": "tsc --noEmit"
@@ -53,18 +52,21 @@
5352
"rimraf": "5.0.5"
5453
},
5554
"devDependencies": {
56-
"clean-package": "2.2.0",
5755
"tsup": "8.0.2",
58-
"typescript": "5.4.2"
56+
"typescript": "5.4.3"
5957
},
6058
"engines": {
6159
"node": ">=18.0.0"
6260
},
6361
"clean-package": {
6462
"remove": [
65-
"scripts",
6663
"devDependencies",
6764
"clean-package"
68-
]
65+
],
66+
"replace": {
67+
"scripts": {
68+
"postpublish": "clean-package restore"
69+
}
70+
}
6971
}
7072
}

packages/ui/package.json

+25-21
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
"license": "MIT",
2222
"exports": {
2323
".": {
24-
"types": "./lib/esm/index.d.ts",
24+
"types": "./lib/types/index.d.ts",
2525
"import": "./lib/esm/index.js",
2626
"require": "./lib/cjs/index.js"
2727
},
2828
"./components/*": {
29-
"types": "./lib/esm/components/*/index.d.ts",
29+
"types": "./lib/types/components/*/index.d.ts",
3030
"import": "./lib/esm/components/*/index.js",
3131
"require": "./lib/cjs/components/*/index.js"
32-
}
32+
},
33+
"./package.json": "./package.json"
3334
},
3435
"main": "lib/cjs/index.js",
3536
"module": "lib/esm/index.js",
@@ -38,61 +39,64 @@
3839
"lib"
3940
],
4041
"scripts": {
41-
"build": "rimraf coverage lib && bun build:cjs && bun build:esm",
42+
"build": "rimraf lib && bun build:fast",
4243
"build:cjs": "tsc -p tsconfig.build.json --module CommonJS --outDir lib/cjs",
43-
"build:esm": "tsc -p tsconfig.build.json --module ESNext --declaration --outDir lib/esm",
44+
"build:esm": "tsc -p tsconfig.build.json --module ESNext --outDir lib/esm",
45+
"build:fast": "bun build:cjs && bun build:esm && bun build:types",
46+
"build:types": "tsc -p tsconfig.build.json --declaration --emitDeclarationOnly --outDir lib/types",
4447
"clean": "rimraf .turbo coverage lib node_modules tsconfig.tsbuildinfo",
45-
"dev": "",
48+
"dev": "bun build:fast --watch",
4649
"format": "prettier . --write",
4750
"format:check": "prettier . --check",
48-
"postinstall": "bun run build",
4951
"lint": "eslint .",
5052
"lint:fix": "eslint . --fix",
5153
"prepack": "clean-package",
52-
"postpack": "clean-package restore",
5354
"prepublishOnly": "bun run build",
5455
"test": "vitest",
5556
"test:coverage": "vitest run --coverage",
5657
"typecheck": "tsc --noEmit"
5758
},
5859
"dependencies": {
5960
"@floating-ui/core": "1.6.0",
60-
"@floating-ui/react": "0.26.9",
61+
"@floating-ui/react": "0.26.10",
6162
"classnames": "2.5.1",
6263
"debounce": "2.0.0",
6364
"flowbite": "2.3.0",
6465
"react-icons": "5.0.1",
65-
"react-indiana-drag-scroll": "2.2.0",
6666
"tailwind-merge": "2.2.2"
6767
},
6868
"devDependencies": {
6969
"@testing-library/jest-dom": "6.4.2",
7070
"@testing-library/react": "14.2.2",
7171
"@testing-library/user-event": "14.5.2",
72-
"@types/react": "18.2.67",
73-
"@types/react-dom": "18.2.22",
74-
"@typescript-eslint/eslint-plugin": "7.3.1",
75-
"@typescript-eslint/parser": "7.3.1",
72+
"@types/react": "18.2.73",
73+
"@types/react-dom": "18.2.23",
74+
"@typescript-eslint/eslint-plugin": "7.4.0",
75+
"@typescript-eslint/parser": "7.4.0",
7676
"@vitejs/plugin-react": "4.2.1",
7777
"@vitest/coverage-v8": "1.4.0",
78-
"clean-package": "2.2.0",
7978
"eslint-plugin-react": "7.34.1",
8079
"eslint-plugin-storybook": "0.8.0",
81-
"eslint-plugin-vitest": "0.3.26",
80+
"eslint-plugin-vitest": "0.4.1",
8281
"jsdom": "24.0.0",
83-
"typescript": "5.4.2",
82+
"mime": "^4.0.1",
83+
"typescript": "5.4.3",
8484
"vitest": "1.4.0"
8585
},
8686
"peerDependencies": {
87-
"react": "^18",
88-
"react-dom": "^18",
87+
"react": ">=18",
88+
"react-dom": ">=18",
8989
"tailwindcss": "^3"
9090
},
9191
"clean-package": {
9292
"remove": [
93-
"scripts",
9493
"devDependencies",
9594
"clean-package"
96-
]
95+
],
96+
"replace": {
97+
"scripts": {
98+
"postpublish": "clean-package restore"
99+
}
100+
}
97101
}
98102
}

packages/ui/tsconfig.build.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"incremental": false,
5+
"sourceMap": true,
56
"jsx": "react-jsx"
67
},
78
"include": ["src"],
8-
"exclude": ["dist", "**/*.spec.ts", "**/*.spec.tsx", "**/*.stories.tsx"]
9+
"exclude": ["lib", "**/*.spec.ts", "**/*.spec.tsx", "**/*.stories.tsx"]
910
}

0 commit comments

Comments
 (0)