@timekast/factory 2.0.0 → 2.0.1
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/commands/env.js +8 -0
- package/dist/commands/provision.js +20 -5
- package/dist/lib/vault-api.js +5 -0
- package/package.json +1 -1
package/dist/commands/env.js
CHANGED
|
@@ -127,6 +127,8 @@ export function readVaultVercelSyncStatus(rootDir) {
|
|
|
127
127
|
}
|
|
128
128
|
if (!state)
|
|
129
129
|
return 'unknown';
|
|
130
|
+
if (state.target === 'railway')
|
|
131
|
+
return 'railway';
|
|
130
132
|
const syncs = state.syncs;
|
|
131
133
|
const recorded = VERCEL_SYNC_ROLES.every((role) => Boolean(syncs?.ids?.[role]));
|
|
132
134
|
const pending = VERCEL_SYNC_ROLES.some((role) => syncs?.pending?.includes(role));
|
|
@@ -141,6 +143,12 @@ export function readVaultVercelSyncStatus(rootDir) {
|
|
|
141
143
|
* says they are not confirmed and points at `factory provision --resume`, which creates them.
|
|
142
144
|
*/
|
|
143
145
|
export function vaultPushCessionMessage(link, syncs = 'active') {
|
|
146
|
+
if (syncs === 'railway') {
|
|
147
|
+
return ('Este repo usa la bóveda y despliega en Railway: sus variables llegan ahí por los syncs de la ' +
|
|
148
|
+
'bóveda y env push no escribe en ningún destino. Cambia el valor en la bóveda ' +
|
|
149
|
+
`(proyecto ${link.projectId}, entorno ${link.envs.main} → Railway \`main\`, ` +
|
|
150
|
+
`${link.envs.develop} → Railway \`develop\`); el sync lo lleva a Railway. No se envió nada.`);
|
|
151
|
+
}
|
|
144
152
|
const where = `(proyecto ${link.projectId}, entorno ${link.envs.main} → production, ` +
|
|
145
153
|
`${link.envs.develop} → preview)`;
|
|
146
154
|
const delivery = syncs === 'active'
|
|
@@ -301,8 +301,15 @@ function buildPlan(services, state, opts = {}) {
|
|
|
301
301
|
}));
|
|
302
302
|
}
|
|
303
303
|
/** Print the plain-text plan (the `--dry-run` and pre-run narration). */
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
/**
|
|
305
|
+
* `plan` — before anything runs (`--dry-run`): what WOULD be created. `summary` — the closing
|
|
306
|
+
* report of a real run, after every step already narrated itself: what this run DID, worded so it
|
|
307
|
+
* never reads as pending work.
|
|
308
|
+
*/
|
|
309
|
+
function printPlan(result, mode = 'plan') {
|
|
310
|
+
console.log(mode === 'plan'
|
|
311
|
+
? `Plan de provision para \`${result.projectName}\` (lifecycle: ${result.lifecycle}):`
|
|
312
|
+
: `\nResumen de esta corrida para \`${result.projectName}\` (lifecycle: ${result.lifecycle}):`);
|
|
306
313
|
// BOOT-001: print the RESOLVED repo (--repo → origin → FACTORY_ORG/name), so a
|
|
307
314
|
// `--dry-run` shows the exact repo the github step / E2E secrets will target.
|
|
308
315
|
if (result.repo) {
|
|
@@ -315,7 +322,13 @@ function printPlan(result) {
|
|
|
315
322
|
console.log(` ${TARGET_UNRESOLVED_DRY_RUN}`);
|
|
316
323
|
}
|
|
317
324
|
for (const step of result.steps) {
|
|
318
|
-
const mark = step.action === 'skip'
|
|
325
|
+
const mark = step.action === 'skip'
|
|
326
|
+
? mode === 'plan'
|
|
327
|
+
? '⏭ (ya completado)'
|
|
328
|
+
: '⏭ ya estaba'
|
|
329
|
+
: mode === 'plan'
|
|
330
|
+
? '+ crear'
|
|
331
|
+
: '✔ hecho';
|
|
319
332
|
const label = step.service === 'github' && result.target === 'railway'
|
|
320
333
|
? 'GitHub (sustrato git main + develop + E2E — nada en Vercel)'
|
|
321
334
|
: SERVICE_LABEL[step.service];
|
|
@@ -9097,13 +9110,15 @@ export async function runProvision(flags, deps = {}) {
|
|
|
9097
9110
|
else {
|
|
9098
9111
|
warnNeonctl(preflight.neonctl);
|
|
9099
9112
|
if (steps.length > 0)
|
|
9100
|
-
printPlan(result);
|
|
9113
|
+
printPlan(result, 'summary');
|
|
9101
9114
|
printCustomizedScripts(result.wrapperWiring);
|
|
9102
9115
|
if (hasDomain) {
|
|
9103
9116
|
console.log(`\n✔ Dominio del cliente listo: ${flags.domain} (ruta ${flags.dns}).`);
|
|
9104
9117
|
}
|
|
9105
9118
|
else {
|
|
9106
|
-
console.log(
|
|
9119
|
+
console.log(
|
|
9120
|
+
// The EFFECTIVE lifecycle: a `--resume` does not repeat `--ephemeral`, and the state keeps it.
|
|
9121
|
+
`\n✔ Scaffold de provision listo (lifecycle: ${result.lifecycle}). ` +
|
|
9107
9122
|
'Estado en `.timekast/provision.json`.');
|
|
9108
9123
|
}
|
|
9109
9124
|
}
|
package/dist/lib/vault-api.js
CHANGED
|
@@ -953,6 +953,11 @@ export function createVaultClient(deps = {}) {
|
|
|
953
953
|
const connectionApp = asString(connection?.app);
|
|
954
954
|
if (!connection || !id || connectionApp !== app)
|
|
955
955
|
return [];
|
|
956
|
+
// A connection scoped to ONE vault project (a client with infrastructure of its own)
|
|
957
|
+
// is not the organization's: the instance lets only that project use it. It never
|
|
958
|
+
// counts toward — or breaks — the choice of the org-wide connection.
|
|
959
|
+
if (asString(connection.projectId))
|
|
960
|
+
return [];
|
|
956
961
|
return [
|
|
957
962
|
{
|
|
958
963
|
id,
|