Skip to content

Commit

Permalink
refactor: test bun (possibly revert if needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
castdrian committed May 2, 2024
1 parent 486d242 commit 67a879f
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 14,482 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/build-mobile-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,9 @@ jobs:
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}

- uses: pnpm/action-setup@v3
name: Install pnpm
- uses: oven-sh/setup-bun@v1
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -46,16 +38,16 @@ jobs:
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

- name: Install dependencies
run: corepack enable && pnpm install
run: bun install

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build Android app
run: cd apps/expo && pnpm apk
run: cd apps/expo && bun apk

- name: Upload movie-web.apk as artifact
uses: actions/upload-artifact@v4
Expand All @@ -75,35 +67,27 @@ jobs:
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Cache Node Modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

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

- name: Cache Pods
uses: actions/cache@v4
with:
path: apps/expo/ios
key: ${{ runner.os }}-pods-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-pods-${{ hashFiles('**/bun.lockb') }}

- name: Build iOS app
run: cd apps/expo && pnpm ipa
run: cd apps/expo && bun ipa

- name: Upload movie-web.ipa as artifact
uses: actions/upload-artifact@v4
Expand Down
38 changes: 11 additions & 27 deletions .github/workflows/build-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
name: Install pnpm
- uses: oven-sh/setup-bun@v1
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -42,16 +34,16 @@ jobs:
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

- name: Install dependencies
run: corepack enable && pnpm install
run: bun install

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build Android app
run: cd apps/expo && pnpm apk
run: cd apps/expo && bun apk

- name: Upload movie-web.apk as artifact
uses: actions/upload-artifact@v3
Expand All @@ -66,35 +58,27 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Cache Node Modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

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

- name: Cache Pods
uses: actions/cache@v4
with:
path: apps/expo/ios
key: ${{ runner.os }}-pods-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-pods-${{ hashFiles('**/bun.lockb') }}

- name: Build iOS app
run: cd apps/expo && pnpm ipa
run: cd apps/expo && bun ipa

- name: Upload movie-web.ipa as artifact
uses: actions/upload-artifact@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: ./tooling/github/setup

- name: Lint
run: pnpm lint && pnpm lint:ws
run: bun lint && bun lint:ws

format:
runs-on: ubuntu-latest
Expand All @@ -39,7 +39,7 @@ jobs:
uses: ./tooling/github/setup

- name: Format
run: pnpm format
run: bun format

typecheck:
runs-on: ubuntu-latest
Expand All @@ -50,4 +50,4 @@ jobs:
uses: ./tooling/github/setup

- name: Typecheck
run: pnpm typecheck
run: bun typecheck
40 changes: 12 additions & 28 deletions .github/workflows/release-mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: release mobile app
on:
push:
branches:
- main
- master
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -39,17 +39,9 @@ jobs:
- name: Pull version bump
run: git pull --all

- uses: pnpm/action-setup@v3
name: Install pnpm
- uses: oven-sh/setup-bun@v1
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -64,16 +56,16 @@ jobs:
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

- name: Install dependencies
run: corepack enable && pnpm install
run: bun install

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build Android app
run: cd apps/expo && pnpm apk
run: cd apps/expo && bun apk

- name: Upload movie-web.apk as artifact
uses: actions/upload-artifact@v4
Expand All @@ -92,35 +84,27 @@ jobs:
- name: Pull version bump
run: git pull --all

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 21
cache: "pnpm"
bun-version: latest

- name: Cache Node Modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}

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

- name: Cache Pods
uses: actions/cache@v4
with:
path: apps/expo/ios
key: ${{ runner.os }}-pods-${{ hashFiles('**/pnpm-lock.yaml') }}
key: ${{ runner.os }}-pods-${{ hashFiles('**/bun.lockb') }}

- name: Build iOS app
run: cd apps/expo && pnpm ipa
run: cd apps/expo && bun ipa

- name: Upload movie-web.ipa as artifact
uses: actions/upload-artifact@v4
Expand Down
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

1 change: 1 addition & 0 deletions apps/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@tamagui/metro-plugin": "^1.96.0",
"@tamagui/toast": "1.96.0",
"@tanstack/react-query": "^5.22.2",
"ajv": "^8.13.0",
"burnt": "^0.12.2",
"class-variance-authority": "^0.7.0",
"expo": "~50.0.14",
Expand Down
Binary file added bun.lockb
Binary file not shown.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"name": "@movie-web/native",
"private": true,
"engines": {
"node": ">=20.11.0"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"workspaces": [
"apps/*",
"packages/*",
"tooling/*"
],
"scripts": {
"build": "turbo build",
"clean": "git clean -xdf node_modules",
Expand All @@ -14,8 +16,8 @@
"format:fix": "turbo format --continue -- --write --cache --cache-location node_modules/.cache/.prettiercache",
"lint": "turbo lint --continue -- --cache --cache-location node_modules/.cache/.eslintcache",
"lint:fix": "turbo lint --continue -- --fix --cache --cache-location node_modules/.cache/.eslintcache",
"lint:ws": "pnpm dlx sherif@latest",
"postinstall": "pnpm lint:ws",
"lint:ws": "bunx sherif@latest",
"postinstall": "bun lint:ws",
"typecheck": "turbo typecheck"
},
"devDependencies": {
Expand All @@ -25,6 +27,5 @@
"turbo": "^1.11.3",
"typescript": "^5.4.3"
},
"prettier": "@movie-web/prettier-config",
"pnpm": {}
"prettier": "@movie-web/prettier-config"
}
40 changes: 36 additions & 4 deletions packages/provider-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@movie-web/provider-utils",
"private": true,
"private": false,
"version": "0.1.0",
"type": "module",
"main": "./src/index.ts",
Expand Down Expand Up @@ -28,10 +28,42 @@
]
},
"prettier": "@movie-web/prettier-config",
"trustedDependencies": ["@movie-web/providers"],
"dependencies": {
"@movie-web/providers": "github:sussy-code/providers",
"@movie-web/providers": "https://github.com/castdrian/providers-bun",
"@nabla/vite-plugin-eslint": "^2.0.2",
"@types/cookie": "^0.6.0",
"@types/crypto-js": "^4.2.2",
"@types/node-fetch": "^2.6.11",
"@types/randombytes": "^2.0.3",
"@types/set-cookie-parser": "^2.4.7",
"@types/spinnies": "^0.5.3",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@vitest/coverage-v8": "^1.4.0",
"commander": "^12.0.0",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"enquirer": "^2.4.1",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"node-fetch": "^3.3.2",
"parse-hls": "^1.0.7",
"prettier": "^3.2.5",
"puppeteer": "^22.6.1",
"spinnies": "^0.5.1",
"srt-webvtt": "^2.0.0",
"tmdb-ts": "^1.6.1"
"tmdb-ts": "^1.6.1",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.3",
"vite": "^5.2.7",
"vite-node": "^1.4.0",
"vite-plugin-dts": "^3.8.1",
"vitest": "^1.4.0"
}
}
}
Loading

0 comments on commit 67a879f

Please sign in to comment.