typescript-virtual-container 1.4.0 → 1.4.1

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 (102) hide show
  1. package/builds/self-standalone.js +184 -300
  2. package/builds/self-standalone.js.map +3 -3
  3. package/builds/standalone-wo-sftp.js +155 -271
  4. package/builds/standalone-wo-sftp.js.map +3 -3
  5. package/builds/standalone.js +149 -265
  6. package/builds/standalone.js.map +3 -3
  7. package/dist/VirtualPackageManager/index.d.ts.map +1 -1
  8. package/dist/VirtualPackageManager/index.js +29 -1
  9. package/dist/commands/curl.d.ts.map +1 -1
  10. package/dist/commands/curl.js +2 -1
  11. package/dist/commands/gzip.d.ts.map +1 -1
  12. package/dist/commands/gzip.js +6 -0
  13. package/dist/commands/man.d.ts.map +1 -1
  14. package/dist/commands/man.js +30 -136
  15. package/dist/commands/neofetch.d.ts.map +1 -1
  16. package/dist/commands/neofetch.js +6 -0
  17. package/dist/commands/wget.d.ts.map +1 -1
  18. package/dist/commands/wget.js +11 -1
  19. package/package.json +2 -2
  20. package/src/VirtualPackageManager/index.ts +29 -1
  21. package/src/commands/curl.ts +2 -1
  22. package/src/commands/gzip.ts +7 -0
  23. package/src/commands/man.ts +38 -143
  24. package/src/commands/manuals/adduser.txt +11 -0
  25. package/src/commands/manuals/apt-cache.txt +12 -0
  26. package/src/commands/manuals/apt.txt +20 -0
  27. package/src/commands/manuals/awk.txt +13 -0
  28. package/src/commands/manuals/cat.txt +14 -0
  29. package/src/commands/manuals/cd.txt +16 -0
  30. package/src/commands/manuals/chmod.txt +16 -0
  31. package/src/commands/manuals/clear.txt +10 -0
  32. package/src/commands/manuals/cp.txt +10 -0
  33. package/src/commands/manuals/curl.txt +20 -0
  34. package/src/commands/manuals/date.txt +14 -0
  35. package/src/commands/manuals/declare.txt +12 -0
  36. package/src/commands/manuals/deluser.txt +10 -0
  37. package/src/commands/manuals/df.txt +10 -0
  38. package/src/commands/manuals/dpkg-query.txt +11 -0
  39. package/src/commands/manuals/dpkg.txt +14 -0
  40. package/src/commands/manuals/du.txt +11 -0
  41. package/src/commands/manuals/echo.txt +11 -0
  42. package/src/commands/manuals/false.txt +10 -0
  43. package/src/commands/manuals/find.txt +11 -0
  44. package/src/commands/manuals/free.txt +12 -0
  45. package/src/commands/manuals/grep.txt +13 -0
  46. package/src/commands/manuals/groups.txt +10 -0
  47. package/src/commands/manuals/gzip.txt +11 -0
  48. package/src/commands/manuals/head.txt +10 -0
  49. package/src/commands/manuals/help.txt +11 -0
  50. package/src/commands/manuals/history.txt +11 -0
  51. package/src/commands/manuals/hostname.txt +10 -0
  52. package/src/commands/manuals/id.txt +10 -0
  53. package/src/commands/manuals/kill.txt +13 -0
  54. package/src/commands/manuals/ls.txt +20 -0
  55. package/src/commands/manuals/lsb_release.txt +14 -0
  56. package/src/commands/manuals/mkdir.txt +10 -0
  57. package/src/commands/manuals/mv.txt +10 -0
  58. package/src/commands/manuals/nano.txt +11 -0
  59. package/src/commands/manuals/neofetch.txt +10 -0
  60. package/src/commands/manuals/node.txt +13 -0
  61. package/src/commands/manuals/npm.txt +13 -0
  62. package/src/commands/manuals/npx.txt +13 -0
  63. package/src/commands/manuals/passwd.txt +11 -0
  64. package/src/commands/manuals/ping.txt +10 -0
  65. package/src/commands/manuals/printf.txt +11 -0
  66. package/src/commands/manuals/ps.txt +10 -0
  67. package/src/commands/manuals/pwd.txt +10 -0
  68. package/src/commands/manuals/python3.txt +13 -0
  69. package/src/commands/manuals/readlink.txt +10 -0
  70. package/src/commands/manuals/return.txt +10 -0
  71. package/src/commands/manuals/rm.txt +10 -0
  72. package/src/commands/manuals/sed.txt +11 -0
  73. package/src/commands/manuals/set.txt +11 -0
  74. package/src/commands/manuals/shift.txt +10 -0
  75. package/src/commands/manuals/sleep.txt +10 -0
  76. package/src/commands/manuals/sort.txt +12 -0
  77. package/src/commands/manuals/source.txt +11 -0
  78. package/src/commands/manuals/ssh.txt +11 -0
  79. package/src/commands/manuals/stat.txt +10 -0
  80. package/src/commands/manuals/su.txt +13 -0
  81. package/src/commands/manuals/sudo.txt +11 -0
  82. package/src/commands/manuals/tail.txt +10 -0
  83. package/src/commands/manuals/tar.txt +19 -0
  84. package/src/commands/manuals/tee.txt +10 -0
  85. package/src/commands/manuals/test.txt +11 -0
  86. package/src/commands/manuals/touch.txt +11 -0
  87. package/src/commands/manuals/tr.txt +10 -0
  88. package/src/commands/manuals/trap.txt +10 -0
  89. package/src/commands/manuals/true.txt +10 -0
  90. package/src/commands/manuals/type.txt +10 -0
  91. package/src/commands/manuals/uname.txt +12 -0
  92. package/src/commands/manuals/uniq.txt +12 -0
  93. package/src/commands/manuals/unset.txt +10 -0
  94. package/src/commands/manuals/uptime.txt +11 -0
  95. package/src/commands/manuals/wc.txt +12 -0
  96. package/src/commands/manuals/wget.txt +12 -0
  97. package/src/commands/manuals/which.txt +10 -0
  98. package/src/commands/manuals/whoami.txt +10 -0
  99. package/src/commands/manuals/xargs.txt +10 -0
  100. package/src/commands/neofetch.ts +7 -0
  101. package/src/commands/wget.ts +12 -1
  102. package/tests/new-features.test.ts +2 -2
