Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
This commit is contained in:
Nicolò Ribaudo 2020-10-05 17:39:14 +02:00 committed by GitHub
parent 5f83a8c1a2
commit 2a3dfa051a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 65 additions and 110 deletions

View File

@ -29,6 +29,7 @@ jobs:
YARN_ENABLE_SCRIPTS: false # disable post-install scripts
YARN_NODE_LINKER: pnp # use pnp linker for better performance: it's meant to update yarn cache only
run: |
yarn dedupe --check
yarn install --immutable
test-coverage:

View File

@ -1,11 +0,0 @@
/* eslint-disable */
module.exports = {
name: "@yarnpkg/plugin-deduplicate",
factory: function (require) {
var plugin;plugin=(()=>{"use strict";var e={587:(e,t,r)=>{r.r(t),r.d(t,{default:()=>d});var o=r(594),s=r(966),a=r(42),n=r(513),i=function(e,t,r,o){var s,a=arguments.length,n=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,r,o);else for(var i=e.length-1;i>=0;i--)(s=e[i])&&(n=(a<3?s(n):a>3?s(t,r,n):s(t,r))||n);return a>3&&n&&Object.defineProperty(t,r,n),n};class c extends o.BaseCommand{async execute(){const e=await s.Configuration.find(this.context.cwd,this.context.plugins),{project:t}=await s.Project.find(e,this.context.cwd);await t.restoreInstallState();const r=await s.StreamReport.start({configuration:e,stdout:this.context.stdout,includeFooter:!1},async e=>{e.startTimerSync("deduplication step",()=>{!function(e,t){const r=new Map;for(const[t,o]of e.storedResolutions.entries()){const s=o,a=e.storedDescriptors.get(t).identHash,n=r.get(a);void 0===n?r.set(a,new Set([s])):r.set(a,n.add(s))}for(const o of e.storedResolutions.keys()){const a=e.storedDescriptors.get(o),i=r.get(a.identHash),c=a.range.match(/^npm:(.*)$/);if(null!==c&&(void 0!==i&&i.size>1)){const r=Array.from(i).map(t=>{const r=e.storedPackages.get(t);if(void 0===r)throw new TypeError(`Can't find package for locator hash '${t}'`);if(s.structUtils.isVirtualLocator(r)){const t=s.structUtils.devirtualizeLocator(r);return e.storedPackages.get(t.locatorHash)}return r}).filter(e=>null!==e.version&&n.satisfies(e.version,c[1])).sort((e,t)=>n.gt(e.version,t.version)?-1:1);if(r.length>1){const n=r[0].locatorHash,i=e.storedResolutions.get(o),c=e.storedPackages.get(n),d=e.storedPackages.get(i);!1===s.structUtils.areLocatorsEqual(d,c)&&(t.reportInfo(s.MessageName.UNNAMED,`${s.structUtils.stringifyDescriptor(a)} can be deduplicated from ${d.name}@${d.version} to ${c.name}@${c.version}`),e.storedResolutions.set(o,n))}}}}
/**
* @license MIT
*/(t,e)})});if(r.hasErrors())return r.exitCode();const o=await s.Cache.find(e);return(await s.StreamReport.start({configuration:e,stdout:this.context.stdout,includeLogs:!0},async e=>{await t.install({cache:o,report:e})})).exitCode()}}c.usage=a.Command.Usage({category:"Workspace-related commands",description:"Reduces dependencies with overlapping ranges to a smaller set of packages",details:"https://github.com/atlassian/yarn-deduplicate for yarn v2",examples:[]}),i([a.Command.Path("deduplicate")],c.prototype,"execute",null);const d={commands:[c]}},594:e=>{e.exports=require("@yarnpkg/cli")},966:e=>{e.exports=require("@yarnpkg/core")},42:e=>{e.exports=require("clipanion")},513:e=>{e.exports=require("semver")}},t={};function r(o){if(t[o])return t[o].exports;var s=t[o]={exports:{}};return e[o](s,s.exports,r),s.exports}return r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(587)})();
return plugin;
}
};

File diff suppressed because one or more lines are too long

