@flyo/nitro-astro 2.3.2 → 2.3.3
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/components/DebugInfo.astro +25 -4
- package/package.json +1 -1
|
@@ -5,10 +5,31 @@ const integration = useFlyoIntegration();
|
|
|
5
5
|
const config = await useConfig(Astro);
|
|
6
6
|
|
|
7
7
|
// Get environment variables
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
// helper: build (import.meta.env) first, then runtime (process.env)
|
|
9
|
+
const env = import.meta.env; // Astro/Vite env access
|
|
10
|
+
const readEnv = (key, fallback = "") => {
|
|
11
|
+
const fromBuild = env?.[key];
|
|
12
|
+
if (fromBuild !== undefined && fromBuild !== "") {
|
|
13
|
+
return String(fromBuild);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const fromRuntime = typeof process !== "undefined" && process.env ? process.env[key] : undefined;
|
|
17
|
+
if (fromRuntime !== undefined && fromRuntime !== "") {
|
|
18
|
+
return String(fromRuntime);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return fallback;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// Get environment variables
|
|
25
|
+
const mode = readEnv("MODE", "-");
|
|
26
|
+
const vercelDeploymentId = readEnv("VERCEL_DEPLOYMENT_ID", "-");
|
|
27
|
+
|
|
28
|
+
// prefer your own sha, otherwise Vercel's
|
|
29
|
+
const gitSha = readEnv("VERCEL_GIT_COMMIT_SHA", "-");
|
|
30
|
+
|
|
31
|
+
// prefer your own release/version, otherwise empty
|
|
32
|
+
const version = readEnv("VERSION", "");
|
|
12
33
|
|
|
13
34
|
// Get token and determine type
|
|
14
35
|
const token = integration.options.accessToken || '';
|