Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"hono": "4.11.7",
"hono-openapi": "^1.1.2",
"hono-rate-limiter": "0.5.3",
"std-env": "3.7.0",
"superjson": "2.2.6"
},
"devDependencies": {
Expand Down
7 changes: 3 additions & 4 deletions apps/api/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createEnv } from "@init/env"
import { auth, db, inngest, kv, node, sentry } from "@init/env/presets"
import { isCI } from "@init/utils/environment"
import { auth, db, inngest, kv, sentry } from "@init/env/presets"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
extends: [
node(),
// Packages
auth(),
auth.providers.github(),
Expand All @@ -28,5 +27,5 @@ export default createEnv({
BASE_URL: z.url(),
PORT: z.coerce.number().default(3000),
},
skipValidation: isCI(),
skipValidation: isCI,
})
1 change: 1 addition & 0 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"api": "workspace:*",
"react": "19.1.0",
"react-dom": "19.1.0",
"std-env": "3.7.0",
"superjson": "2.2.6"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StartClient } from "@tanstack/react-start/client"
import { StrictMode } from "react"
import { hydrateRoot } from "react-dom/client"

configureLogger()
configureLogger({ isDevelopment: import.meta.env.DEV })

hydrateRoot(
document,
Expand Down
8 changes: 4 additions & 4 deletions apps/app/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { createEnv } from "@init/env"
import { auth, db, node } from "@init/env/presets"
import { auth, db } from "@init/env/presets"
import { REACT_PUBLIC_ENV_PREFIX } from "@init/utils/constants"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
client: {
PUBLIC_API_URL: z.url().optional(),
PUBLIC_BASE_URL: z.url(),
},
clientPrefix: REACT_PUBLIC_ENV_PREFIX,
extends: [node(), auth(), auth.providers.github(), auth.providers.google(), db()],
extends: [auth(), auth.providers.github(), auth.providers.google(), db()],
// Load server environment variables (process.env) and client environment
// variables (import.meta.env)
runtimeEnv: { ...import.meta.env, ...process.env },
server: {},
skipValidation: isCI(),
skipValidation: isCI,
})
4 changes: 2 additions & 2 deletions apps/app/src/shared/trpc.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { TRPCRouter } from "api/client"
import type { ReactNode } from "react"
import { isDevelopment } from "@init/utils/environment"
import { useQueryClient } from "@tanstack/react-query"
import { createIsomorphicFn } from "@tanstack/react-start"
import { getRequestHeaders } from "@tanstack/react-start/server"
Expand All @@ -12,6 +11,7 @@ import { buildApiUrl } from "#shared/utils.ts"
const { useTRPC, useTRPCClient, TRPCProvider: TRPCProviderBase } = createTRPCContext<TRPCRouter>()

const url = buildApiUrl("/trpc")
const isDevelopment = import.meta.env.DEV

