Skip to content

Commit

Permalink
fix the latest yarn breaking its own installation
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Nov 18, 2023
1 parent 429da3d commit 645734f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ jobs:
if: matrix.os != 'ubuntu-latest'
run: node scripts/wasm-tests.js

- name: Yarn PnP tests
run: make test-yarnpnp

- name: Sucrase Tests
if: matrix.os == 'ubuntu-latest'
run: make test-sucrase
Expand All @@ -193,6 +190,15 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: cd scripts && node gen-unicode-table.js

- name: Yarn PnP tests
run: |
# Note that Yarn recently deliberately broke "npm install -g yarn".
# They say you now have to run "corepack enable" to fix it. They have
# written about this here: https://yarnpkg.com/corepack
corepack enable
make test-yarnpnp
esbuild-old-versions:
name: esbuild CI (old versions)
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion scripts/test-yarnpnp.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ function reinstallYarnIfNeeded() {
run('yarn set version 4.0.0-rc.22')
}

const rc = fs.readFileSync(path.join(rootDir, '.yarnrc.yml'), 'utf8')
let rc
try {
rc = fs.readFileSync(path.join(rootDir, '.yarnrc.yml'), 'utf8')
} catch {
rc = '' // Sometimes this file doesn't exist, so pretend it's empty
}
fs.writeFileSync(path.join(rootDir, '.yarnrc.yml'), `
pnpEnableEsmLoader: true
pnpIgnorePatterns: ["./bar/**"]
Expand Down

0 comments on commit 645734f

Please sign in to comment.