File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @effect/language-service " : patch
3+ ---
4+
5+ fix: ensure correct path resolution in CLI setup
6+
7+ - Use ` process.cwd() ` explicitly in ` path.resolve() ` for consistent behavior
8+ - Resolve the selected tsconfig path to an absolute path before validation
9+ - Simplify error handling by using direct ` yield* ` for ` TsConfigNotFoundError `
Original file line number Diff line number Diff line change @@ -35,9 +35,7 @@ const createAssessmentInput = (
3535 const packageJsonExists = yield * fs . exists ( packageJsonPath )
3636
3737 if ( ! packageJsonExists ) {
38- return yield * Effect . fail (
39- new PackageJsonNotFoundError ( { path : packageJsonPath } )
40- )
38+ return yield * new PackageJsonNotFoundError ( { path : packageJsonPath } )
4139 }
4240
4341 const packageJsonText = yield * fs . readFileString ( packageJsonPath ) . pipe (
@@ -83,7 +81,7 @@ export const setup = Command.make(
8381 // ========================================================================
8482 // Phase 1: Select tsconfig file
8583 // ========================================================================
86- const currentDir = path . resolve ( "." )
84+ const currentDir = path . resolve ( process . cwd ( ) )
8785 const tsconfigInput = yield * selectTsConfigFile ( currentDir )
8886
8987 // ========================================================================
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export const selectTsConfigFile = (
3939> =>
4040 Effect . gen ( function * ( ) {
4141 const fs = yield * FileSystem . FileSystem
42+ const path = yield * Path . Path
4243
4344 const tsconfigFiles = yield * findTsConfigFiles ( currentDir )
4445
@@ -75,13 +76,12 @@ export const selectTsConfigFile = (
7576 selectedTsconfigPath = selected
7677 }
7778 }
79+ selectedTsconfigPath = path . resolve ( selectedTsconfigPath )
7880
7981 // Check if the selected tsconfig file exists
8082 const tsconfigExists = yield * fs . exists ( selectedTsconfigPath )
8183 if ( ! tsconfigExists ) {
82- return yield * Effect . fail (
83- new TsConfigNotFoundError ( { path : selectedTsconfigPath } )
84- )
84+ return yield * new TsConfigNotFoundError ( { path : selectedTsconfigPath } )
8585 }
8686
8787 // Read the tsconfig file
You can’t perform that action at this time.
0 commit comments