diff --git a/.yarn/plugins/@yarnpkg/plugin-babel-release-tool.cjs b/.yarn/plugins/@yarnpkg/plugin-babel-release-tool.cjs index c9f7b704d3..f8f13bd53b 100644 --- a/.yarn/plugins/@yarnpkg/plugin-babel-release-tool.cjs +++ b/.yarn/plugins/@yarnpkg/plugin-babel-release-tool.cjs @@ -54,7 +54,7 @@ globstar while`,e,d,r,h,x),this.matchOne(e.slice(d),r.slice(h),t))return this.de >>> no match, partial?`,e,d,r,h),d===o))}var v;if(typeof s=="string"?(n.nocase?v=l.toLowerCase()===s.toLowerCase():v=l===s,this.debug("string match",s,l,v)):(v=l.match(s),this.debug("pattern match",s,l,v)),!v)return!1}if(i===o&&a===u)return!0;if(i===o)return t;if(a===u){var m=i===o-1&&e[i]==="";return m}throw new Error("wtf?")};function Zue(e){return e.replace(/\\(.)/g,"$1")}function ese(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var tse={};lF(tse,{default:()=>rse});var Ca=N(E("@yarnpkg/core"));var jc=N(E("@yarnpkg/core")),k7=N(E("@yarnpkg/cli")),ar=N(E("clipanion")),Tc=N(sx()),_a=N(E("semver")),R7=N(S7());function Pc(e){return(r,t)=>r[e]t[e]?1:0}function q7(e,r){return Promise.all(e.map(r))}function ai(e,r){return q7(hx(e.topLevelWorkspace,e),r)}function hx(e,r){let t=[e];for(let n of t)for(let i of n.workspacesCwds){let a=r.workspacesByCwd.get(i);a&&t.push(a)}return t.shift(),t}function ir(e){return e.name.scope?`@${e.name.scope}/${e.name.name}`:e.name.name}var A7=N(E("child_process"));function Vr(e){let r=t=>String(t).trim();return new Promise((t,n)=>{(0,A7.exec)(e,(i,a,o)=>{if(i)return n(i);t({stdout:r(a),stderr:r(o)})})})}async function P7(){let{stdout:e}=await Vr("git describe --long --dirty --first-parent"),[,r,t,n,i,a]=/^((?:.*@)?(.*))-(\d+)-g([0-9a-f]+)(-dirty)?$/.exec(e)||[];return{lastTagName:r,lastVersion:t,refCount:n,sha:i,isDirty:Boolean(a)}}async function j7(e){let r=JSON.stringify(e),{stdout:t}=await Vr(`git tag --sort version:refname --points-at HEAD --list "${r}"`);return t.split(` `).filter(Boolean)}async function T7(e,r){let{stdout:t}=await Vr(`git diff --name-only ${e} -- ${r}`);return t===""?[]:t.split(` `)}async function B7(e){let{stdout:r}=await Vr(`git diff-tree --name-only --no-commit-id --root -r -c ${e}`);return r.split(` -`)}async function I7(e){await Vr("git add ."),await Vr(`git commit -m ${JSON.stringify(e)}`)}async function M7(e){await Vr(`git tag ${JSON.stringify(e)} -m ${JSON.stringify(e)}`)}var oi=N(E("@yarnpkg/core"));async function ui(e,r){let t=await oi.Configuration.find(r.cwd,r.plugins),[{project:n,workspace:i},a]=await Promise.all([oi.Project.find(t,r.cwd),oi.Cache.find(t,{immutable:!0})]);if(n.topLevelWorkspace!==i)throw new Error(`The "yarn ${e}" command must be run in the root workspace.`);return{configuration:t,project:n,cache:a}}var ga=class extends k7.BaseCommand{constructor(){super(...arguments);this.version=ar.Option.String({required:!1});this.forceUpdates=ar.Option.Array("-f,--force-update")||[];this.yes=ar.Option.Boolean("--yes",!1);this.tagVersionPrefix=ar.Option.String("--tag-version-prefix");this.all=ar.Option.Boolean("--all",!1);this.dry=ar.Option.Boolean("--dry",!1)}async execute(){var x,v,m;let{configuration:r,project:t,cache:n}=await ui("release-tool version",this.context),{lastTagName:i,lastVersion:a}=await P7(),o=t.configuration.get("releaseTool"),u=(x=o==null?void 0:o.get("ignoreChanges"))!=null?x:[],s=(v=o==null?void 0:o.get("implicitDependencies"))!=null?v:new Map,l=await this.getChangedWorkspaces(t,i,u,s,new Set(this.forceUpdates)),d;if(this.version==="patch"||this.version==="minor"||this.version==="major"?d=_a.default.inc(a,this.version):d=(m=this.version)!=null?m:await this.promptVersion(a,{Patch:_a.default.inc(a,"patch"),Minor:_a.default.inc(a,"minor"),Major:_a.default.inc(a,"major")}),this.dry){this.logChanges(d,l);return}if(!this.yes&&!await this.promptConfirm(d,l))return 0;t.topLevelWorkspace.manifest.version=d,this.updateManifests(l,hx(t.topLevelWorkspace,t),d);let h=await jc.StreamReport.start({configuration:r,stdout:this.context.stdout,includeLogs:!0},async b=>{await t.resolveEverything({cache:n,report:b})});if(h.hasErrors())return h.exitCode();await t.persist(),await this.gitCommitAndTag(d)}async getChangedWorkspaces(r,t,n,i,a){let o=n.map(d=>R7.default.filter(`!${d}`,{matchBase:!0,dot:!0})),u=new Set,s=new Map;await ai(r,async d=>{let h=ir(d.manifest);if(s.set(h,d),this.all||a.has(h)){u.add(d);return}o.reduce((v,m)=>v.filter(m),await T7(t,d.cwd)).length>0&&u.add(d)});let l;do{l=!1;for(let[d,h]of i){let x=s.get(d);if(!u.has(x))for(let v of h){let m=s.get(v);if(u.has(m)){l=!0,u.add(x);break}}}}while(l);return Array.from(u).sort(Pc("cwd"))}async promptVersion(r,t){let n=Object.entries(t).map(([a,o])=>({name:`${a} (${o})`,value:o})),{version:i}=await Tc.default.prompt({type:"list",name:"version",message:`Select a new version (currently ${r}):`,choices:n});return i}async promptConfirm(r,t){this.logChanges(r,t);let{confirm:n}=await Tc.default.prompt({type:"confirm",name:"confirm",message:"Are you sure you want to create these versions?",default:!1});return n}logChanges(r,t){console.log(""),console.log("Changes:");for(let{manifest:n}of t)console.log(` - ${ir(n)}: ${n.version} => ${r}`);console.log("")}updateManifests(r,t,n){for(let{manifest:i}of r)i.version=n;for(let{manifest:i}of r)for(let{manifest:a}of t){let{identHash:o}=a.name,u=i.dependencies.get(o);if(u==null?void 0:u.range.includes("workspace:")){let s=u.range.replace(/workspace:[\w\^\~\.\*\-]+/g,`workspace:^${a.version}`),l=jc.structUtils.makeDescriptor(u,s);i.dependencies.set(o,l)}}}async gitCommitAndTag(r){var n;let t=((n=this.tagVersionPrefix)!=null?n:"v")+r;if(!this.yes){let{confirm:i}=await Tc.default.prompt({type:"confirm",name:"confirm",message:`Are you sure you want to commit and tag these changes as "${t}"?`,default:!1});if(!i)return 0}await I7(t),await M7(t)}};ga.paths=[["release-tool","version"]],ga.usage=ar.Command.Usage({description:"Bump the version of the updated packages",details:"\n This command will check which packages have been changed since the last git tag. Then, it update the package.json files and then create a new git tag.\n\n If no version is specified, it will prompt for it.\n\n - The `-f,--force` option allows you to specify a package that must be updated even if git doesn't detect any change. It can be specified multiple times, for multiple packages.\n - If the `--all` option is specified, every package will be updated.\n - The `--yes` option disables the confirmation prompts.\n - If `--tag-version-prefix` is specified, it will be used to build the tag name (default: `v`).\n\n This command also reads two options from the .yarnrc.yml file:\n - `releaseTool.ignoreChanges` allows you to specify an array of file patterns to ignore when computing the updated packages.\n - `releaseTool.implicitDependencies` allows you to specify implicit build-time dependencies between packages. When an implicit dependency package is updated, also the implicit dependents will be released.\n "});var L7=ga;var z7=N(E("@yarnpkg/cli")),or=N(E("clipanion")),_x=N(E("path"));var N7=class{constructor(r){Nc(this,"value");Nc(this,"next");this.value=r}},Ve,Ct,Ot,xx=class{constructor(){Sa(this,Ve,void 0);Sa(this,Ct,void 0);Sa(this,Ot,void 0);this.clear()}enqueue(r){var n;let t=new N7(r);He(this,Ve)?(He(this,Ct).next=t,Oe(this,Ct,t)):(Oe(this,Ve,t),Oe(this,Ct,t)),Oe(this,Ot,(n=+He(this,Ot))+1)}dequeue(){var t;let r=He(this,Ve);if(!!r)return Oe(this,Ve,He(this,Ve).next),Oe(this,Ot,(t=+He(this,Ot))-1),r.value}clear(){Oe(this,Ve,void 0),Oe(this,Ct,void 0),Oe(this,Ot,0)}get size(){return He(this,Ot)}*[Symbol.iterator](){let r=He(this,Ve);for(;r;)yield r.value,r=r.next}};Ve=new WeakMap,Ct=new WeakMap,Ot=new WeakMap;var W7=xx;function Ea(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let r=new W7,t=0,n=()=>{t--,r.size>0&&r.dequeue()()},i=async(u,s,l)=>{t++;let d=(async()=>u(...l))();s(d);try{await d}catch{}n()},a=(u,s,l)=>{r.enqueue(i.bind(void 0,u,s,l)),(async()=>{await Promise.resolve(),t0&&r.dequeue()()})()},o=(u,...s)=>new Promise(l=>{a(u,l,s)});return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),o}var $7=N(sx());var ze=N(E("@yarnpkg/core")),Da=N(E("@yarnpkg/plugin-npm"));var bx=N(E("@yarnpkg/core"));var U7=class{constructor(){this.dependencies=new Set;this.dependents=new Set}addDependent(r){this.dependents.add(r),r.dependencies.add(this)}unlink(){this.dependencies.forEach(r=>r.dependents.delete(this)),this.dependents.forEach(r=>r.dependencies.delete(this))}*dependenciesIterator(){yield*this.dependencies}*dependentsIterator(){yield*this.dependents}hasDependencies(){return this.dependencies.size>0}},vx=class extends U7{constructor(r){super();this.workspace=r}intersects(r){for(let t of r.workspacesIterator())if(t===this.workspace)return!0;return!1}*workspacesIterator(){yield this.workspace}toString(){return ir(this.workspace.manifest)}deleteWorkspace(r){return this.workspace===r}},mx=class extends Set{constructor(r){super();this.packages=new Map;r.forEach(t=>{let n=new vx(t);this.packages.set(t.locator.identHash,n),this.add(n)}),this.packages.forEach(t=>{t.workspace.manifest.dependencies.forEach((n,i)=>{var a;(a=this.packages.get(i))==null||a.addDependent(t)})})}getProcessableWorkspaces(){let r=new Set;for(let t of this)if(!t.hasDependencies())for(let n of t.workspacesIterator())r.add(n);return r}delete(r){return this.has(r)&&r.unlink(),super.delete(r)}deleteWorkspace(r){let t=this.packages.get(r.locator.identHash);return t?t.deleteWorkspace(r)&&this.delete(t):!1}detectCycles(r){let t=[],n=new WeakSet,i=o=>{for(let u=0;u ")}`);return}n.has(o)||(n.add(o),a(o))};function a(o){if(!(o instanceof vx)){r.reportError(bx.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected: ${o}`);return}t.push(o);for(let u of o.dependenciesIterator())i(u);t.pop()}this.forEach(i)}},Bc=mx;var G7=N(E("@yarnpkg/core")),yx=N(E("@yarnpkg/plugin-pack")),K7=N(E("@yarnpkg/plugin-npm"));async function V7(e,r,t){let n=await yx.packUtils.genPackList(e),i=await yx.packUtils.genPackStream(e,n),a=await G7.miscUtils.bufferStream(i);return K7.npmPublishUtils.makePublishBody(e,a,{access:void 0,tag:t,registry:r})}var wa=class extends z7.BaseCommand{constructor(){super(...arguments);this.yes=or.Option.Boolean("--yes",!1);this.tag=or.Option.String("--tag","latest");this.tagVersionPrefix=or.Option.String("--tag-version-prefix","v")}async execute(){let{project:r,configuration:t}=await ui("release-tool publish",this.context);await r.restoreInstallState();let n=await this.getTaggedPackages(r),i=new Bc(n);return(await ze.StreamReport.start({configuration:t,stdout:this.context.stdout,includeLogs:!0},async o=>{if(i.detectCycles(o),o.hasErrors())return;let u=await this.packPackages(n,t,o);o.hasErrors()||!this.yes&&!await this.promptConfirm(n)||(await o.startTimerPromise(`Publishing ${n.size} packages`,()=>this.publishPackages(i,u,t,o)),!o.hasErrors()&&await this.runLifecycleScript(n,"postpublish",{report:o}))})).exitCode()}async getTaggedPackages(r){if(!(await j7(`${this.tagVersionPrefix}*.*.*`)).length)throw new Error("No version tag found");let n=await B7("HEAD"),i=new Set(n.filter(o=>_x.default.basename(o)==="package.json").map(o=>_x.default.dirname(o))),a=new Set;return await ai(r,async o=>{i.has(o.relativeCwd)&&!o.manifest.private&&a.add(o)}),a}async packPackages(r,t,n){let i=Ea(4),a=new Map,o=Array.from(r,u=>i(async()=>{let s=await this.packPackage(u,t,n);a.set(u,s)}));return await Promise.all(o),a}async packPackage(r,t,n){if(r.manifest.private)throw new or.UsageError("Private workspaces cannot be published");if(r.manifest.name===null||r.manifest.version===null)throw new or.UsageError("Workspaces must have valid names and versions to be published on an external registry");let i=Da.npmConfigUtils.getPublishRegistry(r.manifest,{configuration:t});await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepublish",{report:n}),await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepublishOnly",{report:n}),await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepack",{report:n});let a=await V7(r,i,this.tag);return{registry:i,body:a}}async publishPackages(r,t,n,i){let a=Ea(4);do{let o=r.getProcessableWorkspaces();if(o.size===0&&r.size>0)throw new Error(`Some packages could not be published: +`)}async function I7(e){await Vr("git add ."),await Vr(`git commit -m ${JSON.stringify(e)}`)}async function M7(e){await Vr(`git tag ${JSON.stringify(e)} -m ${JSON.stringify(e)}`)}var oi=N(E("@yarnpkg/core"));async function ui(e,r){let t=await oi.Configuration.find(r.cwd,r.plugins),[{project:n,workspace:i},a]=await Promise.all([oi.Project.find(t,r.cwd),oi.Cache.find(t,{immutable:!0})]);if(n.topLevelWorkspace!==i)throw new Error(`The "yarn ${e}" command must be run in the root workspace.`);return{configuration:t,project:n,cache:a}}var ga=class extends k7.BaseCommand{constructor(){super(...arguments);this.version=ar.Option.String({required:!1});this.forceUpdates=ar.Option.Array("-f,--force-update")||[];this.yes=ar.Option.Boolean("--yes",!1);this.tagVersionPrefix=ar.Option.String("--tag-version-prefix");this.all=ar.Option.Boolean("--all",!1);this.dry=ar.Option.Boolean("--dry",!1)}async execute(){var x,v,m;let{configuration:r,project:t,cache:n}=await ui("release-tool version",this.context),{lastTagName:i,lastVersion:a}=await P7(),o=t.configuration.get("releaseTool"),u=(x=o==null?void 0:o.get("ignoreChanges"))!=null?x:[],s=(v=o==null?void 0:o.get("implicitDependencies"))!=null?v:new Map,l=await this.getChangedWorkspaces(t,i,u,s,new Set(this.forceUpdates)),d;if(this.version==="patch"||this.version==="minor"||this.version==="major"?d=_a.default.inc(a,this.version):d=(m=this.version)!=null?m:await this.promptVersion(a,{Patch:_a.default.inc(a,"patch"),Minor:_a.default.inc(a,"minor"),Major:_a.default.inc(a,"major")}),this.dry){this.logChanges(d,l);return}if(!this.yes&&!await this.promptConfirm(d,l))return 0;t.topLevelWorkspace.manifest.version=d,this.updateManifests(l,hx(t.topLevelWorkspace,t),d);let h=await jc.StreamReport.start({configuration:r,stdout:this.context.stdout,includeLogs:!0},async b=>{await t.resolveEverything({cache:n,report:b})});if(h.hasErrors())return h.exitCode();await t.persist(),await this.gitCommitAndTag(d)}async getChangedWorkspaces(r,t,n,i,a){let o=n.map(d=>R7.default.filter(`!${d}`,{matchBase:!0,dot:!0})),u=new Set,s=new Map;await ai(r,async d=>{let h=ir(d.manifest);if(s.set(h,d),this.all||a.has(h)){u.add(d);return}o.reduce((v,m)=>v.filter(m),await T7(t,d.cwd)).length>0&&u.add(d)});let l;do{l=!1;for(let[d,h]of i){let x=s.get(d);if(!u.has(x))for(let v of h){let m=s.get(v);if(u.has(m)){l=!0,u.add(x);break}}}}while(l);return Array.from(u).sort(Pc("cwd"))}async promptVersion(r,t){let n=Object.entries(t).map(([a,o])=>({name:`${a} (${o})`,value:o})),{version:i}=await Tc.default.prompt({type:"list",name:"version",message:`Select a new version (currently ${r}):`,choices:n});return i}async promptConfirm(r,t){this.logChanges(r,t);let{confirm:n}=await Tc.default.prompt({type:"confirm",name:"confirm",message:"Are you sure you want to create these versions?",default:!1});return n}logChanges(r,t){console.log(""),console.log("Changes:");for(let{manifest:n}of t)console.log(` - ${ir(n)}: ${n.version} => ${r}`);console.log("")}updateManifests(r,t,n){for(let{manifest:i}of r)i.version=n;for(let{manifest:i}of r)for(let{manifest:a}of t){let{identHash:o}=a.name,u=i.dependencies.get(o),s=/workspace:(?=\^?\d)[\w\^\.\-]+/g;if(u&&s.test(u.range)){let l=u.range.replace(s,`workspace:^${a.version}`),d=jc.structUtils.makeDescriptor(u,l);i.dependencies.set(o,d)}}}async gitCommitAndTag(r){var n;let t=((n=this.tagVersionPrefix)!=null?n:"v")+r;if(!this.yes){let{confirm:i}=await Tc.default.prompt({type:"confirm",name:"confirm",message:`Are you sure you want to commit and tag these changes as "${t}"?`,default:!1});if(!i)return 0}await I7(t),await M7(t)}};ga.paths=[["release-tool","version"]],ga.usage=ar.Command.Usage({description:"Bump the version of the updated packages",details:"\n This command will check which packages have been changed since the last git tag. Then, it update the package.json files and then create a new git tag.\n\n If no version is specified, it will prompt for it.\n\n - The `-f,--force` option allows you to specify a package that must be updated even if git doesn't detect any change. It can be specified multiple times, for multiple packages.\n - If the `--all` option is specified, every package will be updated.\n - The `--yes` option disables the confirmation prompts.\n - If `--tag-version-prefix` is specified, it will be used to build the tag name (default: `v`).\n\n This command also reads two options from the .yarnrc.yml file:\n - `releaseTool.ignoreChanges` allows you to specify an array of file patterns to ignore when computing the updated packages.\n - `releaseTool.implicitDependencies` allows you to specify implicit build-time dependencies between packages. When an implicit dependency package is updated, also the implicit dependents will be released.\n "});var L7=ga;var z7=N(E("@yarnpkg/cli")),or=N(E("clipanion")),_x=N(E("path"));var N7=class{constructor(r){Nc(this,"value");Nc(this,"next");this.value=r}},Ve,Ct,Ot,xx=class{constructor(){Sa(this,Ve,void 0);Sa(this,Ct,void 0);Sa(this,Ot,void 0);this.clear()}enqueue(r){var n;let t=new N7(r);He(this,Ve)?(He(this,Ct).next=t,Oe(this,Ct,t)):(Oe(this,Ve,t),Oe(this,Ct,t)),Oe(this,Ot,(n=+He(this,Ot))+1)}dequeue(){var t;let r=He(this,Ve);if(!!r)return Oe(this,Ve,He(this,Ve).next),Oe(this,Ot,(t=+He(this,Ot))-1),r.value}clear(){Oe(this,Ve,void 0),Oe(this,Ct,void 0),Oe(this,Ot,0)}get size(){return He(this,Ot)}*[Symbol.iterator](){let r=He(this,Ve);for(;r;)yield r.value,r=r.next}};Ve=new WeakMap,Ct=new WeakMap,Ot=new WeakMap;var W7=xx;function Ea(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let r=new W7,t=0,n=()=>{t--,r.size>0&&r.dequeue()()},i=async(u,s,l)=>{t++;let d=(async()=>u(...l))();s(d);try{await d}catch{}n()},a=(u,s,l)=>{r.enqueue(i.bind(void 0,u,s,l)),(async()=>{await Promise.resolve(),t0&&r.dequeue()()})()},o=(u,...s)=>new Promise(l=>{a(u,l,s)});return Object.defineProperties(o,{activeCount:{get:()=>t},pendingCount:{get:()=>r.size},clearQueue:{value:()=>{r.clear()}}}),o}var $7=N(sx());var ze=N(E("@yarnpkg/core")),Da=N(E("@yarnpkg/plugin-npm"));var bx=N(E("@yarnpkg/core"));var U7=class{constructor(){this.dependencies=new Set;this.dependents=new Set}addDependent(r){this.dependents.add(r),r.dependencies.add(this)}unlink(){this.dependencies.forEach(r=>r.dependents.delete(this)),this.dependents.forEach(r=>r.dependencies.delete(this))}*dependenciesIterator(){yield*this.dependencies}*dependentsIterator(){yield*this.dependents}hasDependencies(){return this.dependencies.size>0}},vx=class extends U7{constructor(r){super();this.workspace=r}intersects(r){for(let t of r.workspacesIterator())if(t===this.workspace)return!0;return!1}*workspacesIterator(){yield this.workspace}toString(){return ir(this.workspace.manifest)}deleteWorkspace(r){return this.workspace===r}},mx=class extends Set{constructor(r){super();this.packages=new Map;r.forEach(t=>{let n=new vx(t);this.packages.set(t.locator.identHash,n),this.add(n)}),this.packages.forEach(t=>{t.workspace.manifest.dependencies.forEach((n,i)=>{var a;(a=this.packages.get(i))==null||a.addDependent(t)})})}getProcessableWorkspaces(){let r=new Set;for(let t of this)if(!t.hasDependencies())for(let n of t.workspacesIterator())r.add(n);return r}delete(r){return this.has(r)&&r.unlink(),super.delete(r)}deleteWorkspace(r){let t=this.packages.get(r.locator.identHash);return t?t.deleteWorkspace(r)&&this.delete(t):!1}detectCycles(r){let t=[],n=new WeakSet,i=o=>{for(let u=0;u ")}`);return}n.has(o)||(n.add(o),a(o))};function a(o){if(!(o instanceof vx)){r.reportError(bx.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected: ${o}`);return}t.push(o);for(let u of o.dependenciesIterator())i(u);t.pop()}this.forEach(i)}},Bc=mx;var G7=N(E("@yarnpkg/core")),yx=N(E("@yarnpkg/plugin-pack")),K7=N(E("@yarnpkg/plugin-npm"));async function V7(e,r,t){let n=await yx.packUtils.genPackList(e),i=await yx.packUtils.genPackStream(e,n),a=await G7.miscUtils.bufferStream(i);return K7.npmPublishUtils.makePublishBody(e,a,{access:void 0,tag:t,registry:r})}var wa=class extends z7.BaseCommand{constructor(){super(...arguments);this.yes=or.Option.Boolean("--yes",!1);this.tag=or.Option.String("--tag","latest");this.tagVersionPrefix=or.Option.String("--tag-version-prefix","v")}async execute(){let{project:r,configuration:t}=await ui("release-tool publish",this.context);await r.restoreInstallState();let n=await this.getTaggedPackages(r),i=new Bc(n);return(await ze.StreamReport.start({configuration:t,stdout:this.context.stdout,includeLogs:!0},async o=>{if(i.detectCycles(o),o.hasErrors())return;let u=await this.packPackages(n,t,o);o.hasErrors()||!this.yes&&!await this.promptConfirm(n)||(await o.startTimerPromise(`Publishing ${n.size} packages`,()=>this.publishPackages(i,u,t,o)),!o.hasErrors()&&await this.runLifecycleScript(n,"postpublish",{report:o}))})).exitCode()}async getTaggedPackages(r){if(!(await j7(`${this.tagVersionPrefix}*.*.*`)).length)throw new Error("No version tag found");let n=await B7("HEAD"),i=new Set(n.filter(o=>_x.default.basename(o)==="package.json").map(o=>_x.default.dirname(o))),a=new Set;return await ai(r,async o=>{i.has(o.relativeCwd)&&!o.manifest.private&&a.add(o)}),a}async packPackages(r,t,n){let i=Ea(4),a=new Map,o=Array.from(r,u=>i(async()=>{let s=await this.packPackage(u,t,n);a.set(u,s)}));return await Promise.all(o),a}async packPackage(r,t,n){if(r.manifest.private)throw new or.UsageError("Private workspaces cannot be published");if(r.manifest.name===null||r.manifest.version===null)throw new or.UsageError("Workspaces must have valid names and versions to be published on an external registry");let i=Da.npmConfigUtils.getPublishRegistry(r.manifest,{configuration:t});await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepublish",{report:n}),await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepublishOnly",{report:n}),await ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(r,"prepack",{report:n});let a=await V7(r,i,this.tag);return{registry:i,body:a}}async publishPackages(r,t,n,i){let a=Ea(4);do{let o=r.getProcessableWorkspaces();if(o.size===0&&r.size>0)throw new Error(`Some packages could not be published: `+Array.from(r,s=>` - ${s}`).join(` `));let u=[];for(let s of o){let{body:l,registry:d}=t.get(s);u.push(a(async()=>{try{await this.publishPackage(s,l,d,n,i)}catch(h){throw i.reportError(ze.MessageName.UNNAMED,`Error while publishing ${s.manifest.name}: ${h}`),h}finally{r.deleteWorkspace(s)}}))}await Promise.allSettled(u)}while(r.size>0)}async publishPackage(r,t,n,i,a){let o=r.manifest.name;try{await Da.npmHttpUtils.put(Da.npmHttpUtils.getIdentUrl(o),t,{configuration:i,registry:n,ident:o,jsonResponse:!0}),a.reportInfo(null,`Published ${ir(r.manifest)} ${r.manifest.version}`)}catch(u){if(u.name!=="HTTPError")throw u;{let s=u.response.body&&u.response.body.error?u.response.body.error:`The remote server answered with HTTP ${u.response.statusCode} ${u.response.statusMessage}`;a.reportError(ze.MessageName.NETWORK_ERROR,`[${ir(r.manifest)}] ${s}`)}}}async promptConfirm(r){let t=Array.from(r).sort(Pc("cwd"));console.log(""),console.log("Updated packages:");for(let{manifest:i}of t)console.log(` - ${ir(i)}: ${i.version}`);console.log("");let{confirm:n}=await $7.default.prompt({type:"confirm",name:"confirm",message:"Are you sure you want to create these versions?",default:!1});return n}async runLifecycleScript(r,t,n){let i=Ea(4),a=[];for(let o of r)a.push(i(()=>ze.scriptUtils.maybeExecuteWorkspaceLifecycleScript(o,t,n)));await Promise.all(a)}};wa.paths=[["release-tool","publish"]],wa.usage=or.Command.Usage({description:"Publish on npm the packages updated in the last version",details:"\n This command will first check that the current git HEAD correspond to a version tag (generated with `yarn release-tool version`), then it will upload the packages modified in that commit to the npm registry.\n\n - The `--tag` option allows you to specify how to tag this release on npm (default: `latest`)\n - The `--yes` option disables the confirmation prompt.\n - If `--tag-version-prefix` is specified, it will be used to find the correct tag name (default: `v`).\n "});var H7=wa;var Y7=N(E("@yarnpkg/cli")),Q7=N(E("clipanion"));var J7=N(E("@yarnpkg/core"));var Fa=class extends Y7.BaseCommand{async execute(){let{project:r,configuration:t}=await ui("release-tool check-cycles",this.context);await r.restoreInstallState();let n=await this.getWorkspaces(r),i=new Bc(n);return(await J7.StreamReport.start({configuration:t,stdout:this.context.stdout},async o=>i.detectCycles(o))).exitCode()}async getWorkspaces(r){let t=new Set;return await ai(r,async n=>{n.manifest.private||t.add(n)}),t}};Fa.paths=[["release-tool","check-cycles"]],Fa.usage=Q7.Command.Usage({description:"Assert that there aren't dependency cycles that can cause problems while publishing."});var X7=Fa;var rse={configuration:{releaseTool:{description:"",type:Ca.SettingsType.SHAPE,properties:{ignoreChanges:{description:"",type:Ca.SettingsType.STRING,isArray:!0,default:[]},implicitDependencies:{description:"",type:Ca.SettingsType.MAP,valueDefinition:{description:"",type:Ca.SettingsType.STRING,isArray:!0,default:[]}}}}},commands:[L7,H7,X7]};return tse;})(); diff --git a/Makefile b/Makefile index a763af9591..22bf163076 100644 --- a/Makefile +++ b/Makefile @@ -186,17 +186,15 @@ prepublish: IS_PUBLISH=true $(MAKE) test new-version-checklist: - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @echo "!!!!!! !!!!!!" - @echo "!!!!!! packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src/index.ts" - @echo "!!!!!! replace \"api.assertVersion()\" to the latest published version" - @echo "!!!!!! packages/babel-preset-env/src/available-plugins.ts:" - @echo "!!!!!! replace minVersion[\"bugfix/transform-v8-spread-parameters-in-optional-chaining\"] to the latest published version" - @echo "!!!!!! !!!!!!" - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @exit 1 + # @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + # @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + # @echo "!!!!!! !!!!!!" + # @echo "!!!!!! Write any message that should !!!!!!" + # @echo "!!!!!! block the release here !!!!!!" + # @echo "!!!!!! !!!!!!" + # @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + # @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + # @exit 1 new-version: $(MAKE) new-version-checklist diff --git a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src/index.ts b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src/index.ts index 5144b666bd..cb3179edfa 100644 --- a/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src/index.ts +++ b/packages/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression/src/index.ts @@ -4,7 +4,7 @@ import type { Visitor } from "@babel/traverse"; import { shouldTransform } from "./util"; export default declare(api => { - api.assertVersion("^7.15.0"); + api.assertVersion("^7.16.0"); return { name: "plugin-bugfix-safari-id-destructuring-collision-in-function-expression", diff --git a/packages/babel-preset-env/src/available-plugins.ts b/packages/babel-preset-env/src/available-plugins.ts index 256467fb97..e2b5b55cb8 100644 --- a/packages/babel-preset-env/src/available-plugins.ts +++ b/packages/babel-preset-env/src/available-plugins.ts @@ -150,7 +150,8 @@ export default { }; export const minVersions = { - "bugfix/transform-v8-spread-parameters-in-optional-chaining": "7.15.0", + "bugfix/transform-safari-id-destructuring-collision-in-function-expression": + "7.16.0", "proposal-class-static-block": "7.12.0", "proposal-private-property-in-object": "7.10.0", };