@scelar/nodepod 1.0.2 → 1.0.3

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 (70) hide show
  1. package/dist/__tests__/bench/integration.bench.d.ts +1 -0
  2. package/dist/__tests__/bench/memory-volume.bench.d.ts +1 -0
  3. package/dist/__tests__/bench/polyfills.bench.d.ts +1 -0
  4. package/dist/__tests__/bench/script-engine.bench.d.ts +1 -0
  5. package/dist/__tests__/bench/shell.bench.d.ts +1 -0
  6. package/dist/__tests__/bench/syntax-transforms.bench.d.ts +1 -0
  7. package/dist/__tests__/bench/version-resolver.bench.d.ts +1 -0
  8. package/dist/__tests__/buffer.test.d.ts +1 -0
  9. package/dist/__tests__/byte-encoding.test.d.ts +1 -0
  10. package/dist/__tests__/digest.test.d.ts +1 -0
  11. package/dist/__tests__/events.test.d.ts +1 -0
  12. package/dist/__tests__/memory-volume.test.d.ts +1 -0
  13. package/dist/__tests__/path.test.d.ts +1 -0
  14. package/dist/__tests__/process.test.d.ts +1 -0
  15. package/dist/__tests__/script-engine.test.d.ts +1 -0
  16. package/dist/__tests__/shell-builtins.test.d.ts +1 -0
  17. package/dist/__tests__/shell-interpreter.test.d.ts +1 -0
  18. package/dist/__tests__/shell-parser.test.d.ts +1 -0
  19. package/dist/__tests__/stream.test.d.ts +1 -0
  20. package/dist/__tests__/syntax-transforms.test.d.ts +1 -0
  21. package/dist/__tests__/version-resolver.test.d.ts +1 -0
  22. package/dist/{child_process-Dopvyd-E.js → child_process-D6oDN2MX.js} +4 -4
  23. package/dist/{child_process-Dopvyd-E.js.map → child_process-D6oDN2MX.js.map} +1 -1
  24. package/dist/{child_process-B38qoN6R.cjs → child_process-hmVqFcF7.cjs} +5 -5
  25. package/dist/{child_process-B38qoN6R.cjs.map → child_process-hmVqFcF7.cjs.map} +1 -1
  26. package/dist/{index--Qr8LVpQ.js → index-Ale2oba_.js} +240 -136
  27. package/dist/index-Ale2oba_.js.map +1 -0
  28. package/dist/{index-cnitc68U.cjs → index-BO1i013L.cjs} +236 -191
  29. package/dist/index-BO1i013L.cjs.map +1 -0
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.mjs +1 -1
  32. package/dist/script-engine.d.ts +2 -0
  33. package/dist/syntax-transforms.d.ts +1 -0
  34. package/package.json +97 -95
  35. package/src/__tests__/bench/integration.bench.ts +117 -0
  36. package/src/__tests__/bench/memory-volume.bench.ts +115 -0
  37. package/src/__tests__/bench/polyfills.bench.ts +147 -0
  38. package/src/__tests__/bench/script-engine.bench.ts +104 -0
  39. package/src/__tests__/bench/shell.bench.ts +101 -0
  40. package/src/__tests__/bench/syntax-transforms.bench.ts +82 -0
  41. package/src/__tests__/bench/version-resolver.bench.ts +95 -0
  42. package/src/__tests__/buffer.test.ts +273 -0
  43. package/src/__tests__/byte-encoding.test.ts +98 -0
  44. package/src/__tests__/digest.test.ts +44 -0
  45. package/src/__tests__/events.test.ts +245 -0
  46. package/src/__tests__/memory-volume.test.ts +443 -0
  47. package/src/__tests__/path.test.ts +181 -0
  48. package/src/__tests__/process.test.ts +129 -0
  49. package/src/__tests__/script-engine.test.ts +229 -0
  50. package/src/__tests__/shell-builtins.test.ts +357 -0
  51. package/src/__tests__/shell-interpreter.test.ts +157 -0
  52. package/src/__tests__/shell-parser.test.ts +204 -0
  53. package/src/__tests__/stream.test.ts +142 -0
  54. package/src/__tests__/syntax-transforms.test.ts +158 -0
  55. package/src/__tests__/version-resolver.test.ts +184 -0
  56. package/src/constants/cdn-urls.ts +18 -18
  57. package/src/helpers/byte-encoding.ts +51 -39
  58. package/src/memory-volume.ts +962 -941
  59. package/src/module-transformer.ts +368 -368
  60. package/src/packages/installer.ts +396 -396
  61. package/src/polyfills/buffer.ts +633 -628
  62. package/src/polyfills/esbuild.ts +854 -854
  63. package/src/polyfills/events.ts +282 -276
  64. package/src/polyfills/process.ts +695 -690
  65. package/src/polyfills/readline.ts +692 -692
  66. package/src/polyfills/tty.ts +71 -71
  67. package/src/script-engine.ts +3396 -3375
  68. package/src/syntax-transforms.ts +543 -561
  69. package/dist/index--Qr8LVpQ.js.map +0 -1
  70. package/dist/index-cnitc68U.cjs.map +0 -1
