veryfront 0.1.1167 → 0.1.1168
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/commands/build/command.d.ts +1 -0
- package/esm/cli/commands/build/command.d.ts.map +1 -1
- package/esm/cli/commands/build/command.js +5 -2
- package/esm/cli/commands/demo/demo.d.ts.map +1 -1
- package/esm/cli/commands/demo/demo.js +2 -2
- package/esm/cli/commands/dev/command.d.ts +2 -0
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +48 -53
- package/esm/cli/commands/dev/project-selector.d.ts +20 -0
- package/esm/cli/commands/dev/project-selector.d.ts.map +1 -0
- package/esm/cli/commands/dev/project-selector.js +50 -0
- package/esm/cli/commands/init/config-generator.d.ts +1 -1
- package/esm/cli/commands/init/config-generator.d.ts.map +1 -1
- package/esm/cli/commands/init/config-generator.js +2 -12
- package/esm/cli/commands/init/init-command.d.ts.map +1 -1
- package/esm/cli/commands/init/init-command.js +58 -69
- package/esm/cli/commands/init/interactive-wizard.d.ts +7 -0
- package/esm/cli/commands/init/interactive-wizard.d.ts.map +1 -1
- package/esm/cli/commands/init/interactive-wizard.js +15 -7
- package/esm/cli/commands/push/command.js +3 -3
- package/esm/cli/commands/up/command.js +3 -3
- package/esm/cli/templates/manifest.js +2 -2
- package/esm/cli/ui/colors.d.ts +6 -0
- package/esm/cli/ui/colors.d.ts.map +1 -1
- package/esm/cli/ui/colors.js +7 -5
- package/esm/cli/ui/components/banner.js +2 -2
- package/esm/cli/ui/dot-matrix.d.ts.map +1 -1
- package/esm/cli/ui/dot-matrix.js +5 -4
- package/esm/cli/ui/progress.d.ts +1 -0
- package/esm/cli/ui/progress.d.ts.map +1 -1
- package/esm/cli/ui/progress.js +5 -0
- package/esm/cli/utils/terminal-select.d.ts +7 -0
- package/esm/cli/utils/terminal-select.d.ts.map +1 -1
- package/esm/cli/utils/terminal-select.js +26 -6
- package/esm/deno.js +1 -1
- package/esm/src/build/production-build/asset-generation.js +1 -1
- package/esm/src/build/production-build/build/build-cleanup.js +1 -1
- package/esm/src/build/production-build/build/build-executor.js +4 -4
- package/esm/src/build/production-build/build/build-orchestrator.js +1 -1
- package/esm/src/build/production-build/build/build-setup.js +3 -3
- package/esm/src/build/production-build/build/code-splitter-orchestrator.js +2 -2
- package/esm/src/build/production-build/build/output-generator.js +1 -1
- package/esm/src/build/production-build/build/route-collector.js +3 -3
- package/esm/src/build/production-build/static-generation.js +1 -1
- package/esm/src/modules/react-loader/ssr-module-loader/cache/memory.js +1 -1
- package/esm/src/platform/compat/http/deno-server.d.ts.map +1 -1
- package/esm/src/platform/compat/http/deno-server.js +8 -2
- package/esm/src/security/http/config.d.ts +2 -1
- package/esm/src/security/http/config.d.ts.map +1 -1
- package/esm/src/security/http/config.js +4 -2
- package/esm/src/server/context/cache-invalidation.d.ts.map +1 -1
- package/esm/src/server/context/cache-invalidation.js +8 -2
- package/esm/src/server/dev-server/file-watch-setup.d.ts.map +1 -1
- package/esm/src/server/dev-server/file-watch-setup.js +11 -17
- package/esm/src/server/dev-server/server.js +3 -3
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts +2 -2
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/scripts/hmr-scripts.js +23 -35
- package/esm/src/server/reload-notifier.js +1 -1
- package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
- package/esm/src/server/runtime-handler/index.js +1 -1
- package/esm/src/utils/bundle-manifest.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
|
@@ -16,11 +16,19 @@ function canRunWizard() {
|
|
|
16
16
|
return isCliInteractive() && !(isCiEnv() || isDenoTestingEnv()) && checkIsInteractive();
|
|
17
17
|
}
|
|
18
18
|
export function formatWizardIntro() {
|
|
19
|
-
return
|
|
19
|
+
return `\n${SETUP_COPY.intro}`;
|
|
20
20
|
}
|
|
21
|
+
export const SETUP_COPY = {
|
|
22
|
+
intro: "Let's set up your project.",
|
|
23
|
+
location: "Create project in:",
|
|
24
|
+
template: "Choose a starter template:",
|
|
25
|
+
runtime: "Select runtime:",
|
|
26
|
+
git: "Initialize Git?",
|
|
27
|
+
};
|
|
21
28
|
const SETUP_PROMPT_DISPLAY = {
|
|
22
29
|
showMarker: false,
|
|
23
30
|
showInstructions: false,
|
|
31
|
+
showDescriptions: false,
|
|
24
32
|
};
|
|
25
33
|
export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
26
34
|
if (!canRunWizard()) {
|
|
@@ -37,15 +45,15 @@ export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
|
37
45
|
let projectName = existingName ?? null;
|
|
38
46
|
// Location prompt (skip when name was provided via CLI)
|
|
39
47
|
if (!existingName) {
|
|
40
|
-
const locationChoice = await select(
|
|
48
|
+
const locationChoice = await select(SETUP_COPY.location, [
|
|
41
49
|
{
|
|
42
50
|
value: "current",
|
|
43
|
-
label: "Current
|
|
51
|
+
label: "Current directory",
|
|
44
52
|
description: "Use this directory",
|
|
45
53
|
},
|
|
46
54
|
{
|
|
47
55
|
value: "new",
|
|
48
|
-
label: "New
|
|
56
|
+
label: "New directory",
|
|
49
57
|
description: "Create a new directory",
|
|
50
58
|
},
|
|
51
59
|
], 0, SETUP_PROMPT_DISPLAY);
|
|
@@ -90,7 +98,7 @@ export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
100
|
// Template selection
|
|
93
|
-
const templateChoice = await select(
|
|
101
|
+
const templateChoice = await select(SETUP_COPY.template, getTemplateSelectOptions(), 0, SETUP_PROMPT_DISPLAY);
|
|
94
102
|
if (templateChoice === null) {
|
|
95
103
|
console.log(muted("\n Cancelled.\n"));
|
|
96
104
|
return {
|
|
@@ -106,7 +114,7 @@ export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
|
106
114
|
// Runtime selection (skipped when CLI passed --runtime explicitly)
|
|
107
115
|
let runtime = presetRuntime ?? "node";
|
|
108
116
|
if (presetRuntime === undefined) {
|
|
109
|
-
const runtimeChoice = await select(
|
|
117
|
+
const runtimeChoice = await select(SETUP_COPY.runtime, [
|
|
110
118
|
{ value: "node", label: "Node.js", description: "Default" },
|
|
111
119
|
{ value: "bun", label: "Bun", description: "Fast JS runtime" },
|
|
112
120
|
{ value: "deno", label: "Deno", description: "Secure-by-default" },
|
|
@@ -125,7 +133,7 @@ export async function runInteractiveWizard(existingName, presetRuntime) {
|
|
|
125
133
|
runtime = runtimeChoice;
|
|
126
134
|
}
|
|
127
135
|
// Git init prompt
|
|
128
|
-
const gitChoice = await select(
|
|
136
|
+
const gitChoice = await select(SETUP_COPY.git, [
|
|
129
137
|
{ value: "yes", label: "Yes", description: "Initialize git and create first commit" },
|
|
130
138
|
{ value: "no", label: "No", description: "Skip git initialization" },
|
|
131
139
|
], 0, SETUP_PROMPT_DISPLAY);
|
|
@@ -15,7 +15,7 @@ import { createApiClient, resolveConfigWithAuthDetails, } from "../../shared/con
|
|
|
15
15
|
import { writeProjectLink } from "../../shared/project-link.js";
|
|
16
16
|
import { ProjectSlugConflictError, reserveProjectSlug } from "../../shared/reserve-slug.js";
|
|
17
17
|
import { isVerbose, logInfo, logSuccess } from "../../utils/index.js";
|
|
18
|
-
import { brand, createNoopSpinner, createSpinner
|
|
18
|
+
import { brand, createNoopSpinner, createSpinner } from "../../ui/index.js";
|
|
19
19
|
import { withSpan } from "../../../src/observability/tracing/otlp-setup.js";
|
|
20
20
|
import { createIgnoreChecker, loadIgnorePatterns } from "../../sync/ignore.js";
|
|
21
21
|
import { listAllFiles } from "../pull/index.js";
|
|
@@ -217,8 +217,8 @@ function outputPushResult(projectSlug, branchName, uploaded, deleted) {
|
|
|
217
217
|
? `Pushed to ${target}: ${changes.join(", ")}.`
|
|
218
218
|
: `${target === "main" ? "Main" : `Branch "${branchName}"`} is up to date.`);
|
|
219
219
|
console.log();
|
|
220
|
-
console.log(`
|
|
221
|
-
console.log(`
|
|
220
|
+
console.log(` Studio: ${brand(urls.studio)}`);
|
|
221
|
+
console.log(` Preview: ${brand(urls.preview)}`);
|
|
222
222
|
console.log();
|
|
223
223
|
}
|
|
224
224
|
function outputPushDryRunResult(projectSlug, branchName, projectExists, wouldUpload, wouldDelete) {
|
|
@@ -222,9 +222,9 @@ export async function upCommand(options = {}, env = getEnvironmentConfig()) {
|
|
|
222
222
|
}
|
|
223
223
|
logSuccess(`${projectSlug} is ready`);
|
|
224
224
|
console.log();
|
|
225
|
-
console.log(`
|
|
226
|
-
console.log(`
|
|
225
|
+
console.log(` Studio: ${brand(urls.studio)}`);
|
|
226
|
+
console.log(` Preview: ${brand(urls.preview)}`);
|
|
227
227
|
console.log();
|
|
228
|
-
console.log(`
|
|
228
|
+
console.log(` Deploy: ${brand("veryfront deploy")}`);
|
|
229
229
|
console.log();
|
|
230
230
|
}
|
|
@@ -22,9 +22,9 @@ export default {
|
|
|
22
22
|
},
|
|
23
23
|
"ai-agent": {
|
|
24
24
|
"files": {
|
|
25
|
-
"agents/assistant.ts": "import { agent } from \"veryfront/agent\";\n\nexport default agent({\n id: \"assistant\",\n name: \"
|
|
25
|
+
"agents/assistant.ts": "import { agent } from \"veryfront/agent\";\n\nexport default agent({\n id: \"assistant\",\n name: \"Assistant\",\n description: \"Turn a rough idea into a clear next move.\",\n system:\n \"Be direct and practical. Structure complex answers clearly, use tools when they improve accuracy, and state assumptions that affect the result.\",\n tools: true,\n maxSteps: 10,\n suggestions: {\n suggestions: [\n {\n type: \"prompt\",\n title: \"Shape an idea\",\n prompt: \"Turn this rough idea into a focused plan with the first three steps: \",\n },\n {\n type: \"prompt\",\n title: \"Run the numbers\",\n prompt:\n \"Calculate an 18% tip on $84.50, split the total among three people, and explain the result briefly.\",\n },\n ],\n },\n});\n",
|
|
26
26
|
"app/api/ag-ui/route.ts": "import { createAgUiHandler } from \"veryfront/agent\";\n\nexport const POST = createAgUiHandler(\"assistant\");\n",
|
|
27
|
-
"app/layout.tsx": "import \"../globals.css\";\nimport { Head } from \"veryfront/head\";\n\nexport default function RootLayout({\n children,\n}: {\n children: React.ReactNode;\n}): React.ReactNode {\n return (\n <>\n <Head>\n <title>
|
|
27
|
+
"app/layout.tsx": "import \"../globals.css\";\nimport { Head } from \"veryfront/head\";\n\nexport default function RootLayout({\n children,\n}: {\n children: React.ReactNode;\n}): React.ReactNode {\n return (\n <>\n <Head>\n <title>Assistant</title>\n <link rel=\"icon\" href=\"/favicon.svg\" type=\"image/svg+xml\" />\n </Head>\n {children}\n </>\n );\n}\n",
|
|
28
28
|
"app/page.tsx": "\"use client\";\n\nimport { Chat } from \"veryfront/chat\";\n\nexport default function ChatPage(): React.JSX.Element {\n return <Chat agentId=\"assistant\" className=\"h-screen\" />;\n}\n",
|
|
29
29
|
"evals/assistant.eval.ts": "import { datasets, evalAgent, metrics } from \"veryfront/eval\";\n\nexport default evalAgent({\n name: \"Assistant smoke test\",\n target: \"agent:assistant\",\n dataset: datasets.inline([\n {\n id: \"calculator\",\n input: \"Use the calculator tool to multiply 24 by 7.\",\n reference: \"168\",\n },\n ]),\n metrics: [\n metrics.answer.contains({ text: \"168\" }).gate(),\n metrics.agent.calledTool(\"calculator\").gate(),\n metrics.agent.noFailedTools().gate(),\n ],\n});\n",
|
|
30
30
|
"globals.css": "@import \"tailwindcss\";\n",
|
package/esm/cli/ui/colors.d.ts
CHANGED
|
@@ -16,6 +16,12 @@ export declare function setColorOverride(enabled: boolean | undefined): void;
|
|
|
16
16
|
export declare function setTestColorLevel(level: ColorLevel | null): void;
|
|
17
17
|
export declare function color(text: string, hex: string): string;
|
|
18
18
|
export declare function bgColor(text: string, hex: string): string;
|
|
19
|
+
export declare const BRAND_RGB: {
|
|
20
|
+
readonly r: 238;
|
|
21
|
+
readonly g: 178;
|
|
22
|
+
readonly b: 146;
|
|
23
|
+
};
|
|
24
|
+
export declare const BRAND_TRUECOLOR: string;
|
|
19
25
|
export declare const brand: (text: string) => string;
|
|
20
26
|
export declare const brandBg: (text: string) => string;
|
|
21
27
|
export declare const success: (text: string) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/colors.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAqC7D,wBAAgB,aAAa,IAAI,UAAU,CAG1C;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAuCD,wBAAgB,eAAe,IAAI,IAAI,CAKtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CAEhE;AA4DD,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGvD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzD;AAUD,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/colors.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;AAqC7D,wBAAgB,aAAa,IAAI,UAAU,CAG1C;AAED,wBAAgB,cAAc,IAAI,OAAO,CAExC;AAuCD,wBAAgB,eAAe,IAAI,IAAI,CAKtC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAEnE;A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AAI,MAAM,MAAM,WAAwB,CAAC;AACjE,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,WAAsB,CAAC;AAE7D,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;AAE1B;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,MAAM,CAuB1E"}
|
package/esm/cli/ui/colors.js
CHANGED
|
@@ -161,8 +161,10 @@ function rgb(r, g, b) {
|
|
|
161
161
|
function bgRgb(r, g, b) {
|
|
162
162
|
return (text) => applyColor(text, r, g, b, true);
|
|
163
163
|
}
|
|
164
|
-
export const
|
|
165
|
-
export const
|
|
164
|
+
export const BRAND_RGB = { r: 238, g: 178, b: 146 };
|
|
165
|
+
export const BRAND_TRUECOLOR = `${ESC}[38;2;${BRAND_RGB.r};${BRAND_RGB.g};${BRAND_RGB.b}m`;
|
|
166
|
+
export const brand = rgb(BRAND_RGB.r, BRAND_RGB.g, BRAND_RGB.b);
|
|
167
|
+
export const brandBg = bgRgb(BRAND_RGB.r, BRAND_RGB.g, BRAND_RGB.b);
|
|
166
168
|
export const success = rgb(34, 197, 94);
|
|
167
169
|
export const error = rgb(239, 68, 68);
|
|
168
170
|
export const warning = rgb(234, 179, 8);
|
|
@@ -192,9 +194,9 @@ export { RESET as reset };
|
|
|
192
194
|
* @returns Text with shimmer effect applied
|
|
193
195
|
*/
|
|
194
196
|
export function shimmer(text, frame, waveWidth = 3) {
|
|
195
|
-
const bright = (char) => applyColor(char, 255,
|
|
196
|
-
const normal = (char) => applyColor(char,
|
|
197
|
-
const dimmed = (char) => applyColor(char, 180,
|
|
197
|
+
const bright = (char) => applyColor(char, 255, 211, 188, false);
|
|
198
|
+
const normal = (char) => applyColor(char, BRAND_RGB.r, BRAND_RGB.g, BRAND_RGB.b, false);
|
|
199
|
+
const dimmed = (char) => applyColor(char, 180, 120, 90, false);
|
|
198
200
|
const len = text.length;
|
|
199
201
|
const wavePos = frame % (len + waveWidth * 2);
|
|
200
202
|
let result = "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RESET } from "../ansi.js";
|
|
2
2
|
import { box } from "../box.js";
|
|
3
|
-
import { brand, dim, shouldUseColor } from "../colors.js";
|
|
3
|
+
import { brand, BRAND_TRUECOLOR, dim, shouldUseColor } from "../colors.js";
|
|
4
4
|
import { AGENT_FACE } from "../dot-matrix.js";
|
|
5
5
|
import { maxLineWidth, pad, repeat } from "../layout.js";
|
|
6
6
|
function formatInfoLines(info, styleValue = true) {
|
|
@@ -16,7 +16,7 @@ function formatInfoLines(info, styleValue = true) {
|
|
|
16
16
|
}
|
|
17
17
|
function renderLogo() {
|
|
18
18
|
const useColor = shouldUseColor();
|
|
19
|
-
const litColor = useColor ?
|
|
19
|
+
const litColor = useColor ? BRAND_TRUECOLOR : "";
|
|
20
20
|
const offColor = useColor ? "\x1b[38;5;240m" : "";
|
|
21
21
|
return AGENT_FACE.map((row) => row.map((dot) => (dot === 1 ? `${litColor}●${RESET}` : `${offColor}○${RESET}`)).join(" "));
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dot-matrix.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/dot-matrix.ts"],"names":[],"mappings":"AAAA;;;;;oBAKoB;
|
|
1
|
+
{"version":3,"file":"dot-matrix.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/dot-matrix.ts"],"names":[],"mappings":"AAAA;;;;;oBAKoB;AAKpB,eAAO,MAAM,UAAU,EAAE,MAAM,EAAE,EAQhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAiB9C,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,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B,CAClB,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAChC,UAAU,SAAK,GACd,IAAI;IAeP,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAAE,UAAU,SAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B5F,kBAAkB,CAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,EAChC,UAAU,SAAK,GACd,OAAO,CAAC,IAAI,CAAC;IA2BhB,WAAW,IAAI,IAAI;IAInB,IAAI,IAAI,IAAI;IAMZ,KAAK,IAAI,IAAI;IAIb,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI;CAGtC;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB,GAAG,MAAM,CAEjF;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
|
package/esm/cli/ui/dot-matrix.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Used for the Veryfront logo in CLI experiences.
|
|
6
6
|
******************/
|
|
7
7
|
import { RESET } from "./ansi.js";
|
|
8
|
+
import { BRAND_TRUECOLOR } from "./colors.js";
|
|
8
9
|
export const AGENT_FACE = [
|
|
9
10
|
[0, 0, 0, 0, 0, 0, 0],
|
|
10
11
|
[0, 1, 1, 1, 0, 0, 0],
|
|
@@ -47,10 +48,10 @@ const COMPACT_OPTIONS = {
|
|
|
47
48
|
spacing: " ",
|
|
48
49
|
};
|
|
49
50
|
const SPIN_COLORS = {
|
|
50
|
-
bright: "\x1b[38;2;255;
|
|
51
|
-
orange:
|
|
52
|
-
mid: "\x1b[38;2;
|
|
53
|
-
dim: "\x1b[38;2;140;
|
|
51
|
+
bright: "\x1b[38;2;255;211;188m",
|
|
52
|
+
orange: BRAND_TRUECOLOR,
|
|
53
|
+
mid: "\x1b[38;2;196;133;100m",
|
|
54
|
+
dim: "\x1b[38;2;140;91;68m",
|
|
54
55
|
};
|
|
55
56
|
function resolveOptions(options) {
|
|
56
57
|
if (options.compact)
|
package/esm/cli/ui/progress.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface SpinnerController {
|
|
|
27
27
|
stop: () => void;
|
|
28
28
|
}
|
|
29
29
|
export declare function createNoopSpinner(): SpinnerController;
|
|
30
|
+
export declare function createTransientSpinner(text: string): SpinnerController;
|
|
30
31
|
export declare function createSpinner(text: string): SpinnerController;
|
|
31
32
|
export declare function inlineSpinner(text: string, frame?: number): string;
|
|
32
33
|
export declare class TaskList {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/cli/ui/progress.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;AAEtE,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,SAAI,GAAG,MAAM,CAkB/D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,YAAY,SAAI,GAAG,MAAM,CAEnE;AAED,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAYjD;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;CAClB,GAC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,KAAK,CAA4C;IACzD,OAAO,CAAC,KAAK,CAAK;IAClB,OAAO,CAAC,QAAQ,CAA+C;IAE/D,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAM1B,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAQ7B,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAOzB,MAAM,IAAI,MAAM;IAIhB,cAAc,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAYvD,aAAa,IAAI,IAAI;CAKtB"}
|
package/esm/cli/ui/progress.js
CHANGED
|
@@ -83,6 +83,11 @@ export function createNoopSpinner() {
|
|
|
83
83
|
stop() { },
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
+
export function createTransientSpinner(text) {
|
|
87
|
+
if (!isTTY() || isAnimationDisabled())
|
|
88
|
+
return createNoopSpinner();
|
|
89
|
+
return createSpinner(text);
|
|
90
|
+
}
|
|
86
91
|
export function createSpinner(text) {
|
|
87
92
|
if (!isTTY() || isAnimationDisabled()) {
|
|
88
93
|
const print = (prefix, msg) => {
|
|
@@ -10,8 +10,15 @@ export interface SelectOption {
|
|
|
10
10
|
export interface PromptDisplayOptions {
|
|
11
11
|
showMarker?: boolean;
|
|
12
12
|
showInstructions?: boolean;
|
|
13
|
+
showDescriptions?: boolean;
|
|
14
|
+
clearOnCancel?: boolean;
|
|
15
|
+
interruptOnCtrlC?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class PromptInterruptedError extends Error {
|
|
18
|
+
name: string;
|
|
13
19
|
}
|
|
14
20
|
export declare function formatPrompt(question: string, showMarker?: boolean, instructions?: string): [string, string];
|
|
21
|
+
export declare function formatSelectOption(option: SelectOption, selected: boolean, showDescription?: boolean): string;
|
|
15
22
|
/**
|
|
16
23
|
* Single-select with arrow key navigation
|
|
17
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal-select.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/terminal-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"terminal-select.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/terminal-select.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,qBAAa,sBAAuB,SAAQ,KAAK;IACtC,IAAI,SAA4B;CAC1C;AAeD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,UAAU,UAAQ,EAClB,YAAY,SAAgD,GAC3D,CAAC,MAAM,EAAE,MAAM,CAAC,CAMlB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,OAAO,EACjB,eAAe,UAAO,GACrB,MAAM,CAMR;AAED;;GAEG;AACH,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,EAAE,EACvB,YAAY,SAAI,EAChB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAyExB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,YAAY,EAAE,EACvB,WAAW,GAAE,MAAM,EAAO,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CAwEnB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,YAAY,SAAK,EACjB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAuFxB"}
|
|
@@ -6,11 +6,15 @@ import { brand, muted } from "../ui/index.js";
|
|
|
6
6
|
import { writeStdout } from "../../src/platform/index.js";
|
|
7
7
|
import { isDeno } from "../../src/platform/index.js";
|
|
8
8
|
import { getStdinReader, setRawMode } from "../../src/platform/index.js";
|
|
9
|
+
export class PromptInterruptedError extends Error {
|
|
10
|
+
name = "PromptInterruptedError";
|
|
11
|
+
}
|
|
9
12
|
// ANSI escape codes
|
|
10
13
|
const CLEAR_LINE = "\x1b[2K";
|
|
11
14
|
const MOVE_UP = "\x1b[1A";
|
|
12
15
|
const HIDE_CURSOR = "\x1b[?25l";
|
|
13
16
|
const SHOW_CURSOR = "\x1b[?25h";
|
|
17
|
+
const PROMPT_INTERRUPTED = Symbol("prompt-interrupted");
|
|
14
18
|
function clearOptions(count) {
|
|
15
19
|
for (let i = 0; i < count; i++) {
|
|
16
20
|
writeStdout(MOVE_UP + CLEAR_LINE);
|
|
@@ -23,6 +27,13 @@ export function formatPrompt(question, showMarker = false, instructions = "Use a
|
|
|
23
27
|
muted(` ${instructions}`),
|
|
24
28
|
];
|
|
25
29
|
}
|
|
30
|
+
export function formatSelectOption(option, selected, showDescription = true) {
|
|
31
|
+
const marker = selected ? brand("●") : " ";
|
|
32
|
+
const description = showDescription && option.description
|
|
33
|
+
? muted(` - ${option.description}`)
|
|
34
|
+
: "";
|
|
35
|
+
return ` ${marker} ${option.label}${description}`;
|
|
36
|
+
}
|
|
26
37
|
/**
|
|
27
38
|
* Single-select with arrow key navigation
|
|
28
39
|
*/
|
|
@@ -39,11 +50,7 @@ export async function select(question, options, defaultIndex = 0, display = {})
|
|
|
39
50
|
const opt = options[i];
|
|
40
51
|
if (!opt)
|
|
41
52
|
continue;
|
|
42
|
-
|
|
43
|
-
const prefix = isSelected ? brand("❯") : " ";
|
|
44
|
-
const label = isSelected ? brand(opt.label) : opt.label;
|
|
45
|
-
const desc = opt.description ? muted(` - ${opt.description}`) : "";
|
|
46
|
-
console.log(` ${prefix} ${label}${desc}`);
|
|
53
|
+
console.log(formatSelectOption(opt, i === selectedIndex, display.showDescriptions ?? true));
|
|
47
54
|
}
|
|
48
55
|
}
|
|
49
56
|
writeStdout(HIDE_CURSOR);
|
|
@@ -70,12 +77,25 @@ export async function select(question, options, defaultIndex = 0, display = {})
|
|
|
70
77
|
return options[selectedIndex]?.value ?? null;
|
|
71
78
|
if (key === "escape")
|
|
72
79
|
return null;
|
|
80
|
+
if (key === "ctrl-c") {
|
|
81
|
+
return display.interruptOnCtrlC ? PROMPT_INTERRUPTED : null;
|
|
82
|
+
}
|
|
73
83
|
return undefined;
|
|
74
84
|
});
|
|
75
85
|
clearOptions(options.length);
|
|
86
|
+
if (result === PROMPT_INTERRUPTED) {
|
|
87
|
+
if (display.clearOnCancel) {
|
|
88
|
+
clearOptions((display.showInstructions ?? true) ? 4 : 3);
|
|
89
|
+
}
|
|
90
|
+
throw new PromptInterruptedError();
|
|
91
|
+
}
|
|
76
92
|
const selected = options[selectedIndex];
|
|
77
|
-
if (
|
|
93
|
+
if (result === null && display.clearOnCancel) {
|
|
94
|
+
clearOptions((display.showInstructions ?? true) ? 4 : 3);
|
|
95
|
+
}
|
|
96
|
+
else if (selected) {
|
|
78
97
|
console.log(` ✓ ${selected.label}`);
|
|
98
|
+
}
|
|
79
99
|
return result;
|
|
80
100
|
}
|
|
81
101
|
finally {
|
package/esm/deno.js
CHANGED
|
@@ -126,7 +126,7 @@ export async function copyStaticAssets(adapter, projectDir, outputDir, dryRun =
|
|
|
126
126
|
throw error;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
logger.
|
|
129
|
+
logger.debug(`Copied ${stats.assets} static assets`);
|
|
130
130
|
return stats;
|
|
131
131
|
}
|
|
132
132
|
/**
|
|
@@ -21,7 +21,7 @@ export async function performCleanup(renderer) {
|
|
|
21
21
|
await cleanupCaches();
|
|
22
22
|
}
|
|
23
23
|
export function logBuildCompletion(stats) {
|
|
24
|
-
logger.
|
|
24
|
+
logger.debug("Build complete!", {
|
|
25
25
|
pages: stats.pages,
|
|
26
26
|
chunks: stats.chunks,
|
|
27
27
|
assets: stats.assets,
|
|
@@ -2,12 +2,12 @@ import { serverLogger } from "../../../utils/index.js";
|
|
|
2
2
|
import { buildAppRoutes, buildPagesRoutes } from "../static-generation.js";
|
|
3
3
|
const logger = serverLogger.component("build");
|
|
4
4
|
export async function executeBuild(pagesRoutes, appRoutes, options) {
|
|
5
|
-
logger.
|
|
6
|
-
logger.
|
|
5
|
+
logger.debug(`[BUILD] executeBuild: ${pagesRoutes.length} pages routes, ${appRoutes.length} app routes`);
|
|
6
|
+
logger.debug("Building pages...");
|
|
7
7
|
const pagesStats = await buildPagesRoutes(pagesRoutes, options);
|
|
8
|
-
logger.
|
|
8
|
+
logger.debug(`pagesStats: ${pagesStats.pages} pages built`);
|
|
9
9
|
const appStats = await buildAppRoutes(appRoutes, options);
|
|
10
|
-
logger.
|
|
10
|
+
logger.debug(`appStats: ${appStats.pages} pages built`);
|
|
11
11
|
return {
|
|
12
12
|
pages: pagesStats.pages + appStats.pages,
|
|
13
13
|
totalSize: pagesStats.totalSize + appStats.totalSize,
|
|
@@ -27,7 +27,7 @@ export function buildProduction(options) {
|
|
|
27
27
|
message: `Invalid project directory: ${normalizedOptions.projectDir} does not exist`,
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
logger.
|
|
30
|
+
logger.debug("Starting production build", options);
|
|
31
31
|
const context = await withSpan("build.initializeContext", () => initializeBuildContext(options), {});
|
|
32
32
|
try {
|
|
33
33
|
const outputDir = normalizedOptions.outputDir ?? "";
|
|
@@ -3,10 +3,10 @@ import { join } from "../../../platform/compat/path/index.js";
|
|
|
3
3
|
import { handleErrorWithFallback } from "../../../errors/index.js";
|
|
4
4
|
import { createFileSystem } from "../../../platform/compat/fs.js";
|
|
5
5
|
export async function setupBuildDirectories(adapter, outputDir, dryRun) {
|
|
6
|
-
logger.
|
|
6
|
+
logger.debug("Setting up build directories...");
|
|
7
7
|
await handleErrorWithFallback(() => adapter.fs.remove(outputDir, { recursive: true }), undefined, logger);
|
|
8
8
|
if (dryRun) {
|
|
9
|
-
logger.
|
|
9
|
+
logger.debug("Build directories ready");
|
|
10
10
|
return;
|
|
11
11
|
}
|
|
12
12
|
const fs = createFileSystem();
|
|
@@ -29,5 +29,5 @@ export async function setupBuildDirectories(adapter, outputDir, dryRun) {
|
|
|
29
29
|
throw error;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
logger.
|
|
32
|
+
logger.debug("Build directories ready");
|
|
33
33
|
}
|
|
@@ -5,7 +5,7 @@ export async function runCodeSplitting(projectDir, outputDir, routes, enableSpli
|
|
|
5
5
|
if (!enableSplitting || dryRun || routes.length === 0) {
|
|
6
6
|
return { manifest: null, chunks: 0 };
|
|
7
7
|
}
|
|
8
|
-
logger.
|
|
8
|
+
logger.debug("Running code splitter...");
|
|
9
9
|
const splitter = createCodeSplitter({
|
|
10
10
|
projectDir,
|
|
11
11
|
outDir: join(outputDir, "_veryfront/chunks"),
|
|
@@ -20,6 +20,6 @@ export async function runCodeSplitting(projectDir, outputDir, routes, enableSpli
|
|
|
20
20
|
});
|
|
21
21
|
const { entries, shared, manifest } = await splitter.split();
|
|
22
22
|
const chunks = entries.size + shared.size;
|
|
23
|
-
logger.
|
|
23
|
+
logger.debug(`Created ${chunks} chunks`);
|
|
24
24
|
return { manifest, chunks };
|
|
25
25
|
}
|
|
@@ -20,7 +20,7 @@ import { generateManifest, generateRedirects } from "../manifest.js";
|
|
|
20
20
|
* Generate client runtime scripts
|
|
21
21
|
*/
|
|
22
22
|
export async function generateClientScripts(adapter, outputDir, dryRun) {
|
|
23
|
-
logger.
|
|
23
|
+
logger.debug("Copying client scripts...");
|
|
24
24
|
if (dryRun)
|
|
25
25
|
return;
|
|
26
26
|
await writeOutputFile(adapter, join(outputDir, "_veryfront/app.js"), generateAppModule());
|
|
@@ -11,16 +11,16 @@ import { collectAppRoutes, collectPagesRoutes } from "../../../server/build-rout
|
|
|
11
11
|
const logger = serverLogger.component("build");
|
|
12
12
|
export async function collectAllRoutes(adapter, projectDir, ssg, include, exclude, config) {
|
|
13
13
|
if (!ssg) {
|
|
14
|
-
logger.
|
|
14
|
+
logger.debug("SSG disabled, skipping route collection");
|
|
15
15
|
return { pages: [], app: [] };
|
|
16
16
|
}
|
|
17
17
|
const [pages, app] = await Promise.all([
|
|
18
18
|
collectPagesRoutes(adapter, projectDir, include, exclude, config?.directories?.pages ?? "pages"),
|
|
19
19
|
collectAppRoutes(adapter, projectDir, include, exclude, config?.directories?.app ?? "app"),
|
|
20
20
|
]);
|
|
21
|
-
logger.
|
|
21
|
+
logger.debug(`Collected routes: ${pages.length} pages, ${app.length} app`);
|
|
22
22
|
if (app.length > 0) {
|
|
23
|
-
logger.
|
|
23
|
+
logger.debug(`App routes: ${app.map((r) => r.path).join(", ")}`);
|
|
24
24
|
}
|
|
25
25
|
return { pages, app };
|
|
26
26
|
}
|
|
@@ -223,7 +223,7 @@ export async function buildAppRoutes(appRoutes, options) {
|
|
|
223
223
|
const stats = { pages: 0, totalSize: 0, ssgPaths: [] };
|
|
224
224
|
if (appRoutes.length === 0)
|
|
225
225
|
return stats;
|
|
226
|
-
logger.
|
|
226
|
+
logger.debug("Building App Router static pages...");
|
|
227
227
|
const stylesheetHref = await traceStep("app:styles", () => prepareAppRouteStylesheet(options));
|
|
228
228
|
for (const route of appRoutes) {
|
|
229
229
|
try {
|
|
@@ -242,7 +242,7 @@ export function clearSSRModuleCache() {
|
|
|
242
242
|
// changes (e.g. in tests) take effect.
|
|
243
243
|
_transformSemaphore = undefined;
|
|
244
244
|
resetCachedTransformLimits();
|
|
245
|
-
logger.
|
|
245
|
+
logger.debug("Global cache cleared", {
|
|
246
246
|
modulesCleared: moduleCount,
|
|
247
247
|
failedComponentsCleared: failedCount,
|
|
248
248
|
transformSlotsCleared: transformSlotsCount,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno-server.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/deno-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAIpE,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAkB;IAEpC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"deno-server.d.ts","sourceRoot":"","sources":["../../../../../src/src/platform/compat/http/deno-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAIpE,qBAAa,cAAe,YAAW,UAAU;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAkB;IAEpC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCxE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAIvB"}
|
|
@@ -6,7 +6,6 @@ export class DenoHttpServer {
|
|
|
6
6
|
const { port = 8000, hostname = LOCALHOST.IPV4, signal, onListen } = options;
|
|
7
7
|
this.abortController = new AbortController();
|
|
8
8
|
const serveSignal = signal ?? this.abortController.signal;
|
|
9
|
-
onListen?.({ hostname, port });
|
|
10
9
|
// Access native Deno.serve via `self` to bypass dnt shim transform.
|
|
11
10
|
const nativeDeno = getNativeDeno();
|
|
12
11
|
// Access native Response via `self` to bypass dnt shim transform.
|
|
@@ -17,7 +16,14 @@ export class DenoHttpServer {
|
|
|
17
16
|
const response = await handler(req);
|
|
18
17
|
return toNativeResponse(response, NativeResponse);
|
|
19
18
|
};
|
|
20
|
-
const httpServer = nativeDeno.serve({
|
|
19
|
+
const httpServer = nativeDeno.serve({
|
|
20
|
+
port,
|
|
21
|
+
hostname,
|
|
22
|
+
signal: serveSignal,
|
|
23
|
+
onListen: ({ hostname: boundHostname, port: boundPort }) => {
|
|
24
|
+
onListen?.({ hostname: boundHostname, port: boundPort });
|
|
25
|
+
},
|
|
26
|
+
}, wrappedHandler);
|
|
21
27
|
// Block until the server stops (e.g. via signal abort).
|
|
22
28
|
// Deno.serve() returns synchronously; without awaiting .finished
|
|
23
29
|
// the event loop drains and the process exits in compiled binaries.
|
|
@@ -5,11 +5,12 @@ export declare class SecurityConfigLoader {
|
|
|
5
5
|
private projectDir;
|
|
6
6
|
private adapter;
|
|
7
7
|
private configOverride?;
|
|
8
|
+
private productionRuntime;
|
|
8
9
|
private securityConfig;
|
|
9
10
|
private cspUserHeader;
|
|
10
11
|
private isLoaded;
|
|
11
12
|
private loadPromise;
|
|
12
|
-
constructor(projectDir: string, adapter: RuntimeAdapter, configOverride?: VeryfrontConfig | undefined);
|
|
13
|
+
constructor(projectDir: string, adapter: RuntimeAdapter, configOverride?: VeryfrontConfig | undefined, productionRuntime?: boolean);
|
|
13
14
|
ensureLoaded(): Promise<void>;
|
|
14
15
|
private load;
|
|
15
16
|
private applyConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/src/security/http/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,c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ityConfigLoader {
|
|
|
7
7
|
projectDir;
|
|
8
8
|
adapter;
|
|
9
9
|
configOverride;
|
|
10
|
+
productionRuntime;
|
|
10
11
|
securityConfig = null;
|
|
11
12
|
cspUserHeader = null;
|
|
12
13
|
isLoaded = false;
|
|
13
14
|
loadPromise = null;
|
|
14
|
-
constructor(projectDir, adapter, configOverride) {
|
|
15
|
+
constructor(projectDir, adapter, configOverride, productionRuntime = false) {
|
|
15
16
|
this.projectDir = projectDir;
|
|
16
17
|
this.adapter = adapter;
|
|
17
18
|
this.configOverride = configOverride;
|
|
19
|
+
this.productionRuntime = productionRuntime;
|
|
18
20
|
}
|
|
19
21
|
async ensureLoaded() {
|
|
20
22
|
if (this.isLoaded)
|
|
@@ -41,7 +43,7 @@ export class SecurityConfigLoader {
|
|
|
41
43
|
}
|
|
42
44
|
applyConfig(cfg) {
|
|
43
45
|
const security = cfg?.security ? { ...cfg.security } : {};
|
|
44
|
-
const production = isProduction();
|
|
46
|
+
const production = this.productionRuntime || isProduction();
|
|
45
47
|
if (security.headers)
|
|
46
48
|
security.headers = { ...security.headers };
|
|
47
49
|
security.cors ??= false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache-invalidation.d.ts","sourceRoot":"","sources":["../../../../src/src/server/context/cache-invalidation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cache-invalidation.d.ts","sourceRoot":"","sources":["../../../../src/src/server/context/cache-invalidation.ts"],"names":[],"mappings":"AAwBA,UAAU,mBAAmB;IAC3B,qEAAqE;IACrE,WAAW,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IACvC,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA2Hf"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { serverLogger } from "../../utils/index.js";
|
|
2
|
+
import { isProduction } from "../../platform/environment.js";
|
|
2
3
|
import { clearModulePathCache, invalidateModulePaths, } from "../../transforms/mdx/esm-module-loader/index.js";
|
|
3
4
|
import { clearModuleCacheForProject } from "../../cache/module-cache.js";
|
|
4
5
|
import { clearSSRModuleCache, clearSSRModuleCacheForProject, } from "../../modules/react-loader/ssr-module-loader/index.js";
|
|
@@ -65,11 +66,16 @@ export async function invalidateProjectCaches(projectSlug, changedPaths, options
|
|
|
65
66
|
clearRouterDetectionCache();
|
|
66
67
|
}
|
|
67
68
|
if (!hasRealProjectSlug) {
|
|
68
|
-
|
|
69
|
+
const message = "[CacheInvalidation] Skipping cache invalidation — no project identity available";
|
|
70
|
+
const context = {
|
|
69
71
|
projectSlug,
|
|
70
72
|
reason: "projectSlug is 'preview' and no projectId provided",
|
|
71
73
|
action: "skipped_global_wipe",
|
|
72
|
-
}
|
|
74
|
+
};
|
|
75
|
+
if (isProduction())
|
|
76
|
+
logger.error(message, context);
|
|
77
|
+
else
|
|
78
|
+
logger.debug(message, context);
|
|
73
79
|
// Previously called clearRendererCaches() which wiped ALL projects' caches on this pod.
|
|
74
80
|
// This was a multi-tenant blast radius risk: one preview deployment could nuke every tenant's cache.
|
|
75
81
|
// Now we skip the invalidation entirely. The stale cache will be naturally evicted by TTL
|