Skip to content

Commit 7d81baf

Browse files
committed
fix: clean up entry point error handling and redundant cast
- Add .catch() to interactive path for unhandled import failures - Match JSON formatting (null, 2) in cli.tsx catch with fail() - Remove redundant InstallationType cast in app.tsx PostInstall props
1 parent 3642f3d commit 7d81baf

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

source/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import InstallationMode from './components/steps/InstallationMode.js'
88
import OptionalPackages from './components/steps/OptionalPackages.js'
99
import PostInstall from './components/steps/PostInstall.js'
1010
import ProjectName from './components/steps/ProjectName.js'
11-
import type { InstallationSelectItem, InstallationType, MultiSelectItem } from './types/types.js'
11+
import type { InstallationSelectItem, MultiSelectItem } from './types/types.js'
1212
import { canShowStep } from './utils/utils.js'
1313

1414
const App = () => {
@@ -71,7 +71,7 @@ const App = () => {
7171
<PostInstall
7272
projectName={projectName}
7373
installationConfig={{
74-
installationType: setupType?.value as InstallationType | undefined,
74+
installationType: setupType?.value,
7575
selectedFeatures: selectedFeatures,
7676
}}
7777
key={7}

source/cli.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ if (isNonInteractive) {
8787
features: cli.flags.features,
8888
}).catch((error) => {
8989
const message = error instanceof Error ? error.message : String(error)
90-
console.log(JSON.stringify({ success: false, error: message }))
90+
console.log(JSON.stringify({ success: false, error: message }, null, 2))
9191
process.exit(1)
9292
})
9393
} else {
@@ -99,5 +99,5 @@ if (isNonInteractive) {
9999
render(<App />)
100100
}
101101

102-
run()
102+
run().catch(console.error)
103103
}

0 commit comments

Comments
 (0)