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

feat: migrate to using bun #348

Merged
merged 8 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ env:
UPSTASH_REDIS_REST_URL: ${{secrets.UPSTASH_REDIS_REST_URL}}
UPSTASH_REDIS_REST_TOKEN: ${{secrets.UPSTASH_REDIS_REST_TOKEN}}

# Volta
VOLTA_FEATURE_PNPM: 1

jobs:
main:
name: CI
Expand All @@ -38,20 +35,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Volta
uses: volta-cli/action@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: '1.0.8'

- name: Install Node & pnpm
run: volta install node && volta install pnpm
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18.18.2'

- name: Install dependencies
run: pnpm install
run: bun install

- name: Check format
run: pnpm format:check
run: bun run format:check

- name: Check lint
run: pnpm lint
run: bun run lint

- name: Build
run: pnpm build
run: bun run build
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
.next
bun.lockb
pnpm-lock.yaml
migrations
35 changes: 19 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ If you would like to be more involved in the development of Noodle, we would lik
The Environment:

- [NodeJS](https://nodejs.org/en)
- [Pnpm](https://pnpm.io/)
- [Bun](https://bun.sh/)

The Tech Stack:

Expand Down Expand Up @@ -114,27 +114,30 @@ git clone https://github.com/<your-gh-username>/noodle.git

### Volta

To get the project running locally, it is advised that you have [Volta](https://volta.sh/) installed on your system. This allows you to have the exact same versions of [NodeJS](https://nodejs.org/en) and [Pnpm](https://pnpm.io/) as we do, further lowering the chances of you getting errors that we don't get.
To get the project running locally, it is advised that you have [Volta](https://volta.sh/) installed on your system. This allows you to have the exact same versions of [NodeJS](https://nodejs.org/en), further lowering the chances of you getting errors that we don't get.

There are ways to do this using other tools such as NVM, but we take Noodle as an initiative to move people to arguably better tools such as Volta.

Volta's pnpm support is currently experimental, and so you need to do the following to let it manage your Pnpm version:

In your `.bashrc` or `.zshrc` file, add the following line:
With this out of the way, you should have the correct version of Nodejs once you change directory into Noodle's project folder. You can test this out as such:

```bash
export VOLTA_FEATURE_PNPM=1
# cd into noodle
cd /path/to/noodle

# output node version
node --version
```

With this out of the way, you should have the correct version of Nodejs and Pnpm once you change directory into Noodle's project folder. You can test this out as such:
### Bun

TODO: write this

```bash
# cd into noodle
cd /path/to/noodle

# output node and pnpm versions
node --version
pnpm --version
# output bun version
bun --version
```

And make sure that the version is the same as the one defined in the root `package.json` file in the `volta` section.
Expand Down Expand Up @@ -190,25 +193,25 @@ And that's all for the redis part!

### Installing dependencies

To install the dependencies needed to run Noodle, you need to run `pnpm install`, this will install all of the packages that we use. After this is done, you are ready to run Noodle locally!
To install the dependencies needed to run Noodle, you need to run `bun install`, this will install all of the packages that we use. After this is done, you are ready to run Noodle locally!

### Running stuff

```bash
# Run the project's dev server
pnpm dev
bun run dev

# Build the project
pnpm build
bun run build

# Run the built project in production mode
pnpm start
bun run start

# Lint
pnpm lint
bun run lint

# Format
pnpm format:write
bun run format:write
```

## Closing notes
Expand Down
Binary file added bun.lockb
Binary file not shown.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"author": "NOODLE RUN LTD",
"private": true,
"scripts": {
"dev": "pnpm db:migrate && next dev",
"build": "pnpm db:migrate && next build",
"dev": "bun run db:migrate && bun run next dev",
"build": "bun run db:migrate && bun run next build",
"start": "next start",
"lint": "next lint --fix",
"format": "prettier --write .",
Expand Down Expand Up @@ -113,6 +113,6 @@
},
"volta": {
"node": "18.18.2",
"pnpm": "8.9.2"
"bun": "1.0.8"
}
}
Loading
Loading