Skip to content

Commit cac6949

Browse files
authored
Upgrade from Yarn v1 to v3 (#137)
This commit aligns this project with our other projects, which use Yarn v3 across the board.
1 parent 7e9864d commit cac6949

File tree

9 files changed

+10894
-7608
lines changed

9 files changed

+10894
-7608
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* eslint-disable */
2+
//prettier-ignore
3+
module.exports = {
4+
name: "@yarnpkg/plugin-allow-scripts",
5+
factory: function (require) {
6+
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;})();
7+
return plugin;
8+
}
9+
};

.yarn/plugins/@yarnpkg/plugin-constraints.cjs

+52
Large diffs are not rendered by default.

.yarn/releases/yarn-3.2.1.cjs

+786
Large diffs are not rendered by default.

.yarnrc

-1
This file was deleted.

.yarnrc.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
enableScripts: false
2+
3+
enableTelemetry: 0
4+
5+
logFilters:
6+
- code: YN0004
7+
level: discard
8+
9+
nodeLinker: node-modules
10+
11+
plugins:
12+
- path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs
13+
spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"
14+
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
15+
spec: "@yarnpkg/plugin-constraints"
16+
17+
yarnPath: .yarn/releases/yarn-3.2.1.cjs

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ _Add examples here_
2424

2525
- Install [Node.js](https://nodejs.org) version 14
2626
- If you are using [nvm](https://github.com/creationix/nvm#installation) (recommended) running `nvm use` will automatically choose the right node version for you.
27-
- Install [Yarn v1](https://yarnpkg.com/en/docs/install)
28-
- Run `yarn setup` to install dependencies and run any requried post-install scripts
29-
- **Warning:** Do not use the `yarn` / `yarn install` command directly. Use `yarn setup` instead. The normal install command will skip required post-install scripts, leaving your development environment in an invalid state.
27+
- Install [Yarn v3](https://yarnpkg.com/getting-started/install)
28+
- Run `yarn install` to install dependencies and run any required post-install scripts
3029

3130
### Testing and Linting
3231

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
"lint": "yarn lint:eslint && yarn lint:misc --check",
2020
"lint:eslint": "eslint . --cache --ext js,ts",
2121
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
22-
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
23-
"prepublishOnly": "yarn build:clean && yarn lint && yarn test",
24-
"setup": "yarn install && yarn allow-scripts",
22+
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore",
23+
"prepack": "./scripts/prepack.sh",
2524
"test": "jest",
2625
"test:watch": "jest --watchAll"
2726
},
@@ -63,6 +62,7 @@
6362
"ts-jest": "^26.5.6",
6463
"typescript": "~4.4.4"
6564
},
65+
"packageManager": "[email protected]",
6666
"engines": {
6767
"node": ">=14.0.0"
6868
},

scripts/prepack.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
3+
set -x
4+
set -e
5+
set -o pipefail
6+
7+
if [[ -n $SKIP_PREPACK ]]; then
8+
echo "Notice: skipping prepack."
9+
exit 0
10+
fi
11+
12+
yarn build:clean

yarn.lock

+10,013-7,601
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)