@ranger1/dx 0.1.55 → 0.1.56

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.
@@ -22,9 +22,6 @@ const TARGET_CONFIGS = {
22
22
  },
23
23
  }
24
24
 
25
- const EXPLICIT_ENV_VARS = ['APP_ENV', 'NODE_ENV']
26
- const PUBLIC_ENV_PREFIXES = ['NEXT_PUBLIC_', 'VITE_']
27
-
28
25
  const APP_ENV_MAP = {
29
26
  development: 'dev',
30
27
  staging: 'staging',
@@ -88,13 +85,9 @@ function listMissingConfigs(targetConfigs, projectRoot) {
88
85
  return missing
89
86
  }
90
87
 
91
- function appendTargetArgs(baseArgs, { cwd, orgId, projectId, explicitEnvArgs = [] }) {
88
+ function appendTargetArgs(baseArgs, { cwd, orgId }) {
92
89
  const args = [...baseArgs]
93
90
 
94
- if (explicitEnvArgs.length > 0) {
95
- args.push(...explicitEnvArgs)
96
- }
97
-
98
91
  if (cwd) {
99
92
  args.push('--cwd', cwd)
100
93
  }
@@ -103,40 +96,9 @@ function appendTargetArgs(baseArgs, { cwd, orgId, projectId, explicitEnvArgs = [
103
96
  args.push('--scope', orgId)
104
97
  }
105
98
 
106
- if (projectId) {
107
- args.push('--project', projectId)
108
- }
109
-
110
99
  return args
111
100
  }
112
101
 
113
- function collectExplicitVercelEnvEntries(sourceEnv = {}) {
114
- const includeKeys = new Set(EXPLICIT_ENV_VARS)
115
-
116
- Object.keys(sourceEnv).forEach(name => {
117
- if (PUBLIC_ENV_PREFIXES.some(prefix => name.startsWith(prefix))) {
118
- includeKeys.add(name)
119
- }
120
- })
121
-
122
- return [...includeKeys]
123
- .filter(name => {
124
- const value = sourceEnv[name]
125
- return !(
126
- value === undefined ||
127
- value === null ||
128
- envManager.isPlaceholderEnvValue(value)
129
- )
130
- })
131
- .sort()
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])
138
- }
139
-
140
102
  function maskIdentifier(value) {
141
103
  const raw = String(value || '').trim()
142
104
  if (raw.length <= 10) return raw || '-'
@@ -308,7 +270,7 @@ export async function deployToVercel(target, options = {}) {
308
270
  logger.info(' 1. VERCEL_TOKEN: vercel login 后查看 ~/Library/Application Support/com.vercel.cli/auth.json')
309
271
  logger.info(' 2. PROJECT_ID: vercel project ls --scope <org> 或通过 Vercel Dashboard 获取')
310
272
  logger.info('')
311
- logger.info('提示:部署命令会显式校验 --scope 与 --project,避免环境漂移。')
273
+ logger.info('提示:部署命令会显式校验 --scope 与环境变量上下文,避免环境漂移。')
312
274
  }
313
275
 
314
276
  if (missingConfigFiles.length > 0) {
@@ -373,16 +335,6 @@ export async function deployToVercel(target, options = {}) {
373
335
  `[deploy-context] env=${environment} target=${t} strict=${strictContext ? 1 : 0} org=${maskIdentifier(orgId)} project=${maskIdentifier(projectId)} linked=${linkedContext.exists ? 'yes' : 'no'} token=env`,
374
336
  )
375
337
 
376
- const explicitEnvEntries = collectExplicitVercelEnvEntries({
377
- ...process.env,
378
- APP_ENV: buildEnv,
379
- NODE_ENV: envManager.mapAppEnvToNodeEnv(environment),
380
- VERCEL_ORG_ID: orgId,
381
- VERCEL_PROJECT_ID: projectId,
382
- })
383
-
384
- const deployEnvArgs = withEnvFlag(explicitEnvEntries, '--env')
385
-
386
338
  const envVars = {
387
339
  ...process.env,
388
340
  VERCEL_PROJECT_ID: projectId,
@@ -421,7 +373,6 @@ export async function deployToVercel(target, options = {}) {
421
373
  {
422
374
  cwd: projectRoot,
423
375
  orgId,
424
- projectId,
425
376
  },
426
377
  )
427
378
 
@@ -440,8 +391,6 @@ export async function deployToVercel(target, options = {}) {
440
391
  {
441
392
  cwd: projectRoot,
442
393
  orgId,
443
- projectId,
444
- explicitEnvArgs: deployEnvArgs,
445
394
  },
446
395
  )
447
396
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ranger1/dx",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "repository": {