@ranger1/dx 0.1.53 → 0.1.55

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.
@@ -110,7 +110,7 @@ function appendTargetArgs(baseArgs, { cwd, orgId, projectId, explicitEnvArgs = [
110
110
  return args
111
111
  }
112
112
 
113
- function collectExplicitVercelEnvArgs(sourceEnv = {}) {
113
+ function collectExplicitVercelEnvEntries(sourceEnv = {}) {
114
114
  const includeKeys = new Set(EXPLICIT_ENV_VARS)
115
115
 
116
116
  Object.keys(sourceEnv).forEach(name => {
@@ -129,7 +129,12 @@ function collectExplicitVercelEnvArgs(sourceEnv = {}) {
129
129
  )
130
130
  })
131
131
  .sort()
132
- .flatMap(name => ['--env', `${name}=${String(sourceEnv[name])}`])
132
+ .map(name => `${name}=${String(sourceEnv[name])}`)
133
+ }
134
+
135
+ function withEnvFlag(entries, flag) {
136
+ if (!Array.isArray(entries) || entries.length === 0) return []
137
+ return entries.flatMap(entry => [flag, entry])
133
138
  }
134
139
 
135
140
  function maskIdentifier(value) {
@@ -368,7 +373,7 @@ export async function deployToVercel(target, options = {}) {
368
373
  `[deploy-context] env=${environment} target=${t} strict=${strictContext ? 1 : 0} org=${maskIdentifier(orgId)} project=${maskIdentifier(projectId)} linked=${linkedContext.exists ? 'yes' : 'no'} token=env`,
369
374
  )
370
375
 
371
- const explicitEnvArgs = collectExplicitVercelEnvArgs({
376
+ const explicitEnvEntries = collectExplicitVercelEnvEntries({
372
377
  ...process.env,
373
378
  APP_ENV: buildEnv,
374
379
  NODE_ENV: envManager.mapAppEnvToNodeEnv(environment),
@@ -376,6 +381,8 @@ export async function deployToVercel(target, options = {}) {
376
381
  VERCEL_PROJECT_ID: projectId,
377
382
  })
378
383
 
384
+ const deployEnvArgs = withEnvFlag(explicitEnvEntries, '--env')
385
+
379
386
  const envVars = {
380
387
  ...process.env,
381
388
  VERCEL_PROJECT_ID: projectId,
@@ -415,7 +422,6 @@ export async function deployToVercel(target, options = {}) {
415
422
  cwd: projectRoot,
416
423
  orgId,
417
424
  projectId,
418
- explicitEnvArgs,
419
425
  },
420
426
  )
421
427
 
@@ -435,7 +441,7 @@ export async function deployToVercel(target, options = {}) {
435
441
  cwd: projectRoot,
436
442
  orgId,
437
443
  projectId,
438
- explicitEnvArgs,
444
+ explicitEnvArgs: deployEnvArgs,
439
445
  },
440
446
  )
441
447
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ranger1/dx",
3
- "version": "0.1.53",
3
+ "version": "0.1.55",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {