onveloz 0.0.0-beta.16 → 0.0.0-beta.17
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.mjs +83 -45
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -63,17 +63,22 @@ const PackageManagerSchema = z$1.enum([
|
|
|
63
63
|
"bun",
|
|
64
64
|
"auto"
|
|
65
65
|
]);
|
|
66
|
+
const BuildMethodSchema = z$1.enum(["nixpacks", "dockerfile"]);
|
|
66
67
|
const BuildConfigSchema = z$1.object({
|
|
68
|
+
method: BuildMethodSchema.default("nixpacks").optional(),
|
|
67
69
|
command: z$1.string().nullable().optional(),
|
|
68
70
|
nodeVersion: z$1.string().regex(/^[0-9]+(\.[0-9]+){0,2}(\.x)?$/).default("20").optional(),
|
|
69
71
|
nixpkgsArchive: z$1.string().regex(/^[a-f0-9]{40}$/).optional(),
|
|
70
72
|
packageManager: PackageManagerSchema.default("auto").optional(),
|
|
71
73
|
installCommand: z$1.string().nullable().optional(),
|
|
72
74
|
outputDir: z$1.string().nullable().optional(),
|
|
73
|
-
aptPackages: z$1.array(z$1.string().regex(/^[a-z0-9][a-z0-9.+-]+$/, "Nome de pacote inválido")).optional()
|
|
75
|
+
aptPackages: z$1.array(z$1.string().regex(/^[a-z0-9][a-z0-9.+-]+$/, "Nome de pacote inválido")).optional(),
|
|
76
|
+
dockerfile: z$1.string().optional(),
|
|
77
|
+
context: z$1.string().optional()
|
|
74
78
|
});
|
|
75
79
|
const RuntimeConfigSchema = z$1.object({
|
|
76
80
|
command: z$1.string().nullable().optional(),
|
|
81
|
+
preStartCommand: z$1.string().nullable().optional(),
|
|
77
82
|
port: z$1.number().min(1).max(65535).default(3e3).optional(),
|
|
78
83
|
fsGroup: z$1.number().int().min(0).max(65534).default(1001).optional(),
|
|
79
84
|
healthCheck: z$1.object({
|
|
@@ -138,7 +143,7 @@ const DatabaseConfigSchema = z$1.object({
|
|
|
138
143
|
fromTemplate: z$1.string().optional()
|
|
139
144
|
});
|
|
140
145
|
const ServiceConfigSchema = z$1.object({
|
|
141
|
-
id: z$1.string(),
|
|
146
|
+
id: z$1.string().optional(),
|
|
142
147
|
name: z$1.string(),
|
|
143
148
|
type: ServiceTypeSchema.default("web"),
|
|
144
149
|
root: z$1.string().default(".").optional(),
|
|
@@ -811,6 +816,10 @@ function throwNotFound(flag, entries) {
|
|
|
811
816
|
* 3. Default from `veloz use` → remembered choice
|
|
812
817
|
* 4. Interactive prompt → last resort
|
|
813
818
|
*/
|
|
819
|
+
function requireServiceId(service) {
|
|
820
|
+
if (!service.id) throw new Error(`Serviço "${service.name}" não possui ID. Execute 'veloz deploy' para vincular o serviço.`);
|
|
821
|
+
return service;
|
|
822
|
+
}
|
|
814
823
|
async function resolveService(serviceFlag) {
|
|
815
824
|
const config = requireConfig();
|
|
816
825
|
const entries = Object.entries(config.services);
|
|
@@ -821,7 +830,7 @@ async function resolveService(serviceFlag) {
|
|
|
821
830
|
const [key, service] = found;
|
|
822
831
|
return {
|
|
823
832
|
key,
|
|
824
|
-
service: mergeServiceWithDefaults(service, config.defaults),
|
|
833
|
+
service: requireServiceId(mergeServiceWithDefaults(service, config.defaults)),
|
|
825
834
|
config
|
|
826
835
|
};
|
|
827
836
|
}
|
|
@@ -829,7 +838,7 @@ async function resolveService(serviceFlag) {
|
|
|
829
838
|
const [key, service] = entries[0];
|
|
830
839
|
return {
|
|
831
840
|
key,
|
|
832
|
-
service: mergeServiceWithDefaults(service, config.defaults),
|
|
841
|
+
service: requireServiceId(mergeServiceWithDefaults(service, config.defaults)),
|
|
833
842
|
config
|
|
834
843
|
};
|
|
835
844
|
}
|
|
@@ -838,7 +847,7 @@ async function resolveService(serviceFlag) {
|
|
|
838
847
|
const service = config.services[defaultKey];
|
|
839
848
|
return {
|
|
840
849
|
key: defaultKey,
|
|
841
|
-
service: mergeServiceWithDefaults(service, config.defaults),
|
|
850
|
+
service: requireServiceId(mergeServiceWithDefaults(service, config.defaults)),
|
|
842
851
|
config
|
|
843
852
|
};
|
|
844
853
|
}
|
|
@@ -848,13 +857,12 @@ async function resolveService(serviceFlag) {
|
|
|
848
857
|
})));
|
|
849
858
|
return {
|
|
850
859
|
key: selectedKey,
|
|
851
|
-
service: mergeServiceWithDefaults(config.services[selectedKey], config.defaults),
|
|
860
|
+
service: requireServiceId(mergeServiceWithDefaults(config.services[selectedKey], config.defaults)),
|
|
852
861
|
config
|
|
853
862
|
};
|
|
854
863
|
}
|
|
855
864
|
async function resolveServiceId(serviceFlag) {
|
|
856
865
|
const { service } = await resolveService(serviceFlag);
|
|
857
|
-
if (!service.id) throw new Error(`Serviço "${service.name}" não possui ID. Execute 'veloz deploy' para vincular o serviço.`);
|
|
858
866
|
return service.id;
|
|
859
867
|
}
|
|
860
868
|
function resolveAllServices(serviceFlag) {
|
|
@@ -1454,6 +1462,7 @@ function printServiceConfig(service) {
|
|
|
1454
1462
|
console.log(` ${chalk.bold("Root Dir:")} ${formatValue(service.rootDirectory || "/")}`);
|
|
1455
1463
|
console.log(` ${chalk.bold("Build Command:")} ${formatValue(service.buildCommand)}`);
|
|
1456
1464
|
console.log(` ${chalk.bold("Start Command:")} ${formatValue(service.startCommand)}`);
|
|
1465
|
+
console.log(` ${chalk.bold("Pre-Start Cmd:")} ${formatValue(service.preStartCommand)}`);
|
|
1457
1466
|
console.log(` ${chalk.bold("Porta:")} ${formatValue(service.port)}`);
|
|
1458
1467
|
console.log(` ${chalk.bold("Instâncias:")} ${formatValue(service.instanceCount)}`);
|
|
1459
1468
|
console.log(` ${chalk.bold("CPU Limit:")} ${formatValue(service.cpuLimit)}`);
|
|
@@ -1471,6 +1480,7 @@ configGroup.command("show", {
|
|
|
1471
1480
|
rootDirectory: z.string().nullable(),
|
|
1472
1481
|
buildCommand: z.string().nullable(),
|
|
1473
1482
|
startCommand: z.string().nullable(),
|
|
1483
|
+
preStartCommand: z.string().nullable(),
|
|
1474
1484
|
port: z.number().nullable(),
|
|
1475
1485
|
instanceCount: z.number().nullable(),
|
|
1476
1486
|
cpuLimit: z.string().nullable(),
|
|
@@ -1499,6 +1509,7 @@ configGroup.command("show", {
|
|
|
1499
1509
|
rootDirectory: svc.rootDirectory ?? null,
|
|
1500
1510
|
buildCommand: svc.buildCommand ?? null,
|
|
1501
1511
|
startCommand: svc.startCommand ?? null,
|
|
1512
|
+
preStartCommand: svc.preStartCommand ?? null,
|
|
1502
1513
|
port: svc.port ?? null,
|
|
1503
1514
|
instanceCount: svc.instanceCount ?? null,
|
|
1504
1515
|
cpuLimit: svc.cpuLimit ?? null,
|
|
@@ -1513,6 +1524,7 @@ configGroup.command("set", {
|
|
|
1513
1524
|
name: z.string().optional().describe("Nome do serviço"),
|
|
1514
1525
|
build: z.string().optional().describe("Comando de build"),
|
|
1515
1526
|
start: z.string().optional().describe("Comando de start"),
|
|
1527
|
+
preStart: z.string().optional().describe("Comando executado antes de iniciar o serviço (ex: migrations)"),
|
|
1516
1528
|
port: z.string().optional().describe("Porta do serviço"),
|
|
1517
1529
|
root: z.string().optional().describe("Diretório raiz"),
|
|
1518
1530
|
instances: z.string().optional().describe("Número de instâncias"),
|
|
@@ -1536,6 +1548,7 @@ configGroup.command("set", {
|
|
|
1536
1548
|
if (c.options.name) updates.name = c.options.name;
|
|
1537
1549
|
if (c.options.build !== void 0) updates.buildCommand = c.options.build === "none" ? null : c.options.build;
|
|
1538
1550
|
if (c.options.start !== void 0) updates.startCommand = c.options.start === "none" ? null : c.options.start;
|
|
1551
|
+
if (c.options.preStart !== void 0) updates.preStartCommand = c.options.preStart === "none" ? null : c.options.preStart;
|
|
1539
1552
|
if (c.options.port) updates.port = parseInt(c.options.port, 10);
|
|
1540
1553
|
if (c.options.root !== void 0) updates.rootDirectory = c.options.root === "/" ? null : c.options.root;
|
|
1541
1554
|
if (c.options.instances) updates.instanceCount = parseInt(c.options.instances, 10);
|
|
@@ -1584,6 +1597,8 @@ configGroup.command("edit", {
|
|
|
1584
1597
|
if (buildCmd) updates.buildCommand = buildCmd === "none" ? null : buildCmd;
|
|
1585
1598
|
const startCmd = await prompt(`Start command ${chalk.dim(`(${svc.startCommand || "—"})`)}: `);
|
|
1586
1599
|
if (startCmd) updates.startCommand = startCmd === "none" ? null : startCmd;
|
|
1600
|
+
const preStartCmd = await prompt(`Pre-start command ${chalk.dim(`(${svc.preStartCommand || "—"})`)}: `);
|
|
1601
|
+
if (preStartCmd) updates.preStartCommand = preStartCmd === "none" ? null : preStartCmd;
|
|
1587
1602
|
const port = await prompt(`Porta ${chalk.dim(`(${svc.port})`)}: `);
|
|
1588
1603
|
if (port) updates.port = parseInt(port, 10);
|
|
1589
1604
|
const rootDir = await prompt(`Diretório raiz ${chalk.dim(`(${svc.rootDirectory || "/"})`)}: `);
|
|
@@ -1615,6 +1630,7 @@ configGroup.command("reset", {
|
|
|
1615
1630
|
options: z.object({
|
|
1616
1631
|
build: z.boolean().default(false).describe("Resetar comando de build"),
|
|
1617
1632
|
start: z.boolean().default(false).describe("Resetar comando de start"),
|
|
1633
|
+
preStart: z.boolean().default(false).describe("Resetar comando de pre-start"),
|
|
1618
1634
|
all: z.boolean().default(false).describe("Resetar todas as configurações opcionais"),
|
|
1619
1635
|
service: z.string().optional().describe("Serviço alvo (chave ou nome)")
|
|
1620
1636
|
}),
|
|
@@ -1625,13 +1641,15 @@ configGroup.command("reset", {
|
|
|
1625
1641
|
if (c.options.all) {
|
|
1626
1642
|
updates.buildCommand = null;
|
|
1627
1643
|
updates.startCommand = null;
|
|
1644
|
+
updates.preStartCommand = null;
|
|
1628
1645
|
updates.rootDirectory = null;
|
|
1629
1646
|
} else {
|
|
1630
1647
|
if (c.options.build) updates.buildCommand = null;
|
|
1631
1648
|
if (c.options.start) updates.startCommand = null;
|
|
1649
|
+
if (c.options.preStart) updates.preStartCommand = null;
|
|
1632
1650
|
}
|
|
1633
1651
|
if (Object.keys(updates).length === 0) {
|
|
1634
|
-
warn("Especifique o que resetar: --build, --start, ou --all");
|
|
1652
|
+
warn("Especifique o que resetar: --build, --start, --pre-start, ou --all");
|
|
1635
1653
|
return;
|
|
1636
1654
|
}
|
|
1637
1655
|
await withSpinner({
|
|
@@ -2247,7 +2265,7 @@ function registerLink(cli$1) {
|
|
|
2247
2265
|
},
|
|
2248
2266
|
services: services.map(([key, service]) => ({
|
|
2249
2267
|
key,
|
|
2250
|
-
id: service.id,
|
|
2268
|
+
id: service.id ?? "",
|
|
2251
2269
|
name: service.name,
|
|
2252
2270
|
type: service.type
|
|
2253
2271
|
}))
|
|
@@ -2284,13 +2302,16 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2284
2302
|
...pkg.dependencies,
|
|
2285
2303
|
...pkg.devDependencies
|
|
2286
2304
|
};
|
|
2305
|
+
const scripts = pkg.scripts ?? {};
|
|
2287
2306
|
const hasReact = !!allDeps["react"];
|
|
2307
|
+
const buildCmd = scripts.build ? pmRun(pm, "build") : null;
|
|
2308
|
+
const startCmd = scripts.start ? pmRun(pm, "start") : null;
|
|
2288
2309
|
if (allDeps["next"]) return {
|
|
2289
2310
|
name: "nextjs",
|
|
2290
2311
|
label: "Next.js",
|
|
2291
2312
|
type: "WEB",
|
|
2292
|
-
buildCommand: pmRun(pm, "build"),
|
|
2293
|
-
startCommand: pmRun(pm, "start"),
|
|
2313
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2314
|
+
startCommand: startCmd ?? pmRun(pm, "start"),
|
|
2294
2315
|
outputDir: ".next",
|
|
2295
2316
|
port: 3e3
|
|
2296
2317
|
};
|
|
@@ -2298,8 +2319,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2298
2319
|
name: "nuxt",
|
|
2299
2320
|
label: "Nuxt",
|
|
2300
2321
|
type: "WEB",
|
|
2301
|
-
buildCommand: pmRun(pm, "build"),
|
|
2302
|
-
startCommand: pmRun(pm, "start"),
|
|
2322
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2323
|
+
startCommand: startCmd ?? pmRun(pm, "start"),
|
|
2303
2324
|
outputDir: ".output",
|
|
2304
2325
|
port: 3e3
|
|
2305
2326
|
};
|
|
@@ -2307,8 +2328,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2307
2328
|
name: "remix",
|
|
2308
2329
|
label: "Remix",
|
|
2309
2330
|
type: "WEB",
|
|
2310
|
-
buildCommand: pmRun(pm, "build"),
|
|
2311
|
-
startCommand: pmRun(pm, "start"),
|
|
2331
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2332
|
+
startCommand: startCmd ?? pmRun(pm, "start"),
|
|
2312
2333
|
outputDir: "build",
|
|
2313
2334
|
port: 3e3
|
|
2314
2335
|
};
|
|
@@ -2316,7 +2337,7 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2316
2337
|
name: "astro",
|
|
2317
2338
|
label: "Astro",
|
|
2318
2339
|
type: "STATIC",
|
|
2319
|
-
buildCommand: pmRun(pm, "build"),
|
|
2340
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2320
2341
|
startCommand: null,
|
|
2321
2342
|
outputDir: "dist",
|
|
2322
2343
|
port: 3e3
|
|
@@ -2325,8 +2346,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2325
2346
|
name: "sveltekit",
|
|
2326
2347
|
label: "SvelteKit",
|
|
2327
2348
|
type: "WEB",
|
|
2328
|
-
buildCommand: pmRun(pm, "build"),
|
|
2329
|
-
startCommand: pmRun(pm, "preview"),
|
|
2349
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2350
|
+
startCommand: scripts.preview ? pmRun(pm, "preview") : startCmd ?? pmRun(pm, "start"),
|
|
2330
2351
|
outputDir: "build",
|
|
2331
2352
|
port: 3e3
|
|
2332
2353
|
};
|
|
@@ -2334,7 +2355,7 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2334
2355
|
name: "gatsby",
|
|
2335
2356
|
label: "Gatsby",
|
|
2336
2357
|
type: "STATIC",
|
|
2337
|
-
buildCommand: pmRun(pm, "build"),
|
|
2358
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2338
2359
|
startCommand: null,
|
|
2339
2360
|
outputDir: "public",
|
|
2340
2361
|
port: 3e3
|
|
@@ -2343,8 +2364,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2343
2364
|
name: "angular",
|
|
2344
2365
|
label: "Angular",
|
|
2345
2366
|
type: "WEB",
|
|
2346
|
-
buildCommand: pmRun(pm, "build"),
|
|
2347
|
-
startCommand: pmRun(pm, "start"),
|
|
2367
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2368
|
+
startCommand: startCmd ?? pmRun(pm, "start"),
|
|
2348
2369
|
outputDir: "dist",
|
|
2349
2370
|
port: 4200
|
|
2350
2371
|
};
|
|
@@ -2352,8 +2373,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2352
2373
|
name: "hono",
|
|
2353
2374
|
label: "Hono",
|
|
2354
2375
|
type: "WEB",
|
|
2355
|
-
buildCommand:
|
|
2356
|
-
startCommand:
|
|
2376
|
+
buildCommand: buildCmd,
|
|
2377
|
+
startCommand: startCmd,
|
|
2357
2378
|
outputDir: null,
|
|
2358
2379
|
port: 3e3
|
|
2359
2380
|
};
|
|
@@ -2361,8 +2382,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2361
2382
|
name: "express",
|
|
2362
2383
|
label: "Express",
|
|
2363
2384
|
type: "WEB",
|
|
2364
|
-
buildCommand:
|
|
2365
|
-
startCommand:
|
|
2385
|
+
buildCommand: buildCmd,
|
|
2386
|
+
startCommand: startCmd,
|
|
2366
2387
|
outputDir: null,
|
|
2367
2388
|
port: 3e3
|
|
2368
2389
|
};
|
|
@@ -2370,8 +2391,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2370
2391
|
name: "fastify",
|
|
2371
2392
|
label: "Fastify",
|
|
2372
2393
|
type: "WEB",
|
|
2373
|
-
buildCommand:
|
|
2374
|
-
startCommand:
|
|
2394
|
+
buildCommand: buildCmd,
|
|
2395
|
+
startCommand: startCmd,
|
|
2375
2396
|
outputDir: null,
|
|
2376
2397
|
port: 3e3
|
|
2377
2398
|
};
|
|
@@ -2379,8 +2400,8 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2379
2400
|
name: "nestjs",
|
|
2380
2401
|
label: "NestJS",
|
|
2381
2402
|
type: "WEB",
|
|
2382
|
-
buildCommand: pmRun(pm, "build"),
|
|
2383
|
-
startCommand: pmRun(pm, "start:prod"),
|
|
2403
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2404
|
+
startCommand: scripts["start:prod"] ? pmRun(pm, "start:prod") : startCmd ?? pmRun(pm, "start:prod"),
|
|
2384
2405
|
outputDir: "dist",
|
|
2385
2406
|
port: 3e3
|
|
2386
2407
|
};
|
|
@@ -2388,7 +2409,7 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2388
2409
|
name: hasReact ? "vite-react" : "vite",
|
|
2389
2410
|
label: hasReact ? "Vite + React" : "Vite",
|
|
2390
2411
|
type: "STATIC",
|
|
2391
|
-
buildCommand: pmRun(pm, "build"),
|
|
2412
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2392
2413
|
startCommand: null,
|
|
2393
2414
|
outputDir: "dist",
|
|
2394
2415
|
port: 3e3
|
|
@@ -2397,17 +2418,17 @@ function detectFramework(pkgJsonStr, pm) {
|
|
|
2397
2418
|
name: "cra",
|
|
2398
2419
|
label: "Create React App",
|
|
2399
2420
|
type: "STATIC",
|
|
2400
|
-
buildCommand: pmRun(pm, "build"),
|
|
2421
|
+
buildCommand: buildCmd ?? pmRun(pm, "build"),
|
|
2401
2422
|
startCommand: null,
|
|
2402
2423
|
outputDir: "build",
|
|
2403
2424
|
port: 3e3
|
|
2404
2425
|
};
|
|
2405
|
-
if (
|
|
2426
|
+
if (buildCmd || startCmd) return {
|
|
2406
2427
|
name: "node",
|
|
2407
2428
|
label: "Node.js",
|
|
2408
2429
|
type: "WEB",
|
|
2409
|
-
buildCommand:
|
|
2410
|
-
startCommand:
|
|
2430
|
+
buildCommand: buildCmd ?? "",
|
|
2431
|
+
startCommand: startCmd,
|
|
2411
2432
|
outputDir: "dist",
|
|
2412
2433
|
port: 3e3
|
|
2413
2434
|
};
|
|
@@ -3486,7 +3507,7 @@ const LOGO_LINES = [
|
|
|
3486
3507
|
];
|
|
3487
3508
|
const BRAND_COLOR = "#FF4D00";
|
|
3488
3509
|
function getVersion() {
|
|
3489
|
-
return "0.0.0-beta.
|
|
3510
|
+
return "0.0.0-beta.17";
|
|
3490
3511
|
}
|
|
3491
3512
|
function printBanner(subtitle) {
|
|
3492
3513
|
const version = getVersion();
|
|
@@ -3514,22 +3535,29 @@ function resolveServiceConf(velozConfig, serviceId) {
|
|
|
3514
3535
|
if (!velozConfig) return void 0;
|
|
3515
3536
|
for (const [, conf] of Object.entries(velozConfig.services)) if (conf.id === serviceId) {
|
|
3516
3537
|
const merged = mergeServiceWithDefaults(conf, velozConfig.defaults);
|
|
3538
|
+
const build = merged.build;
|
|
3539
|
+
const isDockerfile = build?.method === "dockerfile";
|
|
3517
3540
|
return {
|
|
3518
3541
|
type: merged.type?.toUpperCase(),
|
|
3519
3542
|
branch: merged.branch,
|
|
3520
|
-
buildCommand:
|
|
3543
|
+
buildCommand: build?.command ?? void 0,
|
|
3521
3544
|
startCommand: merged.runtime?.command ?? void 0,
|
|
3545
|
+
preStartCommand: merged.runtime?.preStartCommand ?? void 0,
|
|
3522
3546
|
port: merged.runtime?.port ?? void 0,
|
|
3523
3547
|
rootDirectory: merged.root,
|
|
3548
|
+
docker: isDockerfile ? {
|
|
3549
|
+
dockerfile: build.dockerfile ?? "Dockerfile",
|
|
3550
|
+
context: build.context ?? merged.root ?? "."
|
|
3551
|
+
} : void 0,
|
|
3524
3552
|
instanceCount: merged.resources?.instances ?? void 0,
|
|
3525
3553
|
cpuLimit: merged.resources?.cpu ?? void 0,
|
|
3526
3554
|
memoryLimit: merged.resources?.memory ?? void 0,
|
|
3527
3555
|
healthCheckPath: merged.runtime?.healthCheck?.path ?? null,
|
|
3528
|
-
aptPackages:
|
|
3529
|
-
nodeVersion:
|
|
3530
|
-
nixpkgsArchive:
|
|
3531
|
-
packageManager:
|
|
3532
|
-
installCommand:
|
|
3556
|
+
aptPackages: build?.aptPackages ?? void 0,
|
|
3557
|
+
nodeVersion: build?.nodeVersion ?? void 0,
|
|
3558
|
+
nixpkgsArchive: build?.nixpkgsArchive ?? void 0,
|
|
3559
|
+
packageManager: build?.packageManager,
|
|
3560
|
+
installCommand: build?.installCommand ?? void 0,
|
|
3533
3561
|
volumes: merged.volumes ?? void 0
|
|
3534
3562
|
};
|
|
3535
3563
|
}
|
|
@@ -3958,7 +3986,7 @@ async function autoUpdate() {
|
|
|
3958
3986
|
if (process.env.VELOZ_MCP === "true") return;
|
|
3959
3987
|
const pm = detectPackageManager();
|
|
3960
3988
|
if (!pm) return;
|
|
3961
|
-
const currentVersion = "0.0.0-beta.
|
|
3989
|
+
const currentVersion = "0.0.0-beta.17";
|
|
3962
3990
|
const latestVersion = await fetchLatestVersion();
|
|
3963
3991
|
if (!latestVersion || latestVersion === currentVersion) return;
|
|
3964
3992
|
const installCmd = getInstallCommand(pm, latestVersion);
|
|
@@ -4098,6 +4126,14 @@ const SERVICE_TYPE_LABELS = {
|
|
|
4098
4126
|
* the server will generate one with nixpacks.
|
|
4099
4127
|
*/
|
|
4100
4128
|
function prepareExtraFiles(_detection, serviceConfig) {
|
|
4129
|
+
if (serviceConfig?.docker) {
|
|
4130
|
+
const dockerfilePath = resolve(process.cwd(), serviceConfig.docker.dockerfile);
|
|
4131
|
+
if (!existsSync(dockerfilePath)) throw new Error(`Dockerfile não encontrado: ${serviceConfig.docker.dockerfile}`);
|
|
4132
|
+
return [{
|
|
4133
|
+
name: "Dockerfile",
|
|
4134
|
+
content: readFileSync(dockerfilePath, "utf-8")
|
|
4135
|
+
}];
|
|
4136
|
+
}
|
|
4101
4137
|
if (existsSync(resolve(process.cwd(), "Dockerfile"))) return [];
|
|
4102
4138
|
const rootDir = serviceConfig?.rootDirectory || ".";
|
|
4103
4139
|
const serviceDockerfilePath = resolve(process.cwd(), rootDir, "Dockerfile");
|
|
@@ -4452,6 +4488,7 @@ async function createServiceFlow(projectId, projectName, repoName, opts = {}) {
|
|
|
4452
4488
|
const allApps = detection.monorepoApps.map((a) => ({
|
|
4453
4489
|
name: a.name,
|
|
4454
4490
|
root: a.path,
|
|
4491
|
+
type: a.framework?.type ?? "WEB",
|
|
4455
4492
|
framework: a.framework?.name ?? null,
|
|
4456
4493
|
buildCommand: a.framework?.buildCommand ?? null,
|
|
4457
4494
|
startCommand: a.framework?.startCommand ?? null,
|
|
@@ -4517,7 +4554,7 @@ async function createServiceFlow(projectId, projectName, repoName, opts = {}) {
|
|
|
4517
4554
|
fn: () => withRetry(() => client.services.create({
|
|
4518
4555
|
projectId,
|
|
4519
4556
|
name: app.name,
|
|
4520
|
-
type:
|
|
4557
|
+
type: app.type,
|
|
4521
4558
|
branch,
|
|
4522
4559
|
rootDirectory: app.root,
|
|
4523
4560
|
buildCommand: app.buildCommand ?? void 0,
|
|
@@ -4730,6 +4767,7 @@ async function addServiceFlow(existingConfig, opts) {
|
|
|
4730
4767
|
const availableApps = detection.monorepoApps.map((a) => ({
|
|
4731
4768
|
name: a.name,
|
|
4732
4769
|
root: a.path,
|
|
4770
|
+
type: a.framework?.type ?? "WEB",
|
|
4733
4771
|
framework: a.framework?.name ?? null,
|
|
4734
4772
|
buildCommand: a.framework?.buildCommand ?? null,
|
|
4735
4773
|
startCommand: a.framework?.startCommand ?? null,
|
|
@@ -4797,7 +4835,7 @@ async function addServiceFlow(existingConfig, opts) {
|
|
|
4797
4835
|
fn: () => withRetry(() => client.services.create({
|
|
4798
4836
|
projectId,
|
|
4799
4837
|
name: app.name,
|
|
4800
|
-
type:
|
|
4838
|
+
type: app.type,
|
|
4801
4839
|
branch,
|
|
4802
4840
|
rootDirectory: app.root,
|
|
4803
4841
|
buildCommand: app.buildCommand ?? void 0,
|
|
@@ -5464,7 +5502,7 @@ async function pruneRemovedEntries(config, existingConfig, services, databases)
|
|
|
5464
5502
|
//#region src/index.ts
|
|
5465
5503
|
if (process.argv.includes("--mcp")) process.env.VELOZ_MCP = "true";
|
|
5466
5504
|
const cli = Cli.create("veloz", {
|
|
5467
|
-
version: "0.0.0-beta.
|
|
5505
|
+
version: "0.0.0-beta.17",
|
|
5468
5506
|
description: "CLI da plataforma Veloz — deploy rápido para o Brasil",
|
|
5469
5507
|
env: z.object({ VELOZ_ENV: z.string().optional().describe("Ambiente alvo (ex: preview, staging)") })
|
|
5470
5508
|
});
|