refactor: type safe env, update to zod v4 (#32035)

This commit is contained in:
Stephen Zhou
2026-02-10 17:55:11 +08:00
committed by GitHub
parent 0142001fc2
commit f355c8d595
34 changed files with 401 additions and 839 deletions

View File

@ -8,6 +8,7 @@ import {
} from '@/app/components/base/prompt-editor/constants'
import { InputVarType } from '@/app/components/workflow/types'
import { getMaxVarNameLength, MARKETPLACE_URL_PREFIX, MAX_VAR_KEY_LENGTH, VAR_ITEM_TEMPLATE, VAR_ITEM_TEMPLATE_IN_WORKFLOW } from '@/config'
import { env } from '@/env'
const otherAllowedRegex = /^\w+$/
@ -129,7 +130,7 @@ export const getVars = (value: string) => {
// Set the value of basePath
// example: /dify
export const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''
export const basePath = env.NEXT_PUBLIC_BASE_PATH
export function getMarketplaceUrl(path: string, params?: Record<string, string | undefined>) {
const searchParams = new URLSearchParams({ source: encodeURIComponent(window.location.origin) })