Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Yarn 4 & Add PnP Support #72

Merged
merged 71 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1c1db01
Upgrade to Yarn 4
SleeplessByte Jul 29, 2024
2a11afe
Use published package
SleeplessByte Jul 29, 2024
adec227
Remove typo
SleeplessByte Jul 29, 2024
97d8d67
Restore files
SleeplessByte Jul 29, 2024
0a5f1ed
Upgrade workflows
SleeplessByte Jul 29, 2024
b79c739
Bump actions
SleeplessByte Jul 29, 2024
47b1f26
Cleanup ignore for prettier & Update dep
SleeplessByte Jul 29, 2024
0599e39
Use immutable flag
SleeplessByte Jul 29, 2024
1f3d64b
ignore install
SleeplessByte Jul 29, 2024
74bf5b9
Explicitely add core-js
SleeplessByte Jul 29, 2024
cbf179d
Attempt to run in band
SleeplessByte Jul 29, 2024
4bbf2e1
Rewrite tests outside of jest for the runner
SleeplessByte Jul 29, 2024
e425038
Fix YARN_ENABLE_OFFLINE_MODE
SleeplessByte Jul 29, 2024
62f6808
Add import fixes
SleeplessByte Jul 29, 2024
2ebc673
Corepack pack
SleeplessByte Jul 29, 2024
6234c81
Add corepack local install
SleeplessByte Jul 29, 2024
6be400a
Make silent again
SleeplessByte Jul 29, 2024
9cf9555
Actually copy the corepack tarball
SleeplessByte Jul 29, 2024
10ed2e7
Maybe pack like this?
SleeplessByte Jul 29, 2024
d937597
More logging in run.sh
SleeplessByte Jul 29, 2024
6d295b6
Sometimes I just want hide in a corner
SleeplessByte Jul 29, 2024
6fd27e0
Forcefully disable global cache
SleeplessByte Jul 29, 2024
4e63026
Maybe like this will work for the global cache
SleeplessByte Jul 29, 2024
7f61bca
Let's ignore production-only build for now
SleeplessByte Jul 29, 2024
fcd7f74
Allow logging on re-run
SleeplessByte Jul 29, 2024
984e457
Another run at this...
SleeplessByte Jul 29, 2024
e7118e0
List cache
SleeplessByte Jul 29, 2024
eede12c
Try copying pnp files explictely for zero-installs
SleeplessByte Jul 29, 2024
73b47ae
Re-enable network
SleeplessByte Jul 29, 2024
d027d9b
Disable hardned mode when disabling network
SleeplessByte Jul 29, 2024
4def1cc
Fix dockerfile
SleeplessByte Jul 29, 2024
3265435
idk why
SleeplessByte Jul 29, 2024
24a0c2e
Apparently this is COREPACK_HOME for corepack install -g
SleeplessByte Jul 29, 2024
6db4915
Try with setting more of COREPACK_HOME
SleeplessByte Jul 29, 2024
29bd611
Try without installing corepack
SleeplessByte Jul 29, 2024
6dbfec4
Disable entwork in docker file for yarn and corepack
SleeplessByte Jul 29, 2024
291e65e
Some more testing and trying
SleeplessByte Jul 29, 2024
65c39aa
idk corepack
SleeplessByte Jul 29, 2024
0d5cf65
Switch from yarnPath to corepack
SleeplessByte Jul 29, 2024
75eab28
Force corepack
SleeplessByte Jul 29, 2024
b16ad38
Use relative path
SleeplessByte Jul 29, 2024
64ea05c
That x should be a z
SleeplessByte Jul 29, 2024
6495c96
Enable corepack for other actions
SleeplessByte Jul 29, 2024
fee40fa
Enable corepack for other actions
SleeplessByte Jul 29, 2024
02e9012
Use /tmp for corepack
SleeplessByte Jul 29, 2024
be7ace7
Remove mkdir of home user corepack cache
SleeplessByte Jul 29, 2024
012398b
Don't echo, exec
SleeplessByte Jul 29, 2024
fcde1e1
Move user up
SleeplessByte Jul 30, 2024
4dc2944
Move user back down
SleeplessByte Jul 30, 2024
6da3a15
Maybe chmod?
SleeplessByte Jul 30, 2024
dc0663a
Add comment with source
SleeplessByte Jul 30, 2024
96041a8
I said what I said
SleeplessByte Jul 30, 2024
1b4c221
Remove COREPACK_DEFAULT_TO_LATEST for now
SleeplessByte Jul 30, 2024
1689bb1
Manual install
SleeplessByte Jul 30, 2024
4d25b9b
Follow tests closely
SleeplessByte Jul 30, 2024
316c2fb
Add v1 because we hate life
SleeplessByte Jul 30, 2024
645488d
Sigh for that command
SleeplessByte Jul 30, 2024
327736b
Idk
SleeplessByte Jul 30, 2024
8206c65
Explictely call corepack
SleeplessByte Jul 30, 2024
d45ee20
Maybe /tmp is overwritten?
SleeplessByte Jul 30, 2024
2738527
Print some more information
SleeplessByte Jul 30, 2024
b9e83ce
Maybe make it 555 for the lock?
SleeplessByte Jul 30, 2024
cd825c9
Standalone package fixes
SleeplessByte Jul 30, 2024
3b37f5c
Remove debug logger
SleeplessByte Jul 30, 2024
d8f0d93
Show us the generated results.json
SleeplessByte Jul 30, 2024
9045203
Fix mismatching results
SleeplessByte Jul 30, 2024
42a70ae
Remove final newline
SleeplessByte Jul 30, 2024
2fba90f
Rely on local yarn
SleeplessByte Jul 30, 2024
57c091b
Force corepack usage
SleeplessByte Jul 30, 2024
78c6b8e
Ignore format for .vscode files
SleeplessByte Jul 30, 2024
0093279
Annotate global cache usage
SleeplessByte Jul 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .eslintignore

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc.js

