build(next): tighten standalone tracing and ignore runtime fs lookups

Trim standalone output by excluding repository-only directories from Next
file tracing and mark runtime path resolution with turbopackIgnore so
build analysis does not treat host-specific files as bundled assets.

Align the proxy debug toggle with the current change handler signature to
avoid incorrect state transitions during settings updates.
This commit is contained in:
diegosouzapw
2026-04-17 23:48:37 -03:00
parent c8828b8a42
commit 4ea123a2c0
7 changed files with 28 additions and 15 deletions

View File

@@ -17,7 +17,18 @@ const nextConfig = {
outputFileTracingExcludes: {
// Planning/task docs are not runtime assets and can break standalone copies
// when broad fs/path tracing pulls the whole repository into the NFT graph.
"/*": ["./_tasks/**/*"],
"/*": [
"./.git/**/*",
"./_tasks/**/*",
"./_references/**/*",
"./_ideia/**/*",
"./_mono_repo/**/*",
"./coverage/**/*",
"./test-results/**/*",
"./playwright-report/**/*",
"./app.__qa_backup/**/*",
"./tests/**/*",
],
},
serverExternalPackages: [
"pino",

View File

@@ -135,7 +135,7 @@ function getPayloadRulesPath() {
return (
process.env.OMNIROUTE_PAYLOAD_RULES_PATH ||
process.env.PAYLOAD_RULES_PATH ||
path.join(process.cwd(), "config", "payloadRules.json")
path.join(/* turbopackIgnore: true */ process.cwd(), "config", "payloadRules.json")
);
}

View File

@@ -142,11 +142,7 @@ export default function ProxyTab() {
<div>
<p className="font-medium">{t("debugToggle")}</p>
</div>
<Toggle
checked={debugMode}
onChange={() => updateDebugMode(!debugMode)}
disabled={loading}
/>
<Toggle checked={debugMode} onChange={updateDebugMode} disabled={loading} />
</div>
</Card>
<Card className="p-6 mt-4">

View File

@@ -10,8 +10,8 @@ import yaml from "js-yaml";
let cachedSpec: { data: any; mtime: number } | null = null;
const OPENAPI_SPEC_CANDIDATES = [
path.join(process.cwd(), "docs", "openapi.yaml"),
path.join(process.cwd(), "app", "docs", "openapi.yaml"),
path.join(/* turbopackIgnore: true */ process.cwd(), "docs", "openapi.yaml"),
path.join(/* turbopackIgnore: true */ process.cwd(), "app", "docs", "openapi.yaml"),
];
export async function GET() {

View File

@@ -69,7 +69,9 @@ async function verifyChecksum(filePath: string, expectedSha256: string): Promise
function findBinaryInDir(dir: string): string | null {
const candidates = ["cli-proxy-api", "cli-proxy-api.exe", "CLIProxyAPI", "CLIProxyAPI.exe"];
for (const name of candidates) {
if (fsSync.existsSync(path.join(dir, name))) return path.join(dir, name);
if (fsSync.existsSync(path.join(/* turbopackIgnore: true */ dir, name))) {
return path.join(/* turbopackIgnore: true */ dir, name);
}
}
return null;
}
@@ -146,7 +148,7 @@ export async function getCurrentBinaryPath(dataDir?: string): Promise<string | n
const symlinkPath = path.join(dir, "bin", "cliproxyapi");
try {
const real = await fs.realpath(symlinkPath);
return fsSync.existsSync(real) ? real : null;
return fsSync.existsSync(/* turbopackIgnore: true */ real) ? real : null;
} catch {
return null;
}
@@ -159,7 +161,9 @@ export async function getInstalledVersions(dataDir?: string): Promise<string[]>
const entries = await fs.readdir(binDir);
return entries
.filter(
(e) => e.startsWith("cliproxyapi-") && fsSync.statSync(path.join(binDir, e)).isDirectory()
(e) =>
e.startsWith("cliproxyapi-") &&
fsSync.statSync(path.join(/* turbopackIgnore: true */ binDir, e)).isDirectory()
)
.map((e) => e.replace("cliproxyapi-", ""));
} catch {

View File

@@ -209,7 +209,7 @@ export async function isZedInstalled(): Promise<boolean> {
];
for (const configPath of zedConfigPaths) {
if (fs.existsSync(configPath)) {
if (fs.existsSync(/* turbopackIgnore: true */ configPath)) {
return true;
}
}

View File

@@ -18,7 +18,7 @@ function getMachineIdRaw(): string {
}
const sysRoot = process.env.SystemRoot || process.env.windir || "C:\\Windows";
const regPath = `${sysRoot}\\System32\\REG.exe`;
if (existsSync(regPath)) {
if (existsSync(/* turbopackIgnore: true */ regPath)) {
const output = execFileSync(
regPath,
["QUERY", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography", "/v", "MachineGuid"],
@@ -59,7 +59,9 @@ function getMachineIdRaw(): string {
try {
for (const filePath of ["/etc/machine-id", "/var/lib/dbus/machine-id"]) {
try {
const content = readFileSync(filePath, "utf8").trim().toLowerCase();
const content = readFileSync(/* turbopackIgnore: true */ filePath, "utf8")
.trim()
.toLowerCase();
if (content.length > 8) return content;
} catch {
// Try the next candidate file