cf-envsync 0.3.13 → 0.3.14
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/index.js +7 -8
- package/package.json +1 -1
- package/src/types/config.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -2286,9 +2286,6 @@ function validateConfig(config) {
|
|
|
2286
2286
|
if (!app.path) {
|
|
2287
2287
|
errors.push(`App "${name}" is missing "path" field`);
|
|
2288
2288
|
}
|
|
2289
|
-
if (!app.workers || Object.keys(app.workers).length === 0) {
|
|
2290
|
-
errors.push(`App "${name}" is missing "workers" mapping`);
|
|
2291
|
-
}
|
|
2292
2289
|
if ((!app.secrets || app.secrets.length === 0) && (!app.vars || app.vars.length === 0)) {
|
|
2293
2290
|
errors.push(`App "${name}" has no "secrets" or "vars" declared`);
|
|
2294
2291
|
}
|
|
@@ -2355,7 +2352,7 @@ function resolveApps(config, appNames) {
|
|
|
2355
2352
|
return resolved;
|
|
2356
2353
|
}
|
|
2357
2354
|
function getWorkerName(app, environment) {
|
|
2358
|
-
return app.workers[environment];
|
|
2355
|
+
return app.workers?.[environment];
|
|
2359
2356
|
}
|
|
2360
2357
|
function resolveEnvFilePath(pattern, env2) {
|
|
2361
2358
|
if (env2 === "local")
|
|
@@ -14410,11 +14407,13 @@ function generateConfigTS(config) {
|
|
|
14410
14407
|
for (const [name, app] of Object.entries(config.apps)) {
|
|
14411
14408
|
lines.push(` ${quoteKey(name)}: {`);
|
|
14412
14409
|
lines.push(` path: ${JSON.stringify(app.path)},`);
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14410
|
+
if (app.workers && Object.keys(app.workers).length > 0) {
|
|
14411
|
+
lines.push(` workers: {`);
|
|
14412
|
+
for (const [env2, worker] of Object.entries(app.workers)) {
|
|
14413
|
+
lines.push(` ${quoteKey(env2)}: ${JSON.stringify(worker)},`);
|
|
14414
|
+
}
|
|
14415
|
+
lines.push(` },`);
|
|
14416
14416
|
}
|
|
14417
|
-
lines.push(` },`);
|
|
14418
14417
|
if (app.secrets?.length) {
|
|
14419
14418
|
lines.push(` secrets: ${JSON.stringify(app.secrets)},`);
|
|
14420
14419
|
}
|
package/package.json
CHANGED
package/src/types/config.ts
CHANGED
|
@@ -35,8 +35,8 @@ export interface EnvSyncConfig {
|
|
|
35
35
|
export interface AppConfig {
|
|
36
36
|
/** Path to app directory relative to project root */
|
|
37
37
|
path: string;
|
|
38
|
-
/** Cloudflare Worker names per environment */
|
|
39
|
-
workers
|
|
38
|
+
/** Cloudflare Worker names per environment (omit for non-worker apps) */
|
|
39
|
+
workers?: Record<string, string>;
|
|
40
40
|
/** Secret keys for this app (pushed via wrangler secret) */
|
|
41
41
|
secrets?: string[];
|
|
42
42
|
/** Var keys for this app (non-secret env vars) */
|