typescript-virtual-container 1.5.5 → 1.5.7

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.
Files changed (64) hide show
  1. package/README.md +117 -35
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/SSHMimic/index.d.ts +5 -1
  4. package/dist/SSHMimic/index.js +27 -3
  5. package/dist/SSHMimic/scp.d.ts +34 -0
  6. package/dist/SSHMimic/scp.js +285 -0
  7. package/dist/SSHMimic/sftp.d.ts +53 -3
  8. package/dist/SSHMimic/sftp.js +9 -3
  9. package/dist/VirtualFileSystem/binaryPack.d.ts +7 -0
  10. package/dist/VirtualFileSystem/binaryPack.js +37 -1
  11. package/dist/VirtualFileSystem/index.d.ts +7 -0
  12. package/dist/VirtualFileSystem/index.js +67 -27
  13. package/dist/VirtualFileSystem/internalTypes.d.ts +2 -0
  14. package/dist/VirtualFileSystem/path.d.ts +5 -0
  15. package/dist/VirtualFileSystem/path.js +24 -11
  16. package/dist/VirtualPackageManager/index.d.ts +4 -2
  17. package/dist/VirtualPackageManager/index.js +24 -4
  18. package/dist/VirtualShell/index.d.ts +4 -0
  19. package/dist/VirtualShell/index.js +1 -7
  20. package/dist/VirtualShell/shell.js +40 -10
  21. package/dist/VirtualShell/shellParser.js +1 -22
  22. package/dist/commands/awk.d.ts +6 -11
  23. package/dist/commands/awk.js +462 -109
  24. package/dist/commands/bzip2.d.ts +11 -0
  25. package/dist/commands/bzip2.js +91 -0
  26. package/dist/commands/exit.js +1 -1
  27. package/dist/commands/find.d.ts +2 -2
  28. package/dist/commands/find.js +209 -37
  29. package/dist/commands/helpers.d.ts +0 -20
  30. package/dist/commands/helpers.js +0 -97
  31. package/dist/commands/lsof.d.ts +6 -0
  32. package/dist/commands/lsof.js +30 -0
  33. package/dist/commands/perl.d.ts +6 -0
  34. package/dist/commands/perl.js +76 -0
  35. package/dist/commands/python.js +5 -2
  36. package/dist/commands/registry.js +19 -1
  37. package/dist/commands/runtime.js +65 -87
  38. package/dist/commands/sed.d.ts +2 -2
  39. package/dist/commands/sed.js +216 -34
  40. package/dist/commands/sh.js +42 -0
  41. package/dist/commands/strace.d.ts +6 -0
  42. package/dist/commands/strace.js +26 -0
  43. package/dist/commands/tar.d.ts +2 -1
  44. package/dist/commands/tar.js +138 -52
  45. package/dist/commands/test.js +2 -2
  46. package/dist/commands/zip.d.ts +11 -0
  47. package/dist/commands/zip.js +232 -0
  48. package/dist/modules/linuxRootfs.js +1 -4
  49. package/dist/modules/neofetch.js +2 -2
  50. package/dist/types/commands.d.ts +4 -0
  51. package/dist/utils/argv.d.ts +6 -0
  52. package/dist/utils/argv.js +32 -0
  53. package/dist/utils/expand.d.ts +5 -2
  54. package/dist/utils/expand.js +112 -45
  55. package/dist/utils/glob.d.ts +6 -0
  56. package/dist/utils/glob.js +34 -0
  57. package/dist/utils/tokenize.js +13 -13
  58. package/package.json +9 -7
  59. package/dist/self-standalone.d.ts +0 -1
  60. package/dist/self-standalone.js +0 -444
  61. package/dist/standalone-wo-sftp.d.ts +0 -1
  62. package/dist/standalone-wo-sftp.js +0 -30
  63. package/dist/standalone.d.ts +0 -1
  64. package/dist/standalone.js +0 -61
@@ -1,3 +1,4 @@
1
+ import { globToRegex } from "../utils/glob";
1
2
  import { tokenizeCommand } from "../utils/tokenize";
2
3
  // ── Public API ───────────────────────────────────────────────────────────────
3
4
  /**
@@ -42,28 +43,6 @@ export function expandGlob(pattern, entries) {
42
43
  const matches = entries.filter((e) => regex.test(e));
43
44
  return matches.length > 0 ? matches.sort() : [pattern];
44
45
  }
45
- function globToRegex(pattern) {
46
- let re = "^";
47
- for (let i = 0; i < pattern.length; i++) {
48
- const c = pattern[i];
49
- if (c === "*")
50
- re += ".*";
51
- else if (c === "?")
52
- re += ".";
53
- else if (c === "[") {
54
- const close = pattern.indexOf("]", i + 1);
55
- if (close === -1)
56
- re += "\\[";
57
- else {
58
- re += `[${pattern.slice(i + 1, close)}]`;
59
- i = close;
60
- }
61
- }
62
- else
63
- re += c.replace(/[.+^${}()|[\]\\]/g, "\\$&");
64
- }
65
- return new RegExp(`${re}$`);
66
- }
67
46
  // ── Internal parser ───────────────────────────────────────────────────────────
68
47
  function parseStatements(input) {
69
48
  // Split by ;, &&, || — respecting quotes and parens
@@ -1,15 +1,10 @@
1
+ /** biome-ignore-all lint/style/useNamingConvention: AWK vars (NR, NF, FS, OFS, ORS) are spec names */
1
2
  import type { ShellModule } from "../types/commands";
2
3
  /**
3
- * Minimal awk-like pattern scanner.
4
- *
5
- * Supported:
6
- * - `NR==N` pattern (line number condition)
7
- * - `NF` (number of fields)
8
- * - `/regex/` pattern
9
- * - `{ print $N, $M, ... }` action
10
- * - `{ print }` / `{ print $0 }`
11
- * - `BEGIN { ... }` and `END { ... }` blocks (no side effects)
12
- * - `$NF` (last field)
13
- * - `-F sep` field separator
4
+ * AWK pattern scanning — supports BEGIN/END, /regex/, NR/NF conditions, field ops,
5
+ * variable assignment (-v), arithmetic, string functions (sub/gsub/substr/split/length/index/sprintf/tolower/toupper/match),
6
+ * printf, getline (from stdin), next, and multi-statement blocks.
7
+ * @category text
8
+ * @params ["[-F sep] [-v var=val] '<program>' [file]"]
14
9
  */
15
10
  export declare const awkCommand: ShellModule;