@fnndsc/fond 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/vfs/contract.d.ts +26 -0
- package/dist/vfs/contract.js +195 -0
- package/dist/vfs/contract.js.map +1 -0
- package/dist/vfs/dispatcher.d.ts +101 -35
- package/dist/vfs/dispatcher.js +189 -87
- package/dist/vfs/dispatcher.js.map +1 -1
- package/dist/vfs/fsViews.d.ts +39 -0
- package/dist/vfs/fsViews.js +91 -0
- package/dist/vfs/fsViews.js.map +1 -0
- package/dist/vfs/memory.d.ts +66 -0
- package/dist/vfs/memory.js +282 -0
- package/dist/vfs/memory.js.map +1 -0
- package/dist/vfs/outcome.d.ts +98 -0
- package/dist/vfs/outcome.js +151 -0
- package/dist/vfs/outcome.js.map +1 -0
- package/dist/vfs/provider.d.ts +80 -23
- package/dist/vfs/render.d.ts +73 -0
- package/dist/vfs/render.js +203 -0
- package/dist/vfs/render.js.map +1 -0
- package/package.json +4 -1
package/dist/vfs/dispatcher.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.VFSDispatcher = void 0;
|
|
17
17
|
const result_js_1 = require("../result.js");
|
|
18
18
|
const errorStack_js_1 = require("../errorStack.js");
|
|
19
|
+
const outcome_js_1 = require("./outcome.js");
|
|
19
20
|
/**
|
|
20
21
|
* The fallback when none is given: it holds nothing, and says so by name
|
|
21
22
|
* rather than answering with an empty folder.
|
|
@@ -27,8 +28,7 @@ const VFS_FALLBACK_NONE = {
|
|
|
27
28
|
return (0, result_js_1.Err)();
|
|
28
29
|
},
|
|
29
30
|
async cp(src) {
|
|
30
|
-
|
|
31
|
-
return false;
|
|
31
|
+
return (0, outcome_js_1.vfs_fail)("ENOENT", `cp: no mount serves ${src}`);
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
@@ -103,6 +103,21 @@ class VFSDispatcher {
|
|
|
103
103
|
return this.providers.some((p) => p.prefix.length > 0 &&
|
|
104
104
|
(clean === p.prefix || clean.startsWith(p.prefix + "/") || p.prefix.startsWith(clean + "/")));
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Asks the mount that owns a path to answer its whole subtree from what it
|
|
108
|
+
* holds (see {@link VFSProvider.subtree}).
|
|
109
|
+
*
|
|
110
|
+
* @param pathStr - The subtree's root.
|
|
111
|
+
* @returns The answer, or null when the mount cannot give one.
|
|
112
|
+
*/
|
|
113
|
+
async subtree(pathStr) {
|
|
114
|
+
const absolutePath = pathStr.startsWith("/") ? pathStr : "/" + pathStr;
|
|
115
|
+
const clean = absolutePath.length > 1 && absolutePath.endsWith("/") ? absolutePath.slice(0, -1) : absolutePath;
|
|
116
|
+
const provider = this.provider_get(clean);
|
|
117
|
+
if (provider === this.defaultProvider || provider.subtree === undefined)
|
|
118
|
+
return null;
|
|
119
|
+
return provider.subtree(clean);
|
|
120
|
+
}
|
|
106
121
|
/**
|
|
107
122
|
* Dispatches directory listing to matched provider.
|
|
108
123
|
* Supports dynamic intermediate parent path synthesis for virtual prefixes.
|
|
@@ -147,7 +162,12 @@ class VFSDispatcher {
|
|
|
147
162
|
// contrast cp(), where a guessed path could write wrongly.
|
|
148
163
|
}
|
|
149
164
|
}
|
|
165
|
+
// The store holding nothing here is an answer: the mounts are the
|
|
166
|
+
// listing, and what the store said is not left to fail the command.
|
|
167
|
+
const mark = errorStack_js_1.errorStack.checkpoint_mark();
|
|
150
168
|
const fallbackResult = await this.defaultProvider.list(resolvedPathStr, options);
|
|
169
|
+
if (!fallbackResult.ok)
|
|
170
|
+
errorStack_js_1.errorStack.checkpoint_drain(mark);
|
|
151
171
|
if (fallbackResult.ok && fallbackResult.value) {
|
|
152
172
|
const fallbackItems = fallbackResult.value;
|
|
153
173
|
for (const item of fallbackItems) {
|
|
@@ -172,132 +192,214 @@ class VFSDispatcher {
|
|
|
172
192
|
return provider.list(pathStr, options);
|
|
173
193
|
}
|
|
174
194
|
/**
|
|
175
|
-
*
|
|
195
|
+
* The path a provider is asked with: as given for a mount, and through
|
|
196
|
+
* the path resolver for the fallback, when one is registered. An
|
|
197
|
+
* operation never proceeds on a guessed path: a path that does not
|
|
198
|
+
* resolve fails the operation.
|
|
199
|
+
*
|
|
200
|
+
* @param provider - The provider the path belongs to.
|
|
201
|
+
* @param pathStr - The path as asked.
|
|
202
|
+
* @param what - How a resolution failure names the path (`source path`, `path`).
|
|
203
|
+
* @param operation - The verb, for the failure's words.
|
|
204
|
+
* @returns The path to ask with, or why the operation cannot proceed.
|
|
205
|
+
*/
|
|
206
|
+
async pathFor_provider(provider, pathStr, what, operation) {
|
|
207
|
+
if (provider !== this.defaultProvider || !this.pathResolver)
|
|
208
|
+
return (0, outcome_js_1.vfs_ok)(pathStr);
|
|
209
|
+
try {
|
|
210
|
+
return (0, outcome_js_1.vfs_ok)(await this.pathResolver(pathStr));
|
|
211
|
+
}
|
|
212
|
+
catch (e) {
|
|
213
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
214
|
+
return (0, outcome_js_1.vfs_fail)('EIO', `${operation}: cannot resolve ${what} ${pathStr}: ${msg}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Copies within or between paths, through the provider that owns the source.
|
|
176
219
|
*
|
|
177
220
|
* @param src - Source path.
|
|
178
221
|
* @param dest - Destination path.
|
|
179
222
|
* @param options - Copy options.
|
|
180
|
-
* @returns
|
|
223
|
+
* @returns Done, or why not.
|
|
181
224
|
*/
|
|
182
225
|
async cp(src, dest, options) {
|
|
183
226
|
const provider = this.provider_get(src);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
resolvedSrc = await this.pathResolver(src);
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
195
|
-
errorStack_js_1.errorStack.stack_push("error", `cp: cannot resolve source path ${src}: ${msg}`);
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
try {
|
|
199
|
-
resolvedDest = await this.pathResolver(dest);
|
|
200
|
-
}
|
|
201
|
-
catch (e) {
|
|
202
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
203
|
-
errorStack_js_1.errorStack.stack_push("error", `cp: cannot resolve destination path ${dest}: ${msg}`);
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
return provider.cp(resolvedSrc, resolvedDest, options);
|
|
207
|
-
}
|
|
208
|
-
return provider.cp(src, dest, options);
|
|
227
|
+
const from = await this.pathFor_provider(provider, src, 'source path', 'cp');
|
|
228
|
+
if (!from.ok)
|
|
229
|
+
return from;
|
|
230
|
+
const to = await this.pathFor_provider(provider, dest, 'destination path', 'cp');
|
|
231
|
+
if (!to.ok)
|
|
232
|
+
return to;
|
|
233
|
+
return provider.cp(from.value, to.value, options);
|
|
209
234
|
}
|
|
210
235
|
/**
|
|
211
|
-
*
|
|
236
|
+
* Reads a file whole, as text, through the provider that owns it.
|
|
212
237
|
*
|
|
213
|
-
* @param pathStr - The absolute
|
|
214
|
-
* @returns
|
|
238
|
+
* @param pathStr - The absolute path of the file.
|
|
239
|
+
* @returns Its content, or why not (`EROFS` where no read is offered).
|
|
215
240
|
*/
|
|
216
241
|
async read(pathStr) {
|
|
217
242
|
const provider = this.provider_get(pathStr);
|
|
218
|
-
if (provider
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
243
|
+
if (!provider.read)
|
|
244
|
+
return this.readFailure_classify(pathStr, (0, outcome_js_1.vfs_fail)('EROFS'));
|
|
245
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'read');
|
|
246
|
+
return this.readFailure_classify(pathStr, at.ok ? await provider.read(at.value) : at);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* A failed read of a folder says so: whatever the owning mount answered
|
|
250
|
+
* (CUBE's "File not found", a projection's own words, a mount that reads
|
|
251
|
+
* nothing), a path its parent lists as a folder is a directory, as a
|
|
252
|
+
* disk says.
|
|
253
|
+
*
|
|
254
|
+
* @param pathStr - The path read.
|
|
255
|
+
* @param outcome - The read's answer.
|
|
256
|
+
* @returns The answer, or `EISDIR` when it failed on a folder.
|
|
257
|
+
*/
|
|
258
|
+
async readFailure_classify(pathStr, outcome) {
|
|
259
|
+
if (outcome.ok || outcome.errno === 'EISDIR')
|
|
260
|
+
return outcome;
|
|
261
|
+
const clean = pathStr.length > 1 && pathStr.endsWith('/') ? pathStr.slice(0, -1) : pathStr;
|
|
262
|
+
if (clean === '/')
|
|
263
|
+
return (0, outcome_js_1.vfs_fail)('EISDIR');
|
|
264
|
+
const slash = clean.lastIndexOf('/');
|
|
265
|
+
const name = clean.slice(slash + 1);
|
|
266
|
+
const mark = errorStack_js_1.errorStack.checkpoint_mark();
|
|
267
|
+
const siblings = await this.list(clean.slice(0, slash) || '/');
|
|
268
|
+
errorStack_js_1.errorStack.checkpoint_drain(mark);
|
|
269
|
+
const folder = siblings.ok && siblings.value.some((item) => item.name === name && (item.type === 'dir' || item.type === 'vfs'));
|
|
270
|
+
return folder ? (0, outcome_js_1.vfs_fail)('EISDIR') : outcome;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Reads a file whole, as bytes, through the provider that owns it.
|
|
274
|
+
*
|
|
275
|
+
* @param pathStr - The absolute path of the file.
|
|
276
|
+
* @returns Its bytes, or why not.
|
|
277
|
+
*/
|
|
278
|
+
async readBinary(pathStr) {
|
|
279
|
+
const provider = this.provider_get(pathStr);
|
|
280
|
+
if (!provider.readBinary)
|
|
281
|
+
return this.readFailure_classify(pathStr, (0, outcome_js_1.vfs_fail)('EROFS'));
|
|
282
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'read');
|
|
283
|
+
return this.readFailure_classify(pathStr, at.ok ? await provider.readBinary(at.value) : at);
|
|
223
284
|
}
|
|
224
285
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* path is refused by name rather than written somewhere it does not live.
|
|
286
|
+
* Writes a file whole, through the provider that owns it; a mount that
|
|
287
|
+
* holds no writable files answers `EROFS`.
|
|
228
288
|
*
|
|
229
|
-
* @param pathStr - The absolute
|
|
230
|
-
* @param content - The
|
|
231
|
-
* @returns
|
|
289
|
+
* @param pathStr - The absolute path of the file.
|
|
290
|
+
* @param content - The new content, whole.
|
|
291
|
+
* @returns Done, or why not.
|
|
232
292
|
*/
|
|
293
|
+
async write(pathStr, content) {
|
|
294
|
+
const provider = this.provider_get(pathStr);
|
|
295
|
+
if (!provider.write)
|
|
296
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
297
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'write');
|
|
298
|
+
return at.ok ? provider.write(at.value, content) : at;
|
|
299
|
+
}
|
|
233
300
|
/**
|
|
234
|
-
*
|
|
235
|
-
* makes no folders refuses by name.
|
|
301
|
+
* Makes a folder, through the provider that owns its path.
|
|
236
302
|
*
|
|
237
|
-
* @param pathStr - The absolute
|
|
238
|
-
* @returns
|
|
303
|
+
* @param pathStr - The absolute path of the new folder.
|
|
304
|
+
* @returns Done, or why not.
|
|
239
305
|
*/
|
|
240
306
|
async mkdir(pathStr) {
|
|
241
307
|
const provider = this.provider_get(pathStr);
|
|
242
|
-
if (provider
|
|
243
|
-
return
|
|
244
|
-
|
|
245
|
-
return
|
|
308
|
+
if (!provider.mkdir)
|
|
309
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
310
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'mkdir');
|
|
311
|
+
return at.ok ? provider.mkdir(at.value) : at;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Whether the provider that owns a folder makes it and its parents in one step.
|
|
315
|
+
*
|
|
316
|
+
* @param pathStr - The absolute path of the folder.
|
|
317
|
+
* @returns True when `mkdirTree` is offered there.
|
|
318
|
+
*/
|
|
319
|
+
mkdirTree_offered(pathStr) {
|
|
320
|
+
return this.provider_get(pathStr).mkdirTree !== undefined;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Makes a folder and any missing parents in one step, where the owning
|
|
324
|
+
* provider can; elsewhere `EROFS`, and `mkdir -p` walks instead.
|
|
325
|
+
*
|
|
326
|
+
* @param pathStr - The absolute path of the folder.
|
|
327
|
+
* @returns Done, or why not.
|
|
328
|
+
*/
|
|
329
|
+
async mkdirTree(pathStr) {
|
|
330
|
+
const provider = this.provider_get(pathStr);
|
|
331
|
+
if (!provider.mkdirTree)
|
|
332
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
333
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'mkdir');
|
|
334
|
+
return at.ok ? provider.mkdirTree(at.value) : at;
|
|
246
335
|
}
|
|
247
336
|
/**
|
|
248
|
-
*
|
|
249
|
-
* mount that removes no folders refuses by name.
|
|
337
|
+
* Removes an empty folder, through the provider that owns it.
|
|
250
338
|
*
|
|
251
|
-
* @param pathStr - The absolute
|
|
252
|
-
* @returns
|
|
339
|
+
* @param pathStr - The absolute path of the folder.
|
|
340
|
+
* @returns Done, or why not.
|
|
253
341
|
*/
|
|
254
342
|
async rmdir(pathStr) {
|
|
255
343
|
const provider = this.provider_get(pathStr);
|
|
256
|
-
if (provider
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
return
|
|
344
|
+
if (!provider.rmdir)
|
|
345
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
346
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rmdir');
|
|
347
|
+
return at.ok ? provider.rmdir(at.value) : at;
|
|
260
348
|
}
|
|
261
349
|
/**
|
|
262
|
-
*
|
|
263
|
-
* mount that renames nothing, is refused by name.
|
|
350
|
+
* Renames within one mount; a rename across mounts answers `EXDEV`.
|
|
264
351
|
*
|
|
265
|
-
* @param src - The absolute
|
|
266
|
-
* @param dest - The absolute
|
|
267
|
-
* @returns
|
|
352
|
+
* @param src - The absolute path now.
|
|
353
|
+
* @param dest - The absolute path it takes.
|
|
354
|
+
* @returns Done, or why not.
|
|
268
355
|
*/
|
|
269
356
|
async rename(src, dest) {
|
|
270
357
|
const provider = this.provider_get(src);
|
|
271
|
-
if (provider !== this.provider_get(dest))
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
358
|
+
if (provider !== this.provider_get(dest))
|
|
359
|
+
return (0, outcome_js_1.vfs_fail)('EXDEV');
|
|
360
|
+
if (!provider.rename)
|
|
361
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
362
|
+
const from = await this.pathFor_provider(provider, src, 'source path', 'mv');
|
|
363
|
+
if (!from.ok)
|
|
364
|
+
return from;
|
|
365
|
+
const to = await this.pathFor_provider(provider, dest, 'destination path', 'mv');
|
|
366
|
+
return to.ok ? provider.rename(from.value, to.value) : to;
|
|
279
367
|
}
|
|
280
|
-
|
|
368
|
+
/**
|
|
369
|
+
* Removes a file or a link, through the provider that owns it.
|
|
370
|
+
*
|
|
371
|
+
* @param pathStr - The absolute path of the entry.
|
|
372
|
+
* @returns Done, or why not.
|
|
373
|
+
*/
|
|
374
|
+
async rm(pathStr) {
|
|
281
375
|
const provider = this.provider_get(pathStr);
|
|
282
|
-
if (provider
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return false;
|
|
376
|
+
if (!provider.rm)
|
|
377
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
378
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rm');
|
|
379
|
+
return at.ok ? provider.rm(at.value) : at;
|
|
287
380
|
}
|
|
288
381
|
/**
|
|
289
|
-
*
|
|
382
|
+
* Whether the provider that owns a folder removes it whole in one step.
|
|
290
383
|
*
|
|
291
|
-
* @param pathStr - The absolute
|
|
292
|
-
* @returns
|
|
384
|
+
* @param pathStr - The absolute path of the folder.
|
|
385
|
+
* @returns True when `rmTree` is offered there.
|
|
293
386
|
*/
|
|
294
|
-
|
|
387
|
+
rmTree_offered(pathStr) {
|
|
388
|
+
return this.provider_get(pathStr).rmTree !== undefined;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Removes a folder and everything under it in one step, where the
|
|
392
|
+
* owning provider can; elsewhere `EROFS`, and `rm -r` walks instead.
|
|
393
|
+
*
|
|
394
|
+
* @param pathStr - The absolute path of the folder.
|
|
395
|
+
* @returns Done, or why not.
|
|
396
|
+
*/
|
|
397
|
+
async rmTree(pathStr) {
|
|
295
398
|
const provider = this.provider_get(pathStr);
|
|
296
|
-
if (provider
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return (0, result_js_1.Err)();
|
|
399
|
+
if (!provider.rmTree)
|
|
400
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
401
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rm');
|
|
402
|
+
return at.ok ? provider.rmTree(at.value) : at;
|
|
301
403
|
}
|
|
302
404
|
/**
|
|
303
405
|
* Resolves a lazy link through the provider that owns it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/vfs/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,4CAA+C;AAC/C,oDAA8C;AAG9C;;;GAGG;AACH,MAAM,iBAAiB,GAAgB;IACrC,MAAM,EAAE,EAAE;IACV,KAAK,CAAC,IAAI,CAAC,IAAY;QACrB,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,mBAAmB,IAAI,GAAG,CAAC,CAAC;QAC3D,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;IACD,KAAK,CAAC,EAAE,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CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,kBAAkB,CAAC,OAAe;QACtC,MAAM,QAAQ,GAAgB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACzD,IAAI,QAAQ,CAAC,kBAAkB,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,2CAA2C,OAAO,EAAE,CAAC,CAAC;QACrF,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;CACF;AArZD,sCAqZC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders the result of a mkdir operation.
|
|
3
|
+
* @param path - The path created.
|
|
4
|
+
* @param success - Whether the operation succeeded.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mkdir_render(path: string, success: boolean): string;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the result of a touch operation.
|
|
9
|
+
* @param path - The path created.
|
|
10
|
+
* @param success - Whether the operation succeeded.
|
|
11
|
+
* @param wrote - Whether content was written, rather than an empty file made.
|
|
12
|
+
*/
|
|
13
|
+
export declare function touch_render(path: string, success: boolean, wrote?: boolean): string;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the result of a copy operation.
|
|
16
|
+
* @param src - Source path.
|
|
17
|
+
* @param dest - Destination path.
|
|
18
|
+
* @param success - Whether the operation succeeded.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cp_render(src: string, dest: string, success: boolean): string;
|
|
21
|
+
/**
|
|
22
|
+
* Renders the result of a move operation.
|
|
23
|
+
* @param src - Source path.
|
|
24
|
+
* @param dest - Destination path.
|
|
25
|
+
* @param success - Whether the operation succeeded.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mv_render(src: string, dest: string, success: boolean): string;
|
|
28
|
+
/**
|
|
29
|
+
* Renders the outcome of an rm operation for terminal display.
|
|
30
|
+
*
|
|
31
|
+
* @param result - The rm result.
|
|
32
|
+
* @returns Formatted status string.
|
|
33
|
+
*/
|
|
34
|
+
export declare function rm_render(result: {
|
|
35
|
+
success: boolean;
|
|
36
|
+
path: string;
|
|
37
|
+
type: 'file' | 'dir' | 'link' | null;
|
|
38
|
+
error?: string;
|
|
39
|
+
}): string;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mkdir_render = mkdir_render;
|
|
7
|
+
exports.touch_render = touch_render;
|
|
8
|
+
exports.cp_render = cp_render;
|
|
9
|
+
exports.mv_render = mv_render;
|
|
10
|
+
exports.rm_render = rm_render;
|
|
11
|
+
/**
|
|
12
|
+
* @file What the file tools say when they are done: a folder made, a file
|
|
13
|
+
* written, a copy or a move, an entry removed.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
/**
|
|
19
|
+
* Renders the result of a mkdir operation.
|
|
20
|
+
* @param path - The path created.
|
|
21
|
+
* @param success - Whether the operation succeeded.
|
|
22
|
+
*/
|
|
23
|
+
function mkdir_render(path, success) {
|
|
24
|
+
if (success) {
|
|
25
|
+
return chalk_1.default.green(`Created directory: ${path}`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return chalk_1.default.red(`Failed to create directory: ${path}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders the result of a touch operation.
|
|
33
|
+
* @param path - The path created.
|
|
34
|
+
* @param success - Whether the operation succeeded.
|
|
35
|
+
* @param wrote - Whether content was written, rather than an empty file made.
|
|
36
|
+
*/
|
|
37
|
+
function touch_render(path, success, wrote = false) {
|
|
38
|
+
if (success) {
|
|
39
|
+
// A touch that carried content WROTE the file, and may have replaced one
|
|
40
|
+
// that was already there: reporting "Created" for a rewrite told the
|
|
41
|
+
// operator a file was new when their old content had just been replaced.
|
|
42
|
+
return chalk_1.default.green(`${wrote ? 'Wrote' : 'Created'} file: ${path}`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return chalk_1.default.red(`Failed to ${wrote ? 'write' : 'create'} file: ${path}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Renders the result of a copy operation.
|
|
50
|
+
* @param src - Source path.
|
|
51
|
+
* @param dest - Destination path.
|
|
52
|
+
* @param success - Whether the operation succeeded.
|
|
53
|
+
*/
|
|
54
|
+
function cp_render(src, dest, success) {
|
|
55
|
+
if (success) {
|
|
56
|
+
return chalk_1.default.green(`Copied ${src} to ${dest}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return chalk_1.default.red(`Failed to copy ${src} to ${dest}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Renders the result of a move operation.
|
|
64
|
+
* @param src - Source path.
|
|
65
|
+
* @param dest - Destination path.
|
|
66
|
+
* @param success - Whether the operation succeeded.
|
|
67
|
+
*/
|
|
68
|
+
function mv_render(src, dest, success) {
|
|
69
|
+
if (success) {
|
|
70
|
+
return chalk_1.default.green(`Moved ${src} to ${dest}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return chalk_1.default.red(`Failed to move ${src} to ${dest}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Renders the outcome of an rm operation for terminal display.
|
|
78
|
+
*
|
|
79
|
+
* @param result - The rm result.
|
|
80
|
+
* @returns Formatted status string.
|
|
81
|
+
*/
|
|
82
|
+
function rm_render(result) {
|
|
83
|
+
if (result.success) {
|
|
84
|
+
const typeStr = result.type || 'item';
|
|
85
|
+
return chalk_1.default.green(`Removed ${typeStr}: ${result.path}`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return chalk_1.default.red(result.error || `Failed to remove: ${result.path}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=fsViews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsViews.js","sourceRoot":"","sources":["../../src/vfs/fsViews.ts"],"names":[],"mappings":";;;;;AAaA,oCAMC;AAQD,oCASC;AAQD,8BAMC;AAQD,8BAMC;AAQD,8BAOC;AA/ED;;;;;GAKG;AACH,kDAA0B;AAE1B;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,OAAgB;IACzD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,OAAgB,EAAE,QAAiB,KAAK;IACjF,IAAI,OAAO,EAAE,CAAC;QACZ,yEAAyE;QACzE,qEAAqE;QACrE,yEAAyE;QACzE,OAAO,eAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,UAAU,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,OAAgB;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,UAAU,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,OAAgB;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,MAAgG;IACxH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,OAAO,GAAW,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC;QAC9C,OAAO,eAAK,CAAC,KAAK,CAAC,WAAW,OAAO,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,qBAAqB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Result } from '../result.js';
|
|
2
|
+
import type { VFSProvider, VFSItem, CpOptions } from './provider.js';
|
|
3
|
+
import { type VfsOutcome } from './outcome.js';
|
|
4
|
+
/**
|
|
5
|
+
* What to put in a memory filesystem before it is used: each path with the
|
|
6
|
+
* text of its file, or null for a folder. Parents are made as needed.
|
|
7
|
+
*/
|
|
8
|
+
export type MemorySeed = Readonly<Record<string, string | null>>;
|
|
9
|
+
/** A filesystem held in memory, answering every operation the contract names. */
|
|
10
|
+
export declare class MemoryVfsProvider implements VFSProvider {
|
|
11
|
+
/** The prefix it claims; empty for a session's whole filesystem. */
|
|
12
|
+
prefix: string;
|
|
13
|
+
/** Who owns what it holds, as a listing says. */
|
|
14
|
+
private readonly owner;
|
|
15
|
+
/** Every entry, by absolute path; the root always exists. */
|
|
16
|
+
private readonly nodes;
|
|
17
|
+
/**
|
|
18
|
+
* Makes an empty filesystem, or one already holding what the seed names.
|
|
19
|
+
*
|
|
20
|
+
* @param prefix - The prefix it claims (`''` for the whole tree).
|
|
21
|
+
* @param seed - Paths to make first.
|
|
22
|
+
* @param owner - The owner its listings show.
|
|
23
|
+
*/
|
|
24
|
+
constructor(prefix?: string, seed?: MemorySeed, owner?: string);
|
|
25
|
+
/**
|
|
26
|
+
* Puts one seeded entry, making its parents.
|
|
27
|
+
*
|
|
28
|
+
* @param where - The path.
|
|
29
|
+
* @param text - The file's text, or null for a folder.
|
|
30
|
+
*/
|
|
31
|
+
seed_put(where: string, text: string | null): void;
|
|
32
|
+
/** The root of what it holds. */
|
|
33
|
+
private root_get;
|
|
34
|
+
/**
|
|
35
|
+
* A path in the form entries are kept under.
|
|
36
|
+
*
|
|
37
|
+
* @param where - The path asked.
|
|
38
|
+
* @returns It, normalised, without a trailing slash.
|
|
39
|
+
*/
|
|
40
|
+
private key_of;
|
|
41
|
+
/**
|
|
42
|
+
* The entries directly in a folder.
|
|
43
|
+
*
|
|
44
|
+
* @param folder - The folder's key.
|
|
45
|
+
* @returns Their keys.
|
|
46
|
+
*/
|
|
47
|
+
private children_of;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a new entry may be made at a path: its parent is a folder.
|
|
50
|
+
*
|
|
51
|
+
* @param key - The new entry's key.
|
|
52
|
+
* @returns Null when it may, else why not.
|
|
53
|
+
*/
|
|
54
|
+
private parent_check;
|
|
55
|
+
list(where: string): Promise<Result<VFSItem[]>>;
|
|
56
|
+
read(where: string): Promise<VfsOutcome<string>>;
|
|
57
|
+
readBinary(where: string): Promise<VfsOutcome<Buffer>>;
|
|
58
|
+
write(where: string, content: string | Buffer): Promise<VfsOutcome>;
|
|
59
|
+
mkdir(where: string): Promise<VfsOutcome>;
|
|
60
|
+
mkdirTree(where: string): Promise<VfsOutcome>;
|
|
61
|
+
rmdir(where: string): Promise<VfsOutcome>;
|
|
62
|
+
rename(src: string, dest: string): Promise<VfsOutcome>;
|
|
63
|
+
rm(where: string): Promise<VfsOutcome>;
|
|
64
|
+
rmTree(where: string): Promise<VfsOutcome>;
|
|
65
|
+
cp(src: string, dest: string, options: CpOptions): Promise<VfsOutcome>;
|
|
66
|
+
}
|