Skip to content

Commit

Permalink
cli fixes (#38)
Browse files Browse the repository at this point in the history
* Change minimum node version to ensure fetch works

* Add better prompt for CLI installs
  • Loading branch information
jplhomer committed Mar 23, 2023
1 parent 9e498e6 commit e7ea5e5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-kangaroos-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"superflare": patch
---

Add helpers to get people to check their Cloudflare Queue, R2, etc settings
2 changes: 1 addition & 1 deletion packages/superflare/bin/superflare.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const { spawn } = require("child_process");
const path = require("path");

const MIN_NODE_VERSION = "16.13.0";
const MIN_NODE_VERSION = "18.0.0";

let superflareProcess;

Expand Down
15 changes: 13 additions & 2 deletions packages/superflare/cli/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
outro,
spinner,
text,
note,
} from "@clack/prompts";
import { cp, mkdtemp, readFile, rmdir, writeFile } from "fs/promises";
import { join, normalize } from "path";
Expand Down Expand Up @@ -76,6 +77,14 @@ export async function newHandler(

s.stop("Everything looks good!");

note(
"Before using R2, Queues, and Durable objects,\n" +
"make sure you've enabled them in the Cloudflare Dashboard.\n" +
"https://dash.cloudflare.com/\n" +
"Otherwise, the following commands might fail! 😬",
"👋 Heads-up:"
);

let path = "";

if (!argv.name) {
Expand Down Expand Up @@ -242,9 +251,11 @@ Do you want to continue?`;
const appKey = randomBytes(256).toString("base64");
await setSecret("APP_KEY", appKey, path);

s.stop("Done creating resources:");
s.stop("Done creating resources!");

const allResults = results.map((r) => r.message);

results.forEach((result) => logger.log(result.message));
note(allResults.join("\n"), "Here's what we did:");

// TODO: Drop the `--legacy-peer-deps` once the remix template is fixed:
// @see https://github.com/remix-run/remix/pull/5425
Expand Down

0 comments on commit e7ea5e5

Please sign in to comment.