-
-
Notifications
You must be signed in to change notification settings - Fork 456
packages(ui): build step using rollup + tsc #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
1193890
refactor: packages(ui) - use `rollup` to build and transpile + tsc fo…
SutuSebastian 58bbf58
chore: packages(ui) - remove `rollup-plugin-delete` replace with loca…
SutuSebastian e3ddcc6
fix: packages(ui) - build step generateDts overriding the rest
SutuSebastian f810b9e
fix: packages(ui) - rework tsconfig files
SutuSebastian 20e6768
feat: packages(ui) - create tailwind plugin for easier management of …
SutuSebastian e653c20
feat: packages(ui) - remove tailwind plugin and replace it with `tail…
SutuSebastian 9ee66ae
chore: remove comments
SutuSebastian e291e80
chore: remove unused package
SutuSebastian 5a09c56
chore: remove rollup external leftover path
SutuSebastian 58ae945
chore: add `trustedDependencies` for `postinstall` script to work in …
SutuSebastian db6618d
chore: get rid of `postinstall` lifecycle script and configure turbor…
SutuSebastian e29e489
fix: turborepo `packages/ui` script dependencies
SutuSebastian aa184ae
chore: rollup config - remove redundant array structure
SutuSebastian afc5490
chore: simplify turbo configs + fix `packages/ui` outputs path
SutuSebastian e4cf84f
chore: update docs introduction and installation guides to new config
SutuSebastian c9824ba
fix: docs redwood guide tailwind config path
SutuSebastian c610613
chore: remove comment
SutuSebastian 9c6a7b3
fix: docs redwood guide tailwind config path typo
SutuSebastian f8f6e78
chore: add changeset
SutuSebastian 70f804d
Update .changeset/hungry-toys-care.md
SutuSebastian ab9e16b
Update .changeset/hungry-toys-care.md
SutuSebastian 41b0f1b
Update .changeset/hungry-toys-care.md
SutuSebastian 82ec7ed
Update .changeset/hungry-toys-care.md
SutuSebastian 50c7cdd
chore: bump version minor
SutuSebastian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
"flowbite-react": minor | ||
--- | ||
|
||
## Rework build process using `rollup` and `tsc` | ||
|
||
### Summary | ||
|
||
In order to bring more performance to the build process of `flowbite-react` package, we have to consider transpiling the files using other tools rather than `tsc`, which is very slow. | ||
|
||
After evaluating various tools including `tsup`, `tshy`, and `bun build`, we chose `rollup` with the `esbuild` plugin for transpiling due to its performance and flexibility. We continue to use `tsc` solely for generating `*.d.ts` declaration files. | ||
|
||
### Changes | ||
|
||
- added `rollup` + `esbuild` for transpiling files | ||
- all files in the `cjs` directory now have `.cjs` extension | ||
- all files in the `esm` directory now have `.mjs` extension | ||
- declaration file types (`*.d.ts`) have been moved from `dist/esm` to `dist/types` | ||
- changed the build output dir from `lib` to `dist` | ||
- created a facade layer for easier management of the `content` path as well as the `plugin` | ||
- fixed turbo repo dependency tree configs in order for `apps/web` to properly pipe and require the build output of `packages/ui` in certain script steps such as `build` and `dev` | ||
|
||
### Breaking changes | ||
|
||
`tailwind.config.js` `content` path: | ||
|
||
old: `"node_modules/flowbite-react/lib/esm/**/*.js"` | ||
|
||
new: `"node_modules/flowbite-react/dist/esm/**/*.mjs"` - (`flowbite.content()` returns it) | ||
|
||
Before | ||
|
||
```js {5,9} | ||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: [ | ||
// ... | ||
"node_modules/flowbite-react/lib/esm/**/*.js", | ||
], | ||
plugins: [ | ||
// ... | ||
require("flowbite/plugin"), | ||
], | ||
}; | ||
``` | ||
|
||
After | ||
|
||
```js {1,7,11} | ||
const flowbite = require("flowbite-react/tailwind"); | ||
|
||
/** @type {import('tailwindcss').Config} */ | ||
module.exports = { | ||
content: [ | ||
// ... | ||
flowbite.content(), | ||
], | ||
plugins: [ | ||
// ... | ||
flowbite.plugin(), | ||
], | ||
}; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.