@@ -0,0 +1,10 @@
1
+ STAT(1) User Commands STAT(1)
2
+
3
+ NAME
4
+ stat - display file status
5
+
6
+ SYNOPSIS
7
+ stat [OPTION]... FILE...
8
+
9
+ OPTIONS
10
+ -c, --format=FORMAT use the specified output format
@@ -0,0 +1,13 @@
1
+ SU(1) User Commands SU(1)
2
+
3
+ NAME
4
+ su - run a command with substitute user and group ID
5
+
6
+ SYNOPSIS
7
+ su [OPTION]... [USER]
8
+
9
+ OPTIONS
10
+ - start a login shell
11
+
12
+ DESCRIPTION
13
+ Switch to another user account in the current session.
@@ -0,0 +1,11 @@
1
+ SUDO(8) User Commands SUDO(8)
2
+
3
+ NAME
4
+ sudo - execute a command as another user
5
+
6
+ SYNOPSIS
7
+ sudo [OPTION]... COMMAND [ARG]...
8
+
9
+ OPTIONS
10
+ -i run login shell as target user
11
+ -u USER run command as USER
@@ -0,0 +1,10 @@
1
+ TAIL(1) User Commands TAIL(1)
2
+
3
+ NAME
4
+ tail - output the last part of files
5
+
6
+ SYNOPSIS
7
+ tail [OPTION]... [FILE]...
8
+
9
+ OPTIONS
10
+ -n, --lines=[+]NUM output the last NUM lines
@@ -0,0 +1,19 @@
1
+ TAR(1) GNU tar Manual TAR(1)
2
+
3
+ NAME
4
+ tar - an archiving utility
5
+
6
+ SYNOPSIS
7
+ tar [OPTION...] [FILE]...
8
+
9
+ DESCRIPTION
10
+ tar saves many files together into a single tape or disk archive,
11
+ and can restore individual files from the archive.
12
+
13
+ OPTIONS
14
+ -c, --create create a new archive
15
+ -x, --extract extract files from an archive
16
+ -z, --gzip filter the archive through gzip
17
+ -f, --file=ARCHIVE use archive file or device ARCHIVE
18
+ -v, --verbose verbosely list files processed
19
+ -t, --list list the contents of an archive
@@ -0,0 +1,10 @@
1
+ TEE(1) User Commands TEE(1)
2
+
3
+ NAME
4
+ tee - read from standard input and write to standard output and files
5
+
6
+ SYNOPSIS
7
+ tee [OPTION]... [FILE]...
8
+
9
+ OPTIONS
10
+ -a append to the given FILEs, do not overwrite
@@ -0,0 +1,11 @@
1
+ TEST(1) Shell Builtins TEST(1)
2
+
3
+ NAME
4
+ test - check file types and compare values
5
+
6
+ SYNOPSIS
7
+ test EXPRESSION
8
+ [ EXPRESSION ]
9
+
10
+ DESCRIPTION
11
+ Evaluate conditional expressions for scripts and shell logic.
@@ -0,0 +1,11 @@
1
+ TOUCH(1) User Commands TOUCH(1)
2
+
3
+ NAME
4
+ touch - change file timestamps / create file
5
+
6
+ SYNOPSIS
7
+ touch FILE...
8
+
9
+ DESCRIPTION
10
+ Update access and modification times.
11
+ If FILE does not exist, create an empty file.
@@ -0,0 +1,10 @@
1
+ TR(1) User Commands TR(1)
2
+
3
+ NAME
4
+ tr - translate or delete characters
5
+
6
+ SYNOPSIS
7
+ tr [OPTION]... SET1 [SET2]
8
+
9
+ OPTIONS
10
+ -d delete characters in SET1 instead of translating
@@ -0,0 +1,10 @@
1
+ TRAP(1) Shell Builtins TRAP(1)
2
+
3
+ NAME
4
+ trap - trap signals and other events
5
+
6
+ SYNOPSIS
7
+ trap [ACTION] [SIGNAL]...
8
+
9
+ DESCRIPTION
10
+ Define or clear handlers for shell signals and EXIT.
@@ -0,0 +1,10 @@
1
+ TRUE(1) User Commands TRUE(1)
2
+
3
+ NAME
4
+ true - do nothing, successfully
5
+
6
+ SYNOPSIS
7
+ true
8
+
9
+ DESCRIPTION
10
+ Exit with a status code indicating success (0).
@@ -0,0 +1,10 @@
1
+ TYPE(1) Shell Builtins TYPE(1)
2
+
3
+ NAME
4
+ type - display how a command name is interpreted
5
+
6
+ SYNOPSIS
7
+ type NAME...
8
+
9
+ DESCRIPTION
10
+ Indicate whether NAME is a shell builtin, alias, or found in PATH.
@@ -0,0 +1,12 @@
1
+ UNAME(1) User Commands UNAME(1)
2
+
3
+ NAME
4
+ uname - print system information
5
+
6
+ SYNOPSIS
7
+ uname [OPTION]...
8
+
9
+ OPTIONS
10
+ -a print all information
11
+ -r print kernel release
12
+ -m print machine hardware name
@@ -0,0 +1,12 @@
1
+ UNIQ(1) User Commands UNIQ(1)
2
+
3
+ NAME
4
+ uniq - report or omit repeated lines
5
+
6
+ SYNOPSIS
7
+ uniq [OPTION]... [INPUT [OUTPUT]]
8
+
9
+ OPTIONS
10
+ -c prefix lines by the number of occurrences
11
+ -d only print duplicate lines
12
+ -u only print unique lines
@@ -0,0 +1,10 @@
1
+ UNSET(1) Shell Builtins UNSET(1)
2
+
3
+ NAME
4
+ unset - unset values and attributes of shell variables
5
+
6
+ SYNOPSIS
7
+ unset NAME...
8
+
9
+ DESCRIPTION
10
+ Remove one or more shell variables from the current environment.
@@ -0,0 +1,11 @@
1
+ UPTIME(1) User Commands UPTIME(1)
2
+
3
+ NAME
4
+ uptime - tell how long the system has been running
5
+
6
+ SYNOPSIS
7
+ uptime [OPTION]
8
+
9
+ OPTIONS
10
+ -p show uptime in a pretty format
11
+ -s show system up since time
@@ -0,0 +1,12 @@
1
+ WC(1) User Commands WC(1)
2
+
3
+ NAME
4
+ wc - print newline, word, and byte counts for each file
5
+
6
+ SYNOPSIS
7
+ wc [OPTION]... [FILE]...
8
+
9
+ OPTIONS
10
+ -l print the newline counts
11
+ -w print the word counts
12
+ -c print the byte counts
@@ -0,0 +1,12 @@
1
+ WGET(1) User Commands WGET(1)
2
+
3
+ NAME
4
+ wget - non-interactive network downloader
5
+
6
+ SYNOPSIS
7
+ wget [OPTION]... [URL]...
8
+
9
+ OPTIONS
10
+ -O FILE write documents to FILE
11
+ -P DIR save files to DIR
12
+ -q quiet mode
@@ -0,0 +1,10 @@
1
+ WHICH(1) User Commands WHICH(1)
2
+
3
+ NAME
4
+ which - locate a command
5
+
6
+ SYNOPSIS
7
+ which COMMAND...
8
+
9
+ DESCRIPTION
10
+ Print the path of COMMAND found in $PATH.
@@ -0,0 +1,10 @@
1
+ WHOAMI(1) User Commands WHOAMI(1)
2
+
3
+ NAME
4
+ whoami - print effective user name
5
+
6
+ SYNOPSIS
7
+ whoami
8
+
9
+ DESCRIPTION
10
+ Print the user name associated with the current effective user ID.
@@ -0,0 +1,10 @@
1
+ XARGS(1) User Commands XARGS(1)
2
+
3
+ NAME
4
+ xargs - build and execute command lines from standard input
5
+
6
+ SYNOPSIS
7
+ xargs [COMMAND [INITIAL-ARGS]]
8
+
9
+ DESCRIPTION
10
+ Read items from stdin and execute COMMAND with those items as arguments.
@@ -13,6 +13,13 @@ export const neofetchCommand: ShellModule = {
13
13
  category: "system",
14
14
  params: ["[--off]"],
15
15
  run: ({ args, authUser, hostname, shell, env }) => {
16
+ if (!shell.packageManager.isInstalled("neofetch")) {
17
+ return {
18
+ stderr:
19
+ "bash: neofetch: command not found\nHint: install it with: apt install neofetch\n",
20
+ exitCode: 127,
21
+ };
22
+ }
16
23
  if (ifFlag(args, "--help")) {
17
24
  return {
18
25
  stdout: "Usage: neofetch [--off]",
@@ -49,7 +49,18 @@ export const wgetCommand: ShellModule = {
49
49
  };
50
50
  }
51
51
 
52
- const url = positionals[0];
52
+ const urlWithoutProtocol = positionals[0];
53
+ if (!urlWithoutProtocol) {
54
+ return {
55
+ stderr: "wget: missing URL\nUsage: wget [OPTION]... [URL]...",
56
+ exitCode: 1,
57
+ };
58
+ }
59
+
60
+ const url = urlWithoutProtocol.startsWith("http://") ||
61
+ urlWithoutProtocol.startsWith("https://")
62
+ ? urlWithoutProtocol
63
+ : `http://${urlWithoutProtocol}`;
53
64
  if (!url)
54
65
  return {
55
66
  stderr: "wget: missing URL\nUsage: wget [OPTION]... [URL]...",
@@ -223,7 +223,7 @@ describe("Package manager (apt/dpkg)", () => {
223
223
  });
224
224
 
225
225
  test("neofetch shows package count after installs", async () => {
226
- await client.exec("apt install curl wget htop");
226
+ await client.exec("apt install curl wget htop neofetch");
227
227
  const r = await client.exec("neofetch");
228
228
  expect(r.exitCode).toBe(0);
229
229
  expect(r.stdout).toContain("(dpkg)");
@@ -675,7 +675,7 @@ describe("/proc/self and /proc/<pid>", () => {
675
675
  });
676
676
  });
677
677
 
678
- import { diffSnapshots, formatDiff, assertDiff } from "../src";
678
+ import { assertDiff, diffSnapshots, formatDiff } from "../src";
679
679
 
680
680
  describe("VFS snapshot diff tooling", () => {
681
681
  let shell5: VirtualShell;