Skip to content

Commit b19a92e

Browse files
SutuSebastianSutuSebastian
andauthored
Monorepo conversion (using bun) (#1264)
* monorepo init: - bun [runtime, package manager, task runner, test runner] - biome [format, lint] - removed `cypress` (to be replaced with `playwright`) - removed codecov - split into multiple packages and apps [web(docs), ui(library), storybook, cli] UNSTABLE * (web): remove unused packages * remove eslint disable rules comments * fix some linting errors * (web): link library to monorepo `ui` package * fix(web): build fix(ui): exports fix(root): sort `package.json` * package upgrade * fix(storybook): - replace `@vitejs/plugin-react-sw` -> `@vitejs/plugin-react` - fix build - add `.gitignore` - update stories path * move git related files in `.git` * cleanup: - remove `biome` and drop `bun:test` until stable - add `prettier` - imporve `.vscode` files and add extentions suggestions * - restore prettier config + add tailwind formatting support - remove more biome leftover - add package json sorter * upgrade all packages * refactor: - prettier config: add import sorting - format files * packages: up * packages: up storybook * fix: prettier plugin order * chore(ui): add `vitest`; add missing `Accordion.spec` import * chore(root): add turbo test commands and format `package.json` * fix: intellisense and tailwind support; add `eslint` * fix(lib): lint errors * feat(ui): add `createTheme` tailwindcss intellisense function * refactor(ui): use new tailwindcss shorthands * fix(storybook/banner): remove invalid tailwind classes * chore: add `.editorconfig` * refactor(ui): wrap all components `theme` with `createTheme` to gain class sorting, linting and apply fixes * fix: prettier config for root and for apps and packages; format code * refactor: move common eslint packages to root `package.json`; - add `eslint` to `web` - optimise onboarding flow - fix tailwind lint errors here and there * chore: up packages * refactor: (web) lint rules + fix examples * refactor: CI/CD improvements: - refactor github actions - setup github actions using `bun` - remove storybook github action (redo later) * fix: CI/CD setup action, add missing required property * fix(web): typecheck * fix(lib): type module for failing tests * fix(lib): `package.json` meta and npm tags; update peerDeps * fix(lib: tsconfig exclude * fix(lib): rename eslint config to cjs since `"type": "module"` * fix(web): eslint nextjs rule; supposably fixed flicker on reload * fix(lib): merge-deep test * chore(lib): eslint config updates * fix(lib): bypass `datepicker` test (unfinished) * refactor(lib): remove `toggleSwitchTheme` empty space * chore: up packages * fix(lib): failing tests due to concurrency * fix(lib): test coverage + format files * refactor(global): switch from `singleQuote` to double * refactor(lib): more tailwind shorthands * chore: up packages * chore: up packages * packages(cli): add first version general: update packages * packages(cli): fix typecheck * packages(cli): refactor - add [dir] argument - add [options] argument - `--template <name>` - `-h, --help` * packages(cli): add `-v, --version` in [options] * packages(cli): add `README.md` * fix: package.json repository.url * packages(cli): add `--git` option * packages(cli): up package version * packages(cli): update `README.md` * packages(cli): bump package version patch * config: sort and tidy up .vscode settings.json * fix(docs): navbar package version * fix(docs): mdx heading color * feat(docs): code demo: - add screen size controls (desktop/tablet/mobile) - add RTL control * feat(docs): code demo: - add tooltip to copy-to-clipboard - fix icon sizes * feat(docs): create `CLI` page * feat(docs): integratoin guides - add `CLI` and `Templates` sections * fix(web): homepage - components section hover styles; sidebar - more spacing (synced with @robert) * packages(cli): update `README.md` apps(web): update CLI page * packages(cli): bump package version patch * apps(web): update `README.md`, `CONTRIBUTING` files; change integration guides order based on popularity/category; remove redundant `typescript` page packages(cli): change integration guides order based on popularity/category; bump version (patch) * apps(web): fix, rewrite and simplify `introduction` and `quickstart` pages * apps(web): fix narrow context * apps(web): small style fixes * chore: up packages + format * apps(web): add `Editor Setup` page * apps(web): remix guide: add dark mode section * apps(web): refactor `Dark mode` page * fix: color flicker on reload + move background and text color to root layout * packages(ui): fix alert them blue color * apps(web): code demo: isolate dark/light mode * apps(web): inline code: add background * feat: add `changeset` * chore: move `CHANGELOG` to packages/ui * chore: add self to `FUNDING` * chore: add `@changesets/changelog-github` * chore: up packages * core improvements: - add `rimraf` for windows support - add `clean-package` for cleaner `package.json` file (used for `flowbite-react` and `create-flowbite-react` packages) * packages(cli): change intro color from `blue` to `cyan` + bump version (patch) * packages(cli): update package.json - add [homepage, bugs] links * chore: move root `README.md` to `packages/ui` + create symlink from it to root * core(ci): test build sync times * core(ci): test build async times * chore: format * fix: turbo.json configs and isolate using turbo workspaces * chore: CLI commands to use @latest for `pnpm` and `bun` * chore: version `packages/cli` * chore: remove random code example * chore: spacing * chore: up `packageManager` version * fix: storybook next dependency examples * chore: up packages, see if it fixes storybook build failure * fix: storybook types * fix: storybook warning * packages(ui): fix version * chore: up `packageManager` version * chore: up packages, see if it fixes storybook build failure * chore: rebuild lock file, check if storybook fails * chore: CI cache clear before install * chore: undo CI cache clear before install * chore: downgrade `packageManager` from `[email protected]` to stable `[email protected]` due to storybook failing; update some packages * chore: bump storybook packages * fix(ui): polymorphic component return type -> type casting * chore: simplify types * chore: bump package from merge conflict --------- Co-authored-by: SutuSebastian <[email protected]>
1 parent c32728b commit b19a92e

File tree

1,273 files changed

+28288
-42666
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,273 files changed

+28288
-42666
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": ["@changesets/changelog-github", { "repo": "themesberg/flowbite-react" }],
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": ["storybook", "web"]
11+
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = lf
7+
indent_size = 2
8+
indent_style = space
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.
File renamed without changes.

CONTRIBUTING.md renamed to .github/CONTRIBUTING.md

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ And if you like the project, but just don't have time to contribute, that's fine
1111
- Refer this project in your project's readme
1212
- Mention the project at local meetups and tell your friends/colleagues
1313

14-
## Table of Contents
15-
16-
- [Code of Conduct](#code-of-conduct)
17-
- [I Have a Question](#i-have-a-question)
18-
- [I Want To Contribute](#i-want-to-contribute)
19-
- [Reporting Bugs](#reporting-bugs)
20-
- [Suggesting Enhancements](#suggesting-enhancements)
21-
- [Your First Code Contribution](#your-first-code-contribution)
22-
- [Improving The Documentation](#improving-the-documentation)
23-
- [Styleguides](#styleguides)
24-
- [Commit Messages](#commit-messages)
25-
2614
## Code of Conduct
2715

2816
This project has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) as its Code of Conduct. Everyone is expected to adhere to these rules, so please read the [full text](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). Thank you.
@@ -108,11 +96,11 @@ Don't forget to:
10896

10997
#### Prerequisites
11098

111-
- You need to understand how to use a terminal, Git, Node.js, and Yarn
112-
- You should be able to write Markdown and React TypeScript
113-
- You should be familiar with Tailwind CSS, ESLint, and Prettier
99+
- You need to understand how to use a terminal, `Git`, `Node.js`, and `Bun`
100+
- You should be able to write `Markdown` and `React TypeScript`
101+
- You should be familiar with `Tailwind` `CSS`, `ESLint`, and `Prettier`
114102
- You should understand what [vitest](https://vitest.dev/) is, and be able to write tests if your contribution changes the behavior of the library in some way
115-
- You should strongly consider using [Visual Studio Code](https://code.visualstudio.com/) as your editor, as it has plugins for Tailwind CSS, ESLint, and Prettier which will automatically fix most style issues for you, and offer suggestions for how to fix the rest
103+
- You should strongly consider using [Visual Studio Code](https://code.visualstudio.com/) as your editor, as it has plugins for `Tailwind CSS`, `ESLint`, and `Prettier` which will automatically fix most style issues for you, and offer suggestions for how to fix the rest
116104

117105
#### Creating a Pull Request
118106

@@ -131,39 +119,33 @@ git remote add upstream https://github.com/themesberg/flowbite-react.git
131119
git checkout -b fix/accordion-alwaysopen
132120
```
133121

134-
4. Install dependencies with [`yarn`](https://classic.yarnpkg.com/en/docs/install#debian-stable):
122+
4. Install dependencies with [`bun`](https://bun.sh/):
135123

136124
```bash
137-
yarn install
125+
bun install
138126
```
139127

140128
5. Start a development server on your machine:
141129

142130
```bash
143-
yarn dev
131+
bun run dev
144132
```
145133

146-
6. Commit changes with `yarn commit` to follow the required [commitizen](https://github.com/commitizen/cz-cli) format:
134+
6. Make sure your changes work and don't break anything else:
147135

148136
```bash
149-
yarn commit
137+
bun run format && bun run lint:fix && bun run test && bun run build
150138
```
151139

152-
7. Make sure your changes work and don't break anything else:
153-
154-
```bash
155-
yarn prettier:fix && yarn lint && yarn test && yarn build
156-
```
157-
158-
8. Push to your forked repository
140+
7. Push to your forked repository
159141

160142
```bash
161143
git push -u origin fix/accordion-alwaysopen
162144
```
163145

164-
9. Go to [the repository](https://github.com/themesberg/flowbite-react) and [create a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
146+
8. Go to [the repository](https://github.com/themesberg/flowbite-react) and [create a Pull Request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
165147

166-
10. Fill out the Pull Request template, which will be available automatically
148+
9. Fill out the Pull Request template, which will be available automatically
167149

168150
#### What Happens Next?
169151

@@ -179,14 +161,10 @@ The [documentation at flowbite-react.com](https://flowbite-react.com/docs/gettin
179161

180162
### Files
181163

182-
We use [Prettier](https://prettier.io/) to format all of our code. Please make sure to run `yarn format` before committing any changes. You can also use VS Code as your editor, and install the Prettier and Tailwind CSS IntelliSense plugins to automatically format your code each time you save.
164+
We use [Prettier](https://prettier.io/) to format all of our code. Please make sure to run `bun run format` before committing any changes. You can also use VS Code as your editor, and install the Prettier and Tailwind CSS IntelliSense plugins to automatically format your code each time you save.
183165

184166
Please refer to the code written already in the project to see how we format our code, what naming conventions we use, and so on. The more consistent your code is with the rest of the project, the easier it will be to review and merge your Pull Request.
185167

186-
### Commits
187-
188-
We use [commitizen](https://github.com/commitizen/cz-cli) to format commit messages. Please use `yarn commit` instead of `git commit` when committing changes.
189-
190168
### Branches &amp; Pull Requests
191169

192170
Please follow the same guidelines published by [commitizen](https://github.com/commitizen/cz-cli) when you name a branch that will be used for a Pull Request. The branch name should be prefixed with the most significant change that will be introduced in the Pull Request.

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# These are supported funding model platforms
22

3-
github: [rluders, tulup-conner]
3+
github: [rluders, tulup-conner, SutuSebastian]

.github/actions/setup/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Setup
2+
description: Setup Bun, Node and install packages
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Setup Bun
8+
uses: oven-sh/setup-bun@v1
9+
with:
10+
bun-version: 1.0.31
11+
12+
- name: Setup Node
13+
uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
17+
- name: Install packages
18+
shell: bash
19+
run: bun install

.github/workflows/ci.yml

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,68 @@ on:
55
branches:
66
- main
77

8-
concurrency: ${{ github.ref }}
9-
108
jobs:
9+
format:
10+
name: 💅 Format
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout branch
14+
uses: actions/checkout@v4
15+
16+
- name: Setup
17+
uses: ./.github/actions/setup
18+
19+
- name: Run format
20+
run: bun run format:check
21+
22+
lint:
23+
name: 🕵 Lint
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout branch
27+
uses: actions/checkout@v4
28+
29+
- name: Setup
30+
uses: ./.github/actions/setup
31+
32+
- name: Run lint
33+
run: bun run lint
34+
35+
typecheck:
36+
name: ✅ Typecheck
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout branch
40+
uses: actions/checkout@v4
41+
42+
- name: Setup
43+
uses: ./.github/actions/setup
44+
45+
- name: Run typecheck
46+
run: bun run typecheck
47+
48+
test:
49+
name: 🔬 Test
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout branch
53+
uses: actions/checkout@v4
54+
55+
- name: Setup
56+
uses: ./.github/actions/setup
57+
58+
- name: Run unit tests
59+
run: bun run test:coverage
60+
1161
build:
62+
name: 🧰 Build
1263
runs-on: ubuntu-latest
1364
steps:
14-
- name: 📥 Check out the code
15-
uses: actions/checkout@v3
16-
with:
17-
fetch-depth: 2
18-
19-
- name: 💿 Setup NodeJS 20
20-
uses: actions/setup-node@v3
21-
with:
22-
node-version: 20
23-
24-
- name: ⏳ Setup Cache
25-
uses: actions/cache@v3
26-
with:
27-
path: '**/node_modules'
28-
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
29-
restore-keys: |
30-
${{ runner.os }}-modules-
31-
32-
- name: 🏭 Install packages
33-
run: yarn install
34-
35-
- name: 🕵 Lint the code
36-
run: yarn lint
37-
38-
- name: 💅 Run Prettier
39-
run: yarn prettier
40-
41-
- name: 🔬 Run unit tests
42-
run: yarn test:coverage
43-
44-
- name: 📊 Upload coverage to Codecov
45-
uses: codecov/codecov-action@v3
46-
with:
47-
fail_ci_if_error: true
48-
files: coverage/coverage-final.json
49-
token: ${{ secrets.CODECOV_TOKEN }}
50-
verbose: true
51-
52-
- name: 🧰 Build Library
53-
run: yarn build:lib
54-
55-
- name: 🧰 Build NextJS
56-
run: yarn build
65+
- name: Checkout branch
66+
uses: actions/checkout@v4
67+
68+
- name: Setup
69+
uses: ./.github/actions/setup
70+
71+
- name: Run build
72+
run: bun run build

.github/workflows/storybook.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)