mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
Fix browser runtime error by excluding Node.js env module from shared package exports
This commit is contained in:
1 parent
f962c0fe09
commit
5c0ba50e02
15 files changed
+15
-15
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import type { Database } from 'bun:sqlite'
|
||||
import type { Repo, CreateRepoInput } from '../types/repo'
|
||||
import { getReposPath } from '@opencode-manager/shared'
|
||||
import { getReposPath } from '@opencode-manager/shared/config/env'
|
||||
import path from 'path'
|
||||
|
||||
export interface RepoRow {
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
getAgentsMdPath,
|
||||
getDatabasePath,
|
||||
ENV
|
||||
} from '@opencode-manager/shared'
|
||||
} from '@opencode-manager/shared/config/env'
|
||||
|
||||
const { PORT, HOST } = ENV.SERVER
|
||||
const DB_PATH = getDatabasePath()
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Hono } from 'hono'
|
||||
import { z } from 'zod'
|
||||
import { proxyRequest } from '../services/proxy'
|
||||
import { logger } from '../utils/logger'
|
||||
import { ENV } from '@opencode-manager/shared'
|
||||
import { ENV } from '@opencode-manager/shared/config/env'
|
||||
import {
|
||||
OAuthAuthorizeRequestSchema,
|
||||
OAuthAuthorizeResponseSchema,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { SettingsService } from '../services/settings'
|
||||
import { writeFileContent } from '../services/file-operations'
|
||||
import { opencodeServerManager } from '../services/opencode-single-server'
|
||||
import { logger } from '../utils/logger'
|
||||
import { getOpenCodeConfigFilePath, getReposPath } from '@opencode-manager/shared'
|
||||
import { getOpenCodeConfigFilePath, getReposPath } from '@opencode-manager/shared/config/env'
|
||||
import path from 'path'
|
||||
|
||||
export function createRepoRoutes(database: Database) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { Database } from 'bun:sqlite'
|
||||
import { SettingsService } from '../services/settings'
|
||||
import { writeFileContent, readFileContent, fileExists } from '../services/file-operations'
|
||||
import { patchOpenCodeConfig } from '../services/proxy'
|
||||
import { getOpenCodeConfigFilePath, getAgentsMdPath } from '@opencode-manager/shared'
|
||||
import { getOpenCodeConfigFilePath, getAgentsMdPath } from '@opencode-manager/shared/config/env'
|
||||
import {
|
||||
UserPreferencesSchema,
|
||||
OpenCodeConfigSchema,
|
||||
|
||||
@@ -6,7 +6,7 @@ import { mkdir, readFile, writeFile, readdir, stat, unlink } from 'fs/promises'
|
||||
import { join } from 'path'
|
||||
import { SettingsService } from '../services/settings'
|
||||
import { logger } from '../utils/logger'
|
||||
import { getWorkspacePath } from '@opencode-manager/shared'
|
||||
import { getWorkspacePath } from '@opencode-manager/shared/config/env'
|
||||
|
||||
const TTS_CACHE_DIR = join(getWorkspacePath(), 'cache', 'tts')
|
||||
const DISCOVERY_CACHE_DIR = join(getWorkspacePath(), 'cache', 'discovery')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import path from 'path'
|
||||
import { getAuthPath } from '@opencode-manager/shared'
|
||||
import { getAuthPath } from '@opencode-manager/shared/config/env'
|
||||
import { logger } from '../utils/logger'
|
||||
import { AuthCredentialsSchema } from '../../../shared/src/schemas/auth'
|
||||
import type { z } from 'zod'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { promises as fs } from 'fs'
|
||||
import path from 'path'
|
||||
import { logger } from '../utils/logger'
|
||||
import { getReposPath } from '@opencode-manager/shared'
|
||||
import { getReposPath } from '@opencode-manager/shared/config/env'
|
||||
|
||||
export async function readFileContent(filePath: string): Promise<string> {
|
||||
try {
|
||||
|
||||
@@ -13,7 +13,8 @@ import {
|
||||
getFileStats,
|
||||
listDirectory
|
||||
} from './file-operations'
|
||||
import { FILE_LIMITS, ALLOWED_MIME_TYPES, getReposPath } from '@opencode-manager/shared'
|
||||
import { getReposPath, FILE_LIMITS } from '@opencode-manager/shared/config/env'
|
||||
import { ALLOWED_MIME_TYPES } from '@opencode-manager/shared'
|
||||
import type { ChunkedFileInfo, PatchOperation } from '@opencode-manager/shared'
|
||||
|
||||
const SHARED_WORKSPACE_BASE = getReposPath()
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from 'path'
|
||||
import { logger } from '../utils/logger'
|
||||
import { createGitHubGitEnv, createNoPromptGitEnv } from '../utils/git-auth'
|
||||
import { SettingsService } from './settings'
|
||||
import { getWorkspacePath, getOpenCodeConfigFilePath, ENV } from '@opencode-manager/shared'
|
||||
import { getWorkspacePath, getOpenCodeConfigFilePath, ENV } from '@opencode-manager/shared/config/env'
|
||||
import type { Database } from 'bun:sqlite'
|
||||
|
||||
const OPENCODE_SERVER_PORT = ENV.OPENCODE.PORT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { logger } from '../utils/logger'
|
||||
import { ENV } from '@opencode-manager/shared'
|
||||
import { ENV } from '@opencode-manager/shared/config/env'
|
||||
|
||||
const OPENCODE_SERVER_URL = `http://127.0.0.1:${ENV.OPENCODE.PORT}`
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import type { Repo, CreateRepoInput } from '../types/repo'
|
||||
import { logger } from '../utils/logger'
|
||||
import { SettingsService } from './settings'
|
||||
import { createGitEnvForRepoUrl, createNoPromptGitEnv, createGitHubGitEnv } from '../utils/git-auth'
|
||||
import { getReposPath } from '@opencode-manager/shared'
|
||||
import { getReposPath } from '@opencode-manager/shared/config/env'
|
||||
import path from 'path'
|
||||
|
||||
export class GitAuthenticationError extends Error {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ENV } from '@opencode-manager/shared'
|
||||
import { ENV } from '@opencode-manager/shared/config/env'
|
||||
|
||||
type LogLevel = 'info' | 'warn' | 'error' | 'debug'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { getReposPath } from '@opencode-manager/shared'
|
||||
import { getReposPath } from '@opencode-manager/shared/config/env'
|
||||
import { createGitHubGitEnv } from '../../src/utils/git-auth'
|
||||
|
||||
const executeCommand = vi.fn()
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export * from './defaults'
|
||||
export * from './env'
|
||||
export * from './client'
|
||||
Reference in new issue
Block a user