This file was deleted.

14 changes: 6 additions & 8 deletions .github/workflows/action-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: 'Post acknowledgement that it will format code'
continue-on-error: true # Never fail the build if this fails
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down Expand Up @@ -60,12 +60,10 @@ jobs:
git clone $HEAD_REPO .
git checkout -b "$HEAD_REF" "origin/$HEAD_REF"

- name: Use Node.js LTS (18.x)
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
- name: Use Node.js LTS (20.x)
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: '18'
- name: Install project development dependencies
run: npm install --no-save
node-version: 20.x
- name: 'Format code'
run: ./bin/format.sh

Expand All @@ -88,7 +86,7 @@ jobs:

- name: 'Post acknowledgement that it has formatted the code'
continue-on-error: true # Never fail the build if this fails
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -102,7 +100,7 @@ jobs:
- name: 'Post reminder to trigger build manually'
continue-on-error: true # Never fail the build if this fails
if: steps.fork_status.outputs.fork == 'true'
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ jobs:
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Use Node.js LTS
uses: actions/setup-node@v3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: .nvmrc

- name: Install project dependencies
run: yarn install --frozen-lockfile
run: |
corepack enable yarn
yarn -v
yarn install --immutable

- name: Run exercism/typescript-test-runner ci precheck (lint code)
run: bin/lint.sh
Expand All @@ -34,12 +37,15 @@ jobs:
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: ${{ matrix.node-version }}

- name: Install project dependencies
run: yarn install --frozen-lockfile
run: |
corepack enable yarn
yarn -v
yarn install --immutable

- name: Build the test-runner (using Node ${{ matrix.node-version }})
run: bin/test.sh
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/pr.ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:

steps:
- name: Checkout PR
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Use Node.js LTS
uses: actions/setup-node@v3
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: .nvmrc

- name: Install project dependencies
run: yarn install --frozen-lockfile
run: |
corepack enable yarn
yarn -v
yarn install --immutable

- name: Run exercism/javascript ci precheck (lint code)
run: bin/lint.sh
Expand All @@ -41,7 +44,10 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install project dependencies
run: yarn install --frozen-lockfile
run: |
corepack enable yarn
yarn -v
yarn install --immutable

- name: Build the test-runner (using Node ${{ matrix.node-version }})
run: bin/test.sh
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: 'Checkout code'
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: 'Verify formatting of all files'
run: ./bin/check-formatting.sh
6 changes: 1 addition & 5 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
/.github/labels.yml
/.github/workflows/sync-labels.yml
/test/fixtures
/test/fixtures/**/*
/tmp
/dist
/node_modules
/CODE_OF_CONDUCT.md

/.yarn
/.yarnrc.yml

# These are org-wide files (https://github.com/exercism/org-wide-files/)
/.github/labels.yml
/.github/workflows/sync-labels.yml

/CODE_OF_CONDUCT.md
/LICENSE
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.4.cjs

This file was deleted.

27 changes: 27 additions & 0 deletions .yarn/sdks/eslint/bin/eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/bin/eslint.js
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real eslint/bin/eslint.js your application uses
module.exports = absRequire(`eslint/bin/eslint.js`);
27 changes: 27 additions & 0 deletions .yarn/sdks/eslint/lib/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real eslint your application uses
module.exports = absRequire(`eslint`);
27 changes: 27 additions & 0 deletions .yarn/sdks/eslint/lib/unsupported-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/use-at-your-own-risk
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real eslint/use-at-your-own-risk your application uses
module.exports = absRequire(`eslint/use-at-your-own-risk`);
14 changes: 14 additions & 0 deletions .yarn/sdks/eslint/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "eslint",
"version": "9.8.0-sdk",
"main": "./lib/api.js",
"type": "commonjs",
"bin": {
"eslint": "./bin/eslint.js"
},
"exports": {
"./package.json": "./package.json",
".": "./lib/api.js",
"./use-at-your-own-risk": "./lib/unsupported-api.js"
}
}
5 changes: 5 additions & 0 deletions .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!

integrations:
- vscode
27 changes: 27 additions & 0 deletions .yarn/sdks/prettier/bin/prettier.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier/bin/prettier.cjs
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`);
27 changes: 27 additions & 0 deletions .yarn/sdks/prettier/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require prettier
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real prettier your application uses
module.exports = absRequire(`prettier`);
7 changes: 7 additions & 0 deletions .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "prettier",
"version": "3.3.3-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
}
27 changes: 27 additions & 0 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}

// Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`);
Loading
Loading