@adbayb/stack 1.16.0 → 1.16.1

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/README.md CHANGED
@@ -92,13 +92,13 @@ flowchart TD
92
92
 
93
93
  ### Used conventions
94
94
 
95
- - [File Structure (inspired by NX)](https://nx.dev/concepts/more-concepts/folder-structure)
95
+ - [Commits](https://www.conventionalcommits.org/)
96
+ - [Scripts](https://conventionalscripts.org/)
97
+ - [File Structure](https://nx.dev/concepts/more-concepts/folder-structure)
96
98
  - Monorepo-first structure to:
97
99
  - Keep a consistent file structure pattern across templates (ease template familiarity and onboarding)
98
100
  - Ease examples setup
99
101
  - Not clutter the published package with development-related context, metadata, and artifacts
100
- - [Commits](https://www.conventionalcommits.org/)
101
- - [Scripts](https://conventionalscripts.org/)
102
102
 
103
103
  <br>
104
104
 
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ ${e.body?`
8
8
  ${e.body}
9
9
  `:""}`,t)},p=e=>(0,v.resolve)(process.cwd(),e),I=e=>(0,v.resolve)(__dirname,"../",e);var D=async()=>{try{return await m.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")}},$=(e,t=!0)=>[...t?[]:["npx --no"],`stack ${e}`].join(" "),A=async()=>m.helpers.exec("corepack enable"),E={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()}},L=e=>async(t=[])=>{let r=[];if(t.length===0)r.push(".");else if(r=t.filter(y=>P.some(a=>y.endsWith(a))),r.length===0)return Promise.resolve();let o=[...r];o.push(`--ext ${P.join(",")}`),o.push("--cache"),o.push(`--cache-location ${p("node_modules/.cache/.eslintcache")}`),o.push("--no-error-on-unmatched-pattern");let n=p(".gitignore");(0,F.existsSync)(n)&&o.push(`--ignore-path ${n}`),e.isFixMode&&o.push("--fix");try{return await m.helpers.exec(`eslint ${o.join(" ")}`)}catch(y){throw s("eslint",y)}},_=L({isFixMode:!1}),M=L({isFixMode:!0}),B=async e=>{let t=[];if(e.length===0)t.push(`"**/!(${O.join("|")})"`);else if(t=e.filter(o=>!O.some(n=>o.endsWith(n))&&o!=="README.md"),t.length===0)return Promise.resolve();let r=[...t];(0,F.existsSync)(p(".gitignore"))&&r.push("--ignore-path .gitignore"),r.push("--write"),r.push("--ignore-unknown"),r.push("--no-error-on-unmatched-pattern");try{return await m.helpers.exec(`prettier ${r.join(" ")}`)}catch(o){throw s("prettier",o)}},q=async()=>{try{return await m.helpers.exec("pnpm --parallel exec tsc --noEmit")}catch(e){throw s("tsc",e)}},V=async()=>{try{return await m.helpers.exec('commitlint --extends "@commitlint/config-conventional" --edit')}catch(e){throw s("commitlint",e)}},s=(e,t)=>new Error(`\`${e}\` failed:
10
10
  ${String(t)}`),i=async(e,t={hasLiveOutput:!0})=>{try{return await m.helpers.exec(`turbo run ${e}`,t)}catch(r){throw s("turbo",r)}},f=async e=>{try{return await m.helpers.exec(e,{hasLiveOutput:!0})}catch(t){throw s("changeset",t)}},ge=["ts","tsx","cts","mts"],P=["js","jsx","cjs","mjs",...ge],O=["CHANGELOG.md","pnpm-lock.yaml"];var W=e=>{e.command({name:"build",description:"Build the project in production mode"}).task({async handler(){await i("build")}})};var he=["commit","lint","type"],U=e=>{e.command({name:"check",description:"Check code health (static analysis)"}).option({key:"only",name:"only",description:`Run only one specified task (accepted value: ${he.join(", ")})`,defaultValue:void 0}).task({label:b("Preparing the project"),async handler(){await i("build",{hasLiveOutput:!1})},skip({only:t}){return t==="commit"}}).task({label:b("Checking linters"),async handler(t,r){let o=r.operands;await _(o)},skip:G("lint")}).task({label:b("Checking types"),async handler(){await q()},skip(t,r){return G("type")(t)||!require.resolve("typescript")||r.operands.length>0}}).task({label:b("Checking commit"),async handler(){await V()},skip({only:t}){return t!=="commit"}})},b=e=>`${e} \u{1F9D0}`,G=e=>t=>t.only!==void 0&&t.only!==e;var k=require("fs"),x=require("termost");var H=e=>{e.command({name:"clean",description:"Clean the project"}).task({key:"files",label:Y("Retrieving removable assets"),async handler(){let t="node_modules/.cache",r=await be();return fe(p(t))&&r.push(t),r}}).task({label({files:t}){return t.length>0?Y("Cleaning assets"):"Already clean \u2728"},async handler({files:t}){t.length!==0&&await ue(t)}}).task({handler({files:t}){x.helpers.message(`Removed assets: ${t.join(", ")}
11
- `,{type:"information"})},skip({files:t}){return t.length===0}})},Y=e=>`${e} \u{1F9F9}`,ue=async e=>x.helpers.exec(`rm -rf ${e.join(" ")}`),fe=e=>(0,k.existsSync)(e)&&(0,k.readdirSync)(e).length>0,be=async()=>(await x.helpers.exec(`git clean -fdXn | grep -v '${ke.join("\\|")}' | cut -c 14-`)).split(/\n/).filter(Boolean),ke=["node_modules",".turbo"];var S=require("fdir"),l=require("fs"),w=require("fs/promises"),z=require("path"),d=require("termost");var X={name:"@adbayb/stack",version:"1.16.0",description:"My opinionated toolchain",publishConfig:{access:"public"},files:["bin","dist","template"],bin:{stack:"bin/index.cjs"},source:"src/index.ts",main:"dist/index.cjs",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.5.0","@changesets/cli":"^2.27.1","@commitlint/cli":"^18.6.1","@commitlint/config-conventional":"^18.6.2",eslint:"^8.56.0",fdir:"^6.1.1",prettier:"^3.2.5",termost:"^0.12.0",turbo:"^1.12.4",typescript:"^5.3.3"}};var J=e=>{e.command({name:"create",description:"Scaffold a new project"}).task({handler(){u({title:`I'm Stack v${X.version}, your bot assistant`,description:"I can guarantee you a project creation in under 1 minute \u{1F680}"},{type:"information"})}}).input({key:"inputName",label:"What's your project name?",type:"text"}).input({key:"inputDescription",label:"How would you describe it?",type:"text"}).input({key:"inputUrl",label:"Where will it be stored? (Git remote URL)",type:"text"}).task({label:g("Checking pre-requisites"),async handler(){await D()}}).task({key:"data",label:g("Evaluating contextual data"),async handler({inputDescription:t,inputName:r,inputUrl:o}){let n=(await E.get("https://resolve-node.vercel.app/lts","text")).replace("v",""),y=(await E.get("https://registry.npmjs.org/pnpm/latest","json")).version,{repoName:a,repoOwner:c}=(o.startsWith("git")?/^git@.*:(?<repoOwner>.*)\/(?<repoName>.*)\.git$/:/^https?:\/\/.*\/(?<repoOwner>.*)\/(?<repoName>.*)\.git$/).exec(o)?.groups??{};if(!c||!a)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{licenseYear:new Date().getFullYear().toString(),nodeVersion:n,npmVersion:y,projectDescription:t.charAt(0).toUpperCase()+t.slice(1),projectName:r.toLowerCase(),projectUrl:o,repoId:`${c}/${a}`}}}).task({label({data:t}){return g(`Creating \`${t.projectName}\` folder`)},async handler({data:t}){let r=(0,z.resolve)(process.cwd(),t.projectName);await(0,w.mkdir)(r),process.chdir(r)}}).task({label:g("Initializing `git`"),async handler({data:t}){await d.helpers.exec("git init"),await d.helpers.exec(`git remote add origin ${t.projectUrl}`)}}).task({label:g("Applying template"),handler({data:t}){we(t)}}).task({label:g("Installing dependencies"),async handler({data:t}){let r=["quickbundle","vitest"],o=["@adbayb/eslint-config","@adbayb/prettier-config","@adbayb/ts-config","@adbayb/stack"];try{await d.helpers.exec(`pnpm add ${o.join(" ")} --save-dev --ignore-workspace-root-check`),await d.helpers.exec(`pnpm add ${r.join(" ")} --save-dev --filter ${t.projectName}`)}catch(n){throw s("pnpm",n)}}}).task({key:"error",label:g("Cleaning up"),async handler({data:t}){try{await(0,w.symlink)(`./${t.projectName}/README.md`,"./README.md"),await A(),await d.helpers.exec("stack install"),await d.helpers.exec("git add -A"),await d.helpers.exec('git commit -m "chore: initial commit"');return}catch(r){return r}}}).task({handler({data:t,error:r}){if(r){u({title:"Oops, an error occurred",description:"Keep calm and carry on with some coffee \u2615\uFE0F",body:String(r)},{type:"error"});return}u({title:"The project was successfully created",description:`Run \`cd ./${t.projectName}\` and Enjoy \u{1F680}`},{type:"success"})}})},g=e=>`${e} \u{1F528}`,we=e=>{let t=".tmpl",r=I("./template"),o=p("./"),n=/{{(.*?)}}/g,y=a=>a.replace(n,(c,h)=>e[h]||"");(0,l.cpSync)(r,o,{force:!0,recursive:!0}),new S.fdir().withBasePath().glob(`**/*${t}`).crawl(o).sync().forEach(a=>{let c=a.slice(0,a.lastIndexOf(t)),h=y((0,l.readFileSync)(a,"utf-8"));(0,l.renameSync)(a,c),(0,l.writeFileSync)(c,h,"utf-8")}),new S.fdir().withBasePath().onlyDirs().filter(a=>!!n.exec(a)).crawl(o).sync().sort((a,c)=>c.length-a.length).forEach(a=>{let c=a.replace(n,(h,ie)=>e[ie]);(0,l.renameSync)(a,c)})};var K=e=>{e.command({name:"fix",description:"Fix auto-fixable issues"}).task({label:N("Preparing the project"),async handler(){await i("build",{hasLiveOutput:!1})}}).task({label:N("Fixing lints"),async handler(t,r){await M(r.operands)}}).task({label:N("Fixing formatting"),async handler(t,r){await B(r.operands)}})},N=e=>`${e} \u{1F691}`;var C=require("fs/promises");var ee=e=>{e.command({name:"install",description:"Setup initial requirements"}).task({label:Q("Installing `git.pre-commit` hook"),async handler(){await Z("pre-commit",`${$(`fix $(git status --porcelain | awk 'BEGIN{ ORS=" " } { print $2 }')`,!1)} && git add -A`)}}).task({label:Q("Installing `git.commit-msg` hook"),async handler(){await Z("commit-msg",`${$("check --only commit",!1)}`)}})},Q=e=>`${e} \u{1F4F2}`,Z=async(e,t)=>{let r=p(`.git/hooks/${e}`);return await(0,C.writeFile)(r,t),(0,C.chmod)(r,"0755")};var j=require("termost");var te=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({async handler(){j.helpers.message(`New changelog entry
11
+ `,{type:"information"})},skip({files:t}){return t.length===0}})},Y=e=>`${e} \u{1F9F9}`,ue=async e=>x.helpers.exec(`rm -rf ${e.join(" ")}`),fe=e=>(0,k.existsSync)(e)&&(0,k.readdirSync)(e).length>0,be=async()=>(await x.helpers.exec(`git clean -fdXn | grep -v '${ke.join("\\|")}' | cut -c 14-`)).split(/\n/).filter(Boolean),ke=["node_modules",".turbo"];var S=require("fdir"),l=require("fs"),w=require("fs/promises"),z=require("path"),d=require("termost");var X={name:"@adbayb/stack",version:"1.16.1",description:"My opinionated toolchain",publishConfig:{access:"public"},files:["bin","dist","template"],bin:{stack:"bin/index.cjs"},source:"src/index.ts",main:"dist/index.cjs",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.5.0","@changesets/cli":"^2.27.1","@commitlint/cli":"^18.6.1","@commitlint/config-conventional":"^18.6.2",eslint:"^8.56.0",fdir:"^6.1.1",prettier:"^3.2.5",termost:"^0.12.0",turbo:"^1.12.4",typescript:"^5.3.3"}};var J=e=>{e.command({name:"create",description:"Scaffold a new project"}).task({handler(){u({title:`I'm Stack v${X.version}, your bot assistant`,description:"I can guarantee you a project creation in under 1 minute \u{1F680}"},{type:"information"})}}).input({key:"inputName",label:"What's your project name?",type:"text"}).input({key:"inputDescription",label:"How would you describe it?",type:"text"}).input({key:"inputUrl",label:"Where will it be stored? (Git remote URL)",type:"text"}).task({label:g("Checking pre-requisites"),async handler(){await D()}}).task({key:"data",label:g("Evaluating contextual data"),async handler({inputDescription:t,inputName:r,inputUrl:o}){let n=(await E.get("https://resolve-node.vercel.app/lts","text")).replace("v",""),y=(await E.get("https://registry.npmjs.org/pnpm/latest","json")).version,{repoName:a,repoOwner:c}=(o.startsWith("git")?/^git@.*:(?<repoOwner>.*)\/(?<repoName>.*)\.git$/:/^https?:\/\/.*\/(?<repoOwner>.*)\/(?<repoName>.*)\.git$/).exec(o)?.groups??{};if(!c||!a)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{licenseYear:new Date().getFullYear().toString(),nodeVersion:n,npmVersion:y,projectDescription:t.charAt(0).toUpperCase()+t.slice(1),projectName:r.toLowerCase(),projectUrl:o,repoId:`${c}/${a}`}}}).task({label({data:t}){return g(`Creating \`${t.projectName}\` folder`)},async handler({data:t}){let r=(0,z.resolve)(process.cwd(),t.projectName);await(0,w.mkdir)(r),process.chdir(r)}}).task({label:g("Initializing `git`"),async handler({data:t}){await d.helpers.exec("git init"),await d.helpers.exec(`git remote add origin ${t.projectUrl}`)}}).task({label:g("Applying template"),handler({data:t}){we(t)}}).task({label:g("Installing dependencies"),async handler({data:t}){let r=["quickbundle","vitest"],o=["@adbayb/eslint-config","@adbayb/prettier-config","@adbayb/ts-config","@adbayb/stack"];try{await d.helpers.exec(`pnpm add ${o.join(" ")} --save-dev --ignore-workspace-root-check`),await d.helpers.exec(`pnpm add ${r.join(" ")} --save-dev --filter ${t.projectName}`)}catch(n){throw s("pnpm",n)}}}).task({key:"error",label:g("Cleaning up"),async handler({data:t}){try{await(0,w.symlink)(`./${t.projectName}/README.md`,"./README.md"),await A(),await d.helpers.exec("stack install"),await d.helpers.exec("git add -A"),await d.helpers.exec('git commit -m "chore: initial commit"');return}catch(r){return r}}}).task({handler({data:t,error:r}){if(r){u({title:"Oops, an error occurred",description:"Keep calm and carry on with some coffee \u2615\uFE0F",body:String(r)},{type:"error"});return}u({title:"The project was successfully created",description:`Run \`cd ./${t.projectName}\` and Enjoy \u{1F680}`},{type:"success"})}})},g=e=>`${e} \u{1F528}`,we=e=>{let t=".tmpl",r=I("./template"),o=p("./"),n=/{{(.*?)}}/g,y=a=>a.replace(n,(c,h)=>e[h]||"");(0,l.cpSync)(r,o,{force:!0,recursive:!0}),new S.fdir().withBasePath().glob(`**/*${t}`).crawl(o).sync().forEach(a=>{let c=a.slice(0,a.lastIndexOf(t)),h=y((0,l.readFileSync)(a,"utf-8"));(0,l.renameSync)(a,c),(0,l.writeFileSync)(c,h,"utf-8")}),new S.fdir().withBasePath().onlyDirs().filter(a=>!!n.exec(a)).crawl(o).sync().sort((a,c)=>c.length-a.length).forEach(a=>{let c=a.replace(n,(h,ie)=>e[ie]);(0,l.renameSync)(a,c)})};var K=e=>{e.command({name:"fix",description:"Fix auto-fixable issues"}).task({label:N("Preparing the project"),async handler(){await i("build",{hasLiveOutput:!1})}}).task({label:N("Fixing lints"),async handler(t,r){await M(r.operands)}}).task({label:N("Fixing formatting"),async handler(t,r){await B(r.operands)}})},N=e=>`${e} \u{1F691}`;var C=require("fs/promises");var ee=e=>{e.command({name:"install",description:"Setup initial requirements"}).task({label:Q("Installing `git.pre-commit` hook"),async handler(){await Z("pre-commit",`${$(`fix $(git status --porcelain | awk 'BEGIN{ ORS=" " } { print $2 }')`,!1)} && git add -A`)}}).task({label:Q("Installing `git.commit-msg` hook"),async handler(){await Z("commit-msg",`${$("check --only commit",!1)}`)}})},Q=e=>`${e} \u{1F4F2}`,Z=async(e,t)=>{let r=p(`.git/hooks/${e}`);return await(0,C.writeFile)(r,t),(0,C.chmod)(r,"0755")};var j=require("termost");var te=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({async handler(){j.helpers.message(`New changelog entry
12
12
  `),await f("changeset")},skip:R("log")}).task({async handler(){j.helpers.message(`Bumping the package(s) version
13
13
  `),await f("changeset version && pnpm install --no-frozen-lockfile")},skip:R("tag")}).task({async handler(){j.helpers.message(`Publishing package(s) to the registry
14
14
  `),await f("stack build && pnpm changeset publish")},skip:R("publish")})},R=e=>t=>!t[e];var re=e=>{e.command({name:"start",description:"Start the project in production mode"}).task({async handler(){await i("start")}})};var oe=e=>{e.command({name:"test",description:"Test the code execution"}).task({async handler(){await i("test")}})};var ne=e=>{e.command({name:"watch",description:"Build and start the project in development mode"}).task({async handler(){await i("watch")}})};var Ce=(...e)=>{let t=(0,ae.termost)({name:"stack",description:"Toolbox to easily scaffold and maintain a project"});for(let r of e)r(t)};Ce(J,ee,H,U,K,re,W,ne,oe,te);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/helpers.ts", "../src/commands/build.ts", "../src/commands/check.ts", "../src/commands/clean.ts", "../src/commands/create.ts", "../package.json", "../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 { createCheckCommand } from \"./commands/check\";\nimport { createCleanCommand } from \"./commands/clean\";\nimport { createCreateCommand } from \"./commands/create\";\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: 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 { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\n\n/**\n * Helper to format log messages with a welcoming bot.\n * @param input - Message factory.\n * @param input.title - Title input.\n * @param input.description - Description input.\n * @param input.body - Body input.\n * @param options - Formatting option.\n * @example\n * botMessage(\n *\t{\n * \t\ttitle: \"Oops, an error occurred\",\n * \t\tdescription:\n * \t\t\t\"Keep calm and carry on with some coffee \u2615\uFE0F\",\n * \t\tbody: String(previousTaskError),\n * \t},\n * \t{\n * \t\ttype: \"error\",\n * \t},\n * );\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 * @example\n * resolveFromProjectDirectory(\".gitignore\");\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 * @example\n * resolveFromStackDirectory(\"./templates\");\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${String(\n\t\t\t\terror,\n\t\t\t)}`,\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 = async () => {\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) {\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 (\n\t\t\tresponseType === \"text\" ? response.text() : response.json()\n\t\t) as Promise<\n\t\t\tResponseType extends \"text\" ? string : Record<string, string>\n\t\t>;\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 ${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 = 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(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 () => {\n\ttry {\n\t\treturn await helpers.exec(\"pnpm --parallel exec tsc --noEmit\");\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${String(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 = string[];\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"build\");\n\t\t\t},\n\t\t});\n};\n", "import { checkCommit, checkLints, checkTypes, turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t\tskip({ only }) {\n\t\t\t\treturn only === \"commit\"; // No need to build if only commitlint is run\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking linters\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tconst filenames = argv.operands;\n\n\t\t\t\tawait checkLints(filenames);\n\t\t\t},\n\t\t\tskip: ifOnlyDefinedAndNotEqualTo(\"lint\"),\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking types\"),\n\t\t\tasync handler() {\n\t\t\t\tawait checkTypes();\n\t\t\t},\n\t\t\tskip(context, argv) {\n\t\t\t\treturn (\n\t\t\t\t\tifOnlyDefinedAndNotEqualTo(\"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})\n\t\t.task({\n\t\t\tlabel: label(\"Checking commit\"),\n\t\t\tasync handler() {\n\t\t\t\tawait checkCommit();\n\t\t\t},\n\t\t\tskip({ only }) {\n\t\t\t\treturn only !== \"commit\";\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDD0`;\n\nconst ifOnlyDefinedAndNotEqualTo =\n\t(only: Only) => (context: CommandContext) => {\n\t\treturn context.only !== undefined && context.only !== only;\n\t};\n", "import { existsSync, readdirSync } from \"node:fs\";\nimport { helpers } from \"termost\";\n\nimport { resolveFromProjectDirectory } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tfiles: 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\tasync handler() {\n\t\t\t\tconst cachePath = \"node_modules/.cache\";\n\t\t\t\tconst files = await retrieveIgnoredFiles();\n\n\t\t\t\tif (\n\t\t\t\t\tisDirectoryExistAndNotEmpty(\n\t\t\t\t\t\tresolveFromProjectDirectory(cachePath),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfiles.push(cachePath);\n\t\t\t\t}\n\n\t\t\t\treturn files;\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\tasync handler({ files }) {\n\t\t\t\tif (files.length === 0) return;\n\n\t\t\t\tawait cleanFiles(files);\n\t\t\t},\n\t\t})\n\t\t.task({\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\tskip({ files }) {\n\t\t\t\treturn files.length === 0;\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDF9`;\n\nconst cleanFiles = async (files: string[]) => {\n\treturn helpers.exec(`rm -rf ${files.join(\" \")}`);\n};\n\nconst isDirectoryExistAndNotEmpty = (path: string) => {\n\treturn existsSync(path) && readdirSync(path).length > 0;\n};\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 PRESERVE_FILES = [\"node_modules\", \".turbo\"];\n", "import { fdir } from \"fdir\";\nimport { cpSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { mkdir, symlink } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\n\nimport pkg from \"../../package.json\";\nimport {\n\tbotMessage,\n\tcreateError,\n\tgetNpmVersion,\n\trequest,\n\tresolveFromProjectDirectory,\n\tresolveFromStackDirectory,\n\tsetPkgManager,\n} from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tdata: Record<\n\t\t| \"licenseYear\"\n\t\t| \"nodeVersion\"\n\t\t| \"npmVersion\"\n\t\t| \"projectDescription\"\n\t\t| \"projectName\"\n\t\t| \"projectUrl\"\n\t\t| \"repoId\",\n\t\tstring\n\t>;\n\terror: Error | undefined;\n\tinputDescription: string;\n\tinputName: string;\n\tinputUrl: string;\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\tkey: \"inputName\",\n\t\t\tlabel: \"What's your project name?\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.input({\n\t\t\tkey: \"inputDescription\",\n\t\t\tlabel: \"How would you describe it?\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.input({\n\t\t\tkey: \"inputUrl\",\n\t\t\tlabel: \"Where will it be stored? (Git remote URL)\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking pre-requisites\"),\n\t\t\tasync handler() {\n\t\t\t\t// Check pnpm availability by verifying its version\n\t\t\t\tawait 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 = (\n\t\t\t\t\tawait request.get(\n\t\t\t\t\t\t\"https://resolve-node.vercel.app/lts\",\n\t\t\t\t\t\t\"text\",\n\t\t\t\t\t)\n\t\t\t\t).replace(\"v\", \"\");\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 { repoName, repoOwner } =\n\t\t\t\t\t(inputUrl.startsWith(\"git\")\n\t\t\t\t\t\t? /^git@.*:(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t\t: /^https?:\\/\\/.*\\/(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t).exec(inputUrl)?.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\tlicenseYear: new Date().getFullYear().toString(),\n\t\t\t\t\tnodeVersion,\n\t\t\t\t\tnpmVersion,\n\t\t\t\t\tprojectDescription:\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\tprojectName: inputName.toLowerCase(), // Enforce lower case for folder and package name\n\t\t\t\t\tprojectUrl: inputUrl,\n\t\t\t\t\trepoId: `${repoOwner}/${repoName}`,\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.projectName}\\` folder`);\n\t\t\t},\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst projectPath = resolve(process.cwd(), data.projectName);\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.projectUrl}`);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Applying template\"),\n\t\t\thandler({ data }) {\n\t\t\t\tapplyTemplate(data);\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.projectName}`,\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\tkey: \"error\",\n\t\t\tlabel: label(\"Cleaning up\"),\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.projectName}/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({ data, error }) {\n\t\t\t\tif (error) {\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(error),\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.projectName}\\` 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 dataModel - Data model mapping the template expression key with its corresponding value.\n * @example\n * applyTemplate(\n * \t{ toReplace: \"value\" },\n * );\n */\nconst applyTemplate = (dataModel: CommandContext[\"data\"]) => {\n\tconst templateExtension = \".tmpl\";\n\tconst templateRootPath = resolveFromStackDirectory(\"./template\");\n\tconst projectRootPath = resolveFromProjectDirectory(\"./\");\n\tconst templateExpressionRegExp = /{{(.*?)}}/g;\n\n\tconst evaluate = (content: string) => {\n\t\treturn content.replace(\n\t\t\ttemplateExpressionRegExp,\n\t\t\t(_, key: keyof CommandContext[\"data\"]) => dataModel[key] || \"\",\n\t\t);\n\t};\n\n\t/** Copy the template before mutations. */\n\tcpSync(templateRootPath, projectRootPath, {\n\t\tforce: true,\n\t\trecursive: true,\n\t});\n\n\t/** Template file mutations. */\n\tnew fdir()\n\t\t.withBasePath()\n\t\t.glob(`**/*${templateExtension}`)\n\t\t.crawl(projectRootPath)\n\t\t.sync()\n\t\t.forEach((templateFilePath) => {\n\t\t\tconst projectFilePath = templateFilePath.slice(\n\t\t\t\t0,\n\t\t\t\ttemplateFilePath.lastIndexOf(templateExtension),\n\t\t\t);\n\n\t\t\tconst content = evaluate(readFileSync(templateFilePath, \"utf-8\"));\n\n\t\t\trenameSync(templateFilePath, projectFilePath);\n\t\t\twriteFileSync(projectFilePath, content, \"utf-8\");\n\t\t});\n\n\t/** Template folder mutations. */\n\tnew fdir()\n\t\t.withBasePath()\n\t\t.onlyDirs()\n\t\t.filter((path) => {\n\t\t\treturn Boolean(templateExpressionRegExp.exec(path));\n\t\t})\n\t\t.crawl(projectRootPath)\n\t\t.sync()\n\t\t// Re-order from longest to lowest path length to apply first renaming operations on deepest file structure\n\t\t.sort((a, b) => b.length - a.length)\n\t\t.forEach((templateFolderPath) => {\n\t\t\tconst newPath = templateFolderPath.replace(\n\t\t\t\ttemplateExpressionRegExp,\n\t\t\t\t(_, dataModelKey) => {\n\t\t\t\t\treturn dataModel[dataModelKey as keyof typeof dataModel];\n\t\t\t\t},\n\t\t\t);\n\n\t\t\trenameSync(templateFolderPath, newPath);\n\t\t});\n};\n", "{\n\t\"name\": \"@adbayb/stack\",\n\t\"version\": \"1.16.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\"template\"\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.cjs\",\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.5.0\",\n\t\t\"@changesets/cli\": \"^2.27.1\",\n\t\t\"@commitlint/cli\": \"^18.6.1\",\n\t\t\"@commitlint/config-conventional\": \"^18.6.2\",\n\t\t\"eslint\": \"^8.56.0\",\n\t\t\"fdir\": \"^6.1.1\",\n\t\t\"prettier\": \"^3.2.5\",\n\t\t\"termost\": \"^0.12.0\",\n\t\t\"turbo\": \"^1.12.4\",\n\t\t\"typescript\": \"^5.3.3\"\n\t}\n}\n", "import { fixFormatting, fixLints, turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait 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\tasync handler(_, argv) {\n\t\t\t\tawait fixLints(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing formatting\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait 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 { changeset } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\thelpers.message(\"New changelog entry\\n\");\n\n\t\t\t\tawait changeset(\"changeset\");\n\t\t\t},\n\t\t\tskip: ifNotEqualTo(\"log\"),\n\t\t})\n\t\t.task({\n\t\t\tasync handler() {\n\t\t\t\thelpers.message(\"Bumping the package(s) version\\n\");\n\n\t\t\t\tawait 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\tskip: ifNotEqualTo(\"tag\"),\n\t\t})\n\t\t.task({\n\t\t\tasync handler() {\n\t\t\t\thelpers.message(\"Publishing package(s) to the registry\\n\");\n\n\t\t\t\tawait changeset(\"stack build && pnpm changeset publish\");\n\t\t\t},\n\t\t\tskip: ifNotEqualTo(\"publish\"),\n\t\t});\n};\n\nconst ifNotEqualTo =\n\t(validOption: keyof CommandContext) => (context: CommandContext) => {\n\t\treturn !context[validOption];\n\t};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait turbo(\"test\");\n\t\t\t},\n\t\t});\n};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"watch\");\n\t\t\t},\n\t\t});\n};\n"],
4
+ "sourcesContent": ["#!/usr/bin/env node\n\nimport { termost } from \"termost\";\n\nimport { createBuildCommand } from \"./commands/build\";\nimport { createCheckCommand } from \"./commands/check\";\nimport { createCleanCommand } from \"./commands/clean\";\nimport { createCreateCommand } from \"./commands/create\";\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: 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 { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\n\n/**\n * Helper to format log messages with a welcoming bot.\n * @param input - Message factory.\n * @param input.title - Title input.\n * @param input.description - Description input.\n * @param input.body - Body input.\n * @param options - Formatting option.\n * @example\n * botMessage(\n *\t{\n * \t\ttitle: \"Oops, an error occurred\",\n * \t\tdescription:\n * \t\t\t\"Keep calm and carry on with some coffee \u2615\uFE0F\",\n * \t\tbody: String(previousTaskError),\n * \t},\n * \t{\n * \t\ttype: \"error\",\n * \t},\n * );\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 * @example\n * resolveFromProjectDirectory(\".gitignore\");\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 * @example\n * resolveFromStackDirectory(\"./templates\");\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${String(\n\t\t\t\terror,\n\t\t\t)}`,\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 = async () => {\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) {\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 (\n\t\t\tresponseType === \"text\" ? response.text() : response.json()\n\t\t) as Promise<\n\t\t\tResponseType extends \"text\" ? string : Record<string, string>\n\t\t>;\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 ${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 = 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(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 () => {\n\ttry {\n\t\treturn await helpers.exec(\"pnpm --parallel exec tsc --noEmit\");\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${String(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 = string[];\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"build\");\n\t\t\t},\n\t\t});\n};\n", "import { checkCommit, checkLints, checkTypes, turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"build\", { hasLiveOutput: false });\n\t\t\t},\n\t\t\tskip({ only }) {\n\t\t\t\treturn only === \"commit\"; // No need to build if only commitlint is run\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking linters\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tconst filenames = argv.operands;\n\n\t\t\t\tawait checkLints(filenames);\n\t\t\t},\n\t\t\tskip: ifOnlyDefinedAndNotEqualTo(\"lint\"),\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking types\"),\n\t\t\tasync handler() {\n\t\t\t\tawait checkTypes();\n\t\t\t},\n\t\t\tskip(context, argv) {\n\t\t\t\treturn (\n\t\t\t\t\tifOnlyDefinedAndNotEqualTo(\"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})\n\t\t.task({\n\t\t\tlabel: label(\"Checking commit\"),\n\t\t\tasync handler() {\n\t\t\t\tawait checkCommit();\n\t\t\t},\n\t\t\tskip({ only }) {\n\t\t\t\treturn only !== \"commit\";\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDD0`;\n\nconst ifOnlyDefinedAndNotEqualTo =\n\t(only: Only) => (context: CommandContext) => {\n\t\treturn context.only !== undefined && context.only !== only;\n\t};\n", "import { existsSync, readdirSync } from \"node:fs\";\nimport { helpers } from \"termost\";\n\nimport { resolveFromProjectDirectory } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tfiles: 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\tasync handler() {\n\t\t\t\tconst cachePath = \"node_modules/.cache\";\n\t\t\t\tconst files = await retrieveIgnoredFiles();\n\n\t\t\t\tif (\n\t\t\t\t\tisDirectoryExistAndNotEmpty(\n\t\t\t\t\t\tresolveFromProjectDirectory(cachePath),\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tfiles.push(cachePath);\n\t\t\t\t}\n\n\t\t\t\treturn files;\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\tasync handler({ files }) {\n\t\t\t\tif (files.length === 0) return;\n\n\t\t\t\tawait cleanFiles(files);\n\t\t\t},\n\t\t})\n\t\t.task({\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\tskip({ files }) {\n\t\t\t\treturn files.length === 0;\n\t\t\t},\n\t\t});\n};\n\nconst label = (message: string) => `${message} \uD83E\uDDF9`;\n\nconst cleanFiles = async (files: string[]) => {\n\treturn helpers.exec(`rm -rf ${files.join(\" \")}`);\n};\n\nconst isDirectoryExistAndNotEmpty = (path: string) => {\n\treturn existsSync(path) && readdirSync(path).length > 0;\n};\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 PRESERVE_FILES = [\"node_modules\", \".turbo\"];\n", "import { fdir } from \"fdir\";\nimport { cpSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { mkdir, symlink } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport { helpers } from \"termost\";\n\nimport pkg from \"../../package.json\";\nimport {\n\tbotMessage,\n\tcreateError,\n\tgetNpmVersion,\n\trequest,\n\tresolveFromProjectDirectory,\n\tresolveFromStackDirectory,\n\tsetPkgManager,\n} from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\n\ntype CommandContext = {\n\tdata: Record<\n\t\t| \"licenseYear\"\n\t\t| \"nodeVersion\"\n\t\t| \"npmVersion\"\n\t\t| \"projectDescription\"\n\t\t| \"projectName\"\n\t\t| \"projectUrl\"\n\t\t| \"repoId\",\n\t\tstring\n\t>;\n\terror: Error | undefined;\n\tinputDescription: string;\n\tinputName: string;\n\tinputUrl: string;\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\tkey: \"inputName\",\n\t\t\tlabel: \"What's your project name?\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.input({\n\t\t\tkey: \"inputDescription\",\n\t\t\tlabel: \"How would you describe it?\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.input({\n\t\t\tkey: \"inputUrl\",\n\t\t\tlabel: \"Where will it be stored? (Git remote URL)\",\n\t\t\ttype: \"text\",\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Checking pre-requisites\"),\n\t\t\tasync handler() {\n\t\t\t\t// Check pnpm availability by verifying its version\n\t\t\t\tawait 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 = (\n\t\t\t\t\tawait request.get(\n\t\t\t\t\t\t\"https://resolve-node.vercel.app/lts\",\n\t\t\t\t\t\t\"text\",\n\t\t\t\t\t)\n\t\t\t\t).replace(\"v\", \"\");\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 { repoName, repoOwner } =\n\t\t\t\t\t(inputUrl.startsWith(\"git\")\n\t\t\t\t\t\t? /^git@.*:(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t\t: /^https?:\\/\\/.*\\/(?<repoOwner>.*)\\/(?<repoName>.*)\\.git$/\n\t\t\t\t\t).exec(inputUrl)?.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\tlicenseYear: new Date().getFullYear().toString(),\n\t\t\t\t\tnodeVersion,\n\t\t\t\t\tnpmVersion,\n\t\t\t\t\tprojectDescription:\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\tprojectName: inputName.toLowerCase(), // Enforce lower case for folder and package name\n\t\t\t\t\tprojectUrl: inputUrl,\n\t\t\t\t\trepoId: `${repoOwner}/${repoName}`,\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.projectName}\\` folder`);\n\t\t\t},\n\t\t\tasync handler({ data }) {\n\t\t\t\tconst projectPath = resolve(process.cwd(), data.projectName);\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.projectUrl}`);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Applying template\"),\n\t\t\thandler({ data }) {\n\t\t\t\tapplyTemplate(data);\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.projectName}`,\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\tkey: \"error\",\n\t\t\tlabel: label(\"Cleaning up\"),\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.projectName}/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({ data, error }) {\n\t\t\t\tif (error) {\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(error),\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.projectName}\\` 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 dataModel - Data model mapping the template expression key with its corresponding value.\n * @example\n * applyTemplate(\n * \t{ toReplace: \"value\" },\n * );\n */\nconst applyTemplate = (dataModel: CommandContext[\"data\"]) => {\n\tconst templateExtension = \".tmpl\";\n\tconst templateRootPath = resolveFromStackDirectory(\"./template\");\n\tconst projectRootPath = resolveFromProjectDirectory(\"./\");\n\tconst templateExpressionRegExp = /{{(.*?)}}/g;\n\n\tconst evaluate = (content: string) => {\n\t\treturn content.replace(\n\t\t\ttemplateExpressionRegExp,\n\t\t\t(_, key: keyof CommandContext[\"data\"]) => dataModel[key] || \"\",\n\t\t);\n\t};\n\n\t/** Copy the template before mutations. */\n\tcpSync(templateRootPath, projectRootPath, {\n\t\tforce: true,\n\t\trecursive: true,\n\t});\n\n\t/** Template file mutations. */\n\tnew fdir()\n\t\t.withBasePath()\n\t\t.glob(`**/*${templateExtension}`)\n\t\t.crawl(projectRootPath)\n\t\t.sync()\n\t\t.forEach((templateFilePath) => {\n\t\t\tconst projectFilePath = templateFilePath.slice(\n\t\t\t\t0,\n\t\t\t\ttemplateFilePath.lastIndexOf(templateExtension),\n\t\t\t);\n\n\t\t\tconst content = evaluate(readFileSync(templateFilePath, \"utf-8\"));\n\n\t\t\trenameSync(templateFilePath, projectFilePath);\n\t\t\twriteFileSync(projectFilePath, content, \"utf-8\");\n\t\t});\n\n\t/** Template folder mutations. */\n\tnew fdir()\n\t\t.withBasePath()\n\t\t.onlyDirs()\n\t\t.filter((path) => {\n\t\t\treturn Boolean(templateExpressionRegExp.exec(path));\n\t\t})\n\t\t.crawl(projectRootPath)\n\t\t.sync()\n\t\t// Re-order from longest to lowest path length to apply first renaming operations on deepest file structure\n\t\t.sort((a, b) => b.length - a.length)\n\t\t.forEach((templateFolderPath) => {\n\t\t\tconst newPath = templateFolderPath.replace(\n\t\t\t\ttemplateExpressionRegExp,\n\t\t\t\t(_, dataModelKey) => {\n\t\t\t\t\treturn dataModel[dataModelKey as keyof typeof dataModel];\n\t\t\t\t},\n\t\t\t);\n\n\t\t\trenameSync(templateFolderPath, newPath);\n\t\t});\n};\n", "{\n\t\"name\": \"@adbayb/stack\",\n\t\"version\": \"1.16.1\",\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\"template\"\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.cjs\",\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.5.0\",\n\t\t\"@changesets/cli\": \"^2.27.1\",\n\t\t\"@commitlint/cli\": \"^18.6.1\",\n\t\t\"@commitlint/config-conventional\": \"^18.6.2\",\n\t\t\"eslint\": \"^8.56.0\",\n\t\t\"fdir\": \"^6.1.1\",\n\t\t\"prettier\": \"^3.2.5\",\n\t\t\"termost\": \"^0.12.0\",\n\t\t\"turbo\": \"^1.12.4\",\n\t\t\"typescript\": \"^5.3.3\"\n\t}\n}\n", "import { fixFormatting, fixLints, turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait 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\tasync handler(_, argv) {\n\t\t\t\tawait fixLints(argv.operands);\n\t\t\t},\n\t\t})\n\t\t.task({\n\t\t\tlabel: label(\"Fixing formatting\"),\n\t\t\tasync handler(_, argv) {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait 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 { changeset } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\thelpers.message(\"New changelog entry\\n\");\n\n\t\t\t\tawait changeset(\"changeset\");\n\t\t\t},\n\t\t\tskip: ifNotEqualTo(\"log\"),\n\t\t})\n\t\t.task({\n\t\t\tasync handler() {\n\t\t\t\thelpers.message(\"Bumping the package(s) version\\n\");\n\n\t\t\t\tawait 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\tskip: ifNotEqualTo(\"tag\"),\n\t\t})\n\t\t.task({\n\t\t\tasync handler() {\n\t\t\t\thelpers.message(\"Publishing package(s) to the registry\\n\");\n\n\t\t\t\tawait changeset(\"stack build && pnpm changeset publish\");\n\t\t\t},\n\t\t\tskip: ifNotEqualTo(\"publish\"),\n\t\t});\n};\n\nconst ifNotEqualTo =\n\t(validOption: keyof CommandContext) => (context: CommandContext) => {\n\t\treturn !context[validOption];\n\t};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait 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\tasync handler() {\n\t\t\t\tawait turbo(\"test\");\n\t\t\t},\n\t\t});\n};\n", "import { turbo } from \"../helpers\";\nimport type { CommandFactory } from \"../types\";\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\tasync handler() {\n\t\t\t\tawait turbo(\"watch\");\n\t\t\t},\n\t\t});\n};\n"],
5
5
  "mappings": ";qeAEA,IAAAA,GAAwB,mBCFxB,IAAAC,EAA2B,cAC3BC,EAAwB,gBACxBC,EAAwB,mBAsBXC,EAAa,CACzBC,EACAC,IACI,CACJ,UAAQ,QACP;AAAA;AAAA,0BAESD,EAAM;AAAA,WACXC,GAAS,OAAS,QAAU,SAAM,oBAAUD,EAAM;AAAA;AAA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MD,EAAU,uCAAuC,CACxD,EACA,KAAMC,EAAa,SAAS,CAC7B,CAAC,CACH,EAEMA,EACJC,GAAuCC,GAChC,CAACA,EAAQD,CAAW,EC3DtB,IAAME,GAAsCC,GAAY,CAC9DA,EACE,QAAQ,CACR,KAAM,QACN,YAAa,sCACd,CAAC,EACA,KAAK,CACL,MAAM,SAAU,CACf,MAAMC,EAAM,OAAO,CACpB,CACD,CAAC,CACH,ECXO,IAAMC,GAAqCC,GAAY,CAC7DA,EACE,QAAQ,CACR,KAAM,OACN,YAAa,yBACd,CAAC,EACA,KAAK,CACL,MAAM,SAAU,CACf,MAAMC,EAAM,MAAM,CACnB,CACD,CAAC,CACH,ECXO,IAAMC,GAAsCC,GAAY,CAC9DA,EACE,QAAQ,CACR,KAAM,QACN,YAAa,iDACd,CAAC,EACA,KAAK,CACL,MAAM,SAAU,CACf,MAAMC,EAAM,OAAO,CACpB,CACD,CAAC,CACH,EZEA,IAAMC,GAAgB,IAAIC,IAAuC,CAChE,IAAMC,KAAU,YAAQ,CACvB,KAAM,QACN,YAAa,mDACd,CAAC,EAED,QAAWC,KAAkBF,EAC5BE,EAAeD,CAAO,CAExB,EAEAF,GACCI,EACAC,GACAC,EACAC,EACAC,EACAC,GACAC,EACAC,GACAC,GACAC,EACD",
6
6
  "names": ["import_termost", "import_node_fs", "import_node_path", "import_termost", "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", "checkCommit", "bin", "turbo", "changeset", "TYPESCRIPT_EXTENSIONS", "createBuildCommand", "program", "turbo", "onlyValues", "createCheckCommand", "program", "label", "turbo", "only", "_", "argv", "filenames", "checkLints", "ifOnlyDefinedAndNotEqualTo", "checkTypes", "context", "checkCommit", "message", "import_node_fs", "import_termost", "createCleanCommand", "program", "label", "cachePath", "files", "retrieveIgnoredFiles", "isDirectoryExistAndNotEmpty", "resolveFromProjectDirectory", "cleanFiles", "message", "path", "PRESERVE_FILES", "import_fdir", "import_node_fs", "import_promises", "import_node_path", "import_termost", "package_default", "createCreateCommand", "program", "botMessage", "package_default", "label", "getNpmVersion", "inputDescription", "inputName", "inputUrl", "nodeVersion", "request", "npmVersion", "repoName", "repoOwner", "createError", "data", "projectPath", "applyTemplate", "localDevDependencies", "globalDevDependencies", "error", "setPkgManager", "message", "dataModel", "templateExtension", "templateRootPath", "resolveFromStackDirectory", "projectRootPath", "resolveFromProjectDirectory", "templateExpressionRegExp", "evaluate", "content", "_", "key", "templateFilePath", "projectFilePath", "path", "b", "templateFolderPath", "newPath", "dataModelKey", "createFixCommand", "program", "label", "turbo", "_", "argv", "fixLints", "fixFormatting", "message", "import_promises", "createInstallCommand", "program", "label", "installGitHook", "getStackCommand", "message", "hook", "content", "filename", "resolveFromProjectDirectory", "import_termost", "createReleaseCommand", "program", "changeset", "ifNotEqualTo", "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.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "My opinionated toolchain",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -0,0 +1,134 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ lerna-debug.log*
8
+ .pnpm-debug.log*
9
+
10
+ # Diagnostic reports (https://nodejs.org/api/report.html)
11
+ report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12
+
13
+ # Runtime data
14
+ pids
15
+ *.pid
16
+ *.seed
17
+ *.pid.lock
18
+
19
+ # Directory for instrumented libs generated by jscoverage/JSCover
20
+ lib-cov
21
+
22
+ # Coverage directory used by tools like istanbul
23
+ coverage
24
+ *.lcov
25
+
26
+ # nyc test coverage
27
+ .nyc_output
28
+
29
+ # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30
+ .grunt
31
+
32
+ # Bower dependency directory (https://bower.io/)
33
+ bower_components
34
+
35
+ # node-waf configuration
36
+ .lock-wscript
37
+
38
+ # Compiled binary addons (https://nodejs.org/api/addons.html)
39
+ build/Release
40
+
41
+ # Dependency directories
42
+ node_modules/
43
+ jspm_packages/
44
+
45
+ # Snowpack dependency directory (https://snowpack.dev/)
46
+ web_modules/
47
+
48
+ # TypeScript cache
49
+ *.tsbuildinfo
50
+
51
+ # Optional npm cache directory
52
+ .npm
53
+
54
+ # Optional eslint cache
55
+ .eslintcache
56
+
57
+ # Optional stylelint cache
58
+ .stylelintcache
59
+
60
+ # Microbundle cache
61
+ .rpt2_cache/
62
+ .rts2_cache_cjs/
63
+ .rts2_cache_es/
64
+ .rts2_cache_umd/
65
+
66
+ # Optional REPL history
67
+ .node_repl_history
68
+
69
+ # Output of 'npm pack'
70
+ *.tgz
71
+
72
+ # Yarn Integrity file
73
+ .yarn-integrity
74
+
75
+ # dotenv environment variable files
76
+ .env
77
+ .env.development.local
78
+ .env.test.local
79
+ .env.production.local
80
+ .env.local
81
+
82
+ # parcel-bundler cache (https://parceljs.org/)
83
+ .cache
84
+ .parcel-cache
85
+
86
+ # Next.js build output
87
+ .next
88
+ out
89
+
90
+ # Nuxt.js build / generate output
91
+ .nuxt
92
+ dist
93
+
94
+ # Gatsby files
95
+ .cache/
96
+ # Comment in the public line in if your project uses Gatsby and not Next.js
97
+ # https://nextjs.org/blog/next-9-1#public-directory-support
98
+ # public
99
+
100
+ # vuepress build output
101
+ .vuepress/dist
102
+
103
+ # vuepress v2.x temp and cache directory
104
+ .temp
105
+ .cache
106
+
107
+ # Docusaurus cache and generated files
108
+ .docusaurus
109
+
110
+ # Serverless directories
111
+ .serverless/
112
+
113
+ # FuseBox cache
114
+ .fusebox/
115
+
116
+ # DynamoDB Local files
117
+ .dynamodb/
118
+
119
+ # TernJS port file
120
+ .tern-port
121
+
122
+ # Stores VSCode versions used for testing VSCode extensions
123
+ .vscode-test
124
+
125
+ # yarn v2
126
+ .yarn/cache
127
+ .yarn/unplugged
128
+ .yarn/build-state.yml
129
+ .yarn/install-state.gz
130
+ .pnp.*
131
+
132
+ # Others
133
+ .DS_Store
134
+ .turbo
@@ -0,0 +1,7 @@
1
+ save-exact=true
2
+ public-hoist-pattern[]=*changesets*
3
+ public-hoist-pattern[]=*commitlint*
4
+ public-hoist-pattern[]=*eslint*
5
+ public-hoist-pattern[]=*prettier*
6
+ public-hoist-pattern[]=*turbo*
7
+ public-hoist-pattern[]=*typescript*