export const makeTRPCClient = createIsomorphicFn()
.server(() =>
Expand All @@ -28,7 +28,7 @@ export const makeTRPCClient = createIsomorphicFn()
.client(() =>
createTRPCClient<TRPCRouter>({
links: [
loggerLink({ colorMode: "ansi", enabled: () => isDevelopment() }),
loggerLink({ colorMode: "ansi", enabled: () => isDevelopment }),
httpBatchStreamLink({
fetch: (requestUrl, options) =>
fetch(requestUrl, {
Expand Down
7 changes: 4 additions & 3 deletions apps/app/src/shared/utils.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { isProduction } from "@init/utils/environment"
import { createUrlBuilder } from "@init/utils/url"
import env from "#shared/env.ts"

export const buildUrl = createUrlBuilder(env.PUBLIC_BASE_URL, isProduction() ? "https" : "http")
const isProduction = import.meta.env.PROD

export const buildUrl = createUrlBuilder(env.PUBLIC_BASE_URL, isProduction ? "https" : "http")

export const baseUrl = buildUrl("/")

// If you are using a separate API, you can use this function to build the API URLs.
export const buildApiUrl = createUrlBuilder(
env.PUBLIC_API_URL ?? `${env.PUBLIC_BASE_URL}/api`,
isProduction() ? "https" : "http"
isProduction ? "https" : "http"
)
3 changes: 2 additions & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"@tauri-apps/api": "2.9.1",
"@tauri-apps/plugin-opener": "2.5.3",
"react": "19.1.0",
"react-dom": "19.1.0"
"react-dom": "19.1.0",
"std-env": "3.7.0"
},
"devDependencies": {
"@inlang/paraglide-js": "2.8.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { queryClient } from "#shared/query-client.ts"

import "@init/ui/globals.css"

configureLogger()
configureLogger({ isDevelopment: import.meta.env.DEV })

export type RouterContext = {
queryClient: QueryClient
Expand Down
4 changes: 2 additions & 2 deletions apps/desktop/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEnv } from "@init/env"
import { tauri } from "@init/env/presets"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
client: {
Expand All @@ -10,5 +10,5 @@ export default createEnv({
clientPrefix: "PUBLIC_",
extends: [tauri()],
runtimeEnv: import.meta.env,
skipValidation: isCI(),
skipValidation: isCI,
})
5 changes: 3 additions & 2 deletions apps/desktop/src/shared/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { isProduction } from "@init/utils/environment"
import { createUrlBuilder } from "@init/utils/url"
import env from "#shared/env.ts"

export const buildApiUrl = createUrlBuilder(env.PUBLIC_API_URL, isProduction() ? "https" : "http")
const isProduction = import.meta.env.PROD

export const buildApiUrl = createUrlBuilder(env.PUBLIC_API_URL, isProduction ? "https" : "http")
1 change: 1 addition & 0 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@webext-core/proxy-service": "2.0.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"std-env": "3.7.0",
"wouter": "^3.7.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/entrypoints/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { browser } from "wxt/browser"
import { defineBackground } from "wxt/utils/define-background"
import { logger } from "#shared/logger.ts"

configureLogger()
configureLogger({ isDevelopment: import.meta.env.DEV })

export default defineBackground({
main: () => {
Expand Down
4 changes: 2 additions & 2 deletions apps/extension/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createEnv } from "@init/env"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
client: {
Expand All @@ -9,5 +9,5 @@ export default createEnv({
clientPrefix: "VITE_",
extends: [],
runtimeEnv: process.env,
skipValidation: isCI(),
skipValidation: isCI,
})
1 change: 1 addition & 0 deletions apps/mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"react-native-unistyles": "3.0.13",
"react-native-web": "~0.21.0",
"react-native-worklets": "0.5.1",
"std-env": "3.7.0",
"superjson": "2.2.6"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEnv } from "@init/env"
import { sentry } from "@init/env/presets"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
client: {
Expand All @@ -10,5 +10,5 @@ export default createEnv({
clientPrefix: "EXPO_PUBLIC_",
extends: [sentry.expo()],
runtimeEnv: process.env,
skipValidation: isCI(),
skipValidation: isCI,
})
4 changes: 2 additions & 2 deletions apps/mobile/src/shared/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { isProduction } from "@init/utils/environment"
import { createUrlBuilder } from "@init/utils/url"
import { Appearance, Platform } from "react-native"
import { isProduction } from "std-env"
import env from "#shared/env.ts"

export const buildApiUrl = createUrlBuilder(
env.EXPO_PUBLIC_API_URL,
isProduction() ? "https" : "http"
isProduction ? "https" : "http"
)

export const isDarkMode = Appearance.getColorScheme() === "dark"
Expand Down
3 changes: 2 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"@init/utils": "workspace:*",
"astro": "5.16.8",
"react": "19.1.0",
"react-dom": "19.1.0"
"react-dom": "19.1.0",
"std-env": "3.7.0"
},
"devDependencies": {
"@astrojs/check": "0.9.6",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createEnv } from "@init/env"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
client: {
Expand All @@ -11,5 +11,5 @@ export default createEnv({
server: {
TEST_VAR: z.string(),
},
skipValidation: isCI(),
skipValidation: isCI,
})
12 changes: 12 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"@init/utils": "workspace:*",
"@tanstack/react-query": "^5.90.20",
"convex": "1.31.6",
"convex-helpers": "0.1.111"
"convex-helpers": "0.1.111",
"std-env": "3.7.0"
},
"devDependencies": {
"@tooling/tsconfig": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/functions/shared/env.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { createEnv } from "@init/env"
import { auth } from "@init/env/presets"
import { isCI } from "@init/utils/environment"
import * as z from "@init/utils/schema"
import { isCI } from "std-env"

export default createEnv({
extends: [auth()],
runtimeEnv: process.env,
server: {
CONVEX_SITE_URL: z.string(),
},
skipValidation: isCI(),
skipValidation: isCI,
})
3 changes: 2 additions & 1 deletion packages/env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
},
"dependencies": {
"@init/utils": "workspace:*",
"@t3-oss/env-core": "0.13.10"
"@t3-oss/env-core": "0.13.10",
"std-env": "3.7.0"
},
"devDependencies": {
"@tooling/tsconfig": "workspace:*",
Expand Down
Loading