@under_koen/bsm 1.9.1 → 1.10.0

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 +2 -2
  2. package/package.json +7 -5
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #! /usr/bin/env node
2
- var On=Object.create;var ds=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Fn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var pi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Bn=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Dn(t))!Mn.call(e,r)&&r!==i&&ds(e,r,{get:()=>t[r],enumerable:!(s=Ln(t,r))||s.enumerable});return e};var ms=(e,t,i)=>(i=e!=null?On(Fn(e)):{},Bn(t||!e||!e.__esModule?ds(i,"default",{value:e,enumerable:!0}):i,e));var bs=pi((Cu,ys)=>{"use strict";function Vn(e,t){var i=e;t.slice(0,-1).forEach(function(r){i=i[r]||{}});var s=t[t.length-1];return s in i}function gs(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function xs(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}ys.exports=function(e,t){t||(t={});var i={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(i.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?i.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(x){i.bools[x]=!0});var s={};function r(x){return s[x].some(function(_){return i.bools[_]})}Object.keys(t.alias||{}).forEach(function(x){s[x]=[].concat(t.alias[x]),s[x].forEach(function(_){s[_]=[x].concat(s[x].filter(function(L){return _!==L}))})}),[].concat(t.string).filter(Boolean).forEach(function(x){i.strings[x]=!0,s[x]&&[].concat(s[x]).forEach(function(_){i.strings[_]=!0})});var n=t.default||{},a={_:[]};function o(x,_){return i.allBools&&/^--[^=]+$/.test(_)||i.strings[x]||i.bools[x]||s[x]}function h(x,_,L){for(var A=x,J=0;J<_.length-1;J++){var W=_[J];if(xs(A,W))return;A[W]===void 0&&(A[W]={}),(A[W]===Object.prototype||A[W]===Number.prototype||A[W]===String.prototype)&&(A[W]={}),A[W]===Array.prototype&&(A[W]=[]),A=A[W]}var N=_[_.length-1];xs(A,N)||((A===Object.prototype||A===Number.prototype||A===String.prototype)&&(A={}),A===Array.prototype&&(A=[]),A[N]===void 0||i.bools[N]||typeof A[N]=="boolean"?A[N]=L:Array.isArray(A[N])?A[N].push(L):A[N]=[A[N],L])}function c(x,_,L){if(!(L&&i.unknownFn&&!o(x,L)&&i.unknownFn(L)===!1)){var A=!i.strings[x]&&gs(_)?Number(_):_;h(a,x.split("."),A),(s[x]||[]).forEach(function(J){h(a,J.split("."),A)})}}Object.keys(i.bools).forEach(function(x){c(x,n[x]===void 0?!1:n[x])});var l=[];e.indexOf("--")!==-1&&(l=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var f=0;f<e.length;f++){var p=e[f],d,y;if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);d=m[1];var b=m[2];i.bools[d]&&(b=b!=="false"),c(d,b,p)}else if(/^--no-.+/.test(p))d=p.match(/^--no-(.+)/)[1],c(d,!1,p);else if(/^--.+/.test(p))d=p.match(/^--(.+)/)[1],y=e[f+1],y!==void 0&&!/^(-|--)[^-]/.test(y)&&!i.bools[d]&&!i.allBools&&(!s[d]||!r(d))?(c(d,y,p),f+=1):/^(true|false)$/.test(y)?(c(d,y==="true",p),f+=1):c(d,i.strings[d]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),E=!1,S=0;S<g.length;S++){if(y=p.slice(S+2),y==="-"){c(g[S],y,p);continue}if(/[A-Za-z]/.test(g[S])&&y[0]==="="){c(g[S],y.slice(1),p),E=!0;break}if(/[A-Za-z]/.test(g[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){c(g[S],y,p),E=!0;break}if(g[S+1]&&g[S+1].match(/\W/)){c(g[S],p.slice(S+2),p),E=!0;break}else c(g[S],i.strings[g[S]]?"":!0,p)}d=p.slice(-1)[0],!E&&d!=="-"&&(e[f+1]&&!/^(-|--)[^-]/.test(e[f+1])&&!i.bools[d]&&(!s[d]||!r(d))?(c(d,e[f+1],p),f+=1):e[f+1]&&/^(true|false)$/.test(e[f+1])?(c(d,e[f+1]==="true",p),f+=1):c(d,i.strings[d]?"":!0,p))}else if((!i.unknownFn||i.unknownFn(p)!==!1)&&a._.push(i.strings._||!gs(p)?p:Number(p)),t.stopEarly){a._.push.apply(a._,e.slice(f+1));break}}return Object.keys(n).forEach(function(x){Vn(a,x.split("."))||(h(a,x.split("."),n[x]),(s[x]||[]).forEach(function(_){h(a,_.split("."),n[x])}))}),t["--"]?a["--"]=l.slice():l.forEach(function(x){a._.push(x)}),a}});var ws=pi((Pu,jn)=>{jn.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var _s=pi(ft=>{"use strict";var Ss=ws(),F=process.env;Object.defineProperty(ft,"_vendors",{value:Ss.map(function(e){return e.constant})});ft.name=null;ft.isPR=null;ft.id=null;Ss.forEach(function(e){let i=(Array.isArray(e.env)?e.env:[e.env]).every(function(s){return Es(s)});ft[e.constant]=i,i&&(ft.name=e.name,ft.isPR=$n(e),ft.id=e.constant)});ft.isCI=!!(F.CI!=="false"&&(F.BUILD_ID||F.BUILD_NUMBER||F.CI||F.CI_APP_ID||F.CI_BUILD_ID||F.CI_BUILD_NUMBER||F.CI_NAME||F.CONTINUOUS_INTEGRATION||F.RUN_ID||ft.name));function Es(e){return typeof e=="string"?!!F[e]:"env"in e?F[e.env]&&F[e.env].includes(e.includes):"any"in e?e.any.some(function(t){return!!F[t]}):Object.keys(e).every(function(t){return F[t]===e[t]})}function $n(e){switch(typeof e.pr){case"string":return!!F[e.pr];case"object":return"env"in e.pr?"any"in e.pr?e.pr.any.some(function(t){return F[e.pr.env]===t}):e.pr.env in F&&F[e.pr.env]!==e.pr.ne:"any"in e.pr?e.pr.any.some(function(t){return!!F[t]}):Es(e.pr);default:return null}}});var Pn=ms(bs(),1);import{createPrompt as yu,useState as ui,useKeypress as bu,useMemo as vu}from"@inquirer/core";var I=class{static silent=!1;static silence(){this.silent=!0}static log(...t){this.silent||console.log(...t)}static error(...t){this.silent||console.error(...t)}};var vs={name:"@under_koen/bsm",version:"1.9.1",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},type:"module",main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.3.0","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.9.0",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^5.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",glob:"^11.0.3",globals:"^16.0.0",minimist:"^1.2.8",mlly:"^1.8.0",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^24.2.3",sinon:"^19.0.2",tsx:"^4.20.6",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]};var lt=class e{static printHelp(t,i){let s=i._;if(s.length===0)I.log(`
2
+ var On=Object.create;var ds=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Fn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var pi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Bn=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Dn(t))!Mn.call(e,r)&&r!==i&&ds(e,r,{get:()=>t[r],enumerable:!(s=Ln(t,r))||s.enumerable});return e};var ms=(e,t,i)=>(i=e!=null?On(Fn(e)):{},Bn(t||!e||!e.__esModule?ds(i,"default",{value:e,enumerable:!0}):i,e));var bs=pi((Cu,ys)=>{"use strict";function Vn(e,t){var i=e;t.slice(0,-1).forEach(function(r){i=i[r]||{}});var s=t[t.length-1];return s in i}function gs(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function xs(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}ys.exports=function(e,t){t||(t={});var i={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(i.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?i.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(x){i.bools[x]=!0});var s={};function r(x){return s[x].some(function(_){return i.bools[_]})}Object.keys(t.alias||{}).forEach(function(x){s[x]=[].concat(t.alias[x]),s[x].forEach(function(_){s[_]=[x].concat(s[x].filter(function(L){return _!==L}))})}),[].concat(t.string).filter(Boolean).forEach(function(x){i.strings[x]=!0,s[x]&&[].concat(s[x]).forEach(function(_){i.strings[_]=!0})});var n=t.default||{},a={_:[]};function o(x,_){return i.allBools&&/^--[^=]+$/.test(_)||i.strings[x]||i.bools[x]||s[x]}function h(x,_,L){for(var A=x,J=0;J<_.length-1;J++){var W=_[J];if(xs(A,W))return;A[W]===void 0&&(A[W]={}),(A[W]===Object.prototype||A[W]===Number.prototype||A[W]===String.prototype)&&(A[W]={}),A[W]===Array.prototype&&(A[W]=[]),A=A[W]}var N=_[_.length-1];xs(A,N)||((A===Object.prototype||A===Number.prototype||A===String.prototype)&&(A={}),A===Array.prototype&&(A=[]),A[N]===void 0||i.bools[N]||typeof A[N]=="boolean"?A[N]=L:Array.isArray(A[N])?A[N].push(L):A[N]=[A[N],L])}function c(x,_,L){if(!(L&&i.unknownFn&&!o(x,L)&&i.unknownFn(L)===!1)){var A=!i.strings[x]&&gs(_)?Number(_):_;h(a,x.split("."),A),(s[x]||[]).forEach(function(J){h(a,J.split("."),A)})}}Object.keys(i.bools).forEach(function(x){c(x,n[x]===void 0?!1:n[x])});var l=[];e.indexOf("--")!==-1&&(l=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var f=0;f<e.length;f++){var p=e[f],d,y;if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);d=m[1];var b=m[2];i.bools[d]&&(b=b!=="false"),c(d,b,p)}else if(/^--no-.+/.test(p))d=p.match(/^--no-(.+)/)[1],c(d,!1,p);else if(/^--.+/.test(p))d=p.match(/^--(.+)/)[1],y=e[f+1],y!==void 0&&!/^(-|--)[^-]/.test(y)&&!i.bools[d]&&!i.allBools&&(!s[d]||!r(d))?(c(d,y,p),f+=1):/^(true|false)$/.test(y)?(c(d,y==="true",p),f+=1):c(d,i.strings[d]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),E=!1,S=0;S<g.length;S++){if(y=p.slice(S+2),y==="-"){c(g[S],y,p);continue}if(/[A-Za-z]/.test(g[S])&&y[0]==="="){c(g[S],y.slice(1),p),E=!0;break}if(/[A-Za-z]/.test(g[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){c(g[S],y,p),E=!0;break}if(g[S+1]&&g[S+1].match(/\W/)){c(g[S],p.slice(S+2),p),E=!0;break}else c(g[S],i.strings[g[S]]?"":!0,p)}d=p.slice(-1)[0],!E&&d!=="-"&&(e[f+1]&&!/^(-|--)[^-]/.test(e[f+1])&&!i.bools[d]&&(!s[d]||!r(d))?(c(d,e[f+1],p),f+=1):e[f+1]&&/^(true|false)$/.test(e[f+1])?(c(d,e[f+1]==="true",p),f+=1):c(d,i.strings[d]?"":!0,p))}else if((!i.unknownFn||i.unknownFn(p)!==!1)&&a._.push(i.strings._||!gs(p)?p:Number(p)),t.stopEarly){a._.push.apply(a._,e.slice(f+1));break}}return Object.keys(n).forEach(function(x){Vn(a,x.split("."))||(h(a,x.split("."),n[x]),(s[x]||[]).forEach(function(_){h(a,_.split("."),n[x])}))}),t["--"]?a["--"]=l.slice():l.forEach(function(x){a._.push(x)}),a}});var ws=pi((Pu,jn)=>{jn.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var _s=pi(ft=>{"use strict";var Ss=ws(),F=process.env;Object.defineProperty(ft,"_vendors",{value:Ss.map(function(e){return e.constant})});ft.name=null;ft.isPR=null;ft.id=null;Ss.forEach(function(e){let i=(Array.isArray(e.env)?e.env:[e.env]).every(function(s){return Es(s)});ft[e.constant]=i,i&&(ft.name=e.name,ft.isPR=$n(e),ft.id=e.constant)});ft.isCI=!!(F.CI!=="false"&&(F.BUILD_ID||F.BUILD_NUMBER||F.CI||F.CI_APP_ID||F.CI_BUILD_ID||F.CI_BUILD_NUMBER||F.CI_NAME||F.CONTINUOUS_INTEGRATION||F.RUN_ID||ft.name));function Es(e){return typeof e=="string"?!!F[e]:"env"in e?F[e.env]&&F[e.env].includes(e.includes):"any"in e?e.any.some(function(t){return!!F[t]}):Object.keys(e).every(function(t){return F[t]===e[t]})}function $n(e){switch(typeof e.pr){case"string":return!!F[e.pr];case"object":return"env"in e.pr?"any"in e.pr?e.pr.any.some(function(t){return F[e.pr.env]===t}):e.pr.env in F&&F[e.pr.env]!==e.pr.ne:"any"in e.pr?e.pr.any.some(function(t){return!!F[t]}):Es(e.pr);default:return null}}});var Pn=ms(bs(),1);import{createPrompt as yu,useState as ui,useKeypress as bu,useMemo as vu}from"@inquirer/core";var I=class{static silent=!1;static silence(){this.silent=!0}static log(...t){this.silent||console.log(...t)}static error(...t){this.silent||console.error(...t)}};var vs={name:"@under_koen/bsm",version:"1.10.0",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},type:"module",main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.3.0","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.0","@semantic-release/npm":"^13.1.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.9.1",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^5.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",glob:"^11.0.3",globals:"^16.0.0",minimist:"^1.2.8",mlly:"^1.8.0",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^25.0.1",sinon:"^19.0.2",tsx:"^4.20.6",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]};var lt=class e{static printHelp(t,i){let s=i._;if(s.length===0)I.log(`
3
3
  \x1B[1mAvailable commands:\x1B[0m`),e.printCommands(t.scripts);else for(let r of s){I.log(`
4
4
  \x1B[1mAvailable commands: \x1B[90m${r}\x1B[0m`);let n=r.split("."),a=[[t.scripts,[],n]];for(;a.length>0;){let o=a.shift();if(o[2].length===0)e.printCommands(o[0],o[1]);else if(o[2][0]==="*"){if(typeof o[0]=="object")if(Array.isArray(o[0]))for(let h=0;h<o[0].length;h++)a.push([o[0][h],[...o[1],h.toString()],[]]);else for(let h in o[0])Object.hasOwn(o[0],h)&&a.push([o[0][h],[...o[1],h],o[2].slice(1)])}else{let h=o[2][0];if(typeof o[0]=="object")if(Array.isArray(o[0])){let c=parseInt(h);a.push([o[0][c],[...o[1],c.toString()],o[2].slice(1)])}else a.push([o[0][h],[...o[1],h],o[2].slice(1)])}}}process.exit(0)}static printCommands(t,i=[],s=!0){if(Array.isArray(t))t.forEach((r,n)=>{e.printCommand(r,[...i,n.toString()])});else if(typeof t=="object"){s&&i.length>0&&e.printCommand(t,[...i]);for(let r in t)Object.hasOwn(t,r)&&e.printCommand(t[r],[...i,r])}else e.printCommand(t,i)}static printCommand(t,i){if(t===void 0){I.error(`\x1B[31mScript '${i.join(".")}' not found\x1B[0m`);return}let s=e.getCommandHelp(t,i);s&&I.log(s)}static getCommandHelp(t,i){if(i[i.length-1]==="$description")return;let s=`\x1B[92m${i.join(".")}\x1B[0m\x1B[90m - \x1B[0m`,r;return typeof t=="string"?r=t:typeof t=="function"?r="\x1B[90m<function>\x1B[0m":Array.isArray(t)?r=`\x1B[90m[${t.length}]\x1B[0m`:Object.hasOwn(t,"$description")?r=`\x1B[90m${t.$description}\x1B[0m`:r=`\x1B[90m{${Object.keys(t).join(", ")}}\x1B[0m`,`${s}${r}`}static printVersion(){I.log(vs.version),process.exit(0)}};var In=ms(_s(),1);import gu from"node:child_process";import xu from"path";import ps from"fs";function di(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function mi(e,t,i=".",s){if(!di(t))return mi(e,{},i,s);let r=Object.assign({},t);for(let n in e){if(n==="__proto__"||n==="constructor")continue;let a=e[n];a!=null&&(s&&s(r,n,a,i)||(Array.isArray(a)&&Array.isArray(r[n])?r[n]=[...a,...r[n]]:di(a)&&di(r[n])?r[n]=mi(a,r[n],(i?`${i}.`:"")+n.toString(),s):r[n]=a))}return r}function gi(e){return(...t)=>t.reduce((i,s)=>mi(i,s,"",e),{})}var Cs=gi(),Ou=gi((e,t,i)=>{if(e[t]!==void 0&&typeof i=="function")return e[t]=i(e[t]),!0}),Lu=gi((e,t,i)=>{if(Array.isArray(e[t])&&typeof i=="function")return e[t]=i(e[t]),!0});var Wn=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Ps=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Gn="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ns="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",xi={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},yi="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",zn={5:yi,"5module":yi+" export import",6:yi+" const class extends export import super"},Hn=/^in(stanceof)?$/,qn=new RegExp("["+Ns+"]"),Kn=new RegExp("["+Ns+Gn+"]");function vi(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function yt(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&qn.test(String.fromCharCode(e)):t===!1?!1:vi(e,Ps)}function kt(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Kn.test(String.fromCharCode(e)):t===!1?!1:vi(e,Ps)||vi(e,Wn)}var k=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function st(e,t){return new k(e,{beforeExpr:!0,binop:t})}var rt={beforeExpr:!0},X={startsExpr:!0},_i={};function T(e,t){return t===void 0&&(t={}),t.keyword=e,_i[e]=new k(e,t)}var u={num:new k("num",X),regexp:new k("regexp",X),string:new k("string",X),name:new k("name",X),privateId:new k("privateId",X),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",rt),semi:new k(";",rt),colon:new k(":",rt),dot:new k("."),question:new k("?",rt),questionDot:new k("?."),arrow:new k("=>",rt),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",rt),backQuote:new k("`",X),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:st("||",1),logicalAND:st("&&",2),bitwiseOR:st("|",3),bitwiseXOR:st("^",4),bitwiseAND:st("&",5),equality:st("==/!=/===/!==",6),relational:st("</>/<=/>=",7),bitShift:st("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:st("%",10),star:st("*",10),slash:st("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:st("??",1),_break:T("break"),_case:T("case",rt),_catch:T("catch"),_continue:T("continue"),_debugger:T("debugger"),_default:T("default",rt),_do:T("do",{isLoop:!0,beforeExpr:!0}),_else:T("else",rt),_finally:T("finally"),_for:T("for",{isLoop:!0}),_function:T("function",X),_if:T("if"),_return:T("return",rt),_switch:T("switch"),_throw:T("throw",rt),_try:T("try"),_var:T("var"),_const:T("const"),_while:T("while",{isLoop:!0}),_with:T("with"),_new:T("new",{beforeExpr:!0,startsExpr:!0}),_this:T("this",X),_super:T("super",X),_class:T("class",X),_extends:T("extends",rt),_export:T("export"),_import:T("import",X),_null:T("null",X),_true:T("true",X),_false:T("false",X),_in:T("in",{beforeExpr:!0,binop:7}),_instanceof:T("instanceof",{beforeExpr:!0,binop:7}),_typeof:T("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:T("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:T("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Z=/\r\n?|\n|\u2028|\u2029/,Qn=new RegExp(Z.source,"g");function Gt(e){return e===10||e===13||e===8232||e===8233}function Os(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(Gt(r))return s<i-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var Ls=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ds=Object.prototype,Yn=Ds.hasOwnProperty,Xn=Ds.toString,zt=Object.hasOwn||function(e,t){return Yn.call(e,t)},As=Array.isArray||function(e){return Xn.call(e)==="[object Array]"},Is=Object.create(null);function Tt(e){return Is[e]||(Is[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Et(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Zn=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,oe=function(t,i){this.line=t,this.column=i};oe.prototype.offset=function(t){return new oe(this.line,this.column+t)};var Le=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Fs(e,t){for(var i=1,s=0;;){var r=Os(e,s,t);if(r<0)return new oe(i,t-s);++i,s=r}}var wi={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Rs=!1;function Jn(e){var t={};for(var i in wi)t[i]=e&&zt(e,i)?e[i]:wi[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Rs&&typeof console=="object"&&console.warn&&(Rs=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
5
5
  Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),As(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return As(t.onComment)&&(t.onComment=ta(t,t.onComment)),t}function ta(e,t){return function(i,s,r,n,a,o){var h={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(h.loc=new Le(this,a,o)),e.ranges&&(h.range=[r,n]),t.push(h)}}var he=1,Ht=2,Ci=4,Ms=8,Ai=16,Bs=32,De=64,Vs=128,Bt=256,ue=512,Fe=he|Ht|Bt;function Ii(e,t){return Ht|(e?Ci:0)|(t?Ms:0)}var ke=0,Ri=1,Ct=2,Us=3,js=4,$s=5,B=function(t,i,s){this.options=t=Jn(t),this.sourceFile=t.sourceFile,this.keywords=Tt(zn[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=xi[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=Tt(r);var n=(r?r+" ":"")+xi.strict;this.reservedWordsStrict=Tt(n),this.reservedWordsStrictBind=Tt(n+" "+xi.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
@@ -19,7 +19,7 @@ globstar while`,t,p,i,d,y),this.matchOne(t.slice(p),i.slice(d),s))return this.de
19
19
  `),{};let r=ps.readFileSync(i,"utf-8").replaceAll("\r","").split(`
20
20
  `).filter(a=>!a.startsWith("#")&&a.trim()!==""),n={};for(let a of r){let h=/^([^=]+)=(['"])?(.+)\2$/g.exec(a);if(h){let c=h[3];h[2]==='"'&&(c=c.replaceAll(/(?<=(?<!\\)(\\\\)*)\\n/g,`
21
21
  `).replaceAll(/(?<=(?<!\\)(\\\\)*)\\t/g," ").replaceAll(/(?<=(?<!\\)(\\\\)*)\\r/g,"\r").replaceAll(/(?<=(?<!\\)(\\\\)*)\\\\/g,"\\")),n[h[1]]=c}}return n}else return I.error(`\x1B[31mCurrently only 'file:' is supported for environment variables\x1B[0m
22
- `),{}}else if(typeof t=="object")if(Array.isArray(t)){let i={};for(let s of t)i={...i,...e.getEnv(s)};return i}else return t;else{let i=t.call(null,process.argv);return i===void 0?{}:e.getEnv(i)}}static async executeHook(t,i,s,r){return Object.hasOwn(t,i)?(await e.runScript(t[i],[],[...s,i],{...r,excludeArgs:!0}),!0):!1}static get _isCI(){return In.isCI}static get objectScripts(){let t=[`_${process.platform}`,`_${process.arch}`,"_default"];return e._isCI&&t.unshift("_ci"),t}static async runObject(t,i,s){for(let r of e.objectScripts)if(Object.hasOwn(t,r)){await e.runScript(t[r],[],[...i,r],s);return}await e.notFound([...i,"_default"],s,t)}static isExecutable(t){if(typeof t=="function"||typeof t=="string")return!0;if(typeof t!="object")return!1;if(Array.isArray(t))return!0;for(let i of e.objectScripts)if(Object.hasOwn(t,i))return!0;return!1}};var Wt=class{static async selectScript(t,i){var o;let r=(((o=i._[0])==null?void 0:o.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),n=[],a=t.scripts;for(let h of r){let c;if(Array.isArray(a)?c=a[Number.parseInt(h)]:c=a[h],typeof c!="object")break;n.push([h,a]),a=c}return yu((h,c)=>{let[l,f]=ui(n),[p,d]=ui(a),y=vu(()=>typeof p=="string"||typeof p=="function"?[]:Object.entries(p).map(N=>[N[0],N[1],lt.getCommandHelp(N[1],[N[0]])]).filter(N=>N[2]!==void 0),[p,l]),[m,b]=ui(0),[g,E]=ui(!1),S=y.length,x=y[m][0],_=y[m][1],L=[...l.map(N=>N[0]),x].join("."),A=`
22
+ `),{}}else if(typeof t=="object")if(Array.isArray(t)){let i={};for(let s of t)i={...i,...e.getEnv(s)};return i}else return t;else{let i=t.call(null,process.argv);return i===void 0?{}:e.getEnv(i)}}static async executeHook(t,i,s,r){return Object.hasOwn(t,i)?(await e.runScript(t[i],[],[...s,i],{...r,excludeArgs:!0}),!0):!1}static get _isCI(){return In.isCI}static get objectScripts(){let[t,i,s]=process.versions.node.split("."),r=[`_${process.platform}`,`_${process.arch}`,`_node${t}_${i}_${s}`,`_node${t}_${i}`,`_node${t}`,"_default"];return e._isCI&&r.unshift("_ci"),r}static async runObject(t,i,s){for(let r of e.objectScripts)if(Object.hasOwn(t,r)){await e.runScript(t[r],[],[...i,r],s);return}await e.notFound([...i,"_default"],s,t)}static isExecutable(t){if(typeof t=="function"||typeof t=="string")return!0;if(typeof t!="object")return!1;if(Array.isArray(t))return!0;for(let i of e.objectScripts)if(Object.hasOwn(t,i))return!0;return!1}};var Wt=class{static async selectScript(t,i){var o;let r=(((o=i._[0])==null?void 0:o.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),n=[],a=t.scripts;for(let h of r){let c;if(Array.isArray(a)?c=a[Number.parseInt(h)]:c=a[h],typeof c!="object")break;n.push([h,a]),a=c}return yu((h,c)=>{let[l,f]=ui(n),[p,d]=ui(a),y=vu(()=>typeof p=="string"||typeof p=="function"?[]:Object.entries(p).map(N=>[N[0],N[1],lt.getCommandHelp(N[1],[N[0]])]).filter(N=>N[2]!==void 0),[p,l]),[m,b]=ui(0),[g,E]=ui(!1),S=y.length,x=y[m][0],_=y[m][1],L=[...l.map(N=>N[0]),x].join("."),A=`
23
23
  \x1B[1mRun command \xBB \x1B[90m${L}\x1B[0m`;if(g)return c([L]),A;function J(){typeof _=="object"&&(b(0),f([...l,[x,p]]),d(_))}bu(N=>{if(N.name==="up")b((m-1+S)%S);else if(N.name==="down")b((m+1)%S);else if(N.name==="left"){if(l.length===0)return;let li=l.slice(0,-1),fi=l[l.length-1];b(Object.keys(fi[1]).indexOf(fi[0])),f(li),d(fi[1])}else N.name==="right"?J():N.name==="return"&&(Mt.isExecutable(_)?E(!0):J())});let W=y.map((N,li)=>`${li===m?"\x1B[32m\x1B[1m> \x1B[4m":" "}${N[2]}`).join(`
24
24
  `);return`${A}
25
25
  ${W}\x1B[?25l`})({message:"test"}).catch(()=>process.exit(1))}};import Rn from"path";function Tn(e){return Array.isArray(e)?e:Object.entries(e).filter(([t])=>!t.startsWith("$")).map(([,t])=>t)}function wu(e,t){if(!t)return;let i=process.platform==="win32"?";":":",s=t.join(i);!process.env.Path||process.env.Path.includes(s)||(e.Path=`${process.env.Path}${i}${s}`)}function Su(){let e=[],t=process.cwd();do e.push(Rn.join(t,"node_modules/.bin"));while(t!==(t=Rn.join(t,"../")));return e}function kn(e,t){if(t.length===0)return e;if(typeof e!="object")return;let i=t[0],s=Mt.subscript(e,i,!1);if(s)return kn(s[1],t.slice(1))}var ci=class{constructor(t){this.argv=t}config;async run(){this.argv.silent&&I.silence(),this.argv.version&&lt.printVersion(),this.config=await tt.load(this.argv),this.handleDebug(),this.argv.help&&lt.printHelp(this.config,this.argv),this.argv.interactive&&(this.argv._=await Wt.selectScript(this.config,this.argv)),this.argv.force&&(process.env.BSM_DISABLE_IDEMPOTENCY="true"),await this.handleNoArgs(),wu(process.env,Su());for(let t of this.argv._){if(t=t.replace(/^\\~/g,"~"),t.startsWith("~")&&process.env.BSM_PATH){let i=process.env.BSM_PATH.split("."),s=kn(this.config.scripts,i);if(s){await Mt.runScript(s,t.split(".").splice(1),i,{});continue}}await Mt.run(t)}}handleDebug(){if(this.argv.debug)switch(this.argv.debug){case"extends":{let t=this.config.extends;if(t)for(let i of t)typeof i=="string"?I.log(i):I.log(i[0]);return process.exit(0)}case"scripts":{let t=[...Tn(this.config.scripts)],i=[];for(;t.length>0;){let s=t.shift();s&&(typeof s=="string"?i.push(s):typeof s=="object"&&t.push(...Tn(s)))}return I.log(i.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@under_koen/bsm",
3
- "version": "1.9.1",
3
+ "version": "1.10.0",
4
4
  "description": "BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",
5
5
  "license": "MIT",
6
6
  "author": "Koen van Staveren <koen@underkoen.nl>",
@@ -27,6 +27,7 @@
27
27
  "build:watch": "bsm",
28
28
  "lint": "bsm",
29
29
  "prettier": "bsm",
30
+ "prepublishOnly": "bsm build.prod",
30
31
  "test": "bsm",
31
32
  "test:cov": "bsm test.cov"
32
33
  },
@@ -34,15 +35,16 @@
34
35
  "@eslint/js": "^9.21.0",
35
36
  "@inquirer/core": "^10.3.0",
36
37
  "@semantic-release/changelog": "^6.0.3",
37
- "@semantic-release/exec": "^7.0.3",
38
+ "@semantic-release/exec": "^7.1.0",
38
39
  "@semantic-release/git": "^10.0.1",
39
- "@semantic-release/github": "^11.0.1",
40
+ "@semantic-release/github": "^12.0.0",
41
+ "@semantic-release/npm": "^13.1.1",
40
42
  "@types/minimist": "^1.2.5",
41
43
  "@types/node": "^22.13.9",
42
44
  "@types/sinon": "^17.0.4",
43
45
  "@typescript-eslint/eslint-plugin": "^8.26.0",
44
46
  "@typescript-eslint/parser": "^8.26.0",
45
- "@under_koen/bsm": "^1.9.0",
47
+ "@under_koen/bsm": "^1.9.1",
46
48
  "c8": "^10.1.3",
47
49
  "ci-info": "^4.1.0",
48
50
  "cpy-cli": "^5.0.0",
@@ -57,7 +59,7 @@
57
59
  "prettier": "^3.5.3",
58
60
  "prettier-package-json": "^2.8.0",
59
61
  "rimraf": "^6.0.1",
60
- "semantic-release": "^24.2.3",
62
+ "semantic-release": "^25.0.1",
61
63
  "sinon": "^19.0.2",
62
64
  "tsx": "^4.20.6",
63
65
  "typescript": "^5.8.2",