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:
		
							
								
								
									
										3
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							| @@ -1,2 +1 @@ | ||||
| /.yarn/releases/** binary | ||||
| /.yarn/plugins/** binary | ||||
| *.lockb diff=lockb | ||||
|   | ||||
							
								
								
									
										34
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -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
									
									
								
							
							
						
						
									
										9
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -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 | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| 20 | ||||
| 18 | ||||
|   | ||||
							
								
								
									
										6
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							| @@ -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]": { | ||||
|   | ||||
							
								
								
									
										9
									
								
								.yarn/plugins/@yarnpkg/plugin-typescript.cjs
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.yarn/plugins/@yarnpkg/plugin-typescript.cjs
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										874
									
								
								.yarn/releases/yarn-3.6.3.cjs
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										874
									
								
								.yarn/releases/yarn-3.6.3.cjs
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -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' | ||||
							
								
								
									
										4
									
								
								Procfile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Procfile
									
									
									
									
									
								
							| @@ -1,2 +1,2 @@ | ||||
| web: yarn start | ||||
| release: yarn run migrations | ||||
| web: bun start | ||||
| release: bun run migrations | ||||
|   | ||||
| @@ -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" | ||||
| 	} | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| { | ||||
| 	"buildCommand": "prisma generate && prisma db push && yarn build", | ||||
| 	"buildCommand": "prisma generate && prisma db push && bun run build", | ||||
| 	"cleanUrls": true, | ||||
| 	"crons": [ | ||||
| 		{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user