@decaf-ts/utils 0.4.6 → 0.4.7
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/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/lib/cli/commands/build-scripts.cjs +1 -1
- package/lib/esm/cli/commands/build-scripts.js +1 -1
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +1 -1
- package/bin/build-scripts.cjs +0 -11197
- package/bin/tag-release.cjs +0 -10687
- package/bin/update-scripts.cjs +0 -11150
package/dist/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"prompts";import{parseArgs as t}from"util";import{Logging as o,patchString as a,LoggedClass as s,LoggedEnvironment as n,LogLevel as r}from"@decaf-ts/logging";import i from"fs";import c from"path";import{spawn as l}from"child_process";import{style as g}from"styled-string-builder";import d from"zlib";import f from"https";import{rollup as h}from"rollup";import u from"@rollup/plugin-typescript";import p from"@rollup/plugin-commonjs";import{nodeResolve as m}from"@rollup/plugin-node-resolve";import S from"@rollup/plugin-json";import{builtinModules as y}from"module";import*as w from"typescript";import{ModuleKind as T}from"typescript";class b{static{this.logger=o.for(b)}constructor(e){this.type="text",this.name=e}setType(e){return b.logger.verbose("Setting type to: "+e),this.type=e,this}setMessage(e){return b.logger.verbose("Setting message to: "+e),this.message=e,this}setInitial(e){return b.logger.verbose("Setting initial value to: "+e),this.initial=e,this}setStyle(e){return b.logger.verbose("Setting style to: "+e),this.style=e,this}setFormat(e){return b.logger.verbose("Setting format function"),this.format=e,this}setValidate(e){return b.logger.verbose("Setting validate function"),this.validate=e,this}setOnState(e){return b.logger.verbose("Setting onState callback"),this.onState=e,this}setMin(e){return b.logger.verbose("Setting min value to: "+e),this.min=e,this}setMax(e){return b.logger.verbose("Setting max value to: "+e),this.max=e,this}setFloat(e){return b.logger.verbose("Setting float to: "+e),this.float=e,this}setRound(e){return b.logger.verbose("Setting round to: "+e),this.round=e,this}setInstructions(e){return b.logger.verbose("Setting instructions to: "+e),this.instructions=e,this}setIncrement(e){return b.logger.verbose("Setting increment to: "+e),this.increment=e,this}setSeparator(e){return b.logger.verbose("Setting separator to: "+e),this.separator=e,this}setActive(e){return b.logger.verbose("Setting active style to: "+e),this.active=e,this}setInactive(e){return b.logger.verbose("Setting inactive style to: "+e),this.inactive=e,this}setChoices(e){return b.logger.verbose("Setting choices: "+JSON.stringify(e)),this.choices=e,this}setHint(e){return b.logger.verbose("Setting hint to: "+e),this.hint=e,this}setWarn(e){return b.logger.verbose("Setting warn to: "+e),this.warn=e,this}setSuggest(e){return b.logger.verbose("Setting suggest function"),this.suggest=e,this}setLimit(e){return b.logger.verbose("Setting limit to: "+e),this.limit=e,this}setMask(e){return b.logger.verbose("Setting mask to: "+e),this.mask=e,this}setStdout(e){return b.logger.verbose("Setting stdout stream"),this.stdout=e,this}setStdin(e){return this.stdin=e,this}async ask(){return(await b.ask(this))[this.name]}static async ask(t){const o=b.logger.for(this.ask);let a;Array.isArray(t)||(t=[t]);try{o.verbose("Asking questions: "+t.map(e=>e.name).join(", ")),a=await e(t),o.verbose("Received answers: "+JSON.stringify(a,null,2))}catch(e){throw Error("Error while getting input: "+e)}return a}static async askNumber(e,t,o,a,s){b.logger.for(this.askNumber).verbose(`Asking number input: undefined, question: ${t}, min: ${o}, max: ${a}, initial: ${s}`);const n=new b(e).setMessage(t).setType("number");return"number"==typeof o&&n.setMin(o),"number"==typeof a&&n.setMax(a),"number"==typeof s&&n.setInitial(s),(await this.ask(n))[e]}static async askText(e,t,o=void 0,a){b.logger.for(this.askText).verbose(`Asking text input: undefined, question: ${t}, mask: ${o}, initial: ${a}`);const s=new b(e).setMessage(t);return o&&s.setMask(o),"string"==typeof a&&s.setInitial(a),(await this.ask(s))[e]}static async askConfirmation(e,t,o){b.logger.for(this.askConfirmation).verbose(`Asking confirmation input: undefined, question: ${t}, initial: ${o}`);const a=new b(e).setMessage(t).setType("confirm");return void 0!==o&&a.setInitial(o),(await this.ask(a))[e]}static async insist(e,t,o,a=1){const s=b.logger.for(this.insist);let n;s.verbose(`Insisting on input: ${e.name}, test: ${t.toString()}, defaultConfirmation: ${o}, limit: ${a}`);let r,i=0;try{do{n=(await b.ask(e))[e.name],t(n)?(r=await b.askConfirmation(e.name+"-confirm",`Is the ${e.type} correct?`,o),r||(n=void 0)):n=void 0}while(void 0===n&&a>1&&i++<a)}catch(e){throw s.error("Error while insisting: "+e),e}return void 0===n&&s.info("no selection..."),n}static async insistForText(e,t,o,a=void 0,s,n=!1,r=-1){b.logger.for(this.insistForText).verbose(`Insisting for text input: undefined, question: ${t}, test: ${o.toString()}, mask: ${a}, initial: ${s}, defaultConfirmation: ${n}, limit: ${r}`);const i=new b(e).setMessage(t);return a&&i.setMask(a),"string"==typeof s&&i.setInitial(s),await this.insist(i,o,n,r)}static async insistForNumber(e,t,o,a,s,n,r=!1,i=-1){b.logger.for(this.insistForNumber).verbose(`Insisting for number input: undefined, question: ${t}, test: ${o.toString()}, min: ${a}, max: ${s}, initial: ${n}, defaultConfirmation: ${r}, limit: ${i}`);const c=new b(e).setMessage(t).setType("number");return"number"==typeof a&&c.setMin(a),"number"==typeof s&&c.setMax(s),"number"==typeof n&&c.setInitial(n),await this.insist(c,o,r,i)}static parseArgs(e){const o=b.logger.for(this.parseArgs),a={args:process.argv.slice(2),options:e};o.debug("Parsing arguments: "+JSON.stringify(a,null,2));try{return t(a)}catch(t){throw o.debug(`Error while parsing arguments:\n${JSON.stringify(a,null,2)}\n | options\n${JSON.stringify(e,null,2)}\n | ${t}`),Error("Error while parsing arguments: "+t)}}}const C={verbose:{type:"boolean",short:"V",default:void 0},version:{type:"boolean",short:"v",default:void 0},help:{type:"boolean",short:"h",default:!1},logLevel:{type:"string",default:"info"},logStyle:{type:"boolean",default:!0},timestamp:{type:"boolean",default:!0},banner:{type:"boolean",default:!0}},D=Object.keys(C).reduce((e,t)=>(e[t]=C[t].default,e),{}),v="utf-8",k=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z])))/g;var $;(e=>{e.PATCH="patch",e.MINOR="minor",e.MAJOR="major"})($||($={}));const E="-no-ci",F="postinstall";var I;(e=>{e.GIT=".token",e.NPM=".npmtoken",e.DOCKER=".dockertoken",e.CONFLUENCE=".confluence-token"})(I||(I={}));const x="Aborted";class j{constructor(e,t,...a){this.cmd=e,this.lock=t,this.logger=o.for(this.cmd)}log(e,t){t=Buffer.isBuffer(t)?t.toString(v):t;const o="stderr"===e?g(t).red.text:t;this.logger.info(o)}data(e){this.log("stdout",e+"")}error(e){this.log("stderr",e+"")}errors(e){this.log("stderr","Error executing command exited : "+e)}exit(e,t){this.log("stdout","command exited code : "+(0===e?g(e.toString()).green.text:g(null===e?"null":e.toString()).red.text)),0===e?this.resolve(t.map(e=>e.trim()).join("\n")):this.reject(Error(t.length?t.join("\n"):e.toString()))}parseCommand(e){return e="string"==typeof e?e.split(" "):e,this.cmd=e.join(" "),[e[0],e.slice(1)]}resolve(e){this.log("stdout",`${this.cmd} executed successfully: ${g(e?"ran to completion":e).green}`),this.lock.resolve(e)}reject(e){e instanceof Error||(e=Error("number"==typeof e?"Exit code "+e:e)),this.log("stderr",`${this.cmd} failed to execute: ${g(e.message).red}`),this.lock.reject(e)}}function N(e){let t=Promise.resolve();return(...o)=>{const a=t.then(()=>e(...o));return t=a.catch(()=>{}),a}}function A(e,...t){let o,a;if(e instanceof AbortSignal?(a=new AbortController,o=[e,...t]):(a=e,o=t),a.signal.aborted)return a;const s=()=>a.abort();for(const e of o){if(e.aborted){a.abort();break}e.addEventListener("abort",s,{once:!0,signal:a.signal})}return a}function B(e,t,o,a,s){function n(t,a){const[n,r]=e.parseCommand(t);s.info("Running command: "+n),s.debug("with args: "+r.join(" "));const i=l(n,r,{...o,cwd:o.cwd||process.cwd(),env:Object.assign({},process.env,o.env,{PATH:process.env.PATH}),shell:o.shell||!1,signal:a.signal});return s.verbose("pid : "+i.pid),i}const r=t.match(/[<>$#]/g);if(r)throw Error(`Invalid command: ${t}. contains invalid characters: ${r}`);if(t.includes(" | ")){const e=t.split(" | "),o=[],s=Array(e.length);s[0]=a;for(let t=0;t<e.length;t++)0!==t&&(s[t]=A(s[t-1].signal)),o.push(n(e[t],s[t])),0!==t&&o[t-1].stdout.pipe(o[t].stdin);return o[e.length-1]}return n(t,a)}function O(e,t={},a=j,...s){const n=o.for(O),r=new AbortController,i={abort:r,command:e,logs:[],errs:[]},c=new Promise((o,c)=>{let l;try{l=new a(e,{resolve:o,reject:c},...s),i.cmd=B(l,e,t,r,n)}catch(t){return c(Error(`Error running command ${e}: ${t}`))}i.cmd.stdout.setEncoding("utf8"),i.cmd.stdout.on("data",e=>{e=e.toString(),i.logs.push(e),l.data(e)}),i.cmd.stderr.on("data",e=>{e=e.toString(),i.errs.push(e),l.error(e)}),i.cmd.once("error",e=>{l.exit(e.message,i.errs)}),i.cmd.once("exit",(e=0)=>{r.signal.aborted&&null===e&&(e=x),l.exit(e,0===e?i.logs:i.errs)})});return Object.assign(i,{promise:c,pipe:async t=>{const o=n.for("pipe");try{o.verbose(`Executing pipe function ${e}...`);const a=await c;return o.verbose(`Piping output to ${t.name}: ${a}`),t(a)}catch(e){throw o.error("Error piping command output: "+e),e}}}),i}const P=o.for("fs");function M(e,t){const o=P.for(M);if(!i.existsSync(e))throw Error(`File not found at path "${e}".`);let s=U(e);try{o.verbose(`Patching file "${e}"...`),o.debug("with value: "+JSON.stringify(t)),s=a(s,t)}catch(e){throw Error("Error patching file: "+e)}L(e,s)}function U(e){const t=P.for(U);try{return t.verbose(`Reading file "${e}"...`),i.readFileSync(e,"utf8")}catch(o){throw t.verbose(`Error reading file "${e}": ${o}`),Error(`Error reading file "${e}": ${o}`)}}function L(e,t){const o=P.for(L);try{o.verbose(`Writing file "${e} with ${t.length} bytes...`),i.writeFileSync(e,t,"utf8")}catch(t){throw o.verbose(`Error writing file "${e}": ${t}`),Error(`Error writing file "${e}": ${t}`)}}function J(e,t){const o=P.for(J),a=[];try{return o.verbose(`Retrieving all files from "${e}"...`),i.readdirSync(e).forEach(t=>{const o=c.join(e,t),s=i.statSync(o);s.isFile()?a.push(o):s.isDirectory()&&a.push(...J(o))}),t?a.filter(t):a}catch(t){throw o.verbose(`Error retrieving files from "${e}": ${t}`),Error(`Error retrieving files from "${e}": ${t}`)}}async function R(e,t){const o=P.for(R);let a,s;try{a=i.statSync(e)}catch(t){throw o.verbose(`Source path "${e}" does not exist: ${t}`),Error(`Source path "${e}" does not exist: ${t}`)}try{s=i.statSync(t)}catch(e){}if(s)throw o.verbose(`Destination path "${t}" already exists`),Error(`Destination path "${t}" already exists`);try{o.verbose(`Renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}...`),i.renameSync(e,t),o.verbose(`Successfully renamed to "${t}"`)}catch(s){throw o.verbose(`Error renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}": ${s}`),Error(`Error renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}": ${s}`)}}function W(e,t){const o=P.for(W);let a,s;try{a=i.statSync(e)}catch(t){throw o.verbose(`Source path "${e}" does not exist: ${t}`),Error(`Source path "${e}" does not exist: ${t}`)}try{s=i.statSync(t)}catch(e){a.isDirectory()&&(o.verbose(`Dest path "${t}" does not exist. creating`),i.mkdirSync(t,{recursive:!0}))}try{o.verbose(`Copying ${a.isFile()?"file":"directory"} "${e}" to "${t}...`),i.cpSync(e,t,{recursive:!0})}catch(s){throw o.verbose(`Error copying ${a.isFile()?"file":"directory"} "${e}" to "${t}: ${s}`),Error(`Error copying ${a.isFile()?"file":"directory"} "${e}" to "${t}: ${s}`)}}function G(e){const t=P.for(G);try{const o=i.statSync(e);o.isFile()?(t.verbose(`Deleting file "${e}...`),i.rmSync(e,{recursive:!0,force:!0})):o.isDirectory()&&i.rmSync(e,{recursive:!0,force:!0})}catch(o){throw t.verbose(`Error Deleting "${e}": ${o}`),Error(`Error Deleting "${e}": ${o}`)}}function _(e=process.cwd(),t){let o;try{o=JSON.parse(U(c.join(e,"package.json")))}catch(e){throw Error('Failed to retrieve package information" '+e)}if(t){if(!(t in o))throw Error(`Property "${t}" not found in package.json`);return o[t]}return o}function V(e,t,o=process.cwd()){const a=_(o);a[e]=t,L(c.join(o,"package.json"),JSON.stringify(a,null,2))}function X(e=process.cwd()){return _(e,"version")}async function z(e=process.cwd()){let t;try{t=JSON.parse(await O("npm ls --json",{cwd:e}).promise)}catch(e){throw Error("Failed to retrieve dependencies: "+e)}const o=(e,t)=>({name:e[0],version:e[1].version});return{prod:Object.entries(t.dependencies||{}).map(o),dev:Object.entries(t.devDependencies||{}).map(o),peer:Object.entries(t.peerDependencies||{}).map(o)}}async function H(){const e=P.for(H);e.info("checking for updates..."),await O("npx npm-check-updates -u").promise,e.info("updating..."),await O("npx npm run do-install").promise}async function K(e,t){if(!t){const e=await z();t={prod:e.prod?.map(e=>e.name)||[],dev:e.dev?.map(e=>e.name)||[],peer:e.peer?.map(e=>e.name)||[]}}const{prod:o,dev:a,peer:s}=t,n=Array.from(new Set([...o||[],...a||[],...s||[]])),r=(e="string"==typeof e?[e]:e).filter(e=>!n.includes(e));return r.length&&await Y({dev:r}),t.dev=t.dev||[],t.dev.push(...r),t}async function q(){const e=P.for(q),t=await O("git config user.name").promise,o=await O("git config user.email").promise;e.verbose(`cached git id: ${t}/${o}. changing to automation`),await O('git config user.email "automation@decaf.ts"').promise,await O('git config user.name "decaf"').promise,e.info("Pushing changes to git..."),await O("git add .").promise,await O('git commit -m "refs #1 - after repo setup"').promise,await O("git push").promise,await O(`git config user.email "${o}"`).promise,await O(`git config user.name "${t}"`).promise,e.verbose(`reverted to git id: ${t}/${o}`)}async function Y(e){const t=P.for(Y),o=e.prod||[],a=e.dev||[],s=e.peer||[];o.length&&(t.info(`Installing dependencies ${o.join(", ")}...`),await O("npm install "+o.join(" "),{cwd:process.cwd()}).promise),a.length&&(t.info(`Installing devDependencies ${a.join(", ")}...`),await O("npm install --save-dev "+a.join(" "),{cwd:process.cwd()}).promise),s.length&&(t.info(`Installing peerDependencies ${s.join(", ")}...`),await O("npm install --save-peer "+s.join(" "),{cwd:process.cwd()}).promise)}async function Z(e){return e.then(e=>e.default||e)}async function Q(e){const t=P.for(Q);try{const o=i.readdirSync(e).map(t=>c.join(e,t)).filter(e=>{try{return i.statSync(e).isFile()&&(e.endsWith(".js")||e.endsWith(".cjs")||e.endsWith(".mjs"))}catch{return!1}});if(0===o.length)throw Error("No JS files found in directory "+e);let a=o[0],s=i.statSync(a).size;for(const e of o.slice(1)){const t=i.statSync(e).size;s>t&&(a=e,s=t)}t.verbose(`Selected smallest bundle: ${a} (${s} bytes)`);const n=i.readFileSync(a),r=d.gzipSync(n),l=Number((r.length/1024).toFixed(1));return t.verbose(`Gzipped size: ${r.length} bytes (${l} KB)`),l}catch(o){throw t.verbose(`Failed to compute gzipped size for ${e}: ${o}`),o}}const ee=[{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That's Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"Decaf-TS: Where smart contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No CRUD, no problem \u2014 Decaf your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS: Your frontend already understands your smart contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye CRUD, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From smart contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No CRUD. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"}],te=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];function oe(e){const t=ae(),o="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),a=o.reduce((e,t)=>Math.max(e,t.length),0);o.push("# "+t.padStart(a-3)),o.forEach((t,o)=>{(e?e.info.bind(e):(()=>{}).bind())(g(t||"").raw(te[o]).text)})}function ae(e){try{return e=void 0===e?Math.floor(Math.random()*ee.length):e,ee[e].Slogan}catch(e){throw Error("Failed to retrieve slogans: "+e)}}class se extends s{constructor(e,t={},a=[]){super(),this.name=e,this.inputs=t,this.requirements=a,se.log||Object.defineProperty(se,"log",{writable:!1,value:o.for(se.name)}),this.inputs=Object.assign({},C,t)}async checkRequirements(){const{prod:e,dev:t,peer:o}=await z(),a=[],s=Array.from(new Set([...e,...t,...o]).values()).map(e=>e.name);for(const e of this.requirements)s.includes(e)||a.push(e);a.length}help(e){return this.log.info("This is help. I'm no use because I should have been overridden.")}async execute(){const e=b.parseArgs(this.inputs),t=n.accumulate(D).accumulate(e.values),{version:o,help:a,banner:s}=t;if(o)return X();if(a)return this.help(e);let r;s&&oe(this.log.for(oe,{timestamp:!1,style:!1,context:!1,logLevel:!1}));try{r=await this.run(t)}catch(e){throw e}return r}}class ne{static{this.log=o.for(ne)}static async downloadFile(e){return new Promise((t,o)=>{!function e(a){a=encodeURI(a),f.get(a,s=>{if(301===s.statusCode||307===s.statusCode)return e(s.headers.location);if(200!==s.statusCode)return ne.log.error(`Failed to fetch ${a} (status: ${s.statusCode})`),o(Error("Failed to fetch "+a));let n="";s.on("data",e=>{n+=e}),s.on("error",e=>{o(e)}),s.on("end",()=>{t(n)})})}(e)})}}function re(e){return e?Array.isArray(e)?e.map(e=>(""+e).trim()).filter(Boolean):(""+e).split(",").map(e=>e.trim()).filter(Boolean):[]}function ie(e){return e.replace(/^@/,"").split(/[/\-_.]+/).filter(Boolean).map((e,t)=>0===t?e.replace(/[^a-zA-Z0-9]/g,""):`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join("")}function ce(){let e;try{e=_(process.cwd())}catch{e=void 0}try{if(!e||!(Object.keys(e.dependencies||{}).length>0||Object.keys(e.devDependencies||{}).length>0||Object.keys(e.peerDependencies||{}).length>0)){const t=c.resolve(__dirname,"../../..");try{e=_(t)}catch{}}}catch{}const t=Object.keys(e&&e.dependencies||{}),o=Object.keys(e&&e.peerDependencies||{}),a=Object.keys(e&&e.devDependencies||{});return Array.from(new Set([...t,...o,...a]))}const le="##PACKAGE_SIZE##";var ge,de;(e=>{e.CJS="commonjs",e.ESM="es2022"})(ge||(ge={})),(e=>{e.BUILD="build",e.BUNDLE="bundle",e.ALL="all"})(de||(de={}));const fe={prod:{type:"boolean",default:!1},dev:{type:"boolean",default:!1},buildMode:{type:"string",default:de.ALL},includes:{type:"string",default:""},externals:{type:"string",default:""},docs:{type:"boolean",default:!1},commands:{type:"boolean",default:!1},banner:{type:"boolean",default:!1}},he=(e=".cjs")=>{const t=ue.log.for(he),o=new Map;return a=>s=>{const n=c.dirname(s.fileName);function r(a){const s=JSON.stringify([n,a]),r=o.get(s);if(null!=r)return r;let l,g=a;try{g=c.resolve(n,g+".ts")}catch(e){throw Error(`Failed to resolve path ${a}: ${e}`)}try{l=i.statSync(g)}catch(e){try{t.verbose(`Testing existence of path ${g} as a folder defaulting to index file`),l=i.statSync(g.replace(/\.ts$/gm,""))}catch(t){throw Error(`Failed to resolve path ${a}: ${e}, ${t}`)}}if(l.isDirectory()&&(g=g.replace(/\.ts$/gm,"/index.ts")),c.isAbsolute(g)){const t=(/\.tsx?$/.exec(c.basename(g))||[])[0]||void 0;g="./"+c.relative(n,c.resolve(c.dirname(g),c.basename(g,t)+e))}return o.set(s,g),g}return w.visitNode(s,function e(t){if((e=>!(!w.isImportDeclaration(e)&&!w.isExportDeclaration(e)||void 0===e.moduleSpecifier||!w.isStringLiteral(e.moduleSpecifier)||!e.moduleSpecifier.text.startsWith("./")&&!e.moduleSpecifier.text.startsWith("../")||""!==c.extname(e.moduleSpecifier.text)))(t)){if(w.isImportDeclaration(t)){const e=r(t.moduleSpecifier.text),o=a.factory.createStringLiteral(e);return a.factory.updateImportDeclaration(t,t.modifiers,t.importClause,o,void 0)}if(w.isExportDeclaration(t)){const e=r(t.moduleSpecifier.text),o=a.factory.createStringLiteral(e);return a.factory.updateExportDeclaration(t,t.modifiers,t.isTypeOnly,t.exportClause,o,void 0)}}return w.visitEachChild(t,e,a)})}};class ue extends se{constructor(){super("BuildScripts",Object.assign({},C,fe)),this.replacements={};const e=_(),{name:t,version:o}=e;this.pkgName=t.includes("@")?t.split("/")[1]:t,this.pkgVersion=o,this.replacements["0.4.5"]=this.pkgVersion,this.replacements["@decaf-ts/utils"]=t}patchFiles(e){const t=this.log.for(this.patchFiles),{name:o,version:a}=_();t.info(`Patching ${o} ${a} module in ${e}...`),i.statSync(e).isDirectory()&&i.readdirSync(e,{withFileTypes:!0,recursive:!0}).filter(e=>e.isFile()).forEach(e=>M(c.join(e.parentPath,e.name),this.replacements)),t.verbose(`Module ${o} ${a} patched in ${e}...`)}reportDiagnostics(e,t){const o=this.formatDiagnostics(e);try{this.log[t](o)}catch(e){throw e}return o}formatDiagnostics(e){return e.map(e=>{let t="";if(e.file&&e.start){const{line:o,character:a}=e.file.getLineAndCharacterOfPosition(e.start);t+=`${e.file.fileName} (${o+1},${a+1})`}return t+=": "+w.flattenDiagnosticMessageText(e.messageText,"\n"),t}).join("\n")}readConfigFile(e){const t=i.readFileSync(e).toString(),o=w.parseConfigFileTextToJson(e,t),a=o.config;a||this.reportDiagnostics([o.error],r.error);const s=w.parseJsonConfigFileContent(a,w.sys,c.dirname(e));return s.errors.length>0&&this.reportDiagnostics(s.errors,r.error),s}evalDiagnostics(e){if(e&&e.length>0){const t=e.filter(e=>e.category===w.DiagnosticCategory.Error),o=e.filter(e=>e.category===w.DiagnosticCategory.Warning),a=e.filter(e=>e.category===w.DiagnosticCategory.Suggestion),s=e.filter(e=>e.category===w.DiagnosticCategory.Message);if(o.length&&this.reportDiagnostics(o,r.warn),t.length)throw this.reportDiagnostics(e,r.error),Error(`TypeScript reported ${e.length} diagnostic(s) during check; aborting.`);a.length&&this.reportDiagnostics(a,r.info),s.length&&this.reportDiagnostics(s,r.info)}}preCheckDiagnostics(e){const t=w.getPreEmitDiagnostics(e);this.evalDiagnostics(t)}async checkTsDiagnostics(e,t,o=!1){const a=this.log.for(this.checkTsDiagnostics);let s;try{s=this.readConfigFile("./tsconfig.json")}catch(e){throw Error("Failed to parse tsconfig.json: "+e)}o?(s.options.module=T.AMD,s.options.outDir="dist",s.options.isolatedModules=!1,s.options.outFile=this.pkgName):(s.options.outDir="lib"+(t===ge.ESM?"/esm":""),s.options.module=t===ge.ESM?T.ES2022:T.CommonJS),s.options.inlineSourceMap=!1,s.options.inlineSources=!1,s.options.sourceMap=!0;const n=w.createProgram(s.fileNames,s.options);this.preCheckDiagnostics(n),a.verbose(`TypeScript checks passed (${o?"bundle":"normal"} mode).`)}async buildTs(e,t,o=!1){let a;this.log.for(this.buildTs).info(`Building ${this.pkgName} ${this.pkgVersion} module (${t}) in ${e?"dev":"prod"} mode...`);try{a=this.readConfigFile("./tsconfig.json")}catch(e){throw Error("Failed to parse tsconfig.json: "+e)}o?(a.options.module=T.AMD,a.options.outDir="dist",a.options.isolatedModules=!1,a.options.outFile=this.pkgName):(a.options.outDir="lib"+(t===ge.ESM?"/esm":""),a.options.module=t===ge.ESM?T.ES2022:T.CommonJS),e?(a.options.inlineSourceMap=!0,a.options.inlineSources=!0,a.options.sourceMap=!1):(a.options.inlineSourceMap=!1,a.options.inlineSources=!1,a.options.sourceMap=!0);const s=w.createProgram(a.fileNames,a.options),n={};t===ge.CJS?n.before=[he(".cjs")]:t===ge.ESM&&(n.before=[he(".js")]);const r=s.emit(void 0,void 0,void 0,void 0,n),i=w.getPreEmitDiagnostics(s).concat(r.diagnostics);this.evalDiagnostics(i)}async build(e,t,o=!1){const a=this.log.for(this.build);if(await this.buildTs(e,t,o),a.verbose(`Module ${this.pkgName} ${this.pkgVersion} (${t}) built in ${e?"dev":"prod"} mode...`),t===ge.CJS&&!o){const e=J("lib",e=>e.endsWith(".js")&&!e.includes("/esm/"));for(const t of e){a.verbose(`Patching ${t}'s cjs imports...`);const e=t.replace(".js",".cjs");await R(t,e)}}}copyAssets(e){const t=this.log.for(this.copyAssets);let o=!1;try{o=i.statSync("./src/assets").isDirectory()}catch(e){return t.verbose("No assets found in ./src/assets to copy")}o&&W("./src/assets",`./${e===ge.CJS?"lib":"dist"}/assets`)}async bundle(e,t,o,a="src/index.ts",s=this.pkgName,n,r=["prompts","styled-string-builder","typed-object-accumulator","@decaf-ts/logging"]){await this.checkTsDiagnostics(t,e,!0);const i=e===ge.ESM,c=this.pkgName,l=this.log,g=Array.from(new Set([...re(r)]));let d=re(n);0===d.length&&(d=ce());const f=Array.from(new Set([...(()=>{try{return Array.isArray(y)?y:[]}catch{return["fs","path","process","child_process","util","https","http","os","stream","crypto","zlib","net","tls","url","querystring","assert","events","tty","dns","querystring"]}})(),...d])),w=!t||"inline",T=[u({compilerOptions:{module:"esnext",declaration:!1,outDir:o?"bin":"dist",sourceMap:!t,inlineSourceMap:!!t,inlineSources:!!t},include:["src/**/*.ts"],exclude:["node_modules","**/*.spec.ts"],tsconfig:"./tsconfig.json"}),S()];o&&T.push(p({include:[],exclude:d}),m({resolveOnly:g}));try{const v=await import("@rollup/plugin-terser"),k=v&&v.terser||v.default||v,$={parse:{ecma:2020},compress:!1,mangle:!1,format:{comments:!1,beautify:!0}},E={parse:{ecma:2020},compress:{ecma:2020,passes:5,drop_console:!0,drop_debugger:!0,toplevel:!0,module:i,unsafe:!0,unsafe_arrows:!0,unsafe_comps:!0,collapse_vars:!0,reduce_funcs:!0,reduce_vars:!0},mangle:{toplevel:!0},format:{comments:!1,ascii_only:!0},toplevel:!0};T.push(k(t?$:E))}catch{}const b={input:a,plugins:T,external:f,onwarn:void 0,treeshake:!t},C={};f.forEach(e=>{C[e]=ie(e)});const D=[{file:`${o?"bin/":"dist/"}${s||".bundle."+(t?"":"min")}${i?".js":".cjs"}`,format:o?"cjs":i?"esm":"umd",name:c,esModule:i,sourcemap:w,globals:C,exports:"auto"}];try{const F=await h(b);async function I(e){for(const t of D)await e.write(t)}l.verbose(F.watchFiles),await I(F)}catch(x){throw Error("Failed to bundle: "+x)}}async buildByEnv(e,t=de.ALL,o,a){try{G("lib")}catch(e){}try{G("dist")}catch(e){}i.mkdirSync("lib"),i.mkdirSync("dist"),[de.ALL,de.BUILD].includes(t)&&(await this.build(e,ge.ESM),await this.build(e,ge.CJS),this.patchFiles("lib")),[de.ALL,de.BUNDLE].includes(t)&&(await this.bundle(ge.ESM,e,!1,"src/index.ts",this.pkgName,a,o),await this.bundle(ge.CJS,e,!1,"src/index.ts",this.pkgName,a,o),this.patchFiles("dist")),this.copyAssets(ge.CJS),this.copyAssets(ge.ESM)}async buildDev(e=de.ALL,t,o){return this.buildByEnv(!0,e,t,o)}async buildProd(e=de.ALL,t,o){return this.buildByEnv(!1,e,t,o)}async buildDocs(){await O("npm install better-docs taffydb").promise,await O("npx markdown-include ./workdocs/readme-md.json").promise,await O("npx jsdoc -c ./workdocs/jsdocs.json -t ./node_modules/better-docs").promise,await O("npm remove better-docs taffydb").promise,[{src:"workdocs/assets",dest:"./docs/workdocs/assets"},{src:"workdocs/reports/coverage",dest:"./docs/workdocs/reports/coverage"},{src:"workdocs/reports/html",dest:"./docs/workdocs/reports/html"},{src:"workdocs/resources",dest:"./docs/workdocs/resources"},{src:"LICENSE.md",dest:"./docs/LICENSE.md"}].forEach(e=>{const{src:t,dest:o}=e;W(t,o)});try{const e=await Q(c.resolve("dist"));this.replacements[le]=e+" KB"}catch{this.replacements[le]="unknown"}try{M("./README.md",this.replacements)}catch(e){this.log.for(this.buildDocs).verbose("Failed to patch README.md: "+e)}}async run(e){const{dev:t,prod:o,docs:a,buildMode:s,includes:n,externals:r}=e;return t?await this.buildDev(s,n,r):o?await this.buildProd(s,n,r):a?await this.buildDocs():void 0}}const pe={ci:{type:"boolean",default:!0},message:{type:"string",short:"m"},tag:{type:"string",short:"t",default:void 0}};class me extends se{constructor(){super("ReleaseScript",pe)}async prepareVersion(e){const t=this.log.for(this.prepareVersion);return(e=this.testVersion(e||""))||(t.verbose("No release message provided. Prompting for one:"),t.info("Listing latest git tags:"),await O("git tag --sort=-taggerdate | head -n 5").promise,await b.insistForText("tag","Enter the new tag number (accepts v*.*.*[-...])",e=>!!e.toString().match(/^v[0-9]+\.[0-9]+.[0-9]+(-[0-9a-zA-Z-]+)?$/)))}testVersion(e){const t=this.log.for(this.testVersion);switch(e=e.trim().toLowerCase()){case $.PATCH:case $.MINOR:case $.MAJOR:return t.verbose("Using provided SemVer update: "+e,1),e;default:return t.verbose("Testing provided version for SemVer compatibility: "+e,1),RegExp(k).test(e)?(t.verbose("version approved: "+e,1),e):void t.debug("Invalid version number: "+e)}}async prepareMessage(e){const t=this.log.for(this.prepareMessage);return e||(t.verbose("No release message provided. Prompting for one"),await b.insistForText("message","What should be the release message/ticket?",e=>!!e&&e.toString().length>5))}async run(e){let t;const{ci:o}=e;let{tag:a,message:s}=e;a=await this.prepareVersion(a),s=await this.prepareMessage(s),t=await O(`npm run prepare-release -- ${a} ${s}`,{cwd:process.cwd()}).promise,t=await O("git status --porcelain").promise,await t,t.logs.length&&await b.askConfirmation("git-changes","Do you want to push the changes to the remote repository?",!0)&&(await O("git add .").promise,await O(`git commit -m "${a} - ${s} - after release preparation${o?"":E}"`).promise),await O(`npm version "${a}" -m "${s}${o?"":E}"`).promise,await O("git push --follow-tags").promise,o||await O("NPM_TOKEN=$(cat .npmtoken) npm publish --access public").promise}}const Se="https://raw.githubusercontent.com/decaf-ts/ts-workspace/master",ye={templates:[".github/ISSUE_TEMPLATE/bug_report.md",".github/ISSUE_TEMPLATE/feature_request.md",".github/FUNDING.yml"],workflows:[".github/workflows/codeql-analysis.yml",".github/workflows/jest-coverage.yaml",".github/workflows/nodejs-build-prod.yaml",".github/workflows/pages.yaml",".github/workflows/publish-on-release.yaml",".github/workflows/release-on-tag.yaml",".github/workflows/snyk-analysis.yaml"],ide:[".idea/runConfigurations/All Tests.run.xml",".idea/runConfigurations/build.run.xml",".idea/runConfigurations/build_prod.run.xml",".idea/runConfigurations/coverage.run.xml",".idea/runConfigurations/docs.run.xml",".idea/runConfigurations/drawings.run.xml",".idea/runConfigurations/flash-forward.run.xml",".idea/runConfigurations/Integration_Tests.run.xml",".idea/runConfigurations/Bundling_Tests.run.xml",".idea/runConfigurations/lint-fix.run.xml",".idea/runConfigurations/release.run.xml",".idea/runConfigurations/test_circular.run.xml",".idea/runConfigurations/uml.run.xml",".idea/runConfigurations/Unit Tests.run.xml",".idea/runConfigurations/update-scripts.run.xml"],docs:["workdocs/tutorials/Contributing.md","workdocs/tutorials/Documentation.md","workdocs/tutorials/For Developers.md","workdocs/2-Badges.md","workdocs/jsdocs.json","workdocs/readme-md.json"],styles:[".prettierrc","eslint.config.js"],scripts:["bin/update-scripts.cjs","bin/tag-release.cjs","bin/build-scripts.cjs"],tests:["jest.config.ts","workdocs/reports/jest.coverage.config.ts"],typescript:["tsconfig.json"],docker:["Dockerfile"],automation:["workdocs/confluence/Continuous Integration-Deployment/GitHub.md","workdocs/confluence/Continuous Integration-Deployment/Jira.md","workdocs/confluence/Continuous Integration-Deployment/Teams.md"]},we={boot:{type:"boolean"},org:{type:"string",short:"o"},name:{type:"string",short:"n",default:void 0},author:{type:"string",short:"a",default:void 0},all:{type:"boolean"},license:{type:"string",message:"Pick the license"},scripts:{type:"boolean"},styles:{type:"boolean"},docs:{type:"boolean"},ide:{type:"boolean"},workflows:{type:"boolean"},templates:{type:"boolean"},typescript:{type:"boolean"},docker:{type:"boolean"},pkg:{type:"boolean"},dependencies:{type:"boolean"},tests:{type:"boolean"},automation:{type:"boolean"}};class Te extends se{constructor(){super("TemplateSync",we),this.replacements={},this.getStyles=()=>this.downloadOption("styles"),this.getTemplates=()=>this.downloadOption("templates"),this.getWorkflows=()=>this.downloadOption("workflows"),this.getDocs=()=>this.downloadOption("docs"),this.getTypescript=()=>this.downloadOption("typescript"),this.getAutomation=()=>this.downloadOption("automation"),this.getTests=()=>this.downloadOption("tests"),this.getDocker=()=>this.downloadOption("docker")}loadValuesFromPackage(){const e=process.cwd(),t=_(e,"author");let o,a=_(e,"name");if(a.startsWith("@")){const e=a.split("/");a=e[1],o=e[0].replace("@","")}["Tiago Venceslau","TiagoVenceslau","${author}"].forEach(e=>this.replacements[e]=t),["TS-Workspace","ts-workspace","${name}"].forEach(e=>this.replacements[e]=a),["decaf-ts","${org}"].forEach(e=>this.replacements[e]=o||'""'),this.replacements["${org_or_owner}"]=o||a}async downloadOption(e){if(!(e in ye))throw Error(`Option "${e}" not found in options`);const t=ye[e];for(const e of t){this.log.info("Downloading "+e);let t=await ne.downloadFile(`${Se}/${e}`);t=a(t,this.replacements),L(c.join(process.cwd(),e),t)}}async getLicense(e){this.log.info(`Downloading ${e} license`);const t=`${Se}/workdocs/licenses/${e}.md`;let o=await ne.downloadFile(t);o=a(o,this.replacements),L(c.join(process.cwd(),"LICENSE.md"),o),V("license",e)}async getIde(){i.mkdirSync(c.join(process.cwd(),".idea","runConfigurations"),{recursive:!0}),await this.downloadOption("ide")}async getScripts(){await this.downloadOption("scripts"),this.log.info("please re-run the command"),process.exit(0)}async initPackage(e,t,o){try{const a=_();delete a[F],a.name=e,a.version="0.0.1",a.author=t,a.license=o,i.writeFileSync("package.json",JSON.stringify(a,null,2))}catch(e){throw Error("Error fixing package.json: "+e)}}async updatePackageScrips(){try{const e=JSON.parse(await ne.downloadFile(Se+"/package.json")),{scripts:t}=e,o=_();Object.keys(o.scripts).forEach(e=>{if(e in t){const s=a(t[e],this.replacements);s!==t[e]&&(o.scripts[e]=s)}}),o.exports.require=e.exports.require,o.exports.import=e.exports.import,o.types=e.types,i.writeFileSync("package.json",JSON.stringify(o,null,2))}catch(e){throw Error("Error fixing package.json scripts: "+e)}}async createTokenFiles(){const e=this.log.for(this.createTokenFiles),t=await b.insistForText("token","please input your github token",e=>!!e.match(/^ghp_[0-9a-zA-Z]{36}$/g));Object.values(I).forEach(o=>{try{let a;try{a=i.existsSync(o)}catch(a){return e.info(`Token file ${o} not found. Creating a new one...`),void i.writeFileSync(o,".token"===o?t:"")}a||i.writeFileSync(o,".token"===o?t:"")}catch(e){throw Error(`Error creating token file ${o}: ${e}`)}})}async getOrg(){const e=await b.askText("Organization","Enter the organization name (will be used to scope your npm project. leave blank to create a unscoped project):");return await b.askConfirmation("Confirm organization","Is this organization correct?",!0)?e:this.getOrg()}async auditFix(){return await O("npm audit fix --force").promise}patchFiles(){const e=[...i.readdirSync(c.join(process.cwd(),"src"),{recursive:!0,withFileTypes:!0}).filter(e=>e.isFile()).map(e=>c.join(e.parentPath,e.name)),...i.readdirSync(c.join(process.cwd(),"workdocs"),{recursive:!0,withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>c.join(e.parentPath,e.name)),c.join(process.cwd(),".gitlab-ci.yml"),c.join(process.cwd(),"workdocs","jsdocs.json")];for(const t of e)M(t,this.replacements)}async updateDependencies(){try{const e=JSON.parse(await ne.downloadFile(Se+"/package.json")),{devDependencies:t}=e,o=_();Object.keys(o.scripts).forEach(e=>{if(e in t){const a=t[e];a!==t[e]&&(o.devDependencies=o.devDependencies||{},o.devDependencies[e]=a)}}),i.writeFileSync("package.json",JSON.stringify(o,null,2)),await O("npm install").promise}catch(e){throw Error("Error fixing package.json dependencies: "+e)}}async run(e){let{license:t}=e;const{boot:o}=e;let{all:a,scripts:s,styles:n,docs:r,ide:i,workflows:c,templates:l,docker:g,typescript:d,dependencies:f,tests:h,automation:u,pkg:p}=e;if((s||n||r||i||c||l||g||d||u||f||h||p)&&(a=!1),o){const e=await this.getOrg(),o=await b.insistForText("Project name","Enter the project name:",e=>e.length>1),a=await b.insistForText("Author","Enter the author name:",e=>e.length>1),s=e?`@${e}/${o}`:o;await this.initPackage(s,a,t),await this.createTokenFiles(),await this.auditFix(),this.patchFiles()}a&&(s=!1,n=!0,r=!0,i=!0,c=!0,l=!0,g=!0,d=!0,p=!0,f=!0,h=!0,u=!1),void 0===s&&(s=await b.askConfirmation("scripts","Do you want to get scripts?",!0)),s&&await this.getScripts(),this.loadValuesFromPackage(),a||void 0!==t||await b.askConfirmation("license","Do you want to set a license?",!0)&&(t=await b.insistForText("license","Enter the desired License (MIT|GPL|Apache|LGPL|AGPL):",e=>!!e&&!!e.match(/^(MIT|GPL|Apache|LGPL|AGPL)$/g))),void 0!==t&&await this.getLicense(t),void 0===i&&(i=await b.askConfirmation("ide","Do you want to get ide configs?",!0)),i&&await this.getIde(),void 0===d&&(d=await b.askConfirmation("typescript","Do you want to get typescript configs?",!0)),d&&await this.getTypescript(),void 0===g&&(g=await b.askConfirmation("docker","Do you want to get docker configs?",!0)),g&&await this.getDocker(),void 0===u&&(u=await b.askConfirmation("automation","Do you want to get automation configs?",!0)),u&&await this.getAutomation(),void 0===n&&(n=await b.askConfirmation("styles","Do you want to get styles?",!0)),n&&await this.getStyles(),void 0===r&&(r=await b.askConfirmation("docs","Do you want to get docs?",!0)),r&&await this.getDocs(),void 0===c&&(c=await b.askConfirmation("workflows","Do you want to get workflows?",!0)),c&&await this.getWorkflows(),void 0===l&&(l=await b.askConfirmation("templates","Do you want to get templates?",!0)),l&&await this.getTemplates(),void 0===p&&(p=await b.askConfirmation("pkg","Do you want to update your package.json scripts?",!0)),p&&await this.updatePackageScrips(),void 0===h&&(h=await b.askConfirmation("pkg","Do you want to update your test configs?",!0)),h&&await this.getTests(),void 0===f&&(f=await b.askConfirmation("pkg","Do you want to update dev dependencies?",!0)),f&&await this.updateDependencies()}}class be extends j{constructor(e,t,o,a="g"){super(e,t);try{this.regexp="string"==typeof o?RegExp(o,a):o}catch(e){throw Error("Invalid regular expression: "+e)}}test(e){let t;this.regexp.lastIndex=0;try{t=this.regexp.exec(e)}catch(e){return}return t}testAndResolve(e){const t=this.test(e);t&&this.resolve(t[0])}testAndReject(e){const t=this.test(e);t&&this.reject(t[0])}data(e){super.data(e),this.testAndResolve(e+"")}error(e){super.error(e),this.testAndReject(e+"")}}const Ce="0.4.5",De="@decaf-ts/utils";export{x as AbortCode,ue as BuildScripts,se as Command,C as DefaultCommandOptions,D as DefaultCommandValues,v as Encoding,ne as HttpClient,E as NoCIFLag,De as PACKAGE_NAME,be as RegexpOutputWriter,me as ReleaseScript,$ as SemVersion,k as SemVersionRegex,F as SetupScriptKey,j as StandardOutputWriter,Te as TemplateSync,I as Tokens,b as UserInput,Ce as VERSION,A as chainAbortController,W as copyFile,G as deletePath,J as getAllFiles,z as getDependencies,Q as getFileSizeZipped,_ as getPackage,ce as getPackageDependencies,X as getPackageVersion,ae as getSlogan,Y as installDependencies,K as installIfNotAvailable,N as lockify,Z as normalizeImport,ie as packageToGlobal,re as parseList,M as patchFile,oe as printBanner,q as pushToGit,U as readFile,R as renameFile,O as runCommand,V as setPackageAttribute,B as spawnCommand,H as updateDependencies,L as writeFile};
|
|
1
|
+
import e from"prompts";import{parseArgs as t}from"util";import{Logging as o,patchString as a,LoggedClass as s,LoggedEnvironment as n,LogLevel as r}from"@decaf-ts/logging";import i from"fs";import c from"path";import{spawn as l}from"child_process";import{style as g}from"styled-string-builder";import d from"zlib";import f from"https";import{rollup as h}from"rollup";import u from"@rollup/plugin-typescript";import p from"@rollup/plugin-commonjs";import{nodeResolve as m}from"@rollup/plugin-node-resolve";import S from"@rollup/plugin-json";import{builtinModules as y}from"module";import*as w from"typescript";import{ModuleKind as T}from"typescript";class b{static{this.logger=o.for(b)}constructor(e){this.type="text",this.name=e}setType(e){return b.logger.verbose("Setting type to: "+e),this.type=e,this}setMessage(e){return b.logger.verbose("Setting message to: "+e),this.message=e,this}setInitial(e){return b.logger.verbose("Setting initial value to: "+e),this.initial=e,this}setStyle(e){return b.logger.verbose("Setting style to: "+e),this.style=e,this}setFormat(e){return b.logger.verbose("Setting format function"),this.format=e,this}setValidate(e){return b.logger.verbose("Setting validate function"),this.validate=e,this}setOnState(e){return b.logger.verbose("Setting onState callback"),this.onState=e,this}setMin(e){return b.logger.verbose("Setting min value to: "+e),this.min=e,this}setMax(e){return b.logger.verbose("Setting max value to: "+e),this.max=e,this}setFloat(e){return b.logger.verbose("Setting float to: "+e),this.float=e,this}setRound(e){return b.logger.verbose("Setting round to: "+e),this.round=e,this}setInstructions(e){return b.logger.verbose("Setting instructions to: "+e),this.instructions=e,this}setIncrement(e){return b.logger.verbose("Setting increment to: "+e),this.increment=e,this}setSeparator(e){return b.logger.verbose("Setting separator to: "+e),this.separator=e,this}setActive(e){return b.logger.verbose("Setting active style to: "+e),this.active=e,this}setInactive(e){return b.logger.verbose("Setting inactive style to: "+e),this.inactive=e,this}setChoices(e){return b.logger.verbose("Setting choices: "+JSON.stringify(e)),this.choices=e,this}setHint(e){return b.logger.verbose("Setting hint to: "+e),this.hint=e,this}setWarn(e){return b.logger.verbose("Setting warn to: "+e),this.warn=e,this}setSuggest(e){return b.logger.verbose("Setting suggest function"),this.suggest=e,this}setLimit(e){return b.logger.verbose("Setting limit to: "+e),this.limit=e,this}setMask(e){return b.logger.verbose("Setting mask to: "+e),this.mask=e,this}setStdout(e){return b.logger.verbose("Setting stdout stream"),this.stdout=e,this}setStdin(e){return this.stdin=e,this}async ask(){return(await b.ask(this))[this.name]}static async ask(t){const o=b.logger.for(this.ask);let a;Array.isArray(t)||(t=[t]);try{o.verbose("Asking questions: "+t.map(e=>e.name).join(", ")),a=await e(t),o.verbose("Received answers: "+JSON.stringify(a,null,2))}catch(e){throw Error("Error while getting input: "+e)}return a}static async askNumber(e,t,o,a,s){b.logger.for(this.askNumber).verbose(`Asking number input: undefined, question: ${t}, min: ${o}, max: ${a}, initial: ${s}`);const n=new b(e).setMessage(t).setType("number");return"number"==typeof o&&n.setMin(o),"number"==typeof a&&n.setMax(a),"number"==typeof s&&n.setInitial(s),(await this.ask(n))[e]}static async askText(e,t,o=void 0,a){b.logger.for(this.askText).verbose(`Asking text input: undefined, question: ${t}, mask: ${o}, initial: ${a}`);const s=new b(e).setMessage(t);return o&&s.setMask(o),"string"==typeof a&&s.setInitial(a),(await this.ask(s))[e]}static async askConfirmation(e,t,o){b.logger.for(this.askConfirmation).verbose(`Asking confirmation input: undefined, question: ${t}, initial: ${o}`);const a=new b(e).setMessage(t).setType("confirm");return void 0!==o&&a.setInitial(o),(await this.ask(a))[e]}static async insist(e,t,o,a=1){const s=b.logger.for(this.insist);let n;s.verbose(`Insisting on input: ${e.name}, test: ${t.toString()}, defaultConfirmation: ${o}, limit: ${a}`);let r,i=0;try{do{n=(await b.ask(e))[e.name],t(n)?(r=await b.askConfirmation(e.name+"-confirm",`Is the ${e.type} correct?`,o),r||(n=void 0)):n=void 0}while(void 0===n&&a>1&&i++<a)}catch(e){throw s.error("Error while insisting: "+e),e}return void 0===n&&s.info("no selection..."),n}static async insistForText(e,t,o,a=void 0,s,n=!1,r=-1){b.logger.for(this.insistForText).verbose(`Insisting for text input: undefined, question: ${t}, test: ${o.toString()}, mask: ${a}, initial: ${s}, defaultConfirmation: ${n}, limit: ${r}`);const i=new b(e).setMessage(t);return a&&i.setMask(a),"string"==typeof s&&i.setInitial(s),await this.insist(i,o,n,r)}static async insistForNumber(e,t,o,a,s,n,r=!1,i=-1){b.logger.for(this.insistForNumber).verbose(`Insisting for number input: undefined, question: ${t}, test: ${o.toString()}, min: ${a}, max: ${s}, initial: ${n}, defaultConfirmation: ${r}, limit: ${i}`);const c=new b(e).setMessage(t).setType("number");return"number"==typeof a&&c.setMin(a),"number"==typeof s&&c.setMax(s),"number"==typeof n&&c.setInitial(n),await this.insist(c,o,r,i)}static parseArgs(e){const o=b.logger.for(this.parseArgs),a={args:process.argv.slice(2),options:e};o.debug("Parsing arguments: "+JSON.stringify(a,null,2));try{return t(a)}catch(t){throw o.debug(`Error while parsing arguments:\n${JSON.stringify(a,null,2)}\n | options\n${JSON.stringify(e,null,2)}\n | ${t}`),Error("Error while parsing arguments: "+t)}}}const C={verbose:{type:"boolean",short:"V",default:void 0},version:{type:"boolean",short:"v",default:void 0},help:{type:"boolean",short:"h",default:!1},logLevel:{type:"string",default:"info"},logStyle:{type:"boolean",default:!0},timestamp:{type:"boolean",default:!0},banner:{type:"boolean",default:!0}},D=Object.keys(C).reduce((e,t)=>(e[t]=C[t].default,e),{}),v="utf-8",k=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z])))/g;var $;(e=>{e.PATCH="patch",e.MINOR="minor",e.MAJOR="major"})($||($={}));const E="-no-ci",F="postinstall";var I;(e=>{e.GIT=".token",e.NPM=".npmtoken",e.DOCKER=".dockertoken",e.CONFLUENCE=".confluence-token"})(I||(I={}));const x="Aborted";class j{constructor(e,t,...a){this.cmd=e,this.lock=t,this.logger=o.for(this.cmd)}log(e,t){t=Buffer.isBuffer(t)?t.toString(v):t;const o="stderr"===e?g(t).red.text:t;this.logger.info(o)}data(e){this.log("stdout",e+"")}error(e){this.log("stderr",e+"")}errors(e){this.log("stderr","Error executing command exited : "+e)}exit(e,t){this.log("stdout","command exited code : "+(0===e?g(e.toString()).green.text:g(null===e?"null":e.toString()).red.text)),0===e?this.resolve(t.map(e=>e.trim()).join("\n")):this.reject(Error(t.length?t.join("\n"):e.toString()))}parseCommand(e){return e="string"==typeof e?e.split(" "):e,this.cmd=e.join(" "),[e[0],e.slice(1)]}resolve(e){this.log("stdout",`${this.cmd} executed successfully: ${g(e?"ran to completion":e).green}`),this.lock.resolve(e)}reject(e){e instanceof Error||(e=Error("number"==typeof e?"Exit code "+e:e)),this.log("stderr",`${this.cmd} failed to execute: ${g(e.message).red}`),this.lock.reject(e)}}function N(e){let t=Promise.resolve();return(...o)=>{const a=t.then(()=>e(...o));return t=a.catch(()=>{}),a}}function A(e,...t){let o,a;if(e instanceof AbortSignal?(a=new AbortController,o=[e,...t]):(a=e,o=t),a.signal.aborted)return a;const s=()=>a.abort();for(const e of o){if(e.aborted){a.abort();break}e.addEventListener("abort",s,{once:!0,signal:a.signal})}return a}function B(e,t,o,a,s){function n(t,a){const[n,r]=e.parseCommand(t);s.info("Running command: "+n),s.debug("with args: "+r.join(" "));const i=l(n,r,{...o,cwd:o.cwd||process.cwd(),env:Object.assign({},process.env,o.env,{PATH:process.env.PATH}),shell:o.shell||!1,signal:a.signal});return s.verbose("pid : "+i.pid),i}const r=t.match(/[<>$#]/g);if(r)throw Error(`Invalid command: ${t}. contains invalid characters: ${r}`);if(t.includes(" | ")){const e=t.split(" | "),o=[],s=Array(e.length);s[0]=a;for(let t=0;t<e.length;t++)0!==t&&(s[t]=A(s[t-1].signal)),o.push(n(e[t],s[t])),0!==t&&o[t-1].stdout.pipe(o[t].stdin);return o[e.length-1]}return n(t,a)}function O(e,t={},a=j,...s){const n=o.for(O),r=new AbortController,i={abort:r,command:e,logs:[],errs:[]},c=new Promise((o,c)=>{let l;try{l=new a(e,{resolve:o,reject:c},...s),i.cmd=B(l,e,t,r,n)}catch(t){return c(Error(`Error running command ${e}: ${t}`))}i.cmd.stdout.setEncoding("utf8"),i.cmd.stdout.on("data",e=>{e=e.toString(),i.logs.push(e),l.data(e)}),i.cmd.stderr.on("data",e=>{e=e.toString(),i.errs.push(e),l.error(e)}),i.cmd.once("error",e=>{l.exit(e.message,i.errs)}),i.cmd.once("exit",(e=0)=>{r.signal.aborted&&null===e&&(e=x),l.exit(e,0===e?i.logs:i.errs)})});return Object.assign(i,{promise:c,pipe:async t=>{const o=n.for("pipe");try{o.verbose(`Executing pipe function ${e}...`);const a=await c;return o.verbose(`Piping output to ${t.name}: ${a}`),t(a)}catch(e){throw o.error("Error piping command output: "+e),e}}}),i}const P=o.for("fs");function M(e,t){const o=P.for(M);if(!i.existsSync(e))throw Error(`File not found at path "${e}".`);let s=U(e);try{o.verbose(`Patching file "${e}"...`),o.debug("with value: "+JSON.stringify(t)),s=a(s,t)}catch(e){throw Error("Error patching file: "+e)}L(e,s)}function U(e){const t=P.for(U);try{return t.verbose(`Reading file "${e}"...`),i.readFileSync(e,"utf8")}catch(o){throw t.verbose(`Error reading file "${e}": ${o}`),Error(`Error reading file "${e}": ${o}`)}}function L(e,t){const o=P.for(L);try{o.verbose(`Writing file "${e} with ${t.length} bytes...`),i.writeFileSync(e,t,"utf8")}catch(t){throw o.verbose(`Error writing file "${e}": ${t}`),Error(`Error writing file "${e}": ${t}`)}}function J(e,t){const o=P.for(J),a=[];try{return o.verbose(`Retrieving all files from "${e}"...`),i.readdirSync(e).forEach(t=>{const o=c.join(e,t),s=i.statSync(o);s.isFile()?a.push(o):s.isDirectory()&&a.push(...J(o))}),t?a.filter(t):a}catch(t){throw o.verbose(`Error retrieving files from "${e}": ${t}`),Error(`Error retrieving files from "${e}": ${t}`)}}async function R(e,t){const o=P.for(R);let a,s;try{a=i.statSync(e)}catch(t){throw o.verbose(`Source path "${e}" does not exist: ${t}`),Error(`Source path "${e}" does not exist: ${t}`)}try{s=i.statSync(t)}catch(e){}if(s)throw o.verbose(`Destination path "${t}" already exists`),Error(`Destination path "${t}" already exists`);try{o.verbose(`Renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}...`),i.renameSync(e,t),o.verbose(`Successfully renamed to "${t}"`)}catch(s){throw o.verbose(`Error renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}": ${s}`),Error(`Error renaming ${a.isFile()?"file":"directory"} "${e}" to "${t}": ${s}`)}}function W(e,t){const o=P.for(W);let a,s;try{a=i.statSync(e)}catch(t){throw o.verbose(`Source path "${e}" does not exist: ${t}`),Error(`Source path "${e}" does not exist: ${t}`)}try{s=i.statSync(t)}catch(e){a.isDirectory()&&(o.verbose(`Dest path "${t}" does not exist. creating`),i.mkdirSync(t,{recursive:!0}))}try{o.verbose(`Copying ${a.isFile()?"file":"directory"} "${e}" to "${t}...`),i.cpSync(e,t,{recursive:!0})}catch(s){throw o.verbose(`Error copying ${a.isFile()?"file":"directory"} "${e}" to "${t}: ${s}`),Error(`Error copying ${a.isFile()?"file":"directory"} "${e}" to "${t}: ${s}`)}}function G(e){const t=P.for(G);try{const o=i.statSync(e);o.isFile()?(t.verbose(`Deleting file "${e}...`),i.rmSync(e,{recursive:!0,force:!0})):o.isDirectory()&&i.rmSync(e,{recursive:!0,force:!0})}catch(o){throw t.verbose(`Error Deleting "${e}": ${o}`),Error(`Error Deleting "${e}": ${o}`)}}function _(e=process.cwd(),t){let o;try{o=JSON.parse(U(c.join(e,"package.json")))}catch(e){throw Error('Failed to retrieve package information" '+e)}if(t){if(!(t in o))throw Error(`Property "${t}" not found in package.json`);return o[t]}return o}function V(e,t,o=process.cwd()){const a=_(o);a[e]=t,L(c.join(o,"package.json"),JSON.stringify(a,null,2))}function X(e=process.cwd()){return _(e,"version")}async function z(e=process.cwd()){let t;try{t=JSON.parse(await O("npm ls --json",{cwd:e}).promise)}catch(e){throw Error("Failed to retrieve dependencies: "+e)}const o=(e,t)=>({name:e[0],version:e[1].version});return{prod:Object.entries(t.dependencies||{}).map(o),dev:Object.entries(t.devDependencies||{}).map(o),peer:Object.entries(t.peerDependencies||{}).map(o)}}async function H(){const e=P.for(H);e.info("checking for updates..."),await O("npx npm-check-updates -u").promise,e.info("updating..."),await O("npx npm run do-install").promise}async function K(e,t){if(!t){const e=await z();t={prod:e.prod?.map(e=>e.name)||[],dev:e.dev?.map(e=>e.name)||[],peer:e.peer?.map(e=>e.name)||[]}}const{prod:o,dev:a,peer:s}=t,n=Array.from(new Set([...o||[],...a||[],...s||[]])),r=(e="string"==typeof e?[e]:e).filter(e=>!n.includes(e));return r.length&&await Y({dev:r}),t.dev=t.dev||[],t.dev.push(...r),t}async function q(){const e=P.for(q),t=await O("git config user.name").promise,o=await O("git config user.email").promise;e.verbose(`cached git id: ${t}/${o}. changing to automation`),await O('git config user.email "automation@decaf.ts"').promise,await O('git config user.name "decaf"').promise,e.info("Pushing changes to git..."),await O("git add .").promise,await O('git commit -m "refs #1 - after repo setup"').promise,await O("git push").promise,await O(`git config user.email "${o}"`).promise,await O(`git config user.name "${t}"`).promise,e.verbose(`reverted to git id: ${t}/${o}`)}async function Y(e){const t=P.for(Y),o=e.prod||[],a=e.dev||[],s=e.peer||[];o.length&&(t.info(`Installing dependencies ${o.join(", ")}...`),await O("npm install "+o.join(" "),{cwd:process.cwd()}).promise),a.length&&(t.info(`Installing devDependencies ${a.join(", ")}...`),await O("npm install --save-dev "+a.join(" "),{cwd:process.cwd()}).promise),s.length&&(t.info(`Installing peerDependencies ${s.join(", ")}...`),await O("npm install --save-peer "+s.join(" "),{cwd:process.cwd()}).promise)}async function Z(e){return e.then(e=>e.default||e)}async function Q(e){const t=P.for(Q);try{const o=i.readdirSync(e).map(t=>c.join(e,t)).filter(e=>{try{return i.statSync(e).isFile()&&(e.endsWith(".js")||e.endsWith(".cjs")||e.endsWith(".mjs"))}catch{return!1}});if(0===o.length)throw Error("No JS files found in directory "+e);let a=o[0],s=i.statSync(a).size;for(const e of o.slice(1)){const t=i.statSync(e).size;s>t&&(a=e,s=t)}t.verbose(`Selected smallest bundle: ${a} (${s} bytes)`);const n=i.readFileSync(a),r=d.gzipSync(n),l=Number((r.length/1024).toFixed(1));return t.verbose(`Gzipped size: ${r.length} bytes (${l} KB)`),l}catch(o){throw t.verbose(`Failed to compute gzipped size for ${e}: ${o}`),o}}const ee=[{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That's Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"No caffeine, no chaos. Just clean code.",Tags:"Coffee-themed, Calm, Tech"},{Slogan:"Full flavor, no jitters. That\u2019s Decaf-TS.",Tags:"Coffee-themed, Cheerful"},{Slogan:"Chill fullstack. Powered by Decaf.",Tags:"Coffee-themed, Fun, Tech"},{Slogan:"Decaf-TS: Brewed for calm code.",Tags:"Coffee-themed, Branding"},{Slogan:"Smooth as your morning Decaf.",Tags:"Coffee-themed, Chill"},{Slogan:"All the kick, none of the crash.",Tags:"Coffee-themed, Energetic"},{Slogan:"Sip back and ship faster.",Tags:"Coffee-themed, Fun"},{Slogan:"Keep calm and code Decaf.",Tags:"Coffee-themed, Playful"},{Slogan:"Code without the caffeine shakes.",Tags:"Coffee-themed, Humorous"},{Slogan:"Your fullstack, decaffeinated.",Tags:"Coffee-themed, Technical"},{Slogan:"Decaf-TS: Where smart contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No CRUD, no problem \u2014 Decaf your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS: Your frontend already understands your smart contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye CRUD, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From smart contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No CRUD. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"},{Slogan:"Decaf-TS-TS: Where blockchain contracts meet smart interfaces.",Tags:"Blockchain, Smart Contracts, Tech"},{Slogan:"Ship dApps without the stress.",Tags:"Blockchain, Cheerful, Developer"},{Slogan:"No boilerplate, no problem \u2014 Decaf-TS your data.",Tags:"Data, No-CRUD, Chill"},{Slogan:"From DID to UI, without breaking a sweat.",Tags:"DID, SSI, UI, Calm"},{Slogan:"Decaf-TS-TS: Your frontend already understands your blockchain contract.",Tags:"Smart Contracts, DX, Magic"},{Slogan:"Self-sovereign by design. Productive by default.",Tags:"SSI, Developer, Calm"},{Slogan:"Build once. Deploy everywhere. Decentralized and delightful.",Tags:"Blockchain, Multi-platform, Happy"},{Slogan:"Data that defines its own destiny.",Tags:"SSI, Data-driven, Empowerment"},{Slogan:"Goodbye boilerplate, hello intent-based interfaces.",Tags:"No-CRUD, UI, Technical"},{Slogan:"The smoothest path from DID to done.",Tags:"DID, Workflow, Chill"},{Slogan:"Because your dApp deserves more than boilerplate.",Tags:"Blockchain, DevX, Efficiency"},{Slogan:"Own your data. Own your flow.",Tags:"SSI, Control, Ownership"},{Slogan:"Write logic like it belongs with the data \u2014 because it does.",Tags:"Data Logic, Developer, Smart"},{Slogan:"From blockchain contracts to smarter frontends.",Tags:"Smart Contracts, UI, DX"},{Slogan:"No caffeine. No boilerplate. Just the future.",Tags:"No-CRUD, Coffee-themed, Futuristic"},{Slogan:"The future of web3 UX is Decaf-TS.",Tags:"Blockchain, UX, Vision"},{Slogan:"Code with confidence. Govern with clarity.",Tags:"Blockchain, Governance, Calm"},{Slogan:"Interfaces that obey the data, not the other way around.",Tags:"UI, Data Logic, Self-aware"},{Slogan:"Brew business logic right into your bytes.",Tags:"Data Logic, Coffee-themed, Fun"},{Slogan:"DIDs done differently \u2014 and delightfully.",Tags:"DID, Self-Sovereign, Playful"}],te=["\x1b[38;5;215m","\x1b[38;5;209m","\x1b[38;5;205m","\x1b[38;5;210m","\x1b[38;5;217m","\x1b[38;5;216m","\x1b[38;5;224m","\x1b[38;5;230m","\x1b[38;5;230m"];function oe(e){const t=ae(),o="# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# ( ( \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# ) ) \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# [=======] \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n# `-----\xb4 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \n# \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591\u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2593\u2592\u2591 \u2591\u2592\u2593\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2593\u2592\u2591 \n#".split("\n"),a=o.reduce((e,t)=>Math.max(e,t.length),0);o.push("# "+t.padStart(a-3)),o.forEach((t,o)=>{(e?e.info.bind(e):(()=>{}).bind())(g(t||"").raw(te[o]).text)})}function ae(e){try{return e=void 0===e?Math.floor(Math.random()*ee.length):e,ee[e].Slogan}catch(e){throw Error("Failed to retrieve slogans: "+e)}}class se extends s{constructor(e,t={},a=[]){super(),this.name=e,this.inputs=t,this.requirements=a,se.log||Object.defineProperty(se,"log",{writable:!1,value:o.for(se.name)}),this.inputs=Object.assign({},C,t)}async checkRequirements(){const{prod:e,dev:t,peer:o}=await z(),a=[],s=Array.from(new Set([...e,...t,...o]).values()).map(e=>e.name);for(const e of this.requirements)s.includes(e)||a.push(e);a.length}help(e){return this.log.info("This is help. I'm no use because I should have been overridden.")}async execute(){const e=b.parseArgs(this.inputs),t=n.accumulate(D).accumulate(e.values),{version:o,help:a,banner:s}=t;if(o)return X();if(a)return this.help(e);let r;s&&oe(this.log.for(oe,{timestamp:!1,style:!1,context:!1,logLevel:!1}));try{r=await this.run(t)}catch(e){throw e}return r}}class ne{static{this.log=o.for(ne)}static async downloadFile(e){return new Promise((t,o)=>{!function e(a){a=encodeURI(a),f.get(a,s=>{if(301===s.statusCode||307===s.statusCode)return e(s.headers.location);if(200!==s.statusCode)return ne.log.error(`Failed to fetch ${a} (status: ${s.statusCode})`),o(Error("Failed to fetch "+a));let n="";s.on("data",e=>{n+=e}),s.on("error",e=>{o(e)}),s.on("end",()=>{t(n)})})}(e)})}}function re(e){return e?Array.isArray(e)?e.map(e=>(""+e).trim()).filter(Boolean):(""+e).split(",").map(e=>e.trim()).filter(Boolean):[]}function ie(e){return e.replace(/^@/,"").split(/[/\-_.]+/).filter(Boolean).map((e,t)=>0===t?e.replace(/[^a-zA-Z0-9]/g,""):`${e.charAt(0).toUpperCase()}${e.slice(1)}`).join("")}function ce(){let e;try{e=_(process.cwd())}catch{e=void 0}try{if(!e||!(Object.keys(e.dependencies||{}).length>0||Object.keys(e.devDependencies||{}).length>0||Object.keys(e.peerDependencies||{}).length>0)){const t=c.resolve(__dirname,"../../..");try{e=_(t)}catch{}}}catch{}const t=Object.keys(e&&e.dependencies||{}),o=Object.keys(e&&e.peerDependencies||{}),a=Object.keys(e&&e.devDependencies||{});return Array.from(new Set([...t,...o,...a]))}const le="##PACKAGE_SIZE##";var ge,de;(e=>{e.CJS="commonjs",e.ESM="es2022"})(ge||(ge={})),(e=>{e.BUILD="build",e.BUNDLE="bundle",e.ALL="all"})(de||(de={}));const fe={prod:{type:"boolean",default:!1},dev:{type:"boolean",default:!1},buildMode:{type:"string",default:de.ALL},includes:{type:"string",default:""},externals:{type:"string",default:""},docs:{type:"boolean",default:!1},commands:{type:"boolean",default:!1},banner:{type:"boolean",default:!1}},he=(e=".cjs")=>{const t=ue.log.for(he),o=new Map;return a=>s=>{const n=c.dirname(s.fileName);function r(a){const s=JSON.stringify([n,a]),r=o.get(s);if(null!=r)return r;let l,g=a;try{g=c.resolve(n,g+".ts")}catch(e){throw Error(`Failed to resolve path ${a}: ${e}`)}try{l=i.statSync(g)}catch(e){try{t.verbose(`Testing existence of path ${g} as a folder defaulting to index file`),l=i.statSync(g.replace(/\.ts$/gm,""))}catch(t){throw Error(`Failed to resolve path ${a}: ${e}, ${t}`)}}if(l.isDirectory()&&(g=g.replace(/\.ts$/gm,"/index.ts")),c.isAbsolute(g)){const t=(/\.tsx?$/.exec(c.basename(g))||[])[0]||void 0;g="./"+c.relative(n,c.resolve(c.dirname(g),c.basename(g,t)+e))}return o.set(s,g),g}return w.visitNode(s,function e(t){if((e=>!(!w.isImportDeclaration(e)&&!w.isExportDeclaration(e)||void 0===e.moduleSpecifier||!w.isStringLiteral(e.moduleSpecifier)||!e.moduleSpecifier.text.startsWith("./")&&!e.moduleSpecifier.text.startsWith("../")||""!==c.extname(e.moduleSpecifier.text)))(t)){if(w.isImportDeclaration(t)){const e=r(t.moduleSpecifier.text),o=a.factory.createStringLiteral(e);return a.factory.updateImportDeclaration(t,t.modifiers,t.importClause,o,void 0)}if(w.isExportDeclaration(t)){const e=r(t.moduleSpecifier.text),o=a.factory.createStringLiteral(e);return a.factory.updateExportDeclaration(t,t.modifiers,t.isTypeOnly,t.exportClause,o,void 0)}}return w.visitEachChild(t,e,a)})}};class ue extends se{constructor(){super("BuildScripts",Object.assign({},C,fe)),this.replacements={};const e=_(),{name:t,version:o}=e;this.pkgName=t.includes("@")?t.split("/")[1]:t,this.pkgVersion=o,this.replacements["0.4.6"]=this.pkgVersion,this.replacements["@decaf-ts/utils"]=t}patchFiles(e){const t=this.log.for(this.patchFiles),{name:o,version:a}=_();t.info(`Patching ${o} ${a} module in ${e}...`),i.statSync(e).isDirectory()&&i.readdirSync(e,{withFileTypes:!0,recursive:!0}).filter(e=>e.isFile()).forEach(e=>M(c.join(e.parentPath,e.name),this.replacements)),t.verbose(`Module ${o} ${a} patched in ${e}...`)}reportDiagnostics(e,t){const o=this.formatDiagnostics(e);try{this.log[t](o)}catch(e){throw e}return o}formatDiagnostics(e){return e.map(e=>{let t="";if(e.file&&e.start){const{line:o,character:a}=e.file.getLineAndCharacterOfPosition(e.start);t+=`${e.file.fileName} (${o+1},${a+1})`}return t+=": "+w.flattenDiagnosticMessageText(e.messageText,"\n"),t}).join("\n")}readConfigFile(e){const t=i.readFileSync(e).toString(),o=w.parseConfigFileTextToJson(e,t),a=o.config;a||this.reportDiagnostics([o.error],r.error);const s=w.parseJsonConfigFileContent(a,w.sys,c.dirname(e));return s.errors.length>0&&this.reportDiagnostics(s.errors,r.error),s}evalDiagnostics(e){if(e&&e.length>0){const t=e.filter(e=>e.category===w.DiagnosticCategory.Error),o=e.filter(e=>e.category===w.DiagnosticCategory.Warning),a=e.filter(e=>e.category===w.DiagnosticCategory.Suggestion),s=e.filter(e=>e.category===w.DiagnosticCategory.Message);if(o.length&&this.reportDiagnostics(o,r.warn),t.length)throw this.reportDiagnostics(e,r.error),Error(`TypeScript reported ${e.length} diagnostic(s) during check; aborting.`);a.length&&this.reportDiagnostics(a,r.info),s.length&&this.reportDiagnostics(s,r.info)}}preCheckDiagnostics(e){const t=w.getPreEmitDiagnostics(e);this.evalDiagnostics(t)}async checkTsDiagnostics(e,t,o=!1){const a=this.log.for(this.checkTsDiagnostics);let s;try{s=this.readConfigFile("./tsconfig.json")}catch(e){throw Error("Failed to parse tsconfig.json: "+e)}o?(s.options.module=T.AMD,s.options.outDir="dist",s.options.isolatedModules=!1,s.options.outFile=this.pkgName):(s.options.outDir="lib"+(t===ge.ESM?"/esm":""),s.options.module=t===ge.ESM?T.ES2022:T.CommonJS),s.options.inlineSourceMap=!1,s.options.inlineSources=!1,s.options.sourceMap=!0;const n=w.createProgram(s.fileNames,s.options);this.preCheckDiagnostics(n),a.verbose(`TypeScript checks passed (${o?"bundle":"normal"} mode).`)}async buildTs(e,t,o=!1){let a;this.log.for(this.buildTs).info(`Building ${this.pkgName} ${this.pkgVersion} module (${t}) in ${e?"dev":"prod"} mode...`);try{a=this.readConfigFile("./tsconfig.json")}catch(e){throw Error("Failed to parse tsconfig.json: "+e)}o?(a.options.module=T.AMD,a.options.outDir="dist",a.options.isolatedModules=!1,a.options.outFile=this.pkgName):(a.options.outDir="lib"+(t===ge.ESM?"/esm":""),a.options.module=t===ge.ESM?T.ES2022:T.CommonJS),e?(a.options.inlineSourceMap=!0,a.options.inlineSources=!0,a.options.sourceMap=!1):(a.options.inlineSourceMap=!1,a.options.inlineSources=!1,a.options.sourceMap=!0);const s=w.createProgram(a.fileNames,a.options),n={};t===ge.CJS?n.before=[he(".cjs")]:t===ge.ESM&&(n.before=[he(".js")]);const r=s.emit(void 0,void 0,void 0,void 0,n),i=w.getPreEmitDiagnostics(s).concat(r.diagnostics);this.evalDiagnostics(i)}async build(e,t,o=!1){const a=this.log.for(this.build);if(await this.buildTs(e,t,o),a.verbose(`Module ${this.pkgName} ${this.pkgVersion} (${t}) built in ${e?"dev":"prod"} mode...`),t===ge.CJS&&!o){const e=J("lib",e=>e.endsWith(".js")&&!e.includes("/esm/"));for(const t of e){a.verbose(`Patching ${t}'s cjs imports...`);const e=t.replace(".js",".cjs");await R(t,e)}}}copyAssets(e){const t=this.log.for(this.copyAssets);let o=!1;try{o=i.statSync("./src/assets").isDirectory()}catch(e){return t.verbose("No assets found in ./src/assets to copy")}o&&W("./src/assets",`./${e===ge.CJS?"lib":"dist"}/assets`)}async bundle(e,t,o,a="src/index.ts",s=this.pkgName,n,r=["prompts","styled-string-builder","typed-object-accumulator","@decaf-ts/logging"]){await this.checkTsDiagnostics(t,e,!0);const i=e===ge.ESM,c=this.pkgName,l=this.log,g=Array.from(new Set([...re(r)]));let d=re(n);0===d.length&&(d=ce());const f=Array.from(new Set([...(()=>{try{return Array.isArray(y)?y:[]}catch{return["fs","path","process","child_process","util","https","http","os","stream","crypto","zlib","net","tls","url","querystring","assert","events","tty","dns","querystring"]}})(),...d])),w=!t||"inline",T=[u({compilerOptions:{module:"esnext",declaration:!1,outDir:o?"bin":"dist",sourceMap:!t,inlineSourceMap:!!t,inlineSources:!!t},include:["src/**/*.ts"],exclude:["node_modules","**/*.spec.ts"],tsconfig:"./tsconfig.json"}),S()];o&&T.push(p({include:[],exclude:d}),m({resolveOnly:g}));try{const v=await import("@rollup/plugin-terser"),k=v&&v.terser||v.default||v,$={parse:{ecma:2020},compress:!1,mangle:!1,format:{comments:!1,beautify:!0}},E={parse:{ecma:2020},compress:{ecma:2020,passes:5,drop_console:!0,drop_debugger:!0,toplevel:!0,module:i,unsafe:!0,unsafe_arrows:!0,unsafe_comps:!0,collapse_vars:!0,reduce_funcs:!0,reduce_vars:!0},mangle:{toplevel:!0},format:{comments:!1,ascii_only:!0},toplevel:!0};T.push(k(t?$:E))}catch{}const b={input:a,plugins:T,external:f,onwarn:void 0,treeshake:!t},C={};f.forEach(e=>{C[e]=ie(e)});const D=[{file:`${o?"bin/":"dist/"}${s||".bundle."+(t?"":"min")}${i?".js":".cjs"}`,format:o?"cjs":i?"esm":"umd",name:c,esModule:i,sourcemap:w,globals:C,exports:"auto"}];try{const F=await h(b);async function I(e){for(const t of D)await e.write(t)}l.verbose(F.watchFiles),await I(F)}catch(x){throw Error("Failed to bundle: "+x)}}async buildByEnv(e,t=de.ALL,o,a){try{G("lib")}catch(e){}try{G("dist")}catch(e){}i.mkdirSync("lib"),i.mkdirSync("dist"),[de.ALL,de.BUILD].includes(t)&&(await this.build(e,ge.ESM),await this.build(e,ge.CJS),this.patchFiles("lib")),[de.ALL,de.BUNDLE].includes(t)&&(await this.bundle(ge.ESM,e,!1,"src/index.ts",this.pkgName,a,o),await this.bundle(ge.CJS,e,!1,"src/index.ts",this.pkgName,a,o),this.patchFiles("dist")),this.copyAssets(ge.CJS),this.copyAssets(ge.ESM)}async buildDev(e=de.ALL,t,o){return this.buildByEnv(!0,e,t,o)}async buildProd(e=de.ALL,t,o){return this.buildByEnv(!1,e,t,o)}async buildDocs(){await O("npm install better-docs taffydb").promise,await O("npx markdown-include ./workdocs/readme-md.json").promise,await O("npx jsdoc -c ./workdocs/jsdocs.json -t ./node_modules/better-docs").promise,await O("npm remove better-docs taffydb").promise,[{src:"workdocs/assets",dest:"./docs/workdocs/assets"},{src:"workdocs/reports/coverage",dest:"./docs/workdocs/reports/coverage"},{src:"workdocs/reports/html",dest:"./docs/workdocs/reports/html"},{src:"workdocs/resources",dest:"./docs/workdocs/resources"},{src:"LICENSE.md",dest:"./docs/LICENSE.md"}].forEach(e=>{const{src:t,dest:o}=e;W(t,o)});try{const e=await Q(c.resolve("dist"));this.replacements[le]=e+" KB"}catch{this.replacements[le]="unknown"}try{M("./README.md",this.replacements)}catch(e){this.log.for(this.buildDocs).verbose("Failed to patch README.md: "+e)}}async run(e){const{dev:t,prod:o,docs:a,buildMode:s,includes:n,externals:r}=e;return t?await this.buildDev(s,n,r):o?await this.buildProd(s,n,r):a?await this.buildDocs():void 0}}const pe={ci:{type:"boolean",default:!0},message:{type:"string",short:"m"},tag:{type:"string",short:"t",default:void 0}};class me extends se{constructor(){super("ReleaseScript",pe)}async prepareVersion(e){const t=this.log.for(this.prepareVersion);return(e=this.testVersion(e||""))||(t.verbose("No release message provided. Prompting for one:"),t.info("Listing latest git tags:"),await O("git tag --sort=-taggerdate | head -n 5").promise,await b.insistForText("tag","Enter the new tag number (accepts v*.*.*[-...])",e=>!!e.toString().match(/^v[0-9]+\.[0-9]+.[0-9]+(-[0-9a-zA-Z-]+)?$/)))}testVersion(e){const t=this.log.for(this.testVersion);switch(e=e.trim().toLowerCase()){case $.PATCH:case $.MINOR:case $.MAJOR:return t.verbose("Using provided SemVer update: "+e,1),e;default:return t.verbose("Testing provided version for SemVer compatibility: "+e,1),RegExp(k).test(e)?(t.verbose("version approved: "+e,1),e):void t.debug("Invalid version number: "+e)}}async prepareMessage(e){const t=this.log.for(this.prepareMessage);return e||(t.verbose("No release message provided. Prompting for one"),await b.insistForText("message","What should be the release message/ticket?",e=>!!e&&e.toString().length>5))}async run(e){let t;const{ci:o}=e;let{tag:a,message:s}=e;a=await this.prepareVersion(a),s=await this.prepareMessage(s),t=await O(`npm run prepare-release -- ${a} ${s}`,{cwd:process.cwd()}).promise,t=await O("git status --porcelain").promise,await t,t.logs.length&&await b.askConfirmation("git-changes","Do you want to push the changes to the remote repository?",!0)&&(await O("git add .").promise,await O(`git commit -m "${a} - ${s} - after release preparation${o?"":E}"`).promise),await O(`npm version "${a}" -m "${s}${o?"":E}"`).promise,await O("git push --follow-tags").promise,o||await O("NPM_TOKEN=$(cat .npmtoken) npm publish --access public").promise}}const Se="https://raw.githubusercontent.com/decaf-ts/ts-workspace/master",ye={templates:[".github/ISSUE_TEMPLATE/bug_report.md",".github/ISSUE_TEMPLATE/feature_request.md",".github/FUNDING.yml"],workflows:[".github/workflows/codeql-analysis.yml",".github/workflows/jest-coverage.yaml",".github/workflows/nodejs-build-prod.yaml",".github/workflows/pages.yaml",".github/workflows/publish-on-release.yaml",".github/workflows/release-on-tag.yaml",".github/workflows/snyk-analysis.yaml"],ide:[".idea/runConfigurations/All Tests.run.xml",".idea/runConfigurations/build.run.xml",".idea/runConfigurations/build_prod.run.xml",".idea/runConfigurations/coverage.run.xml",".idea/runConfigurations/docs.run.xml",".idea/runConfigurations/drawings.run.xml",".idea/runConfigurations/flash-forward.run.xml",".idea/runConfigurations/Integration_Tests.run.xml",".idea/runConfigurations/Bundling_Tests.run.xml",".idea/runConfigurations/lint-fix.run.xml",".idea/runConfigurations/release.run.xml",".idea/runConfigurations/test_circular.run.xml",".idea/runConfigurations/uml.run.xml",".idea/runConfigurations/Unit Tests.run.xml",".idea/runConfigurations/update-scripts.run.xml"],docs:["workdocs/tutorials/Contributing.md","workdocs/tutorials/Documentation.md","workdocs/tutorials/For Developers.md","workdocs/2-Badges.md","workdocs/jsdocs.json","workdocs/readme-md.json"],styles:[".prettierrc","eslint.config.js"],scripts:["bin/update-scripts.cjs","bin/tag-release.cjs","bin/build-scripts.cjs"],tests:["jest.config.ts","workdocs/reports/jest.coverage.config.ts"],typescript:["tsconfig.json"],docker:["Dockerfile"],automation:["workdocs/confluence/Continuous Integration-Deployment/GitHub.md","workdocs/confluence/Continuous Integration-Deployment/Jira.md","workdocs/confluence/Continuous Integration-Deployment/Teams.md"]},we={boot:{type:"boolean"},org:{type:"string",short:"o"},name:{type:"string",short:"n",default:void 0},author:{type:"string",short:"a",default:void 0},all:{type:"boolean"},license:{type:"string",message:"Pick the license"},scripts:{type:"boolean"},styles:{type:"boolean"},docs:{type:"boolean"},ide:{type:"boolean"},workflows:{type:"boolean"},templates:{type:"boolean"},typescript:{type:"boolean"},docker:{type:"boolean"},pkg:{type:"boolean"},dependencies:{type:"boolean"},tests:{type:"boolean"},automation:{type:"boolean"}};class Te extends se{constructor(){super("TemplateSync",we),this.replacements={},this.getStyles=()=>this.downloadOption("styles"),this.getTemplates=()=>this.downloadOption("templates"),this.getWorkflows=()=>this.downloadOption("workflows"),this.getDocs=()=>this.downloadOption("docs"),this.getTypescript=()=>this.downloadOption("typescript"),this.getAutomation=()=>this.downloadOption("automation"),this.getTests=()=>this.downloadOption("tests"),this.getDocker=()=>this.downloadOption("docker")}loadValuesFromPackage(){const e=process.cwd(),t=_(e,"author");let o,a=_(e,"name");if(a.startsWith("@")){const e=a.split("/");a=e[1],o=e[0].replace("@","")}["Tiago Venceslau","TiagoVenceslau","${author}"].forEach(e=>this.replacements[e]=t),["TS-Workspace","ts-workspace","${name}"].forEach(e=>this.replacements[e]=a),["decaf-ts","${org}"].forEach(e=>this.replacements[e]=o||'""'),this.replacements["${org_or_owner}"]=o||a}async downloadOption(e){if(!(e in ye))throw Error(`Option "${e}" not found in options`);const t=ye[e];for(const e of t){this.log.info("Downloading "+e);let t=await ne.downloadFile(`${Se}/${e}`);t=a(t,this.replacements),L(c.join(process.cwd(),e),t)}}async getLicense(e){this.log.info(`Downloading ${e} license`);const t=`${Se}/workdocs/licenses/${e}.md`;let o=await ne.downloadFile(t);o=a(o,this.replacements),L(c.join(process.cwd(),"LICENSE.md"),o),V("license",e)}async getIde(){i.mkdirSync(c.join(process.cwd(),".idea","runConfigurations"),{recursive:!0}),await this.downloadOption("ide")}async getScripts(){await this.downloadOption("scripts"),this.log.info("please re-run the command"),process.exit(0)}async initPackage(e,t,o){try{const a=_();delete a[F],a.name=e,a.version="0.0.1",a.author=t,a.license=o,i.writeFileSync("package.json",JSON.stringify(a,null,2))}catch(e){throw Error("Error fixing package.json: "+e)}}async updatePackageScrips(){try{const e=JSON.parse(await ne.downloadFile(Se+"/package.json")),{scripts:t}=e,o=_();Object.keys(o.scripts).forEach(e=>{if(e in t){const s=a(t[e],this.replacements);s!==t[e]&&(o.scripts[e]=s)}}),o.exports.require=e.exports.require,o.exports.import=e.exports.import,o.types=e.types,i.writeFileSync("package.json",JSON.stringify(o,null,2))}catch(e){throw Error("Error fixing package.json scripts: "+e)}}async createTokenFiles(){const e=this.log.for(this.createTokenFiles),t=await b.insistForText("token","please input your github token",e=>!!e.match(/^ghp_[0-9a-zA-Z]{36}$/g));Object.values(I).forEach(o=>{try{let a;try{a=i.existsSync(o)}catch(a){return e.info(`Token file ${o} not found. Creating a new one...`),void i.writeFileSync(o,".token"===o?t:"")}a||i.writeFileSync(o,".token"===o?t:"")}catch(e){throw Error(`Error creating token file ${o}: ${e}`)}})}async getOrg(){const e=await b.askText("Organization","Enter the organization name (will be used to scope your npm project. leave blank to create a unscoped project):");return await b.askConfirmation("Confirm organization","Is this organization correct?",!0)?e:this.getOrg()}async auditFix(){return await O("npm audit fix --force").promise}patchFiles(){const e=[...i.readdirSync(c.join(process.cwd(),"src"),{recursive:!0,withFileTypes:!0}).filter(e=>e.isFile()).map(e=>c.join(e.parentPath,e.name)),...i.readdirSync(c.join(process.cwd(),"workdocs"),{recursive:!0,withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(".md")).map(e=>c.join(e.parentPath,e.name)),c.join(process.cwd(),".gitlab-ci.yml"),c.join(process.cwd(),"workdocs","jsdocs.json")];for(const t of e)M(t,this.replacements)}async updateDependencies(){try{const e=JSON.parse(await ne.downloadFile(Se+"/package.json")),{devDependencies:t}=e,o=_();Object.keys(o.scripts).forEach(e=>{if(e in t){const a=t[e];a!==t[e]&&(o.devDependencies=o.devDependencies||{},o.devDependencies[e]=a)}}),i.writeFileSync("package.json",JSON.stringify(o,null,2)),await O("npm install").promise}catch(e){throw Error("Error fixing package.json dependencies: "+e)}}async run(e){let{license:t}=e;const{boot:o}=e;let{all:a,scripts:s,styles:n,docs:r,ide:i,workflows:c,templates:l,docker:g,typescript:d,dependencies:f,tests:h,automation:u,pkg:p}=e;if((s||n||r||i||c||l||g||d||u||f||h||p)&&(a=!1),o){const e=await this.getOrg(),o=await b.insistForText("Project name","Enter the project name:",e=>e.length>1),a=await b.insistForText("Author","Enter the author name:",e=>e.length>1),s=e?`@${e}/${o}`:o;await this.initPackage(s,a,t),await this.createTokenFiles(),await this.auditFix(),this.patchFiles()}a&&(s=!1,n=!0,r=!0,i=!0,c=!0,l=!0,g=!0,d=!0,p=!0,f=!0,h=!0,u=!1),void 0===s&&(s=await b.askConfirmation("scripts","Do you want to get scripts?",!0)),s&&await this.getScripts(),this.loadValuesFromPackage(),a||void 0!==t||await b.askConfirmation("license","Do you want to set a license?",!0)&&(t=await b.insistForText("license","Enter the desired License (MIT|GPL|Apache|LGPL|AGPL):",e=>!!e&&!!e.match(/^(MIT|GPL|Apache|LGPL|AGPL)$/g))),void 0!==t&&await this.getLicense(t),void 0===i&&(i=await b.askConfirmation("ide","Do you want to get ide configs?",!0)),i&&await this.getIde(),void 0===d&&(d=await b.askConfirmation("typescript","Do you want to get typescript configs?",!0)),d&&await this.getTypescript(),void 0===g&&(g=await b.askConfirmation("docker","Do you want to get docker configs?",!0)),g&&await this.getDocker(),void 0===u&&(u=await b.askConfirmation("automation","Do you want to get automation configs?",!0)),u&&await this.getAutomation(),void 0===n&&(n=await b.askConfirmation("styles","Do you want to get styles?",!0)),n&&await this.getStyles(),void 0===r&&(r=await b.askConfirmation("docs","Do you want to get docs?",!0)),r&&await this.getDocs(),void 0===c&&(c=await b.askConfirmation("workflows","Do you want to get workflows?",!0)),c&&await this.getWorkflows(),void 0===l&&(l=await b.askConfirmation("templates","Do you want to get templates?",!0)),l&&await this.getTemplates(),void 0===p&&(p=await b.askConfirmation("pkg","Do you want to update your package.json scripts?",!0)),p&&await this.updatePackageScrips(),void 0===h&&(h=await b.askConfirmation("pkg","Do you want to update your test configs?",!0)),h&&await this.getTests(),void 0===f&&(f=await b.askConfirmation("pkg","Do you want to update dev dependencies?",!0)),f&&await this.updateDependencies()}}class be extends j{constructor(e,t,o,a="g"){super(e,t);try{this.regexp="string"==typeof o?RegExp(o,a):o}catch(e){throw Error("Invalid regular expression: "+e)}}test(e){let t;this.regexp.lastIndex=0;try{t=this.regexp.exec(e)}catch(e){return}return t}testAndResolve(e){const t=this.test(e);t&&this.resolve(t[0])}testAndReject(e){const t=this.test(e);t&&this.reject(t[0])}data(e){super.data(e),this.testAndResolve(e+"")}error(e){super.error(e),this.testAndReject(e+"")}}const Ce="0.4.6",De="@decaf-ts/utils";export{x as AbortCode,ue as BuildScripts,se as Command,C as DefaultCommandOptions,D as DefaultCommandValues,v as Encoding,ne as HttpClient,E as NoCIFLag,De as PACKAGE_NAME,be as RegexpOutputWriter,me as ReleaseScript,$ as SemVersion,k as SemVersionRegex,F as SetupScriptKey,j as StandardOutputWriter,Te as TemplateSync,I as Tokens,b as UserInput,Ce as VERSION,A as chainAbortController,W as copyFile,G as deletePath,J as getAllFiles,z as getDependencies,Q as getFileSizeZipped,_ as getPackage,ce as getPackageDependencies,X as getPackageVersion,ae as getSlogan,Y as installDependencies,K as installIfNotAvailable,N as lockify,Z as normalizeImport,ie as packageToGlobal,re as parseList,M as patchFile,oe as printBanner,q as pushToGit,U as readFile,R as renameFile,O as runCommand,V as setPackageAttribute,B as spawnCommand,H as updateDependencies,L as writeFile};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -107,7 +107,7 @@ function getPackageDependencies() {
|
|
|
107
107
|
const dev = Object.keys((pkg && pkg.devDependencies) || {});
|
|
108
108
|
return Array.from(new Set([...deps, ...peer, ...dev]));
|
|
109
109
|
}
|
|
110
|
-
const VERSION_STRING = "0.4.
|
|
110
|
+
const VERSION_STRING = "0.4.6";
|
|
111
111
|
const PACKAGE_STRING = "@decaf-ts/utils";
|
|
112
112
|
const PACKAGE_SIZE_STRING = "##PACKAGE_SIZE##";
|
|
113
113
|
var Modes;
|
|
@@ -65,7 +65,7 @@ export function getPackageDependencies() {
|
|
|
65
65
|
const dev = Object.keys((pkg && pkg.devDependencies) || {});
|
|
66
66
|
return Array.from(new Set([...deps, ...peer, ...dev]));
|
|
67
67
|
}
|
|
68
|
-
const VERSION_STRING = "0.4.
|
|
68
|
+
const VERSION_STRING = "0.4.6";
|
|
69
69
|
const PACKAGE_STRING = "@decaf-ts/utils";
|
|
70
70
|
const PACKAGE_SIZE_STRING = "##PACKAGE_SIZE##";
|
|
71
71
|
var Modes;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export * from "./writers";
|
|
|
26
26
|
* @const VERSION
|
|
27
27
|
* @memberOf module:utils
|
|
28
28
|
*/
|
|
29
|
-
export declare const VERSION = "0.4.
|
|
29
|
+
export declare const VERSION = "0.4.6";
|
|
30
30
|
/**
|
|
31
31
|
* @description Represents the current version of the module.
|
|
32
32
|
* @summary Stores the version for the @decaf-ts/utils package. The build replaces
|
package/lib/esm/index.js
CHANGED
|
@@ -26,7 +26,7 @@ export * from "./writers/index.js";
|
|
|
26
26
|
* @const VERSION
|
|
27
27
|
* @memberOf module:utils
|
|
28
28
|
*/
|
|
29
|
-
export const VERSION = "0.4.
|
|
29
|
+
export const VERSION = "0.4.6";
|
|
30
30
|
/**
|
|
31
31
|
* @description Represents the current version of the module.
|
|
32
32
|
* @summary Stores the version for the @decaf-ts/utils package. The build replaces
|
package/lib/index.cjs
CHANGED
|
@@ -43,7 +43,7 @@ __exportStar(require("./writers/index.cjs"), exports);
|
|
|
43
43
|
* @const VERSION
|
|
44
44
|
* @memberOf module:utils
|
|
45
45
|
*/
|
|
46
|
-
exports.VERSION = "0.4.
|
|
46
|
+
exports.VERSION = "0.4.6";
|
|
47
47
|
/**
|
|
48
48
|
* @description Represents the current version of the module.
|
|
49
49
|
* @summary Stores the version for the @decaf-ts/utils package. The build replaces
|
package/lib/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export * from "./writers";
|
|
|
26
26
|
* @const VERSION
|
|
27
27
|
* @memberOf module:utils
|
|
28
28
|
*/
|
|
29
|
-
export declare const VERSION = "0.4.
|
|
29
|
+
export declare const VERSION = "0.4.6";
|
|
30
30
|
/**
|
|
31
31
|
* @description Represents the current version of the module.
|
|
32
32
|
* @summary Stores the version for the @decaf-ts/utils package. The build replaces
|