Skip to content

Commit bb05b2a

Browse files
Upgrade to Yarn 4 & Add PnP Support (#72)
* Upgrade to Yarn 4 * Upgrade workflows * Bump actions * Cleanup ignore for prettier & Update dep * Use immutable flag * Explicitly add core-js * Forcefully disable global cache * Let's ignore production-only build for now * Allow logging on re-run * Disable hardened mode when disabling network * Disable network in docker file for yarn and corepack * Switch from yarnPath to corepack * Show us the generated results.json * Rely on local yarn * Force corepack usage * Ignore format for .vscode files * Annotate global cache usage
1 parent a2143fb commit bb05b2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+5504
-6202
lines changed

.eslintignore

Lines changed: 0 additions & 19 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/action-format.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- name: 'Post acknowledgement that it will format code'
1414
continue-on-error: true # Never fail the build if this fails
15-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
15+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
1616
with:
1717
github-token: ${{ secrets.GITHUB_TOKEN }}
1818
script: |
@@ -60,12 +60,10 @@ jobs:
6060
git clone $HEAD_REPO .
6161
git checkout -b "$HEAD_REF" "origin/$HEAD_REF"
6262
63-
- name: Use Node.js LTS (18.x)
64-
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
63+
- name: Use Node.js LTS (20.x)
64+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
6565
with:
66-
node-version: '18'
67-
- name: Install project development dependencies
68-
run: npm install --no-save
66+
node-version: 20.x
6967
- name: 'Format code'
7068
run: ./bin/format.sh
7169

@@ -88,7 +86,7 @@ jobs:
8886
8987
- name: 'Post acknowledgement that it has formatted the code'
9088
continue-on-error: true # Never fail the build if this fails
91-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
89+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
9290
with:
9391
github-token: ${{ secrets.GITHUB_TOKEN }}
9492
script: |
@@ -102,7 +100,7 @@ jobs:
102100
- name: 'Post reminder to trigger build manually'
103101
continue-on-error: true # Never fail the build if this fails
104102
if: steps.fork_status.outputs.fork == 'true'
105-
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410
103+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
106104
with:
107105
github-token: ${{ secrets.GITHUB_TOKEN }}
108106
script: |

.github/workflows/ci.js.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
1616
- name: Use Node.js LTS
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
1818
with:
1919
node-version-file: .nvmrc
2020

2121
- name: Install project dependencies
22-
run: yarn install --frozen-lockfile
22+
run: |
23+
corepack enable yarn
24+
corepack yarn -v
25+
corepack yarn install --immutable
2326
2427
- name: Run exercism/typescript-test-runner ci precheck (lint code)
2528
run: bin/lint.sh
@@ -34,12 +37,15 @@ jobs:
3437
steps:
3538
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
3639
- name: Use Node.js ${{ matrix.node-version }}
37-
uses: actions/setup-node@v3
40+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
3841
with:
3942
node-version: ${{ matrix.node-version }}
4043

4144
- name: Install project dependencies
42-
run: yarn install --frozen-lockfile
45+
run: |
46+
corepack enable yarn
47+
corepack yarn -v
48+
corepack yarn install --immutable
4349
4450
- name: Build the test-runner (using Node ${{ matrix.node-version }})
4551
run: bin/test.sh

.github/workflows/pr.ci.js.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,18 @@ jobs:
1111

1212
steps:
1313
- name: Checkout PR
14-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
14+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
1515

1616
- name: Use Node.js LTS
17-
uses: actions/setup-node@v3
17+
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
1818
with:
1919
node-version-file: .nvmrc
2020

2121
- name: Install project dependencies
22-
run: yarn install --frozen-lockfile
22+
run: |
23+
corepack enable yarn
24+
corepack yarn -v
25+
corepack yarn install --immutable
2326
2427
- name: Run exercism/javascript ci precheck (lint code)
2528
run: bin/lint.sh
@@ -41,7 +44,10 @@ jobs:
4144
node-version: ${{ matrix.node-version }}
4245

4346
- name: Install project dependencies
44-
run: yarn install --frozen-lockfile
47+
run: |
48+
corepack enable yarn
49+
corepack yarn -v
50+
corepack yarn install --immutable
4551
4652
- name: Build the test-runner (using Node ${{ matrix.node-version }})
4753
run: bin/test.sh

.github/workflows/verify-code-formatting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- name: 'Checkout code'
13-
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744
13+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
1414

1515
- name: 'Verify formatting of all files'
1616
run: ./bin/check-formatting.sh

.prettierignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
/.github/labels.yml
2-
/.github/workflows/sync-labels.yml
3-
/test/fixtures
1+
/test/fixtures/**/*
42
/tmp
53
/dist
64
/node_modules
7-
/CODE_OF_CONDUCT.md
85

96
/.yarn
107
/.yarnrc.yml
8+
/.vscode
119

1210
# These are org-wide files (https://github.com/exercism/org-wide-files/)
1311
/.github/labels.yml
1412
/.github/workflows/sync-labels.yml
15-
1613
/CODE_OF_CONDUCT.md
1714
/LICENSE

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"arcanis.vscode-zipfs",
4+
"dbaeumer.vscode-eslint",
5+
"esbenp.prettier-vscode"
6+
]
7+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"search.exclude": {
3+
"**/.yarn": true,
4+
"**/.pnp.*": true
5+
},
6+
"eslint.nodePath": ".yarn/sdks",
7+
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
8+
"typescript.tsdk": ".yarn/sdks/typescript/lib",
9+
"typescript.enablePromptUseWorkspaceTsdk": true
10+
}

