@chriscode/hush 4.1.2 → 4.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/dist/cli.js +4 -3
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +121 -19
- package/dist/commands/skill.d.ts.map +1 -1
- package/dist/commands/skill.js +63 -10
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +16 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -40,7 +40,7 @@ ${pc.bold('Commands:')}
|
|
|
40
40
|
inspect List all variables (masked values, AI-safe)
|
|
41
41
|
has <key> Check if a secret exists (exit 0 if set, 1 if not)
|
|
42
42
|
check Verify secrets are encrypted (for pre-commit hooks)
|
|
43
|
-
push Push secrets to Cloudflare Workers
|
|
43
|
+
push Push secrets to Cloudflare (Workers and Pages)
|
|
44
44
|
status Show configuration and status
|
|
45
45
|
skill Install Claude Code / OpenCode skill
|
|
46
46
|
keys <cmd> Manage SOPS age keys (setup, generate, pull, push, list)
|
|
@@ -57,7 +57,7 @@ ${pc.bold('Advanced Commands:')}
|
|
|
57
57
|
${pc.bold('Options:')}
|
|
58
58
|
-e, --env <env> Environment: development or production (default: development)
|
|
59
59
|
-r, --root <dir> Root directory (default: current directory)
|
|
60
|
-
-t, --target <t> Target name from hush.yaml (run/resolve
|
|
60
|
+
-t, --target <t> Target name from hush.yaml (run/resolve/push)
|
|
61
61
|
-q, --quiet Suppress output (has/check commands)
|
|
62
62
|
--dry-run Preview changes without applying (push only)
|
|
63
63
|
--verbose Show detailed output (push --dry-run only)
|
|
@@ -110,6 +110,7 @@ ${pc.bold('Examples:')}
|
|
|
110
110
|
hush has API_KEY -q && echo "API_KEY is configured"
|
|
111
111
|
hush check Verify secrets are encrypted
|
|
112
112
|
hush push --dry-run Preview push to Cloudflare
|
|
113
|
+
hush push -t app Push only the 'app' target
|
|
113
114
|
hush status Show current status
|
|
114
115
|
hush skill Install Claude skill (interactive)
|
|
115
116
|
`);
|
|
@@ -364,7 +365,7 @@ async function main() {
|
|
|
364
365
|
await checkCommand({ root, warn, json, quiet, onlyChanged, requireSource, allowPlaintext });
|
|
365
366
|
break;
|
|
366
367
|
case 'push':
|
|
367
|
-
await pushCommand({ root, dryRun, verbose });
|
|
368
|
+
await pushCommand({ root, dryRun, verbose, target });
|
|
368
369
|
break;
|
|
369
370
|
case 'status':
|
|
370
371
|
await statusCommand({ root });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/commands/push.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAU,WAAW,EAAqC,MAAM,aAAa,CAAC;AAgH1F,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CA6GrE"}
|
package/dist/commands/push.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
-
import { existsSync } from 'node:fs';
|
|
2
|
+
import { existsSync, writeFileSync, unlinkSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import pc from 'picocolors';
|
|
5
5
|
import { loadConfig } from '../config/loader.js';
|
|
@@ -8,7 +8,8 @@ import { interpolateVars } from '../core/interpolate.js';
|
|
|
8
8
|
import { mergeVars } from '../core/merge.js';
|
|
9
9
|
import { parseEnvContent } from '../core/parse.js';
|
|
10
10
|
import { decrypt as sopsDecrypt } from '../core/sops.js';
|
|
11
|
-
|
|
11
|
+
import { loadLocalTemplates, resolveTemplateVars } from '../core/template.js';
|
|
12
|
+
function pushWorkerSecret(key, value, targetDir, dryRun, verbose) {
|
|
12
13
|
if (dryRun) {
|
|
13
14
|
if (verbose) {
|
|
14
15
|
console.log(pc.green(` + ${key}`));
|
|
@@ -32,10 +33,80 @@ function pushSecret(key, value, targetDir, dryRun, verbose) {
|
|
|
32
33
|
return false;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
function pushPagesSecrets(vars, projectName, targetDir, dryRun, verbose) {
|
|
37
|
+
if (dryRun) {
|
|
38
|
+
for (const { key } of vars) {
|
|
39
|
+
if (verbose) {
|
|
40
|
+
console.log(pc.green(` + ${key}`));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
console.log(pc.dim(` [dry-run] ${key}`));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { success: vars.length, failed: 0 };
|
|
47
|
+
}
|
|
48
|
+
const secretsJson = {};
|
|
49
|
+
for (const { key, value } of vars) {
|
|
50
|
+
secretsJson[key] = value;
|
|
51
|
+
}
|
|
52
|
+
const tempFile = join(targetDir, '.hush-secrets-temp.json');
|
|
53
|
+
try {
|
|
54
|
+
writeFileSync(tempFile, JSON.stringify(secretsJson, null, 2));
|
|
55
|
+
execSync(`wrangler pages secret bulk "${tempFile}" --project-name "${projectName}"`, {
|
|
56
|
+
cwd: targetDir,
|
|
57
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
58
|
+
shell: '/bin/bash',
|
|
59
|
+
});
|
|
60
|
+
for (const { key } of vars) {
|
|
61
|
+
console.log(pc.green(` ${key}`));
|
|
62
|
+
}
|
|
63
|
+
return { success: vars.length, failed: 0 };
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
const err = error;
|
|
67
|
+
const stderrStr = err.stderr instanceof Buffer ? err.stderr.toString() : (err.stderr || err.message || 'Unknown error');
|
|
68
|
+
console.error(pc.red(` Failed to push secrets: ${stderrStr}`));
|
|
69
|
+
return { success: 0, failed: vars.length };
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
if (existsSync(tempFile)) {
|
|
73
|
+
unlinkSync(tempFile);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function getTargetsWithPush(config, targetFilter) {
|
|
78
|
+
const pushableTargets = config.targets.filter(t => {
|
|
79
|
+
const hasPushConfig = t.push_to !== undefined;
|
|
80
|
+
const isWranglerFormat = t.format === 'wrangler';
|
|
81
|
+
return hasPushConfig || isWranglerFormat;
|
|
82
|
+
});
|
|
83
|
+
if (targetFilter) {
|
|
84
|
+
const filtered = pushableTargets.filter(t => t.name === targetFilter);
|
|
85
|
+
if (filtered.length === 0) {
|
|
86
|
+
const availableTargets = pushableTargets.map(t => t.name).join(', ');
|
|
87
|
+
throw new Error(`Target "${targetFilter}" not found or has no push configuration.\n` +
|
|
88
|
+
`Available pushable targets: ${availableTargets || '(none)'}`);
|
|
89
|
+
}
|
|
90
|
+
return filtered;
|
|
91
|
+
}
|
|
92
|
+
return pushableTargets;
|
|
93
|
+
}
|
|
94
|
+
function getPushType(target) {
|
|
95
|
+
if (target.push_to) {
|
|
96
|
+
return target.push_to.type;
|
|
97
|
+
}
|
|
98
|
+
return 'cloudflare-workers';
|
|
99
|
+
}
|
|
100
|
+
function getPagesProject(target) {
|
|
101
|
+
if (target.push_to?.type === 'cloudflare-pages') {
|
|
102
|
+
return target.push_to.project;
|
|
103
|
+
}
|
|
104
|
+
throw new Error(`Target "${target.name}" is not configured for Cloudflare Pages`);
|
|
105
|
+
}
|
|
35
106
|
export async function pushCommand(options) {
|
|
36
|
-
const { root, dryRun, verbose } = options;
|
|
107
|
+
const { root, dryRun, verbose, target: targetFilter } = options;
|
|
37
108
|
const config = loadConfig(root);
|
|
38
|
-
console.log(pc.blue('Pushing production secrets to Cloudflare
|
|
109
|
+
console.log(pc.blue('Pushing production secrets to Cloudflare...'));
|
|
39
110
|
if (dryRun) {
|
|
40
111
|
console.log(pc.yellow('(dry-run mode)'));
|
|
41
112
|
if (verbose) {
|
|
@@ -59,30 +130,61 @@ export async function pushCommand(options) {
|
|
|
59
130
|
}
|
|
60
131
|
const merged = mergeVars(...varSources);
|
|
61
132
|
const interpolated = interpolateVars(merged);
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
133
|
+
const rootSecretsRecord = {};
|
|
134
|
+
for (const { key, value } of interpolated) {
|
|
135
|
+
rootSecretsRecord[key] = value;
|
|
136
|
+
}
|
|
137
|
+
let pushableTargets;
|
|
138
|
+
try {
|
|
139
|
+
pushableTargets = getTargetsWithPush(config, targetFilter);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
console.error(pc.red(error.message));
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
if (pushableTargets.length === 0) {
|
|
146
|
+
console.error(pc.red('No targets configured for push'));
|
|
147
|
+
console.error(pc.dim('Add format: wrangler or push_to: { type: cloudflare-pages, project: ... } to a target'));
|
|
65
148
|
process.exit(1);
|
|
66
149
|
}
|
|
67
|
-
for (const target of
|
|
150
|
+
for (const target of pushableTargets) {
|
|
68
151
|
const targetDir = join(root, target.path);
|
|
69
|
-
const
|
|
152
|
+
const pushType = getPushType(target);
|
|
153
|
+
let filtered = filterVarsForTarget(interpolated, target);
|
|
154
|
+
const localTemplate = loadLocalTemplates(targetDir, 'production');
|
|
155
|
+
if (localTemplate.hasTemplate) {
|
|
156
|
+
const templateVars = resolveTemplateVars(localTemplate.vars, rootSecretsRecord, { processEnv: process.env });
|
|
157
|
+
filtered = mergeVars(filtered, templateVars);
|
|
158
|
+
}
|
|
159
|
+
if (filtered.length === 0) {
|
|
160
|
+
console.log(pc.dim(`\n${target.name} - no matching vars, skipped`));
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const typeLabel = pushType === 'cloudflare-pages' ? 'Pages' : 'Workers';
|
|
70
164
|
if (dryRun && verbose) {
|
|
71
|
-
console.log(pc.blue(`\n[DRY RUN] Would push to ${target.name} (${target.path}/):`));
|
|
165
|
+
console.log(pc.blue(`\n[DRY RUN] Would push to ${target.name} (${typeLabel}, ${target.path}/):`));
|
|
72
166
|
}
|
|
73
167
|
else {
|
|
74
|
-
console.log(pc.blue(`\n${target.name} (${target.path}/)`));
|
|
168
|
+
console.log(pc.blue(`\n${target.name} (${typeLabel}, ${target.path}/)`));
|
|
75
169
|
}
|
|
76
170
|
let success = 0;
|
|
77
171
|
let failed = 0;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
172
|
+
if (pushType === 'cloudflare-pages') {
|
|
173
|
+
const projectName = getPagesProject(target);
|
|
174
|
+
const result = pushPagesSecrets(filtered, projectName, targetDir, dryRun, verbose);
|
|
175
|
+
success = result.success;
|
|
176
|
+
failed = result.failed;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
for (const { key, value } of filtered) {
|
|
180
|
+
if (pushWorkerSecret(key, value, targetDir, dryRun, verbose)) {
|
|
181
|
+
if (!dryRun)
|
|
182
|
+
console.log(pc.green(` ${key}`));
|
|
183
|
+
success++;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
failed++;
|
|
187
|
+
}
|
|
86
188
|
}
|
|
87
189
|
}
|
|
88
190
|
console.log(pc.dim(` ${success} pushed, ${failed} failed`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA8hDhD,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CvE"}
|
package/dist/commands/skill.js
CHANGED
|
@@ -723,14 +723,25 @@ hush status
|
|
|
723
723
|
|
|
724
724
|
### hush push
|
|
725
725
|
|
|
726
|
-
Push production secrets to Cloudflare Workers.
|
|
726
|
+
Push production secrets to Cloudflare (Workers and Pages).
|
|
727
727
|
|
|
728
728
|
\`\`\`bash
|
|
729
|
-
hush push # Push
|
|
729
|
+
hush push # Push all targets
|
|
730
|
+
hush push -t api # Push specific target
|
|
730
731
|
hush push --dry-run # Preview without pushing
|
|
731
732
|
hush push --dry-run --verbose # Detailed preview of what would be pushed
|
|
732
733
|
\`\`\`
|
|
733
734
|
|
|
735
|
+
**For Cloudflare Pages:** Add \`push_to\` configuration to your target:
|
|
736
|
+
\`\`\`yaml
|
|
737
|
+
targets:
|
|
738
|
+
- name: app
|
|
739
|
+
format: dotenv
|
|
740
|
+
push_to:
|
|
741
|
+
type: cloudflare-pages
|
|
742
|
+
project: my-pages-project
|
|
743
|
+
\`\`\`
|
|
744
|
+
|
|
734
745
|
---
|
|
735
746
|
|
|
736
747
|
## Debugging Commands
|
|
@@ -895,10 +906,11 @@ hush has DB_URL -q && hush has API_KEY -q && echo "All set"
|
|
|
895
906
|
|
|
896
907
|
### hush push
|
|
897
908
|
|
|
898
|
-
Push production secrets to Cloudflare Workers.
|
|
909
|
+
Push production secrets to Cloudflare (Workers and Pages).
|
|
899
910
|
|
|
900
911
|
\`\`\`bash
|
|
901
|
-
hush push # Push
|
|
912
|
+
hush push # Push all targets
|
|
913
|
+
hush push -t api # Push specific target
|
|
902
914
|
hush push --dry-run # Preview without pushing
|
|
903
915
|
\`\`\`
|
|
904
916
|
|
|
@@ -1232,14 +1244,35 @@ Look at the 🚫 EXCLUDED section to see which pattern is filtering out your var
|
|
|
1232
1244
|
|
|
1233
1245
|
### "Wrangler dev not seeing secrets"
|
|
1234
1246
|
|
|
1235
|
-
If you are using \`hush run -- wrangler dev\` and secrets are missing
|
|
1247
|
+
If you are using \`hush run -- wrangler dev\` and secrets are missing:
|
|
1236
1248
|
|
|
1237
|
-
**
|
|
1238
|
-
|
|
1239
|
-
|
|
1249
|
+
**Step 1: Check for blocking files**
|
|
1250
|
+
\`\`\`bash
|
|
1251
|
+
ls -la .dev.vars # If this exists, it blocks Hush secrets
|
|
1252
|
+
\`\`\`
|
|
1240
1253
|
|
|
1241
|
-
**
|
|
1242
|
-
|
|
1254
|
+
**Step 2: Delete the blocking file**
|
|
1255
|
+
\`\`\`bash
|
|
1256
|
+
rm .dev.vars
|
|
1257
|
+
\`\`\`
|
|
1258
|
+
|
|
1259
|
+
**Step 3: Run normally**
|
|
1260
|
+
\`\`\`bash
|
|
1261
|
+
npx hush run -t api -- wrangler dev
|
|
1262
|
+
\`\`\`
|
|
1263
|
+
|
|
1264
|
+
**Step 4: If still not working, update Wrangler**
|
|
1265
|
+
\`\`\`bash
|
|
1266
|
+
npm update wrangler
|
|
1267
|
+
\`\`\`
|
|
1268
|
+
|
|
1269
|
+
**Why this happens:**
|
|
1270
|
+
- Wrangler has a strict rule: if \`.dev.vars\` exists (even empty!), it ignores ALL environment variables
|
|
1271
|
+
- Hush automatically sets \`CLOUDFLARE_INCLUDE_PROCESS_ENV=true\` for you
|
|
1272
|
+
- But Wrangler only respects this when no \`.dev.vars\` file exists
|
|
1273
|
+
- Older Wrangler versions may not support \`CLOUDFLARE_INCLUDE_PROCESS_ENV\` at all
|
|
1274
|
+
|
|
1275
|
+
**Prevention tip:** Never use \`hush decrypt\` for Wrangler targets—always use \`hush run\`.
|
|
1243
1276
|
|
|
1244
1277
|
### "Variable appears in wrong places"
|
|
1245
1278
|
|
|
@@ -1292,6 +1325,26 @@ npx hush inspect # See what's new
|
|
|
1292
1325
|
\`\`\`bash
|
|
1293
1326
|
npx hush push --dry-run # Preview first
|
|
1294
1327
|
npx hush push # Actually push
|
|
1328
|
+
npx hush push -t api # Push specific target
|
|
1329
|
+
\`\`\`
|
|
1330
|
+
|
|
1331
|
+
### "Push to Cloudflare Pages"
|
|
1332
|
+
|
|
1333
|
+
First, add \`push_to\` to your target in \`hush.yaml\`:
|
|
1334
|
+
\`\`\`yaml
|
|
1335
|
+
targets:
|
|
1336
|
+
- name: app
|
|
1337
|
+
path: ./app
|
|
1338
|
+
format: dotenv
|
|
1339
|
+
push_to:
|
|
1340
|
+
type: cloudflare-pages
|
|
1341
|
+
project: my-pages-project
|
|
1342
|
+
\`\`\`
|
|
1343
|
+
|
|
1344
|
+
Then push:
|
|
1345
|
+
\`\`\`bash
|
|
1346
|
+
npx hush push -t app --dry-run # Preview first
|
|
1347
|
+
npx hush push -t app # Actually push
|
|
1295
1348
|
\`\`\`
|
|
1296
1349
|
|
|
1297
1350
|
### "Build and deploy"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ1D;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAepG;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAoBnD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAO5G;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAK9C,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ1D;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAepG;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAoBnD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,UAAU,GAAG;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAO5G;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,EAAE,CA6C3D"}
|
package/dist/config/loader.js
CHANGED
|
@@ -55,6 +55,7 @@ export function checkSchemaVersion(config) {
|
|
|
55
55
|
export function validateConfig(config) {
|
|
56
56
|
const errors = [];
|
|
57
57
|
const validFormats = ['dotenv', 'wrangler', 'json', 'shell', 'yaml'];
|
|
58
|
+
const validPushTypes = ['cloudflare-workers', 'cloudflare-pages'];
|
|
58
59
|
if (!config.sources.shared) {
|
|
59
60
|
errors.push('sources.shared is required');
|
|
60
61
|
}
|
|
@@ -76,6 +77,21 @@ export function validateConfig(config) {
|
|
|
76
77
|
else if (!validFormats.includes(target.format)) {
|
|
77
78
|
errors.push(`${prefix}: invalid format "${target.format}" (must be one of: ${validFormats.join(', ')})`);
|
|
78
79
|
}
|
|
80
|
+
// Validate push_to configuration
|
|
81
|
+
if (target.push_to) {
|
|
82
|
+
if (!target.push_to.type) {
|
|
83
|
+
errors.push(`${prefix}: push_to.type is required (one of: ${validPushTypes.join(', ')})`);
|
|
84
|
+
}
|
|
85
|
+
else if (!validPushTypes.includes(target.push_to.type)) {
|
|
86
|
+
errors.push(`${prefix}: invalid push_to.type "${target.push_to.type}" (must be one of: ${validPushTypes.join(', ')})`);
|
|
87
|
+
}
|
|
88
|
+
else if (target.push_to.type === 'cloudflare-pages') {
|
|
89
|
+
const pagesConfig = target.push_to;
|
|
90
|
+
if (!pagesConfig.project) {
|
|
91
|
+
errors.push(`${prefix}: push_to.project is required for cloudflare-pages`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
79
95
|
}
|
|
80
96
|
return errors;
|
|
81
97
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
export type OutputFormat = 'dotenv' | 'wrangler' | 'json' | 'shell' | 'yaml';
|
|
2
2
|
export type Environment = 'development' | 'production';
|
|
3
|
+
export type PushDestinationType = 'cloudflare-workers' | 'cloudflare-pages';
|
|
4
|
+
export interface CloudflareWorkersPushConfig {
|
|
5
|
+
type: 'cloudflare-workers';
|
|
6
|
+
}
|
|
7
|
+
export interface CloudflarePagesPushConfig {
|
|
8
|
+
type: 'cloudflare-pages';
|
|
9
|
+
project: string;
|
|
10
|
+
}
|
|
11
|
+
export type PushConfig = CloudflareWorkersPushConfig | CloudflarePagesPushConfig;
|
|
3
12
|
export interface Target {
|
|
4
13
|
name: string;
|
|
5
14
|
path: string;
|
|
6
15
|
format: OutputFormat;
|
|
7
16
|
include?: string[];
|
|
8
17
|
exclude?: string[];
|
|
18
|
+
push_to?: PushConfig;
|
|
9
19
|
}
|
|
10
20
|
export interface SourceFiles {
|
|
11
21
|
shared: string;
|
|
@@ -52,6 +62,7 @@ export interface PushOptions {
|
|
|
52
62
|
root: string;
|
|
53
63
|
dryRun: boolean;
|
|
54
64
|
verbose: boolean;
|
|
65
|
+
target?: string;
|
|
55
66
|
}
|
|
56
67
|
export interface StatusOptions {
|
|
57
68
|
root: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAC7E,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"types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