@turbo/codemod 2.8.20 → 2.8.21-canary.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const e=require(`./runner-Qa95HmyV.js`),t=require(`./dist-B5rR31JW.js`),n=e.__toESM(require(`picocolors`)),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:fs`)),a=e.__toESM(require(`node:path`)),o=e.__toESM(require(`node:os`)),s=e.__toESM(require(`node:child_process`)),c=e.__toESM(require(`semver`)),l=e.__toESM(require(`commander`)),u=e.__toESM(require(`@inquirer/prompts`)),d=e.__toESM(require(`is-git-clean`));var f=`@turbo/codemod`,p=`2.8.20`,m=`Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.`,h=`https://turborepo.dev`,g={url:`https://github.com/vercel/turborepo/issues`},_=`MIT`,v={type:`git`,url:`https://github.com/vercel/turborepo`,directory:`packages/turbo-codemod`},y=`dist/cli.js`,b=[`dist`],x={access:`public`},S={build:`tsdown`,test:`jest`,"check-types":`tsc --noEmit`,"lint:prettier":`prettier -c . --cache --ignore-path=../../.prettierignore`},C={"@inquirer/prompts":`^7.10.1`,commander:`9.5.0`,diff:`5.2.2`,"find-up":`4.1.0`,"fs-extra":`10.1.0`,"gradient-string":`2.0.1`,"is-git-clean":`1.1.0`,json5:`2.2.3`,ora:`4.1.1`,picocolors:`1.0.1`,semver:`7.5.2`,"update-check":`1.5.4`},w={"@jest/globals":`30.2.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/types":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/diff":`5.0.2`,"@types/fs-extra":`9.0.13`,"@types/gradient-string":`1.1.2`,"@types/node":`18.17.4`,"@types/semver":`7.3.12`,"@types/uuid":`9.0.0`,deepmerge:`4.2.2`,jest:`30.2.0`,semver:`7.5.2`,"ts-jest":`29.4.6`,tsdown:`0.12.0`,typescript:`5.5.4`},T={name:f,version:p,description:m,homepage:h,bugs:g,license:_,repository:v,bin:y,files:b,publishConfig:x,scripts:S,dependencies:C,devDependencies:w};function E({directory:t,force:r}){let i=!1,a=`Unable to determine if git directory is clean`;try{i=d.default.sync(t||process.cwd()),a=`Git directory is not clean`}catch(e){let t=e;t.stderr?.includes(`not a git repository`)&&(i=!0)}i||(r?e.log(`${n.default.yellow(`WARNING`)}: ${a}. Forcibly continuing...`):(e.log(`Thank you for using @turbo/codemod!`),e.log(n.default.yellow(`
2
+ const e=require(`./runner-sNjkx4u0.js`),t=require(`./dist-CM5dI28P.js`),n=e.__toESM(require(`picocolors`)),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:fs`)),a=e.__toESM(require(`node:path`)),o=e.__toESM(require(`node:os`)),s=e.__toESM(require(`node:child_process`)),c=e.__toESM(require(`semver`)),l=e.__toESM(require(`commander`)),u=e.__toESM(require(`@inquirer/prompts`)),d=e.__toESM(require(`is-git-clean`));var f=`@turbo/codemod`,p=`2.8.21-canary.10`,m=`Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.`,h=`https://turborepo.dev`,g={url:`https://github.com/vercel/turborepo/issues`},_=`MIT`,v={type:`git`,url:`https://github.com/vercel/turborepo`,directory:`packages/turbo-codemod`},y=`dist/cli.js`,b=[`dist`],x={access:`public`},S={build:`tsdown`,test:`jest`,"check-types":`tsc --noEmit`,"lint:prettier":`prettier -c . --cache --ignore-path=../../.prettierignore`},C={"@inquirer/prompts":`^7.10.1`,commander:`9.5.0`,diff:`5.2.2`,"find-up":`4.1.0`,"fs-extra":`10.1.0`,"gradient-string":`2.0.1`,"is-git-clean":`1.1.0`,json5:`2.2.3`,ora:`4.1.1`,picocolors:`1.0.1`,semver:`7.5.2`,"update-check":`1.5.4`},w={"@jest/globals":`30.2.0`,"@turbo/test-utils":`workspace:*`,"@turbo/tsconfig":`workspace:*`,"@turbo/types":`workspace:*`,"@turbo/utils":`workspace:*`,"@turbo/workspaces":`workspace:*`,"@types/diff":`5.0.2`,"@types/fs-extra":`9.0.13`,"@types/gradient-string":`1.1.2`,"@types/node":`18.17.4`,"@types/semver":`7.3.12`,"@types/uuid":`9.0.0`,deepmerge:`4.2.2`,jest:`30.2.0`,semver:`7.5.2`,"ts-jest":`29.4.6`,tsdown:`0.12.0`,typescript:`5.5.4`},T={name:f,version:p,description:m,homepage:h,bugs:g,license:_,repository:v,bin:y,files:b,publishConfig:x,scripts:S,dependencies:C,devDependencies:w};function E({directory:t,force:r}){let i=!1,a=`Unable to determine if git directory is clean`;try{i=d.default.sync(t||process.cwd()),a=`Git directory is not clean`}catch(e){let t=e;t.stderr?.includes(`not a git repository`)&&(i=!0)}i||(r?e.log(`${n.default.yellow(`WARNING`)}: ${a}. Forcibly continuing...`):(e.log(`Thank you for using @turbo/codemod!`),e.log(n.default.yellow(`
3
3
  But before we continue, please stash or commit your git changes.`)),e.log(`
4
4
  You may use the --force flag to override this safety check.`),process.exit(1)))}function D({directory:e}){let t=a.default.isAbsolute(e)?e:a.default.join(process.cwd(),e);return{exists:i.default.existsSync(t),absolute:t}}const O=[`package.json`,`turbo.json`,`.git`];function k({directory:e}){return O.some(t=>r.default.existsSync(a.default.join(e,t)))}function A(e,t,n){try{let n=(0,s.execSync)(e,{stdio:`pipe`,...t});return n.toString(`utf8`).trim()}catch{return n||void 0}}function j(e,t){let{from:n}=t;if(n)return n;let r=A(`turbo --version`,{cwd:e.paths.root});if(r)return r;let{packageManager:i}=e;return A(i===`yarn`?`yarn turbo --version`:i===`pnpm`?`pnpm turbo --version`:`npm exec -c 'turbo --version'`,{cwd:e.paths.root})}const M=`https://registry.npmjs.org`;async function N({packageName:e}){let t=process.env.npm_config_registry?.replace(/\/$/,``)||M;try{let n=await fetch(`${t}/${e}`);if(!n.ok)throw Error(`HTTP ${n.status}`);return await n.json()}catch{throw Error(`Unable to fetch the latest version of ${e}`)}}async function P({to:e}){let t=await N({packageName:`turbo`}),{"dist-tags":n,versions:r}=t;if(e){if(n[e]||e in r)return e;throw Error(`turbo@${e} does not exist`)}return n.latest}const F=process.env.NODE_ENV===`test`?a.default.join(__dirname,`../transforms`):a.default.join(__dirname,`./transforms`);function I(){let e=r.default.readdirSync(F);return e.map(e=>{let t=a.default.join(F,e);try{let e=require(t);return e.default}catch{return}}).filter(Boolean)}function L({fromVersion:e,toVersion:t}){let n=e.split(`.`)[0],r=n!==t.split(`.`)[0],i=r?`${n}.0.0`:e,a=I().filter(n=>{let r=(0,c.gt)(n.introducedIn,e)&&(0,c.lte)(n.introducedIn,t),a=(n.idempotent??!0)&&(0,c.gt)(n.introducedIn,i)&&(0,c.lte)(n.introducedIn,t);return r||a});return a.sort((e,t)=>(0,c.gt)(e.introducedIn,t.introducedIn)?1:(0,c.eq)(e.introducedIn,t.introducedIn)?0:-1),a}function R(e,t=`latest`){switch(e){case`yarn`:return`yarn global add turbo@${t}`;case`npm`:return`npm install turbo@${t} --global`;case`pnpm`:return`pnpm add turbo@${t} --global`;case`bun`:return`bun add turbo@${t} --global`}}function z({packageManager:e,packageManagerVersion:t,installType:n,isUsingWorkspaces:r,to:i=`latest`}){let a=e=>e.filter(Boolean).join(` `);switch(e){case`yarn`:return(0,c.gte)(t,`2.0.0`)?a([`yarn`,`add`,`turbo@${i}`,n===`devDependencies`&&`--dev`]):a([`yarn`,`add`,`turbo@${i}`,n===`devDependencies`&&`--dev`,r&&`-W`]);case`npm`:return a([`npm`,`install`,`turbo@${i}`,n===`devDependencies`&&`--save-dev`]);case`pnpm`:return a([`pnpm`,`add`,`turbo@${i}`,n===`devDependencies`&&`--save-dev`,r&&`-w`]);case`bun`:return a([`bun`,`add`,`turbo@${i}`,n===`devDependencies`&&`--dev`])}}function B({root:t}){let n=a.default.join(t,`package.json`);if(!r.default.existsSync(n)){e.error(`Unable to find package.json at ${n}`);return}let i=r.default.readJsonSync(n),o=i.devDependencies&&`turbo`in i.devDependencies,s=i.dependencies&&`turbo`in i.dependencies;if(s||o)return s?`dependencies`:`devDependencies`}async function V({project:t,to:n}){let r=A(`turbo bin`,{cwd:t.paths.root,stdio:`pipe`}),i=await e.getPackageManagersBinPaths(),a=Object.keys(i).find(e=>{let t=i[e];return t&&r?r.includes(t):!1});if(r&&a)return R(a,n);let{packageManager:o}=t,s=t.workspaceData.globs.length>0,c=B({root:t.paths.root}),l=await e.getAvailablePackageManagers(),u=l[o];if(u&&c)return z({packageManager:o,packageManagerVersion:u,installType:c,isUsingWorkspaces:s,to:n})}function H({project:e}){try{let t={cwd:e.paths.root,stdio:`ignore`},n=A(`turbo bin`,t);if(n)A(`turbo daemon stop`,t);else{let n=`${e.packageManager} turbo daemon stop`;e.packageManager===`npm`&&(n=`npm exec -c 'turbo daemon stop'`),A(n,t)}}catch{}}var U=e.__toESM(t.require_dist());function W({message:t,success:r}){return r?(e.bold(n.default.green(`Migration completed`)),t&&e.log(t),process.exit(0)):(e.bold(n.default.red(`Migration failed`)),t&&e.log(t),process.exit(1))}async function G(t,r){r.dryRun||E({directory:t,force:r.force});let i=t;i||(i=await(0,u.input)({message:`Where is the root of the repo to migrate?`,default:`.`,validate:e=>{let{exists:t,absolute:r}=D({directory:e});return t?!0:`Directory ${n.default.dim(`(${r})`)} does not exist`},transformer:e=>e.trim()}),i=i.trim());let{exists:a,absolute:c}=D({directory:i});if(!a)return W({success:!1,message:`Directory ${n.default.dim(`(${c})`)} does not exist`});if(!k({directory:c}))return W({success:!1,message:`Directory (${n.default.dim(c)}) does not appear to be a repository`});let l;try{l=await(0,U.getWorkspaceDetails)({root:c})}catch{return W({success:!1,message:`Unable to read determine package manager details from ${n.default.dim(c)}`})}let d=j(l,r);if(!d)return W({success:!1,message:`Unable to infer the version of turbo being used by ${l.name}`});let f=r.to;try{f=await P(r)}catch(e){let t=`UNKNOWN_ERROR`;return e instanceof Error&&(t=e.message),W({success:!1,message:t})}if(!f)return W({success:!1,message:`Unable to fetch the latest version of turbo`});if(d===f)return W({success:!0,message:`Nothing to do, current version (${n.default.bold(d)}) is the same as the requested version (${n.default.bold(f)})`});let p=L({fromVersion:d,toVersion:f});p.length===0&&e.log(`No codemods required to migrate from ${d} to ${f}`,o.default.EOL),r.dryRun||H({project:l}),e.log(`Upgrading turbo from ${n.default.bold(d)} to ${n.default.bold(f)} (${p.length===0?`no codemods required`:`${p.length} required codemod${p.length===1?``:`s`}`})`,o.default.EOL);let m=[];for(let[t,i]of p.entries()){e.log(`(${t+1}/${p.length}) ${n.default.bold(`Running ${i.name}`)}`);let a=await i.transformer({root:l.paths.root,options:{...r,toVersion:f}});e.Runner.logResults(a),m.push(a)}let h=m.some(e=>e.fatalError||Object.keys(e.changes).some(t=>e.changes[t].error));if(h)return W({success:!1,message:`Could not complete migration due to codemod errors. Please fix the errors and try again.`});let g=await V({project:l,to:r.to});if(!g)return W({success:!1,message:`Unable to determine upgrade command`});if(r.install)if(r.dryRun)e.log(`Upgrading turbo with ${n.default.bold(g)} ${n.default.dim(`(dry run)`)}`,o.default.EOL);else{e.log(`Upgrading turbo with ${n.default.bold(g)}`,o.default.EOL);try{(0,s.execSync)(g,{stdio:`pipe`,cwd:l.paths.root})}catch(e){return W({success:!1,message:`Unable to upgrade turbo: ${String(e)}`})}}else e.log(`Upgrade turbo with ${n.default.bold(g)}`,o.default.EOL);W({success:!0})}async function K(t,r,i){let a=I();if(i.list)return e.log(a.map(e=>`- ${n.default.cyan(e.name)}`).join(`
5
5
  `)),process.exit(0);i.dryRun||E({directory:r,force:i.force});let o=r;o||(o=await(0,u.input)({message:`Where is the root of the repo where the transform should run?`,default:`.`,validate:e=>{let{exists:t,absolute:r}=D({directory:e});return t?!0:`Directory ${n.default.dim(`(${r})`)} does not exist`},transformer:e=>e.trim()}),o=o.trim());let s=t;s||=await(0,u.select)({message:`Which transform would you like to apply?`,choices:a.map(e=>({name:`${n.default.bold(e.name)} - ${n.default.gray(e.description)} ${n.default.gray(`(${e.introducedIn})`)}`,value:e.name}))});let{exists:c,absolute:l}=D({directory:o});if(!c)return e.error(`Directory ${n.default.dim(`(${l})`)} does not exist`),process.exit(1);let d=a.map(e=>e.name),f=a.find(e=>e.name===s);if(!f)return e.error(`Invalid transform choice ${n.default.dim(`(${t})`)}, pick one of:`),e.error(d.map(e=>`- ${e}`).join(`
