Skip to content

Commit

Permalink
100x yarn install / build speeds by upgrading to yarn v3 (#3434)
Browse files Browse the repository at this point in the history
* yarn v3

* yarn v3

* undo yarn build change

* redo

* yarn cache immutable

* bump yarn to v3 min
  • Loading branch information
peterpme authored Mar 22, 2023
1 parent c66acce commit 47dbee8
Show file tree
Hide file tree
Showing 27 changed files with 39,531 additions and 28,809 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,json,yml}]
charset = utf-8
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.yarn/** linguist-vendored
/.yarn/releases/* binary
/.yarn/plugins/**/* binary
/.pnp.* binary linguist-generated
2 changes: 1 addition & 1 deletion .github/actions/app-mobile-monorepo-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ runs:
token: ${{ inputs.expo-token }}

- name: 📦 Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
run: yarn install --immutable
shell: bash
15 changes: 2 additions & 13 deletions .github/workflows/pull_requests_and_merges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,14 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18

- uses: actions/cache@v3
name: yarn-cache
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
!**/node_modules/.cache
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
cache: "yarn"

##########################################################################
# Yarn install.
##########################################################################

- name: yarn install
run: yarn install --frozen-lockfile
run: yarn install --immutable

##########################################################################
# Build extension.
Expand Down
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ dist/
deptool-report.html
test-ledger/

.yarn
.expo
.next

*-e

.yarnrc
.eslintcache
.js.map
.d.ts.map
Expand All @@ -48,3 +46,13 @@ test-ledger/
.tamagui
.d.ts
.d.ts.map

# Not using zero-installs
# https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

550 changes: 550 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

Large diffs are not rendered by default.

873 changes: 873 additions & 0 deletions .yarn/releases/yarn-3.5.0.cjs

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
enableTelemetry: false

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs
spec: "@yarnpkg/plugin-version"

yarnPath: .yarn/releases/yarn-3.5.0.cjs

