Skip to content

Commit b10780d

Browse files
committed
chore: upgrade to bun
1 parent 9126554 commit b10780d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+578
-8851
lines changed

.DS_Store

6 KB
Binary file not shown.

.eslintignore

Lines changed: 0 additions & 20 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 150 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,46 @@
1-
name: CI/CD
1+
name: GitHub Actions OIDC Test
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches:
6+
- main
67

78
permissions:
8-
id-token: write
9-
contents: write
9+
id-token: write # required to use OIDC authentication
10+
contents: write # required to checkout the code from the repo
1011

1112
jobs:
12-
# Build
13-
build:
13+
Publish:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1817
with:
19-
fetch-depth: "0"
20-
21-
- name: Setting up Node.js 16.x
22-
uses: actions/setup-node@v3
18+
fetch-depth: 0 # Fetch all history for all branches and tags
19+
- uses: oven-sh/setup-bun@v1
20+
- uses: actions/setup-node@v3
2321
with:
24-
node-version: 16
25-
registry-url: "https://registry.npmjs.org"
26-
scope: "@sundaeswap"
27-
cache: yarn
28-
29-
# Install dependencies
30-
- name: Install
31-
run: yarn install --frozen-lockfile --ignore-scripts && yarn bootstrap
32-
33-
# Lint the files
34-
- name: Lint
35-
run: yarn lint
22+
node-version: 18
3623

37-
# Build artifacts
38-
- name: Build
39-
run: yarn build
24+
# Install Dependencies
25+
- run: bun install --frozen-lockfile
4026

41-
# Run Tests
42-
- name: Run Tests
43-
run: yarn test
44-
45-
# Git Identity
4627
- name: Git Identity
4728
run: |
48-
git config --global user.name '🤖github-actions🍦'
49-
git config --global user.email '🤖github-actions🍦@users.noreply.github.com'
29+
git config --global user.name 'CI-CD'
30+
git config --global user.email 'CI-CD@users.noreply.github.com'
5031
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
5132
env:
5233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5334

54-
# Bump Versions
35+
# Bump Versions (reinstate after release)
5536
- name: Bump versions
56-
run: yarn version:ci
37+
run: bun version
5738
env:
5839
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5940

41+
- name: Configure npm authentication
42+
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
43+
6044
# Create Release
6145
- name: Publish
62-
run: yarn publish:ci
63-
env:
64-
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
46+
run: bun run publish

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn lint:fix
4+
bun lint:fix

.husky/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
yarn test
4+
bun run test

bun.lockb

495 KB
Binary file not shown.

commitlint.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

eslint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { configs } from "@sundaeswap/eslint-config";
2+
export default [
3+
...configs,
4+
{
5+
languageOptions: {
6+
globals: {
7+
global: true,
8+
},
9+
},
10+
},
11+
];

lerna.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"packages": ["packages/*"],
4-
"useWorkspaces": false,
5-
"npmClient": "yarn",
3+
"useNx": true,
4+
"version": "independent",
5+
"npmClient": "bun",
66
"ignoreChanges": [
77
"**/__tests__/**",
88
"**/__fixtures__/**",
99
"**/*.test.js",
1010
"**/*.md"
1111
],
12+
"ignore": "demo",
1213
"command": {
1314
"version": {
1415
"message": "chore(release): publish %s",
1516
"conventionalCommits": true,
16-
"private": false
17+
"conventionalGraduate": true,
18+
"createRelease": "github",
19+
"ignoreScripts": true,
20+
"private": false,
21+
"allowBranch": ["main"]
1722
}
18-
},
19-
"version": "independent",
20-
"useNx": false
23+
}
2124
}

package.json

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"private": false,
33
"name": "defi-sdk",
4+
"type": "module",
45
"description": "",
56
"author": {
67
"name": "SundaeSwap Labs, Inc.",
@@ -11,43 +12,32 @@
1112
},
1213
"homepage": "https://github.com/SundaeSwap-finance/defi-sdk#readme",
1314
"lint-staged": {
14-
"*.{js,jsx,ts,tsx}": "yarn lint --fix"
15+
"*.{js,jsx,ts,tsx}": "bun lint --fix"
1516
},
17+
"workspaces": [
18+
"packages/*"
19+
],
1620
"scripts": {
17-
"lint": "eslint --ext js,jsx,ts,tsx .",
18-
"lint:fix": "yarn lint --fix",
19-
"bootstrap": "lerna bootstrap",
21+
"lint": "eslint --ignore-pattern '**/dist/**'",
22+
"lint:fix": "bun run lint --fix",
23+
"test": "lerna exec bun test",
2024
"clean": "lerna run clean",
2125
"build": "lerna run build --scope '@sundaeswap/*'",
22-
"test": "lerna run test --stream --scope '@sundaeswap/*'",
23-
"postinstall": "yarn bootstrap",
24-
"preinstall": "node tools/preinstall.ts",
25-
"prepare": "husky install",
26-
"version:ci": "lerna version -y --ignore-scripts",
27-
"publish:ci": "lerna publish from-package -y",
28-
"canary": "lerna publish from-package -y --canary",
29-
"typecheck": "tsc --noEmit"
26+
"prepare": "husky",
27+
"version:ci": "bun run version -y --ignore-scripts",
28+
"publish:ci": "bun run publish from-package -y"
3029
},
3130
"devDependencies": {
32-
"@commitlint/cli": "^17.0.3",
33-
"@sundaeswap/asset": "^0.6.9",
34-
"@types/jest": "^28.1.4",
35-
"@types/node": "^18.0.1",
36-
"@typescript-eslint/eslint-plugin": "^5.30.5",
37-
"@typescript-eslint/parser": "^5.30.5",
38-
"eslint": "^8.19.0",
39-
"eslint-config-prettier": "^8.8.0",
40-
"eslint-plugin-import": "^2.26.0",
41-
"eslint-plugin-jest": "^26.5.3",
42-
"eslint-plugin-prettier": "^4.2.1",
43-
"husky": "^8.0.1",
44-
"jest": "^28.1.2",
45-
"lerna": "^5.6.2",
46-
"lint-staged": "^13.0.3",
31+
"@sundaeswap/babel-preset": "2.0.12",
32+
"@sundaeswap/eslint-config": "2.0.11",
33+
"@sundaeswap/prettier-config": "2.0.10",
34+
"@types/bun": "1.1.6",
35+
"@types/node": "^20.14.9",
36+
"husky": "^9.0.11",
37+
"lerna": "^8.1.5",
38+
"lint-staged": "^15.2.7",
4739
"npm-check-updates": "^15.0.2",
48-
"prettier": "^2.7.1",
49-
"ts-jest": "^28.0.5",
50-
"ts-node": "^10.8.2",
51-
"typescript": "^4.7.4"
40+
"prettier": "^3.3.2",
41+
"typescript": "^5.5.2"
5242
}
5343
}

packages/.DS_Store

6 KB
Binary file not shown.

packages/asset/.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@sundaeswap/babel-preset"],
3+
"ignore": ["./src/__tests__"]
4+
}

0 commit comments

Comments
 (0)