Skip to content
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

Monorepo conversion (using bun) #1264

Merged
merged 119 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
91e481c
monorepo init:
Jan 16, 2024
a23952c
(web): remove unused packages
Jan 16, 2024
8a2929c
remove eslint disable rules comments
Jan 16, 2024
eb3e9fa
fix some linting errors
Jan 16, 2024
dc61da9
(web): link library to monorepo `ui` package
Jan 16, 2024
c12e35f
fix(web): build
Jan 17, 2024
f5599b3
package upgrade
Jan 17, 2024
eec073a
fix(storybook):
Jan 17, 2024
6e8dcec
move git related files in `.git`
Jan 18, 2024
90283e4
cleanup:
Jan 18, 2024
607d4fc
- restore prettier config + add tailwind formatting support
Jan 18, 2024
0ce53b0
upgrade all packages
Jan 20, 2024
d041d44
refactor:
Jan 25, 2024
a8515c6
packages: up
Jan 25, 2024
85726f4
packages: up storybook
Jan 25, 2024
aee7a7d
fix: prettier plugin order
Jan 29, 2024
f0f567d
chore(ui): add `vitest`; add missing `Accordion.spec` import
Jan 31, 2024
90d1d56
chore(root): add turbo test commands and format `package.json`
Jan 31, 2024
af15662
fix: intellisense and tailwind support; add `eslint`
Feb 1, 2024
b6605de
fix(lib): lint errors
Feb 1, 2024
1692e7a
feat(ui): add `createTheme` tailwindcss intellisense function
Feb 1, 2024
757d035
refactor(ui): use new tailwindcss shorthands
Feb 1, 2024
afca232
fix(storybook/banner): remove invalid tailwind classes
Feb 1, 2024
97aa106
chore: add `.editorconfig`
Feb 1, 2024
19c1504
refactor(ui): wrap all components `theme` with `createTheme` to gain …
Feb 1, 2024
6687608
fix: prettier config for root and for apps and packages; format code
Feb 1, 2024
d0107e3
refactor: move common eslint packages to root `package.json`;
Feb 2, 2024
2a04456
chore: up packages
Feb 5, 2024
d261122
refactor: (web) lint rules + fix examples
Feb 5, 2024
887daf8
refactor: CI/CD improvements:
Feb 6, 2024
1ca1326
Merge remote-tracking branch 'origin/main' into monorepo/bun
Feb 7, 2024
f8540cd
fix: CI/CD setup action, add missing required property
Feb 7, 2024
54b6f73
fix(web): typecheck
Feb 7, 2024
9ae9958
fix(lib): type module for failing tests
Feb 7, 2024
df9e745
fix(lib): `package.json` meta and npm tags; update peerDeps
Feb 7, 2024
425e8e3
fix(lib: tsconfig exclude
Feb 7, 2024
f3455de
fix(lib): rename eslint config to cjs since `"type": "module"`
Feb 7, 2024
14ee9e7
fix(web): eslint nextjs rule; supposably fixed flicker on reload
Feb 7, 2024
f70a289
fix(lib): merge-deep test
Feb 7, 2024
1b2a3c4
chore(lib): eslint config updates
Feb 7, 2024
fa53d33
fix(lib): bypass `datepicker` test (unfinished)
Feb 7, 2024
7bd0abc
refactor(lib): remove `toggleSwitchTheme` empty space
Feb 7, 2024
9d4e2ae
chore: up packages
Feb 7, 2024
c57ea62
fix(lib): failing tests due to concurrency
Feb 7, 2024
476306b
fix(lib): test coverage + format files
Feb 7, 2024
50f9ca9
refactor(global): switch from `singleQuote` to double
Feb 12, 2024
1ac7b26
refactor(lib): more tailwind shorthands
Feb 12, 2024
bc46766
chore: up packages
Feb 19, 2024
07c6e00
chore: up packages
Feb 20, 2024
8224912
packages(cli): add first version
Feb 24, 2024
bdadabc
packages(cli): fix typecheck
Feb 24, 2024
56a17b3
packages(cli): refactor
Feb 26, 2024
7669705
packages(cli): add `-v, --version` in [options]
Feb 27, 2024
2173786
packages(cli): add `README.md`
Feb 27, 2024
2581910
fix: package.json repository.url
Feb 27, 2024
10aca28
packages(cli): add `--git` option
Feb 27, 2024
2c48ea3
packages(cli): up package version
Feb 27, 2024
2a3ee27
packages(cli): update `README.md`
Feb 27, 2024
5b6b56f
packages(cli): bump package version patch
Feb 27, 2024
61ef32e
config: sort and tidy up .vscode settings.json
Feb 28, 2024
8392871
fix(docs): navbar package version
Feb 29, 2024
50d1e0e
fix(docs): mdx heading color
Feb 29, 2024
faa7386
feat(docs): code demo:
Feb 29, 2024
82dbfba
feat(docs): code demo:
Feb 29, 2024
997fb98
feat(docs): create `CLI` page
Feb 29, 2024
ad60998
feat(docs): integratoin guides - add `CLI` and `Templates` sections
Feb 29, 2024
5df75e7
fix(web): homepage - components section hover styles; sidebar - more …
Mar 1, 2024
74c7f69
packages(cli): update `README.md`
Mar 1, 2024
662dc6c
packages(cli): bump package version patch
Mar 1, 2024
c1a0804
apps(web): update `README.md`, `CONTRIBUTING` files; change integrati…
Mar 1, 2024
6f6e8d3
apps(web): fix, rewrite and simplify `introduction` and `quickstart` …
Mar 1, 2024
0916523
apps(web): fix narrow context
Mar 1, 2024
cecf8d0
apps(web): small style fixes
Mar 2, 2024
a165164
chore: up packages + format
Mar 2, 2024
d2b1f77
apps(web): add `Editor Setup` page
Mar 2, 2024
74d82bb
apps(web): remix guide: add dark mode section
Mar 2, 2024
04f7551
apps(web): refactor `Dark mode` page
Mar 2, 2024
ba3a169
fix: color flicker on reload + move background and text color to root…
Mar 2, 2024
7a000bd
packages(ui): fix alert them blue color
Mar 3, 2024
6b63bb6
apps(web): code demo: isolate dark/light mode
Mar 4, 2024
42d4647
apps(web): inline code: add background
Mar 4, 2024
23978aa
feat: add `changeset`
Mar 6, 2024
e2bbd68
chore: move `CHANGELOG` to packages/ui
Mar 6, 2024
927c11c
chore: add self to `FUNDING`
Mar 6, 2024
12bc373
chore: add `@changesets/changelog-github`
Mar 6, 2024
0b16b03
chore: up packages
Mar 6, 2024
e1c2eef
Merge remote-tracking branch 'origin/main' into monorepo/bun
Mar 6, 2024
df9c0c9
core improvements:
Mar 7, 2024
0039484
packages(cli): change intro color from `blue` to `cyan` + bump versio…
Mar 7, 2024
b93850a
packages(cli): update package.json - add [homepage, bugs] links
Mar 7, 2024
b2ba296
chore: move root `README.md` to `packages/ui` + create symlink from i…
Mar 7, 2024
2bb7b79
core(ci): test build sync times
Mar 7, 2024
7ae5057
core(ci): test build async times
Mar 7, 2024
6d371d1
chore: format
Mar 7, 2024
7f9a9a5
fix: turbo.json configs and isolate using turbo workspaces
Mar 7, 2024
ad15f9b
chore: CLI commands to use @latest for `pnpm` and `bun`
Mar 11, 2024
3328578
chore: version `packages/cli`
Mar 11, 2024
1ad0206
chore: remove random code example
Mar 12, 2024
a82a7ff
chore: spacing
Mar 16, 2024
646780a
chore: up `packageManager` version
Mar 16, 2024
0ef37a6
Merge remote-tracking branch 'origin/main' into monorepo/bun + fix co…
Mar 18, 2024
f9c719e
fix: storybook next dependency examples
Mar 18, 2024
7761f5b
chore: up packages, see if it fixes storybook build failure
Mar 18, 2024
1c52651
fix: storybook types
Mar 18, 2024
299255e
fix: storybook warning
Mar 18, 2024
5f2d8c9
packages(ui): fix version
Mar 18, 2024
fe9efe2
chore: up `packageManager` version
Mar 18, 2024
fa8cca2
chore: up packages, see if it fixes storybook build failure
Mar 19, 2024
624352c
Merge remote-tracking branch 'origin/main' into monorepo/bun
Mar 19, 2024
af86014
chore: rebuild lock file, check if storybook fails
Mar 19, 2024
a9ae007
chore: CI cache clear before install
Mar 19, 2024
8558c49
chore: undo CI cache clear before install
Mar 19, 2024
63da08b
chore: downgrade `packageManager` from `bun@1.0.33` to stable `bun@1.…
Mar 20, 2024
18a2192
chore: bump storybook packages
Mar 20, 2024
36539a1
fix(ui): polymorphic component return type -> type casting
Mar 20, 2024
447bd11
chore: simplify types
Mar 20, 2024
4fb16af
Merge remote-tracking branch 'origin/main' into monorepo/bun
Mar 20, 2024
1aa52d0
chore: bump package from merge conflict
Mar 20, 2024
22ee5b7
Merge remote-tracking branch 'origin/main' into monorepo/bun
Mar 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "themesberg/flowbite-react" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["storybook", "web"]
}
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

File renamed without changes.
48 changes: 13 additions & 35 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ And if you like the project, but just don't have time to contribute, that's fine
- Refer this project in your project's readme
- Mention the project at local meetups and tell your friends/colleagues

## Table of Contents

- [Code of Conduct](#code-of-conduct)
- [I Have a Question](#i-have-a-question)
- [I Want To Contribute](#i-want-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Your First Code Contribution](#your-first-code-contribution)
- [Improving The Documentation](#improving-the-documentation)
- [Styleguides](#styleguides)
- [Commit Messages](#commit-messages)

## Code of Conduct

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.
Expand Down Expand Up @@ -108,11 +96,11 @@ Don't forget to:

#### Prerequisites

- You need to understand how to use a terminal, Git, Node.js, and Yarn
- You should be able to write Markdown and React TypeScript
- You should be familiar with Tailwind CSS, ESLint, and Prettier
- You need to understand how to use a terminal, `Git`, `Node.js`, and `Bun`
- You should be able to write `Markdown` and `React TypeScript`
- You should be familiar with `Tailwind` `CSS`, `ESLint`, and `Prettier`
- 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
- 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
- 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

#### Creating a Pull Request

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

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

```bash
yarn install
bun install
```

5. Start a development server on your machine:

```bash
yarn dev
bun run dev
```

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

```bash
yarn commit
bun run format && bun run lint:fix && bun run test && bun run build
```

7. Make sure your changes work and don't break anything else:

```bash
yarn prettier:fix && yarn lint && yarn test && yarn build
```

8. Push to your forked repository
7. Push to your forked repository

```bash
git push -u origin fix/accordion-alwaysopen
```

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)
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)

10. Fill out the Pull Request template, which will be available automatically
9. Fill out the Pull Request template, which will be available automatically

#### What Happens Next?

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

### Files

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.
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.

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.

### Commits

We use [commitizen](https://github.com/commitizen/cz-cli) to format commit messages. Please use `yarn commit` instead of `git commit` when committing changes.

### Branches & Pull Requests

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.
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

github: [rluders, tulup-conner]
github: [rluders, tulup-conner, SutuSebastian]
19 changes: 19 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup
description: Setup Bun, Node and install packages

runs:
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: 1.0.31

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install packages
shell: bash
run: bun install
106 changes: 61 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,68 @@ on:
branches:
- main

concurrency: ${{ github.ref }}

jobs:
format:
name: 💅 Format
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run format
run: bun run format:check

lint:
name: 🕵 Lint
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run lint
run: bun run lint

typecheck:
name: ✅ Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run typecheck
run: bun run typecheck

test:
name: 🔬 Test
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run unit tests
run: bun run test:coverage

build:
name: 🧰 Build
runs-on: ubuntu-latest
steps:
- name: 📥 Check out the code
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: 💿 Setup NodeJS 20
uses: actions/setup-node@v3
with:
node-version: 20

- name: ⏳ Setup Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-

- name: 🏭 Install packages
run: yarn install

- name: 🕵 Lint the code
run: yarn lint

- name: 💅 Run Prettier
run: yarn prettier

- name: 🔬 Run unit tests
run: yarn test:coverage

- name: 📊 Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
files: coverage/coverage-final.json
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true

- name: 🧰 Build Library
run: yarn build:lib

- name: 🧰 Build NextJS
run: yarn build
- name: Checkout branch
uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup

- name: Run build
run: bun run build
21 changes: 0 additions & 21 deletions .github/workflows/storybook.yml

This file was deleted.

22 changes: 9 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
.next
.vercel
build
coverage
cypress/screenshots
cypress/videos
lib
# dependencies
node_modules
storybook-static

# misc
.DS_Store
npm-debug.log*
*.pem

# typescript
tsconfig.tsbuildinfo
yarn-debug.log*
yarn-error.log*
dist
.contentlayer

# turbo
.turbo
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions .npmignore

This file was deleted.

19 changes: 0 additions & 19 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

Loading