55
.yarn/releases/yarn-2.3.1.cjs vendored Executable file

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,3 @@
# Use Yarn 2
# This path should always match the one in .yarnrc.yml
yarn-path ".yarn/releases/yarn-2.1.1.cjs"
yarn-path ".yarn/releases/yarn-2.3.1.cjs"

View File

@ -4,11 +4,7 @@ enableTransparentWorkspaces: false
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-deduplicate.cjs
spec: "https://raw.githubusercontent.com/eps1lon/yarn-plugin-deduplicate/latest/bin/%40yarnpkg/plugin-deduplicate.js"
unsafeHttpWhitelist:
- localhost
yarnPath: .yarn/releases/yarn-2.1.1.cjs
yarnPath: .yarn/releases/yarn-2.3.1.cjs

View File

@ -3,7 +3,7 @@
__metadata:
version: 4
cacheKey: 5
cacheKey: 7
"@babel/cli@npm:^7.11.6":
version: 7.11.6
@ -3343,7 +3343,7 @@ __metadata:
languageName: unknown
linkType: soft
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.11.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.4.0, @babel/types@npm:^7.4.4":
"@babel/types@npm:^7.0.0, @babel/types@npm:^7.10.4, @babel/types@npm:^7.10.5, @babel/types@npm:^7.11.0, @babel/types@npm:^7.11.5, @babel/types@npm:^7.3.0, @babel/types@npm:^7.4.0, @babel/types@npm:^7.4.4, @babel/types@npm:^7.8.3":
version: 7.11.5
resolution: "@babel/types@npm:7.11.5"
dependencies:
@ -8790,20 +8790,20 @@ fsevents@^1.2.7:
"fsevents@patch:fsevents@^1.2.7#builtin<compat/fsevents>":
version: 1.2.13
resolution: "fsevents@patch:fsevents@npm%3A1.2.13#builtin<compat/fsevents>::version=1.2.13&hash=495457"
resolution: "fsevents@patch:fsevents@npm%3A1.2.13#builtin<compat/fsevents>::version=1.2.13&hash=127e8e"
dependencies:
bindings: ^1.5.0
nan: ^2.12.1
checksum: 508a7e7e1e365236a7a0478392827145ba05c0181b1928b73b20c1a5212d15f6529735db897d617d7b0b051248c5720160f74c113bd727fc02de4f6cf885e1ff
checksum: 7bc048c164eb72f91b18ba7cd2ba30679a0afe57e9cd6352eac4bdbc4ddd4ca2ea98674d0bd3a80e96427469adc433c13532494b36aea40fceab36e198982182
languageName: node
linkType: hard
"fsevents@patch:fsevents@~2.1.2#builtin<compat/fsevents>":
version: 2.1.3
resolution: "fsevents@patch:fsevents@npm%3A2.1.3#builtin<compat/fsevents>::version=2.1.3&hash=495457"
resolution: "fsevents@patch:fsevents@npm%3A2.1.3#builtin<compat/fsevents>::version=2.1.3&hash=127e8e"
dependencies:
node-gyp: latest
checksum: 0005677b72f38a129a3cbe8c3794bdc83081a2bec53dfc03b085c2e5e4ca7a33a861a779d623313652df89746d97f79d24e4fef3b101c11c39ce1ea8a9690e18
checksum: e2b8c379340e21a786d32c653854c8876f94eb1202dd5be378fd42c062bc123aab5051c32bf0011865257c85982c41ded203f9fe8c9f9c8f8c84dc4672abc0e0
languageName: node
linkType: hard
@ -15673,7 +15673,7 @@ typescript@^3.6.3:
"typescript@patch:typescript@^3.6.3#builtin<compat/typescript>":
version: 3.9.7
resolution: "typescript@patch:typescript@npm%3A3.9.7#builtin<compat/typescript>::version=3.9.7&hash=5b02a2"
resolution: "typescript@patch:typescript@npm%3A3.9.7#builtin<compat/typescript>::version=3.9.7&hash=5bf698"
bin:
tsc: bin/tsc
tsserver: bin/tsserver