shell-dsl 0.0.29 → 0.0.31
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 +33 -7
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/fs/index.cjs +4 -4
- package/dist/cjs/src/fs/index.cjs.map +3 -3
- package/dist/cjs/src/fs/memfs-adapter.cjs +7 -108
- package/dist/cjs/src/fs/memfs-adapter.cjs.map +3 -3
- package/dist/cjs/src/fs/real-fs.cjs +27 -123
- package/dist/cjs/src/fs/real-fs.cjs.map +3 -3
- package/dist/cjs/src/fs/{opfs-fs.cjs → web-fs.cjs} +61 -13
- package/dist/cjs/src/fs/web-fs.cjs.map +10 -0
- package/dist/cjs/src/index.cjs +4 -3
- package/dist/cjs/src/index.cjs.map +3 -3
- package/dist/cjs/src/utils/glob.cjs +129 -0
- package/dist/cjs/src/utils/glob.cjs.map +10 -0
- package/dist/cjs/src/utils/index.cjs +3 -1
- package/dist/cjs/src/utils/index.cjs.map +3 -3
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/src/fs/index.mjs +4 -4
- package/dist/mjs/src/fs/index.mjs.map +2 -2
- package/dist/mjs/src/fs/memfs-adapter.mjs +7 -108
- package/dist/mjs/src/fs/memfs-adapter.mjs.map +3 -3
- package/dist/mjs/src/fs/real-fs.mjs +27 -123
- package/dist/mjs/src/fs/real-fs.mjs.map +3 -3
- package/dist/mjs/src/fs/{opfs-fs.mjs → web-fs.mjs} +58 -10
- package/dist/mjs/src/fs/web-fs.mjs.map +10 -0
- package/dist/mjs/src/index.mjs +7 -6
- package/dist/mjs/src/index.mjs.map +3 -3
- package/dist/mjs/src/utils/glob.mjs +89 -0
- package/dist/mjs/src/utils/glob.mjs.map +10 -0
- package/dist/mjs/src/utils/index.mjs +3 -1
- package/dist/mjs/src/utils/index.mjs.map +3 -3
- package/dist/types/src/fs/index.d.ts +2 -2
- package/dist/types/src/fs/real-fs.d.ts +12 -5
- package/dist/types/src/fs/{opfs-fs.d.ts → web-fs.d.ts} +2 -2
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/utils/glob.d.ts +6 -0
- package/dist/types/src/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/src/fs/opfs-fs.cjs.map +0 -10
- package/dist/mjs/src/fs/opfs-fs.mjs.map +0 -10
|
@@ -36,17 +36,65 @@ var __export = (target, all) => {
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
// src/fs/
|
|
40
|
-
var
|
|
41
|
-
__export(
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// src/fs/web-fs.ts
|
|
40
|
+
var exports_web_fs = {};
|
|
41
|
+
__export(exports_web_fs, {
|
|
42
|
+
createWebUnderlyingFS: () => createWebUnderlyingFS,
|
|
43
|
+
WebFileSystem: () => WebFileSystem
|
|
44
44
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
45
|
+
module.exports = __toCommonJS(exports_web_fs);
|
|
46
46
|
var import_real_fs = require("./real-fs.cjs");
|
|
47
47
|
var DIRECTORY_MTIME = new Date(0);
|
|
48
|
-
|
|
48
|
+
var WEB_PATH_OPS = {
|
|
49
|
+
separator: "/",
|
|
50
|
+
resolve(...paths) {
|
|
51
|
+
return normalizeWebPath(paths.join("/"));
|
|
52
|
+
},
|
|
53
|
+
normalize: normalizeWebPath,
|
|
54
|
+
join(...paths) {
|
|
55
|
+
const nonEmpty = paths.filter((segment) => segment.length > 0);
|
|
56
|
+
if (nonEmpty.length === 0) {
|
|
57
|
+
return ".";
|
|
58
|
+
}
|
|
59
|
+
return normalizeWebPath(nonEmpty.join("/"));
|
|
60
|
+
},
|
|
61
|
+
relative(from, to) {
|
|
62
|
+
const fromSegments = getPathSegments(from);
|
|
63
|
+
const toSegments = getPathSegments(to);
|
|
64
|
+
let shared = 0;
|
|
65
|
+
while (shared < fromSegments.length && shared < toSegments.length && fromSegments[shared] === toSegments[shared]) {
|
|
66
|
+
shared++;
|
|
67
|
+
}
|
|
68
|
+
const up = new Array(fromSegments.length - shared).fill("..");
|
|
69
|
+
const down = toSegments.slice(shared);
|
|
70
|
+
return [...up, ...down].join("/");
|
|
71
|
+
},
|
|
72
|
+
isAbsolute(path) {
|
|
73
|
+
return path.startsWith("/");
|
|
74
|
+
},
|
|
75
|
+
dirname(path) {
|
|
76
|
+
const normalized = normalizeWebPath(path);
|
|
77
|
+
if (normalized === "/") {
|
|
78
|
+
return "/";
|
|
79
|
+
}
|
|
80
|
+
const segments = getPathSegments(normalized);
|
|
81
|
+
if (segments.length <= 1) {
|
|
82
|
+
return "/";
|
|
83
|
+
}
|
|
84
|
+
return `/${segments.slice(0, -1).join("/")}`;
|
|
85
|
+
},
|
|
86
|
+
basename(path) {
|
|
87
|
+
const normalized = normalizeWebPath(path);
|
|
88
|
+
if (normalized === "/") {
|
|
89
|
+
return "";
|
|
90
|
+
}
|
|
91
|
+
const segments = getPathSegments(normalized);
|
|
92
|
+
return segments[segments.length - 1] ?? "";
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
function createWebUnderlyingFS(root) {
|
|
49
96
|
return {
|
|
97
|
+
pathOps: WEB_PATH_OPS,
|
|
50
98
|
promises: {
|
|
51
99
|
async readFile(path) {
|
|
52
100
|
const { parentSegments, name } = splitParent(path);
|
|
@@ -126,7 +174,7 @@ function createOPFSUnderlyingFS(root) {
|
|
|
126
174
|
const name = segments[segments.length - 1];
|
|
127
175
|
const exists = await entryExists(parent, name);
|
|
128
176
|
if (exists) {
|
|
129
|
-
throw new Error(`EEXIST: file already exists, mkdir '${
|
|
177
|
+
throw new Error(`EEXIST: file already exists, mkdir '${normalizeWebPath(path)}'`);
|
|
130
178
|
}
|
|
131
179
|
await parent.getDirectoryHandle(name, { create: true });
|
|
132
180
|
},
|
|
@@ -150,9 +198,9 @@ function createOPFSUnderlyingFS(root) {
|
|
|
150
198
|
};
|
|
151
199
|
}
|
|
152
200
|
|
|
153
|
-
class
|
|
201
|
+
class WebFileSystem extends import_real_fs.FileSystem {
|
|
154
202
|
constructor(root, permissions) {
|
|
155
|
-
super("/", permissions,
|
|
203
|
+
super("/", permissions, createWebUnderlyingFS(root));
|
|
156
204
|
}
|
|
157
205
|
}
|
|
158
206
|
function createDirectoryStat() {
|
|
@@ -163,7 +211,7 @@ function createDirectoryStat() {
|
|
|
163
211
|
mtime: DIRECTORY_MTIME
|
|
164
212
|
};
|
|
165
213
|
}
|
|
166
|
-
function
|
|
214
|
+
function normalizeWebPath(path) {
|
|
167
215
|
const normalized = path.replace(/\\/g, "/");
|
|
168
216
|
const rawSegments = (normalized.startsWith("/") ? normalized : `/${normalized}`).split("/").filter(Boolean);
|
|
169
217
|
const segments = [];
|
|
@@ -179,7 +227,7 @@ function normalizeOpfsPath(path) {
|
|
|
179
227
|
return `/${segments.join("/")}`;
|
|
180
228
|
}
|
|
181
229
|
function getPathSegments(path) {
|
|
182
|
-
const normalized =
|
|
230
|
+
const normalized = normalizeWebPath(path);
|
|
183
231
|
return normalized.split("/").filter(Boolean);
|
|
184
232
|
}
|
|
185
233
|
function splitParent(path) {
|
|
@@ -244,4 +292,4 @@ function toWritableData(data) {
|
|
|
244
292
|
return out.buffer;
|
|
245
293
|
}
|
|
246
294
|
|
|
247
|
-
//# debugId=
|
|
295
|
+
//# debugId=63C0A71C805BC57D64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/fs/web-fs.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { FileSystem, type PathOps, type PermissionRules, type UnderlyingFS } from \"./real-fs.cjs\";\n\nconst DIRECTORY_MTIME = new Date(0);\nconst WEB_PATH_OPS: PathOps = {\n separator: \"/\",\n resolve(...paths: string[]): string {\n return normalizeWebPath(paths.join(\"/\"));\n },\n normalize: normalizeWebPath,\n join(...paths: string[]): string {\n const nonEmpty = paths.filter((segment) => segment.length > 0);\n if (nonEmpty.length === 0) {\n return \".\";\n }\n return normalizeWebPath(nonEmpty.join(\"/\"));\n },\n relative(from: string, to: string): string {\n const fromSegments = getPathSegments(from);\n const toSegments = getPathSegments(to);\n let shared = 0;\n\n while (\n shared < fromSegments.length &&\n shared < toSegments.length &&\n fromSegments[shared] === toSegments[shared]\n ) {\n shared++;\n }\n\n const up = new Array(fromSegments.length - shared).fill(\"..\");\n const down = toSegments.slice(shared);\n return [...up, ...down].join(\"/\");\n },\n isAbsolute(path: string): boolean {\n return path.startsWith(\"/\");\n },\n dirname(path: string): string {\n const normalized = normalizeWebPath(path);\n if (normalized === \"/\") {\n return \"/\";\n }\n\n const segments = getPathSegments(normalized);\n if (segments.length <= 1) {\n return \"/\";\n }\n\n return `/${segments.slice(0, -1).join(\"/\")}`;\n },\n basename(path: string): string {\n const normalized = normalizeWebPath(path);\n if (normalized === \"/\") {\n return \"\";\n }\n\n const segments = getPathSegments(normalized);\n return segments[segments.length - 1] ?? \"\";\n },\n};\n\nexport function createWebUnderlyingFS(root: FileSystemDirectoryHandle): UnderlyingFS {\n return {\n pathOps: WEB_PATH_OPS,\n promises: {\n async readFile(path: string): Promise<Buffer> {\n const { parentSegments, name } = splitParent(path);\n const parent = await walkDirectory(root, parentSegments, false);\n const fileHandle = await parent.getFileHandle(name, { create: false });\n const file = await fileHandle.getFile();\n return Buffer.from(await file.arrayBuffer());\n },\n\n async readdir(path: string): Promise<string[]> {\n const dir = await walkDirectory(root, getPathSegments(path), false);\n const entries: string[] = [];\n for await (const [name] of dir.entries()) {\n entries.push(name);\n }\n return entries;\n },\n\n async stat(path: string): Promise<{\n isFile(): boolean;\n isDirectory(): boolean;\n size: number;\n mtime: Date;\n }> {\n const segments = getPathSegments(path);\n\n if (segments.length === 0) {\n return createDirectoryStat();\n }\n\n const { parentSegments, name } = splitParent(path);\n const parent = await walkDirectory(root, parentSegments, false);\n\n try {\n const fileHandle = await parent.getFileHandle(name, { create: false });\n const file = await fileHandle.getFile();\n return {\n isFile: () => true,\n isDirectory: () => false,\n size: file.size,\n mtime: new Date(file.lastModified ?? 0),\n };\n } catch (error) {\n if (!isNotFoundOrTypeMismatch(error)) throw error;\n }\n\n try {\n await parent.getDirectoryHandle(name, { create: false });\n return createDirectoryStat();\n } catch (error) {\n if (!isNotFoundOrTypeMismatch(error)) throw error;\n throw error;\n }\n },\n\n async writeFile(path: string, data: Buffer | string): Promise<void> {\n const { parentSegments, name } = splitParent(path);\n const parent = await walkDirectory(root, parentSegments, false);\n const fileHandle = await parent.getFileHandle(name, { create: true });\n const writable = await fileHandle.createWritable();\n await writable.write(toWritableData(data));\n await writable.close();\n },\n\n async appendFile(path: string, data: Buffer | string): Promise<void> {\n const { parentSegments, name } = splitParent(path);\n const parent = await walkDirectory(root, parentSegments, false);\n const fileHandle = await parent.getFileHandle(name, { create: true });\n const file = await fileHandle.getFile();\n const writable = await fileHandle.createWritable({ keepExistingData: true });\n await writable.write({\n type: \"write\",\n position: file.size,\n data: toWritableData(data),\n });\n await writable.close();\n },\n\n async mkdir(path: string, opts?: { recursive?: boolean }): Promise<void> {\n const segments = getPathSegments(path);\n if (segments.length === 0) {\n return;\n }\n\n if (opts?.recursive) {\n await walkDirectory(root, segments, true);\n return;\n }\n\n const parent = await walkDirectory(root, segments.slice(0, -1), false);\n const name = segments[segments.length - 1]!;\n const exists = await entryExists(parent, name);\n if (exists) {\n throw new Error(`EEXIST: file already exists, mkdir '${normalizeWebPath(path)}'`);\n }\n await parent.getDirectoryHandle(name, { create: true });\n },\n\n async rm(path: string, opts?: { recursive?: boolean; force?: boolean }): Promise<void> {\n const segments = getPathSegments(path);\n if (segments.length === 0) {\n throw new Error(\"EPERM: operation not permitted, rm '/'\");\n }\n\n const parent = await walkDirectory(root, segments.slice(0, -1), false);\n const name = segments[segments.length - 1]!;\n try {\n await parent.removeEntry(name, { recursive: opts?.recursive });\n } catch (error) {\n if (opts?.force && isNotFoundError(error)) {\n return;\n }\n throw error;\n }\n },\n },\n };\n}\n\nexport class WebFileSystem extends FileSystem {\n constructor(root: FileSystemDirectoryHandle, permissions?: PermissionRules) {\n super(\"/\", permissions, createWebUnderlyingFS(root));\n }\n}\n\nfunction createDirectoryStat() {\n return {\n isFile: () => false,\n isDirectory: () => true,\n size: 0,\n mtime: DIRECTORY_MTIME,\n };\n}\n\nfunction normalizeWebPath(path: string): string {\n const normalized = path.replace(/\\\\/g, \"/\");\n const rawSegments = (normalized.startsWith(\"/\") ? normalized : `/${normalized}`)\n .split(\"/\")\n .filter(Boolean);\n\n const segments: string[] = [];\n for (const segment of rawSegments) {\n if (segment === \".\") continue;\n if (segment === \"..\") {\n segments.pop();\n continue;\n }\n segments.push(segment);\n }\n\n return `/${segments.join(\"/\")}`;\n}\n\nfunction getPathSegments(path: string): string[] {\n const normalized = normalizeWebPath(path);\n return normalized.split(\"/\").filter(Boolean);\n}\n\nfunction splitParent(path: string): { parentSegments: string[]; name: string } {\n const segments = getPathSegments(path);\n if (segments.length === 0) {\n throw new Error(`Invalid file path: \"${path}\"`);\n }\n return {\n parentSegments: segments.slice(0, -1),\n name: segments[segments.length - 1]!,\n };\n}\n\nasync function walkDirectory(\n root: FileSystemDirectoryHandle,\n segments: string[],\n create: boolean\n): Promise<FileSystemDirectoryHandle> {\n let current = root;\n for (const segment of segments) {\n current = await current.getDirectoryHandle(segment, { create });\n }\n return current;\n}\n\nasync function entryExists(dir: FileSystemDirectoryHandle, name: string): Promise<boolean> {\n try {\n await dir.getFileHandle(name, { create: false });\n return true;\n } catch (error) {\n if (isTypeMismatchError(error)) return true;\n if (!isNotFoundError(error)) throw error;\n }\n\n try {\n await dir.getDirectoryHandle(name, { create: false });\n return true;\n } catch (error) {\n if (isTypeMismatchError(error)) return true;\n if (!isNotFoundError(error)) throw error;\n return false;\n }\n}\n\nfunction isNotFoundOrTypeMismatch(error: unknown): boolean {\n return isNotFoundError(error) || isTypeMismatchError(error);\n}\n\nfunction isNotFoundError(error: unknown): boolean {\n return getErrorName(error) === \"NotFoundError\";\n}\n\nfunction isTypeMismatchError(error: unknown): boolean {\n return getErrorName(error) === \"TypeMismatchError\";\n}\n\nfunction getErrorName(error: unknown): string | undefined {\n if (!error || typeof error !== \"object\") return undefined;\n const named = error as { name?: unknown };\n return typeof named.name === \"string\" ? named.name : undefined;\n}\n\nfunction toWritableData(data: Buffer | string): string | ArrayBuffer {\n if (typeof data === \"string\") {\n return data;\n }\n const out = new Uint8Array(data.length);\n out.set(data);\n return out.buffer;\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAkF,IAAlF;AAEA,IAAM,kBAAkB,IAAI,KAAK,CAAC;AAClC,IAAM,eAAwB;AAAA,EAC5B,WAAW;AAAA,EACX,OAAO,IAAI,OAAyB;AAAA,IAClC,OAAO,iBAAiB,MAAM,KAAK,GAAG,CAAC;AAAA;AAAA,EAEzC,WAAW;AAAA,EACX,IAAI,IAAI,OAAyB;AAAA,IAC/B,MAAM,WAAW,MAAM,OAAO,CAAC,YAAY,QAAQ,SAAS,CAAC;AAAA,IAC7D,IAAI,SAAS,WAAW,GAAG;AAAA,MACzB,OAAO;AAAA,IACT;AAAA,IACA,OAAO,iBAAiB,SAAS,KAAK,GAAG,CAAC;AAAA;AAAA,EAE5C,QAAQ,CAAC,MAAc,IAAoB;AAAA,IACzC,MAAM,eAAe,gBAAgB,IAAI;AAAA,IACzC,MAAM,aAAa,gBAAgB,EAAE;AAAA,IACrC,IAAI,SAAS;AAAA,IAEb,OACE,SAAS,aAAa,UACtB,SAAS,WAAW,UACpB,aAAa,YAAY,WAAW,SACpC;AAAA,MACA;AAAA,IACF;AAAA,IAEA,MAAM,KAAK,IAAI,MAAM,aAAa,SAAS,MAAM,EAAE,KAAK,IAAI;AAAA,IAC5D,MAAM,OAAO,WAAW,MAAM,MAAM;AAAA,IACpC,OAAO,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,KAAK,GAAG;AAAA;AAAA,EAElC,UA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AO,UAAU;AAAA,IAAU;AAAA,EACzC,MAAM,QAAQ;AAAA,EACd,OAAO,OAAO,MAAM,SAAS,WAAW,MAAM,OAAO;AAAA;AAGvD,SAAS,cAAc,CAAC,MAA6C;AAAA,EACnE,IAAI,OAAO,SAAS,UAAU;AAAA,IAC5B,OAAO;AAAA,EACT;AAAA,EACA,MAAM,MAAM,IAAI,WAAW,KAAK,MAAM;AAAA,EACtC,IAAI,IAAI,IAAI;AAAA,EACZ,OAAO,IAAI;AAAA;",
|
|
8
|
+
"debugId": "63C0A71C805BC57D64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
package/dist/cjs/src/index.cjs
CHANGED
|
@@ -59,15 +59,17 @@ __export(exports_src, {
|
|
|
59
59
|
isCaseNode: () => import_parser2.isCaseNode,
|
|
60
60
|
isArithmeticNode: () => import_parser2.isArithmeticNode,
|
|
61
61
|
isAndNode: () => import_parser2.isAndNode,
|
|
62
|
+
globVirtualFS: () => import_utils.globVirtualFS,
|
|
62
63
|
escapeForInterpolation: () => import_utils.escapeForInterpolation,
|
|
63
64
|
escape: () => import_utils.escape,
|
|
65
|
+
createWebUnderlyingFS: () => import_fs2.createWebUnderlyingFS,
|
|
64
66
|
createVirtualFS: () => import_fs.createVirtualFS,
|
|
65
67
|
createStdout: () => import_io2.createStdout,
|
|
66
68
|
createStdin: () => import_io.createStdin,
|
|
67
69
|
createStderr: () => import_io2.createStderr,
|
|
68
70
|
createShellDSL: () => import_shell_dsl.createShellDSL,
|
|
69
71
|
createPipe: () => import_io2.createPipe,
|
|
70
|
-
|
|
72
|
+
WebFileSystem: () => import_fs2.WebFileSystem,
|
|
71
73
|
StdinImpl: () => import_io.StdinImpl,
|
|
72
74
|
ShellPromise: () => import_shell_promise.ShellPromise,
|
|
73
75
|
ShellError: () => import_errors.ShellError,
|
|
@@ -77,7 +79,6 @@ __export(exports_src, {
|
|
|
77
79
|
Parser: () => import_parser.Parser,
|
|
78
80
|
ParseError: () => import_errors.ParseError,
|
|
79
81
|
OutputCollectorImpl: () => import_io2.OutputCollectorImpl,
|
|
80
|
-
OPFSFileSystem: () => import_fs2.OPFSFileSystem,
|
|
81
82
|
Lexer: () => import_lexer.Lexer,
|
|
82
83
|
LexError: () => import_errors.LexError,
|
|
83
84
|
Interpreter: () => import_interpreter.Interpreter,
|
|
@@ -100,4 +101,4 @@ var import_io = require("./io/index.cjs");
|
|
|
100
101
|
var import_io2 = require("./io/index.cjs");
|
|
101
102
|
var import_utils = require("./utils/index.cjs");
|
|
102
103
|
|
|
103
|
-
//# debugId=
|
|
104
|
+
//# debugId=76B4D83DA9C2C40964756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"// Main class exports\nexport { ShellDSL, createShellDSL, type Program } from \"./shell-dsl.cjs\";\nexport { ShellPromise, type ShellPromiseOptions } from \"./shell-promise.cjs\";\n\n// Types\nexport type {\n VirtualFS,\n FileStat,\n Command,\n CommandContext,\n Stdin,\n Stdout,\n Stderr,\n OutputCollector,\n ExecResult,\n ShellConfig,\n RawValue,\n} from \"./types.cjs\";\nexport { isRawValue } from \"./types.cjs\";\n\n// Errors\nexport { ShellError, LexError, ParseError } from \"./errors.cjs\";\n\n// Lexer\nexport { Lexer, lex, tokenToString } from \"./lexer/index.cjs\";\nexport type { Token, RedirectMode } from \"./lexer/index.cjs\";\n\n// Parser\nexport { Parser, parse } from \"./parser/index.cjs\";\nexport type {\n ASTNode,\n Redirect,\n CommandNode,\n PipelineNode,\n AndNode,\n OrNode,\n SequenceNode,\n LiteralNode,\n VariableNode,\n SubstitutionNode,\n GlobNode,\n ConcatNode,\n IfNode,\n ForNode,\n WhileNode,\n UntilNode,\n CaseNode,\n CaseClause,\n ArithmeticNode,\n} from \"./parser/index.cjs\";\nexport {\n isCommandNode,\n isPipelineNode,\n isAndNode,\n isOrNode,\n isSequenceNode,\n isLiteralNode,\n isVariableNode,\n isSubstitutionNode,\n isGlobNode,\n isConcatNode,\n isIfNode,\n isForNode,\n isWhileNode,\n isUntilNode,\n isCaseNode,\n isArithmeticNode,\n} from \"./parser/index.cjs\";\n\n// Interpreter\nexport { Interpreter, type InterpreterOptions, BreakException, ContinueException } from \"./interpreter/index.cjs\";\n\n// Filesystem\nexport { createVirtualFS } from \"./fs/index.cjs\";\nexport {\n FileSystem,\n ReadOnlyFileSystem,\n
|
|
5
|
+
"// Main class exports\nexport { ShellDSL, createShellDSL, type Program } from \"./shell-dsl.cjs\";\nexport { ShellPromise, type ShellPromiseOptions } from \"./shell-promise.cjs\";\n\n// Types\nexport type {\n VirtualFS,\n FileStat,\n Command,\n CommandContext,\n Stdin,\n Stdout,\n Stderr,\n OutputCollector,\n ExecResult,\n ShellConfig,\n RawValue,\n} from \"./types.cjs\";\nexport { isRawValue } from \"./types.cjs\";\n\n// Errors\nexport { ShellError, LexError, ParseError } from \"./errors.cjs\";\n\n// Lexer\nexport { Lexer, lex, tokenToString } from \"./lexer/index.cjs\";\nexport type { Token, RedirectMode } from \"./lexer/index.cjs\";\n\n// Parser\nexport { Parser, parse } from \"./parser/index.cjs\";\nexport type {\n ASTNode,\n Redirect,\n CommandNode,\n PipelineNode,\n AndNode,\n OrNode,\n SequenceNode,\n LiteralNode,\n VariableNode,\n SubstitutionNode,\n GlobNode,\n ConcatNode,\n IfNode,\n ForNode,\n WhileNode,\n UntilNode,\n CaseNode,\n CaseClause,\n ArithmeticNode,\n} from \"./parser/index.cjs\";\nexport {\n isCommandNode,\n isPipelineNode,\n isAndNode,\n isOrNode,\n isSequenceNode,\n isLiteralNode,\n isVariableNode,\n isSubstitutionNode,\n isGlobNode,\n isConcatNode,\n isIfNode,\n isForNode,\n isWhileNode,\n isUntilNode,\n isCaseNode,\n isArithmeticNode,\n} from \"./parser/index.cjs\";\n\n// Interpreter\nexport { Interpreter, type InterpreterOptions, BreakException, ContinueException } from \"./interpreter/index.cjs\";\n\n// Filesystem\nexport { createVirtualFS } from \"./fs/index.cjs\";\nexport {\n FileSystem,\n ReadOnlyFileSystem,\n WebFileSystem,\n createWebUnderlyingFS,\n type PathOps,\n type Permission,\n type PermissionRules,\n type UnderlyingFS,\n} from \"./fs/index.cjs\";\n\n// I/O\nexport { createStdin, StdinImpl } from \"./io/index.cjs\";\nexport { createStdout, createStderr, createPipe, OutputCollectorImpl, PipeBuffer } from \"./io/index.cjs\";\n\n// Utilities\nexport { escape, escapeForInterpolation, globVirtualFS } from \"./utils/index.cjs\";\nexport type { GlobVirtualFS, GlobOptions } from \"./utils/index.cjs\";\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACuD,IAAvD;AACuD,IAAvD;AAgB2B,IAA3B;AAGiD,IAAjD;AAG0C,IAA1C;AAI8B,IAA9B;AAuCO,IAjBP;AAoBwF,IAAxF;AAGgC,IAAhC;AAUO,IATP;AAYuC,IAAvC;AACwF,IAAxF;AAG8D,IAA9D;",
|
|
8
|
+
"debugId": "76B4D83DA9C2C40964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
8
|
+
var __toCommonJS = (from) => {
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
10
|
+
if (entry)
|
|
11
|
+
return entry;
|
|
12
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
__moduleCache.set(from, entry);
|
|
22
|
+
return entry;
|
|
23
|
+
};
|
|
24
|
+
var __moduleCache;
|
|
25
|
+
var __returnValue = (v) => v;
|
|
26
|
+
function __exportSetter(name, newValue) {
|
|
27
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
28
|
+
}
|
|
29
|
+
var __export = (target, all) => {
|
|
30
|
+
for (var name in all)
|
|
31
|
+
__defProp(target, name, {
|
|
32
|
+
get: all[name],
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
set: __exportSetter.bind(all, name)
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/utils/glob.ts
|
|
40
|
+
var exports_glob = {};
|
|
41
|
+
__export(exports_glob, {
|
|
42
|
+
globVirtualFS: () => globVirtualFS
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(exports_glob);
|
|
45
|
+
var import_match_glob = require("./match-glob.cjs");
|
|
46
|
+
async function globVirtualFS(fs, pattern, opts) {
|
|
47
|
+
const cwd = fs.resolve(opts?.cwd ?? "/");
|
|
48
|
+
const patterns = expandBraces(pattern);
|
|
49
|
+
const allMatches = [];
|
|
50
|
+
for (const expandedPattern of patterns) {
|
|
51
|
+
const matches = await matchPattern(fs, expandedPattern, cwd);
|
|
52
|
+
allMatches.push(...matches);
|
|
53
|
+
}
|
|
54
|
+
return [...new Set(allMatches)].sort();
|
|
55
|
+
}
|
|
56
|
+
function expandBraces(pattern) {
|
|
57
|
+
const braceMatch = pattern.match(/\{([^{}]+)\}/);
|
|
58
|
+
if (!braceMatch)
|
|
59
|
+
return [pattern];
|
|
60
|
+
const before = pattern.slice(0, braceMatch.index);
|
|
61
|
+
const after = pattern.slice(braceMatch.index + braceMatch[0].length);
|
|
62
|
+
const options = braceMatch[1].split(",");
|
|
63
|
+
const results = [];
|
|
64
|
+
for (const option of options) {
|
|
65
|
+
results.push(...expandBraces(before + option + after));
|
|
66
|
+
}
|
|
67
|
+
return results;
|
|
68
|
+
}
|
|
69
|
+
async function matchPattern(fs, pattern, cwd) {
|
|
70
|
+
const parts = pattern.split("/").filter(Boolean);
|
|
71
|
+
const startDir = pattern.startsWith("/") ? "/" : cwd;
|
|
72
|
+
return matchParts(fs, parts, startDir);
|
|
73
|
+
}
|
|
74
|
+
async function matchParts(fs, parts, currentPath) {
|
|
75
|
+
if (parts.length === 0) {
|
|
76
|
+
return await pathExists(fs, currentPath) ? [currentPath] : [];
|
|
77
|
+
}
|
|
78
|
+
const [part, ...rest] = parts;
|
|
79
|
+
if (part === "**") {
|
|
80
|
+
const results = await matchParts(fs, rest, currentPath);
|
|
81
|
+
try {
|
|
82
|
+
const entries = await fs.readdir(currentPath);
|
|
83
|
+
for (const entry of entries) {
|
|
84
|
+
const entryPath = fs.resolve(currentPath, entry);
|
|
85
|
+
try {
|
|
86
|
+
const stat = await fs.stat(entryPath);
|
|
87
|
+
if (stat.isDirectory()) {
|
|
88
|
+
results.push(...await matchParts(fs, parts, entryPath));
|
|
89
|
+
}
|
|
90
|
+
} catch {}
|
|
91
|
+
}
|
|
92
|
+
} catch {}
|
|
93
|
+
return results;
|
|
94
|
+
}
|
|
95
|
+
try {
|
|
96
|
+
const entries = await fs.readdir(currentPath);
|
|
97
|
+
const results = [];
|
|
98
|
+
for (const entry of entries) {
|
|
99
|
+
if (!import_match_glob.matchGlob(part, entry))
|
|
100
|
+
continue;
|
|
101
|
+
const entryPath = fs.resolve(currentPath, entry);
|
|
102
|
+
if (rest.length === 0) {
|
|
103
|
+
if (await pathExists(fs, entryPath)) {
|
|
104
|
+
results.push(entryPath);
|
|
105
|
+
}
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
try {
|
|
109
|
+
const stat = await fs.stat(entryPath);
|
|
110
|
+
if (stat.isDirectory()) {
|
|
111
|
+
results.push(...await matchParts(fs, rest, entryPath));
|
|
112
|
+
}
|
|
113
|
+
} catch {}
|
|
114
|
+
}
|
|
115
|
+
return results;
|
|
116
|
+
} catch {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function pathExists(fs, filePath) {
|
|
121
|
+
try {
|
|
122
|
+
await fs.stat(filePath);
|
|
123
|
+
return true;
|
|
124
|
+
} catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
//# debugId=090DEA543EF7491E64756E2164756E21
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/utils/glob.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { VirtualFS } from \"../types.cjs\";\nimport { matchGlob } from \"./match-glob.cjs\";\n\nexport type GlobVirtualFS = Pick<VirtualFS, \"readdir\" | \"stat\" | \"resolve\">;\n\nexport interface GlobOptions {\n cwd?: string;\n}\n\nexport async function globVirtualFS(fs: GlobVirtualFS, pattern: string, opts?: GlobOptions): Promise<string[]> {\n const cwd = fs.resolve(opts?.cwd ?? \"/\");\n const patterns = expandBraces(pattern);\n const allMatches: string[] = [];\n\n for (const expandedPattern of patterns) {\n const matches = await matchPattern(fs, expandedPattern, cwd);\n allMatches.push(...matches);\n }\n\n return [...new Set(allMatches)].sort();\n}\n\nfunction expandBraces(pattern: string): string[] {\n const braceMatch = pattern.match(/\\{([^{}]+)\\}/);\n if (!braceMatch) return [pattern];\n\n const before = pattern.slice(0, braceMatch.index);\n const after = pattern.slice(braceMatch.index! + braceMatch[0].length);\n const options = braceMatch[1]!.split(\",\");\n const results: string[] = [];\n\n for (const option of options) {\n results.push(...expandBraces(before + option + after));\n }\n\n return results;\n}\n\nasync function matchPattern(fs: GlobVirtualFS, pattern: string, cwd: string): Promise<string[]> {\n const parts = pattern.split(\"/\").filter(Boolean);\n const startDir = pattern.startsWith(\"/\") ? \"/\" : cwd;\n return matchParts(fs, parts, startDir);\n}\n\nasync function matchParts(fs: GlobVirtualFS, parts: string[], currentPath: string): Promise<string[]> {\n if (parts.length === 0) {\n return (await pathExists(fs, currentPath)) ? [currentPath] : [];\n }\n\n const [part, ...rest] = parts;\n\n if (part === \"**\") {\n const results = await matchParts(fs, rest, currentPath);\n\n try {\n const entries = await fs.readdir(currentPath);\n for (const entry of entries) {\n const entryPath = fs.resolve(currentPath, entry);\n try {\n const stat = await fs.stat(entryPath);\n if (stat.isDirectory()) {\n results.push(...(await matchParts(fs, parts, entryPath)));\n }\n } catch {\n // Skip entries we can't stat.\n }\n }\n } catch {\n // Directory not readable.\n }\n\n return results;\n }\n\n try {\n const entries = await fs.readdir(currentPath);\n const results: string[] = [];\n\n for (const entry of entries) {\n if (!matchGlob(part!, entry)) continue;\n\n const entryPath = fs.resolve(currentPath, entry);\n\n if (rest.length === 0) {\n if (await pathExists(fs, entryPath)) {\n results.push(entryPath);\n }\n continue;\n }\n\n try {\n const stat = await fs.stat(entryPath);\n if (stat.isDirectory()) {\n results.push(...(await matchParts(fs, rest, entryPath)));\n }\n } catch {\n // Skip entries we can't stat.\n }\n }\n\n return results;\n } catch {\n return [];\n }\n}\n\nasync function pathExists(fs: GlobVirtualFS, filePath: string): Promise<boolean> {\n try {\n await fs.stat(filePath);\n return true;\n } catch {\n return false;\n }\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAC0B,IAA1B;AAQA,eAAsB,aAAa,CAAC,IAAmB,SAAiB,MAAuC;AAAA,EAC7G,MAAM,MAAM,GAAG,QAAQ,MAAM,OAA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IACN,OAAO;AAAA;AAAA;",
|
|
8
|
+
"debugId": "090DEA543EF7491E64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -40,6 +40,7 @@ var __export = (target, all) => {
|
|
|
40
40
|
var exports_utils = {};
|
|
41
41
|
__export(exports_utils, {
|
|
42
42
|
matchGlob: () => import_match_glob.matchGlob,
|
|
43
|
+
globVirtualFS: () => import_glob.globVirtualFS,
|
|
43
44
|
expandEscapes: () => import_expand_escapes.expandEscapes,
|
|
44
45
|
escapeForInterpolation: () => import_escape.escapeForInterpolation,
|
|
45
46
|
escape: () => import_escape.escape,
|
|
@@ -48,7 +49,8 @@ __export(exports_utils, {
|
|
|
48
49
|
module.exports = __toCommonJS(exports_utils);
|
|
49
50
|
var import_escape = require("./escape.cjs");
|
|
50
51
|
var import_expand_escapes = require("./expand-escapes.cjs");
|
|
52
|
+
var import_glob = require("./glob.cjs");
|
|
51
53
|
var import_flag_parser = require("./flag-parser.cjs");
|
|
52
54
|
var import_match_glob = require("./match-glob.cjs");
|
|
53
55
|
|
|
54
|
-
//# debugId=
|
|
56
|
+
//# debugId=4731049858D6D56664756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/utils/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"export { escape, escapeForInterpolation } from \"./escape.cjs\";\nexport { expandEscapes } from \"./expand-escapes.cjs\";\nexport {\n createFlagParser,\n type FlagDefinition,\n type CommandSpec,\n type FlagError,\n type ParseResult,\n type FlagParser,\n} from \"./flag-parser.cjs\";\nexport { matchGlob } from \"./match-glob.cjs\";\n"
|
|
5
|
+
"export { escape, escapeForInterpolation } from \"./escape.cjs\";\nexport { expandEscapes } from \"./expand-escapes.cjs\";\nexport { globVirtualFS, type GlobVirtualFS, type GlobOptions } from \"./glob.cjs\";\nexport {\n createFlagParser,\n type FlagDefinition,\n type CommandSpec,\n type FlagError,\n type ParseResult,\n type FlagParser,\n} from \"./flag-parser.cjs\";\nexport { matchGlob } from \"./match-glob.cjs\";\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": "
|
|
8
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAA+C,IAA/C;AAC8B,IAA9B;AACoE,IAApE;AAQO,IAPP;AAQ0B,IAA1B;",
|
|
8
|
+
"debugId": "4731049858D6D56664756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/dist/mjs/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { createVirtualFS } from "./memfs-adapter.mjs";
|
|
3
3
|
import { FileSystem } from "./real-fs.mjs";
|
|
4
4
|
import { ReadOnlyFileSystem } from "./readonly-fs.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { WebFileSystem, createWebUnderlyingFS } from "./web-fs.mjs";
|
|
6
6
|
export {
|
|
7
|
+
createWebUnderlyingFS,
|
|
7
8
|
createVirtualFS,
|
|
8
|
-
|
|
9
|
+
WebFileSystem,
|
|
9
10
|
ReadOnlyFileSystem,
|
|
10
|
-
OPFSFileSystem,
|
|
11
11
|
FileSystem
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//# debugId=
|
|
14
|
+
//# debugId=48608B4B3C7BEB9864756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/fs/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"export { createVirtualFS } from \"./memfs-adapter.mjs\";\nexport { FileSystem, type Permission, type PermissionRules, type UnderlyingFS } from \"./real-fs.mjs\";\nexport { ReadOnlyFileSystem } from \"./readonly-fs.mjs\";\nexport {
|
|
5
|
+
"export { createVirtualFS } from \"./memfs-adapter.mjs\";\nexport { FileSystem, type PathOps, type Permission, type PermissionRules, type UnderlyingFS } from \"./real-fs.mjs\";\nexport { ReadOnlyFileSystem } from \"./readonly-fs.mjs\";\nexport { WebFileSystem, createWebUnderlyingFS } from \"./web-fs.mjs\";\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAAA;AACA;AACA;AACA;",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "48608B4B3C7BEB9864756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/fs/memfs-adapter.ts
|
|
2
2
|
import * as pathModule from "path";
|
|
3
|
+
import { globVirtualFS } from "../utils/glob.mjs";
|
|
3
4
|
function createVirtualFS(memfs) {
|
|
4
5
|
const { promises: fs } = memfs;
|
|
5
6
|
return {
|
|
@@ -64,118 +65,16 @@ function createVirtualFS(memfs) {
|
|
|
64
65
|
},
|
|
65
66
|
async glob(pattern, opts) {
|
|
66
67
|
const cwd = opts?.cwd ?? "/";
|
|
67
|
-
return
|
|
68
|
+
return globVirtualFS({
|
|
69
|
+
readdir: (filePath) => this.readdir(filePath),
|
|
70
|
+
stat: (filePath) => this.stat(filePath),
|
|
71
|
+
resolve: (...paths) => this.resolve(...paths)
|
|
72
|
+
}, pattern, { cwd });
|
|
68
73
|
}
|
|
69
74
|
};
|
|
70
75
|
}
|
|
71
|
-
async function expandGlob(memfs, pattern, cwd) {
|
|
72
|
-
const { promises: fs } = memfs;
|
|
73
|
-
const patterns = expandBraces(pattern);
|
|
74
|
-
const allMatches = [];
|
|
75
|
-
for (const pat of patterns) {
|
|
76
|
-
const matches = await matchPattern(fs, pat, cwd);
|
|
77
|
-
allMatches.push(...matches);
|
|
78
|
-
}
|
|
79
|
-
return [...new Set(allMatches)].sort();
|
|
80
|
-
}
|
|
81
|
-
function expandBraces(pattern) {
|
|
82
|
-
const braceMatch = pattern.match(/\{([^{}]+)\}/);
|
|
83
|
-
if (!braceMatch)
|
|
84
|
-
return [pattern];
|
|
85
|
-
const before = pattern.slice(0, braceMatch.index);
|
|
86
|
-
const after = pattern.slice(braceMatch.index + braceMatch[0].length);
|
|
87
|
-
const options = braceMatch[1].split(",");
|
|
88
|
-
const results = [];
|
|
89
|
-
for (const opt of options) {
|
|
90
|
-
const expanded = expandBraces(before + opt + after);
|
|
91
|
-
results.push(...expanded);
|
|
92
|
-
}
|
|
93
|
-
return results;
|
|
94
|
-
}
|
|
95
|
-
async function matchPattern(fs, pattern, cwd) {
|
|
96
|
-
const parts = pattern.split("/").filter((p) => p !== "");
|
|
97
|
-
const isAbsolute = pattern.startsWith("/");
|
|
98
|
-
const startDir = isAbsolute ? "/" : cwd;
|
|
99
|
-
return matchParts(fs, parts, startDir, isAbsolute);
|
|
100
|
-
}
|
|
101
|
-
async function matchParts(fs, parts, currentPath, isAbsolute) {
|
|
102
|
-
if (parts.length === 0) {
|
|
103
|
-
return [currentPath];
|
|
104
|
-
}
|
|
105
|
-
const [part, ...rest] = parts;
|
|
106
|
-
if (part === "**") {
|
|
107
|
-
const results = [];
|
|
108
|
-
const withoutStar = await matchParts(fs, rest, currentPath, isAbsolute);
|
|
109
|
-
results.push(...withoutStar);
|
|
110
|
-
try {
|
|
111
|
-
const entries = await fs.readdir(currentPath);
|
|
112
|
-
for (const entry of entries) {
|
|
113
|
-
const entryPath = pathModule.join(currentPath, String(entry));
|
|
114
|
-
try {
|
|
115
|
-
const stat = await fs.stat(entryPath);
|
|
116
|
-
if (stat.isDirectory()) {
|
|
117
|
-
const subMatches = await matchParts(fs, parts, entryPath, isAbsolute);
|
|
118
|
-
results.push(...subMatches);
|
|
119
|
-
}
|
|
120
|
-
} catch {}
|
|
121
|
-
}
|
|
122
|
-
} catch {}
|
|
123
|
-
return results;
|
|
124
|
-
}
|
|
125
|
-
const regex = globToRegex(part);
|
|
126
|
-
try {
|
|
127
|
-
const entries = await fs.readdir(currentPath);
|
|
128
|
-
const results = [];
|
|
129
|
-
for (const entry of entries) {
|
|
130
|
-
const entryName = String(entry);
|
|
131
|
-
if (regex.test(entryName)) {
|
|
132
|
-
const entryPath = pathModule.join(currentPath, entryName);
|
|
133
|
-
if (rest.length === 0) {
|
|
134
|
-
results.push(entryPath);
|
|
135
|
-
} else {
|
|
136
|
-
try {
|
|
137
|
-
const stat = await fs.stat(entryPath);
|
|
138
|
-
if (stat.isDirectory()) {
|
|
139
|
-
const subMatches = await matchParts(fs, rest, entryPath, isAbsolute);
|
|
140
|
-
results.push(...subMatches);
|
|
141
|
-
}
|
|
142
|
-
} catch {}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return results;
|
|
147
|
-
} catch {
|
|
148
|
-
return [];
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
function globToRegex(pattern) {
|
|
152
|
-
let regex = "^";
|
|
153
|
-
for (let i = 0;i < pattern.length; i++) {
|
|
154
|
-
const char = pattern[i];
|
|
155
|
-
if (char === "*") {
|
|
156
|
-
regex += "[^/]*";
|
|
157
|
-
} else if (char === "?") {
|
|
158
|
-
regex += "[^/]";
|
|
159
|
-
} else if (char === "[") {
|
|
160
|
-
let j = i + 1;
|
|
161
|
-
let classContent = "";
|
|
162
|
-
while (j < pattern.length && pattern[j] !== "]") {
|
|
163
|
-
classContent += pattern[j];
|
|
164
|
-
j++;
|
|
165
|
-
}
|
|
166
|
-
regex += `[${classContent}]`;
|
|
167
|
-
i = j;
|
|
168
|
-
} else if (".+^${}()|\\".includes(char)) {
|
|
169
|
-
regex += "\\" + char;
|
|
170
|
-
} else {
|
|
171
|
-
regex += char;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
regex += "$";
|
|
175
|
-
return new RegExp(regex);
|
|
176
|
-
}
|
|
177
76
|
export {
|
|
178
77
|
createVirtualFS
|
|
179
78
|
};
|
|
180
79
|
|
|
181
|
-
//# debugId=
|
|
80
|
+
//# debugId=EAE27F968F9F56F664756E2164756E21
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/fs/memfs-adapter.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { IFs } from \"memfs\";\nimport type { VirtualFS, FileStat } from \"../types.mjs\";\nimport * as pathModule from \"path\";\n\nexport function createVirtualFS(memfs: IFs): VirtualFS {\n const { promises: fs } = memfs;\n\n return {\n readFile: (async (path: string, encoding?: BufferEncoding): Promise<Buffer | string> => {\n if (path === \"/dev/null\") return encoding ? \"\" : Buffer.alloc(0);\n const content = await fs.readFile(path);\n const buf = Buffer.from(content);\n return encoding ? buf.toString(encoding) : buf;\n }) as VirtualFS[\"readFile\"],\n\n async readdir(path: string): Promise<string[]> {\n const entries = await fs.readdir(path);\n return entries.map(String);\n },\n\n async stat(path: string): Promise<FileStat> {\n const stats = await fs.stat(path);\n return {\n isFile: () => stats.isFile(),\n isDirectory: () => stats.isDirectory(),\n size: Number(stats.size),\n mtime: new Date(stats.mtime),\n };\n },\n\n async exists(path: string): Promise<boolean> {\n try {\n await fs.stat(path);\n return true;\n } catch {\n return false;\n }\n },\n\n async writeFile(path: string, data: Buffer | string): Promise<void> {\n await fs.writeFile(path, data);\n },\n\n async appendFile(path: string, data: Buffer | string): Promise<void> {\n await fs.appendFile(path, data);\n },\n\n async mkdir(path: string, opts?: { recursive?: boolean }): Promise<void> {\n await fs.mkdir(path, opts);\n },\n\n async rm(path: string, opts?: { recursive?: boolean; force?: boolean }): Promise<void> {\n try {\n const stats = await fs.stat(path);\n if (stats.isDirectory()) {\n await fs.rmdir(path, { recursive: opts?.recursive });\n } else {\n await fs.unlink(path);\n }\n } catch (err) {\n if (!opts?.force) throw err;\n }\n },\n\n resolve(...paths: string[]): string {\n return pathModule.resolve(...paths);\n },\n\n dirname(path: string): string {\n return pathModule.dirname(path);\n },\n\n basename(path: string): string {\n return pathModule.basename(path);\n },\n\n async glob(pattern: string, opts?: { cwd?: string }): Promise<string[]> {\n const cwd = opts?.cwd ?? \"/\";\n return
|
|
5
|
+
"import type { IFs } from \"memfs\";\nimport type { VirtualFS, FileStat } from \"../types.mjs\";\nimport * as pathModule from \"path\";\nimport { globVirtualFS } from \"../utils/glob.mjs\";\n\nexport function createVirtualFS(memfs: IFs): VirtualFS {\n const { promises: fs } = memfs;\n\n return {\n readFile: (async (path: string, encoding?: BufferEncoding): Promise<Buffer | string> => {\n if (path === \"/dev/null\") return encoding ? \"\" : Buffer.alloc(0);\n const content = await fs.readFile(path);\n const buf = Buffer.from(content);\n return encoding ? buf.toString(encoding) : buf;\n }) as VirtualFS[\"readFile\"],\n\n async readdir(path: string): Promise<string[]> {\n const entries = await fs.readdir(path);\n return entries.map(String);\n },\n\n async stat(path: string): Promise<FileStat> {\n const stats = await fs.stat(path);\n return {\n isFile: () => stats.isFile(),\n isDirectory: () => stats.isDirectory(),\n size: Number(stats.size),\n mtime: new Date(stats.mtime),\n };\n },\n\n async exists(path: string): Promise<boolean> {\n try {\n await fs.stat(path);\n return true;\n } catch {\n return false;\n }\n },\n\n async writeFile(path: string, data: Buffer | string): Promise<void> {\n await fs.writeFile(path, data);\n },\n\n async appendFile(path: string, data: Buffer | string): Promise<void> {\n await fs.appendFile(path, data);\n },\n\n async mkdir(path: string, opts?: { recursive?: boolean }): Promise<void> {\n await fs.mkdir(path, opts);\n },\n\n async rm(path: string, opts?: { recursive?: boolean; force?: boolean }): Promise<void> {\n try {\n const stats = await fs.stat(path);\n if (stats.isDirectory()) {\n await fs.rmdir(path, { recursive: opts?.recursive });\n } else {\n await fs.unlink(path);\n }\n } catch (err) {\n if (!opts?.force) throw err;\n }\n },\n\n resolve(...paths: string[]): string {\n return pathModule.resolve(...paths);\n },\n\n dirname(path: string): string {\n return pathModule.dirname(path);\n },\n\n basename(path: string): string {\n return pathModule.basename(path);\n },\n\n async glob(pattern: string, opts?: { cwd?: string }): Promise<string[]> {\n const cwd = opts?.cwd ?? \"/\";\n return globVirtualFS(\n {\n readdir: (filePath: string) => this.readdir(filePath),\n stat: (filePath: string) => this.stat(filePath),\n resolve: (...paths: string[]) => this.resolve(...paths),\n },\n pattern,\n { c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