logFilters:
- code: YN0002
level: discard
- code: YN0060
level: discard
- code: YN0006
level: discard
- code: YN0076
level: discard
4 changes: 2 additions & 2 deletions backend/native/backend-ws/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"lint:fix": "yarn run lint --fix"
},
"devDependencies": {
"eslint-config-custom": "*",
"esbuild": "^0.17.11"
"esbuild": "^0.17.11",
"eslint-config-custom": "*"
}
}
4 changes: 2 additions & 2 deletions backend/native/xnft-api-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@coral-xyz/common": "*",
"@coral-xyz/backend-common": "*",
"dotenv": "^16.0.3",
"@coral-xyz/common": "*",
"@coral-xyz/zeus": "*",
"@project-serum/anchor": "^0.25.0",
"@solana/wallet-adapter-react": "^0.15.25",
Expand All @@ -15,6 +14,7 @@
"@types/web-push": "^3.3.2",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"dotenv": "^16.0.3",
"esbuild": "^0.15.13",
"express": "^4.18.2",
"uuid": "^9.0.0",
Expand Down
1 change: 0 additions & 1 deletion backend/workers/xnft-wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"dev:remote": "wrangler dev --port 9999 --local-protocol https",
"start": "miniflare --live-reload --debug --modules dist/index.mjs --https --port 9999"
},
"dependencies": {},
"devDependencies": {
"esbuild": "^0.14.47",
"eslint-config-custom": "*",
Expand Down
1 change: 0 additions & 1 deletion examples/xnft/explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"start": "xnft legacy start",
"dev": "xnft legacy dev"
},
"devDependencies": {},
"dependencies": {
"@coral-xyz/xnft-cli": "0.2.0-latest.3331",
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/xnft/provider-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
},
"dependencies": {
"@coral-xyz/xnft-cli": "0.2.0-latest.3331",
"react-xnft": "0.2.0-latest.3318",
"@project-serum/anchor": "^0.23.0",
"@solana/web3.js": "^1.36.0",
"react": "18.2.0"
"react": "18.2.0",
"react-xnft": "0.2.0-latest.3318"
}
}
4 changes: 2 additions & 2 deletions examples/xnft/simulator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
},
"dependencies": {
"@coral-xyz/xnft-cli": "0.2.0-latest.3331",
"react-xnft": "0.2.0-latest.3318",
"@project-serum/anchor": "^0.23.0",
"@solana/web3.js": "^1.36.0",
"react": "18.2.0"
"react": "18.2.0",
"react-xnft": "0.2.0-latest.3318"
}
}
20 changes: 5 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "backpack",
"packageManager": "[email protected]",
"private": true,
"workspaces": {
"packages": [
Expand All @@ -11,41 +12,30 @@
"packages/*",
"packages/blockchains/*",
"web"
],
"nohoist": [
"**/react-native",
"**/react-native/**",
"**/react-native-scripts",
"**/react-native-scripts/**",
"**/expo",
"**/expo/**",
"**/jest-expo",
"**/jest-expo/**"
]
},
"scripts": {
"lint": "turbo run lint --filter=!@coral-xyz/app-mobile",
"lint:fix": "turbo run lint:fix --filter=!@coral-xyz/app-mobile",
"prepare": "husky install",
"start": "env-cmd --silent turbo run start --concurrency=100% --filter=./packages/*",
"start:fresh": "yarn install && yarn clean && yarn install && yarn start",
"test": "env-cmd --silent turbo run test -- --passWithNoTests --watchAll=false",
"build": "env-cmd --silent turbo run build --filter=!./examples/**",
"build": "env-cmd --silent turbo run build --filter='!./examples/**' ",
"build:fresh": "git clean -xfd && yarn install && yarn build --force",
"e2e": "env-cmd --silent turbo run e2e",
"clean": "git clean -xfd",
"start:ext": "env-cmd --silent turbo run start --filter=@coral-xyz/app-extension... --filter=@coral-xyz/background...",
"build:ext": "env-cmd --silent turbo run build --filter=@coral-xyz/app-extension... --filter=@coral-xyz/background...",
"start:mobile": "env-cmd --silent turbo run start --filter=@coral-xyz/app-mobile... --filter=@coral-xyz/background...",
"build:mobile": "env-cmd --silent turbo run build --filter=@coral-xyz/app-mobile... --filter=@coral-xyz/background...",
"postinstall": "yarn-deduplicate --scopes @babel @mui @typescript-eslint @types @react-native-community @react-navigation @emotion"
"postinstall": "husky install"
},
"devDependencies": {
"buffer": "^5.5.0",
"env-cmd": "^10.1.0",
"eslint": "^8.31.0",
"graphql": "^16.6.0",
"husky": "^8.0.1",
"husky": "^8.0.3",
"lint-staged": "^12.4.1",
"prettier": "^2.8.1",
"turbo": "^1.8.3",
Expand Down Expand Up @@ -75,7 +65,7 @@
},
"engines": {
"node": "18.x",
"yarn": "^1.22.17"
"yarn": "^3.0.0"
},
"dependencies": {
"patch-package": "^6.5.0"
Expand Down
3 changes: 3 additions & 0 deletions packages/app-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"name": "@coral-xyz/app-mobile",
"version": "1.0.0",
"main": "index.js",
"installConfig": {
"hoistingLimits": "workspaces"
},
"scripts": {
"eas-build-post-install": "cd ../../ && yarn build:mobile",
"android": "expo start --android",
Expand Down
4 changes: 2 additions & 2 deletions packages/background/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"start": "parcel src/service-worker-loader.html -p 9333"
},
"dependencies": {
"@coral-xyz/common": "*",
"@coral-xyz/recoil": "*",
"@coral-xyz/blockchain-common": "*",
"@coral-xyz/blockchain-keyring": "*",
"@coral-xyz/common": "*",
"@coral-xyz/recoil": "*",
"@solana/web3.js": "^1.63.1",
"bip32": "^2.0.6",
"bip39": "^3.0.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/blockchains/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"lint:fix": "yarn run lint --fix"
},
"dependencies": {
"@coral-xyz/common": "*",
"@coral-xyz/blockchain-evm": "*",
"@coral-xyz/blockchain-solana": "*"
"@coral-xyz/blockchain-solana": "*",
"@coral-xyz/common": "*"
},
"devDependencies": {
"@coral-xyz/blockchain-keyring": "*",
Expand Down
3 changes: 2 additions & 1 deletion packages/chat-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"dependencies": {
"@coral-xyz/common": "*",
"@coral-xyz/db": "*",
"@coral-xyz/recoil": "*",
"@coral-xyz/react-common": "*",
"@coral-xyz/recoil": "*",
"@coral-xyz/tamagui": "*",
"@coral-xyz/themes": "*",
"@giphy/js-fetch-api": "^4.4.0",
Expand All @@ -30,6 +30,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"tsc-alias": "^1.7.0",
"typescript": "~4.9.3"
},
"targets": {
Expand Down
4 changes: 1 addition & 3 deletions packages/deptool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"name": "@coral-xyz/deptool",
"version": "0.1.0",
"private": true,
"bin": {
"deptool": "./index.js"
},
"bin": "./index.js",
"dependencies": {
"esbuild": "^0.14.43",
"esbuild-node-builtins": "^0.1.0"
Expand Down

This file was deleted.

5 changes: 3 additions & 2 deletions packages/message-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"@coral-xyz/db": "*",
"@coral-xyz/react-common": "*",
"@coral-xyz/recoil": "*",
"@coral-xyz/themes": "*",
"@coral-xyz/tamagui": "*",
"@coral-xyz/themes": "*",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand All @@ -30,7 +30,8 @@
},
"devDependencies": {
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"eslint-config-react": "^1.1.7"
"eslint-config-react": "^1.1.7",
"tsc-alias": "^1.7.0"
},
"browserslist": {
"production": [
Expand Down
1 change: 1 addition & 0 deletions packages/react-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"uuid": "^9.0.0"
},
"devDependencies": {
"tsc-alias": "^1.7.0",
"typescript": "~4.9.3"
},
"targets": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tamagui-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"*.css"
],
"dependencies": {
"@coral-xyz/recoil": "*",
"@coral-xyz/common": "*",
"@coral-xyz/recoil": "*",
"@coral-xyz/themes": "*",
"@tamagui/animations-react-native": "^1.8.1",
"@tamagui/babel-plugin": "^1.8.1",
Expand Down
1 change: 0 additions & 1 deletion packages/xnft-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"bin": {
"xnft": "./index.js"
},
"scripts": {},
"browserslist": [
"last 1 chrome version",
"last 1 firefox version",
Expand Down
Loading

1 comment on commit 47dbee8

@vercel
Copy link

@vercel vercel bot commented on 47dbee8 Mar 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.