@@ -863,11 +863,9 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
863863 const target = yield * makeTempDir ( { prefix : "t3code-picker-target-" } ) ;
864864 yield * writeTextFile ( target , "nested-project/package.json" , "{}" ) ;
865865 yield * writeTextFile ( cwd , "ordinary/package.json" , "{}" ) ;
866- const names = [ "linked-project" , "Templates" , "Recent" , " .linked-hidden"] ;
866+ const names = [ "linked-project" , ".linked-hidden" ] ;
867867 for ( const name of names ) {
868- yield * Effect . tryPromise ( ( ) =>
869- NodeFSP . symlink ( target , path . join ( cwd , name ) , "junction" ) ,
870- ) ;
868+ yield * Effect . promise ( ( ) => NodeFSP . symlink ( target , path . join ( cwd , name ) , "junction" ) ) ;
871869 }
872870 const root = yield * appendSeparator ( cwd ) ;
873871 const directory = yield * workspaceEntries . browse ( { partialPath : root } ) ;
@@ -919,12 +917,12 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
919917 "linked-denied" ,
920918 ] ) {
921919 yield * fs . makeDirectory ( path . join ( target , name ) ) ;
922- yield * Effect . tryPromise ( ( ) =>
920+ yield * Effect . promise ( ( ) =>
923921 NodeFSP . symlink ( path . join ( target , name ) , path . join ( cwd , name ) , "junction" ) ,
924922 ) ;
925923 }
926924 const originalStat = NodeFSP . stat ;
927- const fileStat = yield * Effect . tryPromise ( ( ) =>
925+ const fileStat = yield * Effect . promise ( ( ) =>
928926 originalStat ( path . join ( cwd , "plain-file.txt" ) ) ,
929927 ) ;
930928 const failures = new Map ( [
@@ -960,9 +958,9 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
960958 const chained = path . join ( cwd , "chained" ) ;
961959 const local = path . join ( cwd , "local" ) ;
962960 for ( const link of [ direct , local ] ) {
963- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
961+ yield * Effect . promise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
964962 }
965- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( direct , chained , "junction" ) ) ;
963+ yield * Effect . promise ( ( ) => NodeFSP . symlink ( direct , chained , "junction" ) ) ;
966964 const originalReadlink = NodeFSP . readlink ;
967965 const networkTarget = String . raw `\\host\share` ;
968966 using _readlink = vi
@@ -985,58 +983,6 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
985983 } ) ,
986984 ) ;
987985
988- it . effect (
989- "rejects a network redirect in an intermediate target component before probing it" ,
990- ( ) =>
991- Effect . gen ( function * ( ) {
992- const workspaceEntries = yield * WorkspaceEntries . WorkspaceEntries ;
993- const path = yield * Path . Path ;
994- const fs = yield * FileSystem . FileSystem ;
995- const root = yield * fs . realPath (
996- yield * makeTempDir ( { prefix : "t3code-picker-component-" } ) ,
997- ) ;
998- const cwd = path . join ( root , "projects" ) ;
999- const target = path . join ( root , "target" ) ;
1000- yield * fs . makeDirectory ( cwd ) ;
1001- yield * fs . makeDirectory ( path . join ( target , "project" ) , { recursive : true } ) ;
1002- const redirect = path . join ( root , "redirect" ) ;
1003- const localRedirect = path . join ( root , "local-redirect" ) ;
1004- for ( const link of [ redirect , localRedirect ] ) {
1005- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
1006- }
1007- const blocked = path . join ( cwd , "blocked" ) ;
1008- const local = path . join ( cwd , "local" ) ;
1009- const unsafeTarget = path . join ( redirect , "project" ) ;
1010- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( unsafeTarget , blocked , "junction" ) ) ;
1011- yield * Effect . tryPromise ( ( ) =>
1012- NodeFSP . symlink ( path . join ( localRedirect , "project" ) , local , "junction" ) ,
1013- ) ;
1014- const originalReadlink = NodeFSP . readlink ;
1015- const networkTarget = String . raw `\\host\share` ;
1016- using _readlink = vi
1017- . spyOn ( NodeFSP , "readlink" )
1018- . mockImplementation ( ( file , options ) =>
1019- String ( file ) === redirect
1020- ? Promise . resolve ( networkTarget )
1021- : originalReadlink ( file , options ) ,
1022- ) ;
1023- using stat = vi . spyOn ( NodeFSP , "stat" ) ;
1024- using lstat = vi . spyOn ( NodeFSP , "lstat" ) ;
1025- const result = yield * workspaceEntries . browse ( {
1026- partialPath : yield * appendSeparator ( cwd ) ,
1027- } ) ;
1028- expect ( result . entries ) . toEqual ( [ { name : "local" , fullPath : local } ] ) ;
1029- expect ( lstat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . not . toContain ( unsafeTarget ) ;
1030- expect ( lstat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . not . toContain ( networkTarget ) ;
1031- expect ( stat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . not . toContain ( blocked ) ;
1032- expect ( stat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . not . toContain ( local ) ;
1033- expect ( stat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . not . toContain ( unsafeTarget ) ;
1034- expect ( stat . mock . calls . map ( ( [ file ] ) => String ( file ) ) ) . toContain (
1035- path . join ( target , "project" ) ,
1036- ) ;
1037- } ) ,
1038- ) ;
1039-
1040986 it . effect (
1041987 "reads a chosen link's resolved folder and skips one retargeted to a network share" ,
1042988 ( ) =>
@@ -1050,7 +996,7 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
1050996 const local = path . join ( root , "local" ) ;
1051997 const network = path . join ( root , "network" ) ;
1052998 for ( const link of [ local , network ] ) {
1053- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
999+ yield * Effect . promise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
10541000 }
10551001 const originalReadlink = NodeFSP . readlink ;
10561002 const networkTarget = String . raw `\\host\share` ;
@@ -1092,13 +1038,13 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceEntries", (it) => {
10921038 yield * fs . makeDirectory ( cwd ) ;
10931039 yield * fs . makeDirectory ( target , { recursive : true } ) ;
10941040 yield * fs . makeDirectory ( path . join ( root , "physical" , "child" ) ) ;
1095- yield * Effect . tryPromise ( ( ) =>
1041+ yield * Effect . promise ( ( ) =>
10961042 NodeFSP . symlink ( path . join ( root , "physical" , "child" ) , via , "junction" ) ,
10971043 ) ;
10981044 const relative = path . join ( cwd , "relative" ) ;
10991045 const cycle = path . join ( cwd , "cycle" ) ;
11001046 for ( const link of [ relative , cycle ] ) {
1101- yield * Effect . tryPromise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
1047+ yield * Effect . promise ( ( ) => NodeFSP . symlink ( target , link , "junction" ) ) ;
11021048 }
11031049 const originalReadlink = NodeFSP . readlink ;
11041050 // Junction fixtures avoid Windows symlink privileges; inject relative and cyclic targets.
0 commit comments