Skip to content

Commit

Permalink
replace yarn with bun. speed things up
Browse files Browse the repository at this point in the history
  • Loading branch information
mdial89f committed Jul 26, 2024
1 parent a18a80e commit 568a7cf
Show file tree
Hide file tree
Showing 32 changed files with 65 additions and 19,534 deletions.
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.20
8 changes: 3 additions & 5 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ runs:
uses: HatsuneMiku3939/direnv-action@v1

- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Node cache
uses: actions/cache@v3
- uses: oven-sh/setup-bun@v2
with:
path: "**/node_modules"
key: ${{ github.workflow}}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock', '.nvmrc') }}
bun-version-file: ".bun-version"
23 changes: 7 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,11 @@ jobs:
if [[ ! $STAGE_NAME =~ ^[a-z][a-z0-9-]*$ ]]; then
echo "ERROR: Your branch name, $STAGE_NAME, is not a valid Serverless Framework stage name." && exit 1
fi
cache:
runs-on: ubuntu-20.04
needs:
- init
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/setup

- run: run install
deploy:
runs-on: ubuntu-20.04
needs:
- cache
- init
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
outputs:
Expand Down Expand Up @@ -112,7 +99,7 @@ jobs:
test:
runs-on: ubuntu-20.04
needs:
- cache
- init
environment:
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
Expand Down Expand Up @@ -246,14 +233,18 @@ jobs:
runs-on: ubuntu-20.04
needs:
- test
- e2e
- cfn-nag
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/setup

- name: Install
run: bun install

- name: Release
run: npx semantic-release
run: bun semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ jobs:
run: |
cd docs/_deploy-metrics
rm -rf node_modules
yarn install --frozen-lockfile
bun install
echo $BRANCHES_TO_GENERATE
- name: Build Deploy Metrics
run: |
cd docs/_deploy-metrics
yarn build
bun build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
run: run install

- name: Run ESLint
run: yarn lint
run: bun lint
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v4.0.1
hooks:
- id: check-added-large-files
exclude: "yarn.lock"
exclude: "bun.lockb"
- repo: https://github.com/Yelp/detect-secrets
rev: v1.1.0
hooks:
Expand Down
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
node_modules
testcafe_results
.DS_Store
yarn-error.log
.serverless
.webpack
.yarn_install
tsconfig.tsbuildinfo
build_run
docs/
2 changes: 1 addition & 1 deletion bin/cli/src/commands/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const deploy = {

await runner.run_command_and_output(
"Build",
["yarn", "build"],
["bun", "run", "build"],
"react-app",
);

Expand Down
4 changes: 2 additions & 2 deletions bin/cli/src/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ export const e2e = {
handler: async ({ ui }: { ui: boolean }) => {
await runner.run_command_and_output(
"Install playwright",
["yarn", "playwright", "install", "--with-deps"],
["bun", "playwright", "install", "--with-deps"],
".",
);

await runner.run_command_and_output(
ui ? "e2e:ui tests" : "e2e tests",
["yarn", ui ? "e2e:ui" : "e2e"],
["bun", ui ? "e2e:ui" : "e2e"],
".",
);
},
Expand Down
7 changes: 6 additions & 1 deletion bin/cli/src/commands/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export const install = {
command: "install",
describe: "install all project dependencies",
handler: async () => {
await runner.run_command_and_output("Install", ["yarn"], ".", true);
await runner.run_command_and_output(
"Install",
["bun", "install"],
".",
true,
);
},
};
15 changes: 0 additions & 15 deletions bin/cli/src/commands/test-gui.ts

This file was deleted.

2 changes: 1 addition & 1 deletion bin/cli/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const test = {
}
await runner.run_command_and_output(
"Unit Tests",
["yarn", testCommand],
["bun", "run", testCommand],
".",
);
},
Expand Down
8 changes: 6 additions & 2 deletions bin/cli/src/commands/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ export const ui = {
await writeUiEnvFile(options.stage, true);
await runner.run_command_and_output(
`Build`,
["yarn", "build"],
["bun", "run", "build"],
"react-app",
);
await runner.run_command_and_output(`Run`, ["yarn", "dev"], `react-app`);
await runner.run_command_and_output(
`Run`,
["bun", "run", "dev"],
`react-app`,
);
},
};
Binary file added bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions cdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"**/*.js",
"tsconfig.json",
"package*.json",
"yarn.lock",
"node_modules",
"test"
"test",
"bun.lockb"
]
},
"context": {
Expand Down
Binary file added docs/_deploy-metrics/bun.lockb
Binary file not shown.
Loading

0 comments on commit 568a7cf

Please sign in to comment.