veryfront 0.1.1165 → 0.1.1167
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/esm/cli/app/views/dashboard.d.ts.map +1 -1
- package/esm/cli/app/views/dashboard.js +8 -35
- package/esm/cli/app/views/startup.d.ts +1 -8
- package/esm/cli/app/views/startup.d.ts.map +1 -1
- package/esm/cli/app/views/startup.js +16 -52
- package/esm/cli/auth/login.d.ts.map +1 -1
- package/esm/cli/auth/login.js +13 -8
- package/esm/cli/commands/build/config-display.d.ts.map +1 -1
- package/esm/cli/commands/build/config-display.js +20 -21
- package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
- package/esm/cli/commands/build/error-handler.js +8 -15
- package/esm/cli/commands/build/handler.js +9 -12
- package/esm/cli/commands/build/stats-display.d.ts.map +1 -1
- package/esm/cli/commands/build/stats-display.js +9 -22
- package/esm/cli/commands/config/handler.d.ts.map +1 -1
- package/esm/cli/commands/config/handler.js +23 -4
- package/esm/cli/commands/demo/demo.d.ts +4 -0
- package/esm/cli/commands/demo/demo.d.ts.map +1 -1
- package/esm/cli/commands/demo/demo.js +30 -16
- package/esm/cli/commands/deploy/command-help.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command-help.js +5 -10
- package/esm/cli/commands/deploy/command.d.ts +25 -3
- package/esm/cli/commands/deploy/command.d.ts.map +1 -1
- package/esm/cli/commands/deploy/command.js +202 -137
- package/esm/cli/commands/deploy/index.d.ts +2 -2
- package/esm/cli/commands/deploy/index.d.ts.map +1 -1
- package/esm/cli/commands/deploy/index.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +10 -21
- package/esm/cli/commands/dev/handler.d.ts.map +1 -1
- package/esm/cli/commands/dev/handler.js +2 -0
- package/esm/cli/commands/doctor/index.js +2 -2
- package/esm/cli/commands/eval/command.d.ts +10 -0
- package/esm/cli/commands/eval/command.d.ts.map +1 -1
- package/esm/cli/commands/eval/command.js +2 -3
- package/esm/cli/commands/generate/integration-generator.d.ts.map +1 -1
- package/esm/cli/commands/generate/integration-generator.js +2 -1
- package/esm/cli/commands/init/config-generator.d.ts.map +1 -1
- package/esm/cli/commands/init/config-generator.js +2 -1
- package/esm/cli/commands/init/deno-config-generator.d.ts.map +1 -1
- package/esm/cli/commands/init/deno-config-generator.js +2 -1
- package/esm/cli/commands/init/init-command.d.ts +5 -1
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +89 -79
- package/esm/cli/commands/init/interactive-wizard.d.ts +1 -0
- package/esm/cli/commands/init/interactive-wizard.d.ts.map +1 -1
- package/esm/cli/commands/init/interactive-wizard.js +17 -31
- package/esm/cli/commands/init/types.d.ts +2 -0
- package/esm/cli/commands/init/types.d.ts.map +1 -1
- package/esm/cli/commands/install/install.js +1 -1
- package/esm/cli/commands/install/uninstall.js +1 -1
- package/esm/cli/commands/push/command-help.d.ts.map +1 -1
- package/esm/cli/commands/push/command-help.js +6 -15
- package/esm/cli/commands/push/command.d.ts +12 -6
- package/esm/cli/commands/push/command.d.ts.map +1 -1
- package/esm/cli/commands/push/command.js +203 -93
- package/esm/cli/commands/serve/handler.d.ts +3 -1
- package/esm/cli/commands/serve/handler.d.ts.map +1 -1
- package/esm/cli/commands/serve/handler.js +27 -2
- package/esm/cli/commands/start/command.d.ts +1 -0
- package/esm/cli/commands/start/command.d.ts.map +1 -1
- package/esm/cli/commands/start/command.js +8 -8
- package/esm/cli/commands/studio/command.js +2 -2
- package/esm/cli/commands/up/command-help.d.ts.map +1 -1
- package/esm/cli/commands/up/command-help.js +5 -6
- package/esm/cli/commands/up/command.d.ts.map +1 -1
- package/esm/cli/commands/up/command.js +107 -46
- package/esm/cli/help/formatters.d.ts +0 -1
- package/esm/cli/help/formatters.d.ts.map +1 -1
- package/esm/cli/help/formatters.js +2 -38
- package/esm/cli/help/index.d.ts +0 -1
- package/esm/cli/help/index.d.ts.map +1 -1
- package/esm/cli/help/index.js +0 -1
- package/esm/cli/help/main-help.d.ts.map +1 -1
- package/esm/cli/help/main-help.js +12 -2
- package/esm/cli/help/tips.d.ts +0 -2
- package/esm/cli/help/tips.d.ts.map +1 -1
- package/esm/cli/help/tips.js +1 -13
- package/esm/cli/mcp/tools/deploy-tool.d.ts.map +1 -1
- package/esm/cli/mcp/tools/deploy-tool.js +0 -1
- package/esm/cli/router.d.ts.map +1 -1
- package/esm/cli/router.js +7 -4
- package/esm/cli/shared/args.d.ts.map +1 -1
- package/esm/cli/shared/args.js +3 -1
- package/esm/cli/shared/config.d.ts +11 -0
- package/esm/cli/shared/config.d.ts.map +1 -1
- package/esm/cli/shared/config.js +33 -11
- package/esm/cli/shared/deployment-provenance.d.ts +1 -1
- package/esm/cli/shared/deployment-provenance.d.ts.map +1 -1
- package/esm/cli/shared/deployment-provenance.js +13 -9
- package/esm/cli/shared/project-link.d.ts +14 -0
- package/esm/cli/shared/project-link.d.ts.map +1 -0
- package/esm/cli/shared/project-link.js +147 -0
- package/esm/cli/shared/project-source-context.d.ts.map +1 -1
- package/esm/cli/shared/project-source-context.js +2 -3
- package/esm/cli/shared/runtime-auth.d.ts +3 -3
- package/esm/cli/shared/runtime-auth.d.ts.map +1 -1
- package/esm/cli/shared/runtime-auth.js +18 -7
- package/esm/cli/shared/server-startup.d.ts +4 -3
- package/esm/cli/shared/server-startup.d.ts.map +1 -1
- package/esm/cli/shared/server-startup.js +9 -4
- package/esm/cli/shared/types.d.ts +1 -0
- package/esm/cli/shared/types.d.ts.map +1 -1
- package/esm/cli/templates/manifest.d.ts +1 -0
- package/esm/cli/templates/manifest.js +12 -11
- package/esm/cli/ui/colors.d.ts.map +1 -1
- package/esm/cli/ui/colors.js +10 -5
- package/esm/cli/ui/components/multi-select.js +1 -1
- package/esm/cli/ui/components/table.js +3 -3
- package/esm/cli/ui/progress.js +5 -5
- package/esm/cli/ui/tui.js +1 -1
- package/esm/cli/utils/env-prompt.d.ts.map +1 -1
- package/esm/cli/utils/env-prompt.js +3 -1
- package/esm/cli/utils/index.d.ts.map +1 -1
- package/esm/cli/utils/index.js +17 -14
- package/esm/cli/utils/terminal-select.d.ts +7 -2
- package/esm/cli/utils/terminal-select.d.ts.map +1 -1
- package/esm/cli/utils/terminal-select.js +21 -10
- package/esm/deno.js +1 -1
- package/esm/extensions/ext-bundler-esbuild/src/index.js +1 -1
- package/esm/extensions/ext-eval-report-mlflow/src/index.js +1 -1
- package/esm/extensions/ext-llm-anthropic/src/index.js +1 -1
- package/esm/extensions/ext-llm-google/src/index.js +1 -1
- package/esm/extensions/ext-llm-openai/src/index.js +1 -1
- package/esm/extensions/ext-schema-zod/src/index.js +1 -1
- package/esm/src/agent/ag-ui/runtime-support.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/runtime-support.js +17 -1
- package/esm/src/agent/hosted/chat-request.d.ts.map +1 -1
- package/esm/src/agent/hosted/chat-request.js +40 -1
- package/esm/src/agent/runtime/ag-ui-contract.d.ts +76 -0
- package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -1
- package/esm/src/agent/runtime/ag-ui-contract.js +23 -0
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +7 -6
- package/esm/src/agent/runtime/message-adapter.d.ts +18 -18
- package/esm/src/agent/runtime/message-adapter.d.ts.map +1 -1
- package/esm/src/agent/runtime/message-adapter.js +18 -4
- package/esm/src/agent/schemas/agent.schema.d.ts +40 -0
- package/esm/src/agent/schemas/agent.schema.d.ts.map +1 -1
- package/esm/src/agent/schemas/agent.schema.js +9 -0
- package/esm/src/cache/module-cache.js +1 -1
- package/esm/src/config/loader.js +1 -1
- package/esm/src/errors/middleware/cli-error-boundary.d.ts +5 -1
- package/esm/src/errors/middleware/cli-error-boundary.d.ts.map +1 -1
- package/esm/src/errors/middleware/cli-error-boundary.js +26 -64
- package/esm/src/extensions/builtin-extensions.js +1 -1
- package/esm/src/extensions/capabilities.js +1 -1
- package/esm/src/extensions/loader.js +1 -1
- package/esm/src/internal-agents/schema.d.ts +76 -0
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- package/esm/src/internal-agents/schema.js +28 -0
- package/esm/src/platform/compat/process/command.d.ts.map +1 -1
- package/esm/src/platform/compat/process/command.js +14 -10
- package/esm/src/platform/compat/stdin.d.ts +20 -0
- package/esm/src/platform/compat/stdin.d.ts.map +1 -1
- package/esm/src/platform/compat/stdin.js +78 -44
- package/esm/src/platform/index.d.ts +1 -1
- package/esm/src/platform/index.d.ts.map +1 -1
- package/esm/src/platform/index.js +1 -1
- package/esm/src/routing/api/module-loader/loader.js +2 -2
- package/esm/src/security/http/config.d.ts.map +1 -1
- package/esm/src/security/http/config.js +3 -2
- package/esm/src/server/handlers/preview/hmr.handler.js +2 -2
- package/esm/src/server/handlers/request/api/project-discovery.js +2 -2
- package/esm/src/server/handlers/request/static.handler.d.ts.map +1 -1
- package/esm/src/server/handlers/request/static.handler.js +12 -2
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +1 -4
- package/esm/src/server/runtime-handler/request-lifecycle.d.ts +1 -1
- package/esm/src/server/runtime-handler/request-lifecycle.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-lifecycle.js +2 -2
- package/esm/src/server/runtime-handler/request-tracker.d.ts +3 -2
- package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/request-tracker.js +31 -7
- package/esm/src/tool/factory.js +1 -1
- package/esm/src/tool/registry.js +1 -1
- package/esm/src/transforms/esm/transform-cache.js +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +5 -5
- package/esm/cli/help/logo.d.ts +0 -2
- package/esm/cli/help/logo.d.ts.map +0 -1
- package/esm/cli/help/logo.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/dashboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAyDvD;AA2ED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,GAAG,MAAM,CAQxD"}
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Main view showing server status, projects, and quick actions.
|
|
5
5
|
*/
|
|
6
|
-
import { box } from "../../ui/box.js";
|
|
7
6
|
import { brand, dim, error, muted } from "../../ui/colors.js";
|
|
8
7
|
import { getTerminalWidth } from "../../ui/layout.js";
|
|
9
|
-
import { getAgentFaceWithText } from "../../ui/dot-matrix.js";
|
|
10
8
|
import { renderList } from "../components/list-select.js";
|
|
11
9
|
/**
|
|
12
10
|
* Render the dashboard view
|
|
@@ -15,7 +13,7 @@ export function renderDashboard(state) {
|
|
|
15
13
|
const termWidth = Math.min(getTerminalWidth() - 4, 80);
|
|
16
14
|
const maxListWidth = termWidth - 4;
|
|
17
15
|
const lines = [];
|
|
18
|
-
lines.push(
|
|
16
|
+
lines.push(renderStatus(state), "");
|
|
19
17
|
const hasProjects = state.projects.items.length > 0;
|
|
20
18
|
const hasRemoteProjects = !!state.remote.user && state.remote.projects.length > 0;
|
|
21
19
|
if (hasProjects) {
|
|
@@ -61,22 +59,10 @@ function getShortcut(displayNum) {
|
|
|
61
59
|
// 10='a', 11='b', etc.
|
|
62
60
|
return String.fromCharCode(96 + displayNum - 9);
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*/
|
|
67
|
-
function renderBanner(state) {
|
|
68
|
-
const termWidth = Math.min(getTerminalWidth() - 4, 80);
|
|
69
|
-
const textLines = [];
|
|
70
|
-
textLines.push("");
|
|
71
|
-
textLines.push(`${brand("Veryfront")} ${dim("is now running")}`);
|
|
72
|
-
textLines.push("");
|
|
73
|
-
// Server URL and MCP URL, always reserve both lines to prevent jumps.
|
|
74
|
-
textLines.push(`${dim("Url")} ${brand(state.server.url)}`);
|
|
62
|
+
function renderStatus(state) {
|
|
63
|
+
const lines = [` ✓ Server ready at ${brand(state.server.url)}`];
|
|
75
64
|
if (state.mcp.enabled && state.mcp.transport === "http" && state.mcp.httpPort !== undefined) {
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
textLines.push("");
|
|
65
|
+
lines.push(` ✓ MCP ready at ${brand(`http://veryfront.me:${state.mcp.httpPort}/mcp`)}`);
|
|
80
66
|
}
|
|
81
67
|
const { errors, warnings } = state.server;
|
|
82
68
|
if (errors > 0 || warnings > 0) {
|
|
@@ -85,22 +71,9 @@ function renderBanner(state) {
|
|
|
85
71
|
parts.push(error(`${errors} errors`));
|
|
86
72
|
if (warnings > 0)
|
|
87
73
|
parts.push(muted(`${warnings} warnings`));
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
// Pad to 7 text lines (matching avatar height) for consistent title position
|
|
91
|
-
while (textLines.length < 7) {
|
|
92
|
-
textLines.push("");
|
|
74
|
+
lines.push(` ${parts.join(" ")}`);
|
|
93
75
|
}
|
|
94
|
-
|
|
95
|
-
litColor: "\x1b[38;2;252;143;93m", // Veryfront brand orange
|
|
96
|
-
});
|
|
97
|
-
return box(content, {
|
|
98
|
-
style: "rounded",
|
|
99
|
-
width: termWidth,
|
|
100
|
-
paddingX: 2,
|
|
101
|
-
paddingY: 1,
|
|
102
|
-
borderColor: "\x1b[2m", // Dim to match footer
|
|
103
|
-
});
|
|
76
|
+
return lines.join("\n");
|
|
104
77
|
}
|
|
105
78
|
/**
|
|
106
79
|
* Render a section header
|
|
@@ -117,7 +90,7 @@ function renderHelpBar(state) {
|
|
|
117
90
|
const hasItems = state.projects.items.length > 0 ||
|
|
118
91
|
(!!state.remote.user && state.remote.projects.length > 0);
|
|
119
92
|
if (!state.showHelp) {
|
|
120
|
-
const userInfo = state.remote.user ? ` ${dim("-")} ${
|
|
93
|
+
const userInfo = state.remote.user ? ` ${dim("-")} ${dim(state.remote.user.email)}` : "";
|
|
121
94
|
if (!hasItems) {
|
|
122
95
|
const authHint = state.remote.user
|
|
123
96
|
? `${dim("x")} ${dim("logout")}`
|
|
@@ -148,7 +121,7 @@ function renderHelpBar(state) {
|
|
|
148
121
|
*/
|
|
149
122
|
export function renderEmptyState(state) {
|
|
150
123
|
const lines = [];
|
|
151
|
-
lines.push(
|
|
124
|
+
lines.push(renderStatus(state), "");
|
|
152
125
|
lines.push(` ${dim("No projects.")} ${brand("n")} ${dim("to create")}`, "");
|
|
153
126
|
lines.push(renderHelpBar(state));
|
|
154
127
|
return lines.join("\n");
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**************************
|
|
2
2
|
* Startup View
|
|
3
3
|
*
|
|
4
|
-
* Shows loading progress
|
|
5
|
-
* Displays avatar, title, and step checklist.
|
|
4
|
+
* Shows compact loading progress before the main TUI is ready.
|
|
6
5
|
**************************/
|
|
7
6
|
export interface StartupStep {
|
|
8
7
|
label: string;
|
|
@@ -16,17 +15,11 @@ export interface StartupState {
|
|
|
16
15
|
/** Animation frame counter for shimmer effect */
|
|
17
16
|
frame: number;
|
|
18
17
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Render the startup view inside a consistent-sized box
|
|
21
|
-
*/
|
|
22
18
|
export declare function renderStartup(state: StartupState): string;
|
|
23
19
|
/**
|
|
24
20
|
* Create initial startup state with steps
|
|
25
21
|
*/
|
|
26
22
|
export declare function createStartupState(stepLabels: string[]): StartupState;
|
|
27
|
-
/**
|
|
28
|
-
* Increment animation frame for shimmer effect
|
|
29
|
-
*/
|
|
30
23
|
export declare function incrementFrame(state: StartupState): StartupState;
|
|
31
24
|
/**
|
|
32
25
|
* Set a step to active
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/startup.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"startup.d.ts","sourceRoot":"","sources":["../../../../src/cli/app/views/startup.ts"],"names":[],"mappings":"AAAA;;;;4BAI4B;AAK5B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAmBzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,YAAY,CAMrE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY,CAEhE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAO9E"}
|
|
@@ -1,61 +1,28 @@
|
|
|
1
1
|
/**************************
|
|
2
2
|
* Startup View
|
|
3
3
|
*
|
|
4
|
-
* Shows loading progress
|
|
5
|
-
* Displays avatar, title, and step checklist.
|
|
4
|
+
* Shows compact loading progress before the main TUI is ready.
|
|
6
5
|
**************************/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { getAgentFaceWithText, getSpinningAgentFace } from "../../ui/dot-matrix.js";
|
|
10
|
-
import { getTerminalWidth } from "../../ui/layout.js";
|
|
11
|
-
// Dim orange for completed steps - matches the trailing dots in spinning animation
|
|
12
|
-
const dimOrange = (text) => `\x1b[38;2;180;100;65m${text}\x1b[0m`;
|
|
13
|
-
/**
|
|
14
|
-
* Render the startup view inside a consistent-sized box
|
|
15
|
-
*/
|
|
6
|
+
import { brand, dim } from "../../ui/colors.js";
|
|
7
|
+
import { getSpinnerFrame } from "../../ui/ansi.js";
|
|
16
8
|
export function renderStartup(state) {
|
|
17
|
-
const
|
|
18
|
-
const textLines = [""];
|
|
9
|
+
const lines = [];
|
|
19
10
|
if (state.ready) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
lines.push(state.serverUrl ? ` ✓ Server ready at ${brand(state.serverUrl)}` : " ✓ Server ready");
|
|
12
|
+
if (state.mcpUrl)
|
|
13
|
+
lines.push(` ✓ MCP ready at ${brand(state.mcpUrl)}`);
|
|
14
|
+
return lines.join("\n");
|
|
24
15
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// Completed: dim orange (fades into background, coherent with avatar)
|
|
31
|
-
textLines.push(`${dimOrange("●")} ${dimOrange(step.label)}`);
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
if (step.status === "active") {
|
|
35
|
-
// Active: bright orange dot with shimmer text
|
|
36
|
-
textLines.push(`${brand("●")} ${shimmer(step.label, state.frame)}`);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
// Pending: gray empty circle
|
|
40
|
-
textLines.push(`${dim("○")} ${dim(step.label)}`);
|
|
16
|
+
for (const step of state.steps) {
|
|
17
|
+
if (step.status === "done")
|
|
18
|
+
lines.push(` ✓ ${dim(step.label)}`);
|
|
19
|
+
else if (step.status === "active") {
|
|
20
|
+
lines.push(` ${brand(getSpinnerFrame(state.frame))} ${step.label}`);
|
|
41
21
|
}
|
|
22
|
+
else
|
|
23
|
+
lines.push(` ${dim("○")} ${dim(step.label)}`);
|
|
42
24
|
}
|
|
43
|
-
|
|
44
|
-
while (textLines.length < 7)
|
|
45
|
-
textLines.push("");
|
|
46
|
-
// Use spinning avatar during loading, static when ready or all steps done
|
|
47
|
-
const allStepsDone = state.steps.every((s) => s.status === "done");
|
|
48
|
-
const litColor = "\x1b[38;2;252;143;93m"; // Veryfront brand orange
|
|
49
|
-
const content = state.ready || allStepsDone
|
|
50
|
-
? getAgentFaceWithText(textLines, { litColor })
|
|
51
|
-
: getSpinningAgentFace(textLines, state.frame, { litColor });
|
|
52
|
-
return box(content, {
|
|
53
|
-
style: "rounded",
|
|
54
|
-
width: termWidth,
|
|
55
|
-
paddingX: 2,
|
|
56
|
-
paddingY: 1,
|
|
57
|
-
borderColor: "\x1b[2m", // Dim to match footer
|
|
58
|
-
});
|
|
25
|
+
return lines.join("\n");
|
|
59
26
|
}
|
|
60
27
|
/**
|
|
61
28
|
* Create initial startup state with steps
|
|
@@ -67,9 +34,6 @@ export function createStartupState(stepLabels) {
|
|
|
67
34
|
frame: 0,
|
|
68
35
|
};
|
|
69
36
|
}
|
|
70
|
-
/**
|
|
71
|
-
* Increment animation frame for shimmer effect
|
|
72
|
-
*/
|
|
73
37
|
export function incrementFrame(state) {
|
|
74
38
|
return { ...state, frame: state.frame + 1 };
|
|
75
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/login.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAoB,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cli/auth/login.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,2BAA2B,CAAC;AACzF,OAAO,EAAE,WAAW,EAAoB,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AASjG,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAErE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,IAAI,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,cAAc,CAAC;AASrD,wBAAgB,gBAAgB,IAAI,MAAM,CAIzC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,GAAG,WAAW,EAC3C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,iBAA0C,GAC9C,MAAM,CAQR;AAED,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAgB1B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,QAAQ,IAAI,cAAc,CAEnF;AAqBD,wBAAsB,kBAAkB,CACtC,KAAK,EAAE,MAAM,EACb,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAQ9B;AAgJD,wBAAsB,KAAK,CACzB,MAAM,CAAC,EAAE,UAAU,EACnB,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAuC9B;AAED,wBAAsB,mBAAmB,CACvC,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA6B9B;AAED,wBAAsB,MAAM,CAAC,GAAG,GAAE,iBAA0C,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3F;AAyCD,wBAAsB,MAAM,CAC1B,GAAG,GAAE,iBAA0C,GAC9C,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAiC9B;AAED,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC"}
|
package/esm/cli/auth/login.js
CHANGED
|
@@ -6,9 +6,10 @@ import { deleteToken, getTokenLocation, hasToken, readToken, saveToken } from ".
|
|
|
6
6
|
import { getCallbackUrl, startCallbackServer } from "./callback-server.js";
|
|
7
7
|
import { canOpenBrowser, openBrowser } from "./browser.js";
|
|
8
8
|
import { isTTY, promptUser } from "../utils/index.js";
|
|
9
|
-
import { brand, dim, error, muted,
|
|
9
|
+
import { brand, dim, error, muted, warning } from "../ui/colors.js";
|
|
10
10
|
import { DEFAULT_CALLBACK_PORT, DEFAULT_LOGIN_TIMEOUT_MS, getApiUrl } from "../shared/constants.js";
|
|
11
11
|
import { createSuccessEnvelope, isJsonMode, outputJson } from "../shared/json-output.js";
|
|
12
|
+
import { isInteractive } from "../shared/interactive.js";
|
|
12
13
|
const AUTH_OPTIONS = [
|
|
13
14
|
{ id: "google", label: "Google" },
|
|
14
15
|
{ id: "github", label: "GitHub" },
|
|
@@ -193,6 +194,10 @@ async function loginWithToken() {
|
|
|
193
194
|
return token;
|
|
194
195
|
}
|
|
195
196
|
export async function login(method, env = getEnvironmentConfig()) {
|
|
197
|
+
if (!isInteractive() && (method === undefined || method === "token")) {
|
|
198
|
+
cliLogger.error("Not logged in. Set VERYFRONT_API_TOKEN or run in interactive mode.");
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
196
201
|
const authMethod = method ?? (isTTY() ? await promptAuthMethod() : "token");
|
|
197
202
|
let token = null;
|
|
198
203
|
switch (authMethod) {
|
|
@@ -217,8 +222,8 @@ export async function login(method, env = getEnvironmentConfig()) {
|
|
|
217
222
|
await saveToken(token, env);
|
|
218
223
|
console.log();
|
|
219
224
|
console.log(isApiKeyIdentity(identity)
|
|
220
|
-
? "
|
|
221
|
-
: "
|
|
225
|
+
? " ✓ Authenticated with an API key"
|
|
226
|
+
: " ✓ Logged in as " + brand(identity.email));
|
|
222
227
|
return identity;
|
|
223
228
|
}
|
|
224
229
|
export async function ensureAuthenticated(env = getEnvironmentConfig()) {
|
|
@@ -243,7 +248,7 @@ export async function ensureAuthenticated(env = getEnvironmentConfig()) {
|
|
|
243
248
|
}
|
|
244
249
|
if (!humanOutput)
|
|
245
250
|
return null;
|
|
246
|
-
if (!isTTY()) {
|
|
251
|
+
if (!isTTY() || !isInteractive()) {
|
|
247
252
|
cliLogger.error("Not logged in. Set VERYFRONT_API_TOKEN or run in interactive mode.");
|
|
248
253
|
return null;
|
|
249
254
|
}
|
|
@@ -252,7 +257,7 @@ export async function ensureAuthenticated(env = getEnvironmentConfig()) {
|
|
|
252
257
|
export async function logout(env = getEnvironmentConfig()) {
|
|
253
258
|
await deleteToken(env);
|
|
254
259
|
console.log();
|
|
255
|
-
console.log("
|
|
260
|
+
console.log(" ✓ Logged out");
|
|
256
261
|
}
|
|
257
262
|
async function reportCredential(token, source, env) {
|
|
258
263
|
const credential = await validateCredential(token, env);
|
|
@@ -265,7 +270,7 @@ async function reportCredential(token, source, env) {
|
|
|
265
270
|
return userInfo;
|
|
266
271
|
}
|
|
267
272
|
console.log();
|
|
268
|
-
console.log("
|
|
273
|
+
console.log(" ✓ Logged in as " + brand(userInfo.email));
|
|
269
274
|
}
|
|
270
275
|
else {
|
|
271
276
|
if (isJsonMode()) {
|
|
@@ -277,7 +282,7 @@ async function reportCredential(token, source, env) {
|
|
|
277
282
|
return { authenticated: true, type: "apiKey" };
|
|
278
283
|
}
|
|
279
284
|
console.log();
|
|
280
|
-
console.log("
|
|
285
|
+
console.log(" ✓ Authenticated with an API key");
|
|
281
286
|
}
|
|
282
287
|
console.log(" " + dim(source === "env" ? "(via VERYFRONT_API_TOKEN)" : `Token stored at: ${getTokenLocation(env)}`));
|
|
283
288
|
return credential;
|
|
@@ -306,7 +311,7 @@ export async function whoami(env = getEnvironmentConfig()) {
|
|
|
306
311
|
const { listProviderTokens } = await import("./provider-store.js");
|
|
307
312
|
const providers = await listProviderTokens(env);
|
|
308
313
|
for (const p of providers) {
|
|
309
|
-
console.log(
|
|
314
|
+
console.log(` ✓ ${p} API key configured`);
|
|
310
315
|
}
|
|
311
316
|
}
|
|
312
317
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-display.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/config-display.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"config-display.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/config-display.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAiC9D;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cliLogger } from "../../utils/index.js";
|
|
1
|
+
import { dim, warning } from "../../ui/index.js";
|
|
2
|
+
import { cliLogger, isVerbose } from "../../utils/index.js";
|
|
3
3
|
export function displayBuildConfig(options) {
|
|
4
4
|
const { projectDir, outputDir, splitting = true, compress = true, prefetch = true, ssg = true, include, exclude, dryRun = false, } = options;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cliLogger.info(
|
|
5
|
+
if (isVerbose()) {
|
|
6
|
+
const features = [
|
|
7
|
+
splitting && "splitting",
|
|
8
|
+
compress && "compression",
|
|
9
|
+
prefetch && "prefetch",
|
|
10
|
+
ssg && "SSG",
|
|
11
|
+
].filter(Boolean).join(", ") || "none";
|
|
12
|
+
cliLogger.info(` ${dim("Project:")} ${projectDir}`);
|
|
13
|
+
cliLogger.info(` ${dim("Output:")} ${outputDir ?? "dist"}`);
|
|
14
|
+
cliLogger.info(` ${dim("Features:")} ${features}`);
|
|
15
|
+
if (include?.length)
|
|
16
|
+
cliLogger.info(` ${dim("Include:")} ${include.join(", ")}`);
|
|
17
|
+
if (exclude?.length)
|
|
18
|
+
cliLogger.info(` ${dim("Exclude:")} ${exclude.join(", ")}`);
|
|
19
|
+
cliLogger.info("");
|
|
20
20
|
}
|
|
21
21
|
if (dryRun) {
|
|
22
|
-
cliLogger.info(
|
|
23
|
-
cliLogger.info("
|
|
22
|
+
cliLogger.info(` ${warning("!")} Dry run: no files will be written`);
|
|
23
|
+
cliLogger.info("");
|
|
24
24
|
}
|
|
25
|
-
cliLogger.info("");
|
|
26
25
|
}
|
|
27
26
|
export function displayBuildStart() {
|
|
28
|
-
cliLogger.info(
|
|
27
|
+
cliLogger.info("Building...");
|
|
29
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/error-handler.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/error-handler.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAetD"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cliLogger } from "../../utils/index.js";
|
|
1
|
+
import { brand, dim } from "../../ui/index.js";
|
|
2
|
+
import { cliLogger, isVerbose } from "../../utils/index.js";
|
|
3
3
|
import { exit, getStdout } from "../../../src/platform/index.js";
|
|
4
4
|
export function handleBuildError(error) {
|
|
5
5
|
getStdout()?.write?.(`\r${" ".repeat(80)}\r`);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cliLogger.error(`\n${dim("For help, run: ")}${cyan("veryfront build --help")}`);
|
|
10
|
-
if (globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).main)
|
|
11
|
-
exit(1);
|
|
12
|
-
throw error;
|
|
13
|
-
}
|
|
14
|
-
cliLogger.error(`${red("Error: ")}${error.message}`);
|
|
15
|
-
const stack = error.stack;
|
|
16
|
-
if (stack) {
|
|
6
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
7
|
+
cliLogger.error(`\n✗ ${message}`);
|
|
8
|
+
if (isVerbose() && error instanceof Error && error.stack) {
|
|
17
9
|
cliLogger.error(`\n${dim("Stack trace:")}`);
|
|
18
|
-
cliLogger.error(dim(stack.split("\n").slice(1, 5).join("\n")));
|
|
10
|
+
cliLogger.error(dim(error.stack.split("\n").slice(1, 5).join("\n")));
|
|
19
11
|
}
|
|
20
|
-
cliLogger.error(
|
|
12
|
+
cliLogger.error(` Run ${brand("veryfront build --help")} for usage.`);
|
|
13
|
+
cliLogger.error("");
|
|
21
14
|
if (globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).main)
|
|
22
15
|
exit(1);
|
|
23
16
|
throw error;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineSchema, lazySchema } from "../../../src/schemas/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { dim } from "../../ui/index.js";
|
|
3
3
|
import { join } from "../../../src/platform/compat/path/index.js";
|
|
4
|
-
import { cliLogger } from "../../utils/index.js";
|
|
4
|
+
import { cliLogger, isVerbose, logSuccess } from "../../utils/index.js";
|
|
5
5
|
import { cwd } from "../../../src/platform/index.js";
|
|
6
6
|
import { CommonArgs, createArgParser, parseArgsOrThrow } from "../../shared/args.js";
|
|
7
7
|
import { ensureCliBundlerContracts } from "../../shared/default-contracts.js";
|
|
@@ -72,19 +72,16 @@ export async function handleBuildCommand(args) {
|
|
|
72
72
|
async function handleEmbeddedBuild(projectDir, outputDir) {
|
|
73
73
|
const { buildEmbeddedPreset } = await import("../../../src/build/index.js");
|
|
74
74
|
const finalOutput = outputDir ?? join(projectDir, "dist");
|
|
75
|
-
cliLogger.info(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
cliLogger.info(` ${dim("Preset:")} embedded`);
|
|
81
|
-
cliLogger.info("\n");
|
|
75
|
+
cliLogger.info("Building embedded preset...");
|
|
76
|
+
if (isVerbose()) {
|
|
77
|
+
cliLogger.info(` ${dim("Project:")} ${projectDir}`);
|
|
78
|
+
cliLogger.info(` ${dim("Output:")} ${finalOutput}`);
|
|
79
|
+
}
|
|
82
80
|
await buildEmbeddedPreset({
|
|
83
81
|
projectDir,
|
|
84
82
|
outDir: finalOutput,
|
|
85
83
|
runtime: "deno",
|
|
86
84
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
console.log(getPostBuildTips());
|
|
85
|
+
logSuccess("Built embedded preset");
|
|
86
|
+
cliLogger.info(` ${finalOutput}\n`);
|
|
90
87
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats-display.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/stats-display.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"stats-display.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/build/stats-display.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,OAAO,GACd,IAAI,CAeN"}
|
|
@@ -1,28 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cliLogger } from "../../utils/index.js";
|
|
1
|
+
import { dim } from "../../ui/index.js";
|
|
2
|
+
import { cliLogger, formatBytes } from "../../utils/index.js";
|
|
3
|
+
function formatCount(count, noun) {
|
|
4
|
+
return `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
5
|
+
}
|
|
3
6
|
export function displayBuildSuccess(stats, startTime, outputDir, dryRun) {
|
|
4
7
|
const duration = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
5
|
-
|
|
6
|
-
cliLogger.info(
|
|
7
|
-
cliLogger.info(
|
|
8
|
-
cliLogger.info(separator);
|
|
9
|
-
cliLogger.info(` Pages ${bold(String(stats.pages).padStart(6))} files`);
|
|
10
|
-
cliLogger.info(` Chunks ${bold(String(stats.chunks).padStart(6))} files`);
|
|
11
|
-
cliLogger.info(` Assets ${bold(String(stats.assets).padStart(6))} files`);
|
|
12
|
-
cliLogger.info(separator);
|
|
13
|
-
cliLogger.info(` Total size ${bold((stats.totalSize / 1024 / 1024).toFixed(2).padStart(6))} MB`);
|
|
14
|
-
cliLogger.info(` Build time ${bold(duration.padStart(6))} seconds`);
|
|
15
|
-
cliLogger.info("");
|
|
8
|
+
cliLogger.info(` ✓ Built in ${duration}s`);
|
|
9
|
+
cliLogger.info(` ${formatCount(stats.pages, "page")}, ${formatCount(stats.chunks, "chunk")}, ${formatCount(stats.assets, "asset")}`);
|
|
10
|
+
cliLogger.info(` ${formatBytes(stats.totalSize)} in ${outputDir}`);
|
|
16
11
|
if (dryRun && stats.ssgPaths?.length) {
|
|
17
|
-
cliLogger.info(
|
|
18
|
-
for (const p of stats.ssgPaths)
|
|
19
|
-
cliLogger.info(` ${dim("•")} ${p}`);
|
|
20
|
-
cliLogger.info("");
|
|
12
|
+
cliLogger.info(` ${dim("SSG routes:")} ${stats.ssgPaths.join(", ")}`);
|
|
21
13
|
}
|
|
22
|
-
cliLogger.info(green("✨") + bold(" Your site is ready for deployment!"));
|
|
23
|
-
cliLogger.info(`\n ${dim("Output directory:")} ${cyan(outputDir)}`);
|
|
24
|
-
cliLogger.info(`\n ${dim("Next steps:")}`);
|
|
25
|
-
cliLogger.info(` ${dim("•")} ${cyan("veryfront serve")} to preview locally`);
|
|
26
|
-
cliLogger.info(` ${dim("•")} Deploy the ${cyan("dist")} directory to your host`);
|
|
27
14
|
cliLogger.info("");
|
|
28
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/config/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/config/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAkBxD,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAED,wBAAgB,eAAe,IAAI,MAAM,EAAE,CAS1C;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,wBAAsB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAsCzF;AAED,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA+B1E"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cliLogger } from "../../utils/index.js";
|
|
2
2
|
import { getEnv } from "../../../src/platform/index.js";
|
|
3
|
+
import { ENVIRONMENT_PROJECT_REFERENCE_NAMES, resolveEnvironmentProjectReference, } from "../../shared/config.js";
|
|
3
4
|
import { createSuccessEnvelope, isJsonMode, outputJson } from "../../shared/json-output.js";
|
|
4
5
|
import { bold, dim } from "../../ui/colors.js";
|
|
5
6
|
const ENV_OVERRIDES = {
|
|
6
|
-
projectSlug: "VERYFRONT_PROJECT_SLUG",
|
|
7
7
|
apiBaseUrl: "VERYFRONT_API_BASE_URL",
|
|
8
8
|
apiToken: "VERYFRONT_API_TOKEN",
|
|
9
9
|
nodeEnv: "NODE_ENV",
|
|
@@ -22,10 +22,17 @@ export async function detectConfigSource(projectDir) {
|
|
|
22
22
|
if (await fs.exists(join(projectDir, name)))
|
|
23
23
|
return name;
|
|
24
24
|
}
|
|
25
|
+
if (await fs.exists(join(projectDir, ".veryfront", "project.json"))) {
|
|
26
|
+
return ".veryfront/project.json";
|
|
27
|
+
}
|
|
25
28
|
return null;
|
|
26
29
|
}
|
|
27
30
|
export function getEnvOverrides() {
|
|
28
31
|
const overrides = [];
|
|
32
|
+
for (const envVar of ENVIRONMENT_PROJECT_REFERENCE_NAMES) {
|
|
33
|
+
if (getEnv(envVar))
|
|
34
|
+
overrides.push(`projectSlug (${envVar})`);
|
|
35
|
+
}
|
|
29
36
|
for (const [field, envVar] of Object.entries(ENV_OVERRIDES)) {
|
|
30
37
|
if (getEnv(envVar))
|
|
31
38
|
overrides.push(`${field} (${envVar})`);
|
|
@@ -36,18 +43,30 @@ export async function getConfigCommandData(projectDir) {
|
|
|
36
43
|
const { getEnvironmentConfig } = await import("../../../src/config/index.js");
|
|
37
44
|
const config = getEnvironmentConfig();
|
|
38
45
|
const { readConfigFile } = await import("../../shared/config.js");
|
|
39
|
-
const
|
|
46
|
+
const { resolveCliApiUrl } = await import("../../shared/constants.js");
|
|
47
|
+
const { PROJECT_LINK_RELATIVE_PATH, readProjectLinkForControlPlane, } = await import("../../shared/project-link.js");
|
|
48
|
+
const detectedConfigSource = await detectConfigSource(projectDir);
|
|
40
49
|
const envOverrides = getEnvOverrides();
|
|
41
50
|
const fileConfig = await readConfigFile(projectDir);
|
|
51
|
+
const environmentProjectReference = resolveEnvironmentProjectReference()?.reference;
|
|
52
|
+
const linkedProjectSlug = !config.projectSlug && !fileConfig?.projectSlug &&
|
|
53
|
+
!environmentProjectReference
|
|
54
|
+
? (await readProjectLinkForControlPlane(projectDir, resolveCliApiUrl(config, fileConfig?.apiUrl)))?.projectSlug
|
|
55
|
+
: undefined;
|
|
42
56
|
return {
|
|
43
|
-
projectSlug: config.projectSlug ?? fileConfig?.projectSlug ??
|
|
57
|
+
projectSlug: config.projectSlug ?? fileConfig?.projectSlug ?? environmentProjectReference ??
|
|
58
|
+
linkedProjectSlug ?? null,
|
|
44
59
|
nodeEnv: config.nodeEnv,
|
|
45
60
|
veryfrontEnv: config.veryfrontEnv || null,
|
|
46
61
|
apiBaseUrl: config.apiBaseUrl,
|
|
47
62
|
debug: config.debug,
|
|
48
63
|
ci: config.ci,
|
|
49
64
|
hasApiToken: !!(config.apiToken ?? fileConfig?.apiToken),
|
|
50
|
-
configSource
|
|
65
|
+
configSource: linkedProjectSlug
|
|
66
|
+
? PROJECT_LINK_RELATIVE_PATH
|
|
67
|
+
: detectedConfigSource === ".veryfront/project.json"
|
|
68
|
+
? null
|
|
69
|
+
: detectedConfigSource,
|
|
51
70
|
envOverrides,
|
|
52
71
|
};
|
|
53
72
|
}
|
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module cli/commands/demo
|
|
5
5
|
*/
|
|
6
|
+
import { type ApiClient } from "../../shared/config.js";
|
|
7
|
+
import { type ProjectTarget } from "../../shared/deployment-provenance.js";
|
|
8
|
+
import { type ReserveResult } from "../../shared/reserve-slug.js";
|
|
6
9
|
type AuthMethod = "google" | "github" | "microsoft" | "token";
|
|
10
|
+
export declare function resolveDemoReservedProject(reserveResult: ReserveResult, token: string, client?: ApiClient): Promise<ProjectTarget>;
|
|
7
11
|
export interface DemoOptions {
|
|
8
12
|
/** Project name for the demo (default: demo-{random}) */
|
|
9
13
|
projectName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/demo/demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/demo/demo.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyCH,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC7F,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAgBtF,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAS9D,wBAAsB,0BAA0B,CAC9C,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,MAAM,EACb,MAAM,GAAE,SAIN,GACD,OAAO,CAAC,aAAa,CAAC,CAMxB;AAwYD,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,WAAW,CAAC,EAAE,UAAU,CAAC;CAC1B;AA+DD,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmH1E"}
|