.yarn/releases/yarn-3.6.4.cjs

Lines changed: 0 additions & 874 deletions
This file was deleted.

.yarn/sdks/eslint/bin/eslint.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require eslint/bin/eslint.js
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real eslint/bin/eslint.js your application uses
27+
module.exports = absRequire(`eslint/bin/eslint.js`);

.yarn/sdks/eslint/lib/api.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require eslint
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real eslint your application uses
27+
module.exports = absRequire(`eslint`);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require eslint/use-at-your-own-risk
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real eslint/use-at-your-own-risk your application uses
27+
module.exports = absRequire(`eslint/use-at-your-own-risk`);

.yarn/sdks/eslint/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "eslint",
3+
"version": "9.8.0-sdk",
4+
"main": "./lib/api.js",
5+
"type": "commonjs",
6+
"bin": {
7+
"eslint": "./bin/eslint.js"
8+
},
9+
"exports": {
10+
"./package.json": "./package.json",
11+
".": "./lib/api.js",
12+
"./use-at-your-own-risk": "./lib/unsupported-api.js"
13+
}
14+
}

.yarn/sdks/integrations.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# This file is automatically generated by @yarnpkg/sdks.
2+
# Manual changes might be lost!
3+
4+
integrations:
5+
- vscode

.yarn/sdks/prettier/bin/prettier.cjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require prettier/bin/prettier.cjs
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real prettier/bin/prettier.cjs your application uses
27+
module.exports = absRequire(`prettier/bin/prettier.cjs`);

.yarn/sdks/prettier/index.cjs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require prettier
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real prettier your application uses
27+
module.exports = absRequire(`prettier`);

.yarn/sdks/prettier/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "prettier",
3+
"version": "3.3.3-sdk",
4+
"main": "./index.cjs",
5+
"type": "commonjs",
6+
"bin": "./bin/prettier.cjs"
7+
}

.yarn/sdks/typescript/bin/tsc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env node
2+
3+
const {existsSync} = require(`fs`);
4+
const {createRequire, register} = require(`module`);
5+
const {resolve} = require(`path`);
6+
const {pathToFileURL} = require(`url`);
7+
8+
const relPnpApiPath = "../../../../.pnp.cjs";
9+
10+
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
11+
const absRequire = createRequire(absPnpApiPath);
12+
13+
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
14+
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
15+
16+
if (existsSync(absPnpApiPath)) {
17+
if (!process.versions.pnp) {
18+
// Setup the environment to be able to require typescript/bin/tsc
19+
require(absPnpApiPath).setup();
20+
if (isPnpLoaderEnabled && register) {
21+
register(pathToFileURL(absPnpLoaderPath));
22+
}
23+
}
24+
}
25+
26+
// Defer to the real typescript/bin/tsc your application uses
27+
module.exports = absRequire(`typescript/bin/tsc`);

0 commit comments

Comments
 (0)