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

Bump Yarn to v3 #243

Merged
merged 6 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
* text=auto

# Reviewing the lockfile contents is an important step in verifying that
# we're using the dependencies we expect to be using
yarn.lock linguist-generated=false

# yarn v3
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
/.yarn/releases/** binary
/.yarn/plugins/** binary
10 changes: 4 additions & 6 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- name: Get Yarn cache directory
run: echo "::set-output name=YARN_CACHE_DIR::$(yarn cache dir)"
run: echo "::set-output name=YARN_CACHE_DIR::$(yarn config get cacheFolder)"
id: yarn-cache-dir
- name: Get Yarn version
run: echo "::set-output name=YARN_VERSION::$(yarn --version)"
Expand All @@ -29,16 +29,14 @@ jobs:
with:
path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}
- run: yarn --frozen-lockfile
- run: yarn allow-scripts
- run: yarn patch-package
- run: yarn --immutable
- run: yarn lint # "Testing" (i.e. config validation) is also done here
- name: Validate RC changelog
if: ${{ startsWith(github.ref, 'release/') }}
run: yarn workspaces run auto-changelog validate --rc
run: yarn workspaces foreach --exclude root run auto-changelog validate --rc
- name: Validate changelog
if: ${{ !startsWith(github.ref, 'release/') }}
run: yarn workspaces run auto-changelog validate
run: yarn workspaces foreach --exclude root run auto-changelog validate
- name: Require clean working directory
shell: bash
run: |
Expand Down
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ node_modules/
# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
# yarn v3 (w/o zero-install)
Mrtenz marked this conversation as resolved.
Show resolved Hide resolved
# See: https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/node_modules/eslint/lib/api.js b/node_modules/eslint/lib/api.js
index 3dde098..2118593 100644
--- a/node_modules/eslint/lib/api.js
+++ b/node_modules/eslint/lib/api.js
diff --git a/lib/api.js b/lib/api.js
index 3dde0985505a07ed8b64250bb96f470a0b17ace1..2118593ccb1326c25d4d500a9ecdaccc1e00e2e3 100644
--- a/lib/api.js
+++ b/lib/api.js
@@ -13,6 +13,7 @@ const { ESLint } = require("./eslint");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
Expand Down
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-allow-scripts",
factory: function (require) {
var plugin=(()=>{var a=Object.create,l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty;var u=e=>l(e,"__esModule",{value:!0});var f=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var g=(e,o)=>{for(var r in o)l(e,r,{get:o[r],enumerable:!0})},m=(e,o,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of s(o))!c.call(e,t)&&t!=="default"&&l(e,t,{get:()=>o[t],enumerable:!(r=i(o,t))||r.enumerable});return e},x=e=>m(u(l(e!=null?a(p(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var k={};g(k,{default:()=>d});var n=x(f("@yarnpkg/shell")),y={hooks:{afterAllInstalled:async()=>{let e=await(0,n.execute)("yarn run allow-scripts");e!==0&&process.exit(e)}}},d=y;return k;})();
return plugin;
}
};
28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

801 changes: 801 additions & 0 deletions .yarn/releases/yarn-3.2.4.cjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

17 changes: 17 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
enableScripts: false
Mrtenz marked this conversation as resolved.
Show resolved Hide resolved

enableTelemetry: 0

logFilters:
- code: YN0004
level: discard

nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
spec: 'https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js'
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'

yarnPath: .yarn/releases/yarn-3.2.4.cjs
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"node": ">=14.0.0"
},
"scripts": {
"setup": "yarn install && yarn allow-scripts && yarn patch-package",
"lint:eslint": "yarn eslint . --ext ts,js",
"lint:config-validation": "node ./scripts/validate-configs.js",
"lint:misc": "prettier '**/*.json' '!**/rules-snapshot.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
Expand All @@ -30,12 +29,15 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.2.1",
"fast-deep-equal": "^3.1.3",
"patch-package": "^6.4.7",
"prettier": "^2.2.1"
},
"lavamoat": {
"allowScripts": {
"@lavamoat/preinstall-always-fail": false
}
},
"packageManager": "yarn@3.2.4",
"resolutions": {
"eslint@^8.21.0": "patch:eslint@npm%3A8.21.0#./.yarn/patches/eslint-npm-8.21.0-b57f835038.patch"
}
}