@flaredev/cli 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +15 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -224,6 +224,10 @@ import { existsSync, readFileSync, writeFileSync } from "fs";
224
224
  import { join } from "path";
225
225
  var STACKS = ["cloudflare", "next"];
226
226
  var isStack = (value) => STACKS.includes(value);
227
+ var STACK_LABELS = {
228
+ cloudflare: "Cloudflare Workers, D1 and Drizzle \u2014 cheapest to run, deploys everywhere",
229
+ next: "Next.js on Vercel, Neon Postgres and Prisma \u2014 real Postgres, Node runtime"
230
+ };
227
231
  function readStack(appRoot) {
228
232
  const file = join(appRoot, "package.json");
229
233
  if (!existsSync(file)) return "cloudflare";
@@ -3351,6 +3355,15 @@ function stopIfCancelled(value) {
3351
3355
  async function askCreateQuestions(given, appName) {
3352
3356
  prompts2.intro(`${pc9.bgRed(pc9.white(" Flare "))} ${pc9.dim(`v${FLARE_VERSION2}`)}${appName ? ` ${pc9.dim("\xB7")} ${pc9.bold(appName)}` : ""}`);
3353
3357
  const answers = { ...given };
3358
+ if (given.stack === void 0) {
3359
+ answers.stack = stopIfCancelled(
3360
+ await prompts2.select({
3361
+ message: "Where will it run?",
3362
+ initialValue: "cloudflare",
3363
+ options: STACKS.map((value) => ({ value, label: value === "next" ? "Next.js" : "Cloudflare", hint: STACK_LABELS[value] }))
3364
+ })
3365
+ );
3366
+ }
3354
3367
  if (given.theme === void 0) {
3355
3368
  answers.theme = stopIfCancelled(
3356
3369
  await prompts2.select({
@@ -5022,9 +5035,9 @@ function createCli() {
5022
5035
  cli.command("create <dir>", "Scaffold a new Flare app").option("--pm <manager>", "Package manager: pnpm, npm, yarn, or bun (default: detected)").option("--stack <name>", "Where it runs: cloudflare (default) or next").option("--theme <name>", "Look of the app: default, coral, amber, sky, mono or emerald").option("--auth <list>", "Sign-in methods: magic-link, email-otp, passkeys, 2fa-app, 2fa-email, all or none (default: all)").option("--auth-providers <list>", "Social sign-in, comma-separated: google, github, apple, microsoft").option("-y, --yes", "Don't ask: use the flags given and the defaults for the rest").option("--skip-install", "Write files without installing dependencies").example("flare create shop").example("flare create shop --stack next").example("flare create shop --theme mono --auth passkeys,2fa-app --auth-providers google,github --yes").action(
5023
5036
  async (dir, options2) => {
5024
5037
  const wanted = !options2.skipInstall;
5025
- let answers = { theme: options2.theme, auth: options2.auth, authProviders: options2.authProviders };
5038
+ let answers = { stack: options2.stack, theme: options2.theme, auth: options2.auth, authProviders: options2.authProviders };
5026
5039
  if (canPrompt(options2.yes)) answers = await askCreateQuestions(answers, toAppName(dir));
5027
- const result = createApp(dir, { pm: options2.pm, stack: options2.stack, install: false, ...answers, log: (message) => prompts3.log.message(message) });
5040
+ const result = createApp(dir, { pm: options2.pm, install: false, ...answers, log: (message) => prompts3.log.message(message) });
5028
5041
  let installed = false;
5029
5042
  if (wanted) {
5030
5043
  const spin = prompts3.spinner({ indicator: "timer" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flaredev/cli",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "The flare command-line tool: create, generate, migrate, and deploy Flare apps",
5
5
  "license": "MIT",
6
6
  "author": "Muke Johnbaptist",
@@ -41,7 +41,7 @@
41
41
  "jiti": "^2.7.0",
42
42
  "jsonc-parser": "^3.3.1",
43
43
  "picocolors": "^1.1.1",
44
- "@flaredev/core": "0.5.0"
44
+ "@flaredev/core": "0.5.1"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=22"