@wallavi/vercel-build 0.1.4 → 0.1.5

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.d.ts CHANGED
@@ -1356,6 +1356,7 @@ declare function esperarYPromoverDeploy(opciones: OpcionesPromover): ResultadoPr
1356
1356
  declare const VARIABLES_VERCEL: readonly ["VERCEL_TOKEN", "VERCEL_ORG_ID", "VERCEL_PROJECT_ID"];
1357
1357
  declare const PASOS_VERCEL: readonly [readonly ["pull", "--yes", "--environment=production"], readonly ["build", "--prod"], readonly ["deploy", "--prebuilt", "--prod"]];
1358
1358
  declare const PASO_DEPLOY_REMOTO: readonly ["deploy", "--prod", "--yes", "--no-wait"];
1359
+ declare function argumentosPasoVercel(paso: readonly string[], sha: string): string[];
1359
1360
  declare const ARCHIVO_ENV_PRODUCCION: string;
1360
1361
  declare function tieneVariablesSensibles(carpeta: string): boolean;
1361
1362
  declare function extraerUrlSalud(salida: string, error?: string): string | null;
@@ -1682,4 +1683,4 @@ type Comando = (args: string[], entorno: Entorno) => number;
1682
1683
  declare const COMANDOS: Record<string, Comando>;
1683
1684
  declare function principal(argv: string[], entorno: Entorno): number;
1684
1685
 
