create-better-t-stack 2.5.1 → 2.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -164,4 +164,4 @@ DATABASE_URL="your_connection_string"`)}async function Pe(n){let{projectName:r,p
|
|
|
164
164
|
╔══════════════════╗
|
|
165
165
|
║ Better T-Stack ║
|
|
166
166
|
╚══════════════════╝
|
|
167
|
-
`;console.log(T(Object.values(Q)).multiline(e))}else console.log(T(Object.values(Q)).multiline(Z))},$=()=>process.exit(0);process.on(`SIGINT`,$),process.on(`SIGTERM`,$);async function kt(){let n=Date.now();try{let t=await _(v(process.argv)).scriptName(`create-better-t-stack`).usage(`$0 [project-directory] [options]`,`Create a new Better-T Stack project`).positional(`project-directory`,{describe:`Project name/directory`,type:`string`}).option(`yes`,{alias:`y`,type:`boolean`,describe:`Use default configuration and skip prompts`,default:!1}).option(`database`,{type:`string`,describe:`Database type`,choices:[`none`,`sqlite`,`postgres`,`mysql`,`mongodb`]}).option(`orm`,{type:`string`,describe:`ORM type`,choices:[`drizzle`,`prisma`,`none`]}).option(`auth`,{type:`boolean`,describe:`Include authentication (use --no-auth to exclude)`}).option(`frontend`,{type:`array`,string:!0,describe:`Frontend types`,choices:[`tanstack-router`,`react-router`,`tanstack-start`,`next`,`nuxt`,`native`,`svelte`,`none`]}).option(`addons`,{type:`array`,string:!0,describe:`Additional addons`,choices:[`pwa`,`tauri`,`starlight`,`biome`,`husky`,`turborepo`,`none`]}).option(`examples`,{type:`array`,string:!0,describe:`Examples to include`,choices:[`todo`,`ai`,`none`]}).option(`git`,{type:`boolean`,describe:`Initialize git repository (use --no-git to skip)`}).option(`package-manager`,{alias:`pm`,type:`string`,describe:`Package manager`,choices:[`npm`,`pnpm`,`bun`]}).option(`install`,{type:`boolean`,describe:`Install dependencies (use --no-install to skip)`}).option(`db-setup`,{type:`string`,describe:`Database setup`,choices:[`turso`,`neon`,`prisma-postgres`,`mongodb-atlas`,`none`]}).option(`backend`,{type:`string`,describe:`Backend framework`,choices:[`hono`,`express`,`next`,`elysia`,`convex`]}).option(`runtime`,{type:`string`,describe:`Runtime`,choices:[`bun`,`node`,`none`]}).option(`api`,{type:`string`,describe:`API type`,choices:[`trpc`,`orpc`,`none`]}).completion().recommendCommands().version(Dt()).alias(`version`,`v`).help().alias(`help`,`h`).strict().wrap(null).parse(),r=t,a=r.projectDirectory;Ot();let s=At(r,a);i(g.magenta(`Creating a new Better-T-Stack project`)),!r.yes&&Object.keys(s).length>0&&(o.info(g.yellow(`Using these pre-selected options:`)),o.message(X(s)),o.message(``));let l;r.yes?(l={...A,projectName:a??A.projectName,...s},l.backend===`convex`?(l.auth=!1,l.database=`none`,l.orm=`none`,l.api=`none`,l.runtime=`none`,l.dbSetup=`none`):l.database===`none`&&(l.orm=`none`,l.auth=!1,l.dbSetup=`none`),o.info(g.yellow(`Using these default/flag options:`)),o.message(X(l)),o.message(``)):l=await Tt(s);let u=e.resolve(process.cwd(),l.projectName);if(h.pathExistsSync(u)&&h.readdirSync(u).length>0){let e=await Y();l.projectName=e}await ut(l),o.success(g.blue(`You can reproduce this setup with the following command:\n${Et(l)}`));let d=((Date.now()-n)/1e3).toFixed(2);c(g.magenta(`Project created successfully in ${g.bold(d)} seconds!`))}catch(e){e instanceof Error?(e.name===`YError`?t(g.red(`Invalid arguments: ${e.message}`)):(m.error(`An unexpected error occurred: ${e.message}`),e.message.includes(`is only supported with`)||m.error(e.stack)),process.exit(1)):(m.error(`An unexpected error occurred.`),console.error(e),process.exit(1))}}function At(e,t){let n={},r=new Set(Object.keys(e).filter(e=>e!==`_`&&e!==`$0`));if(e.backend&&(n.backend=e.backend),r.has(`backend`)&&n.backend&&n.backend!==`convex`&&(r.has(`api`)&&e.api===`none`&&(m.fatal(`'--api none' is only supported with '--backend convex'. Please choose 'trpc', 'orpc', or remove the --api flag.`),process.exit(1)),r.has(`runtime`)&&e.runtime===`none`&&(m.fatal(`'--runtime none' is only supported with '--backend convex'. Please choose 'bun', 'node', or remove the --runtime flag.`),process.exit(1))),e.database&&(n.database=e.database),e.orm&&(n.orm=e.orm),e.auth!==void 0&&(n.auth=e.auth),e.git!==void 0&&(n.git=e.git),e.install!==void 0&&(n.install=e.install),e.runtime&&(n.runtime=e.runtime),e.api&&(n.api=e.api),e.dbSetup&&(n.dbSetup=e.dbSetup),e.packageManager&&(n.packageManager=e.packageManager),t&&(n.projectName=t),e.frontend&&e.frontend.length>0)if(e.frontend.includes(`none`))e.frontend.length>1&&(m.fatal(`Cannot combine 'none' with other frontend options.`),process.exit(1)),n.frontend=[];else{let t=e.frontend.filter(e=>e!==`none`),r=t.filter(e=>e===`tanstack-router`||e===`react-router`||e===`tanstack-start`||e===`next`||e===`nuxt`||e===`svelte`);r.length>1&&(m.fatal(`Cannot select multiple web frameworks. Choose only one of: tanstack-router, tanstack-start, react-router, next, nuxt, svelte`),process.exit(1)),n.frontend=t}if(e.addons&&e.addons.length>0&&(e.addons.includes(`none`)?(e.addons.length>1&&(m.fatal(`Cannot combine 'none' with other addons.`),process.exit(1)),n.addons=[]):n.addons=e.addons.filter(e=>e!==`none`)),e.examples&&e.examples.length>0&&(e.examples.includes(`none`)?(e.examples.length>1&&(m.fatal(`Cannot combine 'none' with other examples.`),process.exit(1)),n.examples=[]):(n.examples=e.examples.filter(e=>e!==`none`),n.backend!==`convex`&&e.examples.includes(`none`)&&(n.examples=[]))),n.backend===`convex`){let t=[];r.has(`auth`)&&e.auth===!0&&t.push(`--auth`),r.has(`database`)&&e.database!==`none`&&t.push(`--database ${e.database}`),r.has(`orm`)&&e.orm!==`none`&&t.push(`--orm ${e.orm}`),r.has(`api`)&&e.api!==`none`&&t.push(`--api ${e.api}`),r.has(`runtime`)&&e.runtime!==`none`&&t.push(`--runtime ${e.runtime}`),r.has(`dbSetup`)&&e.dbSetup!==`none`&&t.push(`--db-setup ${e.dbSetup}`),r.has(`examples`)&&t.push(`--examples`),t.length>0&&(m.fatal(`The following flags are incompatible with '--backend convex': ${t.join(`, `)}. Please remove them. The 'todo' example is included automatically with Convex.`),process.exit(1)),n.auth=!1,n.database=`none`,n.orm=`none`,n.api=`none`,n.runtime=`none`,n.dbSetup=`none`,n.examples=[`todo`]}else{let t=n.database??(e.yes?A.database:void 0),i=n.orm??(e.yes?A.orm:void 0),a=n.auth??(e.yes?A.auth:void 0),o=n.dbSetup??(e.yes?A.dbSetup:void 0),s=n.examples??(e.yes?A.examples:void 0),c=n.frontend??(e.yes?A.frontend:void 0),l=n.api??(e.yes?A.api:void 0),u=n.backend??(e.yes?A.backend:void 0);if(t===`none`&&(r.has(`orm`)&&e.orm!==`none`&&(m.fatal(`Cannot use ORM '--orm ${e.orm}' when database is 'none'.`),process.exit(1)),n.orm=`none`,r.has(`auth`)&&e.auth===!0&&(m.fatal(`Authentication requires a database. Cannot use --auth when database is 'none'.`),process.exit(1)),n.auth=!1,r.has(`dbSetup`)&&e.dbSetup!==`none`&&(m.fatal(`Database setup '--db-setup ${e.dbSetup}' requires a database. Cannot use when database is 'none'.`),process.exit(1)),n.dbSetup=`none`),t===`mongodb`&&i===`drizzle`&&(m.fatal(`MongoDB is only available with Prisma. Cannot use --database mongodb with --orm drizzle`),process.exit(1)),n.dbSetup&&n.dbSetup!==`none`){let e=n.dbSetup;e===`turso`?(t&&t!==`sqlite`&&(m.fatal(`Turso setup requires SQLite. Cannot use --db-setup turso with --database ${t}`),process.exit(1)),i===`prisma`&&(m.fatal(`Turso setup is not compatible with Prisma. Cannot use --db-setup turso with --orm prisma`),process.exit(1)),n.database=`sqlite`,n.orm=`drizzle`):e===`prisma-postgres`?(t&&t!==`postgres`&&(m.fatal(`Prisma PostgreSQL setup requires PostgreSQL. Cannot use --db-setup prisma-postgres with --database ${t}.`),process.exit(1)),i&&i!==`prisma`&&i!==`none`&&(m.fatal(`Prisma PostgreSQL setup requires Prisma ORM. Cannot use --db-setup prisma-postgres with --orm ${i}.`),process.exit(1)),n.database=`postgres`,n.orm=`prisma`):e===`mongodb-atlas`?(t&&t!==`mongodb`&&(m.fatal(`MongoDB Atlas setup requires MongoDB. Cannot use --db-setup mongodb-atlas with --database ${t}.`),process.exit(1)),i&&i!==`prisma`&&i!==`none`&&(m.fatal(`MongoDB Atlas setup requires Prisma ORM. Cannot use --db-setup mongodb-atlas with --orm ${i}.`),process.exit(1)),n.database=`mongodb`,n.orm=`prisma`):e===`neon`&&(t&&t!==`postgres`&&(m.fatal(`Neon PostgreSQL setup requires PostgreSQL. Cannot use --db-setup neon with --database ${t}.`),process.exit(1)),n.database=`postgres`)}let d=c?.includes(`nuxt`),f=c?.includes(`svelte`);if((d||f)&&l===`trpc`&&(m.fatal(`tRPC API is not supported with '${d?`nuxt`:`svelte`}' frontend. Please use --api orpc or remove '${d?`nuxt`:`svelte`}' from --frontend.`),process.exit(1)),(d||f)&&l!==`orpc`&&(!e.api||e.yes&&e.api!==`trpc`)&&n.api!==`none`&&(n.api=`orpc`),n.addons&&n.addons.length>0){let e=[`pwa`,`tauri`],t=n.addons.some(t=>e.includes(t)),r=c?.some(e=>e===`tanstack-router`||e===`react-router`||e===`nuxt`&&n.addons?.includes(`tauri`)&&!n.addons?.includes(`pwa`)||e===`svelte`&&n.addons?.includes(`tauri`)&&!n.addons?.includes(`pwa`));if(t&&!r){let e=``;n.addons.includes(`pwa`)&&d?e=`PWA addon is not compatible with Nuxt.`:(n.addons.includes(`pwa`)||n.addons.includes(`tauri`))&&(e=`PWA and Tauri addons require tanstack-router, react-router, or Nuxt/Svelte (Tauri only).`),m.fatal(`${e} Cannot use these addons with your frontend selection.`),process.exit(1)}n.addons.includes(`husky`)&&!n.addons.includes(`biome`)&&m.warn(`Husky addon is recommended to be used with Biome for lint-staged configuration.`),n.addons=[...new Set(n.addons)]}let p=c&&c.length===1&&c[0]===`native`;if(p&&n.examples&&n.examples.length>0&&!n.examples.includes(`none`)&&(m.fatal(`Examples are not supported when only the 'native' frontend is selected.`),process.exit(1)),n.examples&&n.examples.length>0&&!n.examples.includes(`none`)){n.examples.includes(`todo`)&&u!==`convex`&&t===`none`&&(m.fatal(`The 'todo' example requires a database (unless using Convex). Cannot use --examples todo when database is 'none'.`),process.exit(1)),n.examples.includes(`ai`)&&u===`elysia`&&(m.fatal(`The 'ai' example is not compatible with the Elysia backend.`),process.exit(1));let e=c?.some(e=>[`tanstack-router`,`react-router`,`tanstack-start`,`next`,`nuxt`,`svelte`].includes(e)),r=!c||c.length===0}}return n}kt().catch(e=>{m.error(`Aborting installation due to unexpected error...`),e instanceof Error?!e.message.includes(`is only supported with`)&&!e.message.includes(`incompatible with`)&&(m.error(e.message),m.error(e.stack)):console.error(e),process.exit(1)});
|
|
167
|
+
`;console.log(T(Object.values(Q)).multiline(e))}else console.log(T(Object.values(Q)).multiline(Z))},$=()=>process.exit(0);process.on(`SIGINT`,$),process.on(`SIGTERM`,$);async function kt(){let n=Date.now();try{let t=await _(v(process.argv)).scriptName(`create-better-t-stack`).usage(`$0 [project-directory] [options]`,`Create a new Better-T Stack project`).positional(`project-directory`,{describe:`Project name/directory`,type:`string`}).option(`yes`,{alias:`y`,type:`boolean`,describe:`Use default configuration and skip prompts`,default:!1}).option(`database`,{type:`string`,describe:`Database type`,choices:[`none`,`sqlite`,`postgres`,`mysql`,`mongodb`]}).option(`orm`,{type:`string`,describe:`ORM type`,choices:[`drizzle`,`prisma`,`none`]}).option(`auth`,{type:`boolean`,describe:`Include authentication (use --no-auth to exclude)`}).option(`frontend`,{type:`array`,string:!0,describe:`Frontend types`,choices:[`tanstack-router`,`react-router`,`tanstack-start`,`next`,`nuxt`,`native`,`svelte`,`none`]}).option(`addons`,{type:`array`,string:!0,describe:`Additional addons`,choices:[`pwa`,`tauri`,`starlight`,`biome`,`husky`,`turborepo`,`none`]}).option(`examples`,{type:`array`,string:!0,describe:`Examples to include`,choices:[`todo`,`ai`,`none`]}).option(`git`,{type:`boolean`,describe:`Initialize git repository (use --no-git to skip)`}).option(`package-manager`,{alias:`pm`,type:`string`,describe:`Package manager`,choices:[`npm`,`pnpm`,`bun`]}).option(`install`,{type:`boolean`,describe:`Install dependencies (use --no-install to skip)`}).option(`db-setup`,{type:`string`,describe:`Database setup`,choices:[`turso`,`neon`,`prisma-postgres`,`mongodb-atlas`,`none`]}).option(`backend`,{type:`string`,describe:`Backend framework`,choices:[`hono`,`express`,`next`,`elysia`,`convex`]}).option(`runtime`,{type:`string`,describe:`Runtime`,choices:[`bun`,`node`,`none`]}).option(`api`,{type:`string`,describe:`API type`,choices:[`trpc`,`orpc`,`none`]}).completion().recommendCommands().version(Dt()).alias(`version`,`v`).help().alias(`help`,`h`).strict().wrap(null).parse(),r=t,a=r.projectDirectory;Ot();let s=At(r,a);i(g.magenta(`Creating a new Better-T-Stack project`)),!r.yes&&Object.keys(s).length>0&&(o.info(g.yellow(`Using these pre-selected options:`)),o.message(X(s)),o.message(``));let l;r.yes?(l={...A,projectName:a??A.projectName,...s},l.backend===`convex`?(l.auth=!1,l.database=`none`,l.orm=`none`,l.api=`none`,l.runtime=`none`,l.dbSetup=`none`):l.database===`none`&&(l.orm=`none`,l.auth=!1,l.dbSetup=`none`),o.info(g.yellow(`Using these default/flag options:`)),o.message(X(l)),o.message(``)):l=await Tt(s);let u=e.resolve(process.cwd(),l.projectName);if(h.pathExistsSync(u)&&h.readdirSync(u).length>0){let e=await Y();l.projectName=e}await ut(l),o.success(g.blue(`You can reproduce this setup with the following command:\n${Et(l)}`));let d=((Date.now()-n)/1e3).toFixed(2);c(g.magenta(`Project created successfully in ${g.bold(d)} seconds!`))}catch(e){e instanceof Error?(e.name===`YError`?t(g.red(`Invalid arguments: ${e.message}`)):(m.error(`An unexpected error occurred: ${e.message}`),e.message.includes(`is only supported with`)||m.error(e.stack)),process.exit(1)):(m.error(`An unexpected error occurred.`),console.error(e),process.exit(1))}}function At(e,t){let n={},r=new Set(Object.keys(e).filter(e=>e!==`_`&&e!==`$0`));if(e.api&&(n.api=e.api,e.api===`none`&&(e.backend&&e.backend!==`convex`&&(m.fatal(`'--api none' is only supported with '--backend convex'. Please choose a different API setting or use '--backend convex'.`),process.exit(1)),n.backend=`convex`)),e.backend&&(n.backend=e.backend),r.has(`backend`)&&n.backend&&n.backend!==`convex`&&(r.has(`api`)&&e.api===`none`&&(m.fatal(`'--api none' is only supported with '--backend convex'. Please choose 'trpc', 'orpc', or remove the --api flag.`),process.exit(1)),r.has(`runtime`)&&e.runtime===`none`&&(m.fatal(`'--runtime none' is only supported with '--backend convex'. Please choose 'bun', 'node', or remove the --runtime flag.`),process.exit(1))),e.database&&(n.database=e.database),e.orm&&(n.orm=e.orm),e.auth!==void 0&&(n.auth=e.auth),e.git!==void 0&&(n.git=e.git),e.install!==void 0&&(n.install=e.install),e.runtime&&(n.runtime=e.runtime),e.dbSetup&&(n.dbSetup=e.dbSetup),e.packageManager&&(n.packageManager=e.packageManager),t&&(n.projectName=t),e.frontend&&e.frontend.length>0)if(e.frontend.includes(`none`))e.frontend.length>1&&(m.fatal(`Cannot combine 'none' with other frontend options.`),process.exit(1)),n.frontend=[];else{let t=e.frontend.filter(e=>e!==`none`),r=t.filter(e=>e===`tanstack-router`||e===`react-router`||e===`tanstack-start`||e===`next`||e===`nuxt`||e===`svelte`);r.length>1&&(m.fatal(`Cannot select multiple web frameworks. Choose only one of: tanstack-router, tanstack-start, react-router, next, nuxt, svelte`),process.exit(1)),n.frontend=t}if(e.addons&&e.addons.length>0&&(e.addons.includes(`none`)?(e.addons.length>1&&(m.fatal(`Cannot combine 'none' with other addons.`),process.exit(1)),n.addons=[]):n.addons=e.addons.filter(e=>e!==`none`)),e.examples&&e.examples.length>0&&(e.examples.includes(`none`)?(e.examples.length>1&&(m.fatal(`Cannot combine 'none' with other examples.`),process.exit(1)),n.examples=[]):(n.examples=e.examples.filter(e=>e!==`none`),n.backend!==`convex`&&e.examples.includes(`none`)&&(n.examples=[]))),n.backend===`convex`){let t=[];r.has(`auth`)&&e.auth===!0&&t.push(`--auth`),r.has(`database`)&&e.database!==`none`&&t.push(`--database ${e.database}`),r.has(`orm`)&&e.orm!==`none`&&t.push(`--orm ${e.orm}`),r.has(`api`)&&e.api!==`none`&&t.push(`--api ${e.api}`),r.has(`runtime`)&&e.runtime!==`none`&&t.push(`--runtime ${e.runtime}`),r.has(`dbSetup`)&&e.dbSetup!==`none`&&t.push(`--db-setup ${e.dbSetup}`),r.has(`examples`)&&t.push(`--examples`),t.length>0&&(m.fatal(`The following flags are incompatible with '--backend convex': ${t.join(`, `)}. Please remove them. The 'todo' example is included automatically with Convex.`),process.exit(1)),n.auth=!1,n.database=`none`,n.orm=`none`,n.api=`none`,n.runtime=`none`,n.dbSetup=`none`,n.examples=[`todo`]}else{let t=n.database??(e.yes?A.database:void 0),i=n.orm??(e.yes?A.orm:void 0),a=n.auth??(e.yes?A.auth:void 0),o=n.dbSetup??(e.yes?A.dbSetup:void 0),s=n.examples??(e.yes?A.examples:void 0),c=n.frontend??(e.yes?A.frontend:void 0),l=n.api??(e.yes?A.api:void 0),u=n.backend??(e.yes?A.backend:void 0);if(t===`none`&&(r.has(`orm`)&&e.orm!==`none`&&(m.fatal(`Cannot use ORM '--orm ${e.orm}' when database is 'none'.`),process.exit(1)),n.orm=`none`,r.has(`auth`)&&e.auth===!0&&(m.fatal(`Authentication requires a database. Cannot use --auth when database is 'none'.`),process.exit(1)),n.auth=!1,r.has(`dbSetup`)&&e.dbSetup!==`none`&&(m.fatal(`Database setup '--db-setup ${e.dbSetup}' requires a database. Cannot use when database is 'none'.`),process.exit(1)),n.dbSetup=`none`),t===`mongodb`&&i===`drizzle`&&(m.fatal(`MongoDB is only available with Prisma. Cannot use --database mongodb with --orm drizzle`),process.exit(1)),n.dbSetup&&n.dbSetup!==`none`){let e=n.dbSetup;e===`turso`?(t&&t!==`sqlite`&&(m.fatal(`Turso setup requires SQLite. Cannot use --db-setup turso with --database ${t}`),process.exit(1)),i===`prisma`&&(m.fatal(`Turso setup is not compatible with Prisma. Cannot use --db-setup turso with --orm prisma`),process.exit(1)),n.database=`sqlite`,n.orm=`drizzle`):e===`prisma-postgres`?(t&&t!==`postgres`&&(m.fatal(`Prisma PostgreSQL setup requires PostgreSQL. Cannot use --db-setup prisma-postgres with --database ${t}.`),process.exit(1)),i&&i!==`prisma`&&i!==`none`&&(m.fatal(`Prisma PostgreSQL setup requires Prisma ORM. Cannot use --db-setup prisma-postgres with --orm ${i}.`),process.exit(1)),n.database=`postgres`,n.orm=`prisma`):e===`mongodb-atlas`?(t&&t!==`mongodb`&&(m.fatal(`MongoDB Atlas setup requires MongoDB. Cannot use --db-setup mongodb-atlas with --database ${t}.`),process.exit(1)),i&&i!==`prisma`&&i!==`none`&&(m.fatal(`MongoDB Atlas setup requires Prisma ORM. Cannot use --db-setup mongodb-atlas with --orm ${i}.`),process.exit(1)),n.database=`mongodb`,n.orm=`prisma`):e===`neon`&&(t&&t!==`postgres`&&(m.fatal(`Neon PostgreSQL setup requires PostgreSQL. Cannot use --db-setup neon with --database ${t}.`),process.exit(1)),n.database=`postgres`)}let d=c?.includes(`nuxt`),f=c?.includes(`svelte`);if((d||f)&&l===`trpc`&&(m.fatal(`tRPC API is not supported with '${d?`nuxt`:`svelte`}' frontend. Please use --api orpc or remove '${d?`nuxt`:`svelte`}' from --frontend.`),process.exit(1)),(d||f)&&l!==`orpc`&&(!e.api||e.yes&&e.api!==`trpc`)&&n.api!==`none`&&(n.api=`orpc`),n.addons&&n.addons.length>0){let e=[`pwa`,`tauri`],t=n.addons.some(t=>e.includes(t)),r=c?.some(e=>e===`tanstack-router`||e===`react-router`||e===`nuxt`&&n.addons?.includes(`tauri`)&&!n.addons?.includes(`pwa`)||e===`svelte`&&n.addons?.includes(`tauri`)&&!n.addons?.includes(`pwa`));if(t&&!r){let e=``;n.addons.includes(`pwa`)&&d?e=`PWA addon is not compatible with Nuxt.`:(n.addons.includes(`pwa`)||n.addons.includes(`tauri`))&&(e=`PWA and Tauri addons require tanstack-router, react-router, or Nuxt/Svelte (Tauri only).`),m.fatal(`${e} Cannot use these addons with your frontend selection.`),process.exit(1)}n.addons.includes(`husky`)&&!n.addons.includes(`biome`)&&m.warn(`Husky addon is recommended to be used with Biome for lint-staged configuration.`),n.addons=[...new Set(n.addons)]}let p=c&&c.length===1&&c[0]===`native`;if(p&&n.examples&&n.examples.length>0&&!n.examples.includes(`none`)&&(m.fatal(`Examples are not supported when only the 'native' frontend is selected.`),process.exit(1)),n.examples&&n.examples.length>0&&!n.examples.includes(`none`)){n.examples.includes(`todo`)&&u!==`convex`&&t===`none`&&(m.fatal(`The 'todo' example requires a database (unless using Convex). Cannot use --examples todo when database is 'none'.`),process.exit(1)),n.examples.includes(`ai`)&&u===`elysia`&&(m.fatal(`The 'ai' example is not compatible with the Elysia backend.`),process.exit(1));let e=c?.some(e=>[`tanstack-router`,`react-router`,`tanstack-start`,`next`,`nuxt`,`svelte`].includes(e)),r=!c||c.length===0}}return n}kt().catch(e=>{m.error(`Aborting installation due to unexpected error...`),e instanceof Error?!e.message.includes(`is only supported with`)&&!e.message.includes(`incompatible with`)&&(m.error(e.message),m.error(e.stack)):console.error(e),process.exit(1)});
|
package/package.json
CHANGED