neon 2.39.1 → 2.42.0

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.
@@ -0,0 +1,64 @@
1
+ import prompts from "prompts";
2
+ import { NEON_SERVICES } from "../config_template.js";
3
+ /**
4
+ * The picker's rows, in {@link NEON_SERVICES} order. Titles use the product names from the
5
+ * CLI's README ("Managed Better Auth", "Object Storage") rather than the `neon.ts` field
6
+ * names, since this is the list a user reads before they've seen a policy.
7
+ */
8
+ const CHOICES = [
9
+ {
10
+ value: "auth",
11
+ title: "Managed Better Auth",
12
+ description: "Authentication with users and sessions stored in Postgres.",
13
+ },
14
+ {
15
+ value: "functions",
16
+ title: "Functions",
17
+ description: "Long-running, without timeouts, and closer to your database.",
18
+ },
19
+ {
20
+ value: "storage",
21
+ title: "Object Storage",
22
+ description: "S3-compatible blob storage that branches with your projects.",
23
+ },
24
+ {
25
+ value: "ai-gateway",
26
+ title: "AI Gateway",
27
+ description: "All models, one API, one bill. Powered by Databricks. Not available on the Neon free plan.",
28
+ },
29
+ ];
30
+ /**
31
+ * Ask which services the scaffolded `neon.ts` should declare. Selecting nothing is a real
32
+ * answer — it yields the bare starter policy — so an empty list returns empty rather than
33
+ * re-prompting. Aborting (Ctrl-C) exits 1, matching the prompts in `link`.
34
+ *
35
+ * Callers guard the TTY themselves (see `initCmd`); this function assumes it may prompt.
36
+ */
37
+ export const pickServicesInteractively = async () => {
38
+ const { services } = await prompts({
39
+ onState: (state) => {
40
+ if (state.aborted) {
41
+ // Restore the cursor prompts hid, then exit — otherwise the terminal is
42
+ // left without one for the rest of the session.
43
+ process.stdout.write("\x1B[?25h");
44
+ process.stdout.write("\n");
45
+ process.exit(1);
46
+ }
47
+ },
48
+ type: "multiselect",
49
+ name: "services",
50
+ message: "Which Neon services should neon.ts declare? (space to toggle, enter to confirm)",
51
+ instructions: false,
52
+ choices: CHOICES.map((choice) => ({
53
+ value: choice.value,
54
+ title: choice.title,
55
+ description: choice.description,
56
+ })),
57
+ });
58
+ if (!Array.isArray(services)) {
59
+ throw new Error("Aborted: no services selected.");
60
+ }
61
+ // Order by NEON_SERVICES rather than selection order so the rendered neon.ts is
62
+ // independent of the order the rows were toggled in.
63
+ return NEON_SERVICES.filter((service) => services.includes(service));
64
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neon",
3
- "version": "2.39.1",
3
+ "version": "2.42.0",
4
4
  "description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
5
5
  "keywords": [
6
6
  "neon",
@@ -55,11 +55,11 @@
55
55
  "which": "3.0.1",
56
56
  "yaml": "^2.9.0",
57
57
  "yargs": "17.7.2",
58
- "@neon/sdk": "1.4.0",
59
- "@neon/config": "0.12.0",
60
- "@neon/config-runtime": "0.12.0",
61
- "@neon/env": "0.13.0",
62
- "neon-init": "0.20.5"
58
+ "@neon/sdk": "1.4.1",
59
+ "@neon/config": "0.13.1",
60
+ "@neon/config-runtime": "0.12.2",
61
+ "@neon/env": "0.13.2",
62
+ "neon-init": "0.20.6"
63
63
  },
64
64
  "optionalDependencies": {
65
65
  "esbuild": "0.28.1"