turbo-ignore 1.7.3 → 1.7.4

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ GFS4: `),console.error(n)}),e[a]||(l=global[a]||[],f(e,l),e.close=function(n){fu
8
8
  `;typeof s=="object"&&s!==null&&(s.spaces&&(l=s.spaces),s.EOL&&(p=s.EOL));var w=JSON.stringify(f,s?s.replacer:null,l);return w.replace(/\n/g,p)+p}function d(f,s,l,p){p==null&&(p=l,l={}),l=l||{};var w=l.fs||e,T="";try{T=E(s,l)}catch(S){p&&p(S,null);return}w.writeFile(f,T,l,p)}function a(f,s,l){l=l||{};var p=l.fs||e,w=E(s,l);return p.writeFileSync(f,w,l)}function o(f){return Buffer.isBuffer(f)&&(f=f.toString("utf8")),f=f.replace(/^\uFEFF/,""),f}var m={readFile:i,readFileSync:t,writeFile:d,writeFileSync:a};r.exports=m}}),Ee=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/json/jsonfile.js"(u,r){"use strict";R();var e=te().fromCallback,i=Br();r.exports={readJson:e(i.readFile),readJsonSync:i.readFileSync,writeJson:e(i.writeFile),writeJsonSync:i.writeFileSync}}}),Vr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/json/output-json.js"(u,r){"use strict";R();var e=require("path"),i=oe(),t=ue().pathExists,E=Ee();function d(a,o,m,f){typeof m=="function"&&(f=m,m={});let s=e.dirname(a);t(s,(l,p)=>{if(l)return f(l);if(p)return E.writeJson(a,o,m,f);i.mkdirs(s,w=>{if(w)return f(w);E.writeJson(a,o,m,f)})})}r.exports=d}}),Hr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/json/output-json-sync.js"(u,r){"use strict";R();var e=Q(),i=require("path"),t=oe(),E=Ee();function d(a,o,m){let f=i.dirname(a);e.existsSync(f)||t.mkdirsSync(f),E.writeJsonSync(a,o,m)}r.exports=d}}),Yr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/json/index.js"(u,r){"use strict";R();var e=te().fromCallback,i=Ee();i.outputJson=e(Vr()),i.outputJsonSync=Hr(),i.outputJSON=i.outputJson,i.outputJSONSync=i.outputJsonSync,i.writeJSON=i.writeJson,i.writeJSONSync=i.writeJsonSync,i.readJSON=i.readJson,i.readJSONSync=i.readJsonSync,r.exports=i}}),Kr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/move-sync/move-sync.js"(u,r){"use strict";R();var e=Q(),i=require("path"),t=Ae().copySync,E=ge().removeSync,d=oe().mkdirpSync,a=ve();function o(l,p,w){w=w||{};let T=w.overwrite||w.clobber||!1,{srcStat:S}=a.checkPathsSync(l,p,"move");return a.checkParentPathsSync(l,S,p,"move"),d(i.dirname(p)),m(l,p,T)}function m(l,p,w){if(w)return E(p),f(l,p,w);if(e.existsSync(p))throw new Error("dest already exists.");return f(l,p,w)}function f(l,p,w){try{e.renameSync(l,p)}catch(T){if(T.code!=="EXDEV")throw T;return s(l,p,w)}}function s(l,p,w){return t(l,p,{overwrite:w,errorOnExist:!0}),E(l)}r.exports=o}}),Qr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/move-sync/index.js"(u,r){"use strict";R(),r.exports={moveSync:Kr()}}}),Xr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/move/move.js"(u,r){"use strict";R();var e=Q(),i=require("path"),t=$e().copy,E=ge().remove,d=oe().mkdirp,a=ue().pathExists,o=ve();function m(p,w,T,S){typeof T=="function"&&(S=T,T={});let v=T.overwrite||T.clobber||!1;o.checkPaths(p,w,"move",(n,y)=>{if(n)return S(n);let{srcStat:x}=y;o.checkParentPaths(p,x,w,"move",c=>{if(c)return S(c);d(i.dirname(w),h=>h?S(h):f(p,w,v,S))})})}function f(p,w,T,S){if(T)return E(w,v=>v?S(v):s(p,w,T,S));a(w,(v,n)=>v?S(v):n?S(new Error("dest already exists.")):s(p,w,T,S))}function s(p,w,T,S){e.rename(p,w,v=>v?v.code!=="EXDEV"?S(v):l(p,w,T,S):S())}function l(p,w,T,S){t(p,w,{overwrite:T,errorOnExist:!0},n=>n?S(n):E(p,S))}r.exports=m}}),zr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/move/index.js"(u,r){"use strict";R();var e=te().fromCallback;r.exports={move:e(Xr())}}}),Zr=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/output/index.js"(u,r){"use strict";R();var e=te().fromCallback,i=Q(),t=require("path"),E=oe(),d=ue().pathExists;function a(m,f,s,l){typeof s=="function"&&(l=s,s="utf8");let p=t.dirname(m);d(p,(w,T)=>{if(w)return l(w);if(T)return i.writeFile(m,f,s,l);E.mkdirs(p,S=>{if(S)return l(S);i.writeFile(m,f,s,l)})})}function o(m,...f){let s=t.dirname(m);if(i.existsSync(s))return i.writeFileSync(m,...f);E.mkdirsSync(s),i.writeFileSync(m,...f)}r.exports={outputFile:e(a),outputFileSync:o}}}),et=D({"../../node_modules/.pnpm/fs-extra@8.1.0/node_modules/fs-extra/lib/index.js"(u,r){"use strict";R(),r.exports=Object.assign({},De(),Ae(),$e(),Mr(),Ur(),Yr(),oe(),Qr(),zr(),Zr(),ue(),ge());var e=require("fs");Object.getOwnPropertyDescriptor(e,"promises")&&Object.defineProperty(r.exports,"promises",{get(){return e.promises}})}}),We={};gr(We,{getTurboRoot:()=>ht,searchUp:()=>Ge});Je.exports=_r(We);R();R();R();var Et=le(xr());R();R();function rt(u,r){if(!(u instanceof r))throw new TypeError("Cannot call a class as a function")}R();R();function we(u){return we=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},we(u)}R();function tt(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}function nt(u,r){if(r&&(we(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tt(u)}R();function ye(u){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ye(u)}R();R();function me(u,r){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,t){return i.__proto__=t,i},me(u,r)}function it(u,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");u.prototype=Object.create(r&&r.prototype,{constructor:{value:u,writable:!0,configurable:!0}}),Object.defineProperty(u,"prototype",{writable:!1}),r&&me(u,r)}R();R();function ot(u){return Function.toString.call(u).indexOf("[native code]")!==-1}R();R();function st(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function de(u,r,e){return st()?de=Reflect.construct.bind():de=function(t,E,d){var a=[null];a.push.apply(a,E);var o=Function.bind.apply(t,a),m=new o;return d&&me(m,d.prototype),m},de.apply(null,arguments)}function Se(u){var r=typeof Map=="function"?new Map:void 0;return Se=function(i){if(i===null||!ot(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(i))return r.get(i);r.set(i,t)}function t(){return de(i,arguments,ye(this).constructor)}return t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),me(t,i)},Se(u)}var ut=le(Nr()),ke=le(require("path")),Oe=le(et()),at=function(u){it(r,u);function r(e){var i;return rt(this,r),i=nt(this,ye(r).call(this,"No package.json could be found upwards from the directory ".concat(e))),i.directory=e,i}return r}(Se(Error));function ct(u,r){try{var e=Oe.default.readJsonSync(ke.default.join(u,"package.json"));if(r.current===void 0&&(r.current=u),e.workspaces||e.bolt)return u}catch(i){if(i.code!=="ENOENT")throw i}}function ft(u){try{var r=Oe.default.readJsonSync(ke.default.join(u,"lerna.json"));if(r.useWorkspaces!==!0)return u}catch(e){if(e.code!=="ENOENT")throw e}}function lt(u){var r=Oe.default.existsSync(ke.default.join(u,"pnpm-workspace.yaml"));if(r)return u}function mt(u){var r={current:void 0},e=(0,ut.sync)(function(i){return[ft(i),ct(i,r),lt(i)].find(function(t){return t})},{cwd:u,type:"directory"});if(r.current===void 0)throw new at(u);return e===void 0?r.current:e}R();var pt=le(require("fs")),_e=le(require("path"));function dt({target:u,cwd:r}){let e=_e.default.parse(r).root,i=!1;for(;!i&&r!==e;){if(pt.default.existsSync(_e.default.join(r,u))){i=!0;break}r=_e.default.dirname(r)}return i?r:null}var Ge=dt;function yt(u){let r=Ge({target:"turbo.json",cwd:u||process.cwd()});if(!r)try{if(r=mt(u||process.cwd()),!r)return null}catch{return null}return r}var ht=yt;});Y();Y();var rr=require("child_process"),tr=pe(require("path")),nr=pe(Ue());Y();Y();var je="\u226B ";function K(...u){console.log(je,...u)}function ae(...u){console.error(je,...u)}function Be(...u){console.warn(je,...u)}function Ve(u){let{fallback:r,workspace:e}=u;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?(K(`found previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}" on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`),{ref:process.env.VERCEL_GIT_PREVIOUS_SHA,type:"previousDeploy"}):(K(`no previous deployments found for "${e}" on branch "${process.env.VERCEL_GIT_COMMIT_REF}".`),r?(K(`falling back to ref ${r}`),{ref:r,type:"customFallback"}):null):{ref:"HEAD^",type:"headRelative"}}Y();function He(u){return u.task?(K(`using "${u.task}" as the task from the arguments`),`"${u.task}"`):(K('using "build" as the task as it was unspecified'),"build")}Y();var Ye=pe(require("fs")),Ke=pe(require("path"));function Qe(u){let{directory:r=process.cwd(),workspace:e}=u;if(e)return K(`using "${e}" as workspace from arguments`),e;let i=Ke.default.join(r,"package.json");try{let t=Ye.default.readFileSync(i,"utf8"),E=JSON.parse(t);return E.name?(K(`inferred "${E.name}" as workspace from "package.json"`),E.name):(ae(`"${i}" is missing the "name" field (required).`),null)}catch{return ae(`"${i}" could not be found. turbo-ignore inferencing failed`),null}}Y();var be={MISSING_LOCKFILE:{regex:/reading (yarn.lock|package-lock.json|pnpm-lock.yaml):.*?no such file or directory/,message:"turbo-ignore could not complete - no lockfile found, please commit one to your repository"},NO_PACKAGE_MANAGER:{regex:/run failed: We did not detect an in-use package manager for your project/,message:'turbo-ignore could not complete - no package manager detected, please commit a lockfile, or set "packageManager" in your root "package.json"'},UNREACHABLE_PARENT:{regex:/failed to resolve packages to run: commit HEAD\^ does not exist/,message:"turbo-ignore could not complete - parent commit does not exist or is unreachable"},UNREACHABLE_COMMIT:{regex:/commit \S+ does not exist/,message:"turbo-ignore could not complete - commit does not exist or is unreachable"}};function Xe({err:u}){let r=Object.keys(be).find(e=>{let{regex:i}=be[e];return i.test(u)});return r?{level:"warn",message:be[r].message,code:r}:{level:"error",message:u,code:"UNKNOWN_ERROR"}}Y();var ze=require("child_process"),Ne=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],Te=["[vercel deploy]","[vercel build]"];function Fe({workspace:u}){return[`[vercel skip ${u}]`]}function Pe({workspace:u}){return[`[vercel deploy ${u}]`,`[vercel build ${u}]`]}function vt(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,ze.execSync)("git show -s --format=%B").toString()}function Ze({workspace:u}){let r=vt(),e=a=>r.includes(a),i=Pe({workspace:u}).find(e),t=Fe({workspace:u}).find(e);if(i&&t)return{result:"conflict",scope:"workspace",reason:`conflicting commit messages found: ${i} and ${t}`};if(i)return{result:"deploy",scope:"workspace",reason:`found commit message: ${i}`};if(t)return{result:"skip",scope:"workspace",reason:`found commit message: ${t}`};let E=Te.find(e),d=Ne.find(e);return E&&d?{result:"conflict",scope:"global",reason:`conflicting commit messages found: ${E} and ${d}`}:E?{result:"deploy",scope:"global",reason:`found commit message: ${E}`}:d?{result:"skip",scope:"global",reason:`found commit message: ${d}`}:{result:"continue",scope:"global",reason:"no deploy or skip string found in commit message."}}function er(){return console.log(`
9
9
  \u2B1C\uFE0F ignoring the change`),process.exit(0)}function ce(){return console.log(`
10
10
  \u2705 proceeding with deployment`),process.exit(1)}function Ie({args:u}){if(K(`Using Turborepo to determine if this project is affected by the commit...
11
- `),u.directory=u.directory?tr.default.resolve(u.directory):process.cwd(),process.env.TURBO_FORCE==="true")return K("`TURBO_FORCE` detected"),ce();let r=(0,nr.getTurboRoot)(u.directory);if(!r)return ae("monorepo root not found. turbo-ignore inferencing failed"),ce();let e=Qe(u);if(!e)return ce();let i=He(u),t=Ze({workspace:e});if(t.result==="skip")return K(t.reason),er();if(t.result==="deploy")return K(t.reason),ce();t.result==="conflict"&&K(t.reason);let E=Ve({workspace:e,fallback:u.fallback});if(!E)return ce();let d=`npx turbo run ${i} --filter=${e}...[${E.ref}] --dry=json`;K(`analyzing results of \`${d}\``),(0,rr.exec)(d,{cwd:r},(a,o)=>{if(a){let{level:m,code:f,message:s}=Xe({err:a.message});return m==="warn"?Be(s):ae(`${f}: ${a}`),ce()}try{let m=JSON.parse(o);if(m==null)return ae(`failed to parse JSON output from \`${d}\`.`),ce();let{packages:f}=m;return f&&f.length>0?(f.length===1?K(`this commit affects "${e}"`):K(`this commit affects "${e}" and ${f.length-1} ${f.length-1===1?"dependency":"dependencies"} (${f.slice(1).join(", ")})`),ce()):(K("this project and its dependencies are not affected"),er())}catch(m){return ae(`failed to parse JSON output from \`${d}\`.`),ae(m),ce()}})}Y();var ir={name:"turbo-ignore",version:"1.7.3",description:"",homepage:"https://turbo.build/repo",keywords:[],author:"Jared Palmer",license:"MPL-2.0",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turbo/issues"},files:["dist"],main:"dist/index.js",bin:"dist/index.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/**/*.ts","check-types":"tsc --noEmit"},devDependencies:{"@types/jest":"^27.4.0","@types/node":"^16.11.12",eslint:"^8.20.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsconfig:"workspace:*",tsup:"^5.12.1","turbo-test-utils":"workspace:^0.0.0","turbo-utils":"workspace:*",typescript:"^4.7.4"}};var _t=`
11
+ `),u.directory=u.directory?tr.default.resolve(u.directory):process.cwd(),process.env.TURBO_FORCE==="true")return K("`TURBO_FORCE` detected"),ce();let r=(0,nr.getTurboRoot)(u.directory);if(!r)return ae("monorepo root not found. turbo-ignore inferencing failed"),ce();let e=Qe(u);if(!e)return ce();let i=He(u),t=Ze({workspace:e});if(t.result==="skip")return K(t.reason),er();if(t.result==="deploy")return K(t.reason),ce();t.result==="conflict"&&K(t.reason);let E=Ve({workspace:e,fallback:u.fallback});if(!E)return ce();let d=`npx turbo run ${i} --filter=${e}...[${E.ref}] --dry=json`;K(`analyzing results of \`${d}\``),(0,rr.exec)(d,{cwd:r},(a,o)=>{if(a){let{level:m,code:f,message:s}=Xe({err:a.message});return m==="warn"?Be(s):ae(`${f}: ${a}`),ce()}try{let m=JSON.parse(o);if(m==null)return ae(`failed to parse JSON output from \`${d}\`.`),ce();let{packages:f}=m;return f&&f.length>0?(f.length===1?K(`this commit affects "${e}"`):K(`this commit affects "${e}" and ${f.length-1} ${f.length-1===1?"dependency":"dependencies"} (${f.slice(1).join(", ")})`),ce()):(K("this project and its dependencies are not affected"),er())}catch(m){return ae(`failed to parse JSON output from \`${d}\`.`),ae(m),ce()}})}Y();var ir={name:"turbo-ignore",version:"1.7.4",description:"",homepage:"https://turbo.build/repo",keywords:[],author:"Jared Palmer",license:"MPL-2.0",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turbo/issues"},files:["dist"],main:"dist/index.js",bin:"dist/index.js",scripts:{build:"tsup",test:"jest",lint:"eslint src/**/*.ts","check-types":"tsc --noEmit"},devDependencies:{"@types/jest":"^27.4.0","@types/node":"^16.11.12",eslint:"^8.20.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsconfig:"workspace:*",tsup:"^5.12.1","turbo-test-utils":"workspace:^0.0.0","turbo-utils":"workspace:*",typescript:"^4.7.4"}};var _t=`
12
12
  turbo-ignore
13
13
 
14
14
  Automatically ignore builds that have no changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-ignore",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "keywords": [],