Skip to content

Commit

Permalink
chore: 🤖 switch to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
TomTomB committed Jan 15, 2025
1 parent a3bb102 commit 13e8ef1
Show file tree
Hide file tree
Showing 13 changed files with 4,722 additions and 18,362 deletions.
31 changes: 14 additions & 17 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,35 @@ concurrency: release_environment
jobs:
main:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
name: Checkout [main]
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/cache@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-${{ matrix.bun }}-bun-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- run: pnpm install
- run: bun install

- run: pnpm nx format:check
- run: bun nx format:check

- run: pnpm nx run-many -t lint
- run: bun nx run-many -t lint

- run: pnpm nx run-many -t test
- run: bun nx run-many -t test

- run: pnpm nx run-many -t build
- run: bun nx run-many -t build

- run: pnpm nx run playground:build-storybook:ci
- run: bun nx run playground:build-storybook:ci

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand All @@ -55,9 +52,9 @@ jobs:
id: changesets
uses: TomTomB/changesets-action@v1
with:
version: pnpm changeset:release
version: bun changeset:release
commit: 'chore: 🤖 update versions'
publish: pnpm release
publish: bun release
title: Release packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/ci-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,35 @@ concurrency: next_environment
jobs:
next:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- uses: actions/checkout@v4
name: Checkout [next]
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/cache@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-${{ matrix.bun }}-bun-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- run: pnpm install
- run: bun install

- run: pnpm nx format:check
- run: bun nx format:check

- run: pnpm nx run-many -t lint
- run: bun nx run-many -t lint

- run: pnpm nx run-many -t test
- run: bun nx run-many -t test

- run: pnpm nx run-many -t build
- run: bun nx run-many -t build

- run: pnpm nx run playground:build-storybook:ci
- run: bun nx run playground:build-storybook:ci

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
Expand All @@ -55,9 +52,9 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
version: pnpm changeset:prerelease
version: bun changeset:prerelease
commit: 'chore: 🤖 update prereleases'
publish: pnpm release
publish: bun release
title: Release prerelease packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,38 @@ concurrency: ci-${{ github.ref }}
jobs:
pr:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: actions/cache@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
path: ~/.bun/install/cache
key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-${{ matrix.bun }}-bun-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4

- run: pnpm install
- run: bun install

- run: pnpm nx format:check
- run: bun nx format:check

- run: pnpm nx run-many -t lint
- run: bun nx run-many -t lint

- run: pnpm nx run-many -t test
- run: bun nx run-many -t test

- run: pnpm nx run-many -t build
- run: bun nx run-many -t build

- if: "${{ !contains(github.event.pull_request.title, 'from API') && !contains(github.event.pull_request.title, 'API TS Models') }}"
run: pnpm nx run playground:build-storybook:ci
run: bun nx run playground:build-storybook:ci

- uses: FirebaseExtended/action-hosting-deploy@v0
if: "${{ github.event.pull_request.head.repo.full_name == github.repository && !contains(github.event.pull_request.title, 'from API') && !contains(github.event.pull_request.title, 'API TS Models') }}"
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm nx affected --target=lint --parallel --maxParallel 5 --cache && pnpx git-format-staged --formatter "prettier --stdin-filepath "{}"" "*.ts" "*.js" "*.tsx" "*.jsx" "*.json" "*.html" "*.md" "*.yml" "*.css" "*.scss"
bunx nx affected --target=lint --parallel --maxParallel 5 --cache && bunx git-format-staged --formatter "prettier --stdin-filepath "{}"" "*.ts" "*.js" "*.tsx" "*.jsx" "*.json" "*.html" "*.md" "*.yml" "*.css" "*.scss"
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/.yarn
node_modules

pnpm-lock.yaml
bun.lock
migrations.json

libs/types/src/lib/api
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"name": "storybook",
"type": "chrome",
"request": "launch",
"preLaunchTask": "pnpm storybook",
"preLaunchTask": "bun storybook",
"url": "http://localhost:4400/",
"sourceMaps": true,
"sourceMapPathOverrides": {
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Core functionalities and utils.
```sh
yarn add @ethlete/core
# or
pnpm add @ethlete/core
bun add @ethlete/core
```

### @ethlete/query
Expand All @@ -48,7 +48,7 @@ Fetch wrapper with caching, request templates, GQL support and Angular helpers
```sh
yarn add @ethlete/query
# or
pnpm add @ethlete/query
bun add @ethlete/query
```

### @ethlete/cdk
Expand All @@ -62,7 +62,7 @@ Component development kit for Ethlete with a11y and performance in mind.
```sh
yarn add @ethlete/cdk
# or
pnpm add @ethlete/cdk
bun add @ethlete/cdk
```

### @ethlete/components
Expand All @@ -76,7 +76,7 @@ Themeable components based on the Ethlete design system.
```sh
yarn add @ethlete/components
# or
pnpm add @ethlete/components
bun add @ethlete/components
```

### @ethlete/dsp
Expand All @@ -90,7 +90,7 @@ Utilities for creating and managing design systems.
```sh
yarn add @ethlete/dsp
# or
pnpm add @ethlete/dsp
bun add @ethlete/dsp
```

### @ethlete/cli
Expand All @@ -104,7 +104,7 @@ CLI helper functions.
```sh
yarn add @ethlete/cli
# or
pnpm add @ethlete/cli
bun add @ethlete/cli
```

### @ethlete/theming
Expand All @@ -118,7 +118,7 @@ Utilities to make component theming easier.
```sh
yarn add @ethlete/theming
# or
pnpm add @ethlete/theming
bun add @ethlete/theming
```

### @ethlete/contentful
Expand All @@ -132,7 +132,7 @@ Helpers for usage with Contentful (e.g. rich text rendering).
```sh
yarn add @ethlete/contentful
# or
pnpm add @ethlete/contentful
bun add @ethlete/contentful
```

### @ethlete/types
Expand All @@ -146,14 +146,14 @@ Up to date typescript definitions for the Ethlete REST API as well as other type
```sh
yarn add -D @ethlete/types
# or
pnpm add @ethlete/types
bun add @ethlete/types
```

## How to contribute

This mono repository uses:

- [PNPM](https://pnpm.io/) as a package manager.
- [Bun](https://bun.sh/) as a package manager.
- [Conventional commits](http://commitizen.github.io/cz-cli/) for commit messages.
- [Changesets](https://github.com/changesets/changesets) for version management and automated releases.

Expand All @@ -168,7 +168,7 @@ git clone https://github.com/ethlete-io/ethdk.git
Install dependencies:

```sh
pnpm install
bun install
```

Create a feat, fix or other branch:
Expand All @@ -180,17 +180,17 @@ git checkout -B feat/example
Commit your changes via git-cz:

```sh
pnpm commit
bun commit
```

If the changes made should result in a version bump, create a changeset and commit the generated file.
All SDKs adhere to the [semantic versioning](https://semver.org/) guidelines.

```sh
pnpm change
bun change

# OR if the command above fails for some reason:
pnpx changeset
bunx changeset
```

Now all that's left is to create a PR and make sure that all workflows pass.
Expand Down
Loading

0 comments on commit 13e8ef1

Please sign in to comment.