chore: revert back environment variable prefixes to VITE_
This commit is contained in:
@@ -485,7 +485,7 @@ const copyRequest = async () => {
|
||||
|
||||
const copyShareLink = (shareLink: string) => {
|
||||
const link = `${
|
||||
import.meta.env.APP_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||
import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||
}/r${shareLink}`
|
||||
if (navigator.share) {
|
||||
const time = new Date().toLocaleTimeString()
|
||||
|
||||
@@ -106,7 +106,7 @@ const requestLabelColor = computed(() =>
|
||||
const dateStamp = computed(() => shortDateTime(props.shortcode.createdOn))
|
||||
|
||||
const shortcodeBaseURL =
|
||||
import.meta.env.APP_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||
import.meta.env.VITE_SHORTCODE_BASE_URL ?? "https://hopp.sh"
|
||||
|
||||
const copyShortcode = (codeID: string) => {
|
||||
copyToClipboard(`${shortcodeBaseURL}/r/${codeID}`)
|
||||
|
||||
@@ -28,9 +28,9 @@ import { platform } from "~/platform"
|
||||
// TODO: Implement caching
|
||||
|
||||
const BACKEND_GQL_URL =
|
||||
import.meta.env.APP_BACKEND_GQL_URL ?? "https://api.hoppscotch.io/graphql"
|
||||
import.meta.env.VITE_BACKEND_GQL_URL ?? "https://api.hoppscotch.io/graphql"
|
||||
const BACKEND_WS_URL =
|
||||
import.meta.env.APP_BACKEND_WS_URL ?? "wss://api.hoppscotch.io/graphql"
|
||||
import.meta.env.VITE_BACKEND_WS_URL ?? "wss://api.hoppscotch.io/graphql"
|
||||
|
||||
type GQLOpType = "query" | "mutation" | "subscription"
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ const getProxyPayload = (
|
||||
let payload: ProxyPayloadType = {
|
||||
...req,
|
||||
wantsBinary: true,
|
||||
accessToken: import.meta.env.APP_PROXYSCOTCH_ACCESS_TOKEN ?? "",
|
||||
accessToken: import.meta.env.VITE_PROXYSCOTCH_ACCESS_TOKEN ?? "",
|
||||
}
|
||||
|
||||
if (payload.data instanceof FormData) {
|
||||
|
||||
@@ -52,17 +52,17 @@ function initSentry(dsn: string, router: Router, app: App) {
|
||||
Sentry.init({
|
||||
app,
|
||||
dsn,
|
||||
release: import.meta.env.APP_SENTRY_RELEASE_TAG ?? undefined,
|
||||
release: import.meta.env.VITE_SENTRY_RELEASE_TAG ?? undefined,
|
||||
environment: APP_IS_IN_DEV_MODE
|
||||
? "dev"
|
||||
: import.meta.env.APP_SENTRY_ENVIRONMENT,
|
||||
: import.meta.env.VITE_SENTRY_ENVIRONMENT,
|
||||
integrations: [
|
||||
new BrowserTracing({
|
||||
routingInstrumentation: Sentry.vueRouterInstrumentation(
|
||||
getInstrumentationVueRouter(router)
|
||||
),
|
||||
// TODO: We may want to limit this later on
|
||||
tracingOrigins: [new URL(import.meta.env.APP_BACKEND_GQL_URL).origin],
|
||||
tracingOrigins: [new URL(import.meta.env.VITE_BACKEND_GQL_URL).origin],
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: 0.8,
|
||||
@@ -175,22 +175,22 @@ function subscribeForAppDataTags() {
|
||||
|
||||
export default <HoppModule>{
|
||||
onRouterInit(app, router) {
|
||||
if (!import.meta.env.APP_SENTRY_DSN) {
|
||||
if (!import.meta.env.VITE_SENTRY_DSN) {
|
||||
console.log(
|
||||
"Sentry tracing is not enabled because 'APP_SENTRY_DSN' env is not defined"
|
||||
"Sentry tracing is not enabled because 'VITE_SENTRY_DSN' env is not defined"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (settingsStore.value.TELEMETRY_ENABLED) {
|
||||
initSentry(import.meta.env.APP_SENTRY_DSN, router, app)
|
||||
initSentry(import.meta.env.VITE_SENTRY_DSN, router, app)
|
||||
}
|
||||
|
||||
settingsStore.subject$.subscribe(({ TELEMETRY_ENABLED }) => {
|
||||
if (!TELEMETRY_ENABLED && sentryActive) {
|
||||
deinitSentry()
|
||||
} else if (TELEMETRY_ENABLED && !sentryActive) {
|
||||
initSentry(import.meta.env.APP_SENTRY_DSN!, router, app)
|
||||
initSentry(import.meta.env.VITE_SENTRY_DSN!, router, app)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
36
packages/hoppscotch-common/src/vite-envs.d.ts
vendored
36
packages/hoppscotch-common/src/vite-envs.d.ts
vendored
@@ -2,30 +2,30 @@
|
||||
|
||||
// Environment Variables Intellisense
|
||||
interface ImportMetaEnv {
|
||||
readonly APP_GA_ID: string
|
||||
readonly VITE_GA_ID: string
|
||||
|
||||
readonly APP_GTM_ID: string
|
||||
readonly VITE_GTM_ID: string
|
||||
|
||||
readonly APP_API_KEY: string
|
||||
readonly APP_AUTH_DOMAIN: string
|
||||
readonly APP_DATABASE_URL: string
|
||||
readonly APP_PROJECT_ID: string
|
||||
readonly APP_STORAGE_BUCKET: string
|
||||
readonly APP_MESSAGING_SENDER_ID: string
|
||||
readonly APP_APP_ID: string
|
||||
readonly APP_MEASUREMENT_ID: string
|
||||
readonly VITE_API_KEY: string
|
||||
readonly VITE_AUTH_DOMAIN: string
|
||||
readonly VITE_DATABASE_URL: string
|
||||
readonly VITE_PROJECT_ID: string
|
||||
readonly VITE_STORAGE_BUCKET: string
|
||||
readonly VITE_MESSAGING_SENDER_ID: string
|
||||
readonly VITE_APP_ID: string
|
||||
readonly VITE_MEASUREMENT_ID: string
|
||||
|
||||
readonly APP_BASE_URL: string
|
||||
readonly APP_SHORTCODE_BASE_URL: string
|
||||
readonly VITE_BASE_URL: string
|
||||
readonly VITE_SHORTCODE_BASE_URL: string
|
||||
|
||||
readonly APP_BACKEND_GQL_URL: string
|
||||
readonly APP_BACKEND_WS_URL: string
|
||||
readonly VITE_BACKEND_GQL_URL: string
|
||||
readonly VITE_BACKEND_WS_URL: string
|
||||
|
||||
readonly APP_SENTRY_DSN?: string
|
||||
readonly APP_SENTRY_ENVIRONMENT?: string
|
||||
readonly APP_SENTRY_RELEASE_TAG?: string
|
||||
readonly VITE_SENTRY_DSN?: string
|
||||
readonly VITE_SENTRY_ENVIRONMENT?: string
|
||||
readonly VITE_SENTRY_RELEASE_TAG?: string
|
||||
|
||||
readonly APP_PROXYSCOTCH_ACCESS_TOKEN?: string
|
||||
readonly VITE_PROXYSCOTCH_ACCESS_TOKEN?: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
||||
Reference in New Issue
Block a user