@@ -38,15 +38,15 @@ export interface FileSystem {
3838/** The callback names supported by the Go server for virtual FS delegation. */
3939export const fsCallbackNames = [ "readFile" , "fileExists" , "directoryExists" , "getAccessibleEntries" , "realpath" , "writeFile" ] as const ;
4040
41- export interface CreateRequestFileSystemOptions {
42- /** Complete directory listings. Memory filesystems derive these from `files` when omitted. */
41+ export interface CreateFileSystemOptions {
42+ /** Complete directory listings. Full filesystems derive these from `files` when omitted. */
4343 directories ?: Record < string , RequestDirectoryEntries > ;
4444 symlinks ?: Record < string , RequestSymlink > ;
4545 /** Files or directory trees hidden from an underlying snapshot or host filesystem. */
4646 removedPaths ?: readonly string [ ] ;
4747}
4848
49- export interface CreateMemoryFileSystemWithLibOptions extends CreateRequestFileSystemOptions {
49+ export interface CreateFileSystemWithLibOptions extends CreateFileSystemOptions {
5050 /** Default library directory used by a custom or non-embedded compiler executable. */
5151 defaultLibraryPath ?: string ;
5252}
@@ -57,21 +57,21 @@ export interface CreateMemoryFileSystemWithLibOptions extends CreateRequestFileS
5757 */
5858export type RequestFileEntries = readonly ( readonly [ id : DocumentIdentifier , content : string ] ) [ ] ;
5959
60- /** Creates a total memory request filesystem, deriving directory listings when omitted. */
61- export function createMemoryFileSystem (
60+ /** Creates a full request filesystem, deriving directory listings when omitted. */
61+ export function createFileSystem (
6262 files : RequestFileEntries ,
63- options : CreateRequestFileSystemOptions = { } ,
63+ options : CreateFileSystemOptions = { } ,
6464) : RequestFileSystem {
65- return createRequestFileSystem ( "memory " , files , options ) ;
65+ return createRequestFileSystem ( "full " , files , options ) ;
6666}
6767
6868/**
69- * Creates a total memory request filesystem with the compiler's default library
69+ * Creates a full request filesystem with the compiler's default library
7070 * directory mounted read-only through the host filesystem.
7171 */
72- export function createMemoryFileSystemWithLib (
72+ export function createFileSystemWithLib (
7373 files : RequestFileEntries ,
74- options : CreateMemoryFileSystemWithLibOptions = { } ,
74+ options : CreateFileSystemWithLibOptions = { } ,
7575) : RequestFileSystem {
7676 const defaultLibraryPaths = options . defaultLibraryPath
7777 ? [ normalizePath ( options . defaultLibraryPath ) ]
@@ -89,25 +89,25 @@ export function createMemoryFileSystemWithLib(
8989 for ( const defaultLibraryPath of defaultLibraryPaths ) {
9090 symlinks [ defaultLibraryPath ] ??= { target : defaultLibraryPath , host : true } ;
9191 }
92- return createRequestFileSystem ( "memory " , files , {
92+ return createRequestFileSystem ( "full " , files , {
9393 symlinks,
9494 ...( options . directories ? { directories : options . directories } : { } ) ,
9595 ...( options . removedPaths ?. length ? { removedPaths : options . removedPaths } : { } ) ,
9696 } ) ;
9797}
9898
99- /** Creates a read-through cache request filesystem, merging host directory listings when omitted. */
100- export function createCacheFileSystem (
99+ /** Creates a request filesystem layer , merging base directory listings when omitted. */
100+ export function createFileSystemLayer (
101101 files : RequestFileEntries ,
102- options : CreateRequestFileSystemOptions = { } ,
102+ options : CreateFileSystemOptions = { } ,
103103) : RequestFileSystem {
104- return createRequestFileSystem ( "cache " , files , options ) ;
104+ return createRequestFileSystem ( "layer " , files , options ) ;
105105}
106106
107107function createRequestFileSystem (
108108 kind : RequestFileSystem [ "kind" ] ,
109109 files : RequestFileEntries ,
110- options : CreateRequestFileSystemOptions ,
110+ options : CreateFileSystemOptions ,
111111) : RequestFileSystem {
112112 const normalizedFiles = new Map < string , string > ( ) ;
113113 for ( const [ id , content ] of files ) {
@@ -118,7 +118,7 @@ function createRequestFileSystem(
118118 normalizedFiles . set ( fileName , content ) ;
119119 }
120120 const fileRecord = Object . fromEntries ( normalizedFiles ) ;
121- const directories = options . directories ?? ( kind === "memory " ? deriveDirectoryListings ( fileRecord ) : undefined ) ;
121+ const directories = options . directories ?? ( kind === "full " ? deriveDirectoryListings ( fileRecord ) : undefined ) ;
122122 return {
123123 kind,
124124 files : fileRecord ,
0 commit comments