Skip to content

Commit

Permalink
build: upgrade yarn to 3.2 to speed up installation
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed May 11, 2022
1 parent ee298d7 commit 7bd9a4d
Show file tree
Hide file tree
Showing 6 changed files with 11,961 additions and 7,935 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,11 @@ $RECYCLE.BIN/

.idea
dist

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
9 changes: 9 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-engines.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-engines",
factory: function (require) {
var plugin=(()=>{var R=Object.create,m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var T=n=>m(n,"__esModule",{value:!0});var i=n=>{if(typeof require!="undefined")return require(n);throw new Error('Dynamic require of "'+n+'" is not supported')};var V=(n,e)=>{for(var r in e)m(n,r,{get:e[r],enumerable:!0})},N=(n,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of j(e))!Y.call(n,t)&&t!=="default"&&m(n,t,{get:()=>e[t],enumerable:!(r=P(e,t))||r.enumerable});return n},s=n=>N(T(m(n!=null?R(b(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var S={};V(S,{default:()=>$});var o=s(i("@yarnpkg/core")),c;(function(r){r.Yarn="Yarn",r.Console="Console"})(c||(c={}));var h=class{constructor(e){this.throwWrongEngineError=(e,r)=>{let t=this.formatErrorMessage(e,r);this.throwError(t)};this.throwError=e=>{switch(this.errorReporter){case c.Yarn:this.reportYarnError(e);break;case c.Console:default:this.reportConsoleError(e);break}};this.reportYarnError=e=>{throw new o.ReportError(o.MessageName.UNNAMED,e)};this.reportConsoleError=e=>{console.error(e),process.exit(1)};this.formatErrorMessage=(e,r)=>{let{configuration:t}=this.project,a=o.formatUtils.applyStyle(t,o.formatUtils.pretty(t,this.engine,"green"),2),g=o.formatUtils.pretty(t,e,"cyan"),l=o.formatUtils.pretty(t,r,"cyan"),w=`The current ${a} version ${g} does not satisfy the required version ${l}.`;return o.formatUtils.pretty(t,w,"red")};this.project=e.project,this.errorReporter=e.errorReporter}};var f=s(i("fs")),u=s(i("path")),d=s(i("semver")),k=s(i("@yarnpkg/fslib")),p=s(i("@yarnpkg/core"));var v=class extends h{constructor(){super(...arguments);this.resolveNvmRequiredVersion=()=>{let{configuration:e,cwd:r}=this.project,t=(0,u.resolve)(k.npath.fromPortablePath(r),".nvmrc"),a=p.formatUtils.applyStyle(e,p.formatUtils.pretty(e,this.engine,"green"),2);if(!(0,f.existsSync)(t)){this.throwError(p.formatUtils.pretty(e,`Unable to verify the ${a} version. The .nvmrc file does not exist.`,"red"));return}let g=(0,f.readFileSync)(t,"utf-8").trim();if((0,d.validRange)(g))return g;let l=p.formatUtils.pretty(e,".nvmrc","yellow");this.throwError(p.formatUtils.pretty(e,`Unable to verify the ${a} version. The ${l} file contains an invalid semver range.`,"red"))}}get engine(){return"Node"}verifyEngine(e){let r=e.node;r!=null&&(r===".nvmrc"&&(r=this.resolveNvmRequiredVersion()),(0,d.satisfies)(process.version,r)||this.throwWrongEngineError(process.version.replace(/^v/i,""),r.replace(/^v/i,"")))}};var x=s(i("semver")),y=s(i("@yarnpkg/core"));var E=class extends h{get engine(){return"Yarn"}verifyEngine(e){let r=e.yarn;r!=null&&((0,x.satisfies)(y.YarnVersion,r)||this.throwWrongEngineError(y.YarnVersion,r))}};var C=n=>e=>{let{engines:r={}}=e.getWorkspaceByCwd(e.cwd).manifest.raw,t={project:e,errorReporter:n};[new v(t),new E(t)].forEach(g=>g.verifyEngine(r))},q={hooks:{validateProject:C(c.Yarn),setupScriptEnvironment:C(c.Console)}},$=q;return S;})();
return plugin;
}
};
785 changes: 785 additions & 0 deletions .yarn/releases/yarn-3.2.0.cjs

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"

yarnPath: .yarn/releases/yarn-3.2.0.cjs
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@
"commitizen": {
"path": "cz-conventional-changelog"
}
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 7bd9a4d

Please sign in to comment.