chore: prepare for migration to OpenAPI
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
export const getEnv = (key: string, defaultValue = ""): string => {
|
||||
// 1. Try Vite's import.meta.env
|
||||
try {
|
||||
if (typeof import.meta.env !== "undefined" && import.meta.env[key]) {
|
||||
if (import.meta.env?.[key]) {
|
||||
return import.meta.env[key];
|
||||
}
|
||||
} catch {}
|
||||
@@ -20,11 +20,14 @@ export const getEnv = (key: string, defaultValue = ""): string => {
|
||||
return defaultValue;
|
||||
};
|
||||
|
||||
export const VITE_PUBLIC_URL = getEnv("VITE_PUBLIC_URL", "http://localhost:3000");
|
||||
export const VITE_PUBLIC_URL = getEnv(
|
||||
"VITE_PUBLIC_URL",
|
||||
"http://localhost:3000",
|
||||
);
|
||||
|
||||
export const IS_DEV = (() => {
|
||||
try {
|
||||
return typeof import.meta.env !== "undefined" && import.meta.env.DEV;
|
||||
return import.meta.env?.DEV;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// open-in-editor.ts
|
||||
// DEV utility: open source file in local editor
|
||||
|
||||
import { spawn } from "child_process";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { spawn } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
|
||||
/* -------------------------------------------------------
|
||||
* Types
|
||||
|
||||
Reference in New Issue
Block a user