1
0
mirror of https://github.com/zws-im/zws.git synced 2025-10-30 23:27:52 +02:00

build: switch from Yarn to Bun (#625)

This commit is contained in:
Jonah Snider
2023-09-12 03:47:46 -07:00
committed by GitHub
parent 5f8e6db7f4
commit ac07dd9049
14 changed files with 22 additions and 8768 deletions

3
.gitattributes vendored
View File

@@ -1,2 +1 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
*.lockb diff=lockb

View File

@@ -16,29 +16,26 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies with Yarn
run: yarn install --immutable
bun-version: "1.0.0"
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
- name: Pull environment variables
run: yarn vercel env pull --environment development .env --token ${{ secrets.VERCEL_TOKEN }}
run: bun vercel env pull --environment development .env --token ${{ secrets.VERCEL_TOKEN }}
- name: Cache Next.js
uses: actions/cache@v3
with:
# See here for caching with `yarn` https://github.com/actions/cache/blob/main/examples.md#node---yarn or you can leverage caching with actions/setup-node https://github.com/actions/setup-node
path: |
~/.npm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lockb') }}-
- name: Build
run: yarn run build
run: bun run build
lint:
name: Lint
@@ -48,12 +45,11 @@ jobs:
steps:
- name: Checkout Git repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
node-version: "20"
cache: "yarn"
- name: Install dependencies with Yarn
run: yarn install --immutable
bun-version: "1.0.0"
- name: Install dependencies with Bun
run: bun install --frozen-lockfile
- name: Lint
run: yarn run lint
run: bun run lint

9
.gitignore vendored
View File

@@ -234,15 +234,6 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/node,linux,macos,windows,visualstudiocode
# Yarn
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Dotenv files
*.env
!*example.env

View File

@@ -1 +1 @@
20
18

View File

@@ -1,12 +1,6 @@
{
"typescript.preferences.importModuleSpecifierEnding": "index",
"typescript.tsdk": "node_modules/typescript/lib",
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
".yarn/**": true
},
"typescript.preferences.importModuleSpecifier": "shortest",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,9 +0,0 @@
yarnPath: .yarn/releases/yarn-3.6.3.cjs
nodeLinker: node-modules
enableGlobalCache: true
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
spec: '@yarnpkg/plugin-typescript'
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

View File

@@ -1,2 +1,2 @@
web: yarn start
release: yarn run migrations
web: bun start
release: bun run migrations

BIN
bun.lockb Executable file

Binary file not shown.

View File

@@ -19,6 +19,7 @@
"build": "node --require ./ss-polyfills/File.js ./node_modules/.bin/next build",
"build:nixpack": "nixpacks build . --name zws-im/zws",
"dev": "node --require ./ss-polyfills/File.js ./node_modules/.bin/next dev",
"postinstall": "prisma generate",
"lint": "biome check .",
"lint:fix": "biome check . --apply-unsafe",
"migrations": "prisma migrate deploy",
@@ -64,7 +65,7 @@
"type-fest": "4.3.1",
"vercel": "32.2.1"
},
"packageManager": "yarn@3.6.3",
"packageManager": "bun@1.0.0",
"engines": {
"node": "18.x || 20.x"
}

View File

@@ -1,5 +1,5 @@
{
"buildCommand": "prisma generate && prisma db push && yarn build",
"buildCommand": "prisma generate && prisma db push && bun run build",
"cleanUrls": true,
"crons": [
{

7807
yarn.lock

File diff suppressed because it is too large Load Diff