@@ -1,4 +1,4 @@
1
- const e=require(`./runner-Qa95HmyV.js`);var t=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),n=e.__commonJSMin((exports,t)=>{function n(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
1
+ const e=require(`./runner-sNjkx4u0.js`);var t=e.__commonJSMin((exports,t)=>{function n(e){return e==null}function r(e){return typeof e==`object`&&!!e}function i(e){return Array.isArray(e)?e:n(e)?[]:[e]}function a(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function o(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function s(e){return e===0&&1/e==-1/0}t.exports.isNothing=n,t.exports.isObject=r,t.exports.toArray=i,t.exports.repeat=o,t.exports.isNegativeZero=s,t.exports.extend=a}),n=e.__commonJSMin((exports,t)=>{function n(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
2
2
 
3
3
  `+e.mark.snippet),r+` `+n):r}function r(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=n(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){return this.name+`: `+n(this,e)},t.exports=r}),r=e.__commonJSMin((exports,n)=>{var r=t();function i(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function a(e,t){return r.repeat(` `,t-e.length)+e}function o(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,o=[0],s=[],c,l=-1;c=n.exec(e.buffer);)s.push(c.index),o.push(c.index+c[0].length),e.position<=c.index&&l<0&&(l=o.length-2);l<0&&(l=o.length-1);var u=``,d,f,p=Math.min(e.line+t.linesAfter,s.length).toString().length,m=t.maxLength-(t.indent+p+3);for(d=1;d<=t.linesBefore&&!(l-d<0);d++)f=i(e.buffer,o[l-d],s[l-d],e.position-(o[l]-o[l-d]),m),u=r.repeat(` `,t.indent)+a((e.line-d+1).toString(),p)+` | `+f.str+`
4
4
  `+u;for(f=i(e.buffer,o[l],s[l],e.position,m),u+=r.repeat(` `,t.indent)+a((e.line+1).toString(),p)+` | `+f.str+`
@@ -1 +1 @@
1
- const e=require(`./runner-Qa95HmyV.js`);function t({transformer:t,rootPath:n,options:r}){let i={transformer:t,rootPath:n,...r},a=new e.Logger(i),o=new e.Runner(i);return{log:a,runner:o}}Object.defineProperty(exports,`getTransformerHelpers`,{enumerable:!0,get:function(){return t}});
1
+ const e=require(`./runner-sNjkx4u0.js`);function t({transformer:t,rootPath:n,options:r}){let i={transformer:t,rootPath:n,...r},a=new e.Logger(i),o=new e.Runner(i);return{log:a,runner:o}}Object.defineProperty(exports,`getTransformerHelpers`,{enumerable:!0,get:function(){return t}});
@@ -1 +1 @@
1
- const e=require(`./runner-Qa95HmyV.js`),t=e.__toESM(require(`fs-extra`)),n=e.__toESM(require(`json5`));function r(e){let r=t.default.readFileSync(e,`utf8`);return(0,n.parse)(r)}Object.defineProperty(exports,`loadTurboJson`,{enumerable:!0,get:function(){return r}});
1
+ const e=require(`./runner-sNjkx4u0.js`),t=e.__toESM(require(`fs-extra`)),n=e.__toESM(require(`json5`));function r(e){let r=t.default.readFileSync(e,`utf8`);return(0,n.parse)(r)}Object.defineProperty(exports,`loadTurboJson`,{enumerable:!0,get:function(){return r}});
@@ -45,7 +45,7 @@ t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|
45
45
  /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
46
46
  let n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))}),aa=o((exports,t)=>{
47
47
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
48
- t.exports=r;let n=ia();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}}),oa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10),i=10,a=10,o=n>i,s=n===i&&r>=a;exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES=o||s}),sa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}exports.createDirentFromStats=n}),ca=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.fs=void 0;let t=sa();exports.fs=t}),la=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}exports.joinPathSegments=t}),ua=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.readdir=exports.readdirWithFileTypes=exports.read=void 0;let t=ra(),n=aa(),r=oa(),i=ca(),a=la();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}exports.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}let l=s.map(e=>c(e,t));n(l,(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}exports.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}let l=c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}});n(l,(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}exports.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}}),da=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.readdir=exports.readdirWithFileTypes=exports.read=void 0;let t=ra(),n=oa(),r=ca(),i=la();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}exports.read=a;function o(e,t){let n=t.fs.readdirSync(e,{withFileTypes:!0});return n.map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}exports.readdirWithFileTypes=o;function s(e,n){let a=n.fs.readdirSync(e);return a.map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}exports.readdir=s}),fa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.createFileSystemAdapter=exports.FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`);exports.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?exports.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},exports.FILE_SYSTEM_ADAPTER),t)}exports.createFileSystemAdapter=n}),pa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ra(),r=fa();var i=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}};exports.default=i}),ma=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Settings=exports.scandirSync=exports.scandir=void 0;let t=ua(),n=da(),r=pa();exports.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}exports.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}exports.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}}),ha=o((exports,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n}),ga=o((exports,t)=>{var n=ha();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){var e=new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})});return e}}t.exports=r,t.exports.promise=o}),_a=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.joinPathSegments=exports.replacePathSegmentSeparator=exports.isAppliedFilter=exports.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}exports.isFatalError=t;function n(e,t){return e===null||e(t)}exports.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}exports.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}exports.joinPathSegments=i}),va=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=_a();var n=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}};exports.default=n}),ya=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`events`),n=ma(),r=ga(),i=_a(),a=va();var o=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}};exports.default=o}),ba=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ya();var n=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{r(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{i(e,this._storage)}),this._reader.read()}};exports.default=n;function r(e,t){e(t)}function i(e,t){e(null,t)}}),xa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=ya();var r=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};exports.default=r}),Sa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ma(),n=_a(),r=va();var i=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};exports.default=i}),Ca=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Sa();var n=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}};exports.default=n}),wa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ma();var r=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}};exports.default=r}),Ta=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Settings=exports.walkStream=exports.walkSync=exports.walk=void 0;let t=ba(),n=xa(),r=Ca(),i=wa();exports.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}exports.walk=a;function o(e,t){let n=c(t),i=new r.default(e,n);return i.read()}exports.walkSync=o;function s(e,t){let r=c(t),i=new n.default(e,r);return i.read()}exports.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}}),Ea=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ra(),r=Xi();var i=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};exports.default=i}),Da=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=ra(),r=Ta(),i=Ea();var a=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}};exports.default=a}),Oa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Ta(),n=Ea(),r=Da();var i=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}};exports.default=i}),ka=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){let e=t.pattern.expandPatternsWithBraceExpansion(this._patterns);for(let t of e){let e=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(e);this._storage.push({complete:n.length<=1,pattern:t,segments:e,sections:n})}}_getPatternSegments(e){let n=t.pattern.getPatternParts(e,this._micromatchOptions);return n.map(e=>{let n=t.pattern.isDynamicPattern(e,this._settings);return n?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e}})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}};exports.default=n}),Aa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ka();var n=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length)return!0;let i=t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)});if(i)return!0}return!1}};exports.default=n}),ja=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi(),n=Aa();var r=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;if(e===``)return n;let r=e.split(`/`).length;return n-r}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}};exports.default=r}),Ma=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let r=t.pattern.convertPatternsToRe(e,this._micromatchOptions),i=t.pattern.convertPatternsToRe(n,this._micromatchOptions);return e=>this._filter(e,r,i)}_filter(e,t,n){if(this._settings.unique&&this._isDuplicateEntry(e)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(e.path,n))return!1;let r=this._settings.baseNameMatch?e.name:e.path,i=e.dirent.isDirectory(),a=this._isMatchToPatterns(r,t,i)&&!this._isMatchToPatterns(e.path,n,i);return this._settings.unique&&a&&this._createIndexRecord(e),a}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,n){if(!this._settings.absolute)return!1;let r=t.path.makeAbsolute(this._settings.cwd,e);return t.pattern.matchAny(r,n)}_isMatchToPatterns(e,n,r){let i=t.path.removeLeadingDotSegment(e),a=t.pattern.matchAny(i,n);return!a&&r?t.pattern.matchAny(i+`/`,n):a}};exports.default=n}),Na=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};exports.default=n}),Pa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}};exports.default=n}),Fa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ja(),r=Ma(),i=Na(),a=Pa();var o=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};exports.default=o}),Ia=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Oa(),n=Fa();var r=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e),r=await this.api(t,e,n);return r.map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=r}),La=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=Da(),r=Fa();var i=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=i}),Ra=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ra(),n=Ta(),r=Ea();var i=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);if(i===null||!t.entryFilter(i))continue;n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};exports.default=i}),za=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Ra(),n=Fa();var r=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e),r=this.api(t,e,n);return r.map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=r}),Ba=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`),n=require(`os`),r=Math.max(n.cpus().length,1);exports.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};var i=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},exports.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};exports.default=i}),Va=o((exports,t)=>{let n=Zi(),r=Qi(),i=Ia(),a=La(),o=za(),s=Ba(),c=Xi();async function l(e,t){d(e);let n=u(e,i.default,t),r=await Promise.all(n);return c.array.flatten(r)}(function(e){function t(e,t){d(e);let n=u(e,o.default,t);return c.array.flatten(n)}e.sync=t;function i(e,t){d(e);let n=u(e,a.default,t);return c.stream.merge(n)}e.stream=i;function l(e,t){d(e);let i=r.transform([].concat(e)),a=new s.default(t);return n.generate(i,a)}e.generateTasks=l;function f(e,t){d(e);let n=new s.default(t);return c.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=f;function p(e){return d(e),c.path.escape(e)}e.escapePath=p})(l||={});function u(e,t,i){let a=r.transform([].concat(e)),o=new s.default(i),c=n.generate(a,o),l=new t(o);return c.map(l.read,l)}function d(e){let t=[].concat(e),n=t.every(e=>c.string.isString(e)&&!c.string.isEmpty(e));if(!n)throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=l});const Ha=`#0099F7`,Ua=`#F11712`,Wa=`#FFFF00`,Ga=e=>{let t=eo(e);return e=>`\u001B[38;5;${t}m${e}${(0,l.reset)(``)}`},Ka=(0,_.default)(Ha,Ua),qa=Ga(Ha),Ja=Ga(Ua),Ya=Ga(Wa),Xa=(...e)=>{Za((0,l.bold)(e.join(` `)))},Za=(...e)=>{console.log(...e)},Qa=(...e)=>{console.error(Ya((0,l.bold)(`>>>`)),e.join(` `))},$a=(...e)=>{console.error(Ja((0,l.bold)(`>>>`)),e.join(` `))};function eo(e){let t=Number.parseInt(e.slice(1),16),n=Math.floor(t/(256*256))%256,r=Math.floor(t/256)%256,i=t%256,a=16+36*Math.round(n/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return a}var to=c(Va());const no=`{turbo.json,turbo.jsonc}`,ro={};function io(e){try{if(p.default.existsSync(m.default.join(e,`pnpm-workspace.yaml`))){let t=xi.load(p.default.readFileSync(m.default.join(e,`pnpm-workspace.yaml`),`utf8`));return t.packages||[]}let t=JSON.parse(p.default.readFileSync(m.default.join(e,`package.json`),`utf8`));if(t.workspaces){if(`packages`in t.workspaces)return t.workspaces.packages||[];if(Array.isArray(t.workspaces))return t.workspaces}return[]}catch{return[]}}function ao(e,t){let n=ue(e,t),r=[],i=t?.cache??!0;if(i&&e&&e in ro)return ro[e];if(n){let e=io(n),t=e.map(e=>`${e}/${no}`),i=(0,to.sync)([no,...t],{cwd:n,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(e=>m.default.join(n,e)),a={};for(let e of i){let t=m.default.dirname(e);a[t]||(a[t]=[]),a[t].push(e)}for(let[e,t]of Object.entries(a)){if(t.length>1){let t=`Found both turbo.json and turbo.jsonc in the same directory: ${e}\nPlease use either turbo.json or turbo.jsonc, but not both.`;throw $a(t),Error(t)}let i=t[0];try{let e=p.default.readFileSync(i,`utf8`),t=f.default.parse(e),a=m.default.dirname(i)===n;if(a){if(`extends`in t)continue}else if(!(`extends`in t))continue;r.push({config:t,turboConfigPath:i,workspacePath:m.default.dirname(i),isRootConfig:a})}catch(e){Qa(e)}}}return i&&e&&(ro[e]=r),r}function oo(e,t){if(`pipeline`in e)for(let n of Object.entries(e.pipeline))t(n);else for(let n of Object.entries(e.tasks))t(n)}var so=o((exports,t)=>{t.exports=a,a.sync=o;var n=require(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),co=o((exports,t)=>{t.exports=r,r.sync=i;var n=require(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=parseInt(`100`,8),c=parseInt(`010`,8),l=parseInt(`001`,8),u=s|c,d=n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0;return d}}),lo=o((exports,t)=>{var n=require(`fs`),r;r=process.platform===`win32`||global.TESTING_WINDOWS?so():co(),t.exports=i,i.sync=a;function i(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),uo=o((exports,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=require(`path`),i=n?`;`:`:`,a=lo(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;a(f(p,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)},l=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{let e=a.sync(n,{pathExt:c});if(e)if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)};t.exports=c,c.sync=l}),fo=o((exports,t)=>{let n=(e={})=>{let t=e.env||process.env,n=e.platform||process.platform;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),po=o((exports,t)=>{let n=require(`path`),r=uo(),i=fo();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),mo=o((exports,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),ho=o((exports,t)=>{t.exports=/^#!(.*)/}),go=o((exports,t)=>{let n=ho();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),_o=o((exports,t)=>{let n=require(`fs`),r=go();function i(e){let t=150,i=Buffer.alloc(t),a;try{a=n.openSync(e,`r`),n.readSync(a,i,0,t,0),n.closeSync(a)}catch{}return r(i.toString())}t.exports=i}),vo=o((exports,t)=>{let n=require(`path`),r=po(),i=mo(),a=_o(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r));let a=[e.command].concat(e.args).join(` `);e.args=[`/d`,`/s`,`/c`,`"${a}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),yo=o((exports,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),bo=o((exports,t)=>{let n=require(`child_process`),r=vo(),i=yo();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i}),xo=o((exports,t)=>{t.exports=e=>{let t=typeof e==`string`?`
48
+ t.exports=r;let n=ia();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}}),oa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10),i=10,a=10,o=n>i,s=n===i&&r>=a;exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES=o||s}),sa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}exports.createDirentFromStats=n}),ca=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.fs=void 0;let t=sa();exports.fs=t}),la=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}exports.joinPathSegments=t}),ua=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.readdir=exports.readdirWithFileTypes=exports.read=void 0;let t=ra(),n=aa(),r=oa(),i=ca(),a=la();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}exports.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}let l=s.map(e=>c(e,t));n(l,(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}exports.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}let l=c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}});n(l,(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}exports.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}}),da=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.readdir=exports.readdirWithFileTypes=exports.read=void 0;let t=ra(),n=oa(),r=ca(),i=la();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}exports.read=a;function o(e,t){let n=t.fs.readdirSync(e,{withFileTypes:!0});return n.map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}exports.readdirWithFileTypes=o;function s(e,n){let a=n.fs.readdirSync(e);return a.map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}exports.readdir=s}),fa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.createFileSystemAdapter=exports.FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`);exports.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?exports.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},exports.FILE_SYSTEM_ADAPTER),t)}exports.createFileSystemAdapter=n}),pa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ra(),r=fa();var i=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}};exports.default=i}),ma=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Settings=exports.scandirSync=exports.scandir=void 0;let t=ua(),n=da(),r=pa();exports.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}exports.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}exports.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}}),ha=o((exports,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n}),ga=o((exports,t)=>{var n=ha();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){var e=new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})});return e}}t.exports=r,t.exports.promise=o}),_a=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.joinPathSegments=exports.replacePathSegmentSeparator=exports.isAppliedFilter=exports.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}exports.isFatalError=t;function n(e,t){return e===null||e(t)}exports.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}exports.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}exports.joinPathSegments=i}),va=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=_a();var n=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}};exports.default=n}),ya=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`events`),n=ma(),r=ga(),i=_a(),a=va();var o=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}};exports.default=o}),ba=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ya();var n=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{r(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{i(e,this._storage)}),this._reader.read()}};exports.default=n;function r(e,t){e(t)}function i(e,t){e(null,t)}}),xa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=ya();var r=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};exports.default=r}),Sa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ma(),n=_a(),r=va();var i=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};exports.default=i}),Ca=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Sa();var n=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}};exports.default=n}),wa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ma();var r=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}};exports.default=r}),Ta=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Settings=exports.walkStream=exports.walkSync=exports.walk=void 0;let t=ba(),n=xa(),r=Ca(),i=wa();exports.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}exports.walk=a;function o(e,t){let n=c(t),i=new r.default(e,n);return i.read()}exports.walkSync=o;function s(e,t){let r=c(t),i=new n.default(e,r);return i.read()}exports.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}}),Ea=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ra(),r=Xi();var i=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};exports.default=i}),Da=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=ra(),r=Ta(),i=Ea();var a=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}};exports.default=a}),Oa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Ta(),n=Ea(),r=Da();var i=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}};exports.default=i}),ka=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){let e=t.pattern.expandPatternsWithBraceExpansion(this._patterns);for(let t of e){let e=this._getPatternSegments(t),n=this._splitSegmentsIntoSections(e);this._storage.push({complete:n.length<=1,pattern:t,segments:e,sections:n})}}_getPatternSegments(e){let n=t.pattern.getPatternParts(e,this._micromatchOptions);return n.map(e=>{let n=t.pattern.isDynamicPattern(e,this._settings);return n?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e}})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}};exports.default=n}),Aa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ka();var n=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length)return!0;let i=t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)});if(i)return!0}return!1}};exports.default=n}),ja=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi(),n=Aa();var r=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;if(e===``)return n;let r=e.split(`/`).length;return n-r}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}};exports.default=r}),Ma=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let r=t.pattern.convertPatternsToRe(e,this._micromatchOptions),i=t.pattern.convertPatternsToRe(n,this._micromatchOptions);return e=>this._filter(e,r,i)}_filter(e,t,n){if(this._settings.unique&&this._isDuplicateEntry(e)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(e.path,n))return!1;let r=this._settings.baseNameMatch?e.name:e.path,i=e.dirent.isDirectory(),a=this._isMatchToPatterns(r,t,i)&&!this._isMatchToPatterns(e.path,n,i);return this._settings.unique&&a&&this._createIndexRecord(e),a}_isDuplicateEntry(e){return this.index.has(e.path)}_createIndexRecord(e){this.index.set(e.path,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,n){if(!this._settings.absolute)return!1;let r=t.path.makeAbsolute(this._settings.cwd,e);return t.pattern.matchAny(r,n)}_isMatchToPatterns(e,n,r){let i=t.path.removeLeadingDotSegment(e),a=t.pattern.matchAny(i,n);return!a&&r?t.pattern.matchAny(i+`/`,n):a}};exports.default=n}),Na=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};exports.default=n}),Pa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Xi();var n=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}};exports.default=n}),Fa=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`path`),n=ja(),r=Ma(),i=Na(),a=Pa();var o=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};exports.default=o}),Ia=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Oa(),n=Fa();var r=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e),r=await this.api(t,e,n);return r.map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=r}),La=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=require(`stream`),n=Da(),r=Fa();var i=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=i}),Ra=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=ra(),n=Ta(),r=Ea();var i=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);if(i===null||!t.entryFilter(i))continue;n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};exports.default=i}),za=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0});let t=Ra(),n=Fa();var r=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e),r=this.api(t,e,n);return r.map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}};exports.default=r}),Ba=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=require(`fs`),n=require(`os`),r=Math.max(n.cpus().length,1);exports.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};var i=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},exports.DEFAULT_FILE_SYSTEM_ADAPTER),t)}};exports.default=i}),Va=o((exports,t)=>{let n=Zi(),r=Qi(),i=Ia(),a=La(),o=za(),s=Ba(),c=Xi();async function l(e,t){d(e);let n=u(e,i.default,t),r=await Promise.all(n);return c.array.flatten(r)}(function(e){function t(e,t){d(e);let n=u(e,o.default,t);return c.array.flatten(n)}e.sync=t;function i(e,t){d(e);let n=u(e,a.default,t);return c.stream.merge(n)}e.stream=i;function l(e,t){d(e);let i=r.transform([].concat(e)),a=new s.default(t);return n.generate(i,a)}e.generateTasks=l;function f(e,t){d(e);let n=new s.default(t);return c.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=f;function p(e){return d(e),c.path.escape(e)}e.escapePath=p})(l||={});function u(e,t,i){let a=r.transform([].concat(e)),o=new s.default(i),c=n.generate(a,o),l=new t(o);return c.map(l.read,l)}function d(e){let t=[].concat(e),n=t.every(e=>c.string.isString(e)&&!c.string.isEmpty(e));if(!n)throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=l});const Ha=`#0099F7`,Ua=`#F11712`,Wa=`#FFFF00`,Ga=e=>{let t=eo(e);return e=>`\u001B[38;5;${t}m${e}${(0,l.reset)(``)}`},Ka=(0,_.default)(Ha,Ua),qa=Ga(Ha),Ja=Ga(Ua),Ya=Ga(Wa),Xa=(...e)=>{Za((0,l.bold)(e.join(` `)))},Za=(...e)=>{console.log(...e)},Qa=(...e)=>{console.error(Ya((0,l.bold)(`>>>`)),e.join(` `))},$a=(...e)=>{console.error(Ja((0,l.bold)(`>>>`)),e.join(` `))};function eo(e){let t=Number.parseInt(e.slice(1),16),n=Math.floor(t/(256*256))%256,r=Math.floor(t/256)%256,i=t%256,a=16+36*Math.round(n/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5);return a}var to=c(Va());const no=`{turbo.json,turbo.jsonc}`,ro={};function io(e){try{if(p.default.existsSync(m.default.join(e,`pnpm-workspace.yaml`))){let t=xi.load(p.default.readFileSync(m.default.join(e,`pnpm-workspace.yaml`),`utf8`));return t.packages||[]}let t=JSON.parse(p.default.readFileSync(m.default.join(e,`package.json`),`utf8`));if(t.workspaces){if(`packages`in t.workspaces)return t.workspaces.packages||[];if(Array.isArray(t.workspaces))return t.workspaces}return[]}catch{return[]}}function ao(e,t){let n=ue(e,t),r=[],i=t?.cache??!0;if(i&&e&&e in ro)return ro[e];if(n){let e=io(n),t=e.map(e=>`${e}/${no}`),i=(0,to.sync)([no,...t],{cwd:n,onlyFiles:!0,followSymbolicLinks:!1,suppressErrors:!0}).map(e=>m.default.join(n,e)),a={};for(let e of i){let t=m.default.dirname(e);a[t]||(a[t]=[]),a[t].push(e)}for(let[e,t]of Object.entries(a)){if(t.length>1){let t=`Found both turbo.json and turbo.jsonc in the same directory: ${e}\nPlease use either turbo.json or turbo.jsonc, but not both.`;throw $a(t),Error(t)}let i=t[0];try{let e=p.default.readFileSync(i,`utf8`),t=f.default.parse(e),a=m.default.dirname(i)===n;if(a){if(`extends`in t)continue}else if(!(`extends`in t))continue;r.push({config:t,turboConfigPath:i,workspacePath:m.default.dirname(i),isRootConfig:a})}catch(e){Qa(e)}}}return i&&e&&(ro[e]=r),r}function oo(e,t){if(`pipeline`in e){if(!e.pipeline)return;for(let n of Object.entries(e.pipeline))t(n)}else{if(!e.tasks)return;for(let n of Object.entries(e.tasks))t(n)}}var so=o((exports,t)=>{t.exports=a,a.sync=o;var n=require(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),co=o((exports,t)=>{t.exports=r,r.sync=i;var n=require(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=parseInt(`100`,8),c=parseInt(`010`,8),l=parseInt(`001`,8),u=s|c,d=n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0;return d}}),lo=o((exports,t)=>{var n=require(`fs`),r;r=process.platform===`win32`||global.TESTING_WINDOWS?so():co(),t.exports=i,i.sync=a;function i(e,t,n){if(typeof t==`function`&&(n=t,t={}),!n){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,r){i(e,t||{},function(e,t){e?r(e):n(t)})})}r(e,t||{},function(e,r){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)})}function a(e,t){try{return r.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),uo=o((exports,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=require(`path`),i=n?`;`:`:`,a=lo(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e),p=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;a(f(p,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)},l=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{let e=a.sync(n,{pathExt:c});if(e)if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)};t.exports=c,c.sync=l}),fo=o((exports,t)=>{let n=(e={})=>{let t=e.env||process.env,n=e.platform||process.platform;return n===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),po=o((exports,t)=>{let n=require(`path`),r=uo(),i=fo();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),mo=o((exports,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,`$1$1\\"`),e=e.replace(/(?=(\\+?)?)\1$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),ho=o((exports,t)=>{t.exports=/^#!(.*)/}),go=o((exports,t)=>{let n=ho();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),_o=o((exports,t)=>{let n=require(`fs`),r=go();function i(e){let t=150,i=Buffer.alloc(t),a;try{a=n.openSync(e,`r`),n.readSync(a,i,0,t,0),n.closeSync(a)}catch{}return r(i.toString())}t.exports=i}),vo=o((exports,t)=>{let n=require(`path`),r=po(),i=mo(),a=_o(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r));let a=[e.command].concat(e.args).join(` `);e.args=[`/d`,`/s`,`/c`,`"${a}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),yo=o((exports,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),bo=o((exports,t)=>{let n=require(`child_process`),r=vo(),i=yo();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i}),xo=o((exports,t)=>{t.exports=e=>{let t=typeof e==`string`?`
49
49
  `:10,n=typeof e==`string`?`\r`:13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e}}),So=o((exports,t)=>{let n=require(`path`),r=fo(),i=e=>{e={cwd:process.cwd(),path:process.env[r()],execPath:process.execPath,...e};let t,i=n.resolve(e.cwd),a=[];for(;t!==i;)a.push(n.join(i,`node_modules/.bin`)),t=i,i=n.resolve(i,`..`);let o=n.resolve(e.cwd,e.execPath,`..`);return a.push(o),a.concat(e.path).join(n.delimiter)};t.exports=i,t.exports.default=i,t.exports.env=e=>{e={env:process.env,...e};let n={...e.env},i=r({env:n});return e.path=n[i],n[i]=t.exports(e),n}}),Co=o((exports,t)=>{let n=(e,t)=>{for(let n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};t.exports=n,t.exports.default=n}),wo=o((exports,t)=>{let n=Co(),r=new WeakMap,i=(e,t={})=>{if(typeof e!=`function`)throw TypeError(`Expected a function`);let i,a=0,o=e.displayName||e.name||`<anonymous>`,s=function(...n){if(r.set(s,++a),a===1)i=e.apply(this,n),e=null;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return i};return n(s,e),r.set(s,a),s};t.exports=i,t.exports.default=i,t.exports.callCount=e=>{if(!r.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return r.get(e)}}),To=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SIGNALS=void 0;let t=[{name:`SIGHUP`,number:1,action:`terminate`,description:`Terminal closed`,standard:`posix`},{name:`SIGINT`,number:2,action:`terminate`,description:`User interruption with CTRL-C`,standard:`ansi`},{name:`SIGQUIT`,number:3,action:`core`,description:`User interruption with CTRL-\\`,standard:`posix`},{name:`SIGILL`,number:4,action:`core`,description:`Invalid machine instruction`,standard:`ansi`},{name:`SIGTRAP`,number:5,action:`core`,description:`Debugger breakpoint`,standard:`posix`},{name:`SIGABRT`,number:6,action:`core`,description:`Aborted`,standard:`ansi`},{name:`SIGIOT`,number:6,action:`core`,description:`Aborted`,standard:`bsd`},{name:`SIGBUS`,number:7,action:`core`,description:`Bus error due to misaligned, non-existing address or paging error`,standard:`bsd`},{name:`SIGEMT`,number:7,action:`terminate`,description:`Command should be emulated but is not implemented`,standard:`other`},{name:`SIGFPE`,number:8,action:`core`,description:`Floating point arithmetic error`,standard:`ansi`},{name:`SIGKILL`,number:9,action:`terminate`,description:`Forced termination`,standard:`posix`,forced:!0},{name:`SIGUSR1`,number:10,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGSEGV`,number:11,action:`core`,description:`Segmentation fault`,standard:`ansi`},{name:`SIGUSR2`,number:12,action:`terminate`,description:`Application-specific signal`,standard:`posix`},{name:`SIGPIPE`,number:13,action:`terminate`,description:`Broken pipe or socket`,standard:`posix`},{name:`SIGALRM`,number:14,action:`terminate`,description:`Timeout or timer`,standard:`posix`},{name:`SIGTERM`,number:15,action:`terminate`,description:`Termination`,standard:`ansi`},{name:`SIGSTKFLT`,number:16,action:`terminate`,description:`Stack is empty or overflowed`,standard:`other`},{name:`SIGCHLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`posix`},{name:`SIGCLD`,number:17,action:`ignore`,description:`Child process terminated, paused or unpaused`,standard:`other`},{name:`SIGCONT`,number:18,action:`unpause`,description:`Unpaused`,standard:`posix`,forced:!0},{name:`SIGSTOP`,number:19,action:`pause`,description:`Paused`,standard:`posix`,forced:!0},{name:`SIGTSTP`,number:20,action:`pause`,description:`Paused using CTRL-Z or "suspend"`,standard:`posix`},{name:`SIGTTIN`,number:21,action:`pause`,description:`Background process cannot read terminal input`,standard:`posix`},{name:`SIGBREAK`,number:21,action:`terminate`,description:`User interruption with CTRL-BREAK`,standard:`other`},{name:`SIGTTOU`,number:22,action:`pause`,description:`Background process cannot write to terminal output`,standard:`posix`},{name:`SIGURG`,number:23,action:`ignore`,description:`Socket received out-of-band data`,standard:`bsd`},{name:`SIGXCPU`,number:24,action:`core`,description:`Process timed out`,standard:`bsd`},{name:`SIGXFSZ`,number:25,action:`core`,description:`File too big`,standard:`bsd`},{name:`SIGVTALRM`,number:26,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGPROF`,number:27,action:`terminate`,description:`Timeout or timer`,standard:`bsd`},{name:`SIGWINCH`,number:28,action:`ignore`,description:`Terminal window size changed`,standard:`bsd`},{name:`SIGIO`,number:29,action:`terminate`,description:`I/O is available`,standard:`other`},{name:`SIGPOLL`,number:29,action:`terminate`,description:`Watched event`,standard:`other`},{name:`SIGINFO`,number:29,action:`ignore`,description:`Request for process information`,standard:`other`},{name:`SIGPWR`,number:30,action:`terminate`,description:`Device running out of power`,standard:`systemv`},{name:`SIGSYS`,number:31,action:`core`,description:`Invalid system call`,standard:`other`},{name:`SIGUNUSED`,number:31,action:`terminate`,description:`Invalid system call`,standard:`other`}];exports.SIGNALS=t}),Eo=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.SIGRTMAX=exports.getRealtimeSignals=void 0;let t=function(){let e=i-r+1;return Array.from({length:e},n)};exports.getRealtimeSignals=t;let n=function(e,t){return{name:`SIGRT${t+1}`,number:r+t,action:`terminate`,description:`Application-specific signal (realtime)`,standard:`posix`}},r=34,i=64;exports.SIGRTMAX=i}),Do=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.getSignals=void 0;var t=require(`os`),n=To(),r=Eo();let i=function(){let e=(0,r.getRealtimeSignals)(),t=[...n.SIGNALS,...e].map(a);return t};exports.getSignals=i;let a=function({name:e,number:n,description:r,action:i,forced:a=!1,standard:o}){let{signals:{[e]:s}}=t.constants,c=s!==void 0,l=c?s:n;return{name:e,number:l,description:r,supported:c,action:i,forced:a,standard:o}}}),Oo=o(exports=>{Object.defineProperty(exports,`__esModule`,{value:!0}),exports.signalsByNumber=exports.signalsByName=void 0;var t=require(`os`),n=Do(),r=Eo();let i=function(){let e=(0,n.getSignals)();return e.reduce(a,{})},a=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}},o=i();exports.signalsByName=o;let s=function(){let e=(0,n.getSignals)(),t=r.SIGRTMAX+1,i=Array.from({length:t},(t,n)=>c(n,e));return Object.assign({},...i)},c=function(e,t){let n=l(e,t);if(n===void 0)return{};let{name:r,description:i,supported:a,action:o,forced:s,standard:c}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:c}}},l=function(e,n){let r=n.find(({name:n})=>t.constants.signals[n]===e);return r===void 0?n.find(t=>t.number===e):r},u=s();exports.signalsByNumber=u}),ko=o((exports,t)=>{let{signalsByName:n}=Oo(),r=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?`was canceled`:n===void 0?r===void 0?a===void 0?`failed`:`failed with exit code ${a}`:`was killed with ${r} (${i})`:`failed with ${n}`,i=({stdout:e,stderr:t,all:i,error:a,signal:o,exitCode:s,command:c,escapedCommand:l,timedOut:u,isCanceled:d,killed:f,parsed:{options:{timeout:p}}})=>{s=s===null?void 0:s,o=o===null?void 0:o;let m=o===void 0?void 0:n[o].description,h=a&&a.code,g=r({timedOut:u,timeout:p,errorCode:h,signal:o,signalDescription:m,exitCode:s,isCanceled:d}),_=`Command ${g}: ${c}`,v=Object.prototype.toString.call(a)===`[object Error]`,y=v?`${_}\n${a.message}`:_,b=[y,t,e].filter(Boolean).join(`
50
50
  `);return v?(a.originalMessage=a.message,a.message=b):a=Error(b),a.shortMessage=y,a.command=c,a.escapedCommand=l,a.exitCode=s,a.signal=o,a.signalDescription=m,a.stdout=e,a.stderr=t,i!==void 0&&(a.all=i),`bufferedData`in a&&delete a.bufferedData,a.failed=!0,a.timedOut=!!u,a.isCanceled=d,a.killed=f&&!u,a};t.exports=i}),Ao=o((exports,t)=>{let n=[`stdin`,`stdout`,`stderr`],r=e=>n.some(t=>e[t]!==void 0),i=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return n.map(t=>e[t]);if(r(e))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${n.map(e=>`\`${e}\``).join(`, `)}`);if(typeof t==`string`)return t;if(!Array.isArray(t))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let i=Math.max(t.length,n.length);return Array.from({length:i},(e,n)=>t[n])};t.exports=i,t.exports.node=e=>{let t=i(e);return t===`ipc`?`ipc`:t===void 0||typeof t==`string`?[t,t,t,`ipc`]:t.includes(`ipc`)?t:[...t,`ipc`]}}),jo=o((exports,t)=>{t.exports=[`SIGABRT`,`SIGALRM`,`SIGHUP`,`SIGINT`,`SIGTERM`],process.platform!==`win32`&&t.exports.push(`SIGVTALRM`,`SIGXCPU`,`SIGXFSZ`,`SIGUSR2`,`SIGTRAP`,`SIGSYS`,`SIGQUIT`,`SIGIOT`),process.platform===`linux`&&t.exports.push(`SIGIO`,`SIGPOLL`,`SIGPWR`,`SIGSTKFLT`,`SIGUNUSED`)}),Mo=o((exports,t)=>{var n=global.process;let r=function(e){return e&&typeof e==`object`&&typeof e.removeListener==`function`&&typeof e.emit==`function`&&typeof e.reallyExit==`function`&&typeof e.listeners==`function`&&typeof e.kill==`function`&&typeof e.pid==`number`&&typeof e.on==`function`};if(!r(n))t.exports=function(){return function(){}};else{var i=require(`assert`),a=jo(),o=/^win/i.test(n.platform),s=require(`events`);typeof s!=`function`&&(s=s.EventEmitter);var c;n.__signal_exit_emitter__?c=n.__signal_exit_emitter__:(c=n.__signal_exit_emitter__=new s,c.count=0,c.emitted={}),c.infinite||(c.setMaxListeners(1/0),c.infinite=!0),t.exports=function(e,t){if(!r(global.process))return function(){};i.equal(typeof e,`function`,`a callback must be provided for exit handler`),f===!1&&p();var n=`exit`;t&&t.alwaysLast&&(n=`afterexit`);var a=function(){c.removeListener(n,e),c.listeners(`exit`).length===0&&c.listeners(`afterexit`).length===0&&l()};return c.on(n,e),a};var l=function(){!f||!r(global.process)||(f=!1,a.forEach(function(e){try{n.removeListener(e,d[e])}catch{}}),n.emit=g,n.reallyExit=m,--c.count)};t.exports.unload=l;var u=function(e,t,n){c.emitted[e]||(c.emitted[e]=!0,c.emit(e,t,n))},d={};a.forEach(function(e){d[e]=function(){if(r(global.process)){var t=n.listeners(e);t.length===c.count&&(l(),u(`exit`,null,e),u(`afterexit`,null,e),o&&e===`SIGHUP`&&(e=`SIGINT`),n.kill(n.pid,e))}}}),t.exports.signals=function(){return a};var f=!1,p=function(){f||!r(global.process)||(f=!0,c.count+=1,a=a.filter(function(e){try{return n.on(e,d[e]),!0}catch{return!1}}),n.emit=_,n.reallyExit=h)};t.exports.load=p;var m=n.reallyExit,h=function(e){r(global.process)&&(n.exitCode=e||0,u(`exit`,n.exitCode,null),u(`afterexit`,n.exitCode,null),m.call(n,n.exitCode))},g=n.emit,_=function(e,t){if(e===`exit`&&r(global.process)){t!==void 0&&(n.exitCode=t);var i=g.apply(this,arguments);return u(`exit`,n.exitCode,null),u(`afterexit`,n.exitCode,null),i}else return g.apply(this,arguments)}}}),No=o((exports,t)=>{let n=require(`os`),r=Mo(),i=1e3*5,a=(e,t=`SIGTERM`,n={})=>{let r=e(t);return o(e,t,n,r),r},o=(e,t,n,r)=>{if(!s(t,n,r))return;let i=l(n),a=setTimeout(()=>{e(`SIGKILL`)},i);a.unref&&a.unref()},s=(e,{forceKillAfterTimeout:t},n)=>c(e)&&t!==!1&&n,c=e=>e===n.constants.signals.SIGTERM||typeof e==`string`&&e.toUpperCase()===`SIGTERM`,l=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return i;if(!Number.isFinite(e)||e<0)throw TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},u=(e,t)=>{let n=e.kill();n&&(t.isCanceled=!0)},d=(e,t,n)=>{e.kill(t),n(Object.assign(Error(`Timed out`),{timedOut:!0,signal:t}))},f=(e,{timeout:t,killSignal:n=`SIGTERM`},r)=>{if(t===0||t===void 0)return r;let i,a=new Promise((r,a)=>{i=setTimeout(()=>{d(e,n,a)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},p=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},m=async(e,{cleanup:t,detached:n},i)=>{if(!t||n)return i;let a=r(()=>{e.kill()});return i.finally(()=>{a()})};t.exports={spawnedKill:a,spawnedCancel:u,setupTimeout:f,validateTimeout:p,setExitHandler:m}}),Po=o((exports,t)=>{let n=e=>typeof e==`object`&&!!e&&typeof e.pipe==`function`;n.writable=e=>n(e)&&e.writable!==!1&&typeof e._write==`function`&&typeof e._writableState==`object`,n.readable=e=>n(e)&&e.readable!==!1&&typeof e._read==`function`&&typeof e._readableState==`object`,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&typeof e._transform==`function`,t.exports=n}),Fo=o((exports,t)=>{let{PassThrough:n}=require(`stream`);t.exports=e=>{e={...e};let{array:t}=e,{encoding:r}=e,i=r===`buffer`,a=!1;t?a=!(r||i):r||=`utf8`,i&&(r=null);let o=new n({objectMode:a});r&&o.setEncoding(r);let s=0,c=[];return o.on(`data`,e=>{c.push(e),a?s=c.length:s+=e.length}),o.getBufferedValue=()=>t?c:i?Buffer.concat(c,s):c.join(``),o.getBufferedLength=()=>s,o}}),Io=o((exports,t)=>{let{constants:n}=require(`buffer`),r=require(`stream`),{promisify:i}=require(`util`),a=Fo(),o=i(r.pipeline);var s=class extends Error{constructor(){super(`maxBuffer exceeded`),this.name=`MaxBufferError`}};async function c(e,t){if(!e)throw Error(`Expected a stream`);t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,i=a(t);return await new Promise((t,a)=>{let c=e=>{e&&i.getBufferedLength()<=n.MAX_LENGTH&&(e.bufferedData=i.getBufferedValue()),a(e)};(async()=>{try{await o(e,i),t()}catch(e){c(e)}})(),i.on(`data`,()=>{i.getBufferedLength()>r&&c(new s)})}),i.getBufferedValue()}t.exports=c,t.exports.buffer=(e,t)=>c(e,{...t,encoding:`buffer`}),t.exports.array=(e,t)=>c(e,{...t,array:!0}),t.exports.MaxBufferError=s}),Lo=o((exports,t)=>{let{PassThrough:n}=require(`stream`);t.exports=function(){var e=[],t=new n({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=i,t.on(`unpipe`,a),Array.prototype.slice.call(arguments).forEach(r),t;function r(n){return Array.isArray(n)?(n.forEach(r),this):(e.push(n),n.once(`end`,a.bind(null,n)),n.once(`error`,t.emit.bind(t,`error`)),n.pipe(t,{end:!1}),this)}function i(){return e.length==0}function a(n){e=e.filter(function(e){return e!==n}),!e.length&&t.readable&&t.end()}}}),Ro=o((exports,t)=>{let n=Po(),r=Io(),i=Lo(),a=(e,t)=>{t===void 0||e.stdin===void 0||(n(t)?t.pipe(e.stdin):e.stdin.end(t))},o=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=i();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},s=async(e,t)=>{if(e){e.destroy();try{return await t}catch(e){return e.bufferedData}}},c=(e,{encoding:t,buffer:n,maxBuffer:i})=>{if(!(!e||!n))return t?r(e,{encoding:t,maxBuffer:i}):r.buffer(e,{maxBuffer:i})},l=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{let l=c(e,{encoding:r,buffer:i,maxBuffer:a}),u=c(t,{encoding:r,buffer:i,maxBuffer:a}),d=c(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,l,u,d])}catch(r){return Promise.all([{error:r,signal:r.signal,timedOut:r.timedOut},s(e,l),s(t,u),s(n,d)])}},u=({input:e})=>{if(n(e))throw TypeError("The `input` option cannot be a stream in sync mode")};t.exports={handleInput:a,makeAllStream:o,getSpawnedResult:l,validateInputSync:u}}),zo=o((exports,t)=>{let n=(async()=>{})().constructor.prototype,r=[`then`,`catch`,`finally`].map(e=>[e,Reflect.getOwnPropertyDescriptor(n,e)]),i=(e,t)=>{for(let[n,i]of r){let r=typeof t==`function`?(...e)=>Reflect.apply(i.value,t(),e):i.value.bind(t);Reflect.defineProperty(e,n,{...i,value:r})}return e},a=e=>new Promise((t,n)=>{e.on(`exit`,(e,n)=>{t({exitCode:e,signal:n})}),e.on(`error`,e=>{n(e)}),e.stdin&&e.stdin.on(`error`,e=>{n(e)})});t.exports={mergePromise:i,getSpawnedPromise:a}}),Bo=o((exports,t)=>{let n=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],r=/^[\w.-]+$/,i=/"/g,a=e=>typeof e!=`string`||r.test(e)?e:`"${e.replace(i,`\\"`)}"`,o=(e,t)=>n(e,t).join(` `),s=(e,t)=>n(e,t).map(e=>a(e)).join(` `),c=/ +/g,l=e=>{let t=[];for(let n of e.trim().split(c)){let e=t[t.length-1];e&&e.endsWith(`\\`)?t[t.length-1]=`${e.slice(0,-1)} ${n}`:t.push(n)}return t};t.exports={joinCommand:o,getEscapedCommand:s,parseCommand:l}}),Vo=o((exports,t)=>{let n=require(`path`),r=require(`child_process`),i=bo(),a=xo(),o=So(),s=wo(),c=ko(),l=Ao(),{spawnedKill:u,spawnedCancel:d,setupTimeout:f,validateTimeout:p,setExitHandler:m}=No(),{handleInput:h,getSpawnedResult:g,makeAllStream:_,validateInputSync:v}=Ro(),{mergePromise:y,getSpawnedPromise:b}=zo(),{joinCommand:x,parseCommand:S,getEscapedCommand:C}=Bo(),w=1e3*1e3*100,T=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{let a=t?{...process.env,...e}:e;return n?o.env({env:a,cwd:r,execPath:i}):a},E=(e,t,r={})=>{let a=i._parse(e,t,r);return e=a.command,t=a.args,r=a.options,r={maxBuffer:w,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:`utf8`,reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=T(r),r.stdio=l(r),process.platform===`win32`&&n.basename(e,`.exe`)===`cmd`&&t.unshift(`/q`),{file:e,args:t,options:r,parsed:a}},D=(e,t,n)=>typeof t!=`string`&&!Buffer.isBuffer(t)?n===void 0?void 0:``:e.stripFinalNewline?a(t):t,O=(e,t,n)=>{let i=E(e,t,n),a=x(e,t),o=C(e,t);p(i.options);let l;try{l=r.spawn(i.file,i.args,i.options)}catch(e){let t=new r.ChildProcess,n=Promise.reject(c({error:e,stdout:``,stderr:``,all:``,command:a,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1}));return y(t,n)}let v=b(l),S=f(l,i.options,v),w=m(l,i.options,S),T={isCanceled:!1};l.kill=u.bind(null,l.kill.bind(l)),l.cancel=d.bind(null,l,T);let O=async()=>{let[{error:e,exitCode:t,signal:n,timedOut:r},s,u,d]=await g(l,i.options,w),f=D(i.options,s),p=D(i.options,u),m=D(i.options,d);if(e||t!==0||n!==null){let s=c({error:e,exitCode:t,signal:n,stdout:f,stderr:p,all:m,command:a,escapedCommand:o,parsed:i,timedOut:r,isCanceled:T.isCanceled,killed:l.killed});if(!i.options.reject)return s;throw s}return{command:a,escapedCommand:o,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},k=s(O);return h(l,i.options.input),l.all=_(l,i.options),y(l,k)};t.exports=O,t.exports.sync=(e,t,n)=>{let i=E(e,t,n),a=x(e,t),o=C(e,t);v(i.options);let s;try{s=r.spawnSync(i.file,i.args,i.options)}catch(e){throw c({error:e,stdout:``,stderr:``,all:``,command:a,escapedCommand:o,parsed:i,timedOut:!1,isCanceled:!1,killed:!1})}let l=D(i.options,s.stdout,s.error),u=D(i.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let e=c({stdout:l,stderr:u,error:s.error,signal:s.signal,exitCode:s.status,command:a,escapedCommand:o,parsed:i,timedOut:s.error&&s.error.code===`ETIMEDOUT`,isCanceled:!1,killed:s.signal!==null});if(!i.options.reject)return e;throw e}return{command:a,escapedCommand:o,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(e,t)=>{let[n,...r]=S(e);return O(n,r,t)},t.exports.commandSync=(e,t)=>{let[n,...r]=S(e);return O.sync(n,r,t)},t.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t==`object`&&(n=t,t=[]);let r=l.node(n),i=process.execArgv.filter(e=>!e.startsWith(`--inspect`)),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return O(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})}}),Ho=c(Vo());const Uo=5e3;async function Wo(e,t=[],n){let r={cwd:v.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:`0`},timeout:Uo,...n};try{let{stdout:n}=await(0,Ho.default)(e,t,r);return n.trim()}catch{return}}async function Go(){let[e,t,n,r]=await Promise.all([Wo(`yarnpkg`,[`--version`],{cwd:`.`}),Wo(`npm`,[`--version`]),Wo(`pnpm`,[`--version`]),Wo(`bun`,[`--version`])]);return{yarn:e,pnpm:n,npm:t,bun:r}}async function Ko(){let[e,t,n,r]=await Promise.all([Wo(`yarnpkg`,[`--version`],{cwd:`.`}).then(e=>{if(e&&!e.startsWith(`1.`))return`.yarn/releases/yarn-${e}.cjs`;if(e)return Wo(`yarn`,[`global`,`bin`])}),Wo(`npm`,[`config`,`get`,`prefix`]),Wo(`pnpm`,[`bin`,`--global`]),Wo(`bun`,[`pm`,`--g`,`bin`])]);return{yarn:e,pnpm:n,npm:t,bun:r}}var qo=Object.defineProperty,Jo=(e,t)=>{for(var n in t)qo(e,n,{get:t[n],enumerable:!0})},Yo=typeof process==`object`&&process?process:{stdout:null,stderr:null},Xo=e=>!!e&&typeof e==`object`&&(e instanceof Vs||e instanceof x.default||Zo(e)||Qo(e)),Zo=e=>!!e&&typeof e==`object`&&e instanceof w.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==x.default.Writable.prototype.pipe,Qo=e=>!!e&&typeof e==`object`&&e instanceof w.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`,$o=Symbol(`EOF`),es=Symbol(`maybeEmitEnd`),ts=Symbol(`emittedEnd`),ns=Symbol(`emittingEnd`),rs=Symbol(`emittedError`),os=Symbol(`closed`),ss=Symbol(`read`),cs=Symbol(`flush`),ls=Symbol(`flushChunk`),us=Symbol(`encoding`),ds=Symbol(`decoder`),fs=Symbol(`flowing`),ps=Symbol(`paused`),ms=Symbol(`resume`),hs=Symbol(`buffer`),gs=Symbol(`pipes`),_s=Symbol(`bufferLength`),vs=Symbol(`bufferPush`),ys=Symbol(`bufferShift`),bs=Symbol(`objectMode`),xs=Symbol(`destroyed`),Ss=Symbol(`error`),Cs=Symbol(`emitData`),ws=Symbol(`emitEnd`),Ts=Symbol(`emitEnd2`),Es=Symbol(`async`),Ds=Symbol(`abort`),Os=Symbol(`aborted`),ks=Symbol(`signal`),As=Symbol(`dataListeners`),js=Symbol(`discarded`),Ms=e=>Promise.resolve().then(e),Ns=e=>e(),Ps=e=>e===`end`||e===`finish`||e===`prefinish`,Fs=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,Is=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Ls=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[ms](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Rs=class extends Ls{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}},zs=e=>!!e.objectMode,Bs=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,Vs=class extends w.EventEmitter{[fs]=!1;[ps]=!1;[gs]=[];[hs]=[];[bs];[us];[Es];[ds];[$o]=!1;[ts]=!1;[ns]=!1;[os]=!1;[rs]=null;[_s]=0;[xs]=!1;[ks];[Os]=!1;[As]=0;[js]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);zs(t)?(this[bs]=!0,this[us]=null):Bs(t)?(this[us]=t.encoding,this[bs]=!1):(this[bs]=!1,this[us]=null),this[Es]=!!t.async,this[ds]=this[us]?new T.StringDecoder(this[us]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,`buffer`,{get:()=>this[hs]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,`pipes`,{get:()=>this[gs]});let{signal:n}=t;n&&(this[ks]=n,n.aborted?this[Ds]():n.addEventListener(`abort`,()=>this[Ds]()))}get bufferLength(){return this[_s]}get encoding(){return this[us]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[bs]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[Es]}set async(e){this[Es]=this[Es]||!!e}[Ds](){this[Os]=!0,this.emit(`abort`,this[ks]?.reason),this.destroy(this[ks]?.reason)}get aborted(){return this[Os]}set aborted(e){}write(e,t,n){if(this[Os])return!1;if(this[$o])throw Error(`write after end`);if(this[xs])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[Es]?Ms:Ns;if(!this[bs]&&!Buffer.isBuffer(e)){if(Is(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Fs(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[bs]?(this[fs]&&this[_s]!==0&&this[cs](!0),this[fs]?this.emit(`data`,e):this[vs](e),this[_s]!==0&&this.emit(`readable`),n&&r(n),this[fs]):e.length?(typeof e==`string`&&!(t===this[us]&&!this[ds]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[us]&&(e=this[ds].write(e)),this[fs]&&this[_s]!==0&&this[cs](!0),this[fs]?this.emit(`data`,e):this[vs](e),this[_s]!==0&&this.emit(`readable`),n&&r(n),this[fs]):(this[_s]!==0&&this.emit(`readable`),n&&r(n),this[fs])}read(e){if(this[xs])return null;if(this[js]=!1,this[_s]===0||e===0||e&&e>this[_s])return this[es](),null;this[bs]&&(e=null),this[hs].length>1&&!this[bs]&&(this[hs]=[this[us]?this[hs].join(``):Buffer.concat(this[hs],this[_s])]);let t=this[ss](e||null,this[hs][0]);return this[es](),t}[ss](e,t){if(this[bs])this[ys]();else{let n=t;e===n.length||e===null?this[ys]():typeof n==`string`?(this[hs][0]=n.slice(e),t=n.slice(0,e),this[_s]-=e):(this[hs][0]=n.subarray(e),t=n.subarray(0,e),this[_s]-=e)}return this.emit(`data`,t),!this[hs].length&&!this[$o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[$o]=!0,this.writable=!1,(this[fs]||!this[ps])&&this[es](),this}[ms](){this[xs]||(!this[As]&&!this[gs].length&&(this[js]=!0),this[ps]=!1,this[fs]=!0,this.emit(`resume`),this[hs].length?this[cs]():this[$o]?this[es]():this.emit(`drain`))}resume(){return this[ms]()}pause(){this[fs]=!1,this[ps]=!0,this[js]=!1}get destroyed(){return this[xs]}get flowing(){return this[fs]}get paused(){return this[ps]}[vs](e){this[bs]?this[_s]+=1:this[_s]+=e.length,this[hs].push(e)}[ys](){return this[bs]?--this[_s]:this[_s]-=this[hs][0].length,this[hs].shift()}[cs](e=!1){do;while(this[ls](this[ys]())&&this[hs].length);!e&&!this[hs].length&&!this[$o]&&this.emit(`drain`)}[ls](e){return this.emit(`data`,e),this[fs]}pipe(e,t){if(this[xs])return e;this[js]=!1;let n=this[ts];return t||={},e===Yo.stdout||e===Yo.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[gs].push(t.proxyErrors?new Rs(this,e,t):new Ls(this,e,t)),this[Es]?Ms(()=>this[ms]()):this[ms]()),e}unpipe(e){let t=this[gs].find(t=>t.dest===e);t&&(this[gs].length===1?(this[fs]&&this[As]===0&&(this[fs]=!1),this[gs]=[]):this[gs].splice(this[gs].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[js]=!1,this[As]++,!this[gs].length&&!this[fs]&&this[ms]();else if(e===`readable`&&this[_s]!==0)super.emit(`readable`);else if(Ps(e)&&this[ts])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[rs]){let e=t;this[Es]?Ms(()=>e.call(this,this[rs])):e.call(this,this[rs])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[As]=this.listeners(`data`).length,this[As]===0&&!this[js]&&!this[gs].length&&(this[fs]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[As]=0,!this[js]&&!this[gs].length&&(this[fs]=!1)),t}get emittedEnd(){return this[ts]}[es](){!this[ns]&&!this[ts]&&!this[xs]&&this[hs].length===0&&this[$o]&&(this[ns]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[os]&&this.emit(`close`),this[ns]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==xs&&this[xs])return!1;if(e===`data`)return!this[bs]&&!n?!1:this[Es]?(Ms(()=>this[Cs](n)),!0):this[Cs](n);if(e===`end`)return this[ws]();if(e===`close`){if(this[os]=!0,!this[ts]&&!this[xs])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[rs]=n,super.emit(Ss,n);let e=!this[ks]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[es](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[es](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[es](),r}[Cs](e){for(let t of this[gs])t.dest.write(e)===!1&&this.pause();let t=this[js]?!1:super.emit(`data`,e);return this[es](),t}[ws](){return this[ts]?!1:(this[ts]=!0,this.readable=!1,this[Es]?(Ms(()=>this[Ts]()),!0):this[Ts]())}[Ts](){if(this[ds]){let e=this[ds].end();if(e){for(let t of this[gs])t.dest.write(e);this[js]||super.emit(`data`,e)}}for(let e of this[gs])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[bs]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[bs]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[bs])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[us]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(xs,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[js]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[$o])return t();let r,i,a=e=>{this.off(`data`,o),this.off(`end`,s),this.off(xs,c),t(),i(e)},o=e=>{this.off(`error`,a),this.off(`end`,s),this.off(xs,c),this.pause(),r({value:e,done:!!this[$o]})},s=()=>{this.off(`error`,a),this.off(`data`,o),this.off(xs,c),t(),r({done:!0,value:void 0})},c=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(xs,c),this.once(`error`,a),this.once(`end`,s),this.once(`data`,o)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[js]=!1;let e=!1,t=()=>(this.pause(),this.off(Ss,t),this.off(xs,t),this.off(`end`,t),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}};return this.once(`end`,t),this.once(Ss,t),this.once(xs,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[xs])return e?this.emit(`error`,e):this.emit(xs),this;this[xs]=!0,this[js]=!0,this[hs].length=0,this[_s]=0;let t=this;return typeof t.close==`function`&&!this[os]&&t.close(),e?this.emit(`error`,e):this.emit(xs),this}static get isStream(){return Xo}},Hs=g.default.writev,Us=Symbol(`_autoClose`),Ws=Symbol(`_close`),Gs=Symbol(`_ended`),Ks=Symbol(`_fd`),qs=Symbol(`_finished`),Js=Symbol(`_flags`),Ys=Symbol(`_flush`),Xs=Symbol(`_handleChunk`),Zs=Symbol(`_makeBuf`),Qs=Symbol(`_mode`),$s=Symbol(`_needDrain`),ec=Symbol(`_onerror`),tc=Symbol(`_onopen`),nc=Symbol(`_onread`),rc=Symbol(`_onwrite`),ic=Symbol(`_open`),ac=Symbol(`_path`),oc=Symbol(`_pos`),sc=Symbol(`_queue`),cc=Symbol(`_read`),lc=Symbol(`_readSize`),uc=Symbol(`_reading`),dc=Symbol(`_remain`),fc=Symbol(`_size`),pc=Symbol(`_write`),mc=Symbol(`_writing`),hc=Symbol(`_defaultFlag`),gc=Symbol(`_errored`),_c=class extends Vs{[gc]=!1;[Ks];[ac];[lc];[uc]=!1;[fc];[dc];[Us];constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!=`string`)throw TypeError(`path must be a string`);this[gc]=!1,this[Ks]=typeof t.fd==`number`?t.fd:void 0,this[ac]=e,this[lc]=t.readSize||16*1024*1024,this[uc]=!1,this[fc]=typeof t.size==`number`?t.size:1/0,this[dc]=this[fc],this[Us]=typeof t.autoClose==`boolean`?t.autoClose:!0,typeof this[Ks]==`number`?this[cc]():this[ic]()}get fd(){return this[Ks]}get path(){return this[ac]}write(){throw TypeError(`this is a readable stream`)}end(){throw TypeError(`this is a readable stream`)}[ic](){g.default.open(this[ac],`r`,(e,t)=>this[tc](e,t))}[tc](e,t){e?this[ec](e):(this[Ks]=t,this.emit(`open`,t),this[cc]())}[Zs](){return Buffer.allocUnsafe(Math.min(this[lc],this[dc]))}[cc](){if(!this[uc]){this[uc]=!0;let e=this[Zs]();if(e.length===0)return process.nextTick(()=>this[nc](null,0,e));g.default.read(this[Ks],e,0,e.length,null,(e,t,n)=>this[nc](e,t,n))}}[nc](e,t,n){this[uc]=!1,e?this[ec](e):this[Xs](t,n)&&this[cc]()}[Ws](){if(this[Us]&&typeof this[Ks]==`number`){let e=this[Ks];this[Ks]=void 0,g.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}[ec](e){this[uc]=!0,this[Ws](),this.emit(`error`,e)}[Xs](e,t){let n=!1;return this[dc]-=e,e>0&&(n=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[dc]<=0)&&(n=!1,this[Ws](),super.end()),n}emit(e,...t){switch(e){case`prefinish`:case`finish`:return!1;case`drain`:return typeof this[Ks]==`number`&&this[cc](),!1;case`error`:return this[gc]?!1:(this[gc]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}},vc=class extends _c{[ic](){let e=!0;try{this[tc](null,g.default.openSync(this[ac],`r`)),e=!1}finally{e&&this[Ws]()}}[cc](){let e=!0;try{if(!this[uc]){this[uc]=!0;do{let e=this[Zs](),t=e.length===0?0:g.default.readSync(this[Ks],e,0,e.length,null);if(!this[Xs](t,e))break}while(!0);this[uc]=!1}e=!1}finally{e&&this[Ws]()}}[Ws](){if(this[Us]&&typeof this[Ks]==`number`){let e=this[Ks];this[Ks]=void 0,g.default.closeSync(e),this.emit(`close`)}}},yc=class extends h.default{readable=!1;writable=!0;[gc]=!1;[mc]=!1;[Gs]=!1;[sc]=[];[$s]=!1;[ac];[Qs];[Us];[Ks];[hc];[Js];[qs]=!1;[oc];constructor(e,t){t||={},super(t),this[ac]=e,this[Ks]=typeof t.fd==`number`?t.fd:void 0,this[Qs]=t.mode===void 0?438:t.mode,this[oc]=typeof t.start==`number`?t.start:void 0,this[Us]=typeof t.autoClose==`boolean`?t.autoClose:!0;let n=this[oc]===void 0?`w`:`r+`;this[hc]=t.flags===void 0,this[Js]=t.flags===void 0?n:t.flags,this[Ks]===void 0&&this[ic]()}emit(e,...t){if(e===`error`){if(this[gc])return!1;this[gc]=!0}return super.emit(e,...t)}get fd(){return this[Ks]}get path(){return this[ac]}[ec](e){this[Ws](),this[mc]=!0,this.emit(`error`,e)}[ic](){g.default.open(this[ac],this[Js],this[Qs],(e,t)=>this[tc](e,t))}[tc](e,t){this[hc]&&this[Js]===`r+`&&e&&e.code===`ENOENT`?(this[Js]=`w`,this[ic]()):e?this[ec](e):(this[Ks]=t,this.emit(`open`,t),this[mc]||this[Ys]())}end(e,t){return e&&this.write(e,t),this[Gs]=!0,!this[mc]&&!this[sc].length&&typeof this[Ks]==`number`&&this[rc](null,0),this}write(e,t){return typeof e==`string`&&(e=Buffer.from(e,t)),this[Gs]?(this.emit(`error`,Error(`write() after end()`)),!1):this[Ks]===void 0||this[mc]||this[sc].length?(this[sc].push(e),this[$s]=!0,!1):(this[mc]=!0,this[pc](e),!0)}[pc](e){g.default.write(this[Ks],e,0,e.length,this[oc],(e,t)=>this[rc](e,t))}[rc](e,t){e?this[ec](e):(this[oc]!==void 0&&typeof t==`number`&&(this[oc]+=t),this[sc].length?this[Ys]():(this[mc]=!1,this[Gs]&&!this[qs]?(this[qs]=!0,this[Ws](),this.emit(`finish`)):this[$s]&&(this[$s]=!1,this.emit(`drain`))))}[Ys](){if(this[sc].length===0)this[Gs]&&this[rc](null,0);else if(this[sc].length===1)this[pc](this[sc].pop());else{let e=this[sc];this[sc]=[],Hs(this[Ks],e,this[oc],(e,t)=>this[rc](e,t))}}[Ws](){if(this[Us]&&typeof this[Ks]==`number`){let e=this[Ks];this[Ks]=void 0,g.default.close(e,e=>e?this.emit(`error`,e):this.emit(`close`))}}},bc=class extends yc{[ic](){let e;if(this[hc]&&this[Js]===`r+`)try{e=g.default.openSync(this[ac],this[Js],this[Qs])}catch(e){if(e?.code===`ENOENT`)return this[Js]=`w`,this[ic]();throw e}else e=g.default.openSync(this[ac],this[Js],this[Qs]);this[tc](null,e)}[Ws](){if(this[Us]&&typeof this[Ks]==`number`){let e=this[Ks];this[Ks]=void 0,g.default.closeSync(e),this.emit(`close`)}}[pc](e){let t=!0;try{this[rc](null,g.default.writeSync(this[Ks],e,0,e.length,this[oc])),t=!1}finally{if(t)try{this[Ws]()}catch{}}}},xc=new Map([[`C`,`cwd`],[`f`,`file`],[`z`,`gzip`],[`P`,`preservePaths`],[`U`,`unlink`],[`strip-components`,`strip`],[`stripComponents`,`strip`],[`keep-newer`,`newer`],[`keepNewer`,`newer`],[`keep-newer-files`,`newer`],[`keepNewerFiles`,`newer`],[`k`,`keep`],[`keep-existing`,`keep`],[`keepExisting`,`keep`],[`m`,`noMtime`],[`no-mtime`,`noMtime`],[`p`,`preserveOwner`],[`L`,`follow`],[`h`,`follow`],[`onentry`,`onReadEntry`]]),Sc=e=>!!e.sync&&!!e.file,Cc=e=>!e.sync&&!!e.file,wc=e=>!!e.sync&&!e.file,Tc=e=>!e.sync&&!e.file,Ec=e=>!!e.file,Dc=e=>{let t=xc.get(e);return t||e},Oc=(e={})=>{if(!e)return{};let t={};for(let[n,r]of Object.entries(e)){let e=Dc(n);t[e]=r}return t.chmod===void 0&&t.noChmod===!1&&(t.chmod=!0),delete t.noChmod,t},kc=(e,t,n,r,i)=>Object.assign((a=[],o,s)=>{Array.isArray(a)&&(o=a,a={}),typeof o==`function`&&(s=o,o=void 0),o=o?Array.from(o):[];let c=Oc(a);if(i?.(c,o),Sc(c)){if(typeof s==`function`)throw TypeError(`callback not supported for sync tar functions`);return e(c,o)}else if(Cc(c)){let e=t(c,o),n=s||void 0;return n?e.then(()=>n(),n):e}else if(wc(c)){if(typeof s==`function`)throw TypeError(`callback not supported for sync tar functions`);return n(c,o)}else if(Tc(c)){if(typeof s==`function`)throw TypeError(`callback only supported with file option`);return r(c,o)}else throw Error(`impossible options??`)},{syncFile:e,asyncFile:t,syncNoFile:n,asyncNoFile:r,validate:i}),Ac=E.default.constants||{ZLIB_VERNUM:4736},jc=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Ac)),Mc=b.Buffer.concat,Nc=Object.getOwnPropertyDescriptor(b.Buffer,`concat`),Pc=e=>e,Fc=Nc?.writable===!0||Nc?.set!==void 0?e=>{b.Buffer.concat=e?Pc:Mc}:e=>{},Ic=Symbol(`_superWrite`),Lc=class extends Error{code;errno;constructor(e,t){super(`zlib: `+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||=`ZLIB_ERROR`,this.message=`zlib: `+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return`ZlibError`}},Rc=Symbol(`flushFlag`),zc=class extends Vs{#t=!1;#i=!1;#s;#n;#r;#e;#o;get sawError(){return this.#t}get handle(){return this.#e}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!=`object`)throw TypeError(`invalid options for ZlibBase constructor`);if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof E[t]!=`function`)throw TypeError(`Compression method not supported: `+t);try{this.#e=new E[t](e)}catch(e){throw new Lc(e,this.constructor)}this.#o=e=>{this.#t||(this.#t=!0,this.close(),this.emit(`error`,e))},this.#e?.on(`error`,e=>this.#o(new Lc(e))),this.once(`end`,()=>this.close)}close(){this.#e&&(this.#e.close(),this.#e=void 0,this.emit(`close`))}reset(){if(!this.#t)return(0,y.default)(this.#e,`zlib binding closed`),this.#e.reset?.()}flush(e){this.ended||(typeof e!=`number`&&(e=this.#r),this.write(Object.assign(b.Buffer.alloc(0),{[Rc]:e})))}end(e,t,n){return typeof e==`function`&&(n=e,t=void 0,e=void 0),typeof t==`function`&&(n=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(n)}get ended(){return this.#i}[Ic](e){return super.write(e)}write(e,t,n){if(typeof t==`function`&&(n=t,t=`utf8`),typeof e==`string`&&(e=b.Buffer.from(e,t)),this.#t)return;(0,y.default)(this.#e,`zlib binding closed`);let r=this.#e._handle,i=r.close;r.close=()=>{};let a=this.#e.close;this.#e.close=()=>{},Fc(!0);let o;try{let t=typeof e[Rc]==`number`?e[Rc]:this.#s;o=this.#e._processChunk(e,t),Fc(!1)}catch(e){Fc(!1),this.#o(new Lc(e,this.write))}finally{this.#e&&(this.#e._handle=r,r.close=i,this.#e.close=a,this.#e.removeAllListeners(`error`))}this.#e&&this.#e.on(`error`,e=>this.#o(new Lc(e,this.write)));let s;if(o)if(Array.isArray(o)&&o.length>0){let e=o[0];s=this[Ic](b.Buffer.from(e));for(let e=1;e<o.length;e++)s=this[Ic](o[e])}else s=this[Ic](b.Buffer.from(o));return n&&n(),s}},Bc=class extends zc{#t;#i;constructor(e,t){e||={},e.flush=e.flush||jc.Z_NO_FLUSH,e.finishFlush=e.finishFlush||jc.Z_FINISH,e.fullFlushFlag=jc.Z_FULL_FLUSH,super(e,t),this.#t=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw Error(`cannot switch params when binding is closed`);if(!this.handle.params)throw Error(`not supported in this implementation`);if(this.#t!==e||this.#i!==t){this.flush(jc.Z_SYNC_FLUSH),(0,y.default)(this.handle,`zlib binding closed`);let n=this.handle.flush;this.handle.flush=(e,t)=>{typeof e==`function`&&(t=e,e=this.flushFlag),this.flush(e),t?.()};try{this.handle.params(e,t)}finally{this.handle.flush=n}this.handle&&(this.#t=e,this.#i=t)}}}},Vc=class extends Bc{#t;constructor(e){super(e,`Gzip`),this.#t=e&&!!e.portable}[Ic](e){return this.#t?(this.#t=!1,e[9]=255,super[Ic](e)):super[Ic](e)}},Hc=class extends Bc{constructor(e){super(e,`Unzip`)}},Uc=class extends zc{constructor(e,t){e||={},e.flush=e.flush||jc.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||jc.BROTLI_OPERATION_FINISH,e.fullFlushFlag=jc.BROTLI_OPERATION_FLUSH,super(e,t)}},Wc=class extends Uc{constructor(e){super(e,`BrotliCompress`)}},Gc=class extends Uc{constructor(e){super(e,`BrotliDecompress`)}},Kc=class extends zc{constructor(e,t){e||={},e.flush=e.flush||jc.ZSTD_e_continue,e.finishFlush=e.finishFlush||jc.ZSTD_e_end,e.fullFlushFlag=jc.ZSTD_e_flush,super(e,t)}},qc=class extends Kc{constructor(e){super(e,`ZstdCompress`)}},Jc=class extends Kc{constructor(e){super(e,`ZstdDecompress`)}},Yc=(e,t)=>{if(Number.isSafeInteger(e))e<0?Zc(e,t):Xc(e,t);else throw Error(`cannot encode number outside of javascript safe integer range`);return t},Xc=(e,t)=>{t[0]=128;for(var n=t.length;n>1;n--)t[n-1]=e&255,e=Math.floor(e/256)},Zc=(e,t)=>{t[0]=255;var n=!1;e*=-1;for(var r=t.length;r>1;r--){var i=e&255;e=Math.floor(e/256),n?t[r-1]=tl(i):i===0?t[r-1]=0:(n=!0,t[r-1]=nl(i))}},Qc=e=>{let t=e[0],n=t===128?el(e.subarray(1,e.length)):t===255?$c(e):null;if(n===null)throw Error(`invalid base256 encoding`);if(!Number.isSafeInteger(n))throw Error(`parsed number outside of javascript safe integer range`);return n},$c=e=>{for(var t=e.length,n=0,r=!1,i=t-1;i>-1;i--){var a=Number(e[i]),o;r?o=tl(a):a===0?o=a:(r=!0,o=nl(a)),o!==0&&(n-=o*256**(t-i-1))}return n},el=e=>{for(var t=e.length,n=0,r=t-1;r>-1;r--){var i=Number(e[r]);i!==0&&(n+=i*256**(t-r-1))}return n},tl=e=>(255^e)&255,nl=e=>(255^e)+1&255,rl={};Jo(rl,{code:()=>sl,isCode:()=>il,isName:()=>al,name:()=>ol});var il=e=>ol.has(e),al=e=>sl.has(e),ol=new Map([[`0`,`File`],[``,`OldFile`],[`1`,`Link`],[`2`,`SymbolicLink`],[`3`,`CharacterDevice`],[`4`,`BlockDevice`],[`5`,`Directory`],[`6`,`FIFO`],[`7`,`ContiguousFile`],[`g`,`GlobalExtendedHeader`],[`x`,`ExtendedHeader`],[`A`,`SolarisACL`],[`D`,`GNUDumpDir`],[`I`,`Inode`],[`K`,`NextFileHasLongLinkpath`],[`L`,`NextFileHasLongPath`],[`M`,`ContinuationFile`],[`N`,`OldGnuLongPath`],[`S`,`SparseFile`],[`V`,`TapeVolumeHeader`],[`X`,`OldExtendedHeader`]]),sl=new Map(Array.from(ol).map(e=>[e[1],e[0]])),cl=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#t=`Unsupported`;linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,n,r){Buffer.isBuffer(e)?this.decode(e,t||0,n,r):e&&this.#i(e)}decode(e,t,n,r){if(t||=0,!e||!(e.length>=t+512))throw Error(`need 512 bytes for header`);this.path=n?.path??ul(e,t,100),this.mode=n?.mode??r?.mode??pl(e,t+100,8),this.uid=n?.uid??r?.uid??pl(e,t+108,8),this.gid=n?.gid??r?.gid??pl(e,t+116,8),this.size=n?.size??r?.size??pl(e,t+124,12),this.mtime=n?.mtime??r?.mtime??dl(e,t+136,12),this.cksum=pl(e,t+148,12),r&&this.#i(r,!0),n&&this.#i(n);let i=ul(e,t+156,1);if(il(i)&&(this.#t=i||`0`),this.#t===`0`&&this.path.slice(-1)===`/`&&(this.#t=`5`),this.#t===`5`&&(this.size=0),this.linkpath=ul(e,t+157,100),e.subarray(t+257,t+265).toString()===`ustar\x0000`)if(this.uname=n?.uname??r?.uname??ul(e,t+265,32),this.gname=n?.gname??r?.gname??ul(e,t+297,32),this.devmaj=n?.devmaj??r?.devmaj??pl(e,t+329,8)??0,this.devmin=n?.devmin??r?.devmin??pl(e,t+337,8)??0,e[t+475]!==0){let n=ul(e,t+345,155);this.path=n+`/`+this.path}else{let i=ul(e,t+345,130);i&&(this.path=i+`/`+this.path),this.atime=n?.atime??r?.atime??dl(e,t+476,12),this.ctime=n?.ctime??r?.ctime??dl(e,t+488,12)}let a=256;for(let n=t;n<t+148;n++)a+=e[n];for(let n=t+156;n<t+512;n++)a+=e[n];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([e,n])=>!(n==null||e===`path`&&t||e===`linkpath`&&t||e===`global`))))}encode(e,t=0){if(e||=this.block=Buffer.alloc(512),this.#t===`Unsupported`&&(this.#t=`0`),!(e.length>=t+512))throw Error(`need 512 bytes for header`);let n=this.ctime||this.atime?130:155,r=ll(this.path||``,n),i=r[0],a=r[1];this.needPax=!!r[2],this.needPax=Cl(e,t,100,i)||this.needPax,this.needPax=_l(e,t+100,8,this.mode)||this.needPax,this.needPax=_l(e,t+108,8,this.uid)||this.needPax,this.needPax=_l(e,t+116,8,this.gid)||this.needPax,this.needPax=_l(e,t+124,12,this.size)||this.needPax,this.needPax=xl(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this.#t.charCodeAt(0),this.needPax=Cl(e,t+157,100,this.linkpath)||this.needPax,e.write(`ustar\x0000`,t+257,8),this.needPax=Cl(e,t+265,32,this.uname)||this.needPax,this.needPax=Cl(e,t+297,32,this.gname)||this.needPax,this.needPax=_l(e,t+329,8,this.devmaj)||this.needPax,this.needPax=_l(e,t+337,8,this.devmin)||this.needPax,this.needPax=Cl(e,t+345,n,a)||this.needPax,e[t+475]===0?(this.needPax=Cl(e,t+345,130,a)||this.needPax,this.needPax=xl(e,t+476,12,this.atime)||this.needPax,this.needPax=xl(e,t+488,12,this.ctime)||this.needPax):this.needPax=Cl(e,t+345,155,a)||this.needPax;let o=256;for(let n=t;n<t+148;n++)o+=e[n];for(let n=t+156;n<t+512;n++)o+=e[n];return this.cksum=o,_l(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#t===`Unsupported`?this.#t:ol.get(this.#t)}get typeKey(){return this.#t}set type(e){let t=String(sl.get(e));if(il(t)||t===`Unsupported`)this.#t=t;else if(il(e))this.#t=e;else throw TypeError(`invalid entry type: `+e)}},ll=(e,t)=>{let n=e,r=``,i,a=m.posix.parse(e).root||`.`;if(Buffer.byteLength(n)<100)i=[n,r,!1];else{r=m.posix.dirname(n),n=m.posix.basename(n);do Buffer.byteLength(n)<=100&&Buffer.byteLength(r)<=t?i=[n,r,!1]:Buffer.byteLength(n)>100&&Buffer.byteLength(r)<=t?i=[n.slice(0,99),r,!0]:(n=m.posix.join(m.posix.basename(r),n),r=m.posix.dirname(r));while(r!==a&&i===void 0);i||=[e.slice(0,99),``,!0]}return i},ul=(e,t,n)=>e.subarray(t,t+n).toString(`utf8`).replace(/\0.*/,``),dl=(e,t,n)=>fl(pl(e,t,n)),fl=e=>e===void 0?void 0:new Date(e*1e3),pl=(e,t,n)=>Number(e[t])&128?Qc(e.subarray(t,t+n)):hl(e,t,n),ml=e=>isNaN(e)?void 0:e,hl=(e,t,n)=>ml(parseInt(e.subarray(t,t+n).toString(`utf8`).replace(/\0.*$/,``).trim(),8)),gl={12:8589934591,8:2097151},_l=(e,t,n,r)=>r===void 0?!1:r>gl[n]||r<0?(Yc(r,e.subarray(t,t+n)),!0):(vl(e,t,n,r),!1),vl=(e,t,n,r)=>e.write(yl(r,n),t,n,`ascii`),yl=(e,t)=>bl(Math.floor(e).toString(8),t),bl=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join(`0`)+e+` `)+`\0`,xl=(e,t,n,r)=>r===void 0?!1:_l(e,t,n,r.getTime()/1e3),Sl=Array(156).join(`\0`),Cl=(e,t,n,r)=>r===void 0?!1:(e.write(r+Sl,t,n,`utf8`),r.length!==Buffer.byteLength(r)||r.length>n),wl=class e{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(e,t=!1){this.atime=e.atime,this.charset=e.charset,this.comment=e.comment,this.ctime=e.ctime,this.dev=e.dev,this.gid=e.gid,this.global=t,this.gname=e.gname,this.ino=e.ino,this.linkpath=e.linkpath,this.mtime=e.mtime,this.nlink=e.nlink,this.path=e.path,this.size=e.size,this.uid=e.uid,this.uname=e.uname}encode(){let e=this.encodeBody();if(e===``)return Buffer.allocUnsafe(0);let t=Buffer.byteLength(e),n=512*Math.ceil(1+t/512),r=Buffer.allocUnsafe(n);for(let e=0;e<512;e++)r[e]=0;new cl({path:(`PaxHeader/`+(0,m.basename)(this.path??``)).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:t,mtime:this.mtime,type:this.global?`GlobalExtendedHeader`:`ExtendedHeader`,linkpath:``,uname:this.uname||``,gname:this.gname||``,devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(e,512,t,`utf8`);for(let e=t+512;e<r.length;e++)r[e]=0;return r}encodeBody(){return this.encodeField(`path`)+this.encodeField(`ctime`)+this.encodeField(`atime`)+this.encodeField(`dev`)+this.encodeField(`ino`)+this.encodeField(`nlink`)+this.encodeField(`charset`)+this.encodeField(`comment`)+this.encodeField(`gid`)+this.encodeField(`gname`)+this.encodeField(`linkpath`)+this.encodeField(`mtime`)+this.encodeField(`size`)+this.encodeField(`uid`)+this.encodeField(`uname`)}encodeField(e){if(this[e]===void 0)return``;let t=this[e],n=t instanceof Date?t.getTime()/1e3:t,r=` `+(e===`dev`||e===`ino`||e===`nlink`?`SCHILY.`:``)+e+`=`+n+`
51
51
  `,i=Buffer.byteLength(r),a=Math.floor(Math.log(i)/Math.log(10))+1;return i+a>=10**a&&(a+=1),a+i+r}static parse(t,n,r=!1){return new e(Tl(El(t),n),r)}},Tl=(e,t)=>t?Object.assign({},t,e):e,El=e=>e.replace(/\n$/,``).split(`
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../dist-B5rR31JW.js`),n=require(`../get-transformer-helpers-D818f5xf.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`));var a=e.__toESM(t.require_dist());const o=`add-package-manager`,s="Set the `packageManager` key in root `package.json` file",c=`1.1.0`;async function l({root:t,options:s}){let{log:c,runner:l}=n.getTransformerHelpers({transformer:o,rootPath:t,options:s}),u=i.default.join(t,`package.json`),d=r.default.readJsonSync(u);if(`packageManager`in d)return c.info(`"packageManager" already set in root "package.json"`),l.finish();c.info(`Set "packageManager" key in root "package.json" file...`);let f;try{f=await(0,a.getWorkspaceDetails)({root:t})}catch{return l.abortTransform({reason:`Unable to determine package manager for ${t}`})}let p=await e.getAvailablePackageManagers(),{packageManager:m}=f,h=p[m];if(!h)return l.abortTransform({reason:`Unable to determine package manager version for ${t}`});let g=`${m}@${h}`,_=[{name:`package.json`,path:t,packageJson:{...d,packageJsonPath:u}}];for(let e of _){let{packageJsonPath:t,...n}=e.packageJson,r={...n,packageManager:g};l.modifyFile({filePath:t,after:r})}return l.finish()}const u={name:o,description:s,introducedIn:c,transformer:l};var d=u;exports.default=d,exports.transformer=l;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../dist-CM5dI28P.js`),n=require(`../get-transformer-helpers-ClDUxvBs.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`));var a=e.__toESM(t.require_dist());const o=`add-package-manager`,s="Set the `packageManager` key in root `package.json` file",c=`1.1.0`;async function l({root:t,options:s}){let{log:c,runner:l}=n.getTransformerHelpers({transformer:o,rootPath:t,options:s}),u=i.default.join(t,`package.json`),d=r.default.readJsonSync(u);if(`packageManager`in d)return c.info(`"packageManager" already set in root "package.json"`),l.finish();c.info(`Set "packageManager" key in root "package.json" file...`);let f;try{f=await(0,a.getWorkspaceDetails)({root:t})}catch{return l.abortTransform({reason:`Unable to determine package manager for ${t}`})}let p=await e.getAvailablePackageManagers(),{packageManager:m}=f,h=p[m];if(!h)return l.abortTransform({reason:`Unable to determine package manager version for ${t}`});let g=`${m}@${h}`,_=[{name:`package.json`,path:t,packageJson:{...d,packageJsonPath:u}}];for(let e of _){let{packageJsonPath:t,...n}=e.packageJson,r={...n,packageManager:g};l.modifyFile({filePath:t,after:r})}return l.finish()}const u={name:o,description:s,introducedIn:c,transformer:l};var d=u;exports.default=d,exports.transformer=l;
@@ -1,2 +1,2 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../dist-B5rR31JW.js`),n=require(`../get-transformer-helpers-D818f5xf.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`));var a=e.__toESM(t.require_dist());const o=`add-package-names`,s=`Ensure all packages have a name in their package.json`,c=`2.0.0-canary.0`;async function l(e){try{return await r.default.readJson(e)}catch{return null}}function u({pkgPath:e,pkgName:t}){let n=``,r=t;if(t&&t.startsWith(`@`)&&t.includes(`/`)){let e=t.split(`/`);n=`${e[0]}/`,r=e[1]}let a=i.default.basename(i.default.dirname(e));return t?`${n}${a}-${r}`:`${n}${a}`}async function d({root:e,options:t}){let{log:r,runner:s}=n.getTransformerHelpers({transformer:o,rootPath:e,options:t});r.info(`Validating that each package has a unique "name"...`);let c;try{c=await(0,a.getWorkspaceDetails)({root:e})}catch{return s.abortTransform({reason:`Unable to determine package manager for ${e}`})}let d=[c.paths.packageJson],f=[l(c.paths.packageJson)];for(let e of c.workspaceData.workspaces){let t=e.paths.packageJson;d.push(t),f.push(l(t))}let p=await Promise.all(f),m=Object.fromEntries(d.map((e,t)=>[e,p[t]])),h=new Map;for(let[e,t]of Object.entries(m))if(t?.name){let n=h.get(t.name)||[];n.push(e),h.set(t.name,n)}let g=[...h.entries()].filter(([,e])=>e.length>1);if(g.length>0){let t=g.map(([t,n])=>{let r=n.map(t=>i.default.relative(e,t));return` - "${t}" found in: ${r.join(`, `)}`});return s.abortTransform({reason:`Found packages with duplicate "name" fields:\n${t.join(`
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../dist-CM5dI28P.js`),n=require(`../get-transformer-helpers-ClDUxvBs.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`));var a=e.__toESM(t.require_dist());const o=`add-package-names`,s=`Ensure all packages have a name in their package.json`,c=`2.0.0-canary.0`;async function l(e){try{return await r.default.readJson(e)}catch{return null}}function u({pkgPath:e,pkgName:t}){let n=``,r=t;if(t&&t.startsWith(`@`)&&t.includes(`/`)){let e=t.split(`/`);n=`${e[0]}/`,r=e[1]}let a=i.default.basename(i.default.dirname(e));return t?`${n}${a}-${r}`:`${n}${a}`}async function d({root:e,options:t}){let{log:r,runner:s}=n.getTransformerHelpers({transformer:o,rootPath:e,options:t});r.info(`Validating that each package has a unique "name"...`);let c;try{c=await(0,a.getWorkspaceDetails)({root:e})}catch{return s.abortTransform({reason:`Unable to determine package manager for ${e}`})}let d=[c.paths.packageJson],f=[l(c.paths.packageJson)];for(let e of c.workspaceData.workspaces){let t=e.paths.packageJson;d.push(t),f.push(l(t))}let p=await Promise.all(f),m=Object.fromEntries(d.map((e,t)=>[e,p[t]])),h=new Map;for(let[e,t]of Object.entries(m))if(t?.name){let n=h.get(t.name)||[];n.push(e),h.set(t.name,n)}let g=[...h.entries()].filter(([,e])=>e.length>1);if(g.length>0){let t=g.map(([t,n])=>{let r=n.map(t=>i.default.relative(e,t));return` - "${t}" found in: ${r.join(`, `)}`});return s.abortTransform({reason:`Found packages with duplicate "name" fields:\n${t.join(`
2
2
  `)}\nPlease resolve these duplicates manually and re-run the codemod.`})}let _=new Set(h.keys());for(let[e,t]of Object.entries(m))if(t&&!t.name){let n=u({pkgPath:e,pkgName:void 0});s.modifyFile({filePath:e,after:{...t,name:n}}),_.add(n)}return s.finish()}const f={name:o,description:s,introducedIn:c,transformer:d};var p=f;exports.default=p,exports.getNewPkgName=u,exports.transformer=d;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`node:path`)),a=`clean-globs`,o=`Automatically clean up invalid globs from your 'turbo.json' file`,s=`1.11.0`;function c({root:r,options:o}){let{runner:s}=t.getTransformerHelpers({transformer:a,rootPath:r,options:o}),c=i.default.join(r,`turbo.json`),u=n.loadTurboJson(c);s.modifyFile({filePath:c,after:l(u)});let d=e.getTurboConfigs(r);for(let e of d){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&s.modifyFile({filePath:n,after:l(t)})}return s.finish()}function l(e){if(r.isPipelineKeyMissing(e))return e;let t=e=>u(e);for(let[n,r]of Object.entries(e.pipeline))r.inputs=r.inputs?.map(t),r.outputs=r.outputs?.map(t);return e}function u(e){let t=e,n=t.replace(/\*\*\/\*\*/g,`**`);for(;n!==t;)t=n,n=t.replace(/\*\*\/\*\*/g,`**`);return n=t.replace(/(\*\*)([^*/]+)/g,`$1/*$2`),n!==t&&(t=n),n=t.replace(/([^*/]+)(\*\*)/g,`$1*/$2`),n!==t&&(t=n),t}const d={name:a,description:o,introducedIn:s,transformer:c};var f=d;exports.default=f,exports.fixGlobPattern=u,exports.transformer=c;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`node:path`)),a=`clean-globs`,o=`Automatically clean up invalid globs from your 'turbo.json' file`,s=`1.11.0`;function c({root:r,options:o}){let{runner:s}=t.getTransformerHelpers({transformer:a,rootPath:r,options:o}),c=i.default.join(r,`turbo.json`),u=n.loadTurboJson(c);s.modifyFile({filePath:c,after:l(u)});let d=e.getTurboConfigs(r);for(let e of d){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&s.modifyFile({filePath:n,after:l(t)})}return s.finish()}function l(e){if(r.isPipelineKeyMissing(e))return e;let t=e=>u(e);for(let[n,r]of Object.entries(e.pipeline))r.inputs=r.inputs?.map(t),r.outputs=r.outputs?.map(t);return e}function u(e){let t=e,n=t.replace(/\*\*\/\*\*/g,`**`);for(;n!==t;)t=n,n=t.replace(/\*\*\/\*\*/g,`**`);return n=t.replace(/(\*\*)([^*/]+)/g,`$1/*$2`),n!==t&&(t=n),n=t.replace(/([^*/]+)(\*\*)/g,`$1*/$2`),n!==t&&(t=n),t}const d={name:a,description:o,introducedIn:s,transformer:c};var f=d;exports.default=f,exports.fixGlobPattern=u,exports.transformer=c;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=`create-turbo-config`,a='Create the `turbo.json` file from an existing "turbo" key in `package.json`',o=`1.1.0`;function s({root:e,options:a}){let{log:o,runner:s}=t.getTransformerHelpers({transformer:i,rootPath:e,options:a});o.info(`Migrating "package.json" "turbo" key to "turbo.json" file...`);let c=r.default.join(e,`turbo.json`),l=r.default.join(e,`package.json`);if(!n.default.existsSync(l))return s.abortTransform({reason:`No package.json found at ${e}. Is the path correct?`});let u=n.default.readJsonSync(l),d=null;try{d=n.default.readJsonSync(c)}catch{d=null}let f=u,p=d;if(!d&&u.turbo){let{turbo:e,...t}=u;p=e,f=t}return s.modifyFile({filePath:c,after:p}),s.modifyFile({filePath:l,after:f}),s.finish()}const c={name:i,description:a,introducedIn:o,transformer:s};var l=c;exports.default=l,exports.transformer=s;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=`create-turbo-config`,a='Create the `turbo.json` file from an existing "turbo" key in `package.json`',o=`1.1.0`;function s({root:e,options:a}){let{log:o,runner:s}=t.getTransformerHelpers({transformer:i,rootPath:e,options:a});o.info(`Migrating "package.json" "turbo" key to "turbo.json" file...`);let c=r.default.join(e,`turbo.json`),l=r.default.join(e,`package.json`);if(!n.default.existsSync(l))return s.abortTransform({reason:`No package.json found at ${e}. Is the path correct?`});let u=n.default.readJsonSync(l),d=null;try{d=n.default.readJsonSync(c)}catch{d=null}let f=u,p=d;if(!d&&u.turbo){let{turbo:e,...t}=u;p=e,f=t}return s.modifyFile({filePath:c,after:p}),s.modifyFile({filePath:l,after:f}),s.finish()}const c={name:i,description:a,introducedIn:o,transformer:s};var l=c;exports.default=l,exports.transformer=s;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`)),a=`migrate-dot-env`,o='Migrate the "dotEnv" entries to "inputs" in `turbo.json`',s=`2.0.0-canary.0`;function c(t){if(`globalDotEnv`in t){if(t.globalDotEnv){t.globalDependencies=t.globalDependencies??[];for(let e of t.globalDotEnv)t.globalDependencies.push(e)}delete t.globalDotEnv}return e.forEachTaskDef(t,([e,t])=>{if(`dotEnv`in t){if(t.dotEnv){t.inputs=t.inputs??[`$TURBO_DEFAULT$`];for(let e of t.dotEnv)t.inputs.push(e)}delete t.dotEnv}}),t}function l({root:o,options:s}){let{log:l,runner:u}=t.getTransformerHelpers({transformer:a,rootPath:o,options:s}),d=i.default.join(o,`package.json`),f={};try{f=r.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});l.info("Moving entries in `dotEnv` key in task config to `inputs`");let p=i.default.join(o,`turbo.json`);if(!r.default.existsSync(p))return u.abortTransform({reason:`No turbo.json found at ${o}. Is the path correct?`});let m=n.loadTurboJson(p);u.modifyFile({filePath:p,after:c(m)});let h=e.getTurboConfigs(o);for(let e of h){let{config:t,turboConfigPath:n}=e;(`pipeline`in t||`tasks`in t)&&u.modifyFile({filePath:n,after:c(t)})}return u.finish()}const u={name:a,description:o,introducedIn:s,transformer:l};var d=u;exports.default=d,exports.transformer=l;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`)),a=`migrate-dot-env`,o='Migrate the "dotEnv" entries to "inputs" in `turbo.json`',s=`2.0.0-canary.0`;function c(t){if(`globalDotEnv`in t){if(t.globalDotEnv){t.globalDependencies=t.globalDependencies??[];for(let e of t.globalDotEnv)t.globalDependencies.push(e)}delete t.globalDotEnv}return e.forEachTaskDef(t,([e,t])=>{if(`dotEnv`in t){if(t.dotEnv){t.inputs=t.inputs??[`$TURBO_DEFAULT$`];for(let e of t.dotEnv)t.inputs.push(e)}delete t.dotEnv}}),t}function l({root:o,options:s}){let{log:l,runner:u}=t.getTransformerHelpers({transformer:a,rootPath:o,options:s}),d=i.default.join(o,`package.json`),f={};try{f=r.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});l.info("Moving entries in `dotEnv` key in task config to `inputs`");let p=i.default.join(o,`turbo.json`);if(!r.default.existsSync(p))return u.abortTransform({reason:`No turbo.json found at ${o}. Is the path correct?`});let m=n.loadTurboJson(p);u.modifyFile({filePath:p,after:c(m)});let h=e.getTurboConfigs(o);for(let e of h){let{config:t,turboConfigPath:n}=e;(`pipeline`in t||`tasks`in t)&&u.modifyFile({filePath:n,after:c(t)})}return u.finish()}const u={name:a,description:o,introducedIn:s,transformer:l};var d=u;exports.default=d,exports.transformer=l;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`migrate-env-var-dependencies`,s='Migrate environment variable dependencies from "dependsOn" to "env" in `turbo.json`',c=`1.5.0`;function l(e){if(r.isPipelineKeyMissing(e))return{hasKeys:!1};let t=[`extends`in e?[]:e.globalDependencies,Object.values(e.pipeline).flatMap(e=>e.dependsOn??[])].flat(),n=t.filter(e=>e?.startsWith(`$`));return{hasKeys:!!n.length,envVars:n}}function u({env:e,deps:t}){let n=new Set(e),r=[];if(t)for(let e of t)e.startsWith(`$`)?n.add(e.slice(1)):r.push(e);return n.size?{deps:r,env:Array.from(n)}:{env:e,deps:t}}function d(e){let{deps:t,env:n}=u({env:e.env,deps:e.dependsOn}),r={...e};return t?r.dependsOn=t:delete r.dependsOn,n?.length?r.env=n:delete r.env,r}function f(e){if(`extends`in e)return e;let{deps:t,env:n}=u({env:e.globalEnv,deps:e.globalDependencies}),r={...e};return t?.length?r.globalDependencies=t:delete r.globalDependencies,n?.length?r.globalEnv=n:delete r.globalEnv,r}function p(e){if(r.isPipelineKeyMissing(e))return e;let t=f(e);for(let n of Object.keys(e.pipeline))if(n in e.pipeline){let e=t.pipeline[n];t.pipeline[n]={...e,...d(e)}}return t}function m({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s});c.info(`Migrating environment variable dependencies from "globalDependencies" and "dependsOn" to "env" in "turbo.json"...`);let d=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);l(h).hasKeys&&(h=p(h)),u.modifyFile({filePath:m,after:h});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&l(t).hasKeys&&u.modifyFile({filePath:n,after:p(t)})}return u.finish()}const h={name:o,description:s,introducedIn:c,transformer:m};var g=h;exports.default=g,exports.hasLegacyEnvVarDependencies=l,exports.migrateConfig=p,exports.migrateDependencies=u,exports.migrateGlobal=f,exports.migratePipeline=d,exports.transformer=m;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`migrate-env-var-dependencies`,s='Migrate environment variable dependencies from "dependsOn" to "env" in `turbo.json`',c=`1.5.0`;function l(e){if(r.isPipelineKeyMissing(e))return{hasKeys:!1};let t=[`extends`in e?[]:e.globalDependencies,Object.values(e.pipeline).flatMap(e=>e.dependsOn??[])].flat(),n=t.filter(e=>e?.startsWith(`$`));return{hasKeys:!!n.length,envVars:n}}function u({env:e,deps:t}){let n=new Set(e),r=[];if(t)for(let e of t)e.startsWith(`$`)?n.add(e.slice(1)):r.push(e);return n.size?{deps:r,env:Array.from(n)}:{env:e,deps:t}}function d(e){let{deps:t,env:n}=u({env:e.env,deps:e.dependsOn}),r={...e};return t?r.dependsOn=t:delete r.dependsOn,n?.length?r.env=n:delete r.env,r}function f(e){if(`extends`in e)return e;let{deps:t,env:n}=u({env:e.globalEnv,deps:e.globalDependencies}),r={...e};return t?.length?r.globalDependencies=t:delete r.globalDependencies,n?.length?r.globalEnv=n:delete r.globalEnv,r}function p(e){if(r.isPipelineKeyMissing(e))return e;let t=f(e);for(let n of Object.keys(e.pipeline))if(n in e.pipeline){let e=t.pipeline[n];t.pipeline[n]={...e,...d(e)}}return t}function m({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s});c.info(`Migrating environment variable dependencies from "globalDependencies" and "dependsOn" to "env" in "turbo.json"...`);let d=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);l(h).hasKeys&&(h=p(h)),u.modifyFile({filePath:m,after:h});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&l(t).hasKeys&&u.modifyFile({filePath:n,after:p(t)})}return u.finish()}const h={name:o,description:s,introducedIn:c,transformer:m};var g=h;exports.default=g,exports.hasLegacyEnvVarDependencies=l,exports.migrateConfig=p,exports.migrateDependencies=u,exports.migrateGlobal=f,exports.migratePipeline=d,exports.transformer=m;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`rename-output-mode`,s='Rename the "outputMode" key to "outputLogs" in `turbo.json`',c=`2.0.0-canary.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline))Object.hasOwn(n,`outputMode`)&&(n.outputLogs=n.outputMode,delete n.outputMode);return e}function u({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),d=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Renaming `outputMode` key in task config to `outputLogs`");let p=a.default.join(r,`turbo.json`);if(!i.default.existsSync(p))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let m=n.loadTurboJson(p);u.modifyFile({filePath:p,after:l(m)});let h=e.getTurboConfigs(r);for(let e of h){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&u.modifyFile({filePath:n,after:l(t)})}return u.finish()}const d={name:o,description:s,introducedIn:c,transformer:u};var f=d;exports.default=f,exports.transformer=u;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`rename-output-mode`,s='Rename the "outputMode" key to "outputLogs" in `turbo.json`',c=`2.0.0-canary.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline))Object.hasOwn(n,`outputMode`)&&(n.outputLogs=n.outputMode,delete n.outputMode);return e}function u({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),d=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(d)}catch{}if(`turbo`in f)return u.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Renaming `outputMode` key in task config to `outputLogs`");let p=a.default.join(r,`turbo.json`);if(!i.default.existsSync(p))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let m=n.loadTurboJson(p);u.modifyFile({filePath:p,after:l(m)});let h=e.getTurboConfigs(r);for(let e of h){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&u.modifyFile({filePath:n,after:l(t)})}return u.finish()}const d={name:o,description:s,introducedIn:c,transformer:u};var f=d;exports.default=f,exports.transformer=u;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`rename-pipeline`,s='Rename the "pipeline" key to "tasks" in `turbo.json`',c=`2.0.0-canary.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;let{pipeline:t,...n}=e;return{...n,tasks:t}}function u({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s});c.info("Renaming `pipeline` key in turbo.json to `tasks`");let d=a.default.join(r,`turbo.json`);if(!i.default.existsSync(d))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let f=n.loadTurboJson(d);if(`tasks`in f)return c.info(`turbo.json already has a tasks key, exiting`),u.finish();let p=f;u.modifyFile({filePath:d,after:l(p)});let m=e.getTurboConfigs(r);for(let e of m){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&u.modifyFile({filePath:n,after:l(t)})}return u.finish()}const d={name:o,description:s,introducedIn:c,transformer:u};var f=d;exports.default=f,exports.transformer=u;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`rename-pipeline`,s='Rename the "pipeline" key to "tasks" in `turbo.json`',c=`2.0.0-canary.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;let{pipeline:t,...n}=e;return{...n,tasks:t}}function u({root:r,options:s}){let{log:c,runner:u}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s});c.info("Renaming `pipeline` key in turbo.json to `tasks`");let d=a.default.join(r,`turbo.json`);if(!i.default.existsSync(d))return u.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let f=n.loadTurboJson(d);if(`tasks`in f)return c.info(`turbo.json already has a tasks key, exiting`),u.finish();let p=f;u.modifyFile({filePath:d,after:l(p)});let m=e.getTurboConfigs(r);for(let e of m){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&u.modifyFile({filePath:n,after:l(t)})}return u.finish()}const d={name:o,description:s,introducedIn:c,transformer:u};var f=d;exports.default=f,exports.transformer=u;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=[`dist/**`,`build/**`],s=`set-default-outputs`,c='Add the "outputs" key with defaults where it is missing in `turbo.json`',l=`1.7.0`,u=!1;function d(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline))n.cache!==!1&&(n.outputs?Array.isArray(n.outputs)&&n.outputs.length===0&&delete n.outputs:n.outputs=o);return e}function f({root:r,options:o}){let{log:c,runner:l}=t.getTransformerHelpers({transformer:s,rootPath:r,options:o}),u=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(u)}catch{}if(`turbo`in f)return l.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Adding default `outputs` key into tasks if it doesn't exist");let p=a.default.join(r,`turbo.json`);if(!i.default.existsSync(p))return l.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let m=n.loadTurboJson(p);l.modifyFile({filePath:p,after:d(m)});let h=e.getTurboConfigs(r);for(let e of h){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&l.modifyFile({filePath:n,after:d(t)})}return l.finish()}const p={name:s,description:c,introducedIn:l,idempotent:u,transformer:f};var m=p;exports.default=m,exports.migrateConfig=d,exports.transformer=f;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=[`dist/**`,`build/**`],s=`set-default-outputs`,c='Add the "outputs" key with defaults where it is missing in `turbo.json`',l=`1.7.0`,u=!1;function d(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline))n.cache!==!1&&(n.outputs?Array.isArray(n.outputs)&&n.outputs.length===0&&delete n.outputs:n.outputs=o);return e}function f({root:r,options:o}){let{log:c,runner:l}=t.getTransformerHelpers({transformer:s,rootPath:r,options:o}),u=a.default.join(r,`package.json`),f={};try{f=i.default.readJsonSync(u)}catch{}if(`turbo`in f)return l.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Adding default `outputs` key into tasks if it doesn't exist");let p=a.default.join(r,`turbo.json`);if(!i.default.existsSync(p))return l.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let m=n.loadTurboJson(p);l.modifyFile({filePath:p,after:d(m)});let h=e.getTurboConfigs(r);for(let e of h){let{config:t,turboConfigPath:n}=e;`pipeline`in t&&l.modifyFile({filePath:n,after:d(t)})}return l.finish()}const p={name:s,description:c,introducedIn:l,idempotent:u,transformer:f};var m=p;exports.default=m,exports.migrateConfig=d,exports.transformer=f;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`stabilize-env-mode`,s=`Rewrite experimentalPassThroughEnv and experimentalGlobalPassThroughEnv`,c=`1.10.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;let t=e.experimentalGlobalPassThroughEnv,n=e.globalPassThroughEnv,i;return(Array.isArray(t)||Array.isArray(n))&&(i=[],Array.isArray(t)&&(i=i.concat(t)),Array.isArray(n)&&(i=i.concat(n)),i=[...new Set(i)],i.sort()),delete e.experimentalGlobalPassThroughEnv,delete e.globalPassThroughEnv,Array.isArray(i)&&(e.globalPassThroughEnv=i),u(e)}function u(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline)){let e=n.experimentalPassThroughEnv,t=n.passThroughEnv,r;(Array.isArray(e)||Array.isArray(t))&&(r=[],Array.isArray(e)&&(r=r.concat(e)),Array.isArray(t)&&(r=r.concat(t)),r=[...new Set(r)],r.sort()),delete n.experimentalPassThroughEnv,delete n.passThroughEnv,Array.isArray(r)&&(n.passThroughEnv=r)}return e}function d({root:r,options:s}){let{log:c,runner:d}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),f=a.default.join(r,`package.json`),p={};try{p=i.default.readJsonSync(f)}catch{}if(`turbo`in p)return d.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Rewriting `experimentalPassThroughEnv` and `experimentalGlobalPassThroughEnv`");let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return d.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);d.modifyFile({filePath:m,after:l(h)});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n,isRootConfig:r}=e;!r&&`pipeline`in t&&d.modifyFile({filePath:n,after:u(t)})}return d.finish()}const f={name:o,description:s,introducedIn:c,transformer:d};var p=f;exports.default=p,exports.migrateRootConfig=l,exports.migrateTaskConfigs=u,exports.transformer=d;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`stabilize-env-mode`,s=`Rewrite experimentalPassThroughEnv and experimentalGlobalPassThroughEnv`,c=`1.10.0`;function l(e){if(r.isPipelineKeyMissing(e))return e;let t=e.experimentalGlobalPassThroughEnv,n=e.globalPassThroughEnv,i;return(Array.isArray(t)||Array.isArray(n))&&(i=[],Array.isArray(t)&&(i=i.concat(t)),Array.isArray(n)&&(i=i.concat(n)),i=[...new Set(i)],i.sort()),delete e.experimentalGlobalPassThroughEnv,delete e.globalPassThroughEnv,Array.isArray(i)&&(e.globalPassThroughEnv=i),u(e)}function u(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline)){let e=n.experimentalPassThroughEnv,t=n.passThroughEnv,r;(Array.isArray(e)||Array.isArray(t))&&(r=[],Array.isArray(e)&&(r=r.concat(e)),Array.isArray(t)&&(r=r.concat(t)),r=[...new Set(r)],r.sort()),delete n.experimentalPassThroughEnv,delete n.passThroughEnv,Array.isArray(r)&&(n.passThroughEnv=r)}return e}function d({root:r,options:s}){let{log:c,runner:d}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),f=a.default.join(r,`package.json`),p={};try{p=i.default.readJsonSync(f)}catch{}if(`turbo`in p)return d.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info("Rewriting `experimentalPassThroughEnv` and `experimentalGlobalPassThroughEnv`");let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return d.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);d.modifyFile({filePath:m,after:l(h)});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n,isRootConfig:r}=e;!r&&`pipeline`in t&&d.modifyFile({filePath:n,after:u(t)})}return d.finish()}const f={name:o,description:s,introducedIn:c,transformer:d};var p=f;exports.default=p,exports.migrateRootConfig=l,exports.migrateTaskConfigs=u,exports.transformer=d;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`)),a=`stabilize-ui`,o='Rename the "experimentalUI" key to "ui" in `turbo.json`',s=`2.0.0-canary.0`;function c(e){let t=e.experimentalUI;return delete e.experimentalUI,t!==void 0&&!t&&(e.ui=`stream`),e}function l({root:e,options:o}){let{log:s,runner:l}=t.getTransformerHelpers({transformer:a,rootPath:e,options:o});s.info("Renaming `experimentalUI` key in turbo.json to `ui`");let u=i.default.join(e,`turbo.json`);if(!r.default.existsSync(u))return l.abortTransform({reason:`No turbo.json found at ${e}. Is the path correct?`});let d=n.loadTurboJson(u);return l.modifyFile({filePath:u,after:c(d)}),l.finish()}const u={name:a,description:o,introducedIn:s,transformer:l};var d=u;exports.default=d,exports.transformer=l;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=e.__toESM(require(`fs-extra`)),i=e.__toESM(require(`node:path`)),a=`stabilize-ui`,o='Rename the "experimentalUI" key to "ui" in `turbo.json`',s=`2.0.0-canary.0`;function c(e){let t=e.experimentalUI;return delete e.experimentalUI,t!==void 0&&!t&&(e.ui=`stream`),e}function l({root:e,options:o}){let{log:s,runner:l}=t.getTransformerHelpers({transformer:a,rootPath:e,options:o});s.info("Renaming `experimentalUI` key in turbo.json to `ui`");let u=i.default.join(e,`turbo.json`);if(!r.default.existsSync(u))return l.abortTransform({reason:`No turbo.json found at ${e}. Is the path correct?`});let d=n.loadTurboJson(u);return l.modifyFile({filePath:u,after:c(d)}),l.finish()}const u={name:a,description:o,introducedIn:s,transformer:l};var d=u;exports.default=d,exports.transformer=l;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=require(`../load-turbo-json-Crk93YDk.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`transform-env-literals-to-wildcards`,s=`Rewrite env fields to distinguish wildcards from literals`,c=`1.10.0`;function l(e){let t=e;return t=t.replace(/\\/g,`\\\\`),e.startsWith(`!`)&&(t=`\\${t}`),t=t.replace(/\*/g,`\\*`),t}function u(e){if(r.isPipelineKeyMissing(e))return e;let{globalEnv:t,globalPassThroughEnv:n}=e;return Array.isArray(t)&&(e.globalEnv=t.map(l)),Array.isArray(n)&&(e.globalPassThroughEnv=n.map(l)),d(e)}function d(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline)){let{env:e,passThroughEnv:t}=n;Array.isArray(e)&&(n.env=e.map(l)),Array.isArray(t)&&(n.passThroughEnv=t.map(l))}return e}function f({root:r,options:s}){let{log:c,runner:l}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),f=a.default.join(r,`package.json`),p={};try{p=i.default.readJsonSync(f)}catch{}if(`turbo`in p)return l.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info(`Rewriting env vars to support wildcards`);let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return l.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);l.modifyFile({filePath:m,after:u(h)});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n,isRootConfig:r}=e;!r&&`pipeline`in t&&l.modifyFile({filePath:n,after:d(t)})}return l.finish()}const p={name:o,description:s,introducedIn:c,transformer:f};var m=p;exports.default=m,exports.migrateRootConfig=u,exports.migrateTaskConfigs=d,exports.transformer=f;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=require(`../load-turbo-json-D0odmKLK.js`),r=require(`../is-pipeline-key-missing-CMFMdrGr.js`),i=e.__toESM(require(`fs-extra`)),a=e.__toESM(require(`node:path`)),o=`transform-env-literals-to-wildcards`,s=`Rewrite env fields to distinguish wildcards from literals`,c=`1.10.0`;function l(e){let t=e;return t=t.replace(/\\/g,`\\\\`),e.startsWith(`!`)&&(t=`\\${t}`),t=t.replace(/\*/g,`\\*`),t}function u(e){if(r.isPipelineKeyMissing(e))return e;let{globalEnv:t,globalPassThroughEnv:n}=e;return Array.isArray(t)&&(e.globalEnv=t.map(l)),Array.isArray(n)&&(e.globalPassThroughEnv=n.map(l)),d(e)}function d(e){if(r.isPipelineKeyMissing(e))return e;for(let[t,n]of Object.entries(e.pipeline)){let{env:e,passThroughEnv:t}=n;Array.isArray(e)&&(n.env=e.map(l)),Array.isArray(t)&&(n.passThroughEnv=t.map(l))}return e}function f({root:r,options:s}){let{log:c,runner:l}=t.getTransformerHelpers({transformer:o,rootPath:r,options:s}),f=a.default.join(r,`package.json`),p={};try{p=i.default.readJsonSync(f)}catch{}if(`turbo`in p)return l.abortTransform({reason:'"turbo" key detected in package.json. Run `npx @turbo/codemod transform create-turbo-config` first'});c.info(`Rewriting env vars to support wildcards`);let m=a.default.join(r,`turbo.json`);if(!i.default.existsSync(m))return l.abortTransform({reason:`No turbo.json found at ${r}. Is the path correct?`});let h=n.loadTurboJson(m);l.modifyFile({filePath:m,after:u(h)});let g=e.getTurboConfigs(r);for(let e of g){let{config:t,turboConfigPath:n,isRootConfig:r}=e;!r&&`pipeline`in t&&l.modifyFile({filePath:n,after:d(t)})}return l.finish()}const p={name:o,description:s,introducedIn:c,transformer:f};var m=p;exports.default=m,exports.migrateRootConfig=u,exports.migrateTaskConfigs=d,exports.transformer=f;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=`update-schema-json-url`,a=`Update the "$schema" property in turbo.json from "https://turborepo.dev/schema.v1.json" to "https://turborepo.dev/schema.v2.json"`,o=`2.0.0`;function s(e){return e.replace(`https://turborepo.dev/schema.v1.json`,`https://turborepo.dev/schema.v2.json`)}function c({root:e,options:a}){let{log:o,runner:c}=t.getTransformerHelpers({transformer:i,rootPath:e,options:a});o.info(`Updating "$schema" property in turbo.json...`);let l=r.default.join(e,`turbo.json`);if(!n.default.existsSync(l))return c.abortTransform({reason:`No turbo.json found at ${e}. Is the path correct?`});try{let e=n.default.readFileSync(l,`utf8`);if(e.includes(`https://turborepo.dev/schema.v1.json`)){let t=s(e);c.modifyFile({filePath:l,before:e,after:t}),o.info(`Updated "$schema" property in turbo.json`)}else o.info(`No v1 schema URL found in turbo.json. Skipping update.`)}catch(e){return c.abortTransform({reason:`Error updating schema URL in turbo.json: ${String(e)}`})}return c.finish()}const l={name:i,description:a,introducedIn:o,transformer:c,idempotent:!0};var u=l;exports.default=u,exports.transformer=c;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=`update-schema-json-url`,a=`Update the "$schema" property in turbo.json from "https://turborepo.dev/schema.v1.json" to "https://turborepo.dev/schema.v2.json"`,o=`2.0.0`;function s(e){return e.replace(`https://turborepo.dev/schema.v1.json`,`https://turborepo.dev/schema.v2.json`)}function c({root:e,options:a}){let{log:o,runner:c}=t.getTransformerHelpers({transformer:i,rootPath:e,options:a});o.info(`Updating "$schema" property in turbo.json...`);let l=r.default.join(e,`turbo.json`);if(!n.default.existsSync(l))return c.abortTransform({reason:`No turbo.json found at ${e}. Is the path correct?`});try{let e=n.default.readFileSync(l,`utf8`);if(e.includes(`https://turborepo.dev/schema.v1.json`)){let t=s(e);c.modifyFile({filePath:l,before:e,after:t}),o.info(`Updated "$schema" property in turbo.json`)}else o.info(`No v1 schema URL found in turbo.json. Skipping update.`)}catch(e){return c.abortTransform({reason:`Error updating schema URL in turbo.json: ${String(e)}`})}return c.finish()}const l={name:i,description:a,introducedIn:o,transformer:c,idempotent:!0};var u=l;exports.default=u,exports.transformer=c;
@@ -1 +1 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-Qa95HmyV.js`),t=require(`../get-transformer-helpers-D818f5xf.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=e.__toESM(require(`semver`)),a=`update-versioned-schema-json`,o=`Update the "$schema" property in turbo.json to use the versioned subdomain format (e.g., https://v2-7-5.turborepo.dev/schema.json)`,s=`2.7.5`,c=s,l=[`https://turborepo.dev/schema.json`,`https://turborepo.dev/schema.v2.json`,`https://turborepo.com/schema.json`,`https://turborepo.com/schema.v2.json`,`https://turbo.build/schema.json`,`https://turbo.build/schema.v2.json`],u=/https:\/\/v\d+-\d+-\d+\.turborepo\.dev\/schema\.json/g;function d(e){let t=(0,i.coerce)(e);return t?t.version:null}function f(e){let[t,n,r]=e.split(`.`);return`v${t}-${n}-${r}`}function p(e){let t=d(e);if(!t)throw Error(`Invalid version: ${e}`);let n=f(t);return`https://${n}.turborepo.dev/schema.json`}function m(e,t){let n=e;for(let e of l)n=n.replaceAll(e,t);return n=n.replaceAll(u,t),n}function h(e,t){if(l.some(t=>e.includes(t)))return!0;let n=e.match(u);return n?n.some(e=>e!==t):!1}function g({root:o,options:s}){let{log:l,runner:u}=t.getTransformerHelpers({transformer:a,rootPath:o,options:s}),{toVersion:f}=s,g=f?d(f):null;if(!g||!(0,i.gte)(g,c))return l.info(`Skipping schema URL update: target version ${f||`unknown`} does not support versioned schema URLs`),u.finish();l.info(`Updating "$schema" property in turbo.json files to versioned format...`);let _=r.default.join(o,`turbo.json`);if(!n.default.existsSync(_))return u.abortTransform({reason:`No turbo.json found at ${o}. Is the path correct?`});try{let t=p(g),r=e.getTurboConfigs(o);for(let{turboConfigPath:e}of r){let r=n.default.readFileSync(e,`utf8`);if(h(r,t)){let n=m(r,t);u.modifyFile({filePath:e,before:r,after:n}),l.info(`Updated "$schema" in ${e}`)}}}catch(e){return u.abortTransform({reason:`Error updating schema URL: ${String(e)}`})}return u.finish()}const _={name:a,description:o,introducedIn:s,transformer:g,idempotent:!0};var v=_;exports.default=v,exports.transformer=g;
1
+ Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`../runner-sNjkx4u0.js`),t=require(`../get-transformer-helpers-ClDUxvBs.js`),n=e.__toESM(require(`fs-extra`)),r=e.__toESM(require(`node:path`)),i=e.__toESM(require(`semver`)),a=`update-versioned-schema-json`,o=`Update the "$schema" property in turbo.json to use the versioned subdomain format (e.g., https://v2-7-5.turborepo.dev/schema.json)`,s=`2.7.5`,c=s,l=[`https://turborepo.dev/schema.json`,`https://turborepo.dev/schema.v2.json`,`https://turborepo.com/schema.json`,`https://turborepo.com/schema.v2.json`,`https://turbo.build/schema.json`,`https://turbo.build/schema.v2.json`],u=/https:\/\/v\d+-\d+-\d+\.turborepo\.dev\/schema\.json/g;function d(e){let t=(0,i.coerce)(e);return t?t.version:null}function f(e){let[t,n,r]=e.split(`.`);return`v${t}-${n}-${r}`}function p(e){let t=d(e);if(!t)throw Error(`Invalid version: ${e}`);let n=f(t);return`https://${n}.turborepo.dev/schema.json`}function m(e,t){let n=e;for(let e of l)n=n.replaceAll(e,t);return n=n.replaceAll(u,t),n}function h(e,t){if(l.some(t=>e.includes(t)))return!0;let n=e.match(u);return n?n.some(e=>e!==t):!1}function g({root:o,options:s}){let{log:l,runner:u}=t.getTransformerHelpers({transformer:a,rootPath:o,options:s}),{toVersion:f}=s,g=f?d(f):null;if(!g||!(0,i.gte)(g,c))return l.info(`Skipping schema URL update: target version ${f||`unknown`} does not support versioned schema URLs`),u.finish();l.info(`Updating "$schema" property in turbo.json files to versioned format...`);let _=r.default.join(o,`turbo.json`);if(!n.default.existsSync(_))return u.abortTransform({reason:`No turbo.json found at ${o}. Is the path correct?`});try{let t=p(g),r=e.getTurboConfigs(o);for(let{turboConfigPath:e}of r){let r=n.default.readFileSync(e,`utf8`);if(h(r,t)){let n=m(r,t);u.modifyFile({filePath:e,before:r,after:n}),l.info(`Updated "$schema" in ${e}`)}}}catch(e){return u.abortTransform({reason:`Error updating schema URL: ${String(e)}`})}return u.finish()}const _={name:a,description:o,introducedIn:s,transformer:g,idempotent:!0};var v=_;exports.default=v,exports.transformer=g;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turbo/codemod",
3
- "version": "2.8.20",
3
+ "version": "2.8.21-canary.10",
4
4
  "description": "Provides Codemod transformations to help upgrade your Turborepo codebase when a feature is deprecated.",
5
5
  "homepage": "https://turborepo.dev",
6
6
  "bugs": {
@@ -47,11 +47,11 @@
47
47
  "ts-jest": "29.4.6",
48
48
  "tsdown": "0.12.0",
49
49
  "typescript": "5.5.4",
50
- "@turbo/tsconfig": "0.0.0",
51
- "@turbo/utils": "0.0.0",
52
50
  "@turbo/test-utils": "0.0.0",
53
- "@turbo/workspaces": "2.8.20",
54
- "@turbo/types": "2.8.20"
51
+ "@turbo/types": "2.8.21-canary.10",
52
+ "@turbo/workspaces": "2.8.21-canary.10",
53
+ "@turbo/utils": "0.0.0",
54
+ "@turbo/tsconfig": "0.0.0"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsdown",