@voltro/cli 0.10.0 → 0.11.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/CHANGELOG.md +134 -0
- package/THIRD-PARTY-NOTICES.md +1047 -22
- package/bin/voltro.mjs +16 -7
- package/dist/apiBuild-BGd-BnHq.js +2 -0
- package/dist/{apiBuild-DTLPSlt9.js → apiBuild-D_kEJTxc.js} +10 -10
- package/dist/bin.js +2 -2
- package/dist/bootTiming-BdyP9nYw.js +38 -0
- package/dist/{commands-B0QT8dUY.js → commands-BiQsbV50.js} +2191 -2039
- package/dist/dev-DH13Ysgs.js +2 -0
- package/dist/{dev-CK9fbuAM.js → dev-zJGsTTNb.js} +2317 -2282
- package/dist/index.js +1 -1
- package/dist/{inspectMetrics-BeMjgt8x.js → inspectMetrics-BuBwg1yW.js} +1169 -1137
- package/dist/{serveCommand-YR3mKjvf.js → serveCommand-BU454-ay.js} +272 -296
- package/dist/serveEntry.js +3 -3
- package/dist/{start-C_M4fGS2.js → start-ChN6PO-c.js} +338 -323
- package/dist/startEntry.js +2 -2
- package/package.json +23 -17
- package/templates/agent-docs/data.md +107 -0
- package/templates/agent-docs/database/seedsdialects.md +21 -1
- package/templates/agent-docs/deployment.md +49 -0
- package/templates/agent-docs/internationalization.md +36 -0
- package/templates/agent-docs/multi-tenancy.md +33 -0
- package/templates/apps/api-ai/package.json +7 -7
- package/templates/apps/api-auth/package.json +8 -8
- package/templates/apps/api-backend/package.json +7 -7
- package/templates/apps/api-backend-deactivation/package.json +7 -7
- package/templates/apps/api-backend-mail/package.json +8 -8
- package/templates/apps/api-backend-mariadb/package.json +9 -9
- package/templates/apps/api-backend-storage/package.json +8 -8
- package/templates/apps/api-data-advanced/package.json +8 -8
- package/templates/apps/api-durable/package.json +8 -8
- package/templates/apps/api-feature-flags/package.json +9 -9
- package/templates/apps/api-governance/package.json +8 -8
- package/templates/apps/api-kv/package.json +8 -8
- package/templates/apps/api-moderation/package.json +8 -8
- package/templates/apps/api-observability/package.json +8 -8
- package/templates/apps/api-ratelimit/package.json +8 -8
- package/templates/apps/api-rbac/package.json +8 -8
- package/templates/apps/api-rest/package.json +7 -7
- package/templates/apps/api-saas/package.json +11 -11
- package/templates/apps/api-search/package.json +8 -8
- package/templates/apps/api-versioning/package.json +8 -8
- package/templates/apps/api-webhooks/package.json +8 -8
- package/templates/apps/changelog/package.json +6 -6
- package/templates/apps/edge-functions/package.json +2 -2
- package/templates/apps/frontend-admin/package.json +8 -8
- package/templates/apps/frontend-app/package.json +8 -8
- package/templates/apps/frontend-blank/package.json +7 -7
- package/templates/apps/frontend-contact/package.json +7 -7
- package/templates/apps/frontend-dashboard/package.json +7 -7
- package/templates/apps/frontend-docs/package.json +7 -7
- package/templates/apps/frontend-i18n/package.json +6 -6
- package/templates/apps/frontend-landing/package.json +7 -7
- package/templates/apps/frontend-spa/package.json +7 -7
- package/templates/apps/frontend-ssr/package.json +7 -7
- package/templates/apps/frontend-ssr-api/package.json +8 -8
- package/templates/apps/frontend-static-blog/package.json +6 -6
- package/dist/apiBuild-BbR1nYcE.js +0 -2
- package/dist/dev-BJvbwjSz.js +0 -2
package/bin/voltro.mjs
CHANGED
|
@@ -48,13 +48,22 @@ if (argv[0] === 'start') {
|
|
|
48
48
|
const serverDir = join(startRoot, '.framework', 'dist', 'server')
|
|
49
49
|
const ssrEntry = join(serverDir, 'ssrEntry.js')
|
|
50
50
|
const appConfig = join(serverDir, 'appConfig.js')
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
51
|
+
// Prefer the app's PRECOMPILED START BUNDLE when `voltro build` produced one:
|
|
52
|
+
// `.framework/dist-web/startBundle/startEntry.js` inlines the whole start runtime
|
|
53
|
+
// (effect + @voltro) into ONE file, so boot loads a single artefact instead of
|
|
54
|
+
// resolving the per-module CLI graph — the module-graph load that dominates a
|
|
55
|
+
// scale-from-zero web cold start. Same export shape (runStartCommand + loadDotEnv),
|
|
56
|
+
// so the import path below is identical.
|
|
57
|
+
//
|
|
58
|
+
// Fallback: the NARROW CLI start entry (`dist/startEntry.js`) — NOT the CLI bin:
|
|
59
|
+
// importing `dist/bin.js` pulls the whole command graph, and the build commands
|
|
60
|
+
// statically reach for the build toolchain, so on a `--prod --no-optional` image
|
|
61
|
+
// (no esbuild/vite/tsx) that import dies with `Cannot find package 'esbuild'`
|
|
62
|
+
// before any start code runs. Both re-export only runStartCommand + loadDotEnv.
|
|
63
|
+
const appStartBundle = join(startRoot, '.framework', 'dist-web', 'startBundle', 'startEntry.js')
|
|
64
|
+
const startEntry = existsSync(appStartBundle)
|
|
65
|
+
? appStartBundle
|
|
66
|
+
: resolve(here, '..', 'dist', 'startEntry.js')
|
|
58
67
|
if (existsSync(startEntry) && existsSync(ssrEntry) && existsSync(appConfig)) {
|
|
59
68
|
try {
|
|
60
69
|
const mod = await import(pathToFileURL(startEntry).href)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Mt as e } from "./inspectMetrics-
|
|
2
|
-
import {
|
|
1
|
+
import { Mt as e } from "./inspectMetrics-BuBwg1yW.js";
|
|
2
|
+
import { d as t, lt as n } from "./dev-zJGsTTNb.js";
|
|
3
3
|
import { isAbsolute as r, join as i, relative as a, resolve as o } from "node:path";
|
|
4
4
|
import { createLogger as s } from "@voltro/logger";
|
|
5
5
|
import { existsSync as c, promises as l } from "node:fs";
|
|
6
6
|
import { createRequire as u } from "node:module";
|
|
7
7
|
//#region src/apiBuild.ts
|
|
8
8
|
var d = s({ scope: "voltro:build" }), f = async (e) => {
|
|
9
|
-
let
|
|
10
|
-
if (!c(
|
|
9
|
+
let t = i(e, "package.json");
|
|
10
|
+
if (!c(t)) return [];
|
|
11
11
|
let r = {};
|
|
12
12
|
try {
|
|
13
|
-
let e = JSON.parse(await l.readFile(
|
|
13
|
+
let e = JSON.parse(await l.readFile(t, "utf8"));
|
|
14
14
|
r = {
|
|
15
15
|
...e.dependencies,
|
|
16
16
|
...e.devDependencies,
|
|
@@ -19,8 +19,8 @@ var d = s({ scope: "voltro:build" }), f = async (e) => {
|
|
|
19
19
|
} catch {
|
|
20
20
|
return [];
|
|
21
21
|
}
|
|
22
|
-
let a = u(
|
|
23
|
-
return
|
|
22
|
+
let a = u(t);
|
|
23
|
+
return n.filter((e) => {
|
|
24
24
|
if (r[e] === void 0) return !1;
|
|
25
25
|
try {
|
|
26
26
|
return a.resolve(e), !0;
|
|
@@ -28,7 +28,7 @@ var d = s({ scope: "voltro:build" }), f = async (e) => {
|
|
|
28
28
|
return !1;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
}, p = /(?:\.(?:query|mutation|action|stream)(?:\.server)?\.ts|\.workflow(?:\.server)?\.tsx|\.(?:subscribe|reaction|aggregate|agent|tool|webhook|cron|trigger)(?:\.server)?\.tsx?|\.(?:startup|seed)\.tsx?|\.(?:entity|schema|relations)\.ts|(?:^|\/)schema\.ts)$/, m = (e) => /\.(ts|tsx)$/.test(e) && !/\.(test|spec)\.[tj]sx?$/.test(e), h = async (e) => (await
|
|
31
|
+
}, p = /(?:\.(?:query|mutation|action|stream)(?:\.server)?\.ts|\.workflow(?:\.server)?\.tsx|\.(?:subscribe|reaction|aggregate|agent|tool|webhook|cron|trigger)(?:\.server)?\.tsx?|\.(?:startup|seed)\.tsx?|\.(?:entity|schema|relations)\.ts|(?:^|\/)schema\.ts)$/, m = (e) => /\.(ts|tsx)$/.test(e) && !/\.(test|spec)\.[tj]sx?$/.test(e), h = async (e) => (await t(e)).filter((t) => p.test(t) && m(t) && !t.includes(`${e}/.framework/`)), g = {
|
|
32
32
|
name: "externalize-bare",
|
|
33
33
|
setup(e) {
|
|
34
34
|
e.onResolve({ filter: /.*/ }, (e) => {
|
|
@@ -106,7 +106,7 @@ const drivers = ${JSON.stringify(t)}\nlet mod\nfor (const d of drivers) {\n try
|
|
|
106
106
|
setup(a) {
|
|
107
107
|
a.onResolve({ filter: /.*/ }, (e) => {
|
|
108
108
|
let a = e.path;
|
|
109
|
-
if (!(a.startsWith(".") || r(a) || a.startsWith("node:"))) {
|
|
109
|
+
if (!(a.startsWith(".") || r(a) || a.startsWith("node:")) && !(/^effect$/.test(a) || a.startsWith("@effect/") || a.startsWith("@voltro/"))) {
|
|
110
110
|
if (x(a, y)) return {
|
|
111
111
|
path: a,
|
|
112
112
|
namespace: "native-leaf"
|
|
@@ -188,4 +188,4 @@ const drivers = ${JSON.stringify(t)}\nlet mod\nfor (const d of drivers) {\n try
|
|
|
188
188
|
}), i(s, "serveEntry.js");
|
|
189
189
|
};
|
|
190
190
|
//#endregion
|
|
191
|
-
export {
|
|
191
|
+
export { _ as a, C as i, v as n, T as o, h as r, w as s, y as t };
|
package/dist/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { n as t } from "./commands-
|
|
2
|
+
import { bt as e } from "./inspectMetrics-BuBwg1yW.js";
|
|
3
|
+
import { n as t } from "./commands-BiQsbV50.js";
|
|
4
4
|
import { createLogger as n } from "@voltro/logger";
|
|
5
5
|
//#region src/bin.ts
|
|
6
6
|
var r = n({ scope: "voltro:cli" }), i = process.argv.slice(2);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/bootTiming.ts
|
|
2
|
+
var e = () => {
|
|
3
|
+
let e = process.env.VOLTRO_BOOT_TIMING;
|
|
4
|
+
return e === "1" || e === "true";
|
|
5
|
+
}, t = () => {
|
|
6
|
+
let t = [{
|
|
7
|
+
name: "modules",
|
|
8
|
+
at: performance.now()
|
|
9
|
+
}], n = () => Math.round(t[t.length - 1].at), r = () => {
|
|
10
|
+
if (!e()) return null;
|
|
11
|
+
let n = {}, r = 0;
|
|
12
|
+
for (let e of t) n[e.name] = Math.round(e.at - r), r = e.at;
|
|
13
|
+
return n;
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
mark: (e) => {
|
|
17
|
+
t.push({
|
|
18
|
+
name: e,
|
|
19
|
+
at: performance.now()
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
total: n,
|
|
23
|
+
phaseBreakdown: r,
|
|
24
|
+
finish: (e) => {
|
|
25
|
+
let t = n(), i = r();
|
|
26
|
+
if (!i) {
|
|
27
|
+
e.info(`serve: ready in ${t}ms`);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
e.info(`serve: ready in ${t}ms`, {
|
|
31
|
+
bootMs: t,
|
|
32
|
+
phases: i
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { t };
|