neon 9.1.0 → 9.2.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.
- package/README.md +1 -1
- package/dist/_chunks/{checkout-B_gbS0nD.js → checkout-Bw48iTay.js} +2 -2
- package/dist/_chunks/{config-BClSMzco.js → config-aBF_xpbX.js} +1 -1
- package/dist/_chunks/{deploy-CJ22hy3i.js → deploy-CMYTjbf6.js} +1 -1
- package/dist/_chunks/{dev-CSoQfCuS.js → dev-r0-8mPJk.js} +8 -5
- package/dist/_chunks/{git-C6XPViK5.js → git-0gR_dDCC.js} +2 -2
- package/dist/_chunks/{link-n40BxbmK.js → link-CYwhNbA4.js} +1 -1
- package/dist/_chunks/{status-TDYLPWRO.js → status-Du6yqWxf.js} +1 -1
- package/dist/commands/checkout.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/functions_new.js +1 -1
- package/dist/commands/git.js +1 -1
- package/dist/commands/index.js +7 -7
- package/dist/commands/link.js +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/dev/functions.js +16 -4
- package/dist/init/deploy.js +5 -3
- package/dist/init/link.js +1 -1
- package/dist/init/run.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -642,7 +642,7 @@ If you'd rather not keep env vars on disk, inject them at runtime instead with `
|
|
|
642
642
|
|
|
643
643
|
**`neon dev` resolves the same set, by the same rules** — including the AI Gateway on a branch with no `neon.ts`. A function running locally gets the same Postgres / Auth / Data API / storage / AI Gateway vars a deploy would inject. `dev` also sets `NEON_DEV_FUNCTION_PORTS`, a JSON map of the slugs this process is serving to their ports (every neon.ts function, or the matching slug when `--source` names one), so `functionBaseUrl("<slug>")` returns `http://localhost:<port>` for those and the deployed URL on the linked branch for any other slug.
|
|
644
644
|
|
|
645
|
-
Before `neon.ts` is evaluated, `dev` loads the project directory's `.env`, then `.env.local`, which overrides it, into the environment, so Function env values
|
|
645
|
+
Before `neon.ts` is evaluated, `dev` loads the project directory's `.env`, then `.env.local`, which overrides it, into the environment, so Function env values resolve the same way they do for `neon deploy --env`. A variable declared `required: true` must be set, or `dev` fails before any Function starts; `--source` checks only the Function it serves. `required: "default-branch"` and `required: false` may be unset ([Function env](../config/README.md#function-env)). A variable already set in the shell wins over both. Local Functions inherit every loaded variable, including keys `neon.ts` doesn't declare; the deployed runtime gets only declared and Neon-injected env. `--env <file>` loads only that file, resolved from the current directory, matching `neon deploy --env`:
|
|
646
646
|
|
|
647
647
|
```bash
|
|
648
648
|
neon dev # loads .env, then .env.local (overrides .env)
|
|
@@ -12,8 +12,8 @@ import { fillSingleProject, listAllProjectBranches } from "../utils/enrichers.js
|
|
|
12
12
|
import { buildCheckoutEvent, readGitContext } from "../utils/git.js";
|
|
13
13
|
import { buildHookBranch, loadHookConfig, resolveHookEnv, runCheckoutAfterHook, runCheckoutBeforeHook, runCreateAfterHook, runCreateBeforeHook } from "../utils/hooks.js";
|
|
14
14
|
import { n as autoPullEnvAfterPin } from "./env-DxcO3oJk.js";
|
|
15
|
-
import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-
|
|
16
|
-
import { i as handler$1 } from "./link-
|
|
15
|
+
import { a as applyPolicyOnCreate, f as envFlag, l as createBranchFromPolicyOnCheckout } from "./config-aBF_xpbX.js";
|
|
16
|
+
import { i as handler$1 } from "./link-CYwhNbA4.js";
|
|
17
17
|
import chalk from "chalk";
|
|
18
18
|
import prompts from "prompts";
|
|
19
19
|
// src/commands/checkout.ts
|
|
@@ -89,7 +89,7 @@ const INSPECT_FIELDS = [
|
|
|
89
89
|
"config"
|
|
90
90
|
];
|
|
91
91
|
const envFlag = { env: {
|
|
92
|
-
describe: "Path to a .env file to load into the environment before evaluating neon.ts so Function env values resolve from it. Existing env vars are not overridden. Function env values that read process.env must be set in this file or the environment.",
|
|
92
|
+
describe: "Path to a .env file to load into the environment before evaluating neon.ts so Function env values resolve from it. Existing env vars are not overridden. Required Function env (declared required: true, or required: \"default-branch\" when deploying the default branch) and values that read process.env must be set in this file or the environment.",
|
|
93
93
|
type: "string"
|
|
94
94
|
} };
|
|
95
95
|
/** Apply-only flags, exported so `deploy` can reuse the exact same surface. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
|
|
2
2
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
3
|
-
import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-
|
|
3
|
+
import { f as envFlag, i as applyFlags, p as envPullFlag, r as applyCmd } from "./config-aBF_xpbX.js";
|
|
4
4
|
import { DEPLOY_COMMANDS_EPILOGUE } from "../commands/deploy_help.js";
|
|
5
5
|
// src/commands/deploy.ts
|
|
6
6
|
var deploy_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -7,7 +7,7 @@ import { t as NEON_DEV_FUNCTION_PORTS } from "./env-EJU-0InB.js";
|
|
|
7
7
|
import { branchIdResolve } from "../utils/enrichers.js";
|
|
8
8
|
import { bundleEntry } from "../utils/esbuild.js";
|
|
9
9
|
import { a as resolveDevEnv } from "./env-CFBmcKyo.js";
|
|
10
|
-
import { f as envFlag } from "./config-
|
|
10
|
+
import { f as envFlag } from "./config-aBF_xpbX.js";
|
|
11
11
|
import { findConfigFunctionBySource, resolveFunctionsFromConfig } from "../dev/functions.js";
|
|
12
12
|
import { resolveWatchInputs } from "../dev/inputs.js";
|
|
13
13
|
import { existsSync, mkdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
@@ -194,12 +194,13 @@ const runSingleSource = async (props, shellEnv, envFiles) => {
|
|
|
194
194
|
bundleDir: devBundleDir(process.cwd()),
|
|
195
195
|
childEnv: buildChildEnv({
|
|
196
196
|
...neonEnv,
|
|
197
|
+
...match?.declaredEnv,
|
|
197
198
|
...overlay
|
|
198
|
-
}, port),
|
|
199
|
+
}, port, match?.unsetEnv),
|
|
199
200
|
label: null,
|
|
200
201
|
envSummary: {
|
|
201
202
|
neon: Object.keys(neonEnv),
|
|
202
|
-
fn:
|
|
203
|
+
fn: Object.keys(match?.declaredEnv ?? {})
|
|
203
204
|
}
|
|
204
205
|
};
|
|
205
206
|
await runSupervisor([unit], {
|
|
@@ -390,7 +391,7 @@ const plannedToUnit = (fn, branchEnv, port, overlay = {}) => {
|
|
|
390
391
|
const childEnv = buildChildEnv({
|
|
391
392
|
...branchEnv,
|
|
392
393
|
...fn.env
|
|
393
|
-
}, port);
|
|
394
|
+
}, port, fn.unsetEnv);
|
|
394
395
|
return {
|
|
395
396
|
slug: fn.slug,
|
|
396
397
|
source: fn.source,
|
|
@@ -407,6 +408,7 @@ const plannedToUnit = (fn, branchEnv, port, overlay = {}) => {
|
|
|
407
408
|
source: fn.source,
|
|
408
409
|
port: fn.port ?? null,
|
|
409
410
|
env: fn.env,
|
|
411
|
+
unsetEnv: fn.unsetEnv ?? null,
|
|
410
412
|
overlay,
|
|
411
413
|
externalPackages: fn.externalPackages ?? null,
|
|
412
414
|
bundler: typeof fn.bundler === "function" ? "custom" : fn.bundler ?? null
|
|
@@ -420,13 +422,14 @@ const plannedToUnit = (fn, branchEnv, port, overlay = {}) => {
|
|
|
420
422
|
* NEON_DEV_PORT (explicit) or NEON_DEV_PORT_BASE (search). An inherited
|
|
421
423
|
* NEON_DEV_FUNCTION_PORTS names another process's ports, so only this one's applies.
|
|
422
424
|
*/
|
|
423
|
-
const buildChildEnv = (neonEnv, port) => {
|
|
425
|
+
const buildChildEnv = (neonEnv, port, unset = []) => {
|
|
424
426
|
const inherited = { ...process.env };
|
|
425
427
|
delete inherited[NEON_DEV_FUNCTION_PORTS];
|
|
426
428
|
const env = {
|
|
427
429
|
...inherited,
|
|
428
430
|
...neonEnv
|
|
429
431
|
};
|
|
432
|
+
for (const key of unset) delete env[key];
|
|
430
433
|
delete env.NEON_DEV_PORT;
|
|
431
434
|
delete env.NEON_DEV_PORT_BASE;
|
|
432
435
|
if (port.mode === "explicit") env.NEON_DEV_PORT = String(port.port);
|
|
@@ -5,8 +5,8 @@ import { CONTEXT_FILE, contextBranch, gitBranchMap, gitBranchMapping, isUnfollow
|
|
|
5
5
|
import { writer } from "../writer.js";
|
|
6
6
|
import { neonSafeBranchName } from "../utils/branch_name.js";
|
|
7
7
|
import { currentGitBranch, gitPull, gitRepoRoot, hasUpstream, installPostCheckoutHook, isGitRepo, isManagedHook, localGitBranches, postCheckoutHookPath, readGitContext, removePostCheckoutHook } from "../utils/git.js";
|
|
8
|
-
import { o as quoteFlagValue } from "./link-
|
|
9
|
-
import { o as handler$1 } from "./checkout-
|
|
8
|
+
import { o as quoteFlagValue } from "./link-CYwhNbA4.js";
|
|
9
|
+
import { o as handler$1 } from "./checkout-Bw48iTay.js";
|
|
10
10
|
import { existsSync } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
import chalk from "chalk";
|
|
@@ -14,7 +14,7 @@ import { createBranch, pickBranchInteractively } from "../utils/branch_picker.js
|
|
|
14
14
|
import { looksLikeBranchId } from "../utils/formats.js";
|
|
15
15
|
import { listAllProjectBranches } from "../utils/enrichers.js";
|
|
16
16
|
import { n as autoPullEnvAfterPin } from "./env-DxcO3oJk.js";
|
|
17
|
-
import { h as initCmd } from "./config-
|
|
17
|
+
import { h as initCmd } from "./config-aBF_xpbX.js";
|
|
18
18
|
import { formatLinkSummary } from "../commands/link_output.js";
|
|
19
19
|
import { r as REGIONS } from "./projects-a3X4OFEJ.js";
|
|
20
20
|
import prompts from "prompts";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.js";
|
|
2
2
|
import { fillSingleProject } from "../utils/enrichers.js";
|
|
3
|
-
import { y as status } from "./config-
|
|
3
|
+
import { y as status } from "./config-aBF_xpbX.js";
|
|
4
4
|
// src/commands/status.ts
|
|
5
5
|
var status_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
builder: () => builder,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-
|
|
1
|
+
export { t as builder, r as command, i as describe, a as formatCheckoutPolicyFailure, o as handler } from "../_chunks/checkout-Bw48iTay.js";
|
package/dist/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as ConfigInstallFailed, n as addCmd, r as applyCmd, i as applyFlags, a as applyPolicyOnCreate, o as builder, s as command, l as createBranchFromPolicyOnCheckout, u as describe, d as ensureConfigPackages, f as envFlag, p as envPullFlag, m as handler, h as initCmd, g as installCommandFrom, _ as missingDependencies, v as planCmd, y as status } from "../_chunks/config-
|
|
1
|
+
export { t as ConfigInstallFailed, n as addCmd, r as applyCmd, i as applyFlags, a as applyPolicyOnCreate, o as builder, s as command, l as createBranchFromPolicyOnCheckout, u as describe, d as ensureConfigPackages, f as envFlag, p as envPullFlag, m as handler, h as initCmd, g as installCommandFrom, _ as missingDependencies, v as planCmd, y as status } from "../_chunks/config-aBF_xpbX.js";
|
package/dist/commands/deploy.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-
|
|
1
|
+
export { t as builder, n as command, i as describe, a as handler } from "../_chunks/deploy-CMYTjbf6.js";
|
package/dist/commands/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as captureShellEnv, r as command, i as describe, a as devBundleDir, o as devEnvContext, c as diffUnits, l as formatEnvFiles, u as formatEnvSummary, d as handler, f as loadDevEnvFiles, p as localFunctionPortsEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-
|
|
1
|
+
export { t as builder, n as captureShellEnv, r as command, i as describe, a as devBundleDir, o as devEnvContext, c as diffUnits, l as formatEnvFiles, u as formatEnvSummary, d as handler, f as loadDevEnvFiles, p as localFunctionPortsEnv, m as planFunctionsToUnits, h as reportDevCredential, g as sourceFunctionUrlOverlay } from "../_chunks/dev-r0-8mPJk.js";
|
|
@@ -8,7 +8,7 @@ import { writer } from "../writer.js";
|
|
|
8
8
|
import { formatInitDone, printInitDone } from "../init/chrome.js";
|
|
9
9
|
import { FUNCTION_SLUG_PATTERN, deriveFunctionSlug } from "../utils/function_slug.js";
|
|
10
10
|
import { displayPath } from "./env_output.js";
|
|
11
|
-
import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-
|
|
11
|
+
import { _ as missingDependencies, d as ensureConfigPackages, g as installCommandFrom } from "../_chunks/config-aBF_xpbX.js";
|
|
12
12
|
import { recommendedOperations } from "../functions/registry.js";
|
|
13
13
|
import { collidingFiles, operationsFromFlags, planConfigRegistration, planEnvExample, planScaffold, writeScaffold } from "../functions/scaffold.js";
|
|
14
14
|
import { describeRegistrySource, openRegistry } from "../functions/source.js";
|
package/dist/commands/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as aliases, n as builder, r as cleanup, i as command, a as describe, s as handler, c as install, l as partitionBranchesToPrune, u as status, d as sync, f as uninstall } from "../_chunks/git-
|
|
1
|
+
export { t as aliases, n as builder, r as cleanup, i as command, a as describe, s as handler, c as install, l as partitionBranchesToPrune, u as status, d as sync, f as uninstall } from "../_chunks/git-0gR_dDCC.js";
|
package/dist/commands/index.js
CHANGED
|
@@ -3,28 +3,28 @@ import { t as api_exports } from "../_chunks/api-1MKsfpY3.js";
|
|
|
3
3
|
import { n as api_keys_exports } from "../_chunks/api_keys-CTFHd5m_.js";
|
|
4
4
|
import { n as ask_exports } from "../_chunks/ask-Xlek1Pxh.js";
|
|
5
5
|
import { o as env_exports } from "../_chunks/env-DxcO3oJk.js";
|
|
6
|
-
import { c as config_exports } from "../_chunks/config-
|
|
6
|
+
import { c as config_exports } from "../_chunks/config-aBF_xpbX.js";
|
|
7
7
|
import { u as projects_exports } from "../_chunks/projects-a3X4OFEJ.js";
|
|
8
|
-
import { a as link_exports } from "../_chunks/link-
|
|
8
|
+
import { a as link_exports } from "../_chunks/link-CYwhNbA4.js";
|
|
9
9
|
import { o as mcp_exports } from "../_chunks/mcp-SvqWzHnT.js";
|
|
10
10
|
import { c as plugins_exports } from "../_chunks/plugins-BwUZQ6Ic.js";
|
|
11
11
|
import { l as skills_exports } from "../_chunks/skills-Bv8oKKwE.js";
|
|
12
12
|
import { t as bootstrap_exports } from "../_chunks/bootstrap-B73qVB39.js";
|
|
13
13
|
import { r as branches_exports } from "../_chunks/branches-Bp-5z1lM.js";
|
|
14
14
|
import { n as bucket_exports } from "../_chunks/bucket-D06bvDSa.js";
|
|
15
|
-
import { n as checkout_exports } from "../_chunks/checkout-
|
|
15
|
+
import { n as checkout_exports } from "../_chunks/checkout-Bw48iTay.js";
|
|
16
16
|
import { o as claim_exports } from "../_chunks/claim-BVEwQ65H.js";
|
|
17
17
|
import { o as connection_string_exports } from "../_chunks/connection_string-6WhV4WFx.js";
|
|
18
18
|
import { a as credentials_exports } from "../_chunks/credentials-BMBNmW0t.js";
|
|
19
19
|
import { r as data_api_exports } from "../_chunks/data_api-CHDwvMTG.js";
|
|
20
20
|
import { s as databases_exports } from "../_chunks/databases-B-qY303S.js";
|
|
21
|
-
import { r as deploy_exports } from "../_chunks/deploy-
|
|
22
|
-
import { s as dev_exports } from "../_chunks/dev-
|
|
21
|
+
import { r as deploy_exports } from "../_chunks/deploy-CMYTjbf6.js";
|
|
22
|
+
import { s as dev_exports } from "../_chunks/dev-r0-8mPJk.js";
|
|
23
23
|
import { i as diff_exports } from "../_chunks/diff-dnxneH0u.js";
|
|
24
24
|
import { c as docs_exports } from "../_chunks/docs-BpLiSTmm.js";
|
|
25
25
|
import { o as feedback_exports } from "../_chunks/feedback-mQmdTRFn.js";
|
|
26
26
|
import { o as functions_exports } from "../_chunks/functions-PHaU-kRb.js";
|
|
27
|
-
import { o as git_exports } from "../_chunks/git-
|
|
27
|
+
import { o as git_exports } from "../_chunks/git-0gR_dDCC.js";
|
|
28
28
|
import { a as init_exports } from "../_chunks/init-D2fClHtC.js";
|
|
29
29
|
import { o as inspect_exports } from "../_chunks/inspect-yFAb61qo.js";
|
|
30
30
|
import { a as ip_allow_exports } from "../_chunks/ip_allow-DBdxNEUa.js";
|
|
@@ -40,7 +40,7 @@ import { o as profile_exports } from "../_chunks/profile-CArcjyS4.js";
|
|
|
40
40
|
import { s as realtime_exports } from "../_chunks/realtime-BwtzYf5a.js";
|
|
41
41
|
import { a as set_context_exports } from "../_chunks/set_context-ompB6d2D.js";
|
|
42
42
|
import { s as snapshots_exports } from "../_chunks/snapshots-DxNhjcco.js";
|
|
43
|
-
import { a as status_exports } from "../_chunks/status-
|
|
43
|
+
import { a as status_exports } from "../_chunks/status-Du6yqWxf.js";
|
|
44
44
|
import { d as triggers_exports } from "../_chunks/triggers-BfvyeJUC.js";
|
|
45
45
|
import { s as user_exports } from "../_chunks/user-D9mC430O.js";
|
|
46
46
|
import { i as vpc_endpoints_exports } from "../_chunks/vpc_endpoints-C-Y4WK2M.js";
|
package/dist/commands/link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as command, r as describe, i as handler, o as quoteFlagValue, s as runLink, c as shouldOfferConfigInit } from "../_chunks/link-
|
|
1
|
+
export { t as builder, n as command, r as describe, i as handler, o as quoteFlagValue, s as runLink, c as shouldOfferConfigInit } from "../_chunks/link-CYwhNbA4.js";
|
package/dist/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-
|
|
1
|
+
export { t as builder, n as command, r as describe, i as handler } from "../_chunks/status-Du6yqWxf.js";
|
package/dist/dev/functions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loadProjectConfig } from "../project.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
4
|
-
import { resolveConfig } from "@neon/config";
|
|
4
|
+
import { assertFunctionEnv, authoredFunctions, resolveConfig, resolveFunctionEnv } from "@neon/config";
|
|
5
5
|
// src/dev/functions.ts
|
|
6
6
|
/**
|
|
7
7
|
* Load `neon.ts` (if any) and resolve the list of functions it declares into
|
|
@@ -16,6 +16,7 @@ const resolveFunctionsFromConfig = async (cwd, branchName, contextFile) => {
|
|
|
16
16
|
const loaded = await loadNeonConfig(cwd, contextFile);
|
|
17
17
|
if (!loaded) return null;
|
|
18
18
|
const { config, configDir, configPath } = loaded;
|
|
19
|
+
assertFunctionEnv(config, "development");
|
|
19
20
|
return {
|
|
20
21
|
configPath,
|
|
21
22
|
functions: (resolveConfig(config, {
|
|
@@ -35,20 +36,31 @@ const resolveFunctionsFromConfig = async (cwd, branchName, contextFile) => {
|
|
|
35
36
|
const findConfigFunctionBySource = async (cwd, source, contextFile) => {
|
|
36
37
|
const loaded = await loadNeonConfig(cwd, contextFile);
|
|
37
38
|
if (!loaded) return void 0;
|
|
38
|
-
|
|
39
|
+
const match = (resolveConfig(loaded.config, {
|
|
39
40
|
name: "local",
|
|
40
41
|
exists: false
|
|
41
|
-
}).preview?.functions ?? []).
|
|
42
|
+
}).preview?.functions ?? []).find((fn) => resolveFunctionSource(fn.source, loaded.configDir) === source);
|
|
43
|
+
if (!match) return void 0;
|
|
44
|
+
const served = Object.entries(authoredFunctions(loaded.config) ?? {}).filter(([slug]) => slug === match.slug);
|
|
45
|
+
assertFunctionEnv({ functions: Object.fromEntries(served) }, "development");
|
|
46
|
+
return toPlannedFunction(match, source);
|
|
42
47
|
};
|
|
43
48
|
const resolveFunctionSource = (source, configDir) => isAbsolute(source) ? source : resolve(configDir, source);
|
|
44
49
|
const toPlannedFunction = (fn, source) => {
|
|
45
50
|
const port = devPort(fn.dev);
|
|
51
|
+
const declaredEnv = resolveFunctionEnv(fn.envVars, "development").env;
|
|
52
|
+
const unsetEnv = Object.entries(fn.envVars ?? {}).filter(([key, declaration]) => !(key in declaredEnv) && declaration.onUndefined !== "skip").map(([key]) => key);
|
|
46
53
|
return {
|
|
47
54
|
slug: fn.slug,
|
|
48
55
|
name: fn.name,
|
|
49
56
|
source,
|
|
50
57
|
...port !== void 0 ? { port } : {},
|
|
51
|
-
env: {
|
|
58
|
+
env: {
|
|
59
|
+
...fn.env,
|
|
60
|
+
...declaredEnv
|
|
61
|
+
},
|
|
62
|
+
declaredEnv,
|
|
63
|
+
...unsetEnv.length > 0 ? { unsetEnv } : {},
|
|
52
64
|
...fn.externalPackages ? { externalPackages: fn.externalPackages.map((pkg) => pkg.name) } : {},
|
|
53
65
|
...fn.bundler !== "esbuild" ? { bundler: fn.bundler } : {}
|
|
54
66
|
};
|
package/dist/init/deploy.js
CHANGED
|
@@ -4,9 +4,10 @@ import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
|
|
|
4
4
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
5
5
|
import { loadProjectConfig } from "../project.js";
|
|
6
6
|
import { loadEnvFileIntoProcess } from "../env_file.js";
|
|
7
|
-
import { r as applyCmd } from "../_chunks/config-
|
|
7
|
+
import { r as applyCmd } from "../_chunks/config-aBF_xpbX.js";
|
|
8
8
|
import { authContext } from "./auth.js";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
|
+
import { missingFunctionEnv } from "@neon/config";
|
|
10
11
|
// src/init/deploy.ts
|
|
11
12
|
/**
|
|
12
13
|
* The function env keys neon.ts reads that neither `envFile` nor the environment sets.
|
|
@@ -15,12 +16,13 @@ import { existsSync } from "node:fs";
|
|
|
15
16
|
const missingDeployEnv = async (options) => {
|
|
16
17
|
const applied = existsSync(options.envFile) ? loadEnvFileIntoProcess(options.envFile) : [];
|
|
17
18
|
try {
|
|
18
|
-
const { omittedFunctionEnv } = await loadProjectConfig({
|
|
19
|
+
const { config, omittedFunctionEnv } = await loadProjectConfig({
|
|
19
20
|
cwd: options.cwd,
|
|
20
21
|
contextFile: options.contextFile,
|
|
21
22
|
unsetFunctionEnv: "omit"
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
+
const declared = missingFunctionEnv(config, "deploy").map(({ key }) => key);
|
|
25
|
+
return [.../* @__PURE__ */ new Set([...omittedFunctionEnv, ...declared])];
|
|
24
26
|
} finally {
|
|
25
27
|
for (const key of applied) delete process.env[key];
|
|
26
28
|
}
|
package/dist/init/link.js
CHANGED
|
@@ -4,7 +4,7 @@ import "../config.js";
|
|
|
4
4
|
import "../auth.js";
|
|
5
5
|
import { c as ensureAuth } from "../_chunks/auth-rup6nemJ.js";
|
|
6
6
|
import { recoverFrom401 } from "../auth_recovery.js";
|
|
7
|
-
import { s as runLink } from "../_chunks/link-
|
|
7
|
+
import { s as runLink } from "../_chunks/link-CYwhNbA4.js";
|
|
8
8
|
// src/init/link.ts
|
|
9
9
|
const isUnauthorized = (error) => isNeonApiError(error) && error.status === 401;
|
|
10
10
|
const authenticationFailed = () => /* @__PURE__ */ new Error("Authentication failed.");
|
package/dist/init/run.js
CHANGED
|
@@ -14,8 +14,8 @@ import { getAgentDisplayName } from "../mcp/agents.js";
|
|
|
14
14
|
import { missingPluginsCommands, pluginsCommandProblemText, pluginsInstallableAgents, unusablePluginsCommands } from "../plugins/targets.js";
|
|
15
15
|
import { AGENTS_NOT_INSTALLED, CANCELLED_BODY, CLAIMABLE_ACCOUNT_FLAGS, CLAIMABLE_ALREADY_LINKED, CLAIMABLE_MCP_API_KEY, CLAIMABLE_NO_LINK, MCP_API_KEY_NEEDS_AUTH, MCP_SCOPED_NEEDS_PROJECT, NON_TTY_LINK_NEEDS_AUTH, NO_AGENTS_FALLBACK_STATUS, PROGRESS, PROJECT_PINNED_OFFLINE, claimableNext, claimableThenServicesNext, configInitNext, envPullFailedNext, existingConfigNext, installFailedNext, mcpAfterLinkNext, mcpConfigLocationSkipped, mcpConfigLocationUnavailable, mcpKeyFailedNext, namedAgentsUnavailable, newConfigNext, offlinePinNext, skippedLinkNext, toolingFailedNext, unattendedUnauthedNext } from "./copy.js";
|
|
16
16
|
import { agentsRowValue, configRowValue, formatInitDone, headingForKind, printInitBanner, printInitDone, printInitProgress, projectRowValue, shouldPrintInitBanner } from "./chrome.js";
|
|
17
|
-
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-
|
|
18
|
-
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-
|
|
17
|
+
import { h as initCmd, t as ConfigInstallFailed } from "../_chunks/config-aBF_xpbX.js";
|
|
18
|
+
import { o as quoteFlagValue, s as runLink } from "../_chunks/link-CYwhNbA4.js";
|
|
19
19
|
import { runAuthenticatedLink } from "./link.js";
|
|
20
20
|
import { mcpInstallableAgents } from "../mcp/targets.js";
|
|
21
21
|
import { skillsInstallableAgents } from "../skills/targets.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neon",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.2.0",
|
|
4
4
|
"description": "CLI tool for Neon, the cloud backend primitives built around Lakebase Postgres",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"neon",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"yaml": "^2.9.0",
|
|
74
74
|
"yargs": "17.7.2",
|
|
75
75
|
"yoctocolors": "^2.1.2",
|
|
76
|
-
"@neon/config": "1.
|
|
77
|
-
"@neon/config-runtime": "1.
|
|
76
|
+
"@neon/config": "1.13.0",
|
|
77
|
+
"@neon/config-runtime": "1.12.0",
|
|
78
78
|
"@neon/realtime": "0.2.0",
|
|
79
79
|
"@neon/sdk": "7.11.0"
|
|
80
80
|
},
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
"typescript": "^5.9.0",
|
|
114
114
|
"vitest": "^3.0.9",
|
|
115
115
|
"@neon-internals/cli-core": "0.0.0",
|
|
116
|
-
"@neon-internals/env-core": "0.0.
|
|
116
|
+
"@neon-internals/env-core": "0.0.48",
|
|
117
117
|
"@neon/e2e-harness": "0.0.0",
|
|
118
|
-
"@neon/env": "2.0
|
|
118
|
+
"@neon/env": "2.1.0",
|
|
119
119
|
"@neon/functions": "0.11.0"
|
|
120
120
|
},
|
|
121
121
|
"publishConfig": {
|