diff --git a/.yarn/releases/yarn-3.4.1.cjs b/.yarn/releases/yarn-3.4.1.cjs index 2bdb752d86091c..dc178d5adda54f 100755 --- a/.yarn/releases/yarn-3.4.1.cjs +++ b/.yarn/releases/yarn-3.4.1.cjs @@ -724,7 +724,7 @@ ${we.map(pe=>`Not found: ${lo(pe)} To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why \` to get more information as to who depends on them. `,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]});var TM=Pe(Xr()),OM=J("util"),Yu=class extends De{constructor(){super(...arguments);this.fields=z.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=z.Rest()}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),{project:i}=await je.find(t,this.context.cwd),n=typeof this.fields<"u"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,s=[],o=!1,a=await Ge.start({configuration:t,includeFooter:!1,json:this.json,stdout:this.context.stdout},async l=>{for(let c of this.packages){let u;if(c==="."){let L=i.topLevelWorkspace;if(!L.manifest.name)throw new be(`Missing ${ee.pretty(t,"name",ee.Type.CODE)} field in ${K.fromPortablePath(x.join(L.cwd,xt.manifest))}`);u=P.makeDescriptor(L.manifest.name,"unknown")}else u=P.parseDescriptor(c);let g=Mt.getIdentUrl(u),f=MM(await Mt.get(g,{configuration:t,ident:u,jsonResponse:!0,customErrorMessage:Mt.customPackageError})),h=Object.keys(f.versions).sort(TM.default.compareLoose),C=f["dist-tags"].latest||h[h.length-1],y=vt.validRange(u.range);if(y){let L=TM.default.maxSatisfying(h,y);L!==null?C=L:(l.reportWarning(0,`Unmet range ${P.prettyRange(t,u.range)}; falling back to the latest version`),o=!0)}else Object.prototype.hasOwnProperty.call(f["dist-tags"],u.range)?C=f["dist-tags"][u.range]:u.range!=="unknown"&&(l.reportWarning(0,`Unknown tag ${P.prettyRange(t,u.range)}; falling back to the latest version`),o=!0);let B=f.versions[C],v={...f,...B,version:C,versions:h},D;if(n!==null){D={};for(let L of n){let H=v[L];if(typeof H<"u")D[L]=H;else{l.reportWarning(1,`The ${ee.pretty(t,L,ee.Type.CODE)} field doesn't exist inside ${P.prettyIdent(t,u)}'s information`),o=!0;continue}}}else this.json||(delete v.dist,delete v.readme,delete v.users),D=v;l.reportJson(D),this.json||s.push(D)}});OM.inspect.styles.name="cyan";for(let l of s)(l!==s[0]||o)&&this.context.stdout.write(` `),this.context.stdout.write(`${(0,OM.inspect)(l,{depth:1/0,colors:!0,compact:!1})} -`);return a.exitCode()}};Yu.paths=[["npm","info"]],Yu.usage=ve.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});function MM(r){if(Array.isArray(r)){let e=[];for(let t of r)t=MM(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=MM(r[t]);i&&(e[t]=i)}return e}else return r||null}var sue=Pe(Pm()),ju=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ge.start({configuration:t,stdout:this.context.stdout,includeFooter:!1},async s=>{let o=await zVe({configuration:t,registry:i,report:s,stdin:this.context.stdin,stdout:this.context.stdout}),a=`/-/user/org.couchdb.user:${encodeURIComponent(o.name)}`,l=await Mt.put(a,o,{attemptedAs:o.name,configuration:t,registry:i,jsonResponse:!0,authType:Mt.AuthType.NO_AUTH});return await WVe(i,l.token,{configuration:t,scope:this.scope}),s.reportInfo(0,"Successfully logged in")})).exitCode()}};ju.paths=[["npm","login"]],ju.usage=ve.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});async function Qb({scope:r,publish:e,configuration:t,cwd:i}){return r&&e?or.getScopeRegistry(r,{configuration:t,type:or.RegistryType.PUBLISH_REGISTRY}):r?or.getScopeRegistry(r,{configuration:t}):e?or.getPublishRegistry((await Ph(t,i)).manifest,{configuration:t}):or.getDefaultRegistry({configuration:t})}async function WVe(r,e,{configuration:t,scope:i}){let n=o=>a=>{let l=Ie.isIndexableObject(a)?a:{},c=l[o],u=Ie.isIndexableObject(c)?c:{};return{...l,[o]:{...u,npmAuthToken:e}}},s=i?{npmScopes:n(i)}:{npmRegistries:n(r)};return await ye.updateHomeConfiguration(s)}async function zVe({configuration:r,registry:e,report:t,stdin:i,stdout:n}){t.reportInfo(0,`Logging in to ${ee.pretty(r,e,ee.Type.URL)}`);let s=!1;if(e.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(t.reportInfo(0,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),s=!0),t.reportSeparator(),process.env.YARN_IS_TEST_ENV)return{name:process.env.YARN_INJECT_NPM_USER||"",password:process.env.YARN_INJECT_NPM_PASSWORD||""};let{username:o,password:a}=await(0,sue.prompt)([{type:"input",name:"username",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:i,stdout:n},{type:"password",name:"password",message:s?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:i,stdout:n}]);return t.reportSeparator(),{name:o,password:a}}var ap=new Set(["npmAuthIdent","npmAuthToken"]),qu=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=z.Boolean("-A,--all",!1,{description:"Logout of all registries"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i=async()=>{var c;let s=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),o=await ye.find(this.context.cwd,this.context.plugins),a=P.makeIdent((c=this.scope)!=null?c:null,"pkg");return!or.getAuthConfiguration(s,{configuration:o,ident:a}).get("npmAuthToken")};return(await Ge.start({configuration:t,stdout:this.context.stdout},async s=>{if(this.all&&(await XVe(),s.reportInfo(0,"Successfully logged out from everything")),this.scope){await oue("npmScopes",this.scope),await i()?s.reportInfo(0,`Successfully logged out from ${this.scope}`):s.reportWarning(0,"Scope authentication settings removed, but some other ones settings still apply to it");return}let o=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish});await oue("npmRegistries",o),await i()?s.reportInfo(0,`Successfully logged out from ${o}`):s.reportWarning(0,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};qu.paths=[["npm","logout"]],qu.usage=ve.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --scope my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]});function VVe(r,e){let t=r[e];if(!Ie.isIndexableObject(t))return!1;let i=new Set(Object.keys(t));if([...ap].every(s=>!i.has(s)))return!1;for(let s of ap)i.delete(s);if(i.size===0)return r[e]=void 0,!0;let n={...t};for(let s of ap)delete n[s];return r[e]=n,!0}async function XVe(){let r=e=>{let t=!1,i=Ie.isIndexableObject(e)?{...e}:{};i.npmAuthToken&&(delete i.npmAuthToken,t=!0);for(let n of Object.keys(i))VVe(i,n)&&(t=!0);if(Object.keys(i).length!==0)return t?i:e};return await ye.updateHomeConfiguration({npmRegistries:r,npmScopes:r})}async function oue(r,e){return await ye.updateHomeConfiguration({[r]:t=>{let i=Ie.isIndexableObject(t)?t:{};if(!Object.prototype.hasOwnProperty.call(i,e))return t;let n=i[e],s=Ie.isIndexableObject(n)?n:{},o=new Set(Object.keys(s));if([...ap].every(l=>!o.has(l)))return t;for(let l of ap)o.delete(l);if(o.size===0)return Object.keys(i).length===1?void 0:{...i,[e]:void 0};let a={};for(let l of ap)a[l]=void 0;return{...i,[e]:{...s,...a}}}})}var Ju=class extends De{constructor(){super(...arguments);this.access=z.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=z.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=z.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"});this.otp=z.String("--otp",{description:"The OTP token to use with the command"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await je.find(t,this.context.cwd);if(!n)throw new ct(i.cwd,this.context.cwd);if(n.manifest.private)throw new be("Private workspaces cannot be published");if(n.manifest.name===null||n.manifest.version===null)throw new be("Workspaces must have valid names and versions to be published on an external registry");await i.restoreInstallState();let s=n.manifest.name,o=n.manifest.version,a=or.getPublishRegistry(n.manifest,{configuration:t});return(await Ge.start({configuration:t,stdout:this.context.stdout},async c=>{var u,g;if(this.tolerateRepublish)try{let f=await Mt.get(Mt.getIdentUrl(s),{configuration:t,registry:a,ident:s,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(f,"versions"))throw new at(15,'Registry returned invalid data for - missing "versions" field');if(Object.prototype.hasOwnProperty.call(f.versions,o)){c.reportWarning(0,`Registry already knows about version ${o}; skipping.`);return}}catch(f){if(((g=(u=f.originalError)==null?void 0:u.response)==null?void 0:g.statusCode)!==404)throw f}await Jt.maybeExecuteWorkspaceLifecycleScript(n,"prepublish",{report:c}),await ia.prepareForPack(n,{report:c},async()=>{let f=await ia.genPackList(n);for(let B of f)c.reportInfo(null,B);let h=await ia.genPackStream(n,f),p=await Ie.bufferStream(h),C=await op.getGitHead(n.cwd),y=await op.makePublishBody(n,p,{access:this.access,tag:this.tag,registry:a,gitHead:C});await Mt.put(Mt.getIdentUrl(s),y,{configuration:t,registry:a,ident:s,otp:this.otp,jsonResponse:!0})}),c.reportInfo(0,"Package archive published")})).exitCode()}};Ju.paths=[["npm","publish"]],Ju.usage=ve.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overriden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]});var aue=Pe(Xr());var Wu=class extends De{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=z.String({required:!1})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await je.find(t,this.context.cwd),s;if(typeof this.package<"u")s=P.parseIdent(this.package);else{if(!n)throw new ct(i.cwd,this.context.cwd);if(!n.manifest.name)throw new be(`Missing 'name' field in ${K.fromPortablePath(x.join(n.cwd,xt.manifest))}`);s=n.manifest.name}let o=await IE(s,t),l={children:Ie.sortMap(Object.entries(o),([c])=>c).map(([c,u])=>({value:ee.tuple(ee.Type.RESOLUTION,{descriptor:P.makeDescriptor(s,c),locator:P.makeLocator(s,u)})}))};return Vn.emitTree(l,{configuration:t,json:this.json,stdout:this.context.stdout})}};Wu.paths=[["npm","tag","list"]],Wu.usage=ve.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` +`);return a.exitCode()}};Yu.paths=[["npm","info"]],Yu.usage=ve.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]});function MM(r){if(Array.isArray(r)){let e=[];for(let t of r)t=MM(t),t&&e.push(t);return e}else if(typeof r=="object"&&r!==null){let e={};for(let t of Object.keys(r)){if(t.startsWith("_"))continue;let i=MM(r[t]);i&&(e[t]=i)}return e}else return r||null}var sue=Pe(Pm()),ju=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--filter",{description:"Login to the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Login to the publish registry"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ge.start({configuration:t,stdout:this.context.stdout,includeFooter:!1},async s=>{let o=await zVe({configuration:t,registry:i,report:s,stdin:this.context.stdin,stdout:this.context.stdout}),a=`/-/user/org.couchdb.user:${encodeURIComponent(o.name)}`,l=await Mt.put(a,o,{attemptedAs:o.name,configuration:t,registry:i,jsonResponse:!0,authType:Mt.AuthType.NO_AUTH});return await WVe(i,l.token,{configuration:t,scope:this.scope}),s.reportInfo(0,"Successfully logged in")})).exitCode()}};ju.paths=[["npm","login"]],ju.usage=ve.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--filter` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --filter my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]});async function Qb({scope:r,publish:e,configuration:t,cwd:i}){return r&&e?or.getScopeRegistry(r,{configuration:t,type:or.RegistryType.PUBLISH_REGISTRY}):r?or.getScopeRegistry(r,{configuration:t}):e?or.getPublishRegistry((await Ph(t,i)).manifest,{configuration:t}):or.getDefaultRegistry({configuration:t})}async function WVe(r,e,{configuration:t,scope:i}){let n=o=>a=>{let l=Ie.isIndexableObject(a)?a:{},c=l[o],u=Ie.isIndexableObject(c)?c:{};return{...l,[o]:{...u,npmAuthToken:e}}},s=i?{npmScopes:n(i)}:{npmRegistries:n(r)};return await ye.updateHomeConfiguration(s)}async function zVe({configuration:r,registry:e,report:t,stdin:i,stdout:n}){t.reportInfo(0,`Logging in to ${ee.pretty(r,e,ee.Type.URL)}`);let s=!1;if(e.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(t.reportInfo(0,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),s=!0),t.reportSeparator(),process.env.YARN_IS_TEST_ENV)return{name:process.env.YARN_INJECT_NPM_USER||"",password:process.env.YARN_INJECT_NPM_PASSWORD||""};let{username:o,password:a}=await(0,sue.prompt)([{type:"input",name:"username",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:i,stdout:n},{type:"password",name:"password",message:s?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:i,stdout:n}]);return t.reportSeparator(),{name:o,password:a}}var ap=new Set(["npmAuthIdent","npmAuthToken"]),qu=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--filter",{description:"Logout of the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=z.Boolean("-A,--all",!1,{description:"Logout of all registries"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i=async()=>{var c;let s=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),o=await ye.find(this.context.cwd,this.context.plugins),a=P.makeIdent((c=this.scope)!=null?c:null,"pkg");return!or.getAuthConfiguration(s,{configuration:o,ident:a}).get("npmAuthToken")};return(await Ge.start({configuration:t,stdout:this.context.stdout},async s=>{if(this.all&&(await XVe(),s.reportInfo(0,"Successfully logged out from everything")),this.scope){await oue("npmScopes",this.scope),await i()?s.reportInfo(0,`Successfully logged out from ${this.scope}`):s.reportWarning(0,"Scope authentication settings removed, but some other ones settings still apply to it");return}let o=await Qb({configuration:t,cwd:this.context.cwd,publish:this.publish});await oue("npmRegistries",o),await i()?s.reportInfo(0,`Successfully logged out from ${o}`):s.reportWarning(0,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};qu.paths=[["npm","logout"]],qu.usage=ve.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--filter` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --filter my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]});function VVe(r,e){let t=r[e];if(!Ie.isIndexableObject(t))return!1;let i=new Set(Object.keys(t));if([...ap].every(s=>!i.has(s)))return!1;for(let s of ap)i.delete(s);if(i.size===0)return r[e]=void 0,!0;let n={...t};for(let s of ap)delete n[s];return r[e]=n,!0}async function XVe(){let r=e=>{let t=!1,i=Ie.isIndexableObject(e)?{...e}:{};i.npmAuthToken&&(delete i.npmAuthToken,t=!0);for(let n of Object.keys(i))VVe(i,n)&&(t=!0);if(Object.keys(i).length!==0)return t?i:e};return await ye.updateHomeConfiguration({npmRegistries:r,npmScopes:r})}async function oue(r,e){return await ye.updateHomeConfiguration({[r]:t=>{let i=Ie.isIndexableObject(t)?t:{};if(!Object.prototype.hasOwnProperty.call(i,e))return t;let n=i[e],s=Ie.isIndexableObject(n)?n:{},o=new Set(Object.keys(s));if([...ap].every(l=>!o.has(l)))return t;for(let l of ap)o.delete(l);if(o.size===0)return Object.keys(i).length===1?void 0:{...i,[e]:void 0};let a={};for(let l of ap)a[l]=void 0;return{...i,[e]:{...s,...a}}}})}var Ju=class extends De{constructor(){super(...arguments);this.access=z.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=z.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=z.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"});this.otp=z.String("--otp",{description:"The OTP token to use with the command"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await je.find(t,this.context.cwd);if(!n)throw new ct(i.cwd,this.context.cwd);if(n.manifest.private)throw new be("Private workspaces cannot be published");if(n.manifest.name===null||n.manifest.version===null)throw new be("Workspaces must have valid names and versions to be published on an external registry");await i.restoreInstallState();let s=n.manifest.name,o=n.manifest.version,a=or.getPublishRegistry(n.manifest,{configuration:t});return(await Ge.start({configuration:t,stdout:this.context.stdout},async c=>{var u,g;if(this.tolerateRepublish)try{let f=await Mt.get(Mt.getIdentUrl(s),{configuration:t,registry:a,ident:s,jsonResponse:!0});if(!Object.prototype.hasOwnProperty.call(f,"versions"))throw new at(15,'Registry returned invalid data for - missing "versions" field');if(Object.prototype.hasOwnProperty.call(f.versions,o)){c.reportWarning(0,`Registry already knows about version ${o}; skipping.`);return}}catch(f){if(((g=(u=f.originalError)==null?void 0:u.response)==null?void 0:g.statusCode)!==404)throw f}await Jt.maybeExecuteWorkspaceLifecycleScript(n,"prepublish",{report:c}),await ia.prepareForPack(n,{report:c},async()=>{let f=await ia.genPackList(n);for(let B of f)c.reportInfo(null,B);let h=await ia.genPackStream(n,f),p=await Ie.bufferStream(h),C=await op.getGitHead(n.cwd),y=await op.makePublishBody(n,p,{access:this.access,tag:this.tag,registry:a,gitHead:C});await Mt.put(Mt.getIdentUrl(s),y,{configuration:t,registry:a,ident:s,otp:this.otp,jsonResponse:!0})}),c.reportInfo(0,"Package archive published")})).exitCode()}};Ju.paths=[["npm","publish"]],Ju.usage=ve.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overriden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]});var aue=Pe(Xr());var Wu=class extends De{constructor(){super(...arguments);this.json=z.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=z.String({required:!1})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await je.find(t,this.context.cwd),s;if(typeof this.package<"u")s=P.parseIdent(this.package);else{if(!n)throw new ct(i.cwd,this.context.cwd);if(!n.manifest.name)throw new be(`Missing 'name' field in ${K.fromPortablePath(x.join(n.cwd,xt.manifest))}`);s=n.manifest.name}let o=await IE(s,t),l={children:Ie.sortMap(Object.entries(o),([c])=>c).map(([c,u])=>({value:ee.tuple(ee.Type.RESOLUTION,{descriptor:P.makeDescriptor(s,c),locator:P.makeLocator(s,u)})}))};return Vn.emitTree(l,{configuration:t,json:this.json,stdout:this.context.stdout})}};Wu.paths=[["npm","tag","list"]],Wu.usage=ve.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` This command will list all tags of a package from the npm registry. If the package is not specified, Yarn will default to the current workspace. @@ -732,7 +732,7 @@ ${we.map(pe=>`Not found: ${lo(pe)} This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten. `,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]});var Vu=class extends De{constructor(){super(...arguments);this.package=z.String();this.tag=z.String()}async execute(){if(this.tag==="latest")throw new be("The 'latest' tag cannot be removed.");let t=await ye.find(this.context.cwd,this.context.plugins),{project:i,workspace:n}=await je.find(t,this.context.cwd);if(!n)throw new ct(i.cwd,this.context.cwd);let s=P.parseIdent(this.package),o=or.getPublishRegistry(n.manifest,{configuration:t}),a=ee.pretty(t,this.tag,ee.Type.CODE),l=ee.pretty(t,s,ee.Type.IDENT),c=await IE(s,t);if(!Object.prototype.hasOwnProperty.call(c,this.tag))throw new be(`${a} is not a tag of package ${l}`);return(await Ge.start({configuration:t,stdout:this.context.stdout},async g=>{let f=`/-/package${Mt.getIdentUrl(s)}/dist-tags/${encodeURIComponent(this.tag)}`;await Mt.del(f,{configuration:t,registry:o,ident:s,jsonResponse:!0}),g.reportInfo(0,`Tag ${a} removed from package ${l}`)})).exitCode()}};Vu.paths=[["npm","tag","remove"]],Vu.usage=ve.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:` This command will remove a tag from a package from the npm registry. - `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Xu=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i;return this.scope&&this.publish?i=or.getScopeRegistry(this.scope,{configuration:t,type:or.RegistryType.PUBLISH_REGISTRY}):this.scope?i=or.getScopeRegistry(this.scope,{configuration:t}):this.publish?i=or.getPublishRegistry((await Ph(t,this.context.cwd)).manifest,{configuration:t}):i=or.getDefaultRegistry({configuration:t}),(await Ge.start({configuration:t,stdout:this.context.stdout},async s=>{var a,l;let o;try{o=await Mt.get("/-/whoami",{configuration:t,registry:i,authType:Mt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.makeIdent(this.scope,""):void 0})}catch(c){if(((a=c.response)==null?void 0:a.statusCode)===401||((l=c.response)==null?void 0:l.statusCode)===403){s.reportError(41,"Authentication failed - your credentials may have expired");return}else throw c}s.reportInfo(0,o.username)})).exitCode()}};Xu.paths=[["npm","whoami"]],Xu.usage=ve.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]});var _Ve={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[Gu,Yu,ju,qu,Ju,zu,Wu,Vu,Xu]},ZVe=_Ve;var zM={};ut(zM,{default:()=>h6e,patchUtils:()=>_u});var _u={};ut(_u,{applyPatchFile:()=>Sb,diffFolders:()=>JM,ensureUnpatchedDescriptor:()=>HM,extractPackageToDisk:()=>qM,extractPatchFlags:()=>hue,isParentRequired:()=>jM,loadPatchFiles:()=>QE,makeDescriptor:()=>GM,makeLocator:()=>YM,makePatchHash:()=>WM,parseDescriptor:()=>wE,parseLocator:()=>BE,parsePatchFile:()=>yE});var $Ve=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Ap(r){return x.relative(Oe.root,x.resolve(Oe.root,K.toPortablePath(r)))}function e6e(r){let e=r.trim().match($Ve);if(!e)throw new Error(`Bad header line: '${r}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var t6e=420,r6e=493;var Aue=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),i6e=r=>({header:e6e(r),parts:[]}),n6e={["@"]:"header",["-"]:"deletion",["+"]:"insertion",[" "]:"context",["\\"]:"pragma",undefined:"context"};function s6e(r){let e=[],t=Aue(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=Aue()}for(let l=0;l0?"patch":"mode change",v=null;switch(B){case"rename":{if(!u||!g)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:i,fromPath:Ap(u),toPath:Ap(g)}),v=g}break;case"file deletion":{let D=n||p;if(!D)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:i,hunk:y&&y[0]||null,path:Ap(D),mode:bb(l),hash:f})}break;case"file creation":{let D=s||C;if(!D)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:i,hunk:y&&y[0]||null,path:Ap(D),mode:bb(c),hash:h})}break;case"patch":case"mode change":v=C||s;break;default:Ie.assertNever(B);break}v&&o&&a&&o!==a&&e.push({type:"mode change",semverExclusivity:i,path:Ap(v),oldMode:bb(o),newMode:bb(a)}),v&&y&&y.length&&e.push({type:"patch",semverExclusivity:i,path:Ap(v),hunks:y,beforeHash:f,afterHash:h})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function bb(r){let e=parseInt(r,8)&511;if(e!==t6e&&e!==r6e)throw new Error(`Unexpected file mode string: ${r}`);return e}function yE(r){let e=r.split(/\n/g);return e[e.length-1]===""&&e.pop(),o6e(s6e(e))}function a6e(r){let e=0,t=0;for(let{type:i,lines:n}of r.parts)switch(i){case"context":t+=n.length,e+=n.length;break;case"deletion":e+=n.length;break;case"insertion":t+=n.length;break;default:Ie.assertNever(i);break}if(e!==r.header.original.length||t!==r.header.patched.length){let i=n=>n<0?n:`+${n}`;throw new Error(`hunk header integrity check failed (expected @@ ${i(r.header.original.length)} ${i(r.header.patched.length)} @@, got @@ ${i(e)} ${i(t)} @@)`)}}var lp=class extends Error{constructor(t,i){super(`Cannot apply hunk #${t+1}`);this.hunk=i}};async function cp(r,e,t){let i=await r.lstatPromise(e),n=await t();if(typeof n<"u"&&(e=n),r.lutimesPromise)await r.lutimesPromise(e,i.atime,i.mtime);else if(!i.isSymbolicLink())await r.utimesPromise(e,i.atime,i.mtime);else throw new Error("Cannot preserve the time values of a symlink")}async function Sb(r,{baseFs:e=new $t,dryRun:t=!1,version:i=null}={}){for(let n of r)if(!(n.semverExclusivity!==null&&i!==null&&!vt.satisfiesWithPrereleases(i,n.semverExclusivity)))switch(n.type){case"file deletion":if(t){if(!e.existsSync(n.path))throw new Error(`Trying to delete a file that doesn't exist: ${n.path}`)}else await cp(e,x.dirname(n.path),async()=>{await e.unlinkPromise(n.path)});break;case"rename":if(t){if(!e.existsSync(n.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${n.fromPath}`)}else await cp(e,x.dirname(n.fromPath),async()=>{await cp(e,x.dirname(n.toPath),async()=>{await cp(e,n.fromPath,async()=>(await e.movePromise(n.fromPath,n.toPath),n.toPath))})});break;case"file creation":if(t){if(e.existsSync(n.path))throw new Error(`Trying to create a file that already exists: ${n.path}`)}else{let s=n.hunk?n.hunk.parts[0].lines.join(` + `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]});var Xu=class extends De{constructor(){super(...arguments);this.scope=z.String("-s,--filter",{description:"Print username for the registry configured for a given scope"});this.publish=z.Boolean("--publish",!1,{description:"Print username for the publish registry"})}async execute(){let t=await ye.find(this.context.cwd,this.context.plugins),i;return this.scope&&this.publish?i=or.getScopeRegistry(this.scope,{configuration:t,type:or.RegistryType.PUBLISH_REGISTRY}):this.scope?i=or.getScopeRegistry(this.scope,{configuration:t}):this.publish?i=or.getPublishRegistry((await Ph(t,this.context.cwd)).manifest,{configuration:t}):i=or.getDefaultRegistry({configuration:t}),(await Ge.start({configuration:t,stdout:this.context.stdout},async s=>{var a,l;let o;try{o=await Mt.get("/-/whoami",{configuration:t,registry:i,authType:Mt.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?P.makeIdent(this.scope,""):void 0})}catch(c){if(((a=c.response)==null?void 0:a.statusCode)===401||((l=c.response)==null?void 0:l.statusCode)===403){s.reportError(41,"Authentication failed - your credentials may have expired");return}else throw c}s.reportInfo(0,o.username)})).exitCode()}};Xu.paths=[["npm","whoami"]],Xu.usage=ve.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--filter`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --filter company"]]});var _Ve={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[Gu,Yu,ju,qu,Ju,zu,Wu,Vu,Xu]},ZVe=_Ve;var zM={};ut(zM,{default:()=>h6e,patchUtils:()=>_u});var _u={};ut(_u,{applyPatchFile:()=>Sb,diffFolders:()=>JM,ensureUnpatchedDescriptor:()=>HM,extractPackageToDisk:()=>qM,extractPatchFlags:()=>hue,isParentRequired:()=>jM,loadPatchFiles:()=>QE,makeDescriptor:()=>GM,makeLocator:()=>YM,makePatchHash:()=>WM,parseDescriptor:()=>wE,parseLocator:()=>BE,parsePatchFile:()=>yE});var $Ve=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function Ap(r){return x.relative(Oe.root,x.resolve(Oe.root,K.toPortablePath(r)))}function e6e(r){let e=r.trim().match($Ve);if(!e)throw new Error(`Bad header line: '${r}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var t6e=420,r6e=493;var Aue=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),i6e=r=>({header:e6e(r),parts:[]}),n6e={["@"]:"header",["-"]:"deletion",["+"]:"insertion",[" "]:"context",["\\"]:"pragma",undefined:"context"};function s6e(r){let e=[],t=Aue(),i="parsing header",n=null,s=null;function o(){n&&(s&&(n.parts.push(s),s=null),t.hunks.push(n),n=null)}function a(){o(),e.push(t),t=Aue()}for(let l=0;l0?"patch":"mode change",v=null;switch(B){case"rename":{if(!u||!g)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:i,fromPath:Ap(u),toPath:Ap(g)}),v=g}break;case"file deletion":{let D=n||p;if(!D)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:i,hunk:y&&y[0]||null,path:Ap(D),mode:bb(l),hash:f})}break;case"file creation":{let D=s||C;if(!D)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:i,hunk:y&&y[0]||null,path:Ap(D),mode:bb(c),hash:h})}break;case"patch":case"mode change":v=C||s;break;default:Ie.assertNever(B);break}v&&o&&a&&o!==a&&e.push({type:"mode change",semverExclusivity:i,path:Ap(v),oldMode:bb(o),newMode:bb(a)}),v&&y&&y.length&&e.push({type:"patch",semverExclusivity:i,path:Ap(v),hunks:y,beforeHash:f,afterHash:h})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function bb(r){let e=parseInt(r,8)&511;if(e!==t6e&&e!==r6e)throw new Error(`Unexpected file mode string: ${r}`);return e}function yE(r){let e=r.split(/\n/g);return e[e.length-1]===""&&e.pop(),o6e(s6e(e))}function a6e(r){let e=0,t=0;for(let{type:i,lines:n}of r.parts)switch(i){case"context":t+=n.length,e+=n.length;break;case"deletion":e+=n.length;break;case"insertion":t+=n.length;break;default:Ie.assertNever(i);break}if(e!==r.header.original.length||t!==r.header.patched.length){let i=n=>n<0?n:`+${n}`;throw new Error(`hunk header integrity check failed (expected @@ ${i(r.header.original.length)} ${i(r.header.patched.length)} @@, got @@ ${i(e)} ${i(t)} @@)`)}}var lp=class extends Error{constructor(t,i){super(`Cannot apply hunk #${t+1}`);this.hunk=i}};async function cp(r,e,t){let i=await r.lstatPromise(e),n=await t();if(typeof n<"u"&&(e=n),r.lutimesPromise)await r.lutimesPromise(e,i.atime,i.mtime);else if(!i.isSymbolicLink())await r.utimesPromise(e,i.atime,i.mtime);else throw new Error("Cannot preserve the time values of a symlink")}async function Sb(r,{baseFs:e=new $t,dryRun:t=!1,version:i=null}={}){for(let n of r)if(!(n.semverExclusivity!==null&&i!==null&&!vt.satisfiesWithPrereleases(i,n.semverExclusivity)))switch(n.type){case"file deletion":if(t){if(!e.existsSync(n.path))throw new Error(`Trying to delete a file that doesn't exist: ${n.path}`)}else await cp(e,x.dirname(n.path),async()=>{await e.unlinkPromise(n.path)});break;case"rename":if(t){if(!e.existsSync(n.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${n.fromPath}`)}else await cp(e,x.dirname(n.fromPath),async()=>{await cp(e,x.dirname(n.toPath),async()=>{await cp(e,n.fromPath,async()=>(await e.movePromise(n.fromPath,n.toPath),n.toPath))})});break;case"file creation":if(t){if(e.existsSync(n.path))throw new Error(`Trying to create a file that already exists: ${n.path}`)}else{let s=n.hunk?n.hunk.parts[0].lines.join(` `)+(n.hunk.parts[0].noNewlineAtEndOfFile?"":` `):"";await e.mkdirpPromise(x.dirname(n.path),{chmod:493,utimes:[xr.SAFE_TIME,xr.SAFE_TIME]}),await e.writeFilePromise(n.path,s,{mode:n.mode}),await e.utimesPromise(n.path,xr.SAFE_TIME,xr.SAFE_TIME)}break;case"patch":await cp(e,n.path,async()=>{await c6e(n,{baseFs:e,dryRun:t})});break;case"mode change":{let o=(await e.statPromise(n.path)).mode;if(lue(n.newMode)!==lue(o))continue;await cp(e,n.path,async()=>{await e.chmodPromise(n.path,n.newMode)})}break;default:Ie.assertNever(n);break}}function lue(r){return(r&64)>0}function cue(r){return r.replace(/\s+$/,"")}function l6e(r,e){return cue(r)===cue(e)}async function c6e({hunks:r,path:e},{baseFs:t,dryRun:i=!1}){let n=await t.statSync(e).mode,o=(await t.readFileSync(e,"utf8")).split(/\n/),a=[],l=0,c=0;for(let g of r){let f=Math.max(c,g.header.patched.start+l),h=Math.max(0,f-c),p=Math.max(0,o.length-f-g.header.original.length),C=Math.max(h,p),y=0,B=0,v=null;for(;y<=C;){if(y<=h&&(B=f-y,v=uue(g,o,B),v!==null)){y=-y;break}if(y<=p&&(B=f+y,v=uue(g,o,B),v!==null))break;y+=1}if(v===null)throw new lp(r.indexOf(g),g);a.push(v),l+=y,c=B+g.header.original.length}if(i)return;let u=0;for(let g of a)for(let f of g)switch(f.type){case"splice":{let h=f.index+u;o.splice(h,f.numToDelete,...f.linesToInsert),u+=f.linesToInsert.length-f.numToDelete}break;case"pop":o.pop();break;case"push":o.push(f.line);break;default:Ie.assertNever(f);break}await t.writeFilePromise(e,o.join(` `),{mode:n})}function uue(r,e,t){let i=[];for(let n of r.parts)switch(n.type){case"context":case"deletion":{for(let s of n.lines){let o=e[t];if(o==null||!l6e(o,s))return null;t+=1}n.type==="deletion"&&(i.push({type:"splice",index:t-n.lines.length,numToDelete:n.lines.length,linesToInsert:[]}),n.noNewlineAtEndOfFile&&i.push({type:"push",line:""}))}break;case"insertion":i.push({type:"splice",index:t,numToDelete:0,linesToInsert:n.lines}),n.noNewlineAtEndOfFile&&i.push({type:"pop"});break;default:Ie.assertNever(n.type);break}return i}var g6e=/^builtin<([^>]+)>$/;function UM(r,e){let{source:t,selector:i,params:n}=P.parseRange(r);if(t===null)throw new Error("Patch locators must explicitly define their source");let s=i?i.split(/&/).map(c=>K.toPortablePath(c)):[],o=n&&typeof n.locator=="string"?P.parseLocator(n.locator):null,a=n&&typeof n.version=="string"?n.version:null,l=e(t);return{parentLocator:o,sourceItem:l,patchPaths:s,sourceVersion:a}}function wE(r){let{sourceItem:e,...t}=UM(r.range,P.parseDescriptor);return{...t,sourceDescriptor:e}}function BE(r){let{sourceItem:e,...t}=UM(r.reference,P.parseLocator);return{...t,sourceLocator:e}}function HM(r){if(!r.range.startsWith("patch:"))return r;let{sourceItem:e}=UM(r.range,P.parseDescriptor);return e}function gue({parentLocator:r,sourceItem:e,patchPaths:t,sourceVersion:i,patchHash:n},s){let o=r!==null?{locator:P.stringifyLocator(r)}:{},a=typeof i<"u"?{version:i}:{},l=typeof n<"u"?{hash:n}:{};return P.makeRange({protocol:"patch:",source:s(e),selector:t.join("&"),params:{...a,...l,...o}})}function GM(r,{parentLocator:e,sourceDescriptor:t,patchPaths:i}){return P.makeDescriptor(r,gue({parentLocator:e,sourceItem:t,patchPaths:i},P.stringifyDescriptor))}function YM(r,{parentLocator:e,sourcePackage:t,patchPaths:i,patchHash:n}){return P.makeLocator(r,gue({parentLocator:e,sourceItem:t,sourceVersion:t.version,patchPaths:i,patchHash:n},P.stringifyLocator))}function fue({onAbsolute:r,onRelative:e,onBuiltin:t},i){i.startsWith("~")&&(i=i.slice(1));let s=i.match(g6e);return s!==null?t(s[1]):x.isAbsolute(i)?r(i):e(i)}function hue(r){let e=r.startsWith("~");return e&&(r=r.slice(1)),{optional:e}}function jM(r){return fue({onAbsolute:()=>!1,onRelative:()=>!0,onBuiltin:()=>!1},r)}async function QE(r,e,t){let i=r!==null?await t.fetcher.fetch(r,t):null,n=i&&i.localPath?{packageFs:new jt(Oe.root),prefixPath:x.relative(Oe.root,i.localPath)}:i;i&&i!==n&&i.releaseFs&&i.releaseFs();let s=await Ie.releaseAfterUseAsync(async()=>await Promise.all(e.map(async o=>{let a=hue(o),l=await fue({onAbsolute:async()=>await M.readFilePromise(o,"utf8"),onRelative:async()=>{if(n===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await n.packageFs.readFilePromise(x.join(n.prefixPath,o),"utf8")},onBuiltin:async c=>await t.project.configuration.firstHook(u=>u.getBuiltinPatch,t.project,c)},o);return{...a,source:l}})));for(let o of s)typeof o.source=="string"&&(o.source=o.source.replace(/\r\n?/g,` diff --git a/apps/api/v1/README.md b/apps/api/v1/README.md index 27828f8caee494..071d58879d0b1b 100644 --- a/apps/api/v1/README.md +++ b/apps/api/v1/README.md @@ -199,7 +199,7 @@ There's some settings that you'll need to setup. Under Vercel > Your API Project > Settings In General > Build & Development Settings -BUILD COMMAND: `yarn turbo run build --scope=@calcom/api --include-dependencies --no-deps` +BUILD COMMAND: `yarn turbo run build --filter=@calcom/api --no-deps` OUTPUT DIRECTORY: `apps/api/.next` In Git > Ignored Build Step diff --git a/docs/self-hosting/deployments/vercel.mdx b/docs/self-hosting/deployments/vercel.mdx index 02c5ec438acc2b..67e03065b2049e 100644 --- a/docs/self-hosting/deployments/vercel.mdx +++ b/docs/self-hosting/deployments/vercel.mdx @@ -76,7 +76,7 @@ Sometimes, yarn install might fail during deployment on Vercel, in which case, y Override to: ``` - cd ../.. && yarn build --include-dependencies --no-deps + cd ../.. && yarn build --no-deps ``` diff --git a/infra/docker/api/Dockerfile b/infra/docker/api/Dockerfile index a9502dd77dfe1d..15f17b8ba5b99e 100644 --- a/infra/docker/api/Dockerfile +++ b/infra/docker/api/Dockerfile @@ -33,8 +33,8 @@ RUN set -eux; \ apt-get clean && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives && \ yarn config set httpTimeout 1200000 && \ - npx turbo prune --scope=@calcom/web --docker && \ - npx turbo prune --scope=@calcom/api --docker && \ + npx turbo prune --filter=@calcom/web --docker && \ + npx turbo prune --filter=@calcom/api --docker && \ yarn install && \ yarn turbo run build --filter=@calcom/api diff --git a/package.json b/package.json index 6b080c2150278a..de7821ac0dc223 100644 --- a/package.json +++ b/package.json @@ -28,23 +28,23 @@ "edit-app-template": "yarn app-store edit-template", "delete-app-template": "yarn app-store delete-template", "build": "turbo run build --filter=@calcom/web...", - "build:ai": "turbo run build --scope=\"@calcom/ai\"", + "build:ai": "turbo run build --filter=\"@calcom/ai\"", "clean": "find . -name node_modules -o -name .next -o -name .turbo -o -name dist -type d -prune | xargs rm -rf", "db-deploy": "turbo run db-deploy", "db-seed": "turbo run db-seed", "db-studio": "yarn prisma studio", "deploy": "turbo run deploy", - "dev:all": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/website\" --scope=\"@calcom/console\"", - "dev:ai": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/api-proxy\" --scope=\"@calcom/api\" --scope=\"@calcom/ai\"", - "dev:api": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/api-proxy\" --scope=\"@calcom/api\"", - "dev:api:console": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/api-proxy\" --scope=\"@calcom/api\" --scope=\"@calcom/console\"", - "dev:console": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/console\"", - "dev:swagger": "turbo run dev --scope=\"@calcom/api-proxy\" --scope=\"@calcom/api\" --scope=\"@calcom/swagger\"", - "dev:website": "turbo run dev --scope=\"@calcom/web\" --scope=\"@calcom/website\"", - "dev": "turbo run dev --scope=\"@calcom/web\"", - "build-storybook": "turbo run build --scope=\"@calcom/storybook\"", + "dev:all": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/website\" --filter=\"@calcom/console\"", + "dev:ai": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\" --filter=\"@calcom/ai\"", + "dev:api": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\"", + "dev:api:console": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\" --filter=\"@calcom/console\"", + "dev:console": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/console\"", + "dev:swagger": "turbo run dev --filter=\"@calcom/api-proxy\" --filter=\"@calcom/api\" --filter=\"@calcom/swagger\"", + "dev:website": "turbo run dev --filter=\"@calcom/web\" --filter=\"@calcom/website\"", + "dev": "turbo run dev --filter=\"@calcom/web\"", + "build-storybook": "turbo run build --filter=\"@calcom/storybook\"", "dx": "turbo run dx", - "i-dev": "infisical run -- turbo run dev --scope=\"@calcom/web\"", + "i-dev": "infisical run -- turbo run dev --filter=\"@calcom/web\"", "i-dx": "infisical run -- turbo run dx", "i-gen-web-example-env": "infisical secrets generate-example-env --tags=web > .env.example", "i-gen-app-store-example-env": "infisical secrets generate-example-env --tags=appstore > .env.appStore.example", @@ -61,7 +61,7 @@ "pre-commit": "lint-staged", "predev": "echo 'Checking env files'", "prisma": "yarn workspace @calcom/prisma prisma", - "start": "turbo run start --scope=\"@calcom/web\"", + "start": "turbo run start --filter=\"@calcom/web\"", "tdd": "vitest watch", "e2e": "NEXT_PUBLIC_IS_E2E=1 yarn playwright test --project=@calcom/web", "e2e:app-store": "QUICK=true yarn playwright test --project=@calcom/app-store", @@ -124,7 +124,7 @@ "date-fns-tz": "^3.2.0", "eslint": "^8.34.0", "p-limit": "^6.2.0", - "turbo": "^1.10.1" + "turbo": "^2.5.5" }, "resolutions": { "types-ramda": "0.29.4", diff --git a/packages/trpc/tsconfig.json b/packages/trpc/tsconfig.json index 101aeb3e01d9e4..b3a251d7427001 100644 --- a/packages/trpc/tsconfig.json +++ b/packages/trpc/tsconfig.json @@ -1,19 +1,5 @@ { "extends": "@calcom/tsconfig/react-library.json", - "paths": { - "~/*": ["/*"], - "@calcom/app-store": ["../app-store"], - "@calcom/app-store/*": ["../app-store/*"], - "@calcom/dayjs": ["../dayjs"], - "@calcom/dayjs/*": ["../dayjs/*"], - "@calcom/features": ["../features"], - "@calcom/features/*": ["../features/*"], - "@calcom/lib": ["../lib"], - "@calcom/lib/*": ["../lib/*"], - "@calcom/prisma": ["../prisma"], - "@calcom/prisma/*": ["../prisma/*"], - "@calcom/repository/*": ["../lib/server/repository/*"] - }, "include": [ "../types/@wojtekmaj__react-daterange-picker.d.ts", "../types/business-days-plugin.d.ts", @@ -33,6 +19,9 @@ "declarationMap": false, "resolveJsonModule": true, "declarationDir": "types/server", - "moduleResolution": "node" + "moduleResolution": "node", + "paths": { + "~/*": ["./*"] + } } } diff --git a/turbo.json b/turbo.json index dbe0992b2d6ec5..1522df42b6e75b 100644 --- a/turbo.json +++ b/turbo.json @@ -1,253 +1,5 @@ { "$schema": "https://turborepo.org/schema.json", - "pipeline": { - "@calcom/prisma#build": { - "cache": false, - "dependsOn": ["post-install"] - }, - "@calcom/prisma#db-migrate": { - "cache": false, - "dependsOn": ["@calcom/prisma#db-up"], - "inputs": ["./schema.prisma", "./migrations/**/*.sql"] - }, - "@calcom/prisma#db-seed": { - "cache": false, - "dependsOn": ["@calcom/prisma#db-migrate"] - }, - "@calcom/prisma#db-up": { - "cache": false - }, - "@calcom/prisma#dx": { - "cache": false, - "dependsOn": ["@calcom/prisma#db-migrate"] - }, - "@calcom/trpc#build": { - "outputs": ["./types"] - }, - "@calcom/web#build": { - "dependsOn": ["^build"], - "outputs": [".next/**"], - "env": [ - "NEXT_PUBLIC_AVAILABILITY_SCHEDULE_INTERVAL", - "NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD", - "NEXT_PUBLIC_IS_E2E", - "NEXT_PUBLIC_SENTRY_DSN", - "NEXT_PUBLIC_SENTRY_DSN_CLIENT", - "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY", - "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRODUCT_ID", - "NEXT_PUBLIC_STRIPE_PUBLIC_KEY", - "NEXT_PUBLIC_STRIPE_TEAM_MONTHLY_PRICE_ID", - "NEXT_PUBLIC_WEBAPP_URL", - "NEXT_PUBLIC_WEBSITE_URL", - "SENTRY_AUTH_TOKEN", - "SENTRY_DEBUG", - "SENTRY_MAX_SPANS", - "SENTRY_ORG", - "SENTRY_PROJECT", - "SENTRY_SAMPLE_RATE", - "SENTRY_TRACES_SAMPLE_RATE", - "SENTRY_REPLAYS_SESSION_SAMPLE_RATE", - "SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE", - "STRIPE_PREMIUM_PLAN_PRODUCT_ID", - "STRIPE_TEAM_MONTHLY_PRICE_ID", - "NEXT_PUBLIC_STRIPE_CREDITS_PRICE_ID", - "STRIPE_TEAM_PRODUCT_ID", - "STRIPE_ORG_MONTHLY_PRICE_ID", - "STRIPE_ORG_PRODUCT_ID", - "NEXT_PUBLIC_API_V2_URL", - "NEXT_PUBLIC_VAPID_PUBLIC_KEY", - "BUILD_STANDALONE", - "NEXT_PUBLIC_API_HITPAY_PRODUCTION", - "NEXT_PUBLIC_API_HITPAY_SANDBOX" - ] - }, - "@calcom/web#dx": { - "cache": false, - "dependsOn": ["@calcom/prisma#dx"] - }, - "@calcom/web#start": { - "cache": false, - "dependsOn": [] - }, - "@calcom/atoms#build": { - "outputs": ["dist/**", "globals.min.css"] - }, - "@calcom/api-v2#build": { - "dependsOn": ["^build"], - "env": [ - "NODE_ENV", - "API_PORT", - "DATABASE_READ_URL", - "DATABASE_WRITE_URL", - "LOG_LEVEL", - "NEXTAUTH_SECRET" - ] - }, - "@calcom/ai#build": { - "env": [ - "FRONTEND_URL", - "BACKEND_URL", - "APP_ID", - "APP_URL", - "SENDER_DOMAIN", - "PARSE_KEY", - "NODE_ENV", - "OPENAI_API_KEY", - "SENDGRID_API_KEY", - "DATABASE_URL" - ] - }, - "@calcom/website#build": { - "dependsOn": ["^build"], - "outputs": [".next/**"], - "env": [ - "CSP_POLICY", - "DATABASE_URL", - "DATOCMS_API_TOKEN", - "DATOCMS_GRAPHQL_ENDPOINT", - "DATOCMS_WEBHOOK_SECRET", - "DATOCMS_PREVIEW_SECRET", - "ENVIRONMENT_URL", - "NEXT_PUBLIC_AVAILABILITY_SCHEDULE_INTERVAL", - "NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN", - "NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE", - "NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE", - "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE", - "NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE", - "NEXT_PUBLIC_STRIPE_PUBLIC_KEY", - "NEXT_PUBLIC_WEBAPP_URL", - "NEXT_PUBLIC_WEBSITE_URL", - "NEXT_PUBLIC_VERCEL_ENV", - "NEXT_PUBLIC_VERCEL_BRANCH_URL", - "NEXT_PUBLIC_POSTHOG_KEY", - "NEXT_PUBLIC_POSTHOG_HOST", - "SENDGRID_VERIFICATION_KEY", - "STRIPE_FREE_PLAN_PRODUCT_ID", - "STRIPE_PREMIUM_PLAN_PRODUCT_ID", - "STRIPE_PRO_PLAN_PRODUCT_ID", - "STRIPE_SUPPORT_TABLE", - "MOTIFLAND_REST_ENDPOINT", - "MOTIFLAND_DOCS_API_KEY", - "MOTIFLAND_DOCS_PROJECT_ID", - "PLAIN_HMAC_SECRET_KEY", - "PLAIN_API_KEY", - "PLAIN_API_URL", - "NEXT_PUBLIC_PLAIN_CHAT_ID", - "PLAIN_CHAT_HMAC_SECRET_KEY", - "NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS" - ] - }, - "build": { - "dependsOn": ["^build"], - "outputs": ["dist/**", ".next/**"] - }, - "db-deploy": { - "cache": false, - "inputs": ["./migrations/**/*.sql", "./prisma/migrations/**/*.sql"] - }, - "db-seed": {}, - "deploy": { - "cache": false, - "dependsOn": ["@calcom/web#build"] - }, - "clean": { - "cache": false, - "outputs": ["dist/**", "build/**"] - }, - "dev": { - "dependsOn": ["//#env-check:common", "//#env-check:app-store"], - "cache": false - }, - "dx": { - "dependsOn": ["//#env-check:common", "//#env-check:app-store"], - "cache": false - }, - "lint": { - "cache": false - }, - "lint:fix": { - "cache": false - }, - "lint:report": { - "cache": false, - "outputs": ["lint-results"] - }, - "post-install": { - "dependsOn": [], - "outputs": ["../../node_modules/@prisma/client/**", "../../node_modules/@prisma/admin-client/**"], - "inputs": ["./schema.prisma", "./prisma/schema.prisma"], - "env": ["PRISMA_GENERATE_DATAPROXY"] - }, - "@calcom/prisma#post-install": { - "cache": false, - "outputs": ["dist/**", "build/**"] - }, - "start": { - "outputs": ["dist/**", "build/**"] - }, - "embed-tests": { - "cache": false, - "outputs": ["dist/**", "build/**"] - }, - "embed-tests-quick": { - "cache": false, - "outputs": ["dist/**", "build/**"] - }, - "type-check": { - "cache": false, - "dependsOn": ["@calcom/trpc#build"] - }, - "type-check:ci": { - "cache": false, - "dependsOn": ["@calcom/trpc#build"] - }, - "@calcom/prisma#db-reset": { - "cache": false, - "outputs": ["dist/**", "build/**"] - }, - "@calcom/app-store-cli#build": { - "cache": false, - "inputs": ["../../app-store/**/**"], - "outputs": ["../../app-store/apps.server.generated.ts", "../../app-store/apps.browser.generated.tsx"] - }, - "@calcom/embed-react#type-check": { - "dependsOn": ["@calcom/embed-core#build", "@calcom/embed-snippet#build"], - "outputs": ["dist/**", "build/**"] - }, - "@calcom/embed-core#build": { - "cache": false, - "outputs": ["../../../apps/web/public/embed/**"], - "env": [ - "EMBED_PUBLIC_VERCEL_URL", - "EMBED_PUBLIC_WEBAPP_URL", - "EMBED_PUBLIC_EMBED_FINGER_PRINT", - "EMBED_PUBLIC_EMBED_VERSION" - ] - }, - "embed-tests-update-snapshots:ci": { - "cache": false, - "dependsOn": [ - "@calcom/prisma#db-seed", - "@calcom/web#build", - "^build", - "^embed-tests-update-snapshots:ci" - ], - "outputs": ["dist/**", "build/**"] - }, - "//#env-check:common": { - "cache": false, - "inputs": ["./.env.example", "./.env"], - "outputs": ["./.env"] - }, - "//#env-check:app-store": { - "cache": false, - "inputs": ["./.env.appStore.example", "./.env.appStore"], - "outputs": ["./.env.appStore"] - }, - "//#test": { - "cache": false - } - }, "globalDependencies": ["yarn.lock"], "globalEnv": [ "ALLOWED_HOSTNAMES", @@ -415,6 +167,7 @@ "STRIPE_WEBHOOK_SECRET", "STRIPE_WEBHOOK_SECRET_APPS", "STRIPE_WEBHOOK_SECRET_BILLING", + "STRIPE_TEAM_MONTHLY_PRICE_ID", "TANDEM_BASE_URL", "TANDEM_CLIENT_ID", "TANDEM_CLIENT_SECRET", @@ -497,5 +250,253 @@ "CAL_VIDEO_RECORDING_TOKEN_SECRET", "ORGANIZER_EMAIL_EXEMPT_DOMAINS", "SLOTS_CACHE_TTL" - ] + ], + "tasks": { + "@calcom/prisma#build": { + "cache": false, + "dependsOn": ["post-install"] + }, + "@calcom/prisma#db-migrate": { + "cache": false, + "dependsOn": ["@calcom/prisma#db-up"], + "inputs": ["./schema.prisma", "./migrations/**/*.sql"] + }, + "@calcom/prisma#db-seed": { + "cache": false, + "dependsOn": ["@calcom/prisma#db-migrate"] + }, + "@calcom/prisma#db-up": { + "cache": false + }, + "@calcom/prisma#dx": { + "cache": false, + "dependsOn": ["@calcom/prisma#db-migrate"] + }, + "@calcom/trpc#build": { + "outputs": ["./types"] + }, + "@calcom/web#build": { + "dependsOn": ["^build"], + "outputs": [".next/**"], + "env": [ + "NEXT_PUBLIC_AVAILABILITY_SCHEDULE_INTERVAL", + "NEXT_PUBLIC_BOOKER_NUMBER_OF_DAYS_TO_LOAD", + "NEXT_PUBLIC_IS_E2E", + "NEXT_PUBLIC_SENTRY_DSN", + "NEXT_PUBLIC_SENTRY_DSN_CLIENT", + "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE_MONTHLY", + "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRODUCT_ID", + "NEXT_PUBLIC_STRIPE_PUBLIC_KEY", + "NEXT_PUBLIC_STRIPE_TEAM_MONTHLY_PRICE_ID", + "NEXT_PUBLIC_WEBAPP_URL", + "NEXT_PUBLIC_WEBSITE_URL", + "SENTRY_AUTH_TOKEN", + "SENTRY_DEBUG", + "SENTRY_MAX_SPANS", + "SENTRY_ORG", + "SENTRY_PROJECT", + "SENTRY_SAMPLE_RATE", + "SENTRY_TRACES_SAMPLE_RATE", + "SENTRY_REPLAYS_SESSION_SAMPLE_RATE", + "SENTRY_REPLAYS_ON_ERROR_SAMPLE_RATE", + "STRIPE_PREMIUM_PLAN_PRODUCT_ID", + "STRIPE_TEAM_MONTHLY_PRICE_ID", + "NEXT_PUBLIC_STRIPE_CREDITS_PRICE_ID", + "STRIPE_TEAM_PRODUCT_ID", + "STRIPE_ORG_MONTHLY_PRICE_ID", + "STRIPE_ORG_PRODUCT_ID", + "NEXT_PUBLIC_API_V2_URL", + "NEXT_PUBLIC_VAPID_PUBLIC_KEY", + "BUILD_STANDALONE", + "NEXT_PUBLIC_API_HITPAY_PRODUCTION", + "NEXT_PUBLIC_API_HITPAY_SANDBOX" + ] + }, + "@calcom/web#dx": { + "cache": false, + "dependsOn": ["@calcom/prisma#dx"] + }, + "@calcom/web#start": { + "cache": false, + "dependsOn": [] + }, + "@calcom/atoms#build": { + "outputs": ["dist/**", "globals.min.css"] + }, + "@calcom/api-v2#build": { + "dependsOn": ["^build"], + "env": [ + "NODE_ENV", + "API_PORT", + "DATABASE_READ_URL", + "DATABASE_WRITE_URL", + "LOG_LEVEL", + "NEXTAUTH_SECRET" + ] + }, + "@calcom/ai#build": { + "env": [ + "FRONTEND_URL", + "BACKEND_URL", + "APP_ID", + "APP_URL", + "SENDER_DOMAIN", + "PARSE_KEY", + "NODE_ENV", + "OPENAI_API_KEY", + "SENDGRID_API_KEY", + "DATABASE_URL" + ] + }, + "@calcom/website#build": { + "dependsOn": ["^build"], + "outputs": [".next/**"], + "env": [ + "CSP_POLICY", + "DATABASE_URL", + "DATOCMS_API_TOKEN", + "DATOCMS_GRAPHQL_ENDPOINT", + "DATOCMS_WEBHOOK_SECRET", + "DATOCMS_PREVIEW_SECRET", + "ENVIRONMENT_URL", + "NEXT_PUBLIC_AVAILABILITY_SCHEDULE_INTERVAL", + "NEXT_PUBLIC_IS_PREMIUM_NEW_PLAN", + "NEXT_PUBLIC_STRIPE_FREE_PLAN_PRICE", + "NEXT_PUBLIC_STRIPE_PREMIUM_NEW_PLAN_PRICE", + "NEXT_PUBLIC_STRIPE_PREMIUM_PLAN_PRICE", + "NEXT_PUBLIC_STRIPE_PRO_PLAN_PRICE", + "NEXT_PUBLIC_STRIPE_PUBLIC_KEY", + "NEXT_PUBLIC_WEBAPP_URL", + "NEXT_PUBLIC_WEBSITE_URL", + "NEXT_PUBLIC_VERCEL_ENV", + "NEXT_PUBLIC_VERCEL_BRANCH_URL", + "NEXT_PUBLIC_POSTHOG_KEY", + "NEXT_PUBLIC_POSTHOG_HOST", + "SENDGRID_VERIFICATION_KEY", + "STRIPE_FREE_PLAN_PRODUCT_ID", + "STRIPE_PREMIUM_PLAN_PRODUCT_ID", + "STRIPE_PRO_PLAN_PRODUCT_ID", + "STRIPE_SUPPORT_TABLE", + "MOTIFLAND_REST_ENDPOINT", + "MOTIFLAND_DOCS_API_KEY", + "MOTIFLAND_DOCS_PROJECT_ID", + "PLAIN_HMAC_SECRET_KEY", + "PLAIN_API_KEY", + "PLAIN_API_URL", + "NEXT_PUBLIC_PLAIN_CHAT_ID", + "PLAIN_CHAT_HMAC_SECRET_KEY", + "NEXT_PUBLIC_PLAIN_CHAT_EXCLUDED_PATHS" + ] + }, + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**", ".next/**"] + }, + "db-deploy": { + "cache": false, + "inputs": ["./migrations/**/*.sql", "./prisma/migrations/**/*.sql"] + }, + "db-seed": {}, + "deploy": { + "cache": false, + "dependsOn": ["@calcom/web#build"] + }, + "clean": { + "cache": false, + "outputs": ["dist/**", "build/**"] + }, + "dev": { + "dependsOn": ["//#env-check:common", "//#env-check:app-store"], + "cache": false + }, + "dx": { + "dependsOn": ["//#env-check:common", "//#env-check:app-store"], + "cache": false + }, + "lint": { + "cache": false + }, + "lint:fix": { + "cache": false + }, + "lint:report": { + "cache": false, + "outputs": ["lint-results"] + }, + "post-install": { + "dependsOn": [], + "outputs": ["../../node_modules/@prisma/client/**", "../../node_modules/@prisma/admin-client/**"], + "inputs": ["./schema.prisma", "./prisma/schema.prisma"], + "env": ["PRISMA_GENERATE_DATAPROXY"] + }, + "@calcom/prisma#post-install": { + "cache": false, + "outputs": ["dist/**", "build/**"] + }, + "start": { + "outputs": ["dist/**", "build/**"] + }, + "embed-tests": { + "cache": false, + "outputs": ["dist/**", "build/**"] + }, + "embed-tests-quick": { + "cache": false, + "outputs": ["dist/**", "build/**"] + }, + "type-check": { + "cache": false, + "dependsOn": ["@calcom/trpc#build"] + }, + "type-check:ci": { + "cache": false, + "dependsOn": ["@calcom/trpc#build"] + }, + "@calcom/prisma#db-reset": { + "cache": false, + "outputs": ["dist/**", "build/**"] + }, + "@calcom/app-store-cli#build": { + "cache": false, + "inputs": ["../../app-store/**"], + "outputs": ["../../app-store/apps.server.generated.ts", "../../app-store/apps.browser.generated.tsx"] + }, + "@calcom/embed-react#type-check": { + "dependsOn": ["@calcom/embed-core#build", "@calcom/embed-snippet#build"], + "outputs": ["dist/**", "build/**"] + }, + "@calcom/embed-core#build": { + "cache": false, + "outputs": ["../../../apps/web/public/embed/**"], + "env": [ + "EMBED_PUBLIC_VERCEL_URL", + "EMBED_PUBLIC_WEBAPP_URL", + "EMBED_PUBLIC_EMBED_FINGER_PRINT", + "EMBED_PUBLIC_EMBED_VERSION" + ] + }, + "embed-tests-update-snapshots:ci": { + "cache": false, + "dependsOn": [ + "@calcom/prisma#db-seed", + "@calcom/web#build", + "^build", + "^embed-tests-update-snapshots:ci" + ], + "outputs": ["dist/**", "build/**"] + }, + "//#env-check:common": { + "cache": false, + "inputs": ["./.env.example", "./.env"], + "outputs": ["./.env"] + }, + "//#env-check:app-store": { + "cache": false, + "inputs": ["./.env.appStore.example", "./.env.appStore"], + "outputs": ["./.env.appStore"] + }, + "//#test": { + "cache": false + } + } } diff --git a/yarn.lock b/yarn.lock index d6513632a03dc2..9bffe2498c25e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21694,7 +21694,7 @@ __metadata: prismock: ^1.33.4 resize-observer-polyfill: ^1.5.1 tsc-absolute: ^1.0.0 - turbo: ^1.10.1 + turbo: ^2.5.5 typescript: 5.9.0-beta vitest: ^2.1.1 vitest-fetch-mock: ^0.3.0 @@ -44926,58 +44926,58 @@ __metadata: languageName: node linkType: hard -"turbo-darwin-64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-darwin-64@npm:1.10.1" +"turbo-darwin-64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-darwin-64@npm:2.5.5" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"turbo-darwin-arm64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-darwin-arm64@npm:1.10.1" +"turbo-darwin-arm64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-darwin-arm64@npm:2.5.5" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"turbo-linux-64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-linux-64@npm:1.10.1" +"turbo-linux-64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-linux-64@npm:2.5.5" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"turbo-linux-arm64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-linux-arm64@npm:1.10.1" +"turbo-linux-arm64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-linux-arm64@npm:2.5.5" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"turbo-windows-64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-windows-64@npm:1.10.1" +"turbo-windows-64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-windows-64@npm:2.5.5" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"turbo-windows-arm64@npm:1.10.1": - version: 1.10.1 - resolution: "turbo-windows-arm64@npm:1.10.1" +"turbo-windows-arm64@npm:2.5.5": + version: 2.5.5 + resolution: "turbo-windows-arm64@npm:2.5.5" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"turbo@npm:^1.10.1": - version: 1.10.1 - resolution: "turbo@npm:1.10.1" - dependencies: - turbo-darwin-64: 1.10.1 - turbo-darwin-arm64: 1.10.1 - turbo-linux-64: 1.10.1 - turbo-linux-arm64: 1.10.1 - turbo-windows-64: 1.10.1 - turbo-windows-arm64: 1.10.1 +"turbo@npm:^2.5.5": + version: 2.5.5 + resolution: "turbo@npm:2.5.5" + dependencies: + turbo-darwin-64: 2.5.5 + turbo-darwin-arm64: 2.5.5 + turbo-linux-64: 2.5.5 + turbo-linux-arm64: 2.5.5 + turbo-windows-64: 2.5.5 + turbo-windows-arm64: 2.5.5 dependenciesMeta: turbo-darwin-64: optional: true @@ -44993,7 +44993,7 @@ __metadata: optional: true bin: turbo: bin/turbo - checksum: 3551c57be67e833583de549d74d5ec991e0f1e38047e25600b8acc085a1a8a4007992259a015eb9f2c0abd68156545800bd34e7b5ad337d1998b32461952d3fb + checksum: 8da6525097ba17bb59571eb512f216362b046bbf88765ddb05fb9937a44e04eeba3bb883c55fca53a7e8a104e02366b4f6f99ef90d12078d0dc95d4659004af6 languageName: node linkType: hard