Skip to content

Commit

Permalink
Merge pull request #122 from sablier-labs/build/bun
Browse files Browse the repository at this point in the history
build: switch to bun for dep management
  • Loading branch information
PaulRBerg authored Dec 31, 2023
2 parents 9e19491 + 71ac48a commit fac672d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 12,771 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ repos

# files
babel.config.js
bun.lockb
docusaurus.config.js
package-lock.json
pnpm-lock.yaml
yarn.lock
24 changes: 8 additions & 16 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,28 @@ jobs:
- name: "Check out the repo"
uses: "actions/checkout@v3"

- name: "Install Pnpm"
uses: "pnpm/action-setup@v2"
with:
version: "8"

- name: "Install Node.js"
uses: "actions/setup-node@v3"
with:
cache: "pnpm"
node-version: "lts/*"
- name: "Install Bun"
uses: "oven-sh/setup-bun@v1"

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

- name: "Lint the code"
run: "pnpm check"
run: "bun run check"

- name: "Pull Vercel environment information"
run: "pnpm vercel pull --environment=production --token=$VERCEL_TOKEN --yes"
run: "bun vercel pull --environment=production --token=$VERCEL_TOKEN --yes"

- name: "Build the website"
run: "pnpm vercel build --prod --token=$VERCEL_TOKEN"
run: "bun vercel build --prod --token=$VERCEL_TOKEN"

- name: "Add build summary"
run: |
echo "## Build results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY
- name: "Deploy website to Vercel"
run: "pnpm vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN"
- name: "Deploy the website to Vercel"
run: "bun vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN"

- name: "Add deploy summary"
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ node_modules
.DS_Store
*.tsbuildinfo
.pnp.*
package-lock.json
pnpm-lock.yaml
yarn.lock
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ repos
.DS_Store
*.tsbuildinfo
.pnp.*
bun.lockb
package-lock.json
pnpm-lock.yaml
yarn.lock
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ This website contains all documentation for Sablier, including older protocol re
## Installation

```sh
$ pnpm install
$ bun install
```

## Local Development

```sh
$ pnpm start
$ bun run start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without
Expand All @@ -21,7 +21,7 @@ having to restart the server.
## Build

```sh
$ pnpm build
$ bun run build
```

This command generates static content into the `build` directory, and can be served using any static contents hosting
Expand All @@ -30,7 +30,7 @@ service.
## Clear cache

```sh
$ pnpm clear
$ bun run clear
```

## License
Expand Down
Binary file added bun.lockb
Binary file not shown.
10 changes: 5 additions & 5 deletions docs/contracts/v2/guides/01-local-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ You will need the following software on your machine:
- [Git](https://git-scm.com/downloads)
- [Foundry](https://github.com/foundry-rs/foundry)
- [Node.js](https://nodejs.org/en/download)
- [Yarn](https://yarnpkg.com/)
- [Bun](https://bun.sh)

In addition, familiarity with [Ethereum](https://ethereum.org/) and [Solidity](https://soliditylang.org/) is requisite.

Expand All @@ -38,7 +38,7 @@ To install the template, simply execute the following commands:
$ mkdir sablier-v2-integration-template
$ cd sablier-v2-integration-template
$ forge init --template sablier-labs/sablier-v2-integration-template
$ yarn install
$ bun install
```

Then, hop to the `Run a Fork Test` section to complete your set up and start developing.
Expand Down Expand Up @@ -79,13 +79,13 @@ The folder structure should be intuitive:
- `script` is where you'll write scripts to perform actions like deploying contracts (you guessed it, in Solidity)
- `foundry.toml` is where you can configure your Foundry settings, which we will leave as is in this guide

Let's install the Sablier Node.js packages using Yarn:
Let's install the Sablier Node.js packages using Bun:

```shell
$ yarn add @sablier/v2-core @sablier/v2-periphery
$ bun add @sablier/v2-core @sablier/v2-periphery
```

Yarn will download the Sablier contracts, along with their dependencies, and put them in the `node_modules` directory.
Bun will download the Sablier contracts, along with their dependencies, and put them in the `node_modules` directory.

Let's remap the package names to point to the installed contracts. This step is required so that the Solidity compiler
can find the Sablier contracts when you import them:
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
"repository": "github:sablier-labs/v2-docs",
"scripts": {
"build": "docusaurus build",
"check": "pnpm prettier:check && pnpm lint:fix",
"check": "bun run prettier:check && bun run lint:fix",
"clear": "docusaurus clear",
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"fix": "pnpm prettier:write && pnpm lint:fix",
"lint:check": "pnpm eslint . --ext md,mdx,ts,tsx",
"lint:fix": "pnpm eslint . --ext md,mdx,ts,tsx --fix",
"fix": "bun run prettier:write && bun run lint:fix",
"lint:check": "bun eslint . --ext md,mdx,ts,tsx",
"lint:fix": "bun eslint . --ext md,mdx,ts,tsx --fix",
"prettier:check": "prettier --check \"**/*.{json,md,mdx,ts,tsx,yml}\"",
"prettier:write": "prettier --write \"**/*.{json,md,mdx,ts,tsx,yml}\"",
"serve": "docusaurus serve",
Expand Down
Loading

0 comments on commit fac672d

Please sign in to comment.