#!/usr/bin/env node
import{createTemplate as e,runTemplateCLI as t}from"bingo";import{intakeDirectory as n}from"bingo-fs";import{handlebars as r}from"bingo-handlebars";import i from"node:path";import{z as a}from"zod";const o=[`minimal`,`web`,`cli`,`library`,`cli+library`,`electron`,`unplugin`],s=/node_modules|pnpm-lock\.yaml/;var c=e({about:{description:`Create a new TypeScript library, CLI, or web project with Kitschpatrol's shared configuration.`,name:`Create Kitschpatrol Project`},options:{type:a.enum(o).default(`minimal`).describe(`The type of project to create`),"author-name":a.string().default(`Eric Mika`).describe(`The name of the author`),"author-email":a.string().default(`eric@ericmika.com`).describe(`The email of the author`),"author-url":a.string().default(`https://ericmika.com`).describe(`The URL of the author`),"cli-command-name":a.string().default(`new-project`).describe(`CLI command name (if applicable)`),"github-owner":a.string().default(`kitschpatrol`).describe(`The owner of the repository`),"github-repository":a.string().default(`new-project`).describe(`The name of the repository / package`),"npm-auth-command":a.string().default(`op read 'op://Personal/npm/token'`).describe(`A shell command that sets the NPM_AUTH_TOKEN env variable with a granular token for publishing to npm`)},async produce({options:e}){let t={...e,year:new Date().getFullYear()};async function a(...n){let a={};for(let o of n)a[o]=await r(i.join(import.meta.dirname,`../templates/${e.type}/${o}`),t);return a}return{files:{...await n(i.join(import.meta.dirname,`../templates/${e.type}`),{exclude:s}),...await a(`license.txt`,`package.json`,...e.type===`unplugin`?[`playground/package.json`,`src/bun.ts`,`src/esbuild.ts`,`src/farm.ts`,`src/index.ts`,`src/rolldown.ts`,`src/rollup.ts`,`src/rspack.ts`,`src/vite.ts`,`src/webpack.ts`,`test/__snapshots__/rollup.test.ts.snap`]:[])},scripts:[{commands:e.type===`electron`?[`pnpm install`,`pnpm run fix`]:[`pnpm install`,`pnpm run build`,`pnpm run fix`],phase:0,silent:!0}],suggestions:[`git commit --amend -m 'Initial commit.'`]}}});process.exitCode=await t(c);export{};