@adbayb/stack 1.6.0 → 1.7.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.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
- "use strict";var ne=Object.create;var T=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ce=Object.prototype.hasOwnProperty;var me=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ie(t))!ce.call(e,n)&&n!==r&&T(e,n,{get:()=>t[n],enumerable:!(o=ae(t,n))||o.enumerable});return e};var pe=(e,t,r)=>(r=e!=null?ne(se(e)):{},me(t||!e||!e.__esModule?T(r,"default",{value:e,enumerable:!0}):r,e));var oe=require("termost");var b=require("fs"),c=require("termost"),w=require("path"),g=(e,t)=>{c.helpers.message(`
2
+ "use strict";var ae=Object.create;var T=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var ce=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var pe=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of se(t))!me.call(e,n)&&n!==r&&T(e,n,{get:()=>t[n],enumerable:!(o=ie(t,n))||o.enumerable});return e};var le=(e,t,r)=>(r=e!=null?ae(ce(e)):{},pe(t||!e||!e.__esModule?T(r,"default",{value:e,enumerable:!0}):r,e));var ne=require("termost");var C=require("fs"),c=require("termost"),w=require("path"),g=(e,t)=>{c.helpers.message(`
3
3
  \u256D\u2500\u2500\u2500\u2500\u2500\u256E
4
4
  \u2502 \u25E0 \u25E0 ${e.title}
5
5
  \u2502 ${t?.type==="error"?"\u25E0":"\u25E1"} \u2502 ${e.description}
6
6
  \u2570\u2500\u2500\u2500\u2500\u2500\u256F
7
7
  ${e.body?`
8
8
  ${e.body}
9
- `:""}`,t)},i=e=>(0,w.resolve)(process.cwd(),e),P=e=>(0,w.resolve)(__dirname,"../",e);var N=async()=>{try{return await c.helpers.exec("pnpm -v")}catch{throw s("pnpm","The project must use `pnpm` as a node package manager tool. Follow this installation guide https://pnpm.io/installation")}},F=(e,t=!0)=>[...t?[]:["npx --no"],`stack ${e}`].join(" "),O=()=>c.helpers.exec("corepack enable"),j={async get(e,t){let r=await fetch(e);if(!r.ok)throw s("fetch",`Failed to fetch resources from ${e} (${JSON.stringify({status:r.status,statusText:r.statusText})})`);return t==="text"?r.text():r.json()}},I=e=>async(t=[])=>{let r=[];if(t.length===0)r.push(".");else if(r=t.filter(m=>R.some(u=>m.endsWith(u))),r.length===0)return Promise.resolve();let o=[...r];o.push(`--ext ${R.join(",")}`),o.push("--cache"),o.push(`--cache-location ${await i("node_modules/.cache/.eslintcache")}`),o.push("--no-error-on-unmatched-pattern");let n=await i(".gitignore");(0,b.existsSync)(n)&&o.push(`--ignore-path ${n}`),e.isFixMode&&o.push("--fix");try{return await c.helpers.exec(`eslint ${o.join(" ")}`)}catch(m){throw s("eslint",m)}},L=I({isFixMode:!1}),A=I({isFixMode:!0}),D=async e=>{let t=[];if(e.length===0)t.push(`"**/!(${S.join("|")})"`);else if(t=e.filter(o=>!S.some(n=>o.endsWith(n))&&o!=="README.md"),t.length===0)return Promise.resolve();let r=[...t];(0,b.existsSync)(await i(".gitignore"))&&r.push("--ignore-path .gitignore"),r.push("--write"),r.push("--ignore-unknown"),r.push("--no-error-on-unmatched-pattern");try{return await c.helpers.exec(`prettier ${r.join(" ")}`)}catch(o){throw s("prettier",o)}},M=async e=>{try{let t=e.filter(r=>V.some(o=>r.endsWith(o)));return await c.helpers.exec(`tsc --tsBuildInfoFile ${await i("node_modules/.cache/.tsbuildinfo")} --noEmit ${t.join(" ")}`)}catch(t){throw s("tsc",t)}},B=async()=>{try{return await c.helpers.exec('commitlint --extends "@commitlint/config-conventional" --edit')}catch(e){throw s("commitlint",e)}},s=(e,t)=>new Error(`\`${e}\` failed:
10
- ${t}`),a=async(e,t={hasLiveOutput:!0})=>{try{return await c.helpers.exec(`turbo run ${e}`,t)}catch(r){throw s("turbo",r)}},h=async e=>{try{return await c.helpers.exec(e,{hasLiveOutput:!0})}catch(t){throw s("changeset",t)}},V=["ts","tsx","cts","mts"],R=["js","jsx","cjs","mjs",...V],S=["CHANGELOG.md","pnpm-lock.yaml"];var W=e=>{e.command({name:"build",description:"Build the project in production mode"}).task({handler(){return a("build")}})};var v=require("path"),p=require("termost"),d=require("fs"),y=require("fs/promises");var q={files:[".nvmrc","CONTRIBUTING.md","LICENSE","package.json","pnpm-workspace.yaml",".changeset/config.json",".github/PULL_REQUEST_TEMPLATE.md","{{project_name}}/package.json","{{project_name}}/README.md","examples/default/package.json","examples/default/src/index.ts"],folders:["{{project_name}}"]};var G=e=>{e.command({name:"create",description:"Scaffold a new project"}).task({handler(){g({title:"I'm Stack, your bot assistant",description:"I can guarantee you a project creation in under 1 minute \u{1F680}"},{type:"information"})}}).input({type:"text",key:"inputName",label:"What's your project name?"}).input({type:"text",key:"inputDescription",label:"How would you describe it?"}).input({type:"text",key:"inputUrl",label:"Where will it be stored? (Git remote URL)"}).task({label:l("Checking pre-requisites"),handler(){return N()}}).task({key:"data",label:l("Evaluating contextual data"),async handler({inputDescription:t,inputName:r,inputUrl:o}){let n=await j.get("https://resolve-node.vercel.app/lts","text"),m=(await j.get("https://registry.npmjs.org/pnpm/latest","json")).version,{repoOwner:u,repoName:_}=o.match(o.startsWith("git")?/^git@.*:(?<repoOwner>.*)\/(?<repoName>.*)\.git$/:/^https?:\/\/.*\/(?<repoOwner>.*)\/(?<repoName>.*)\.git$/)?.groups??{};if(!u||!_)throw s("git","The owner and repository name can not be extracted. Please make sure to follow either `/^git@.*:(?<repoOwner>.*)/(?<repoName>.*).git$/` or `/^https?://.*/(?<repoOwner>.*)/(?<repoName>.*).git$/` pattern.");return{license_year:new Date().getFullYear().toString(),node_version:n,npm_version:m,repo_id:`${u}/${_}`,project_description:t.charAt(0).toUpperCase()+t.slice(1),project_name:r.toLowerCase(),project_url:o,project_version:"0.0.0"}}}).task({label({data:t}){return l(`Creating \`${t.project_name}\` folder`)},async handler({data:t}){let r=(0,v.resolve)(process.cwd(),t.project_name);await(0,y.mkdir)(r),process.chdir(r)}}).task({label:l("Initializing `git`"),async handler({data:t}){await p.helpers.exec("git init"),await p.helpers.exec(`git remote add origin ${t.project_url}`)}}).task({label:l("Applying default template"),async handler({data:t}){await ue();let r=de(q,t);r.hydrate(),r.rename()}}).task({label:l("Installing dependencies"),async handler({data:t}){let r=["quickbundle","vitest"],o=["@adbayb/eslint-config","@adbayb/prettier-config","@adbayb/ts-config","@adbayb/stack"];try{await p.helpers.exec(`pnpm add ${o.join(" ")} --save-dev --ignore-workspace-root-check`),await p.helpers.exec(`pnpm add ${r.join(" ")} --save-dev --filter ${t.project_name}`)}catch(n){throw s("pnpm",n)}}}).task({label:l("Cleaning up"),key:"previousTaskError",async handler({data:t}){try{await(0,y.symlink)(`./${t.project_name}/README.md`,"./README.md"),await O(),await p.helpers.exec("stack install"),await p.helpers.exec("git add -A"),await p.helpers.exec('git commit -m "chore: initial commit"');return}catch(r){return r}}}).task({handler({previousTaskError:t,data:r}){if(t){g({title:"Oops, an error occurred",description:"Keep calm and carry on with some coffee \u2615\uFE0F",body:String(t)},{type:"error"});return}g({title:"The project was successfully created",description:`Run \`cd ./${r.project_name}\` and Enjoy \u{1F680}`},{type:"success"})}})},l=e=>`${e} \u{1F528}`,de=(e,t)=>{let r=o=>o.replace(/{{(.*?)}}/g,(n,m)=>t[m]||"");return{hydrate(){for(let o of e.files){let n=i(o),m=(0,d.readFileSync)(n,"utf-8");(0,d.writeFileSync)(n,r(m))}},rename(){try{for(let o of e.folders)(0,d.renameSync)(i(o),i(r(o)))}catch{}}}},ue=async()=>{let e=(0,v.resolve)(P("./templates"),"./default/content.tar.gz"),t=i("./");return p.helpers.exec(`tar -xzf ${e} -C ${t} --strip-components=1`)};var ge=["commit","lint","type"],z=e=>{e.command({name:"check",description:"Check code health (static analysis)"}).option({key:"only",name:"only",description:`Run only one specified task (accepted value: ${ge.join(", ")})`,defaultValue:void 0}).task({label:f("Preparing the project"),handler(){return a("build",{hasLiveOutput:!1})}}).task({label:f("Checking linters"),skip:U("lint"),async handler(t,r){let o=r.operands;return L(o)}}).task({label:f("Checking types"),skip(t,r){return U("type")(t)||!require.resolve("typescript")||r.operands.length>0},handler(t,r){return M(r.operands)}}).task({label:f("Checking commit"),skip({only:t}){return t!=="commit"},handler(){return B()}})},f=e=>`${e} \u{1F9D0}`,U=e=>t=>t.only!==void 0&&t.only!==e;var k=require("termost"),X=e=>{e.command({name:"clean",description:"Clean the project"}).task({key:"files",label:H("Retrieving removable assets"),handler(){return he()}}).task({label({files:t}){return t.length>0?H("Cleaning assets"):"Already clean \u2728"},handler({files:t}){return t.length>0?ye(t.join(" ")):Promise.resolve()}}).task({skip({files:t}){return t.length===0},handler({files:t}){k.helpers.message(`Removed assets: ${t.join(", ")}
11
- `,{type:"information"})}})},H=e=>`${e} \u{1F9F9}`,he=async()=>(await k.helpers.exec(`git clean -fdXn | grep -v '${fe.join("\\|")}' | cut -c 14-`)).split(/\n/).filter(Boolean),ye=e=>k.helpers.exec(`rm -rf ${e}`),fe=["node_modules",".turbo"];var Y=e=>{e.command({name:"fix",description:"Fix auto-fixable issues"}).task({label:$("Preparing the project"),handler(){return a("build",{hasLiveOutput:!1})}}).task({label:$("Fixing lints"),handler(t,r){return A(r.operands)}}).task({label:$("Fixing formatting"),handler(t,r){return D(r.operands)}})},$=e=>`${e} \u{1F691}`;var x=require("fs/promises");var Q=e=>{e.command({name:"install",description:"Setup initial requirements"}).task({label:J("Installing `git.pre-commit` hook"),handler(){return K("pre-commit",`${F(`fix $(git status --porcelain | awk 'BEGIN{ ORS=" " } { print $2 }')`,!1)} && git add -A`)}}).task({label:J("Installing `git.commit-msg` hook"),handler(){return K("commit-msg",`${F("check --only commit",!1)}`)}})},J=e=>`${e} \u{1F4F2}`,K=async(e,t)=>{let r=i(`.git/hooks/${e}`);return await(0,x.writeFile)(r,t),(0,x.chmod)(r,"0755")};var C=require("termost");var Z=e=>{e.command({name:"release",description:"Log, version, and publish package(s)"}).option({key:"log",name:"log",description:"Add a new changelog entry",defaultValue:!0}).option({key:"tag",name:"tag",description:"Bump the package(s) version"}).option({key:"publish",name:"publish",description:"Publish package(s) to the registry"}).task({skip:E("log"),handler(){return C.helpers.message(`New changelog entry
12
- `),h("changeset")}}).task({skip:E("tag"),handler(){return C.helpers.message(`Bumping the package(s) version
13
- `),h("changeset version && pnpm install --no-frozen-lockfile")}}).task({skip:E("publish"),handler(){return C.helpers.message(`Publishing package(s) to the registry
14
- `),h("stack build && pnpm changeset publish")}})},E=e=>t=>!t[e];var ee=e=>{e.command({name:"start",description:"Start the project in production mode"}).task({handler(){return a("start")}})};var te=e=>{e.command({name:"test",description:"Test the code execution"}).task({handler(){return a("test")}})};var re=e=>{e.command({name:"watch",description:"Build and start the project in development mode"}).task({handler(){return a("watch")}})};var ke=(...e)=>{let t=(0,oe.termost)({name:"stack",description:"Toolbox to easily scaffold and maintain a project"});for(let r of e)r(t)};ke(G,Q,X,z,Y,ee,W,re,te,Z);
9
+ `:""}`,t)},i=e=>(0,w.resolve)(process.cwd(),e),P=e=>(0,w.resolve)(__dirname,"../",e);var N=async()=>{try{return await c.helpers.exec("pnpm -v")}catch{throw s("pnpm","The project must use `pnpm` as a node package manager tool. Follow this installation guide https://pnpm.io/installation")}},j=(e,t=!0)=>[...t?[]:["npx --no"],`stack ${e}`].join(" "),O=()=>c.helpers.exec("corepack enable"),F={async get(e,t){let r=await fetch(e);if(!r.ok)throw s("fetch",`Failed to fetch resources from ${e} (${JSON.stringify({status:r.status,statusText:r.statusText})})`);return t==="text"?r.text():r.json()}},I=e=>async(t=[])=>{let r=[];if(t.length===0)r.push(".");else if(r=t.filter(m=>R.some(u=>m.endsWith(u))),r.length===0)return Promise.resolve();let o=[...r];o.push(`--ext ${R.join(",")}`),o.push("--cache"),o.push(`--cache-location ${await i("node_modules/.cache/.eslintcache")}`),o.push("--no-error-on-unmatched-pattern");let n=await i(".gitignore");(0,C.existsSync)(n)&&o.push(`--ignore-path ${n}`),e.isFixMode&&o.push("--fix");try{return await c.helpers.exec(`eslint ${o.join(" ")}`)}catch(m){throw s("eslint",m)}},A=I({isFixMode:!1}),L=I({isFixMode:!0}),D=async e=>{let t=[];if(e.length===0)t.push(`"**/!(${S.join("|")})"`);else if(t=e.filter(o=>!S.some(n=>o.endsWith(n))&&o!=="README.md"),t.length===0)return Promise.resolve();let r=[...t];(0,C.existsSync)(await i(".gitignore"))&&r.push("--ignore-path .gitignore"),r.push("--write"),r.push("--ignore-unknown"),r.push("--no-error-on-unmatched-pattern");try{return await c.helpers.exec(`prettier ${r.join(" ")}`)}catch(o){throw s("prettier",o)}},M=async e=>{try{let t=e.filter(r=>q.some(o=>r.endsWith(o)));return await c.helpers.exec(`tsc --tsBuildInfoFile ${await i("node_modules/.cache/.tsbuildinfo")} --noEmit ${t.join(" ")}`)}catch(t){throw s("tsc",t)}},B=async()=>{try{return await c.helpers.exec('commitlint --extends "@commitlint/config-conventional" --edit')}catch(e){throw s("commitlint",e)}},s=(e,t)=>new Error(`\`${e}\` failed:
10
+ ${t}`),a=async(e,t={hasLiveOutput:!0})=>{try{return await c.helpers.exec(`turbo run ${e}`,t)}catch(r){throw s("turbo",r)}},h=async e=>{try{return await c.helpers.exec(e,{hasLiveOutput:!0})}catch(t){throw s("changeset",t)}},q=["ts","tsx","cts","mts"],R=["js","jsx","cjs","mjs",...q],S=["CHANGELOG.md","pnpm-lock.yaml"];var W=e=>{e.command({name:"build",description:"Build the project in production mode"}).task({handler(){return a("build")}})};var v=require("path"),p=require("termost"),d=require("fs"),y=require("fs/promises");var V={files:[".nvmrc","CONTRIBUTING.md","LICENSE","package.json","pnpm-workspace.yaml",".changeset/config.json",".changeset/welcome.md",".github/PULL_REQUEST_TEMPLATE.md","{{project_name}}/package.json","{{project_name}}/README.md","examples/default/package.json","examples/default/src/index.ts"],folders:["{{project_name}}"]};var G={name:"@adbayb/stack",version:"1.7.0",description:"My opinionated toolchain",publishConfig:{access:"public"},files:["bin","dist","templates"],bin:{stack:"bin/index.cjs"},source:"src/index.ts",main:"dist/index.js",platform:"node",scripts:{prepublishOnly:"pnpm build",prestart:"pnpm build",start:"bin/index.js",build:"quickbundle build",watch:"quickbundle watch"},keywords:["stack","scripts","toolchain","development"],author:{name:"Ayoub Adib",email:"adbayb@gmail.com",url:"https://twitter.com/adbayb"},repository:{type:"git",url:"https://github.com/adbayb/stack.git",directory:"stack"},license:"MIT",dependencies:{"@changesets/changelog-github":"^0.4.8","@changesets/cli":"^2.26.2","@commitlint/cli":"^17.7.1","@commitlint/config-conventional":"^17.7.0",eslint:"^8.47.0",prettier:"^3.0.2",termost:"^0.9.0",turbo:"^1.10.12",typescript:"^5.1.6"}};var U=e=>{e.command({name:"create",description:"Scaffold a new project"}).task({handler(){g({title:`I'm Stack v${G.version}, your bot assistant`,description:"I can guarantee you a project creation in under 1 minute \u{1F680}"},{type:"information"})}}).input({type:"text",key:"inputName",label:"What's your project name?"}).input({type:"text",key:"inputDescription",label:"How would you describe it?"}).input({type:"text",key:"inputUrl",label:"Where will it be stored? (Git remote URL)"}).task({label:l("Checking pre-requisites"),handler(){return N()}}).task({key:"data",label:l("Evaluating contextual data"),async handler({inputDescription:t,inputName:r,inputUrl:o}){let n=await F.get("https://resolve-node.vercel.app/lts","text"),m=(await F.get("https://registry.npmjs.org/pnpm/latest","json")).version,{repoOwner:u,repoName:_}=o.match(o.startsWith("git")?/^git@.*:(?<repoOwner>.*)\/(?<repoName>.*)\.git$/:/^https?:\/\/.*\/(?<repoOwner>.*)\/(?<repoName>.*)\.git$/)?.groups??{};if(!u||!_)throw s("git","The owner and repository name can not be extracted. Please make sure to follow either `/^git@.*:(?<repoOwner>.*)/(?<repoName>.*).git$/` or `/^https?://.*/(?<repoOwner>.*)/(?<repoName>.*).git$/` pattern.");return{license_year:new Date().getFullYear().toString(),node_version:n,npm_version:m,repo_id:`${u}/${_}`,project_description:t.charAt(0).toUpperCase()+t.slice(1),project_name:r.toLowerCase(),project_url:o,project_version:"0.0.0"}}}).task({label({data:t}){return l(`Creating \`${t.project_name}\` folder`)},async handler({data:t}){let r=(0,v.resolve)(process.cwd(),t.project_name);await(0,y.mkdir)(r),process.chdir(r)}}).task({label:l("Initializing `git`"),async handler({data:t}){await p.helpers.exec("git init"),await p.helpers.exec(`git remote add origin ${t.project_url}`)}}).task({label:l("Applying default template"),async handler({data:t}){await he();let r=ge(V,t);r.hydrate(),r.rename()}}).task({label:l("Installing dependencies"),async handler({data:t}){let r=["quickbundle","vitest"],o=["@adbayb/eslint-config","@adbayb/prettier-config","@adbayb/ts-config","@adbayb/stack"];try{await p.helpers.exec(`pnpm add ${o.join(" ")} --save-dev --ignore-workspace-root-check`),await p.helpers.exec(`pnpm add ${r.join(" ")} --save-dev --filter ${t.project_name}`)}catch(n){throw s("pnpm",n)}}}).task({label:l("Cleaning up"),key:"previousTaskError",async handler({data:t}){try{await(0,y.symlink)(`./${t.project_name}/README.md`,"./README.md"),await O(),await p.helpers.exec("stack install"),await p.helpers.exec("git add -A"),await p.helpers.exec('git commit -m "chore: initial commit"');return}catch(r){return r}}}).task({handler({previousTaskError:t,data:r}){if(t){g({title:"Oops, an error occurred",description:"Keep calm and carry on with some coffee \u2615\uFE0F",body:String(t)},{type:"error"});return}g({title:"The project was successfully created",description:`Run \`cd ./${r.project_name}\` and Enjoy \u{1F680}`},{type:"success"})}})},l=e=>`${e} \u{1F528}`,ge=(e,t)=>{let r=o=>o.replace(/{{(.*?)}}/g,(n,m)=>t[m]||"");return{hydrate(){for(let o of e.files){let n=i(o),m=(0,d.readFileSync)(n,"utf-8");(0,d.writeFileSync)(n,r(m))}},rename(){try{for(let o of e.folders)(0,d.renameSync)(i(o),i(r(o)))}catch{}}}},he=async()=>{let e=(0,v.resolve)(P("./templates"),"./default/content.tar.gz"),t=i("./");return p.helpers.exec(`tar -xzf ${e} -C ${t} --strip-components=1`)};var ye=["commit","lint","type"],H=e=>{e.command({name:"check",description:"Check code health (static analysis)"}).option({key:"only",name:"only",description:`Run only one specified task (accepted value: ${ye.join(", ")})`,defaultValue:void 0}).task({label:f("Preparing the project"),handler(){return a("build",{hasLiveOutput:!1})}}).task({label:f("Checking linters"),skip:z("lint"),async handler(t,r){let o=r.operands;return A(o)}}).task({label:f("Checking types"),skip(t,r){return z("type")(t)||!require.resolve("typescript")||r.operands.length>0},handler(t,r){return M(r.operands)}}).task({label:f("Checking commit"),skip({only:t}){return t!=="commit"},handler(){return B()}})},f=e=>`${e} \u{1F9D0}`,z=e=>t=>t.only!==void 0&&t.only!==e;var k=require("termost"),Y=e=>{e.command({name:"clean",description:"Clean the project"}).task({key:"files",label:X("Retrieving removable assets"),handler(){return fe()}}).task({label({files:t}){return t.length>0?X("Cleaning assets"):"Already clean \u2728"},handler({files:t}){return t.length>0?ke(t.join(" ")):Promise.resolve()}}).task({skip({files:t}){return t.length===0},handler({files:t}){k.helpers.message(`Removed assets: ${t.join(", ")}
11
+ `,{type:"information"})}})},X=e=>`${e} \u{1F9F9}`,fe=async()=>(await k.helpers.exec(`git clean -fdXn | grep -v '${be.join("\\|")}' | cut -c 14-`)).split(/\n/).filter(Boolean),ke=e=>k.helpers.exec(`rm -rf ${e}`),be=["node_modules",".turbo"];var J=e=>{e.command({name:"fix",description:"Fix auto-fixable issues"}).task({label:$("Preparing the project"),handler(){return a("build",{hasLiveOutput:!1})}}).task({label:$("Fixing lints"),handler(t,r){return L(r.operands)}}).task({label:$("Fixing formatting"),handler(t,r){return D(r.operands)}})},$=e=>`${e} \u{1F691}`;var b=require("fs/promises");var Z=e=>{e.command({name:"install",description:"Setup initial requirements"}).task({label:K("Installing `git.pre-commit` hook"),handler(){return Q("pre-commit",`${j(`fix $(git status --porcelain | awk 'BEGIN{ ORS=" " } { print $2 }')`,!1)} && git add -A`)}}).task({label:K("Installing `git.commit-msg` hook"),handler(){return Q("commit-msg",`${j("check --only commit",!1)}`)}})},K=e=>`${e} \u{1F4F2}`,Q=async(e,t)=>{let r=i(`.git/hooks/${e}`);return await(0,b.writeFile)(r,t),(0,b.chmod)(r,"0755")};var x=require("termost");var ee=e=>{e.command({name:"release",description:"Log, version, and publish package(s)"}).option({key:"log",name:"log",description:"Add a new changelog entry"}).option({key:"tag",name:"tag",description:"Bump the package(s) version"}).option({key:"publish",name:"publish",description:"Publish package(s) to the registry"}).task({skip:E("log"),handler(){return x.helpers.message(`New changelog entry
12
+ `),h("changeset")}}).task({skip:E("tag"),handler(){return x.helpers.message(`Bumping the package(s) version
13
+ `),h("changeset version && pnpm install --no-frozen-lockfile")}}).task({skip:E("publish"),handler(){return x.helpers.message(`Publishing package(s) to the registry
14
+ `),h("stack build && pnpm changeset publish")}})},E=e=>t=>!t[e];var te=e=>{e.command({name:"start",description:"Start the project in production mode"}).task({handler(){return a("start")}})};var re=e=>{e.command({name:"test",description:"Test the code execution"}).task({handler(){return a("test")}})};var oe=e=>{e.command({name:"watch",description:"Build and start the project in development mode"}).task({handler(){return a("watch")}})};var xe=(...e)=>{let t=(0,ne.termost)({name:"stack",description:"Toolbox to easily scaffold and maintain a project"});for(let r of e)r(t)};xe(U,Z,Y,H,J,te,W,oe,re,ee);
15
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.ts", "../src/helpers.ts", "../src/commands/build.ts", "../src/commands/create.ts", "../templates/default/config.json", "../src/commands/check.ts", "../src/commands/clean.ts", "../src/commands/fix.ts", "../src/commands/install.ts", "../src/commands/release.ts", "../src/commands/start.ts", "../src/commands/test.ts", "../src/commands/watch.ts"],
4
- "sourcesContent": ["#!/usr/bin/env node\n\nimport { termost } from \"termost\";\n\nimport { createBuildCommand } from \"./commands/build\";\nimport { createCreateCommand } from \"./commands/create\";\nimport { createCheckCommand } from \"./commands/check\";\nimport { createCleanCommand } from \"./commands/clean\";\nimport { createFixCommand } from \"./commands/fix\";\nimport { createInstallCommand } from \"./commands/install\";\nimport { createReleaseCommand } from \"./commands/release\";\nimport { createStartCommand } from \"./commands/start\";\nimport { createTestCommand } from \"./commands/test\";\nimport { createWatchCommand } from \"./commands/watch\";\nimport type { CommandFactory } from \"./types\";\n\nconst createProgram = (...commandFactories: Array<CommandFactory>) => {\n\tconst program = termost({\n\t\tname: \"stack\",\n\t\tdescription: \"Toolbox to easily scaffold and maintain a project\",\n\t});\n\n\tfor (const commandBuilder of commandFactories) {\n\t\tcommandBuilder(program);\n\t}\n};\n\ncreateProgram(\n\tcreateCreateCommand,\n\tcreateInstallCommand,\n\tcreateCleanCommand,\n\tcreateCheckCommand,\n\tcreateFixCommand,\n\tcreateStartCommand,\n\tcreateBuildCommand,\n\tcreateWatchCommand,\n\tcreateTestCommand,\n\tcreateReleaseCommand,\n);\n", "import { existsSync } from \"node:fs\";\nimport { helpers } from \"termost\";\nimport { resolve } from \"node:path\";\n\n/**\n * Helper to format log messages with a welcoming bot\n * @param input Content input\n * @param options Termost options for the `message` API\n */\nexport const botMessage = (\n\tinput: { title: string; description: string; body?: string },\n\toptions: Parameters<typeof helpers.message>[1],\n) => {\n\thelpers.message(\n\t\t`\n\u256D\u2500\u2500\u2500\u2500\u2500\u256E\n\u2502 \u25E0 \u25E0 ${input.title}\n\u2502 ${options?.type === \"error\" ? \"\u25E0\" : \"\u25E1\"} \u2502 ${input.description}\n\u2570\u2500\u2500\u2500\u2500\u2500\u256F\n${\n\t!input.body\n\t\t? \"\"\n\t\t: `\n${input.body}\n`\n}`,\n\t\toptions,\n\t);\n};\n\n/**\n * Resolve a relative path to an absolute one resolved from the generated project root directory\n * @param path The relative path\n * @returns The resolved absolute path\n */\nexport const resolveFromProjectDirectory = (path: string) => {\n\treturn resolve(process.cwd(), path);\n};\n\n/**\n * Resolve a relative path to an absolute one resolved from the `stack` node module directory\n * @param path The relative path\n * @returns The resolved absolute path\n */\nexport const resolveFromStackDirectory = (path: string) => {\n\treturn resolve(__dirname, \"../\", path);\n};\n\nexport const getRepositoryUrl = async () => {\n\ttry {\n\t\t// This step is used as well to persist the repository url value:\n\t\treturn await helpers.exec(\"git config --get remote.origin.url\");\n\t} catch (error) {\n\t\tthrow createError(\n\t\t\t\"git\",\n\t\t\t`The project must be a \\`git\\` repository with an origin already setup. Have you tried to run \\`git init && git remote add origin git@github.com:OWNER/REPOSITORY.git && git add -A && git commit -m \"chore: initial commit\" && git push -u origin main\\`?\\n${error}`,\n\t\t);\n\t}\n};\n\nexport const getNpmVersion = async () => {\n\ttry {\n\t\treturn await helpers.exec(\"pnpm -v\");\n\t} catch (error) {\n\t\tthrow createError(\n\t\t\t\"pnpm\",\n\t\t\t\"The project must use `pnpm` as a node package manager tool. Follow this installation guide https://pnpm.io/installation\",\n\t\t);\n\t}\n};\n\nexport const getStackCommand = (command: string, isNodeRuntime = true) => {\n\t// @note: `isNodeRuntime` allows executing node bin executables in a non node environment such as in git hooks context\n\t// Npx is used to make executable resolution independent from the build tool (npx is the built-in Node tool)\n\t// `--no` flag to prevent installation prompt and throw an error if the binary is not installed\n\treturn [...(isNodeRuntime ? [] : [\"npx --no\"]), `stack ${command}`].join(\n\t\t\" \",\n\t);\n};\n\nexport const setPkgManager = () => {\n\treturn helpers.exec(\"corepack enable\");\n};\n\nexport const request = {\n\tasync get<ResponseType extends \"json\" | \"text\">(\n\t\turl: string,\n\t\tresponseType: ResponseType,\n\t): Promise<ResponseType extends \"text\" ? string : Record<string, string>> {\n\t\tconst response = await fetch(url);\n\n\t\tif (!response.ok) {\n\t\t\tthrow createError(\n\t\t\t\t\"fetch\",\n\t\t\t\t`Failed to fetch resources from ${url} (${JSON.stringify({\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t})})`,\n\t\t\t);\n\t\t}\n\n\t\treturn responseType === \"text\" ? response.text() : response.json();\n\t},\n};\n\nconst eslint =\n\t(options: { isFixMode: boolean }) =>\n\tasync (files: FilenameCollection = []) => {\n\t\tlet eslintFiles = [];\n\n\t\tif (files.length === 0) {\n\t\t\teslintFiles.push(\".\");\n\t\t} else {\n\t\t\teslintFiles = files.filter((file) => {\n\t\t\t\treturn ESLINT_EXTENSIONS.some((ext) => file.endsWith(ext));\n\t\t\t});\n\n\t\t\tif (eslintFiles.length === 0) return Promise.resolve();\n\t\t}\n\n\t\tconst args = [...eslintFiles];\n\n\t\targs.push(`--ext ${ESLINT_EXTENSIONS.join(\",\")}`);\n\t\targs.push(\"--cache\");\n\t\targs.push(\n\t\t\t`--cache-location ${await resolveFromProjectDirectory(\n\t\t\t\t\"node_modules/.cache/.eslintcache\",\n\t\t\t)}`,\n\t\t);\n\t\t// @note: prevent errors when no matched file is found\n\t\targs.push(\"--no-error-on-unmatched-pattern\");\n\n\t\tconst gitIgnoreFile = await resolveFromProjectDirectory(\".gitignore\");\n\n\t\tif (existsSync(gitIgnoreFile)) {\n\t\t\targs.push(`--ignore-path ${gitIgnoreFile}`);\n\t\t}\n\n\t\tif (options.isFixMode) {\n\t\t\targs.push(\"--fix\");\n\t\t}\n\n\t\ttry {\n\t\t\treturn await helpers.exec(`eslint ${args.join(\" \")}`);\n\t\t} catch (error) {\n\t\t\tthrow createError(\"eslint\", error);\n\t\t}\n\t};\n\nexport const checkLints = eslint({ isFixMode: false });\n\nexport const fixLints = eslint({ isFixMode: true });\n\nexport const fixFormatting = async (files: FilenameCollection) => {\n\tlet prettierFiles = [];\n\n\tif (files.length === 0) {\n\t\tprettierFiles.push(`\"**/!(${PRETTIER_IGNORE_FILES.join(\"|\")})\"`);\n\t} else {\n\t\tprettierFiles = files.filter((file) => {\n\t\t\treturn (\n\t\t\t\t!PRETTIER_IGNORE_FILES.some((filename) =>\n\t\t\t\t\tfile.endsWith(filename),\n\t\t\t\t) && // The root `README.md` file is ignored to prevent error due to its symbolic link nature when specified explicitly as a file\n\t\t\t\tfile !== \"README.md\"\n\t\t\t);\n\t\t});\n\n\t\tif (prettierFiles.length === 0) return Promise.resolve();\n\t}\n\n\tconst args = [...prettierFiles];\n\n\tif (existsSync(await resolveFromProjectDirectory(\".gitignore\"))) {\n\t\targs.push(\"--ignore-path .gitignore\");\n\t}\n\n\targs.push(\"--write\");\n\targs.push(\"--ignore-unknown\");\n\targs.push(\"--no-error-on-unmatched-pattern\");\n\n\ttry {\n\t\treturn await helpers.exec(`prettier ${args.join(\" \")}`);\n\t} catch (error) {\n\t\tthrow createError(\"prettier\", error);\n\t}\n};\n\nexport const checkTypes = async (files: FilenameCollection) => {\n\ttry {\n\t\tconst tsFiles = files.filter((file) => {\n\t\t\treturn TYPESCRIPT_EXTENSIONS.some((ext) => file.endsWith(ext));\n\t\t});\n\n\t\treturn await helpers.exec(\n\t\t\t`tsc --tsBuildInfoFile ${await resolveFromProjectDirectory(\n\t\t\t\t\"node_modules/.cache/.tsbuildinfo\",\n\t\t\t)} --noEmit ${tsFiles.join(\" \")}`,\n\t\t);\n\t} catch (error) {\n\t\tthrow createError(\"tsc\", error);\n\t}\n};\n\nexport const checkCommit = async () => {\n\ttry {\n\t\treturn await helpers.exec(\n\t\t\t'commitlint --extends \"@commitlint/config-conventional\" --edit',\n\t\t);\n\t} catch (error) {\n\t\tthrow createError(\"commitlint\", error);\n\t}\n};\n\nexport const createError = (bin: string, error: Error | string | unknown) => {\n\treturn new Error(`\\`${bin}\\` failed:\\n${error}`);\n};\n\nexport const turbo = async (\n\tcommand: \"build\" | \"start\" | \"test\" | \"watch\",\n\toptions: Parameters<typeof helpers.exec>[1] = { hasLiveOutput: true },\n) => {\n\ttry {\n\t\treturn await helpers.exec(`turbo run ${command}`, options);\n\t} catch (error) {\n\t\tthrow createError(\"turbo\", error);\n\t}\n};\n\nexport const changeset = async (command: string) => {\n\ttry {\n\t\treturn await helpers.exec(command, {\n\t\t\thasLiveOutput: true,\n\t\t});\n\t} catch (error) {\n\t\tthrow createError(\"changeset\", error);\n\t}\n};\n\nconst TYPESCRIPT_EXTENSIONS = [\"ts\", \"tsx\", \"cts\", \"mts\"];\n/**\n * Extensions supported by ESLint.\n */\nconst ESLINT_EXTENSIONS = [\"js\", \"jsx\", \"cjs\", \"mjs\", ...TYPESCRIPT_EXTENSIONS];\nconst PRETTIER_IGNORE_FILES = [\"CHANGELOG.md\", \"pnpm-lock.yaml\"];\n\ntype FilenameCollection = Array<string>;\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createBuildCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"build\",\n\t\t\tdescription: \"Build the project in production mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\");\n\t\t\t},\n\t\t});\n};\n", "import { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\nimport { readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { mkdir, symlink } from \"node:fs/promises\";\n\nimport type { CommandFactory } from \"../types\";\nimport {\n\tbotMessage,\n\tcreateError,\n\tgetNpmVersion,\n\trequest,\n\tresolveFromProjectDirectory,\n\tresolveFromStackDirectory,\n\tsetPkgManager,\n} from \"../helpers\";\nimport defaultTemplateConfig from \"../../templates/default/config.json\";\n\ntype CommandContext = {\n\tpreviousTaskError: Error | undefined;\n\tinputName: string;\n\tinputDescription: string;\n\tinputUrl: string;\n\tdata: Record<\n\t\t| \"license_year\"\n\t\t| \"node_version\"\n\t\t| \"npm_version\"\n\t\t| \"project_description\"\n\t\t| \"project_name\"\n\t\t| \"project_url\"\n\t\t| \"repo_id\",\n\t\tstring\n\t>;\n};\n\nexport const createCreateCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"create\",\n\t\t\tdescription: \"Scaffold a new project\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\tbotMessage(\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: \"I'm Stack, your bot assistant\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"I can guarantee you a project creation in under 1 minute \uD83D\uDE80\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"information\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputName\",\n\t\t\tlabel: \"What's your project name?\",\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputDescription\",\n\t\t\tlabel: \"How would you describe it?\",\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputUrl\",\n\t\t\tlabel: \"Where will it be stored? (Git remote URL)\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking pre-requisites\"),\n\t\t\thandler() {\n\t\t\t\t// Check pnpm availability by verifying its version\n\t\t\t\treturn getNpmVersion();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tkey: \"data\",\n\t\t\tlabel: label(\"Evaluating contextual data\"),\n\t\t\tasync handler({ inputDescription, inputName, inputUrl }) {\n\t\t\t\tconst nodeVersion = await request.get(\n\t\t\t\t\t\"https://resolve-node.vercel.app/lts\",\n\t\t\t\t\t\"text\",\n\t\t\t\t);\n\n\t\t\t\tconst npmVersion = (\n\t\t\t\t\tawait request.get(\n\t\t\t\t\t\t\"https://registry.npmjs.org/pnpm/latest\",\n\t\t\t\t\t\t\"json\",\n\t\t\t\t\t)\n\t\t\t\t).version as string;\n\n\t\t\t\tconst { repoOwner, repoName } =\n\t\t\t\t\tinputUrl.match(\n\t\t\t\t\t\tinputUrl.startsWith(\"git\")\n\t\t\t\t\t\t\t? /^git@.*:(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t\t\t: /^https?:\\/\\/.*\\/(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/,\n\t\t\t\t\t)?.groups ?? {};\n\n\t\t\t\tif (!repoOwner || !repoName) {\n\t\t\t\t\tthrow createError(\n\t\t\t\t\t\t\"git\",\n\t\t\t\t\t\t\"The owner and repository name can not be extracted. Please make sure to follow either `/^git@.*:(?<repoOwner>.*)/(?<repoName>.*).git$/` or `/^https?://.*/(?<repoOwner>.*)/(?<repoName>.*).git$/` pattern.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tlicense_year: new Date().getFullYear().toString(),\n\t\t\t\t\tnode_version: nodeVersion,\n\t\t\t\t\tnpm_version: npmVersion,\n\t\t\t\t\trepo_id: `${repoOwner}/${repoName}`,\n\t\t\t\t\tproject_description:\n\t\t\t\t\t\tinputDescription.charAt(0).toUpperCase() +\n\t\t\t\t\t\tinputDescription.slice(1), // Enforce upper case for the first letter\n\t\t\t\t\tproject_name: inputName.toLowerCase(), // Enforce lower case for folder and package name\n\t\t\t\t\tproject_url: inputUrl,\n\t\t\t\t\tproject_version: \"0.0.0\",\n\t\t\t\t};\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel({ data }) {\n\t\t\t\treturn label(`Creating \\`${data.project_name}\\` folder`);\n\t\t\t},\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst projectPath = resolve(process.cwd(), data.project_name);\n\n\t\t\t\tawait mkdir(projectPath);\n\t\t\t\tprocess.chdir(projectPath);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Initializing `git`\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tawait helpers.exec(\"git init\");\n\t\t\t\tawait helpers.exec(`git remote add origin ${data.project_url}`);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Applying default template\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tawait extractTemplate();\n\n\t\t\t\t// Hydrate template expressions with context values:\n\t\t\t\tconst engine = createTemplateEngine(\n\t\t\t\t\tdefaultTemplateConfig,\n\t\t\t\t\tdata,\n\t\t\t\t);\n\n\t\t\t\tengine.hydrate();\n\t\t\t\tengine.rename();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing dependencies\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst localDevDependencies = [\"quickbundle\", \"vitest\"];\n\n\t\t\t\tconst globalDevDependencies = [\n\t\t\t\t\t\"@adbayb/eslint-config\",\n\t\t\t\t\t\"@adbayb/prettier-config\",\n\t\t\t\t\t\"@adbayb/ts-config\",\n\t\t\t\t\t\"@adbayb/stack\",\n\t\t\t\t];\n\n\t\t\t\ttry {\n\t\t\t\t\tawait helpers.exec(\n\t\t\t\t\t\t`pnpm add ${globalDevDependencies.join(\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t)} --save-dev --ignore-workspace-root-check`,\n\t\t\t\t\t);\n\n\t\t\t\t\tawait helpers.exec(\n\t\t\t\t\t\t`pnpm add ${localDevDependencies.join(\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t)} --save-dev --filter ${data.project_name}`,\n\t\t\t\t\t);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow createError(\"pnpm\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Cleaning up\"),\n\t\t\tkey: \"previousTaskError\",\n\t\t\tasync handler({ data }) {\n\t\t\t\ttry {\n\t\t\t\t\t// Symlink the package `README.md` file to the root project directory\n\t\t\t\t\tawait symlink(\n\t\t\t\t\t\t`./${data.project_name}/README.md`,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t);\n\t\t\t\t\t// Set the Node package manager runtime by following the `packageManager` field instruction\n\t\t\t\t\tawait setPkgManager();\n\t\t\t\t\t// Run install command to add git hooks\n\t\t\t\t\tawait helpers.exec(\"stack install\");\n\t\t\t\t\t// Commit (and run check/fix command via git hooks)\n\t\t\t\t\tawait helpers.exec(\"git add -A\");\n\t\t\t\t\tawait helpers.exec('git commit -m \"chore: initial commit\"');\n\n\t\t\t\t\treturn;\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn error as Error;\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\thandler({ previousTaskError, data }) {\n\t\t\t\tif (previousTaskError) {\n\t\t\t\t\tbotMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Oops, an error occurred\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Keep calm and carry on with some coffee \u2615\uFE0F\",\n\t\t\t\t\t\t\tbody: String(previousTaskError),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbotMessage(\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: \"The project was successfully created\",\n\t\t\t\t\t\tdescription: `Run \\`cd ./${data.project_name}\\` and Enjoy \uD83D\uDE80`,\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"success\" },\n\t\t\t\t);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDD28`;\n\n/**\n * A simple template engine to evaluate dynamic expressions and apply side effets (such as hydrating a content with values from an input object) on impacted template files\n * @param config Configuration object listing template files/folders that need expression evaluation\n * @param input Input object mapping the template expression key with its corresponding value\n */\nconst createTemplateEngine = (\n\tconfig: Record<\"files\" | \"folders\", Array<string>>,\n\tinput: CommandContext[\"data\"],\n) => {\n\tconst evaluate = (expression: string) => {\n\t\treturn expression.replace(\n\t\t\t/{{(.*?)}}/g,\n\t\t\t(_, key: keyof CommandContext[\"data\"]) => input[key] || \"\",\n\t\t);\n\t};\n\n\treturn {\n\t\thydrate() {\n\t\t\tfor (const filename of config.files) {\n\t\t\t\tconst filepath = resolveFromProjectDirectory(filename);\n\t\t\t\tconst content = readFileSync(filepath, \"utf-8\");\n\n\t\t\t\twriteFileSync(filepath, evaluate(content));\n\t\t\t}\n\t\t},\n\t\trename() {\n\t\t\ttry {\n\t\t\t\tfor (const pathname of config.folders) {\n\t\t\t\t\trenameSync(\n\t\t\t\t\t\tresolveFromProjectDirectory(pathname),\n\t\t\t\t\t\tresolveFromProjectDirectory(evaluate(pathname)),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Silent error in case of stack re-creation\n\t\t\t}\n\t\t},\n\t};\n};\n\nconst extractTemplate = async () => {\n\tconst compressedFilePath = resolve(\n\t\tresolveFromStackDirectory(\"./templates\"),\n\t\t\"./default/content.tar.gz\",\n\t);\n\n\tconst destinationPath = resolveFromProjectDirectory(\"./\");\n\n\treturn helpers.exec(\n\t\t`tar -xzf ${compressedFilePath} -C ${destinationPath} --strip-components=1`,\n\t);\n};\n", "{\n\t\"files\": [\n\t\t\".nvmrc\",\n\t\t\"CONTRIBUTING.md\",\n\t\t\"LICENSE\",\n\t\t\"package.json\",\n\t\t\"pnpm-workspace.yaml\",\n\t\t\".changeset/config.json\",\n\t\t\".github/PULL_REQUEST_TEMPLATE.md\",\n\t\t\"{{project_name}}/package.json\",\n\t\t\"{{project_name}}/README.md\",\n\t\t\"examples/default/package.json\",\n\t\t\"examples/default/src/index.ts\"\n\t],\n\t\"folders\": [\"{{project_name}}\"]\n}\n", "import type { CommandFactory } from \"../types\";\nimport { checkCommit, checkLints, checkTypes, turbo } from \"../helpers\";\n\nconst onlyValues = [\"commit\", \"lint\", \"type\"] as const;\n\ntype Only = (typeof onlyValues)[number];\n\ntype CommandContext = {\n\tonly: Only | undefined;\n};\n\nexport const createCheckCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"check\",\n\t\t\tdescription: \"Check code health (static analysis)\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"only\",\n\t\t\tname: \"only\",\n\t\t\tdescription: `Run only one specified task (accepted value: ${onlyValues.join(\n\t\t\t\t\", \",\n\t\t\t)})`,\n\t\t\tdefaultValue: undefined,\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Preparing the project\"),\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking linters\"),\n\t\t\tskip: ifNotAllOrOnlyNotEqualTo(\"lint\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tconst filenames = argv.operands;\n\n\t\t\t\treturn checkLints(filenames);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking types\"),\n\t\t\tskip(context, argv) {\n\t\t\t\treturn (\n\t\t\t\t\tifNotAllOrOnlyNotEqualTo(\"type\")(context) ||\n\t\t\t\t\t!require.resolve(\"typescript\") ||\n\t\t\t\t\t// For now, skip type-checking if some files are passed down\n\t\t\t\t\t// @see: https://github.com/microsoft/TypeScript/issues/27379\n\t\t\t\t\targv.operands.length > 0\n\t\t\t\t);\n\t\t\t},\n\t\t\thandler(_, argv) {\n\t\t\t\treturn checkTypes(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking commit\"),\n\t\t\tskip({ only }) {\n\t\t\t\treturn only !== \"commit\";\n\t\t\t},\n\t\t\thandler() {\n\t\t\t\treturn checkCommit();\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDD0`;\n\nconst ifNotAllOrOnlyNotEqualTo = (only: Only) => (context: CommandContext) => {\n\treturn context.only !== undefined && context.only !== only;\n};\n", "import { helpers } from \"termost\";\n\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tfiles: Array<string>;\n};\n\nexport const createCleanCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"clean\",\n\t\t\tdescription: \"Clean the project\",\n\t\t})\n\t\t.task({\n\t\t\tkey: \"files\",\n\t\t\tlabel: label(\"Retrieving removable assets\"),\n\t\t\thandler() {\n\t\t\t\treturn retrieveIgnoredFiles();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel({ files }) {\n\t\t\t\treturn files.length > 0\n\t\t\t\t\t? label(\"Cleaning assets\")\n\t\t\t\t\t: \"Already clean \u2728\";\n\t\t\t},\n\t\t\thandler({ files }) {\n\t\t\t\treturn files.length > 0\n\t\t\t\t\t? cleanFiles(files.join(\" \"))\n\t\t\t\t\t: Promise.resolve();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip({ files }) {\n\t\t\t\treturn files.length === 0;\n\t\t\t},\n\t\t\thandler({ files }) {\n\t\t\t\thelpers.message(`Removed assets: ${files.join(\", \")}\\n`, {\n\t\t\t\t\ttype: \"information\",\n\t\t\t\t});\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDF9`;\n\nconst retrieveIgnoredFiles = async () => {\n\tconst rawFiles = await helpers.exec(\n\t\t`git clean -fdXn | grep -v '${PRESERVE_FILES.join(\n\t\t\t\"\\\\|\",\n\t\t)}' | cut -c 14-`,\n\t);\n\n\treturn rawFiles.split(/\\n/).filter(Boolean);\n};\n\nconst cleanFiles = (fileList: string) => {\n\treturn helpers.exec(`rm -rf ${fileList}`);\n};\n\nconst PRESERVE_FILES = [\"node_modules\", \".turbo\"];\n", "import type { CommandFactory } from \"../types\";\nimport { fixFormatting, fixLints, turbo } from \"../helpers\";\n\nexport const createFixCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"fix\",\n\t\t\tdescription: \"Fix auto-fixable issues\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Preparing the project\"),\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing lints\"),\n\t\t\thandler(_, argv) {\n\t\t\t\treturn fixLints(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing formatting\"),\n\t\t\thandler(_, argv) {\n\t\t\t\treturn fixFormatting(argv.operands);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDE91`;\n", "import { chmod, writeFile } from \"node:fs/promises\";\n\nimport { getStackCommand, resolveFromProjectDirectory } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\nexport const createInstallCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"install\",\n\t\t\tdescription: \"Setup initial requirements\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing `git.pre-commit` hook\"),\n\t\t\thandler() {\n\t\t\t\treturn installGitHook(\n\t\t\t\t\t\"pre-commit\",\n\t\t\t\t\t`${getStackCommand(\n\t\t\t\t\t\t\"fix $(git status --porcelain | awk 'BEGIN{ ORS=\\\" \\\" } { print $2 }')\",\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t)} && git add -A`,\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing `git.commit-msg` hook\"),\n\t\t\thandler() {\n\t\t\t\treturn installGitHook(\n\t\t\t\t\t\"commit-msg\",\n\t\t\t\t\t`${getStackCommand(\"check --only commit\", false)}`,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDCF2`;\n\nconst installGitHook = async (\n\thook: \"commit-msg\" | \"pre-commit\",\n\tcontent: string,\n) => {\n\tconst filename = resolveFromProjectDirectory(`.git/hooks/${hook}`);\n\n\tawait writeFile(filename, content);\n\n\treturn chmod(filename, \"0755\");\n};\n", "import { helpers } from \"termost\";\n\nimport type { CommandFactory } from \"../types\";\nimport { changeset } from \"../helpers\";\n\ntype CommandContext = {\n\tlog: boolean;\n\tpublish: boolean;\n\ttag: boolean;\n};\n\nexport const createReleaseCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"release\",\n\t\t\tdescription: \"Log, version, and publish package(s)\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"log\",\n\t\t\tname: \"log\",\n\t\t\tdescription: \"Add a new changelog entry\",\n\t\t\tdefaultValue: true,\n\t\t})\n\t\t.option({\n\t\t\tkey: \"tag\",\n\t\t\tname: \"tag\",\n\t\t\tdescription: \"Bump the package(s) version\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"publish\",\n\t\t\tname: \"publish\",\n\t\t\tdescription: \"Publish package(s) to the registry\",\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"log\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"New changelog entry\\n\");\n\n\t\t\t\treturn changeset(\"changeset\");\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"tag\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"Bumping the package(s) version\\n\");\n\n\t\t\t\treturn changeset(\n\t\t\t\t\t\"changeset version && pnpm install --no-frozen-lockfile\",\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"publish\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"Publishing package(s) to the registry\\n\");\n\n\t\t\t\treturn changeset(\"stack build && pnpm changeset publish\");\n\t\t\t},\n\t\t});\n};\n\nconst ifNotEqualTo =\n\t(validOption: keyof CommandContext) => (context: CommandContext) => {\n\t\treturn !context[validOption];\n\t};\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createStartCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"start\",\n\t\t\tdescription: \"Start the project in production mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"start\");\n\t\t\t},\n\t\t});\n};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\nexport const createTestCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"test\",\n\t\t\tdescription: \"Test the code execution\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"test\");\n\t\t\t},\n\t\t});\n};\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createWatchCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"watch\",\n\t\t\tdescription: \"Build and start the project in development mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"watch\");\n\t\t\t},\n\t\t});\n};\n"],
5
- "mappings": ";qeAEA,IAAAA,GAAwB,mBCFxB,IAAAC,EAA2B,cAC3BC,EAAwB,mBACxBC,EAAwB,gBAOXC,EAAa,CACzBC,EACAC,IACI,CACJ,UAAQ,QACP;AAAA;AAAA,0BAESD,EAAM;AAAA,WACXC,GAAS,OAAS,QAAU,SAAM,oBAAUD,EAAM;AAAA;AAAA,EAGtDA,EAAM,KAEJ;AAAA,EACFA,EAAM;AAAA,EAFJ,KAKFC,CACD,CACD,EAOaC,EAA+BC,MACpC,WAAQ,QAAQ,IAAI,EAAGA,CAAI,EAQtBC,EAA6BD,MAClC,WAAQ,UAAW,MAAOA,CAAI,EAe/B,IAAME,EAAgB,SAAY,CACxC,GAAI,CACH,OAAO,MAAM,UAAQ,KAAK,SAAS,CACpC,MAAE,CACD,MAAMC,EACL,OACA,yHACD,CACD,CACD,EAEaC,EAAkB,CAACC,EAAiBC,EAAgB,KAIzD,CAAC,GAAIA,EAAgB,CAAC,EAAI,CAAC,UAAU,EAAI,SAASD,GAAS,EAAE,KACnE,GACD,EAGYE,EAAgB,IACrB,UAAQ,KAAK,iBAAiB,EAGzBC,EAAU,CACtB,MAAM,IACLC,EACAC,EACyE,CACzE,IAAMC,EAAW,MAAM,MAAMF,CAAG,EAEhC,GAAI,CAACE,EAAS,GACb,MAAMR,EACL,QACA,kCAAkCM,MAAQ,KAAK,UAAU,CACxD,OAAQE,EAAS,OACjB,WAAYA,EAAS,UACtB,CAAC,IACF,EAGD,OAAOD,IAAiB,OAASC,EAAS,KAAK,EAAIA,EAAS,KAAK,CACl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DA,EACE,QAAQ,CACR,KAAM,OACN,YAAa,yBACd,CAAC,EACA,KAAK,CACL,SAAU,CACT,OAAOC,EAAM,MAAM,CACpB,CACD,CAAC,CACH,ECXO,IAAMC,GAAsCC,GAAY,CAC9DA,EACE,QAAQ,CACR,KAAM,QACN,YAAa,iDACd,CAAC,EACA,KAAK,CACL,SAAU,CACT,OAAOC,EAAM,OAAO,CACrB,CACD,CAAC,CACH,EZEA,IAAMC,GAAgB,IAAIC,IAA4C,CACrE,IAAMC,KAAU,YAAQ,CACvB,KAAM,QACN,YAAa,mDACd,CAAC,EAED,QAAWC,KAAkBF,EAC5BE,EAAeD,CAAO,CAExB,EAEAF,GACCI,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,EACAC,GACAC,GACAC,CACD",
6
- "names": ["import_termost", "import_node_fs", "import_termost", "import_node_path", "botMessage", "input", "options", "resolveFromProjectDirectory", "path", "resolveFromStackDirectory", "getNpmVersion", "createError", "getStackCommand", "command", "isNodeRuntime", "setPkgManager", "request", "url", "responseType", "response", "eslint", "options", "files", "eslintFiles", "file", "ESLINT_EXTENSIONS", "ext", "args", "resolveFromProjectDirectory", "gitIgnoreFile", "error", "checkLints", "fixLints", "fixFormatting", "prettierFiles", "PRETTIER_IGNORE_FILES", "filename", "checkTypes", "tsFiles", "TYPESCRIPT_EXTENSIONS", "checkCommit", "bin", "turbo", "changeset", "createBuildCommand", "program", "turbo", "import_node_path", "import_termost", "import_node_fs", "import_promises", "config_default", "createCreateCommand", "program", "botMessage", "label", "getNpmVersion", "inputDescription", "inputName", "inputUrl", "nodeVersion", "request", "npmVersion", "repoOwner", "repoName", "createError", "data", "projectPath", "extractTemplate", "engine", "createTemplateEngine", "config_default", "localDevDependencies", "globalDevDependencies", "error", "setPkgManager", "previousTaskError", "message", "config", "input", "evaluate", "expression", "_", "key", "filename", "filepath", "resolveFromProjectDirectory", "content", "pathname", "compressedFilePath", "resolveFromStackDirectory", "destinationPath", "onlyValues", "createCheckCommand", "program", "label", "turbo", "ifNotAllOrOnlyNotEqualTo", "_", "argv", "filenames", "checkLints", "context", "checkTypes", "only", "checkCommit", "message", "import_termost", "createCleanCommand", "program", "label", "retrieveIgnoredFiles", "files", "cleanFiles", "message", "PRESERVE_FILES", "fileList", "createFixCommand", "program", "label", "turbo", "_", "argv", "fixLints", "fixFormatting", "message", "import_promises", "createInstallCommand", "program", "label", "installGitHook", "getStackCommand", "message", "hook", "content", "filename", "resolveFromProjectDirectory", "import_termost", "createReleaseCommand", "program", "ifNotEqualTo", "changeset", "validOption", "context", "createStartCommand", "program", "turbo", "createTestCommand", "program", "turbo", "createWatchCommand", "program", "turbo", "createProgram", "commandFactories", "program", "commandBuilder", "createCreateCommand", "createInstallCommand", "createCleanCommand", "createCheckCommand", "createFixCommand", "createStartCommand", "createBuildCommand", "createWatchCommand", "createTestCommand", "createReleaseCommand"]
3
+ "sources": ["../src/index.ts", "../src/helpers.ts", "../src/commands/build.ts", "../src/commands/create.ts", "../templates/default/config.json", "../package.json", "../src/commands/check.ts", "../src/commands/clean.ts", "../src/commands/fix.ts", "../src/commands/install.ts", "../src/commands/release.ts", "../src/commands/start.ts", "../src/commands/test.ts", "../src/commands/watch.ts"],
4
+ "sourcesContent": ["#!/usr/bin/env node\n\nimport { termost } from \"termost\";\n\nimport { createBuildCommand } from \"./commands/build\";\nimport { createCreateCommand } from \"./commands/create\";\nimport { createCheckCommand } from \"./commands/check\";\nimport { createCleanCommand } from \"./commands/clean\";\nimport { createFixCommand } from \"./commands/fix\";\nimport { createInstallCommand } from \"./commands/install\";\nimport { createReleaseCommand } from \"./commands/release\";\nimport { createStartCommand } from \"./commands/start\";\nimport { createTestCommand } from \"./commands/test\";\nimport { createWatchCommand } from \"./commands/watch\";\nimport type { CommandFactory } from \"./types\";\n\nconst createProgram = (...commandFactories: Array<CommandFactory>) => {\n\tconst program = termost({\n\t\tname: \"stack\",\n\t\tdescription: \"Toolbox to easily scaffold and maintain a project\",\n\t});\n\n\tfor (const commandBuilder of commandFactories) {\n\t\tcommandBuilder(program);\n\t}\n};\n\ncreateProgram(\n\tcreateCreateCommand,\n\tcreateInstallCommand,\n\tcreateCleanCommand,\n\tcreateCheckCommand,\n\tcreateFixCommand,\n\tcreateStartCommand,\n\tcreateBuildCommand,\n\tcreateWatchCommand,\n\tcreateTestCommand,\n\tcreateReleaseCommand,\n);\n", "import { existsSync } from \"node:fs\";\nimport { helpers } from \"termost\";\nimport { resolve } from \"node:path\";\n\n/**\n * Helper to format log messages with a welcoming bot\n * @param input Content input\n * @param options Termost options for the `message` API\n */\nexport const botMessage = (\n\tinput: { title: string; description: string; body?: string },\n\toptions: Parameters<typeof helpers.message>[1],\n) => {\n\thelpers.message(\n\t\t`\n\u256D\u2500\u2500\u2500\u2500\u2500\u256E\n\u2502 \u25E0 \u25E0 ${input.title}\n\u2502 ${options?.type === \"error\" ? \"\u25E0\" : \"\u25E1\"} \u2502 ${input.description}\n\u2570\u2500\u2500\u2500\u2500\u2500\u256F\n${\n\t!input.body\n\t\t? \"\"\n\t\t: `\n${input.body}\n`\n}`,\n\t\toptions,\n\t);\n};\n\n/**\n * Resolve a relative path to an absolute one resolved from the generated project root directory\n * @param path The relative path\n * @returns The resolved absolute path\n */\nexport const resolveFromProjectDirectory = (path: string) => {\n\treturn resolve(process.cwd(), path);\n};\n\n/**\n * Resolve a relative path to an absolute one resolved from the `stack` node module directory\n * @param path The relative path\n * @returns The resolved absolute path\n */\nexport const resolveFromStackDirectory = (path: string) => {\n\treturn resolve(__dirname, \"../\", path);\n};\n\nexport const getRepositoryUrl = async () => {\n\ttry {\n\t\t// This step is used as well to persist the repository url value:\n\t\treturn await helpers.exec(\"git config --get remote.origin.url\");\n\t} catch (error) {\n\t\tthrow createError(\n\t\t\t\"git\",\n\t\t\t`The project must be a \\`git\\` repository with an origin already setup. Have you tried to run \\`git init && git remote add origin git@github.com:OWNER/REPOSITORY.git && git add -A && git commit -m \"chore: initial commit\" && git push -u origin main\\`?\\n${error}`,\n\t\t);\n\t}\n};\n\nexport const getNpmVersion = async () => {\n\ttry {\n\t\treturn await helpers.exec(\"pnpm -v\");\n\t} catch (error) {\n\t\tthrow createError(\n\t\t\t\"pnpm\",\n\t\t\t\"The project must use `pnpm` as a node package manager tool. Follow this installation guide https://pnpm.io/installation\",\n\t\t);\n\t}\n};\n\nexport const getStackCommand = (command: string, isNodeRuntime = true) => {\n\t// @note: `isNodeRuntime` allows executing node bin executables in a non node environment such as in git hooks context\n\t// Npx is used to make executable resolution independent from the build tool (npx is the built-in Node tool)\n\t// `--no` flag to prevent installation prompt and throw an error if the binary is not installed\n\treturn [...(isNodeRuntime ? [] : [\"npx --no\"]), `stack ${command}`].join(\n\t\t\" \",\n\t);\n};\n\nexport const setPkgManager = () => {\n\treturn helpers.exec(\"corepack enable\");\n};\n\nexport const request = {\n\tasync get<ResponseType extends \"json\" | \"text\">(\n\t\turl: string,\n\t\tresponseType: ResponseType,\n\t): Promise<ResponseType extends \"text\" ? string : Record<string, string>> {\n\t\tconst response = await fetch(url);\n\n\t\tif (!response.ok) {\n\t\t\tthrow createError(\n\t\t\t\t\"fetch\",\n\t\t\t\t`Failed to fetch resources from ${url} (${JSON.stringify({\n\t\t\t\t\tstatus: response.status,\n\t\t\t\t\tstatusText: response.statusText,\n\t\t\t\t})})`,\n\t\t\t);\n\t\t}\n\n\t\treturn responseType === \"text\" ? response.text() : response.json();\n\t},\n};\n\nconst eslint =\n\t(options: { isFixMode: boolean }) =>\n\tasync (files: FilenameCollection = []) => {\n\t\tlet eslintFiles = [];\n\n\t\tif (files.length === 0) {\n\t\t\teslintFiles.push(\".\");\n\t\t} else {\n\t\t\teslintFiles = files.filter((file) => {\n\t\t\t\treturn ESLINT_EXTENSIONS.some((ext) => file.endsWith(ext));\n\t\t\t});\n\n\t\t\tif (eslintFiles.length === 0) return Promise.resolve();\n\t\t}\n\n\t\tconst args = [...eslintFiles];\n\n\t\targs.push(`--ext ${ESLINT_EXTENSIONS.join(\",\")}`);\n\t\targs.push(\"--cache\");\n\t\targs.push(\n\t\t\t`--cache-location ${await resolveFromProjectDirectory(\n\t\t\t\t\"node_modules/.cache/.eslintcache\",\n\t\t\t)}`,\n\t\t);\n\t\t// @note: prevent errors when no matched file is found\n\t\targs.push(\"--no-error-on-unmatched-pattern\");\n\n\t\tconst gitIgnoreFile = await resolveFromProjectDirectory(\".gitignore\");\n\n\t\tif (existsSync(gitIgnoreFile)) {\n\t\t\targs.push(`--ignore-path ${gitIgnoreFile}`);\n\t\t}\n\n\t\tif (options.isFixMode) {\n\t\t\targs.push(\"--fix\");\n\t\t}\n\n\t\ttry {\n\t\t\treturn await helpers.exec(`eslint ${args.join(\" \")}`);\n\t\t} catch (error) {\n\t\t\tthrow createError(\"eslint\", error);\n\t\t}\n\t};\n\nexport const checkLints = eslint({ isFixMode: false });\n\nexport const fixLints = eslint({ isFixMode: true });\n\nexport const fixFormatting = async (files: FilenameCollection) => {\n\tlet prettierFiles = [];\n\n\tif (files.length === 0) {\n\t\tprettierFiles.push(`\"**/!(${PRETTIER_IGNORE_FILES.join(\"|\")})\"`);\n\t} else {\n\t\tprettierFiles = files.filter((file) => {\n\t\t\treturn (\n\t\t\t\t!PRETTIER_IGNORE_FILES.some((filename) =>\n\t\t\t\t\tfile.endsWith(filename),\n\t\t\t\t) && // The root `README.md` file is ignored to prevent error due to its symbolic link nature when specified explicitly as a file\n\t\t\t\tfile !== \"README.md\"\n\t\t\t);\n\t\t});\n\n\t\tif (prettierFiles.length === 0) return Promise.resolve();\n\t}\n\n\tconst args = [...prettierFiles];\n\n\tif (existsSync(await resolveFromProjectDirectory(\".gitignore\"))) {\n\t\targs.push(\"--ignore-path .gitignore\");\n\t}\n\n\targs.push(\"--write\");\n\targs.push(\"--ignore-unknown\");\n\targs.push(\"--no-error-on-unmatched-pattern\");\n\n\ttry {\n\t\treturn await helpers.exec(`prettier ${args.join(\" \")}`);\n\t} catch (error) {\n\t\tthrow createError(\"prettier\", error);\n\t}\n};\n\nexport const checkTypes = async (files: FilenameCollection) => {\n\ttry {\n\t\tconst tsFiles = files.filter((file) => {\n\t\t\treturn TYPESCRIPT_EXTENSIONS.some((ext) => file.endsWith(ext));\n\t\t});\n\n\t\treturn await helpers.exec(\n\t\t\t`tsc --tsBuildInfoFile ${await resolveFromProjectDirectory(\n\t\t\t\t\"node_modules/.cache/.tsbuildinfo\",\n\t\t\t)} --noEmit ${tsFiles.join(\" \")}`,\n\t\t);\n\t} catch (error) {\n\t\tthrow createError(\"tsc\", error);\n\t}\n};\n\nexport const checkCommit = async () => {\n\ttry {\n\t\treturn await helpers.exec(\n\t\t\t'commitlint --extends \"@commitlint/config-conventional\" --edit',\n\t\t);\n\t} catch (error) {\n\t\tthrow createError(\"commitlint\", error);\n\t}\n};\n\nexport const createError = (bin: string, error: Error | string | unknown) => {\n\treturn new Error(`\\`${bin}\\` failed:\\n${error}`);\n};\n\nexport const turbo = async (\n\tcommand: \"build\" | \"start\" | \"test\" | \"watch\",\n\toptions: Parameters<typeof helpers.exec>[1] = { hasLiveOutput: true },\n) => {\n\ttry {\n\t\treturn await helpers.exec(`turbo run ${command}`, options);\n\t} catch (error) {\n\t\tthrow createError(\"turbo\", error);\n\t}\n};\n\nexport const changeset = async (command: string) => {\n\ttry {\n\t\treturn await helpers.exec(command, {\n\t\t\thasLiveOutput: true,\n\t\t});\n\t} catch (error) {\n\t\tthrow createError(\"changeset\", error);\n\t}\n};\n\nconst TYPESCRIPT_EXTENSIONS = [\"ts\", \"tsx\", \"cts\", \"mts\"];\n/**\n * Extensions supported by ESLint.\n */\nconst ESLINT_EXTENSIONS = [\"js\", \"jsx\", \"cjs\", \"mjs\", ...TYPESCRIPT_EXTENSIONS];\nconst PRETTIER_IGNORE_FILES = [\"CHANGELOG.md\", \"pnpm-lock.yaml\"];\n\ntype FilenameCollection = Array<string>;\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createBuildCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"build\",\n\t\t\tdescription: \"Build the project in production mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\");\n\t\t\t},\n\t\t});\n};\n", "import { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\nimport { readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { mkdir, symlink } from \"node:fs/promises\";\n\nimport type { CommandFactory } from \"../types\";\nimport {\n\tbotMessage,\n\tcreateError,\n\tgetNpmVersion,\n\trequest,\n\tresolveFromProjectDirectory,\n\tresolveFromStackDirectory,\n\tsetPkgManager,\n} from \"../helpers\";\nimport defaultTemplateConfig from \"../../templates/default/config.json\";\nimport pkg from \"../../package.json\";\n\ntype CommandContext = {\n\tpreviousTaskError: Error | undefined;\n\tinputName: string;\n\tinputDescription: string;\n\tinputUrl: string;\n\tdata: Record<\n\t\t| \"license_year\"\n\t\t| \"node_version\"\n\t\t| \"npm_version\"\n\t\t| \"project_description\"\n\t\t| \"project_name\"\n\t\t| \"project_url\"\n\t\t| \"repo_id\",\n\t\tstring\n\t>;\n};\n\nexport const createCreateCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"create\",\n\t\t\tdescription: \"Scaffold a new project\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\tbotMessage(\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: `I'm Stack v${pkg.version}, your bot assistant`,\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"I can guarantee you a project creation in under 1 minute \uD83D\uDE80\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: \"information\",\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputName\",\n\t\t\tlabel: \"What's your project name?\",\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputDescription\",\n\t\t\tlabel: \"How would you describe it?\",\n\t\t})\n\t\t.input({\n\t\t\ttype: \"text\",\n\t\t\tkey: \"inputUrl\",\n\t\t\tlabel: \"Where will it be stored? (Git remote URL)\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking pre-requisites\"),\n\t\t\thandler() {\n\t\t\t\t// Check pnpm availability by verifying its version\n\t\t\t\treturn getNpmVersion();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tkey: \"data\",\n\t\t\tlabel: label(\"Evaluating contextual data\"),\n\t\t\tasync handler({ inputDescription, inputName, inputUrl }) {\n\t\t\t\tconst nodeVersion = await request.get(\n\t\t\t\t\t\"https://resolve-node.vercel.app/lts\",\n\t\t\t\t\t\"text\",\n\t\t\t\t);\n\n\t\t\t\tconst npmVersion = (\n\t\t\t\t\tawait request.get(\n\t\t\t\t\t\t\"https://registry.npmjs.org/pnpm/latest\",\n\t\t\t\t\t\t\"json\",\n\t\t\t\t\t)\n\t\t\t\t).version as string;\n\n\t\t\t\tconst { repoOwner, repoName } =\n\t\t\t\t\tinputUrl.match(\n\t\t\t\t\t\tinputUrl.startsWith(\"git\")\n\t\t\t\t\t\t\t? /^git@.*:(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t\t\t: /^https?:\\/\\/.*\\/(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/,\n\t\t\t\t\t)?.groups ?? {};\n\n\t\t\t\tif (!repoOwner || !repoName) {\n\t\t\t\t\tthrow createError(\n\t\t\t\t\t\t\"git\",\n\t\t\t\t\t\t\"The owner and repository name can not be extracted. Please make sure to follow either `/^git@.*:(?<repoOwner>.*)/(?<repoName>.*).git$/` or `/^https?://.*/(?<repoOwner>.*)/(?<repoName>.*).git$/` pattern.\",\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tlicense_year: new Date().getFullYear().toString(),\n\t\t\t\t\tnode_version: nodeVersion,\n\t\t\t\t\tnpm_version: npmVersion,\n\t\t\t\t\trepo_id: `${repoOwner}/${repoName}`,\n\t\t\t\t\tproject_description:\n\t\t\t\t\t\tinputDescription.charAt(0).toUpperCase() +\n\t\t\t\t\t\tinputDescription.slice(1), // Enforce upper case for the first letter\n\t\t\t\t\tproject_name: inputName.toLowerCase(), // Enforce lower case for folder and package name\n\t\t\t\t\tproject_url: inputUrl,\n\t\t\t\t\tproject_version: \"0.0.0\",\n\t\t\t\t};\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel({ data }) {\n\t\t\t\treturn label(`Creating \\`${data.project_name}\\` folder`);\n\t\t\t},\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst projectPath = resolve(process.cwd(), data.project_name);\n\n\t\t\t\tawait mkdir(projectPath);\n\t\t\t\tprocess.chdir(projectPath);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Initializing `git`\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tawait helpers.exec(\"git init\");\n\t\t\t\tawait helpers.exec(`git remote add origin ${data.project_url}`);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Applying default template\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tawait extractTemplate();\n\n\t\t\t\t// Hydrate template expressions with context values:\n\t\t\t\tconst engine = createTemplateEngine(\n\t\t\t\t\tdefaultTemplateConfig,\n\t\t\t\t\tdata,\n\t\t\t\t);\n\n\t\t\t\tengine.hydrate();\n\t\t\t\tengine.rename();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing dependencies\"),\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst localDevDependencies = [\"quickbundle\", \"vitest\"];\n\n\t\t\t\tconst globalDevDependencies = [\n\t\t\t\t\t\"@adbayb/eslint-config\",\n\t\t\t\t\t\"@adbayb/prettier-config\",\n\t\t\t\t\t\"@adbayb/ts-config\",\n\t\t\t\t\t\"@adbayb/stack\",\n\t\t\t\t];\n\n\t\t\t\ttry {\n\t\t\t\t\tawait helpers.exec(\n\t\t\t\t\t\t`pnpm add ${globalDevDependencies.join(\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t)} --save-dev --ignore-workspace-root-check`,\n\t\t\t\t\t);\n\n\t\t\t\t\tawait helpers.exec(\n\t\t\t\t\t\t`pnpm add ${localDevDependencies.join(\n\t\t\t\t\t\t\t\" \",\n\t\t\t\t\t\t)} --save-dev --filter ${data.project_name}`,\n\t\t\t\t\t);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tthrow createError(\"pnpm\", error);\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Cleaning up\"),\n\t\t\tkey: \"previousTaskError\",\n\t\t\tasync handler({ data }) {\n\t\t\t\ttry {\n\t\t\t\t\t// Symlink the package `README.md` file to the root project directory\n\t\t\t\t\tawait symlink(\n\t\t\t\t\t\t`./${data.project_name}/README.md`,\n\t\t\t\t\t\t\"./README.md\",\n\t\t\t\t\t);\n\t\t\t\t\t// Set the Node package manager runtime by following the `packageManager` field instruction\n\t\t\t\t\tawait setPkgManager();\n\t\t\t\t\t// Run install command to add git hooks\n\t\t\t\t\tawait helpers.exec(\"stack install\");\n\t\t\t\t\t// Commit (and run check/fix command via git hooks)\n\t\t\t\t\tawait helpers.exec(\"git add -A\");\n\t\t\t\t\tawait helpers.exec('git commit -m \"chore: initial commit\"');\n\n\t\t\t\t\treturn;\n\t\t\t\t} catch (error) {\n\t\t\t\t\treturn error as Error;\n\t\t\t\t}\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\thandler({ previousTaskError, data }) {\n\t\t\t\tif (previousTaskError) {\n\t\t\t\t\tbotMessage(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttitle: \"Oops, an error occurred\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Keep calm and carry on with some coffee \u2615\uFE0F\",\n\t\t\t\t\t\t\tbody: String(previousTaskError),\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tbotMessage(\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle: \"The project was successfully created\",\n\t\t\t\t\t\tdescription: `Run \\`cd ./${data.project_name}\\` and Enjoy \uD83D\uDE80`,\n\t\t\t\t\t},\n\t\t\t\t\t{ type: \"success\" },\n\t\t\t\t);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDD28`;\n\n/**\n * A simple template engine to evaluate dynamic expressions and apply side effets (such as hydrating a content with values from an input object) on impacted template files\n * @param config Configuration object listing template files/folders that need expression evaluation\n * @param input Input object mapping the template expression key with its corresponding value\n */\nconst createTemplateEngine = (\n\tconfig: Record<\"files\" | \"folders\", Array<string>>,\n\tinput: CommandContext[\"data\"],\n) => {\n\tconst evaluate = (expression: string) => {\n\t\treturn expression.replace(\n\t\t\t/{{(.*?)}}/g,\n\t\t\t(_, key: keyof CommandContext[\"data\"]) => input[key] || \"\",\n\t\t);\n\t};\n\n\treturn {\n\t\thydrate() {\n\t\t\tfor (const filename of config.files) {\n\t\t\t\tconst filepath = resolveFromProjectDirectory(filename);\n\t\t\t\tconst content = readFileSync(filepath, \"utf-8\");\n\n\t\t\t\twriteFileSync(filepath, evaluate(content));\n\t\t\t}\n\t\t},\n\t\trename() {\n\t\t\ttry {\n\t\t\t\tfor (const pathname of config.folders) {\n\t\t\t\t\trenameSync(\n\t\t\t\t\t\tresolveFromProjectDirectory(pathname),\n\t\t\t\t\t\tresolveFromProjectDirectory(evaluate(pathname)),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Silent error in case of stack re-creation\n\t\t\t}\n\t\t},\n\t};\n};\n\nconst extractTemplate = async () => {\n\tconst compressedFilePath = resolve(\n\t\tresolveFromStackDirectory(\"./templates\"),\n\t\t\"./default/content.tar.gz\",\n\t);\n\n\tconst destinationPath = resolveFromProjectDirectory(\"./\");\n\n\treturn helpers.exec(\n\t\t`tar -xzf ${compressedFilePath} -C ${destinationPath} --strip-components=1`,\n\t);\n};\n", "{\n\t\"files\": [\n\t\t\".nvmrc\",\n\t\t\"CONTRIBUTING.md\",\n\t\t\"LICENSE\",\n\t\t\"package.json\",\n\t\t\"pnpm-workspace.yaml\",\n\t\t\".changeset/config.json\",\n\t\t\".changeset/welcome.md\",\n\t\t\".github/PULL_REQUEST_TEMPLATE.md\",\n\t\t\"{{project_name}}/package.json\",\n\t\t\"{{project_name}}/README.md\",\n\t\t\"examples/default/package.json\",\n\t\t\"examples/default/src/index.ts\"\n\t],\n\t\"folders\": [\"{{project_name}}\"]\n}\n", "{\n\t\"name\": \"@adbayb/stack\",\n\t\"version\": \"1.7.0\",\n\t\"description\": \"My opinionated toolchain\",\n\t\"publishConfig\": {\n\t\t\"access\": \"public\"\n\t},\n\t\"files\": [\n\t\t\"bin\",\n\t\t\"dist\",\n\t\t\"templates\"\n\t],\n\t\"bin\": {\n\t\t\"stack\": \"bin/index.cjs\"\n\t},\n\t\"source\": \"src/index.ts\",\n\t\"main\": \"dist/index.js\",\n\t\"platform\": \"node\",\n\t\"scripts\": {\n\t\t\"prepublishOnly\": \"pnpm build\",\n\t\t\"prestart\": \"pnpm build\",\n\t\t\"start\": \"bin/index.js\",\n\t\t\"build\": \"quickbundle build\",\n\t\t\"watch\": \"quickbundle watch\"\n\t},\n\t\"keywords\": [\n\t\t\"stack\",\n\t\t\"scripts\",\n\t\t\"toolchain\",\n\t\t\"development\"\n\t],\n\t\"author\": {\n\t\t\"name\": \"Ayoub Adib\",\n\t\t\"email\": \"adbayb@gmail.com\",\n\t\t\"url\": \"https://twitter.com/adbayb\"\n\t},\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/adbayb/stack.git\",\n\t\t\"directory\": \"stack\"\n\t},\n\t\"license\": \"MIT\",\n\t\"dependencies\": {\n\t\t\"@changesets/changelog-github\": \"^0.4.8\",\n\t\t\"@changesets/cli\": \"^2.26.2\",\n\t\t\"@commitlint/cli\": \"^17.7.1\",\n\t\t\"@commitlint/config-conventional\": \"^17.7.0\",\n\t\t\"eslint\": \"^8.47.0\",\n\t\t\"prettier\": \"^3.0.2\",\n\t\t\"termost\": \"^0.9.0\",\n\t\t\"turbo\": \"^1.10.12\",\n\t\t\"typescript\": \"^5.1.6\"\n\t}\n}\n", "import type { CommandFactory } from \"../types\";\nimport { checkCommit, checkLints, checkTypes, turbo } from \"../helpers\";\n\nconst onlyValues = [\"commit\", \"lint\", \"type\"] as const;\n\ntype Only = (typeof onlyValues)[number];\n\ntype CommandContext = {\n\tonly: Only | undefined;\n};\n\nexport const createCheckCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"check\",\n\t\t\tdescription: \"Check code health (static analysis)\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"only\",\n\t\t\tname: \"only\",\n\t\t\tdescription: `Run only one specified task (accepted value: ${onlyValues.join(\n\t\t\t\t\", \",\n\t\t\t)})`,\n\t\t\tdefaultValue: undefined,\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Preparing the project\"),\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking linters\"),\n\t\t\tskip: ifNotAllOrOnlyNotEqualTo(\"lint\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tconst filenames = argv.operands;\n\n\t\t\t\treturn checkLints(filenames);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking types\"),\n\t\t\tskip(context, argv) {\n\t\t\t\treturn (\n\t\t\t\t\tifNotAllOrOnlyNotEqualTo(\"type\")(context) ||\n\t\t\t\t\t!require.resolve(\"typescript\") ||\n\t\t\t\t\t// For now, skip type-checking if some files are passed down\n\t\t\t\t\t// @see: https://github.com/microsoft/TypeScript/issues/27379\n\t\t\t\t\targv.operands.length > 0\n\t\t\t\t);\n\t\t\t},\n\t\t\thandler(_, argv) {\n\t\t\t\treturn checkTypes(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking commit\"),\n\t\t\tskip({ only }) {\n\t\t\t\treturn only !== \"commit\";\n\t\t\t},\n\t\t\thandler() {\n\t\t\t\treturn checkCommit();\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDD0`;\n\nconst ifNotAllOrOnlyNotEqualTo = (only: Only) => (context: CommandContext) => {\n\treturn context.only !== undefined && context.only !== only;\n};\n", "import { helpers } from \"termost\";\n\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tfiles: Array<string>;\n};\n\nexport const createCleanCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"clean\",\n\t\t\tdescription: \"Clean the project\",\n\t\t})\n\t\t.task({\n\t\t\tkey: \"files\",\n\t\t\tlabel: label(\"Retrieving removable assets\"),\n\t\t\thandler() {\n\t\t\t\treturn retrieveIgnoredFiles();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel({ files }) {\n\t\t\t\treturn files.length > 0\n\t\t\t\t\t? label(\"Cleaning assets\")\n\t\t\t\t\t: \"Already clean \u2728\";\n\t\t\t},\n\t\t\thandler({ files }) {\n\t\t\t\treturn files.length > 0\n\t\t\t\t\t? cleanFiles(files.join(\" \"))\n\t\t\t\t\t: Promise.resolve();\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip({ files }) {\n\t\t\t\treturn files.length === 0;\n\t\t\t},\n\t\t\thandler({ files }) {\n\t\t\t\thelpers.message(`Removed assets: ${files.join(\", \")}\\n`, {\n\t\t\t\t\ttype: \"information\",\n\t\t\t\t});\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDF9`;\n\nconst retrieveIgnoredFiles = async () => {\n\tconst rawFiles = await helpers.exec(\n\t\t`git clean -fdXn | grep -v '${PRESERVE_FILES.join(\n\t\t\t\"\\\\|\",\n\t\t)}' | cut -c 14-`,\n\t);\n\n\treturn rawFiles.split(/\\n/).filter(Boolean);\n};\n\nconst cleanFiles = (fileList: string) => {\n\treturn helpers.exec(`rm -rf ${fileList}`);\n};\n\nconst PRESERVE_FILES = [\"node_modules\", \".turbo\"];\n", "import type { CommandFactory } from \"../types\";\nimport { fixFormatting, fixLints, turbo } from \"../helpers\";\n\nexport const createFixCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"fix\",\n\t\t\tdescription: \"Fix auto-fixable issues\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Preparing the project\"),\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing lints\"),\n\t\t\thandler(_, argv) {\n\t\t\t\treturn fixLints(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing formatting\"),\n\t\t\thandler(_, argv) {\n\t\t\t\treturn fixFormatting(argv.operands);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDE91`;\n", "import { chmod, writeFile } from \"node:fs/promises\";\n\nimport { getStackCommand, resolveFromProjectDirectory } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\nexport const createInstallCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"install\",\n\t\t\tdescription: \"Setup initial requirements\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing `git.pre-commit` hook\"),\n\t\t\thandler() {\n\t\t\t\treturn installGitHook(\n\t\t\t\t\t\"pre-commit\",\n\t\t\t\t\t`${getStackCommand(\n\t\t\t\t\t\t\"fix $(git status --porcelain | awk 'BEGIN{ ORS=\\\" \\\" } { print $2 }')\",\n\t\t\t\t\t\tfalse,\n\t\t\t\t\t)} && git add -A`,\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Installing `git.commit-msg` hook\"),\n\t\t\thandler() {\n\t\t\t\treturn installGitHook(\n\t\t\t\t\t\"commit-msg\",\n\t\t\t\t\t`${getStackCommand(\"check --only commit\", false)}`,\n\t\t\t\t);\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83D\uDCF2`;\n\nconst installGitHook = async (\n\thook: \"commit-msg\" | \"pre-commit\",\n\tcontent: string,\n) => {\n\tconst filename = resolveFromProjectDirectory(`.git/hooks/${hook}`);\n\n\tawait writeFile(filename, content);\n\n\treturn chmod(filename, \"0755\");\n};\n", "import { helpers } from \"termost\";\n\nimport type { CommandFactory } from \"../types\";\nimport { changeset } from \"../helpers\";\n\ntype CommandContext = {\n\tlog: boolean;\n\tpublish: boolean;\n\ttag: boolean;\n};\n\nexport const createReleaseCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command<CommandContext>({\n\t\t\tname: \"release\",\n\t\t\tdescription: \"Log, version, and publish package(s)\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"log\",\n\t\t\tname: \"log\",\n\t\t\tdescription: \"Add a new changelog entry\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"tag\",\n\t\t\tname: \"tag\",\n\t\t\tdescription: \"Bump the package(s) version\",\n\t\t})\n\t\t.option({\n\t\t\tkey: \"publish\",\n\t\t\tname: \"publish\",\n\t\t\tdescription: \"Publish package(s) to the registry\",\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"log\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"New changelog entry\\n\");\n\n\t\t\t\treturn changeset(\"changeset\");\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"tag\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"Bumping the package(s) version\\n\");\n\n\t\t\t\treturn changeset(\n\t\t\t\t\t\"changeset version && pnpm install --no-frozen-lockfile\",\n\t\t\t\t);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tskip: ifNotEqualTo(\"publish\"),\n\t\t\thandler() {\n\t\t\t\thelpers.message(\"Publishing package(s) to the registry\\n\");\n\n\t\t\t\treturn changeset(\"stack build && pnpm changeset publish\");\n\t\t\t},\n\t\t});\n};\n\nconst ifNotEqualTo =\n\t(validOption: keyof CommandContext) => (context: CommandContext) => {\n\t\treturn !context[validOption];\n\t};\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createStartCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"start\",\n\t\t\tdescription: \"Start the project in production mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"start\");\n\t\t\t},\n\t\t});\n};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\nexport const createTestCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"test\",\n\t\t\tdescription: \"Test the code execution\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"test\");\n\t\t\t},\n\t\t});\n};\n", "import type { CommandFactory } from \"../types\";\nimport { turbo } from \"../helpers\";\n\nexport const createWatchCommand: CommandFactory = (program) => {\n\tprogram\n\t\t.command({\n\t\t\tname: \"watch\",\n\t\t\tdescription: \"Build and start the project in development mode\",\n\t\t})\n\t\t.task({\n\t\t\thandler() {\n\t\t\t\treturn turbo(\"watch\");\n\t\t\t},\n\t\t});\n};\n"],
5
+ "mappings": ";qeAEA,IAAAA,GAAwB,mBCFxB,IAAAC,EAA2B,cAC3BC,EAAwB,mBACxBC,EAAwB,gBAOXC,EAAa,CACzBC,EACAC,IACI,CACJ,UAAQ,QACP;AAAA;AAAA,0BAESD,EAAM;AAAA,WACXC,GAAS,OAAS,QAAU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SAAU,CACT,OAAOC,EAAM,OAAO,CACrB,CACD,CAAC,CACH,ECXO,IAAMC,GAAqCC,GAAY,CAC7DA,EACE,QAAQ,CACR,KAAM,OACN,YAAa,yBACd,CAAC,EACA,KAAK,CACL,SAAU,CACT,OAAOC,EAAM,MAAM,CACpB,CACD,CAAC,CACH,ECXO,IAAMC,GAAsCC,GAAY,CAC9DA,EACE,QAAQ,CACR,KAAM,QACN,YAAa,iDACd,CAAC,EACA,KAAK,CACL,SAAU,CACT,OAAOC,EAAM,OAAO,CACrB,CACD,CAAC,CACH,EbEA,IAAMC,GAAgB,IAAIC,IAA4C,CACrE,IAAMC,KAAU,YAAQ,CACvB,KAAM,QACN,YAAa,mDACd,CAAC,EAED,QAAWC,KAAkBF,EAC5BE,EAAeD,CAAO,CAExB,EAEAF,GACCI,EACAC,EACAC,EACAC,EACAC,EACAC,GACAC,EACAC,GACAC,GACAC,EACD",
6
+ "names": ["import_termost", "import_node_fs", "import_termost", "import_node_path", "botMessage", "input", "options", "resolveFromProjectDirectory", "path", "resolveFromStackDirectory", "getNpmVersion", "createError", "getStackCommand", "command", "isNodeRuntime", "setPkgManager", "request", "url", "responseType", "response", "eslint", "options", "files", "eslintFiles", "file", "ESLINT_EXTENSIONS", "ext", "args", "resolveFromProjectDirectory", "gitIgnoreFile", "error", "checkLints", "fixLints", "fixFormatting", "prettierFiles", "PRETTIER_IGNORE_FILES", "filename", "checkTypes", "tsFiles", "TYPESCRIPT_EXTENSIONS", "checkCommit", "bin", "turbo", "changeset", "createBuildCommand", "program", "turbo", "import_node_path", "import_termost", "import_node_fs", "import_promises", "config_default", "package_default", "createCreateCommand", "program", "botMessage", "package_default", "label", "getNpmVersion", "inputDescription", "inputName", "inputUrl", "nodeVersion", "request", "npmVersion", "repoOwner", "repoName", "createError", "data", "projectPath", "extractTemplate", "engine", "createTemplateEngine", "config_default", "localDevDependencies", "globalDevDependencies", "error", "setPkgManager", "previousTaskError", "message", "config", "input", "evaluate", "expression", "_", "key", "filename", "filepath", "resolveFromProjectDirectory", "content", "pathname", "compressedFilePath", "resolveFromStackDirectory", "destinationPath", "onlyValues", "createCheckCommand", "program", "label", "turbo", "ifNotAllOrOnlyNotEqualTo", "_", "argv", "filenames", "checkLints", "context", "checkTypes", "only", "checkCommit", "message", "import_termost", "createCleanCommand", "program", "label", "retrieveIgnoredFiles", "files", "cleanFiles", "message", "PRESERVE_FILES", "fileList", "createFixCommand", "program", "label", "turbo", "_", "argv", "fixLints", "fixFormatting", "message", "import_promises", "createInstallCommand", "program", "label", "installGitHook", "getStackCommand", "message", "hook", "content", "filename", "resolveFromProjectDirectory", "import_termost", "createReleaseCommand", "program", "ifNotEqualTo", "changeset", "validOption", "context", "createStartCommand", "program", "turbo", "createTestCommand", "program", "turbo", "createWatchCommand", "program", "turbo", "createProgram", "commandFactories", "program", "commandBuilder", "createCreateCommand", "createInstallCommand", "createCleanCommand", "createCheckCommand", "createFixCommand", "createStartCommand", "createBuildCommand", "createWatchCommand", "createTestCommand", "createReleaseCommand"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adbayb/stack",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "My opinionated toolchain",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -6,6 +6,7 @@
6
6
  "package.json",
7
7
  "pnpm-workspace.yaml",
8
8
  ".changeset/config.json",
9
+ ".changeset/welcome.md",
9
10
  ".github/PULL_REQUEST_TEMPLATE.md",
10
11
  "{{project_name}}/package.json",
11
12
  "{{project_name}}/README.md",
Binary file