Merged in feat/sw-2871-booking-flow-envs (pull request #2483)
feat(SW-2871): Add env setup to booking-flow package * Add env setup to booking-flow package * Add missing dep * Really fix it.. Approved-by: Linus Flood
This commit is contained in:
18
packages/booking-flow/env/server.ts
vendored
Normal file
18
packages/booking-flow/env/server.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { createEnv } from "@t3-oss/env-nextjs"
|
||||||
|
import { z } from "zod"
|
||||||
|
|
||||||
|
export const env = createEnv({
|
||||||
|
/**
|
||||||
|
* Due to t3-env only checking typeof window === "undefined"
|
||||||
|
* and Netlify running Deno, window is never "undefined"
|
||||||
|
* https://github.com/t3-oss/t3-env/issues/154
|
||||||
|
*/
|
||||||
|
isServer: typeof window === "undefined" || "Deno" in window,
|
||||||
|
server: {
|
||||||
|
FOO: z.string().optional(),
|
||||||
|
},
|
||||||
|
emptyStringAsUndefined: true,
|
||||||
|
runtimeEnv: {
|
||||||
|
FOO: process.env.FOO,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
|
|
||||||
|
import { env } from "../env/server"
|
||||||
|
|
||||||
|
const tempEnv = env.FOO
|
||||||
|
|
||||||
export function Temp() {
|
export function Temp() {
|
||||||
return (
|
return (
|
||||||
<Typography variant="Body/Lead text">
|
<Typography variant="Body/Lead text">
|
||||||
<p>Tjena</p>
|
<p>Tjena {tempEnv}</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
"@eslint/js": "^9.26.0",
|
"@eslint/js": "^9.26.0",
|
||||||
"@scandic-hotels/typescript-config": "workspace:*",
|
"@scandic-hotels/typescript-config": "workspace:*",
|
||||||
|
"@t3-oss/env-nextjs": "^0.13.4",
|
||||||
"@types/lodash-es": "^4",
|
"@types/lodash-es": "^4",
|
||||||
"@types/react": "19.1.0",
|
"@types/react": "19.1.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
"@typescript-eslint/eslint-plugin": "^8.32.0",
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
"eslint-plugin-import": "^2.31.0",
|
"eslint-plugin-import": "^2.31.0",
|
||||||
"eslint-plugin-simple-import-sort": "^12.1.1",
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
||||||
"typescript": "5.8.3",
|
"typescript": "5.8.3",
|
||||||
"vitest": "^3.2.4"
|
"vitest": "^3.2.4",
|
||||||
|
"zod": "^3.24.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6776,6 +6776,7 @@ __metadata:
|
|||||||
"@eslint/js": "npm:^9.26.0"
|
"@eslint/js": "npm:^9.26.0"
|
||||||
"@scandic-hotels/common": "workspace:*"
|
"@scandic-hotels/common": "workspace:*"
|
||||||
"@scandic-hotels/typescript-config": "workspace:*"
|
"@scandic-hotels/typescript-config": "workspace:*"
|
||||||
|
"@t3-oss/env-nextjs": "npm:^0.13.4"
|
||||||
"@types/lodash-es": "npm:^4"
|
"@types/lodash-es": "npm:^4"
|
||||||
"@types/react": "npm:19.1.0"
|
"@types/react": "npm:19.1.0"
|
||||||
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
|
"@typescript-eslint/eslint-plugin": "npm:^8.32.0"
|
||||||
@@ -6786,6 +6787,7 @@ __metadata:
|
|||||||
eslint-plugin-simple-import-sort: "npm:^12.1.1"
|
eslint-plugin-simple-import-sort: "npm:^12.1.1"
|
||||||
typescript: "npm:5.8.3"
|
typescript: "npm:5.8.3"
|
||||||
vitest: "npm:^3.2.4"
|
vitest: "npm:^3.2.4"
|
||||||
|
zod: "npm:^3.24.4"
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
next: ^15
|
next: ^15
|
||||||
react: ^19
|
react: ^19
|
||||||
|
|||||||
Reference in New Issue
Block a user