@@ -1,71 +1,71 @@
1
- // TTY polyfill - always reports non-TTY in browser
2
-
3
-
4
- // always false in browser
5
- export function isatty(_fd: number): boolean {
6
- return false;
7
- }
8
-
9
- export interface ReadStream {
10
- isTTY: boolean;
11
- isRaw: boolean;
12
- setRawMode(_mode: boolean): this;
13
- }
14
-
15
- export const ReadStream = function ReadStream(this: any) {
16
- if (!this) return;
17
- this.isTTY = false;
18
- this.isRaw = false;
19
- } as unknown as { new(): ReadStream; prototype: any };
20
-
21
- ReadStream.prototype.setRawMode = function setRawMode(_mode: boolean) {
22
- this.isRaw = _mode;
23
- return this;
24
- };
25
-
26
- export interface WriteStream {
27
- isTTY: boolean;
28
- columns: number;
29
- rows: number;
30
- getColorDepth(): number;
31
- hasColors(count?: number): boolean;
32
- getWindowSize(): [number, number];
33
- clearLine(_dir: number, _cb?: () => void): boolean;
34
- clearScreenDown(_cb?: () => void): boolean;
35
- cursorTo(_x: number, _y?: number | (() => void), _cb?: () => void): boolean;
36
- moveCursor(_dx: number, _dy: number, _cb?: () => void): boolean;
37
- }
38
-
39
- export const WriteStream = function WriteStream(this: any) {
40
- if (!this) return;
41
- this.isTTY = false;
42
- this.columns = 120;
43
- this.rows = 40;
44
- } as unknown as { new(): WriteStream; prototype: any };
45
-
46
- WriteStream.prototype.getColorDepth = function getColorDepth(): number { return 8; };
47
- WriteStream.prototype.hasColors = function hasColors(count?: number): boolean {
48
- return (count ?? 1) <= 256;
49
- };
50
- WriteStream.prototype.getWindowSize = function getWindowSize(): [number, number] {
51
- return [this.columns, this.rows];
52
- };
53
- WriteStream.prototype.clearLine = function clearLine(_dir: number, _cb?: () => void): boolean {
54
- _cb?.();
55
- return true;
56
- };
57
- WriteStream.prototype.clearScreenDown = function clearScreenDown(_cb?: () => void): boolean {
58
- _cb?.();
59
- return true;
60
- };
61
- WriteStream.prototype.cursorTo = function cursorTo(_x: number, _y?: number | (() => void), _cb?: () => void): boolean {
62
- if (typeof _y === "function") _y();
63
- else _cb?.();
64
- return true;
65
- };
66
- WriteStream.prototype.moveCursor = function moveCursor(_dx: number, _dy: number, _cb?: () => void): boolean {
67
- _cb?.();
68
- return true;
69
- };
70
-
71
- export default { isatty, ReadStream, WriteStream };
1
+ // TTY polyfill - always reports non-TTY in browser
2
+
3
+
4
+ // always false in browser
5
+ export function isatty(_fd: number): boolean {
6
+ return false;
7
+ }
8
+
9
+ export interface ReadStream {
10
+ isTTY: boolean;
11
+ isRaw: boolean;
12
+ setRawMode(_mode: boolean): this;
13
+ }
14
+
15
+ export const ReadStream = function ReadStream(this: any) {
16
+ if (!this) return;
17
+ this.isTTY = false;
18
+ this.isRaw = false;
19
+ } as unknown as { new(): ReadStream; prototype: any };
20
+
21
+ ReadStream.prototype.setRawMode = function setRawMode(_mode: boolean) {
22
+ this.isRaw = _mode;
23
+ return this;
24
+ };
25
+
26
+ export interface WriteStream {
27
+ isTTY: boolean;
28
+ columns: number;
29
+ rows: number;
30
+ getColorDepth(): number;
31
+ hasColors(count?: number): boolean;
32
+ getWindowSize(): [number, number];
33
+ clearLine(_dir: number, _cb?: () => void): boolean;
34
+ clearScreenDown(_cb?: () => void): boolean;
35
+ cursorTo(_x: number, _y?: number | (() => void), _cb?: () => void): boolean;
36
+ moveCursor(_dx: number, _dy: number, _cb?: () => void): boolean;
37
+ }
38
+
39
+ export const WriteStream = function WriteStream(this: any) {
40
+ if (!this) return;
41
+ this.isTTY = false;
42
+ this.columns = 120;
43
+ this.rows = 40;
44
+ } as unknown as { new(): WriteStream; prototype: any };
45
+
46
+ WriteStream.prototype.getColorDepth = function getColorDepth(): number { return 8; };
47
+ WriteStream.prototype.hasColors = function hasColors(count?: number): boolean {
48
+ return (count ?? 1) <= 256;
49
+ };
50
+ WriteStream.prototype.getWindowSize = function getWindowSize(): [number, number] {
51
+ return [this.columns, this.rows];
52
+ };
53
+ WriteStream.prototype.clearLine = function clearLine(_dir: number, _cb?: () => void): boolean {
54
+ _cb?.();
55
+ return true;
56
+ };
57
+ WriteStream.prototype.clearScreenDown = function clearScreenDown(_cb?: () => void): boolean {
58
+ _cb?.();
59
+ return true;
60
+ };
61
+ WriteStream.prototype.cursorTo = function cursorTo(_x: number, _y?: number | (() => void), _cb?: () => void): boolean {
62
+ if (typeof _y === "function") _y();
63
+ else _cb?.();
64
+ return true;
65
+ };
66
+ WriteStream.prototype.moveCursor = function moveCursor(_dx: number, _dy: number, _cb?: () => void): boolean {
67
+ _cb?.();
68
+ return true;
69
+ };
70
+
71
+ export default { isatty, ReadStream, WriteStream };