Archived
0
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
argonbot/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

29 lines
49 KiB
JavaScript
Raw Normal View History

2021-06-14 09:59:17 +00:00
/* eslint-disable */
module.exports = {
name: "@yarnpkg/plugin-workspace-tools",
factory: function (require) {
var plugin;plugin=(()=>{"use strict";var e={997:(e,t,n)=>{n.r(t),n.d(t,{default:()=>R});function o(e,t,n,o){var r,a=arguments.length,s=a<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var i=e.length-1;i>=0;i--)(r=e[i])&&(s=(a<3?r(s):a>3?r(t,n,s):r(t,n))||s);return a>3&&s&&Object.defineProperty(t,n,s),s}const r=require("@yarnpkg/cli"),a=require("@yarnpkg/core"),s=require("clipanion"),i=require("yup");class l extends r.BaseCommand{constructor(){super(...arguments),this.workspaces=[],this.json=!1,this.production=!1,this.all=!1}async execute(){const e=await a.Configuration.find(this.context.cwd,this.context.plugins),{project:t,workspace:n}=await a.Project.find(e,this.context.cwd),o=await a.Cache.find(e);let s;if(this.all)s=new Set(t.workspaces);else if(0===this.workspaces.length){if(!n)throw new r.WorkspaceRequiredError(t.cwd,this.context.cwd);s=new Set([n])}else s=new Set(this.workspaces.map(e=>t.getWorkspaceByIdent(a.structUtils.parseIdent(e))));for(const e of s)for(const n of a.Manifest.hardDependencies)for(const o of e.manifest.getForScope(n).values()){const e=t.tryWorkspaceByDescriptor(o);null!==e&&s.add(e)}for(const e of t.workspaces)s.has(e)?this.production&&e.manifest.devDependencies.clear():(e.manifest.dependencies.clear(),e.manifest.devDependencies.clear(),e.manifest.peerDependencies.clear(),e.manifest.scripts.clear());return(await a.StreamReport.start({configuration:e,json:this.json,stdout:this.context.stdout,includeLogs:!0},async e=>{await t.install({cache:o,report:e,persistProject:!1})})).exitCode()}}l.usage=s.Command.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.js` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "}),l.schema=i.object().shape({all:i.bool(),workspaces:i.array().when("all",{is:!0,then:i.array().max(0,"Cannot specify workspaces when using the --all flag"),otherwise:i.array()})}),o([s.Command.Rest()],l.prototype,"workspaces",void 0),o([s.Command.Boolean("--json",{description:"Format the output as an NDJSON stream"})],l.prototype,"json",void 0),o([s.Command.Boolean("--production",{description:"Only install regular dependencies by omitting dev dependencies"})],l.prototype,"production",void 0),o([s.Command.Boolean("-A,--all",{description:"Install the entire project"})],l.prototype,"all",void 0),o([s.Command.Path("workspaces","focus")],l.prototype,"execute",null);var u=n(401),p=n.n(u);const c=require("os");var d=n(578),f=n.n(d);const h=(e,t)=>{const n=[];for(const o of e.workspacesCwds){const e=t.workspacesByCwd.get(o);e&&n.push(e,...h(e,t))}return n},g=(e,t)=>{const n=new Set,o=e=>{const r=new Map([...e.manifest.dependencies,...e.manifest.devDependencies]);for(const e of r.values()){const r=t.tryWorkspaceByDescriptor(e);null===r||n.has(r)||(n.add(r),o(r))}};return o(e),n};class A extends r.BaseCommand{constructor(){super(...arguments),this.args=[],this.allLegacy=!1,this.recursive=!1,this.verbose=!1,this.parallel=!1,this.interlaced=!1,this.topological=!1,this.topologicalDev=!1,this.include=[],this.exclude=[],this.publicOnly=!1}async execute(){var e;const t=await a.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await a.Project.find(t,this.context.cwd),i=null!==(e=this.all)&&void 0!==e?e:this.allLegacy;if(!i&&!o)throw new r.WorkspaceRequiredError(n.cw
2021-06-14 09:59:17 +00:00
/*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*/
const o=n(669),r=n(615),a=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),s=e=>"number"==typeof e||"string"==typeof e&&""!==e,i=e=>Number.isInteger(+e),l=e=>{let t=""+e,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},u=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},p=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},c=(e,t,n,o)=>{if(n)return r(e,t,{wrap:!1,...o});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},d=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,o=n.capture?"":"?:";return t?`(${o}${e.join("|")})`:e.join("|")}return r(e,t,n)},f=(...e)=>new RangeError("Invalid range arguments: "+o.inspect(...e)),h=(e,t,n)=>{if(!0===n.strictRanges)throw f([e,t]);return[]},g=(e,t,n=1,o={})=>{let r=Number(e),a=Number(t);if(!Number.isInteger(r)||!Number.isInteger(a)){if(!0===o.strictRanges)throw f([e,t]);return[]}0===r&&(r=0),0===a&&(a=0);let s=r>a,i=String(e),h=String(t),g=String(n);n=Math.max(Math.abs(n),1);let A=l(i)||l(h)||l(g),y=A?Math.max(i.length,h.length,g.length):0,R=!1===A&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,o),m=o.transform||(e=>t=>!0===e?Number(t):String(t))(R);if(o.toRegex&&1===n)return c(p(e,y),p(t,y),!0,o);let _={negatives:[],positives:[]},E=[],C=0;for(;s?r>=a:r<=a;)!0===o.toRegex&&n>1?_[(b=r)<0?"negatives":"positives"].push(Math.abs(b)):E.push(u(m(r,C),y,R)),r=s?r-n:r+n,C++;var b;return!0===o.toRegex?n>1?((e,t)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let n,o=t.capture?"":"?:",r="",a="";return e.positives.length&&(r=e.positives.join("|")),e.negatives.length&&(a=`-(${o}${e.negatives.join("|")})`),n=r&&a?`${r}|${a}`:r||a,t.wrap?`(${o}${n})`:n})(_,o):d(E,null,{wrap:!1,...o}):E},A=(e,t,n,o={})=>{if(null==t&&s(e))return[e];if(!s(e)||!s(t))return h(e,t,o);if("function"==typeof n)return A(e,t,1,{transform:n});if(a(n))return A(e,t,0,n);let r={...o};return!0===r.capture&&(r.wrap=!0),n=n||r.step||1,i(n)?i(e)&&i(t)?g(e,t,n,r):((e,t,n=1,o={})=>{if(!i(e)&&e.length>1||!i(t)&&t.length>1)return h(e,t,o);let r=o.transform||(e=>String.fromCharCode(e)),a=(""+e).charCodeAt(0),s=(""+t).charCodeAt(0),l=a>s,u=Math.min(a,s),p=Math.max(a,s);if(o.toRegex&&1===n)return c(u,p,!1,o);let f=[],g=0;for(;l?a>=s:a<=s;)f.push(r(a,g)),a=l?a-n:a+n,g++;return!0===o.toRegex?d(f,null,{wrap:!1,options:o}):f})(e,t,Math.max(Math.abs(n),1),r):null==n||a(n)?A(e,t,1,n):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(n,r)};e.exports=A},761:e=>{
2021-06-14 09:59:17 +00:00
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
e.exports=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))}},401:(e,t,n)=>{const o=n(669),r=n(235),a=n(722),s=n(598),i=e=>"string"==typeof e&&(""===e||"./"===e),l=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let o=new Set,r=new Set,s=new Set,i=0,l=e=>{s.add(e.output),n&&n.onResult&&n.onResult(e)};for(let s=0;s<t.length;s++){let u=a(String(t[s]),{...n,onResult:l},!0),p=u.state.negated||u.state.negatedExtglob;p&&i++;for(let t of e){let e=u(t,!0);(p?!e.isMatch:e.isMatch)&&(p?o.add(e.output):(o.delete(e.output),r.add(e.output)))}}let u=(i===t.length?[...s]:[...r]).filter(e=>!o.has(e));if(n&&0===u.length){if(!0===n.failglob)throw new Error(`No matches found for "${t.join(", ")}"`);if(!0===n.nonull||!0===n.nullglob)return n.unescape?t.map(e=>e.replace(/\\/g,"")):t}return u};l.match=l,l.matcher=(e,t)=>a(e,t),l.any=l.isMatch=(e,t,n)=>a(t,n)(e),l.not=(e,t,n={})=>{t=[].concat(t).map(String);let o=new Set,r=[],a=l(e,t,{...n,onResult:e=>{n.onResult&&n.onResult(e),r.push(e.output)}});for(let e of r)a.includes(e)||o.add(e);return[...o]},l.contains=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${o.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>l.contains(e,t,n));if("string"==typeof t){if(i(e)||i(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return l.isMatch(e,t,{...n,contains:!0})},l.matchKeys=(e,t,n)=>{if(!s.isObject(e))throw new TypeError("Expected the first argument to be an object");let o=l(Object.keys(e),t,n),r={};for(let t of o)r[t]=e[t];return r},l.some=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(o.some(e=>t(e)))return!0}return!1},l.every=(e,t,n)=>{let o=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(!o.every(e=>t(e)))return!1}return!0},l.all=(e,t,n)=>{if("string"!=typeof e)throw new TypeError(`Expected a string: "${o.inspect(e)}"`);return[].concat(t).every(t=>a(t,n)(e))},l.capture=(e,t,n)=>{let o=s.isWindows(n),r=a.makeRe(String(e),{...n,capture:!0}).exec(o?s.toPosixSlashes(t):t);if(r)return r.slice(1).map(e=>void 0===e?"":e)},l.makeRe=(...e)=>a.makeRe(...e),l.scan=(...e)=>a.scan(...e),l.parse=(e,t)=>{let n=[];for(let o of[].concat(e||[]))for(let e of r(String(o),t))n.push(a.parse(e,t));return n},l.braces=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return t&&!0===t.nobrace||!/\{.*\}/.test(e)?[e]:r(e,t)},l.braceExpand=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");return l.braces(e,{...t,expand:!0})},e.exports=l},578:(e,t,n)=>{const o=n(550),r=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},a=(e,t,...a)=>{n++;const s=o(e,...a);t(s),s.then(r,r)},s=(o,...r)=>new Promise(s=>((o,r,...s)=>{n<e?a(o,r,...s):t.push(a.bind(null,o,r,...s))})(o,s,...r));return Object.defineProperties(s,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length}}),s};e.exports=r,e.exports.default=r},550:e=>{e.exports=(e,...t)=>new Promise(n=>{n(e(...t))})},722:(e,t,n)=>{e.exports=n(828)},86:(e,t,n)=>{const o=n(622),r={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},a={...r,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"};e.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,.
2021-06-14 09:59:17 +00:00
/*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*/
const o=n(761),r=(e,t,n)=>{if(!1===o(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===o(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let a={relaxZeros:!0,...n};"boolean"==typeof a.strictZeros&&(a.relaxZeros=!1===a.strictZeros);let l=e+":"+t+"="+String(a.relaxZeros)+String(a.shorthand)+String(a.capture)+String(a.wrap);if(r.cache.hasOwnProperty(l))return r.cache[l].result;let u=Math.min(e,t),p=Math.max(e,t);if(1===Math.abs(u-p)){let n=e+"|"+t;return a.capture?`(${n})`:!1===a.wrap?n:`(?:${n})`}let c=h(e)||h(t),d={min:e,max:t,a:u,b:p},f=[],g=[];if(c&&(d.isPadded=c,d.maxLen=String(d.max).length),u<0){g=s(p<0?Math.abs(p):1,Math.abs(u),d,a),u=d.a=0}return p>=0&&(f=s(u,p,d,a)),d.negatives=g,d.positives=f,d.result=function(e,t,n){let o=i(e,t,"-",!1,n)||[],r=i(t,e,"",!1,n)||[],a=i(e,t,"-?",!0,n)||[];return o.concat(a).concat(r).join("|")}(g,f,a),!0===a.capture?d.result=`(${d.result})`:!1!==a.wrap&&f.length+g.length>1&&(d.result=`(?:${d.result})`),r.cache[l]=d,d.result};function a(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let o=function(e,t){let n=[];for(let o=0;o<e.length;o++)n.push([e[o],t[o]]);return n}(e,t),r=o.length,a="",s=0;for(let e=0;e<r;e++){let[t,r]=o[e];t===r?a+=t:"0"!==t||"9"!==r?a+=f(t,r,n):s++}return s&&(a+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:a,count:[s],digits:r}}function s(e,t,n,o){let r,s=function(e,t){let n=1,o=1,r=p(e,n),a=new Set([t]);for(;e<=r&&r<=t;)a.add(r),n+=1,r=p(e,n);for(r=c(t+1,o)-1;e<r&&r<=t;)a.add(r),o+=1,r=c(t+1,o)-1;return a=[...a],a.sort(l),a}(e,t),i=[],u=e;for(let e=0;e<s.length;e++){let t=s[e],l=a(String(u),String(t),o),p="";n.isPadded||!r||r.pattern!==l.pattern?(n.isPadded&&(p=g(t,n,o)),l.string=p+l.pattern+d(l.count),i.push(l),u=t+1,r=l):(r.count.length>1&&r.count.pop(),r.count.push(l.count[0]),r.string=r.pattern+d(r.count),u=t+1)}return i}function i(e,t,n,o,r){let a=[];for(let r of e){let{string:e}=r;o||u(t,"string",e)||a.push(n+e),o&&u(t,"string",e)&&a.push(n+e)}return a}function l(e,t){return e>t?1:t>e?-1:0}function u(e,t,n){return e.some(e=>e[t]===n)}function p(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function c(e,t){return e-e%Math.pow(10,t)}function d(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function f(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function h(e){return/^-?(0+)\d/.test(e)}function g(e,t,n){if(!t.isPadded)return e;let o=Math.abs(t.maxLen-String(e).length),r=!1!==n.relaxZeros;switch(o){case 0:return"";case 1:return r?"0?":"0";case 2:return r?"0{0,2}":"00";default:return r?`0{0,${o}}`:`0{${o}}`}}r.cache={},r.clearCache=()=>r.cache={},e.exports=r},622:e=>{e.exports=require("path")},669:e=>{e.exports=require("util")}},t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={exports:{}};return e[o](r,r.exports,n),r.exports}return n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n(997)})();
2021-06-14 09:59:17 +00:00
return plugin;
}
};