Skip to content

Commit 9cc759e

Browse files
committed
#608: finalizations
1 parent ca547ae commit 9cc759e

File tree

5 files changed

+25
-15
lines changed

5 files changed

+25
-15
lines changed

packages/sourcing/src/files/RemoteFileSystem.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
import RemoteFilesNotSupported from './errors/RemoteFilesNotSupported';
23
import FileSystem from './interfaces/FileSystem';
34

45
/* eslint-disable @typescript-eslint/no-unused-vars */
@@ -12,17 +13,17 @@ export default class RemoteFileSystem implements FileSystem
1213

1314
copy(source: string, destination: string): Promise<void>
1415
{
15-
throw new Error('Method 1 not implemented.');
16+
throw new RemoteFilesNotSupported();
1617
}
1718

1819
delete(location: string): Promise<void>
1920
{
20-
throw new Error('Method 2 not implemented.');
21+
throw new RemoteFilesNotSupported();
2122
}
2223

2324
exists(location: string): Promise<boolean>
2425
{
25-
throw new Error('Method 3 not implemented.');
26+
throw new RemoteFilesNotSupported();
2627
}
2728

2829
async filter(location: string, pattern: string): Promise<string[]>
@@ -32,17 +33,17 @@ export default class RemoteFileSystem implements FileSystem
3233

3334
isDirectory(location: string): boolean
3435
{
35-
throw new Error('Method 5 not implemented.');
36+
throw new RemoteFilesNotSupported();
3637
}
3738

3839
join(...paths: string[]): string
3940
{
40-
throw new Error('Method 6 not implemented.');
41+
throw new RemoteFilesNotSupported();
4142
}
4243

4344
read(location: string): Promise<Buffer>
4445
{
45-
throw new Error('Method 7 not implemented.');
46+
throw new RemoteFilesNotSupported();
4647
}
4748

4849
resolve(location: string): string
@@ -52,16 +53,16 @@ export default class RemoteFileSystem implements FileSystem
5253

5354
relative(from: string, to: string): string
5455
{
55-
throw new Error('Method 9 not implemented.');
56+
throw new RemoteFilesNotSupported();
5657
}
5758

5859
mimeType(location: string): Promise<string | undefined>
5960
{
60-
throw new Error('Method 10 not implemented.');
61+
throw new RemoteFilesNotSupported();
6162
}
6263

6364
write(location: string, content: string): Promise<void>
6465
{
65-
throw new Error('Method 11 not implemented.');
66+
throw new RemoteFilesNotSupported();
6667
}
6768
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
export default class RemoteFilesNotSupported extends Error
3+
{
4+
constructor()
5+
{
6+
super('Remote files are not supported');
7+
}
8+
}

packages/sourcing/src/files/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export type { default as FileReader } from './interfaces/FileReader';
88

99
export { default as File } from './models/File';
1010

11-
export type { default as FileManager } from './FileManager';
11+
export { default as FileManager } from './FileManager';
1212
export { default as LocalFileManager } from './LocalFileManager';
1313
export { default as RemoteFileManager } from './RemoteFileManager';

packages/sourcing/src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11

2-
export type { FileReader, FileManager } from './files';
3-
export { Files, File, LocalFileManager, RemoteFileManager, InvalidLocation, FileNotFound } from './files';
2+
export type { FileReader } from './files';
3+
export { Files, File, FileManager, LocalFileManager, RemoteFileManager, InvalidLocation, FileNotFound } from './files';
44

5-
export { Module, ModuleImporter, ImportManager, ModuleNotLoaded } from './modules';
5+
export type { Module, ModuleImporter } from './modules';
6+
export { ImportManager, ModuleNotLoaded } from './modules';
67

7-
export type { default as SourcingManager } from './SourcingManager';
8+
export { default as SourcingManager } from './SourcingManager';
89
export { default as LocalSourcingManager } from './LocalSourcingManager';
910
export { default as RemoteSourcingManager } from './RemoteSourcingManager';

packages/sourcing/src/modules/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export type { default as ModuleImporter } from './interfaces/ModuleImporter';
55

66
export { default as Module } from './types/Module';
77

8-
export type { default as ImportManager } from './ImportManager';
8+
export { default as ImportManager } from './ImportManager';
99
export { default as LocalImportManager } from './LocalImportManager';
1010
export { default as RemoteImportManager } from './RemoteImportManager';

0 commit comments

Comments
 (0)