fix: 修复 main 文件及 "production" 的问题

This commit is contained in:
claude-code-best
2026-04-07 10:53:45 +08:00
parent dab0783941
commit a7d9a220bf
8 changed files with 6747 additions and 6356 deletions

View File

@@ -68,8 +68,8 @@ export function AutoUpdater({
} }
if ( if (
"production" === 'test' || process.env.NODE_ENV === 'test' ||
"production" === 'development' process.env.NODE_ENV === 'development'
) { ) {
logForDebugging( logForDebugging(
'AutoUpdater: Skipping update check in test/dev environment', 'AutoUpdater: Skipping update check in test/dev environment',

View File

@@ -6,7 +6,7 @@ import { Text, useInterval } from '../ink.js'
// Show DevBar for dev builds or all ants // Show DevBar for dev builds or all ants
function shouldShowDevBar(): boolean { function shouldShowDevBar(): boolean {
return ( return (
"production" === 'development' || process.env.USER_TYPE === 'ant' process.env.NODE_ENV === 'development' || process.env.USER_TYPE === 'ant'
) )
} }

View File

@@ -83,8 +83,8 @@ export function NativeAutoUpdater({
} }
if ( if (
"production" === 'test' || process.env.NODE_ENV === 'test' ||
"production" === 'development' process.env.NODE_ENV === 'development'
) { ) {
logForDebugging( logForDebugging(
'NativeAutoUpdater: Skipping update check in test/dev environment', 'NativeAutoUpdater: Skipping update check in test/dev environment',

View File

@@ -33,8 +33,8 @@ export function PackageManagerAutoUpdater({ verbose }: Props): React.ReactNode {
const checkForUpdates = React.useCallback(async () => { const checkForUpdates = React.useCallback(async () => {
if ( if (
"production" === 'test' || process.env.NODE_ENV === 'test' ||
"production" === 'development' process.env.NODE_ENV === 'development'
) { ) {
return return
} }

View File

@@ -623,7 +623,7 @@ export function useTypeahead({
// subsequent tests in the shard. The subscriber still registers so // subsequent tests in the shard. The subscriber still registers so
// fileSuggestions tests that trigger a refresh directly work correctly. // fileSuggestions tests that trigger a refresh directly work correctly.
useEffect(() => { useEffect(() => {
if ("production" !== 'test') { if (process.env.NODE_ENV !== 'test') {
startBackgroundCacheRefresh() startBackgroundCacheRefresh()
} }
return onIndexBuildComplete(() => { return onIndexBuildComplete(() => {

View File

@@ -153,7 +153,7 @@ export async function showSetupScreens(
devChannels?: ChannelEntry[], devChannels?: ChannelEntry[],
): Promise<boolean> { ): Promise<boolean> {
if ( if (
"production" === 'test' || process.env.NODE_ENV === 'test' ||
isEnvTruthy(false) || isEnvTruthy(false) ||
process.env.IS_DEMO // Skip onboarding in demo mode process.env.IS_DEMO // Skip onboarding in demo mode
) { ) {

13083
src/main.tsx

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ export const TestingPermissionTool: Tool<InputSchema, string> = buildTool({
return 'TestingPermission' return 'TestingPermission'
}, },
isEnabled() { isEnabled() {
return "production" === 'test' return process.env.NODE_ENV === 'test'
}, },
isConcurrencySafe() { isConcurrencySafe() {
return true return true