@voltro/cli 0.23.0 → 0.25.0
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 +537 -0
- package/THIRD-PARTY-NOTICES.md +2 -2
- package/bin/voltro.mjs +39 -4
- package/dist/{apiBuild-JQtIhZPy.js → apiBuild-BqhCSytw.js} +46 -24
- package/dist/apiBuild-N1R4V792.js +2 -0
- package/dist/bin.js +3 -3
- package/dist/{commands-Bsu9Buln.js → commands-7EmYJ9Xg.js} +2796 -2478
- package/dist/dbCommand-CIrdFLp9.js +2 -0
- package/dist/{dbCommand-GI7-BVZt.js → dbCommand-FUU12FvD.js} +285 -246
- package/dist/{dev-DRxF_qOB.js → dev-BvHT7WZa.js} +1 -1
- package/dist/{dev-jM07kq_D.js → dev-MacSQ1Ll.js} +2042 -1631
- package/dist/fileConventions-3bffWssN.js +30 -0
- package/dist/frameworkTableAssembly-BsnCKzQ6.js +2 -0
- package/dist/{frameworkTableAssembly-sg41s14F.js → frameworkTableAssembly-Cw5zJz6n.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/inspect-C9gjHwBk.js +2 -0
- package/dist/{inspect-_ldwsAwH.js → inspect-DuLUrZp9.js} +14 -1
- package/dist/{inspectMetrics-dcC7gnxu.js → inspectMetrics-EQwH7BI4.js} +15 -15
- package/dist/manifestBuild-BVwS1Z_6.js +2 -0
- package/dist/{manifestBuild-Bs1Uw22_.js → manifestBuild-Dneq4_Jx.js} +1 -1
- package/dist/serveCommand-5ZFiNO1R.js +1241 -0
- package/dist/serveEntry.js +2 -2
- package/dist/{start-C_4VUDT8.js → start-C-ZWSDpg.js} +2 -2
- package/dist/startEntry.js +2 -2
- package/package.json +17 -17
- package/templates/AGENTS.core.md +12 -5
- package/templates/AGENTS.md +14 -7
- package/templates/agent-docs/_index.md +2 -2
- package/templates/agent-docs/_manifest.json +3 -3
- package/templates/agent-docs/authentication.md +21 -0
- package/templates/agent-docs/cli.md +32 -0
- package/templates/agent-docs/data.md +491 -167
- package/templates/agent-docs/database/migrations.md +132 -63
- package/templates/agent-docs/database/schema.md +80 -0
- package/templates/agent-docs/database/seedsdialects.md +12 -0
- package/templates/agent-docs/deployment.md +75 -1
- package/templates/agent-docs/plugins.md +1 -1
- package/templates/agent-docs/reference.md +2 -2
- package/templates/agent-docs/security.md +18 -0
- package/templates/agent-docs/templates/apibackends.md +5 -5
- package/templates/agent-docs/templates/overview.md +1 -1
- package/templates/agent-docs/whats-new.md +263 -169
- package/templates/agent-docs/workflows.md +74 -20
- package/templates/apps/api-ai/package.json +8 -7
- package/templates/apps/api-auth/package.json +9 -8
- package/templates/apps/api-backend/package.json +8 -7
- package/templates/apps/api-backend-deactivation/package.json +8 -7
- package/templates/apps/api-backend-mail/package.json +9 -8
- package/templates/apps/api-backend-mariadb/package.json +10 -9
- package/templates/apps/api-backend-storage/package.json +9 -8
- package/templates/apps/api-data-advanced/package.json +9 -8
- package/templates/apps/api-durable/README.md +2 -1
- package/templates/apps/api-durable/events/orders.event.ts +18 -0
- package/templates/apps/api-durable/mutations/orders.place.mutation.server.ts +17 -15
- package/templates/apps/api-durable/package.json +9 -8
- package/templates/apps/api-durable/triggers/order.placed.trigger.tsx +6 -4
- package/templates/apps/api-feature-flags/package.json +10 -9
- package/templates/apps/api-governance/package.json +9 -8
- package/templates/apps/api-kv/package.json +9 -8
- package/templates/apps/api-moderation/package.json +9 -8
- package/templates/apps/api-observability/package.json +9 -8
- package/templates/apps/api-ratelimit/package.json +9 -8
- package/templates/apps/api-rbac/package.json +9 -8
- package/templates/apps/api-rest/package.json +8 -7
- package/templates/apps/api-saas/package.json +12 -11
- package/templates/apps/api-search/package.json +9 -8
- package/templates/apps/api-versioning/package.json +9 -8
- package/templates/apps/api-webhooks/README.md +2 -2
- package/templates/apps/api-webhooks/events/orders.event.ts +35 -0
- package/templates/apps/api-webhooks/package.json +10 -9
- package/templates/apps/api-webhooks/template.json +1 -1
- package/templates/apps/changelog/package.json +7 -6
- package/templates/apps/edge-functions/package.json +3 -2
- package/templates/apps/frontend-admin/package.json +9 -8
- package/templates/apps/frontend-app/package.json +9 -8
- package/templates/apps/frontend-blank/package.json +8 -7
- package/templates/apps/frontend-contact/package.json +8 -7
- package/templates/apps/frontend-contact/src/globals.d.ts +6 -0
- package/templates/apps/frontend-dashboard/package.json +8 -7
- package/templates/apps/frontend-docs/package.json +8 -7
- package/templates/apps/frontend-docs/src/globals.d.ts +6 -0
- package/templates/apps/frontend-i18n/package.json +7 -6
- package/templates/apps/frontend-landing/package.json +8 -7
- package/templates/apps/frontend-landing/src/globals.d.ts +6 -0
- package/templates/apps/frontend-spa/package.json +8 -7
- package/templates/apps/frontend-spa/src/globals.d.ts +6 -0
- package/templates/apps/frontend-ssr/package.json +8 -7
- package/templates/apps/frontend-ssr/src/globals.d.ts +6 -0
- package/templates/apps/frontend-ssr-api/package.json +9 -8
- package/templates/apps/frontend-static-blog/package.json +7 -6
- package/templates/apps/frontend-static-blog/src/globals.d.ts +6 -0
- package/dist/apiBuild-CD-4JLLA.js +0 -2
- package/dist/dbCommand-CSguuUQn.js +0 -2
- package/dist/fileConventions-CBNPZVOV.js +0 -29
- package/dist/frameworkTableAssembly-DRJrAVr1.js +0 -2
- package/dist/inspect-BA67TF6v.js +0 -2
- package/dist/manifestBuild-i-fRHg_H.js +0 -2
- package/dist/serveCommand-Cl8sicD5.js +0 -1162
- package/templates/apps/api-webhooks/events/order.completed.webhook.tsx +0 -22
package/THIRD-PARTY-NOTICES.md
CHANGED
|
@@ -10914,7 +10914,7 @@ programs and associated documentation files created by the
|
|
|
10914
10914
|
Original Author, when distributed with the Software.
|
|
10915
10915
|
```
|
|
10916
10916
|
|
|
10917
|
-
## brace-expansion@5.0.
|
|
10917
|
+
## brace-expansion@5.0.9
|
|
10918
10918
|
|
|
10919
10919
|
License: MIT
|
|
10920
10920
|
|
|
@@ -14150,7 +14150,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
14150
14150
|
THE SOFTWARE.
|
|
14151
14151
|
```
|
|
14152
14152
|
|
|
14153
|
-
## postcss@8.5.
|
|
14153
|
+
## postcss@8.5.25
|
|
14154
14154
|
|
|
14155
14155
|
License: MIT
|
|
14156
14156
|
|
package/bin/voltro.mjs
CHANGED
|
@@ -113,8 +113,32 @@ if (argv[0] === 'serve') {
|
|
|
113
113
|
// by walking the app tree). This is what makes the bundle relocation-safe —
|
|
114
114
|
// the Docker deploy moves the app from `apps/x/api` to the image root.
|
|
115
115
|
if (serveRoot !== process.cwd()) process.chdir(serveRoot)
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
// The IMPORT and the RUN are separated on purpose, and the reason is a
|
|
117
|
+
// consumer's deploy. One `try` around both meant every runtime fault the
|
|
118
|
+
// app's boot could raise came out as "serve bundle failed to load … Run
|
|
119
|
+
// `voltro build`" — with the stack discarded. They had just run it. The
|
|
120
|
+
// real fault was a `TypeError` two frames into CDC startup, which sends you
|
|
121
|
+
// to rebuild, then to check `.dockerignore`, then to doubt the image, and
|
|
122
|
+
// never to the actual line.
|
|
123
|
+
//
|
|
124
|
+
// An import that throws IS a build problem (missing / stale / corrupt
|
|
125
|
+
// artefact) and degrades as before. An import that SUCCEEDS and then throws
|
|
126
|
+
// from `runServe` is the app failing to boot: it is reported as itself,
|
|
127
|
+
// with its stack, and it does not fall through to a second execution path —
|
|
128
|
+
// silently switching to tsx is how a bundle-only defect stays a mystery.
|
|
129
|
+
let mod
|
|
130
|
+
try {
|
|
131
|
+
mod = await import(pathToFileURL(serveBundle).href)
|
|
132
|
+
} catch (importError) {
|
|
133
|
+
if (importError?.name === 'VoltroBootRefusal') {
|
|
134
|
+
console.error(String(importError.message))
|
|
135
|
+
process.exit(1)
|
|
136
|
+
}
|
|
137
|
+
console.warn('[voltro] serve bundle failed to load:', importError?.message ?? importError)
|
|
138
|
+
if (importError?.stack) console.warn(String(importError.stack))
|
|
139
|
+
mod = undefined
|
|
140
|
+
}
|
|
141
|
+
if (mod && typeof mod.runServe === 'function') {
|
|
118
142
|
const code = await mod.runServe(argv.slice(1))
|
|
119
143
|
process.exit(typeof code === 'number' ? code : 0)
|
|
120
144
|
}
|
|
@@ -130,8 +154,19 @@ if (argv[0] === 'serve') {
|
|
|
130
154
|
console.error(String(error.message))
|
|
131
155
|
process.exit(1)
|
|
132
156
|
}
|
|
133
|
-
//
|
|
134
|
-
|
|
157
|
+
// Reached only when the bundle IMPORTED and `runServe` threw — the app
|
|
158
|
+
// failed to boot. Not a build problem, so say what happened and stop.
|
|
159
|
+
console.error('[voltro] the serve bundle loaded, and the app failed to boot:')
|
|
160
|
+
console.error(String(error?.stack ?? error?.message ?? error))
|
|
161
|
+
// No "try this flag" line here on purpose: there is no supported switch that
|
|
162
|
+
// runs `voltro serve` off the bundle, and naming one that does not exist is
|
|
163
|
+
// the same defect as the message this replaced.
|
|
164
|
+
console.error(
|
|
165
|
+
'\n[voltro] This is a runtime error, not a missing bundle — `voltro build` will not change it.\n'
|
|
166
|
+
+ ' If the same app boots under `voltro dev` (which loads from source), the fault is in\n'
|
|
167
|
+
+ ' what the bundle did to a dependency, not in your code — report the stack above.',
|
|
168
|
+
)
|
|
169
|
+
process.exit(1)
|
|
135
170
|
}
|
|
136
171
|
}
|
|
137
172
|
// PRODUCTION MUST serve from the precompiled bundle — never transpile on demand.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { lt as e } from "./inspectMetrics-
|
|
1
|
+
import { lt as e } from "./inspectMetrics-EQwH7BI4.js";
|
|
2
2
|
import { a as t } from "./seedRunner-D6eu-u5U.js";
|
|
3
|
-
import {
|
|
3
|
+
import { h as n } from "./dev-MacSQ1Ll.js";
|
|
4
4
|
import { dirname as r, isAbsolute as i, join as a, relative as o, resolve as s } from "node:path";
|
|
5
5
|
import { fileURLToPath as c } from "node:url";
|
|
6
6
|
import { createLogger as l } from "@voltro/logger";
|
|
@@ -41,7 +41,7 @@ var p = l({ scope: "voltro:build" }), m = (e) => {
|
|
|
41
41
|
return !1;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
}, g = /(?:\.(?:query|mutation|action|stream)(?:\.server)?\.ts|\.workflow(?:\.server)?\.tsx|\.(?:subscribe|reaction|aggregate|agent|tool|webhook|cron|trigger|outbox|connection|email)(?:\.server)?\.tsx?|\.(?:startup|seed)\.tsx?|\.(?:entity|schema|relations|migration)\.ts|(?:^|\/)schema\.ts)$/, _ = (e) => /\.(ts|tsx)$/.test(e) && !/\.(test|spec)\.[tj]sx?$/.test(e), v = async (e) => (await n(e)).filter((t) => g.test(t) && _(t) && !t.includes(`${e}/.framework/`)), y = {
|
|
44
|
+
}, g = /(?:\.(?:query|mutation|action|stream)(?:\.server)?\.ts|\.workflow(?:\.server)?\.tsx|\.(?:subscribe|reaction|aggregate|agent|tool|webhook|cron|trigger|outbox|connection|email)(?:\.server)?\.tsx?|\.(?:startup|seed)\.tsx?|\.(?:entity|schema|relations|migration|event)\.ts|(?:^|\/)schema\.ts)$/, _ = (e) => /\.(ts|tsx)$/.test(e) && !/\.(test|spec)\.[tj]sx?$/.test(e), v = async (e) => (await n(e)).filter((t) => g.test(t) && _(t) && !t.includes(`${e}/.framework/`)), y = {
|
|
45
45
|
name: "externalize-bare",
|
|
46
46
|
setup(e) {
|
|
47
47
|
e.onResolve({ filter: /.*/ }, (e) => {
|
|
@@ -100,7 +100,6 @@ var p = l({ scope: "voltro:build" }), m = (e) => {
|
|
|
100
100
|
"pg-native",
|
|
101
101
|
"@tursodatabase/*",
|
|
102
102
|
"@libsql/*",
|
|
103
|
-
"@vlasky/zongji",
|
|
104
103
|
"ioredis",
|
|
105
104
|
"nodemailer"
|
|
106
105
|
], C = [
|
|
@@ -145,13 +144,33 @@ const drivers = ${JSON.stringify(t)}\nlet mod\nfor (const d of drivers) {\n try
|
|
|
145
144
|
loader: "js"
|
|
146
145
|
}));
|
|
147
146
|
}
|
|
148
|
-
}), D = (e) => a(e, ".framework", "dist-api", "serveBundle", "serveEntry.js"), O = async (t) => {
|
|
147
|
+
}), D = (e) => a(e, ".framework", "dist-api", "serveBundle", "serveEntry.js"), O = 1e3, k = async (e, t) => {
|
|
148
|
+
let n = t - O, r = 0, i = async (e) => {
|
|
149
|
+
let t;
|
|
150
|
+
try {
|
|
151
|
+
t = await d.readdir(e, { withFileTypes: !0 });
|
|
152
|
+
} catch {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
for (let o of t) {
|
|
156
|
+
let t = a(e, o.name);
|
|
157
|
+
if (o.isDirectory()) {
|
|
158
|
+
await i(t);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
(await d.stat(t)).mtimeMs < n && (await d.rm(t, { force: !0 }), r += 1);
|
|
163
|
+
} catch {}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return await i(e), r;
|
|
167
|
+
}, A = async (t) => {
|
|
149
168
|
let n = await e("esbuild", () => import("esbuild")), r = a(t, ".framework"), i = a(r, "dist-api", "serveBundle");
|
|
150
169
|
await d.mkdir(r, { recursive: !0 });
|
|
151
|
-
let c = [...await v(t)],
|
|
152
|
-
if (u(
|
|
153
|
-
let
|
|
154
|
-
entryPoints:
|
|
170
|
+
let c = Date.now(), l = [...await v(t)], f = a(t, "app.config.ts");
|
|
171
|
+
if (u(f) && l.push(f), l.length === 0) return null;
|
|
172
|
+
let g = a(t, "tsconfig.json"), b = await n.build({
|
|
173
|
+
entryPoints: l,
|
|
155
174
|
bundle: !0,
|
|
156
175
|
write: !1,
|
|
157
176
|
metafile: !0,
|
|
@@ -163,26 +182,26 @@ const drivers = ${JSON.stringify(t)}\nlet mod\nfor (const d of drivers) {\n try
|
|
|
163
182
|
logLevel: "silent",
|
|
164
183
|
plugins: [y],
|
|
165
184
|
outdir: a(i, ".probe"),
|
|
166
|
-
...u(
|
|
167
|
-
}),
|
|
185
|
+
...u(g) ? { tsconfig: g } : {}
|
|
186
|
+
}), x = Object.keys(b.metafile.inputs).map((e) => s(t, e)).filter((e) => e.startsWith(`${t}/`) && !e.includes("/node_modules/") && !e.includes("/.framework/") && _(e)), S = await h(t), C = /* @__PURE__ */ new Set(), w = [
|
|
168
187
|
"// GENERATED BY `voltro build` — do not edit; overwritten on next build.",
|
|
169
188
|
"import { join as __join, dirname as __dirname, resolve as __resolve } from 'node:path'",
|
|
170
189
|
"import { pathToFileURL as __pathToFileURL, fileURLToPath as __fileURLToPath } from 'node:url'",
|
|
171
190
|
"import { runServe as __runServe, registerAppModules, registerDriver, loadDotEnv } from '@voltro/cli/serveEntry'",
|
|
172
|
-
...
|
|
191
|
+
...S.map((e, t) => `import * as __drv${t} from ${JSON.stringify(e)}`),
|
|
173
192
|
"const __isMain = Boolean(process.argv[1]) && import.meta.url === __pathToFileURL(process.argv[1]).href",
|
|
174
193
|
"if (__isMain) process.chdir(__resolve(__dirname(__fileURLToPath(import.meta.url)), '..', '..', '..'))",
|
|
175
194
|
"const __root = process.cwd()",
|
|
176
195
|
"registerAppModules({",
|
|
177
|
-
...
|
|
196
|
+
...x.map((e) => ` [__join(__root, ${JSON.stringify(o(t, e))})]: () => import(${JSON.stringify(e)}),`),
|
|
178
197
|
"})",
|
|
179
|
-
...
|
|
198
|
+
...S.map((e, t) => `registerDriver(${JSON.stringify(e)}, __drv${t})`),
|
|
180
199
|
"export const runServe = (args = []) => { loadDotEnv([]); return __runServe(args) }",
|
|
181
200
|
"if (__isMain) runServe(process.argv.slice(2)).then((c) => process.exit(typeof c === 'number' ? c : 0))",
|
|
182
201
|
""
|
|
183
|
-
],
|
|
184
|
-
|
|
185
|
-
entryPoints: [
|
|
202
|
+
], T = a(r, "serveEntry.ts");
|
|
203
|
+
await d.writeFile(T, w.join("\n"), "utf8"), await n.build({
|
|
204
|
+
entryPoints: [T],
|
|
186
205
|
bundle: !0,
|
|
187
206
|
format: "esm",
|
|
188
207
|
platform: "node",
|
|
@@ -190,20 +209,23 @@ const drivers = ${JSON.stringify(t)}\nlet mod\nfor (const d of drivers) {\n try
|
|
|
190
209
|
outdir: i,
|
|
191
210
|
splitting: !0,
|
|
192
211
|
write: !0,
|
|
193
|
-
plugins: [E(
|
|
212
|
+
plugins: [E(S, t, C)],
|
|
194
213
|
banner: { js: "import { createRequire as __voltroRequire } from 'node:module'; const require = __voltroRequire(import.meta.url);" },
|
|
195
214
|
jsx: "automatic",
|
|
196
215
|
jsxImportSource: "react",
|
|
197
216
|
logLevel: "silent",
|
|
198
217
|
absWorkingDir: t,
|
|
199
218
|
alias: m("serveEntry"),
|
|
200
|
-
...u(
|
|
201
|
-
})
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
219
|
+
...u(g) ? { tsconfig: g } : {}
|
|
220
|
+
});
|
|
221
|
+
let D = await k(i, c);
|
|
222
|
+
return p.info("api build: serve bundle written", {
|
|
223
|
+
appModules: x.length,
|
|
224
|
+
drivers: S.length > 0 ? S.join(", ") : "none (memory)",
|
|
225
|
+
...C.size > 0 ? { externalizedOptionalPeers: [...C].join(", ") } : {},
|
|
226
|
+
...D > 0 ? { prunedStaleChunks: D } : {},
|
|
205
227
|
out: a(".framework", "dist-api", "serveBundle", "serveEntry.js")
|
|
206
228
|
}), a(i, "serveEntry.js");
|
|
207
229
|
};
|
|
208
230
|
//#endregion
|
|
209
|
-
export { v as a,
|
|
231
|
+
export { v as a, b as c, m as i, A as l, S as n, E as o, x as r, k as s, g as t, D as u };
|
package/dist/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Z as e } from "./inspectMetrics-
|
|
3
|
-
import { r as t } from "./commands-
|
|
4
|
-
import { l as n } from "./dbCommand-
|
|
2
|
+
import { Z as e } from "./inspectMetrics-EQwH7BI4.js";
|
|
3
|
+
import { r as t } from "./commands-7EmYJ9Xg.js";
|
|
4
|
+
import { l as n } from "./dbCommand-FUU12FvD.js";
|
|
5
5
|
import { createLogger as r } from "@voltro/logger";
|
|
6
6
|
//#region src/sqlErrorDetail.ts
|
|
7
7
|
var i = (e) => typeof e == "object" && !!e, a = (e) => {
|