1685
- export { API_VERCEL_URL, ARCHIVO_CAPTURA_V6, ARCHIVO_CONFIG, ARCHIVO_DEPLOYMENTS_V6, ARCHIVO_ENV_PRODUCCION, type ArgumentosCapturar, type ArgumentosDesplegar, type ArgumentosMedir, COMANDOS, type CapturaV6, type Comando, type ConfigVercelBuild, type DeploymentPromocion, type DeploymentVercel, type DiaMinutos, type Dormir, ESTADOS_DEPLOYMENT, type Ejecutar, type Entorno, type EquipoVercel, ErrorContratoVercel, ErrorRedVercel, type Evaluacion, INTERVALO_POLL_DEPLOY_MS, LIMITE_PAGINA_VERCEL, MAX_PAGINAS_VERCEL, type MetodoHttpVercel, type OpcionesCambios, type OpcionesCapturar, type OpcionesDesplegar, type OpcionesIgnorar, type OpcionesMedir, type OpcionesProceso, type OpcionesPromover, PASOS_VERCEL, PASO_DEPLOY_REMOTO, PREFIJO_PREVIEW, type PaginaDeployments, type PaginaTeams, type PaginacionVercel, type PedidoCaptura, type ProyectoVercelBuild, RAMA_PRINCIPAL, REFERENCIA_DEPLOYMENTS_V6, type RespuestaHttp, type Resultado, type ResultadoDeployments, type ResultadoProceso, type ResultadoPromocion, type SolicitarVercel, TIMEOUT_POLL_DEPLOY_MS, USO, VARIABLES_VERCEL, armarCapturaV6, calcularMinutosPorDia, capturar, comandoCapturar, comandoDesplegar, comandoIgnorar, comandoMedir, comandoTurbo, configVacia, consultarDeployments, desplegar, dormirSincrono, ejecutar, ejecutarCapturar, ejecutarDesplegar, ejecutarIgnorar, ejecutarMedir, esperarYPromoverDeploy, esquemaArchivoDeployments, esquemaCapturaV6, esquemaConfig, esquemaDeployment, esquemaDeploymentPromocion, esquemaEquipo, esquemaEstadoDeployment, esquemaListaDeploymentsPromocion, esquemaPaginaDeployments, esquemaPaginaTeams, esquemaPaginacion, esquemaPedidoCaptura, evaluarCambios, extraerAliasProduccion, extraerIdOUrlDeploy, extraerUrlSalud, ignorar, leerArgumentosCapturar, leerArgumentosDesplegar, leerArgumentosMedir, leerConfig, leerFlagsCli, leerRespuestaDeployments, limpiarIdOUrlDeploy, medir, normalizarCarpeta, paquetesDeTurbo, pedirJsonVercel, principal, proyectoDeCarpeta, ramaPermitida, rangoFechasUtc, redactarToken, resolverEquipo, solicitarVercel, tieneVariablesSensibles, ubicarEnRepo, validarConfig, validarFechaIso };
1686
+ export { API_VERCEL_URL, ARCHIVO_CAPTURA_V6, ARCHIVO_CONFIG, ARCHIVO_DEPLOYMENTS_V6, ARCHIVO_ENV_PRODUCCION, type ArgumentosCapturar, type ArgumentosDesplegar, type ArgumentosMedir, COMANDOS, type CapturaV6, type Comando, type ConfigVercelBuild, type DeploymentPromocion, type DeploymentVercel, type DiaMinutos, type Dormir, ESTADOS_DEPLOYMENT, type Ejecutar, type Entorno, type EquipoVercel, ErrorContratoVercel, ErrorRedVercel, type Evaluacion, INTERVALO_POLL_DEPLOY_MS, LIMITE_PAGINA_VERCEL, MAX_PAGINAS_VERCEL, type MetodoHttpVercel, type OpcionesCambios, type OpcionesCapturar, type OpcionesDesplegar, type OpcionesIgnorar, type OpcionesMedir, type OpcionesProceso, type OpcionesPromover, PASOS_VERCEL, PASO_DEPLOY_REMOTO, PREFIJO_PREVIEW, type PaginaDeployments, type PaginaTeams, type PaginacionVercel, type PedidoCaptura, type ProyectoVercelBuild, RAMA_PRINCIPAL, REFERENCIA_DEPLOYMENTS_V6, type RespuestaHttp, type Resultado, type ResultadoDeployments, type ResultadoProceso, type ResultadoPromocion, type SolicitarVercel, TIMEOUT_POLL_DEPLOY_MS, USO, VARIABLES_VERCEL, argumentosPasoVercel, armarCapturaV6, calcularMinutosPorDia, capturar, comandoCapturar, comandoDesplegar, comandoIgnorar, comandoMedir, comandoTurbo, configVacia, consultarDeployments, desplegar, dormirSincrono, ejecutar, ejecutarCapturar, ejecutarDesplegar, ejecutarIgnorar, ejecutarMedir, esperarYPromoverDeploy, esquemaArchivoDeployments, esquemaCapturaV6, esquemaConfig, esquemaDeployment, esquemaDeploymentPromocion, esquemaEquipo, esquemaEstadoDeployment, esquemaListaDeploymentsPromocion, esquemaPaginaDeployments, esquemaPaginaTeams, esquemaPaginacion, esquemaPedidoCaptura, evaluarCambios, extraerAliasProduccion, extraerIdOUrlDeploy, extraerUrlSalud, ignorar, leerArgumentosCapturar, leerArgumentosDesplegar, leerArgumentosMedir, leerConfig, leerFlagsCli, leerRespuestaDeployments, limpiarIdOUrlDeploy, medir, normalizarCarpeta, paquetesDeTurbo, pedirJsonVercel, principal, proyectoDeCarpeta, ramaPermitida, rangoFechasUtc, redactarToken, resolverEquipo, solicitarVercel, tieneVariablesSensibles, ubicarEnRepo, validarConfig, validarFechaIso };
package/dist/index.js CHANGED
@@ -795,9 +795,8 @@ ${salida}`.replace(REGEX_ANSI, "");
795
795
  const alias = /\bAlias(?:ed)?\s*:\s*(https?:\/\/[^\s\]"')>]+)/i.exec(
796
796
  texto
797
797
  )?.[1];
798
- const candidata = urlStdout ?? produccion ?? alias;
799
- if (candidata) {
800
- const limpio = limpiarIdOUrlDeploy(candidata);
798
+ for (const candidata of [urlStdout, produccion, alias]) {
799
+ const limpio = candidata ? limpiarIdOUrlDeploy(candidata) : null;
801
800
  if (limpio && limpio !== "vercel.com") return limpio;
802
801
  }
803
802
  return /\b(dpl_[a-zA-Z0-9]+)\b/.exec(texto)?.[1] ?? null;
@@ -1029,6 +1028,15 @@ var PASO_DEPLOY_REMOTO = [
1029
1028
  "--yes",
1030
1029
  "--no-wait"
1031
1030
  ];
1031
+ function argumentosPasoVercel(paso, sha) {
1032
+ return paso[0] === "deploy" ? [
1033
+ ...paso,
1034
+ "--meta",
1035
+ `githubCommitSha=${sha}`,
1036
+ "--meta",
1037
+ `gitCommitSha=${sha}`
1038
+ ] : [...paso];
1039
+ }
1032
1040
  var ARCHIVO_ENV_PRODUCCION = path3__namespace.join(
1033
1041
  ".vercel",
1034
1042
  ".env.production.local"
@@ -1065,8 +1073,11 @@ function redactarCredenciales(texto, env) {
1065
1073
  }
1066
1074
  return limpio;
1067
1075
  }
1068
- function correrPasoVercel(ej, paso, cwd, opciones) {
1069
- const r = ej("vercel", paso, { cwd, env: opciones.env });
1076
+ function correrPasoVercel(ej, paso, cwd, opciones, sha) {
1077
+ const r = ej("vercel", argumentosPasoVercel(paso, sha), {
1078
+ cwd,
1079
+ env: { ...opciones.env, VERCEL_GIT_COMMIT_SHA: sha }
1080
+ });
1070
1081
  if (r.salida.trim() !== "") {
1071
1082
  opciones.salida(redactarCredenciales(r.salida.trimEnd(), opciones.env));
1072
1083
  }
@@ -1142,7 +1153,13 @@ function ejecutarDesplegar(opciones) {
1142
1153
  );
1143
1154
  return 0;
1144
1155
  }
1145
- const rPull = correrPasoVercel(ej, PASOS_VERCEL[0], rutaCarpeta, opciones);
1156
+ const rPull = correrPasoVercel(
1157
+ ej,
1158
+ PASOS_VERCEL[0],
1159
+ rutaCarpeta,
1160
+ opciones,
1161
+ sha
1162
+ );
1146
1163
  if (!rPull.ok) return rPull.codigo;
1147
1164
  const cwdResuelto = path3__namespace.resolve(opciones.cwd);
1148
1165
  const raizGit = ubicarEnRepo(rutaCarpeta, ej)?.raiz ?? ubicarEnRepo(cwdResuelto, ej)?.raiz;
@@ -1166,7 +1183,7 @@ function ejecutarDesplegar(opciones) {
1166
1183
  const pasosRestantes = haySensibles ? [PASO_DEPLOY_REMOTO] : PASOS_VERCEL.slice(1);
1167
1184
  let ultimoDeploy = rPull.resultado;
1168
1185
  for (const paso of pasosRestantes) {
1169
- const r = correrPasoVercel(ej, paso, rutaCarpeta, opciones);
1186
+ const r = correrPasoVercel(ej, paso, rutaCarpeta, opciones, sha);
1170
1187
  if (!r.ok) return r.codigo;
1171
1188
  ultimoDeploy = r.resultado;
1172
1189
  }
@@ -1390,6 +1407,7 @@ exports.REFERENCIA_DEPLOYMENTS_V6 = REFERENCIA_DEPLOYMENTS_V6;
1390
1407
  exports.TIMEOUT_POLL_DEPLOY_MS = TIMEOUT_POLL_DEPLOY_MS;
1391
1408
  exports.USO = USO;
1392
1409
  exports.VARIABLES_VERCEL = VARIABLES_VERCEL;
1410
+ exports.argumentosPasoVercel = argumentosPasoVercel;
1393
1411
  exports.armarCapturaV6 = armarCapturaV6;
1394
1412
  exports.calcularMinutosPorDia = calcularMinutosPorDia;
1395
1413
  exports.capturar = capturar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallavi/vercel-build",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "description": "Detección de cambios y despliegue compartidos para los proyectos de Vercel del monorepo",
6
6
  "license": "MIT",