@rmartz/envctl 3.1.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.
- package/README.md +79 -0
- package/dist/envctl.d.ts +3 -0
- package/dist/envctl.d.ts.map +1 -0
- package/dist/envctl.js +36 -0
- package/dist/envctl.js.map +1 -0
- package/dist/lib/auth.d.ts +21 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +148 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/check-firebase.d.ts +6 -0
- package/dist/lib/check-firebase.d.ts.map +1 -0
- package/dist/lib/check-firebase.js +81 -0
- package/dist/lib/check-firebase.js.map +1 -0
- package/dist/lib/check-live.d.ts +3 -0
- package/dist/lib/check-live.d.ts.map +1 -0
- package/dist/lib/check-live.js +50 -0
- package/dist/lib/check-live.js.map +1 -0
- package/dist/lib/check.d.ts +9 -0
- package/dist/lib/check.d.ts.map +1 -0
- package/dist/lib/check.js +165 -0
- package/dist/lib/check.js.map +1 -0
- package/dist/lib/cli/help.d.ts +4 -0
- package/dist/lib/cli/help.d.ts.map +1 -0
- package/dist/lib/cli/help.js +52 -0
- package/dist/lib/cli/help.js.map +1 -0
- package/dist/lib/cli/registry.d.ts +19 -0
- package/dist/lib/cli/registry.d.ts.map +1 -0
- package/dist/lib/cli/registry.js +111 -0
- package/dist/lib/cli/registry.js.map +1 -0
- package/dist/lib/cli/router.d.ts +22 -0
- package/dist/lib/cli/router.d.ts.map +1 -0
- package/dist/lib/cli/router.js +98 -0
- package/dist/lib/cli/router.js.map +1 -0
- package/dist/lib/cli/version.d.ts +2 -0
- package/dist/lib/cli/version.d.ts.map +1 -0
- package/dist/lib/cli/version.js +58 -0
- package/dist/lib/cli/version.js.map +1 -0
- package/dist/lib/commands/auth.d.ts +2 -0
- package/dist/lib/commands/auth.d.ts.map +1 -0
- package/dist/lib/commands/auth.js +33 -0
- package/dist/lib/commands/auth.js.map +1 -0
- package/dist/lib/commands/bootstrap-args.d.ts +11 -0
- package/dist/lib/commands/bootstrap-args.d.ts.map +1 -0
- package/dist/lib/commands/bootstrap-args.js +111 -0
- package/dist/lib/commands/bootstrap-args.js.map +1 -0
- package/dist/lib/commands/bootstrap.d.ts +5 -0
- package/dist/lib/commands/bootstrap.d.ts.map +1 -0
- package/dist/lib/commands/bootstrap.js +166 -0
- package/dist/lib/commands/bootstrap.js.map +1 -0
- package/dist/lib/commands/check.d.ts +3 -0
- package/dist/lib/commands/check.d.ts.map +1 -0
- package/dist/lib/commands/check.js +47 -0
- package/dist/lib/commands/check.js.map +1 -0
- package/dist/lib/commands/config-pull.d.ts +12 -0
- package/dist/lib/commands/config-pull.d.ts.map +1 -0
- package/dist/lib/commands/config-pull.js +161 -0
- package/dist/lib/commands/config-pull.js.map +1 -0
- package/dist/lib/commands/config-push-args.d.ts +9 -0
- package/dist/lib/commands/config-push-args.d.ts.map +1 -0
- package/dist/lib/commands/config-push-args.js +108 -0
- package/dist/lib/commands/config-push-args.js.map +1 -0
- package/dist/lib/commands/config-push.d.ts +6 -0
- package/dist/lib/commands/config-push.d.ts.map +1 -0
- package/dist/lib/commands/config-push.js +166 -0
- package/dist/lib/commands/config-push.js.map +1 -0
- package/dist/lib/commands/deployment-config.d.ts +9 -0
- package/dist/lib/commands/deployment-config.d.ts.map +1 -0
- package/dist/lib/commands/deployment-config.js +73 -0
- package/dist/lib/commands/deployment-config.js.map +1 -0
- package/dist/lib/commands/env-plan.d.ts +4 -0
- package/dist/lib/commands/env-plan.d.ts.map +1 -0
- package/dist/lib/commands/env-plan.js +85 -0
- package/dist/lib/commands/env-plan.js.map +1 -0
- package/dist/lib/commands/env.d.ts +4 -0
- package/dist/lib/commands/env.d.ts.map +1 -0
- package/dist/lib/commands/env.js +122 -0
- package/dist/lib/commands/env.js.map +1 -0
- package/dist/lib/commands/init.d.ts +3 -0
- package/dist/lib/commands/init.d.ts.map +1 -0
- package/dist/lib/commands/init.js +59 -0
- package/dist/lib/commands/init.js.map +1 -0
- package/dist/lib/commands/secrets-args.d.ts +13 -0
- package/dist/lib/commands/secrets-args.d.ts.map +1 -0
- package/dist/lib/commands/secrets-args.js +136 -0
- package/dist/lib/commands/secrets-args.js.map +1 -0
- package/dist/lib/commands/secrets-plan.d.ts +9 -0
- package/dist/lib/commands/secrets-plan.d.ts.map +1 -0
- package/dist/lib/commands/secrets-plan.js +109 -0
- package/dist/lib/commands/secrets-plan.js.map +1 -0
- package/dist/lib/commands/secrets.d.ts +7 -0
- package/dist/lib/commands/secrets.d.ts.map +1 -0
- package/dist/lib/commands/secrets.js +191 -0
- package/dist/lib/commands/secrets.js.map +1 -0
- package/dist/lib/deployments.d.ts +4 -0
- package/dist/lib/deployments.d.ts.map +1 -0
- package/dist/lib/deployments.js +83 -0
- package/dist/lib/deployments.js.map +1 -0
- package/dist/lib/environments.d.ts +4 -0
- package/dist/lib/environments.d.ts.map +1 -0
- package/dist/lib/environments.js +97 -0
- package/dist/lib/environments.js.map +1 -0
- package/dist/lib/firebase-credential.d.ts +28 -0
- package/dist/lib/firebase-credential.d.ts.map +1 -0
- package/dist/lib/firebase-credential.js +50 -0
- package/dist/lib/firebase-credential.js.map +1 -0
- package/dist/lib/firebase-invalidate.d.ts +4 -0
- package/dist/lib/firebase-invalidate.d.ts.map +1 -0
- package/dist/lib/firebase-invalidate.js +61 -0
- package/dist/lib/firebase-invalidate.js.map +1 -0
- package/dist/lib/firebase-vars.d.ts +14 -0
- package/dist/lib/firebase-vars.d.ts.map +1 -0
- package/dist/lib/firebase-vars.js +40 -0
- package/dist/lib/firebase-vars.js.map +1 -0
- package/dist/lib/firebase.d.ts +20 -0
- package/dist/lib/firebase.d.ts.map +1 -0
- package/dist/lib/firebase.js +189 -0
- package/dist/lib/firebase.js.map +1 -0
- package/dist/lib/gcp.d.ts +4 -0
- package/dist/lib/gcp.d.ts.map +1 -0
- package/dist/lib/gcp.js +53 -0
- package/dist/lib/gcp.js.map +1 -0
- package/dist/lib/generated-secrets.d.ts +16 -0
- package/dist/lib/generated-secrets.d.ts.map +1 -0
- package/dist/lib/generated-secrets.js +68 -0
- package/dist/lib/generated-secrets.js.map +1 -0
- package/dist/lib/logger.d.ts +7 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +60 -0
- package/dist/lib/logger.js.map +1 -0
- package/dist/lib/manifest/index.d.ts +6 -0
- package/dist/lib/manifest/index.d.ts.map +1 -0
- package/dist/lib/manifest/index.js +15 -0
- package/dist/lib/manifest/index.js.map +1 -0
- package/dist/lib/manifest/parse.d.ts +11 -0
- package/dist/lib/manifest/parse.d.ts.map +1 -0
- package/dist/lib/manifest/parse.js +214 -0
- package/dist/lib/manifest/parse.js.map +1 -0
- package/dist/lib/manifest/resolve.d.ts +9 -0
- package/dist/lib/manifest/resolve.d.ts.map +1 -0
- package/dist/lib/manifest/resolve.js +34 -0
- package/dist/lib/manifest/resolve.js.map +1 -0
- package/dist/lib/manifest/types.d.ts +57 -0
- package/dist/lib/manifest/types.d.ts.map +1 -0
- package/dist/lib/manifest/types.js +12 -0
- package/dist/lib/manifest/types.js.map +1 -0
- package/dist/lib/manifest/write.d.ts +3 -0
- package/dist/lib/manifest/write.d.ts.map +1 -0
- package/dist/lib/manifest/write.js +110 -0
- package/dist/lib/manifest/write.js.map +1 -0
- package/dist/lib/project.d.ts +6 -0
- package/dist/lib/project.d.ts.map +1 -0
- package/dist/lib/project.js +56 -0
- package/dist/lib/project.js.map +1 -0
- package/dist/lib/providers/deployment.d.ts +19 -0
- package/dist/lib/providers/deployment.d.ts.map +1 -0
- package/dist/lib/providers/deployment.js +62 -0
- package/dist/lib/providers/deployment.js.map +1 -0
- package/dist/lib/providers/registry.d.ts +5 -0
- package/dist/lib/providers/registry.d.ts.map +1 -0
- package/dist/lib/providers/registry.js +31 -0
- package/dist/lib/providers/registry.js.map +1 -0
- package/dist/lib/providers/service.d.ts +35 -0
- package/dist/lib/providers/service.d.ts.map +1 -0
- package/dist/lib/providers/service.js +81 -0
- package/dist/lib/providers/service.js.map +1 -0
- package/dist/lib/rotation-preflight.d.ts +11 -0
- package/dist/lib/rotation-preflight.d.ts.map +1 -0
- package/dist/lib/rotation-preflight.js +47 -0
- package/dist/lib/rotation-preflight.js.map +1 -0
- package/dist/lib/rotation.d.ts +33 -0
- package/dist/lib/rotation.d.ts.map +1 -0
- package/dist/lib/rotation.js +168 -0
- package/dist/lib/rotation.js.map +1 -0
- package/dist/lib/sentry.d.ts +5 -0
- package/dist/lib/sentry.d.ts.map +1 -0
- package/dist/lib/sentry.js +132 -0
- package/dist/lib/sentry.js.map +1 -0
- package/dist/lib/subprocess.d.ts +8 -0
- package/dist/lib/subprocess.d.ts.map +1 -0
- package/dist/lib/subprocess.js +30 -0
- package/dist/lib/subprocess.js.map +1 -0
- package/dist/lib/targets.d.ts +3 -0
- package/dist/lib/targets.d.ts.map +1 -0
- package/dist/lib/targets.js +25 -0
- package/dist/lib/targets.js.map +1 -0
- package/dist/lib/vercel-api.d.ts +50 -0
- package/dist/lib/vercel-api.d.ts.map +1 -0
- package/dist/lib/vercel-api.js +176 -0
- package/dist/lib/vercel-api.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-args.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/bootstrap-args.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,gBAAgB;IAG/B,SAAS,EAAE,MAAM,CAAC;IAElB,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,EAAE,MAAM,CAAC;IAEtB,MAAM,EAAE,OAAO,CAAC;IAEhB,IAAI,EAAE,OAAO,CAAC;IAEd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,eAAe,0uCAqBc,CAAC;AAI3C,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EAAE,EACd,UAAU,EAAE,MAAM,GACjB,gBAAgB,CAuClB"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.BOOTSTRAP_USAGE = void 0;
|
|
37
|
+
exports.parseBootstrapArgs = parseBootstrapArgs;
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const logger_1 = require("../logger");
|
|
40
|
+
exports.BOOTSTRAP_USAGE = `Usage: envctl bootstrap [OPTIONS]
|
|
41
|
+
|
|
42
|
+
Configure a project end to end in one pass: push public environment variables,
|
|
43
|
+
initialize any provider secrets that are not yet present, then materialize a
|
|
44
|
+
local dotenv file for development. Idempotent — safe to re-run: public vars are
|
|
45
|
+
upserted, and a secret that already exists is left in place (use
|
|
46
|
+
'envctl secrets rotate' to rotate it) rather than re-initialized.
|
|
47
|
+
|
|
48
|
+
Preconditions: a linked Vercel project (.vercel/project.json, from
|
|
49
|
+
'vercel link'), the Vercel CLI on PATH, an authenticated gcloud for Firebase,
|
|
50
|
+
and a Sentry token for Sentry. Run 'envctl auth status' to check.
|
|
51
|
+
|
|
52
|
+
OPTIONS:
|
|
53
|
+
--env <name|all> Environment(s) for the public-config and secrets
|
|
54
|
+
phases (default: all)
|
|
55
|
+
--deployment-dir <path> Path to the deployment config directory, resolved
|
|
56
|
+
against the project root (default: deployment)
|
|
57
|
+
--out <path> Dotenv file the pull phase writes, resolved against
|
|
58
|
+
the project root (default: .env.local)
|
|
59
|
+
--no-pull Skip the local dotenv pull phase
|
|
60
|
+
--dry-run Print the plan for every phase without making changes
|
|
61
|
+
-h, --help Show this help`;
|
|
62
|
+
// Parses `bootstrap` args (the global -C/--working-dir flag is already stripped
|
|
63
|
+
// by the router). Prints usage and exits 0 on -h/--help.
|
|
64
|
+
function parseBootstrapArgs(args, workingDir) {
|
|
65
|
+
let targetEnv = "all";
|
|
66
|
+
let deploymentDir = "deployment";
|
|
67
|
+
let dryRun = false;
|
|
68
|
+
let pull = true;
|
|
69
|
+
let out = ".env.local";
|
|
70
|
+
for (let i = 0; i < args.length; i++) {
|
|
71
|
+
const arg = args[i];
|
|
72
|
+
if (arg === "--env") {
|
|
73
|
+
targetEnv =
|
|
74
|
+
args[++i] ?? (0, logger_1.err)('--env requires an environment name or "all"');
|
|
75
|
+
if (!targetEnv)
|
|
76
|
+
(0, logger_1.err)('--env requires an environment name or "all"');
|
|
77
|
+
}
|
|
78
|
+
else if (arg === "--deployment-dir") {
|
|
79
|
+
deploymentDir = args[++i] ?? (0, logger_1.err)("--deployment-dir requires a path");
|
|
80
|
+
if (!deploymentDir)
|
|
81
|
+
(0, logger_1.err)("--deployment-dir requires a path");
|
|
82
|
+
}
|
|
83
|
+
else if (arg === "--out") {
|
|
84
|
+
out = args[++i] ?? (0, logger_1.err)("--out requires a path");
|
|
85
|
+
if (!out)
|
|
86
|
+
(0, logger_1.err)("--out requires a path");
|
|
87
|
+
}
|
|
88
|
+
else if (arg === "--no-pull") {
|
|
89
|
+
pull = false;
|
|
90
|
+
}
|
|
91
|
+
else if (arg === "--dry-run") {
|
|
92
|
+
dryRun = true;
|
|
93
|
+
}
|
|
94
|
+
else if (arg === "-h" || arg === "--help") {
|
|
95
|
+
console.log(exports.BOOTSTRAP_USAGE);
|
|
96
|
+
process.exit(0);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
(0, logger_1.err)(`Unknown option: ${arg}. Run 'envctl bootstrap --help' for usage.`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
targetEnv,
|
|
104
|
+
workingDir,
|
|
105
|
+
deploymentDir: path.resolve(workingDir, deploymentDir),
|
|
106
|
+
dryRun,
|
|
107
|
+
pull,
|
|
108
|
+
out: path.resolve(workingDir, out),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=bootstrap-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap-args.js","sourceRoot":"","sources":["../../../src/lib/commands/bootstrap-args.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,gDA0CC;AA1FD,2CAA6B;AAE7B,sCAAgC;AAqBnB,QAAA,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;0CAqBW,CAAC;AAE3C,gFAAgF;AAChF,yDAAyD;AAC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AI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,CAAC,GAAG,CAAC,uBAAe,CAAC,CAAC;YAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,IAAA,YAAG,EAAC,mBAAmB,GAAG,4CAA4C,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,OAAO;QACL,SAAS;QACT,UAAU;QACV,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC;QACtD,MAAM;QACN,IAAI;QACJ,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CommandContext } from "../cli/registry";
|
|
2
|
+
import type { BootstrapOptions } from "./bootstrap-args";
|
|
3
|
+
export declare function runBootstrap(opts: BootstrapOptions): Promise<void>;
|
|
4
|
+
export declare function runBootstrapCommand(ctx: CommandContext, args: string[]): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/bootstrap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AActD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiKzD,wBAAsB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDxE;AAID,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runBootstrap = runBootstrap;
|
|
4
|
+
exports.runBootstrapCommand = runBootstrapCommand;
|
|
5
|
+
const auth_1 = require("../auth");
|
|
6
|
+
const deployments_1 = require("../deployments");
|
|
7
|
+
const environments_1 = require("../environments");
|
|
8
|
+
const targets_1 = require("../targets");
|
|
9
|
+
const firebase_credential_1 = require("../firebase-credential");
|
|
10
|
+
const logger_1 = require("../logger");
|
|
11
|
+
const manifest_1 = require("../manifest");
|
|
12
|
+
const project_1 = require("../project");
|
|
13
|
+
const subprocess_1 = require("../subprocess");
|
|
14
|
+
const vercel_api_1 = require("../vercel-api");
|
|
15
|
+
const bootstrap_args_1 = require("./bootstrap-args");
|
|
16
|
+
const config_pull_1 = require("./config-pull");
|
|
17
|
+
const config_push_1 = require("./config-push");
|
|
18
|
+
const env_plan_1 = require("./env-plan");
|
|
19
|
+
const secrets_1 = require("./secrets");
|
|
20
|
+
const secrets_plan_1 = require("./secrets-plan");
|
|
21
|
+
// Fails fast, before any change, on the prerequisites the three phases need:
|
|
22
|
+
// a resolvable Vercel project, the Vercel CLI (for the pull), gcloud (for
|
|
23
|
+
// Firebase), and a Sentry token (for Sentry). Tool-existence checks are skipped
|
|
24
|
+
// on --dry-run because those tools are never invoked on that path.
|
|
25
|
+
function bootstrapPreflight(opts, configured) {
|
|
26
|
+
(0, project_1.detectProject)(opts.workingDir); // throws early if the project can't be resolved
|
|
27
|
+
if (opts.dryRun)
|
|
28
|
+
return;
|
|
29
|
+
if (opts.pull && !(0, subprocess_1.commandExists)("vercel"))
|
|
30
|
+
(0, logger_1.err)("The Vercel CLI is required for the local pull phase. Install it (e.g. `npm i -g vercel`) or pass --no-pull.");
|
|
31
|
+
if (configured.firebase && !(0, subprocess_1.commandExists)("gcloud"))
|
|
32
|
+
(0, logger_1.err)("gcloud is required to initialize Firebase secrets. Authenticate gcloud, or remove Firebase config to skip it.");
|
|
33
|
+
if (configured.sentry && !(0, auth_1.resolveSentryToken)())
|
|
34
|
+
(0, logger_1.err)("A Sentry token is required to initialize Sentry secrets. Set SENTRY_AUTH_TOKEN or run `sentry-cli login`.");
|
|
35
|
+
}
|
|
36
|
+
// The three fixed Vercel deployment targets. Used to check full presence for
|
|
37
|
+
// "--env all": a secret is "already present" only if it covers all targets.
|
|
38
|
+
const ALL_VERCEL_TARGETS = ["production", "preview", "development"];
|
|
39
|
+
// Reports which providers already have their secret present in the Vercel
|
|
40
|
+
// project, scoped to the requested target(s) so a partial prior run (e.g. key
|
|
41
|
+
// exists for production only) does not incorrectly skip other environments.
|
|
42
|
+
// Uses the manifest's resolved Firebase credential names so a project with
|
|
43
|
+
// custom var names (e.g. `privateKey: FB_PK`) is correctly detected.
|
|
44
|
+
async function detectExistingSecrets(client, targetEnv, deploymentDir) {
|
|
45
|
+
const { envs } = await client.listEnvVars();
|
|
46
|
+
const isPresent = (key) => {
|
|
47
|
+
if (targetEnv === "all") {
|
|
48
|
+
return ALL_VERCEL_TARGETS.every((t) => envs.some((e) => e.key === key && e.target.includes(t)));
|
|
49
|
+
}
|
|
50
|
+
return envs.some((e) => e.key === key && e.target.includes(targetEnv));
|
|
51
|
+
};
|
|
52
|
+
const firebaseService = (0, manifest_1.parseManifest)(deploymentDir).services.find((s) => s.provider === "firebase");
|
|
53
|
+
const firebaseSpec = (0, firebase_credential_1.resolveFirebaseCredential)(firebaseService);
|
|
54
|
+
return {
|
|
55
|
+
firebase: (0, firebase_credential_1.firebasePresenceKeys)(firebaseSpec).some(isPresent),
|
|
56
|
+
sentry: ["SENTRY_DSN", "NEXT_PUBLIC_SENTRY_DSN"].some(isPresent),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
// Phase 2: initialize each configured secret that is not already present.
|
|
60
|
+
// Idempotent — an existing secret is left in place (rotate it explicitly).
|
|
61
|
+
async function bootstrapSecrets(opts, token, configured, resolvedTarget) {
|
|
62
|
+
const services = ["firebase", "sentry"].filter((s) => configured[s]);
|
|
63
|
+
if (services.length === 0) {
|
|
64
|
+
(0, logger_1.log)(" No secret providers configured — skipping.");
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (opts.dryRun) {
|
|
68
|
+
for (const s of services)
|
|
69
|
+
(0, logger_1.log)(` Would initialize ${s} secrets if not already present.`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const project = (0, project_1.detectProject)(opts.workingDir);
|
|
73
|
+
const client = new vercel_api_1.VercelClient(token, project.projectId, project.teamId);
|
|
74
|
+
const present = await detectExistingSecrets(client, resolvedTarget, opts.deploymentDir);
|
|
75
|
+
for (const service of services) {
|
|
76
|
+
if (present[service]) {
|
|
77
|
+
(0, logger_1.log)(` ${service}: already present — skipping (use 'envctl secrets rotate' to rotate).`);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
(0, logger_1.log)(` ${service}: initializing...`);
|
|
81
|
+
await (0, secrets_1.runSecrets)({
|
|
82
|
+
targetEnv: resolvedTarget,
|
|
83
|
+
workingDir: opts.workingDir,
|
|
84
|
+
deploymentDir: opts.deploymentDir,
|
|
85
|
+
invalidateKeys: true,
|
|
86
|
+
refreshPreviews: false,
|
|
87
|
+
init: service,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// Phase 4: trigger redeployments so running environments pick up the pushed
|
|
92
|
+
// vars. On a zero-deployment project this logs a skip per env (the
|
|
93
|
+
// "No READY deployment found" message) rather than erroring, satisfying the
|
|
94
|
+
// #71 requirement that bootstrap explicitly reports when verification is skipped.
|
|
95
|
+
async function bootstrapVerify(opts, token, resolvedTarget) {
|
|
96
|
+
if (opts.dryRun) {
|
|
97
|
+
(0, logger_1.log)(" Would trigger redeployments to verify pushed configuration.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const project = (0, project_1.detectProject)(opts.workingDir);
|
|
101
|
+
const client = new vercel_api_1.VercelClient(token, project.projectId, project.teamId);
|
|
102
|
+
await (0, deployments_1.triggerAndWaitRedeployments)(resolvedTarget, client);
|
|
103
|
+
}
|
|
104
|
+
// Phase 3: materialize the local dotenv file from the development environment.
|
|
105
|
+
function bootstrapPull(opts) {
|
|
106
|
+
if (!opts.pull) {
|
|
107
|
+
(0, logger_1.log)(" Skipping local dotenv pull (--no-pull).");
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (opts.dryRun) {
|
|
111
|
+
(0, logger_1.log)(` Would pull development into ${opts.out}.`);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// Bootstrap is idempotent and always refreshes the local dotenv, so it
|
|
115
|
+
// overwrites any existing file (--force).
|
|
116
|
+
(0, config_pull_1.runConfigPull)({ workingDir: opts.workingDir }, [
|
|
117
|
+
"--env",
|
|
118
|
+
"development",
|
|
119
|
+
"--out",
|
|
120
|
+
opts.out,
|
|
121
|
+
"--force",
|
|
122
|
+
]);
|
|
123
|
+
}
|
|
124
|
+
// Orchestrates the end-to-end bootstrap: public config, then any missing
|
|
125
|
+
// secrets, then the local dotenv file. Accepts fully-resolved options so it is
|
|
126
|
+
// directly unit-testable.
|
|
127
|
+
async function runBootstrap(opts) {
|
|
128
|
+
const token = (0, auth_1.resolveVercelToken)();
|
|
129
|
+
(0, env_plan_1.assertDeploymentPrereqs)(opts.deploymentDir, token); // narrows token to string
|
|
130
|
+
const activeEnvs = (0, environments_1.listActiveEnvs)(opts.deploymentDir);
|
|
131
|
+
if (activeEnvs.length === 0)
|
|
132
|
+
(0, logger_1.err)(`No active environments found in ${opts.deploymentDir}/environments.yml`);
|
|
133
|
+
const devSource = (0, env_plan_1.findDevSource)(opts.deploymentDir, activeEnvs);
|
|
134
|
+
const envList = (0, env_plan_1.resolveEnvList)(activeEnvs, opts.targetEnv, devSource);
|
|
135
|
+
// Resolve the env name to its Vercel provider target for Vercel API calls.
|
|
136
|
+
// detectConfiguredServices scans env YAML files and needs the env name, not
|
|
137
|
+
// the provider target, so it still receives opts.targetEnv.
|
|
138
|
+
const resolvedTarget = opts.targetEnv === "all"
|
|
139
|
+
? "all"
|
|
140
|
+
: (0, targets_1.resolveEnvTarget)(opts.deploymentDir, opts.targetEnv);
|
|
141
|
+
const configured = (0, secrets_plan_1.detectConfiguredServices)(opts.deploymentDir, opts.targetEnv, envList, devSource);
|
|
142
|
+
bootstrapPreflight(opts, configured);
|
|
143
|
+
(0, logger_1.log)(opts.dryRun
|
|
144
|
+
? "Bootstrap dry run — no changes will be made"
|
|
145
|
+
: "Bootstrapping project...");
|
|
146
|
+
(0, logger_1.log)("Phase 1/4 — public environment variables");
|
|
147
|
+
await (0, config_push_1.runPush)({
|
|
148
|
+
targetEnv: opts.targetEnv,
|
|
149
|
+
workingDir: opts.workingDir,
|
|
150
|
+
deploymentDir: opts.deploymentDir,
|
|
151
|
+
dryRun: opts.dryRun,
|
|
152
|
+
});
|
|
153
|
+
(0, logger_1.log)("Phase 2/4 — provider secrets");
|
|
154
|
+
await bootstrapSecrets(opts, token, configured, resolvedTarget);
|
|
155
|
+
(0, logger_1.log)("Phase 3/4 — local environment file");
|
|
156
|
+
bootstrapPull(opts);
|
|
157
|
+
(0, logger_1.log)("Phase 4/4 — post-push verification");
|
|
158
|
+
await bootstrapVerify(opts, token, resolvedTarget);
|
|
159
|
+
(0, logger_1.log)(opts.dryRun ? "Dry run complete." : "Bootstrap complete.");
|
|
160
|
+
}
|
|
161
|
+
// Command adapter: parses args (the global -C is already stripped by the
|
|
162
|
+
// router) and dispatches to the orchestrator.
|
|
163
|
+
async function runBootstrapCommand(ctx, args) {
|
|
164
|
+
await runBootstrap((0, bootstrap_args_1.parseBootstrapArgs)(args, ctx.workingDir));
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../../../src/lib/commands/bootstrap.ts"],"names":[],"mappings":";;AAgLA,oCAmDC;AAID,kDAKC;AA5OD,kCAAiE;AAEjE,gDAA6D;AAC7D,kDAAiD;AACjD,wCAA8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C,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA2BtD,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runCheck = runCheck;
|
|
4
|
+
const check_1 = require("../check");
|
|
5
|
+
const check_live_1 = require("../check-live");
|
|
6
|
+
const logger_1 = require("../logger");
|
|
7
|
+
const USAGE = `Usage: envctl check [--live]
|
|
8
|
+
|
|
9
|
+
Validate that the project's deployment config is coherent and deployable,
|
|
10
|
+
without changing anything. Reports every problem it finds and exits non-zero if
|
|
11
|
+
any is an error.
|
|
12
|
+
|
|
13
|
+
--live Also reconcile declared public variables against what is live on the
|
|
14
|
+
deployment provider (requires network + auth).`;
|
|
15
|
+
function parseCheckArgs(args) {
|
|
16
|
+
let live = false;
|
|
17
|
+
for (const arg of args) {
|
|
18
|
+
if (arg === "--live")
|
|
19
|
+
live = true;
|
|
20
|
+
else if (arg === "-h" || arg === "--help") {
|
|
21
|
+
console.log(USAGE);
|
|
22
|
+
process.exit(0);
|
|
23
|
+
}
|
|
24
|
+
else
|
|
25
|
+
(0, logger_1.err)(`Unknown option: ${arg}. Run 'envctl check --help' for usage.`);
|
|
26
|
+
}
|
|
27
|
+
return { live };
|
|
28
|
+
}
|
|
29
|
+
// `envctl check [--live]` — read-only validation of the project's deployment
|
|
30
|
+
// config. Prints each finding, then exits non-zero (via err) if any error was
|
|
31
|
+
// found.
|
|
32
|
+
async function runCheck(ctx, args) {
|
|
33
|
+
const { live } = parseCheckArgs(args);
|
|
34
|
+
const findings = (0, check_1.checkStatic)(ctx.workingDir);
|
|
35
|
+
if (live)
|
|
36
|
+
findings.push(...(await (0, check_live_1.checkLive)(ctx.workingDir)));
|
|
37
|
+
for (const f of findings)
|
|
38
|
+
console.error(` ${f.severity === "error" ? "✖" : "⚠"} ${f.message}`);
|
|
39
|
+
const errorCount = findings.filter((f) => f.severity === "error").length;
|
|
40
|
+
const warningCount = findings.length - errorCount;
|
|
41
|
+
if (errorCount > 0)
|
|
42
|
+
(0, logger_1.err)(`check failed: ${errorCount} error(s)${warningCount ? `, ${warningCount} warning(s)` : ""}.`);
|
|
43
|
+
(0, logger_1.log)(warningCount > 0
|
|
44
|
+
? `OK with ${warningCount} warning(s).`
|
|
45
|
+
: "OK — deployment config is valid.");
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../src/lib/commands/check.ts"],"names":[],"mappings":";;AA6BA,4BAuBC;AApDD,oCAAqD;AACrD,8CAA0C;AAE1C,sCAAqC;AAErC,MAAM,KAAK,GAAG;;;;;;;0DAO4C,CAAC;AAE3D,SAAS,cAAc,CAAC,IAAc;IACpC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,GAAG,KAAK,QAAQ;YAAE,IAAI,GAAG,IAAI,CAAC;aAC7B,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;;YAAM,IAAA,YAAG,EAAC,mBAAmB,GAAG,wCAAwC,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,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const PULL_USAGE = "Usage: envctl config pull [OPTIONS]\n\nMaterialize a local dotenv file from an environment for local development \u2014 the\ninverse of 'config push'. Delegates to the Vercel CLI (`vercel env pull`),\nwhich handles decryption and dotenv escaping, so the pulled file includes the\nenvironment's secrets. The environment name is mapped to its Vercel target the\nsame way as 'config push' (development -> development, staging -> preview, ...).\n\nThe target holds live secrets: it is written with owner-only (0600) permissions\nand 'config pull' warns if it is not gitignored.\n\nOPTIONS:\n --env <name> Environment to pull (default: development)\n --out <path> Output file, resolved against the project root\n (default: .env.local)\n --force Overwrite the target file if it already exists\n -h, --help Show this help";
|
|
8
|
+
export declare function parsePullArgs(args: string[], workingDir: string): PullOptions;
|
|
9
|
+
export declare function runConfigPull(ctx: CommandContext, args: string[]): void;
|
|
10
|
+
export declare function runEnvPullDeprecated(ctx: CommandContext, args: string[]): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=config-pull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-pull.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/config-pull.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,UAAU,WAAW;IAEnB,GAAG,EAAE,MAAM,CAAC;IAEZ,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,s1BAgBS,CAAC;AAGjC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAsB7E;AAuBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA2DvE;AAID,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,MAAM,EAAE,GACb,IAAI,CAGN"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.PULL_USAGE = void 0;
|
|
37
|
+
exports.parsePullArgs = parsePullArgs;
|
|
38
|
+
exports.runConfigPull = runConfigPull;
|
|
39
|
+
exports.runEnvPullDeprecated = runEnvPullDeprecated;
|
|
40
|
+
const fs = __importStar(require("fs"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const logger_1 = require("../logger");
|
|
43
|
+
const subprocess_1 = require("../subprocess");
|
|
44
|
+
const targets_1 = require("../targets");
|
|
45
|
+
const deployment_config_1 = require("./deployment-config");
|
|
46
|
+
exports.PULL_USAGE = `Usage: envctl config pull [OPTIONS]
|
|
47
|
+
|
|
48
|
+
Materialize a local dotenv file from an environment for local development — the
|
|
49
|
+
inverse of 'config push'. Delegates to the Vercel CLI (\`vercel env pull\`),
|
|
50
|
+
which handles decryption and dotenv escaping, so the pulled file includes the
|
|
51
|
+
environment's secrets. The environment name is mapped to its Vercel target the
|
|
52
|
+
same way as 'config push' (development -> development, staging -> preview, ...).
|
|
53
|
+
|
|
54
|
+
The target holds live secrets: it is written with owner-only (0600) permissions
|
|
55
|
+
and 'config pull' warns if it is not gitignored.
|
|
56
|
+
|
|
57
|
+
OPTIONS:
|
|
58
|
+
--env <name> Environment to pull (default: development)
|
|
59
|
+
--out <path> Output file, resolved against the project root
|
|
60
|
+
(default: .env.local)
|
|
61
|
+
--force Overwrite the target file if it already exists
|
|
62
|
+
-h, --help Show this help`;
|
|
63
|
+
// `args` has already had the global -C/--working-dir flag stripped by the router.
|
|
64
|
+
function parsePullArgs(args, workingDir) {
|
|
65
|
+
let env = "development";
|
|
66
|
+
let out = ".env.local";
|
|
67
|
+
let force = false;
|
|
68
|
+
for (let i = 0; i < args.length; i++) {
|
|
69
|
+
const arg = args[i];
|
|
70
|
+
if (arg === "--env") {
|
|
71
|
+
env = args[++i] ?? (0, logger_1.err)("--env requires an environment name");
|
|
72
|
+
}
|
|
73
|
+
else if (arg === "--out") {
|
|
74
|
+
out = args[++i] ?? (0, logger_1.err)("--out requires a path");
|
|
75
|
+
}
|
|
76
|
+
else if (arg === "--force") {
|
|
77
|
+
force = true;
|
|
78
|
+
}
|
|
79
|
+
else if (arg === "-h" || arg === "--help") {
|
|
80
|
+
console.log(exports.PULL_USAGE);
|
|
81
|
+
process.exit(0);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
(0, logger_1.err)(`Unknown option: ${arg}. Run 'envctl config pull --help' for usage.`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return { env, out: path.resolve(workingDir, out), force };
|
|
88
|
+
}
|
|
89
|
+
// Warns when the pulled file is not gitignored, since it now holds live
|
|
90
|
+
// secrets. Uses `git check-ignore` (the authoritative source: it honors nested
|
|
91
|
+
// .gitignore, negations, and global excludes) rather than reimplementing the
|
|
92
|
+
// match. Silently skips when git is absent or the path is outside a repo — a
|
|
93
|
+
// spurious warning is worse than none for an advisory check.
|
|
94
|
+
function warnIfNotGitIgnored(target, cwd) {
|
|
95
|
+
if (!(0, subprocess_1.commandExists)("git"))
|
|
96
|
+
return;
|
|
97
|
+
const { status } = (0, subprocess_1.runStatus)("git", ["check-ignore", "-q", "--", target], {
|
|
98
|
+
cwd,
|
|
99
|
+
});
|
|
100
|
+
if (status === 1)
|
|
101
|
+
(0, logger_1.warn)(`${target} is not gitignored — it holds secrets and may be committed. Add it to .gitignore.`);
|
|
102
|
+
}
|
|
103
|
+
// `envctl config pull` — pull an environment's variables into a local dotenv
|
|
104
|
+
// file, the inverse of `config push`. Wraps the Vercel CLI (it owns decryption
|
|
105
|
+
// + escaping); preflights that the CLI is present and the directory is a linked
|
|
106
|
+
// Vercel project, refuses to clobber an existing file without --force, and
|
|
107
|
+
// restricts the written file to the owner because it contains secrets.
|
|
108
|
+
function runConfigPull(ctx, args) {
|
|
109
|
+
const opts = parsePullArgs(args, ctx.workingDir);
|
|
110
|
+
if (!(0, subprocess_1.commandExists)("vercel")) {
|
|
111
|
+
(0, logger_1.err)("The Vercel CLI is required for 'config pull'. Install it (e.g. `npm i -g vercel`) and run `vercel login`.");
|
|
112
|
+
}
|
|
113
|
+
if (!fs.existsSync(path.join(ctx.workingDir, ".vercel", "project.json"))) {
|
|
114
|
+
(0, logger_1.err)("Not a linked Vercel project (no .vercel/project.json). Run `vercel link` first.");
|
|
115
|
+
}
|
|
116
|
+
// Use lstatSync (not existsSync) to avoid following symlinks: a dangling
|
|
117
|
+
// symlink returns false from existsSync but lstatSync detects it.
|
|
118
|
+
let targetStat;
|
|
119
|
+
try {
|
|
120
|
+
targetStat = fs.lstatSync(opts.out);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Target does not exist — safe to create.
|
|
124
|
+
}
|
|
125
|
+
if (targetStat !== undefined) {
|
|
126
|
+
if (!targetStat.isFile()) {
|
|
127
|
+
(0, logger_1.err)(`${opts.out} exists but is not a regular file — refusing to write secrets to it.`);
|
|
128
|
+
}
|
|
129
|
+
if (!opts.force) {
|
|
130
|
+
(0, logger_1.err)(`Refusing to overwrite ${opts.out} without --force.`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const target = (0, targets_1.resolveEnvTarget)((0, deployment_config_1.deploymentDir)(ctx.workingDir), opts.env);
|
|
134
|
+
// Pre-create the target at 0600 before the CLI writes secrets into it,
|
|
135
|
+
// closing the window where the CLI creates the file with a permissive umask.
|
|
136
|
+
// chmodSync handles existing files, since writeFileSync's mode applies only
|
|
137
|
+
// on creation.
|
|
138
|
+
fs.writeFileSync(opts.out, "", { mode: 0o600 });
|
|
139
|
+
fs.chmodSync(opts.out, 0o600);
|
|
140
|
+
(0, logger_1.log)(`Pulling '${opts.env}' (${target}) into ${opts.out}...`);
|
|
141
|
+
try {
|
|
142
|
+
(0, subprocess_1.run)("vercel", ["env", "pull", opts.out, `--environment=${target}`, "--yes"], {
|
|
143
|
+
cwd: ctx.workingDir,
|
|
144
|
+
env: { ...process.env, VERCEL_NON_INTERACTIVE: "1" },
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
(0, logger_1.err)(`vercel env pull failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
149
|
+
}
|
|
150
|
+
// Backstop: some CLIs replace the inode (temp-then-rename); re-lock after write.
|
|
151
|
+
fs.chmodSync(opts.out, 0o600);
|
|
152
|
+
warnIfNotGitIgnored(opts.out, ctx.workingDir);
|
|
153
|
+
(0, logger_1.log)(`Wrote ${opts.out}`);
|
|
154
|
+
}
|
|
155
|
+
// Deprecated alias: `envctl env pull` now lives at `config pull` (the inverse of
|
|
156
|
+
// `config push`). Warns, then delegates so existing scripts keep working.
|
|
157
|
+
function runEnvPullDeprecated(ctx, args) {
|
|
158
|
+
(0, logger_1.warn)("'envctl env pull' is deprecated — use 'envctl config pull' instead.");
|
|
159
|
+
runConfigPull(ctx, args);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=config-pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-pull.js","sourceRoot":"","sources":["../../../src/lib/commands/config-pull.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,sCAsBC;AAuBD,sCA2DC;AAID,oDAMC;AAvJD,uCAAyB;AACzB,2CAA6B;AAG7B,sCAA2C;AAC3C,8CAA8D;AAC9D,wCAA8C;AAC9C,2DAAoD;AAWvC,QAAA,UAAU,GAAG;;;;;;;;;;;;;;;;gCAgBM,CAAC;AAEjC,kFAAkF;AAClF,SAAgB,aAAa,CAAC,IAAc,EAAE,UAAkB;IAC9D,IAAI,GAAG,GAAG,aAAa,CAAC;IACxB,IAAI,GAAG,GAAG,YAAY,CAAC;IACvB,IAAI,KAAK,GAAG,KAAK,CAAC;IAElB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;YACpB,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,IAAA,YAAG,EAAC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KAAK,CAAC,CAAC;IAC9B,IAAA,YAAG,EAAC,YAAY,IAAI,CAAC,GAAG,MAAM,MAAM,UAAU,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7D,IAAI,CAAC;QACH,IAAA,gBAAG,EACD,QAAQ,EACR,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,iBAAiB,MAAM,EAAE,EAAE,OAAO,CAAC,EAC7D;YACE,GAAG,EAAE,GAAG,CAAC,UAAU;YACnB,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,sBAAsB,EAAE,GAAG,EAAE;SACrD,CACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAA,YAAG,EACD,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACpF,CAAC;IACJ,CAAC;IAED,iFAAiF;IACjF,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9B,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAC9C,IAAA,YAAG,EAAC,SAAS,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED,iFAAiF;AACjF,0EAA0E;AAC1E,SAAgB,oBAAoB,CAClC,GAAmB,EACnB,IAAc;IAEd,IAAA,aAAI,EAAC,qEAAqE,CAAC,CAAC;IAC5E,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PushOptions {
|
|
2
|
+
targetEnv: string;
|
|
3
|
+
workingDir: string;
|
|
4
|
+
deploymentDir: string;
|
|
5
|
+
dryRun: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const PUSH_USAGE = "Usage: envctl config push [OPTIONS]\n\nUpsert public (non-secret) environment variables to a Vercel project from\ndeployment configuration files. Reads the list of active environments from\n<deployment-dir>/environments.yml and per-environment values from\n<deployment-dir>/{env}.yml.\n\nThe development Vercel target is always populated from the same YAML source as\nthe staging/preview environment. It does not appear in environments.yml and has\nno dedicated YAML file. Existing variables are updated in place; missing ones\nare created as plain-type records. Variables not present in the config files are\nleft untouched.\n\nOPTIONS:\n --env <name> Target a specific environment by name as listed in\n environments.yml, or 'development' for the implicit\n development target (default: all active environments\n plus development)\n --deployment-dir <path> Path to the deployment config directory, resolved\n against the project root (default: deployment)\n --dry-run Print what would change without making any API calls\n -h, --help Show this help\n\nENVIRONMENT MAPPING:\n production \u2192 production (Vercel target)\n staging \u2192 preview (Vercel target)\n preview \u2192 preview (Vercel target)\n development \u2192 development (implicit \u2014 mirrors staging/preview)\n <other> \u2192 passed through as-is";
|
|
8
|
+
export declare function parsePushArgs(args: string[], workingDir: string): PushOptions;
|
|
9
|
+
//# sourceMappingURL=config-push-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-push-args.d.ts","sourceRoot":"","sources":["../../../src/lib/commands/config-push-args.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAG1B,SAAS,EAAE,MAAM,CAAC;IAGlB,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,EAAE,MAAM,CAAC;IAEtB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,UAAU,q9CA4Bc,CAAC;AAMtC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CA8B7E"}
|