fix process vars

This commit is contained in:
Jason Laster 2025-03-17 12:33:58 -07:00
parent bdf151d7c7
commit 8d4b0d0f18
5 changed files with 10176 additions and 7817 deletions

3
.gitignore vendored
View File

@ -10,6 +10,9 @@ pnpm-debug.log*
lerna-debug.log*
.cursor
supabase/.temp/
data
scripts
node_modules
dist

View File

@ -27,7 +27,7 @@ export interface OllamaApiResponse {
models: OllamaModel[];
}
export const DEFAULT_NUM_CTX = process?.env?.DEFAULT_NUM_CTX ? parseInt(process.env.DEFAULT_NUM_CTX, 10) : 32768;
export const DEFAULT_NUM_CTX = import.meta.env.DEFAULT_NUM_CTX ? parseInt(import.meta.env.DEFAULT_NUM_CTX, 10) : 32768;
export default class OllamaProvider extends BaseProvider {
name = 'Ollama';
@ -101,7 +101,7 @@ export default class OllamaProvider extends BaseProvider {
throw new Error('No baseUrl found for OLLAMA provider');
}
const isDocker = process.env.RUNNING_IN_DOCKER === 'true';
const isDocker = import.meta.env.RUNNING_IN_DOCKER === 'true';
baseUrl = isDocker ? baseUrl.replace('localhost', 'host.docker.internal') : baseUrl;
baseUrl = isDocker ? baseUrl.replace('127.0.0.1', 'host.docker.internal') : baseUrl;

View File

@ -64,7 +64,7 @@ export function shouldUseSupabase(): boolean {
// Check environment variables
const useSupabaseFromEnv =
typeof window !== 'undefined' ? window.ENV?.USE_SUPABASE === 'true' : process.env.USE_SUPABASE === 'true';
typeof window === 'object' ? window.ENV?.USE_SUPABASE === 'true' : process.env.USE_SUPABASE === 'true';
// URL param takes precedence over environment variable
const shouldUse = useSupabaseFromUrl || useSupabaseFromEnv;

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,6 @@ import { vitePlugin as remixVitePlugin } from '@remix-run/dev';
import { vercelPreset } from '@vercel/remix/vite';
import UnoCSS from 'unocss/vite';
import { defineConfig, type ViteDevServer } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { optimizeCssModules } from 'vite-plugin-optimize-css-modules';
import { sentryVitePlugin } from '@sentry/vite-plugin';
import tsconfigPaths from 'vite-tsconfig-paths';
@ -25,6 +24,7 @@ export default defineConfig((config) => {
define: {
__COMMIT_HASH: JSON.stringify(getGitHash()),
__APP_VERSION: JSON.stringify(process.env.npm_package_version),
// 'process.env': JSON.stringify(process.env)
},
build: {
@ -62,6 +62,8 @@ export default defineConfig((config) => {
'SUPABASE_URL',
'SUPABASE_ANON_KEY',
'USE_SUPABASE',
'DEFAULT_NUM_CTX',
'RUNNING_IN_DOCKER',
],
css: {
preprocessorOptions: {