chore(docs): keep runtime tracing server-safe
Co-authored-by: Junior Garcia <jrgarciadev@gmail.com>
This commit is contained in:
committed by
Junior Garcia
parent
735c6c5bad
commit
5408417db5
+22
-18
@@ -1,25 +1,29 @@
|
||||
import {appendFileSync} from "node:fs";
|
||||
|
||||
import {createEnv} from "@t3-oss/env-nextjs";
|
||||
import {z} from "zod";
|
||||
|
||||
// #region agent log
|
||||
appendFileSync(
|
||||
"/opt/cursor/logs/debug.log",
|
||||
`${JSON.stringify({
|
||||
data: {
|
||||
featurebaseEndpointPresent: process.env["FEATUREBASE_API_ENDPOINT"] !== undefined,
|
||||
featurebaseKeyPresent: process.env["FEATUREBASE_API_KEY"] !== undefined,
|
||||
loopsEndpointPresent: process.env["LOOPS_API_ENDPOINT"] !== undefined,
|
||||
loopsKeyPresent: process.env["LOOPS_API_KEY"] !== undefined,
|
||||
nodeEnv: process.env["NODE_ENV"] ?? null,
|
||||
},
|
||||
hypothesisId: "D",
|
||||
location: "apps/docs/env.ts:module-evaluation",
|
||||
message: "Validating documentation runtime environment",
|
||||
timestamp: Date.now(),
|
||||
})}\n`,
|
||||
);
|
||||
if (typeof window === "undefined") {
|
||||
const fileSystem = process.getBuiltinModule("fs") as {
|
||||
appendFileSync(path: string, data: string): void;
|
||||
};
|
||||
|
||||
fileSystem.appendFileSync(
|
||||
"/opt/cursor/logs/debug.log",
|
||||
`${JSON.stringify({
|
||||
data: {
|
||||
featurebaseEndpointPresent: process.env["FEATUREBASE_API_ENDPOINT"] !== undefined,
|
||||
featurebaseKeyPresent: process.env["FEATUREBASE_API_KEY"] !== undefined,
|
||||
loopsEndpointPresent: process.env["LOOPS_API_ENDPOINT"] !== undefined,
|
||||
loopsKeyPresent: process.env["LOOPS_API_KEY"] !== undefined,
|
||||
nodeEnv: process.env["NODE_ENV"] ?? null,
|
||||
},
|
||||
hypothesisId: "D",
|
||||
location: "apps/docs/env.ts:module-evaluation",
|
||||
message: "Validating documentation runtime environment",
|
||||
timestamp: Date.now(),
|
||||
})}\n`,
|
||||
);
|
||||
}
|
||||
// #endregion
|
||||
|
||||
export const env = createEnv({
|
||||
|
||||
Reference in New Issue
Block a user