@opentabs-dev/shared 0.0.67 → 0.0.68

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentabs-dev/shared",
3
- "version": "0.0.67",
3
+ "version": "0.0.68",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
package/dist/runtime.d.ts DELETED
@@ -1,71 +0,0 @@
1
- /**
2
- * Runtime compatibility layer for Node.js and Bun.
3
- *
4
- * Production code imports these helpers instead of using Bun-specific APIs
5
- * directly. When running under Bun, the fast native APIs are used. When
6
- * running under Node.js, equivalent standard library APIs are used.
7
- *
8
- * Platform-contributor-only code (tests, build scripts, dev mode) may still
9
- * use Bun APIs directly since contributors always have Bun installed.
10
- */
11
- /** True when running under the Bun runtime. */
12
- export declare const isBun: boolean;
13
- /** Read a file as UTF-8 text. */
14
- export declare const readFile: (path: string) => Promise<string>;
15
- /** Read a file and parse it as JSON. */
16
- export declare const readJsonFile: (path: string) => Promise<unknown>;
17
- /** Write a string to a file (creates or overwrites). */
18
- export declare const writeFile: (path: string, content: string) => Promise<void>;
19
- /** Check whether a file exists. */
20
- export declare const fileExists: (path: string) => Promise<boolean>;
21
- /** Delete a file. Does not throw if the file does not exist. */
22
- export declare const deleteFile: (path: string) => Promise<void>;
23
- /** Result of a spawned process. */
24
- export interface SpawnResult {
25
- exitCode: number;
26
- stdout: string;
27
- stderr: string;
28
- }
29
- /** Options for process spawning. */
30
- export interface SpawnOptions {
31
- cwd?: string;
32
- env?: Record<string, string | undefined>;
33
- stdin?: 'inherit' | 'pipe' | 'ignore';
34
- }
35
- /** Spawn a process synchronously and return its exit code and output. */
36
- export declare const spawnProcessSync: (cmd: string, args: string[], opts?: SpawnOptions) => SpawnResult;
37
- /** Spawn a process asynchronously and return its exit code and output. */
38
- export declare const spawnProcess: (cmd: string, args: string[], opts?: SpawnOptions) => Promise<SpawnResult>;
39
- /** Handle for a streaming child process. */
40
- export interface StreamingProcess {
41
- stdout: ReadableStream<Uint8Array>;
42
- stderr: ReadableStream<Uint8Array>;
43
- kill: (signal?: string) => void;
44
- exited: Promise<number>;
45
- }
46
- /**
47
- * Spawn a process with streaming stdout/stderr.
48
- * Used when the caller needs real-time output (e.g., tee to terminal + log file).
49
- */
50
- export declare const spawnStreaming: (cmd: string, args: string[], opts?: SpawnOptions & {
51
- env?: Record<string, string | undefined>;
52
- }) => StreamingProcess;
53
- /**
54
- * Spawn a process with inherited stdio (pass-through to terminal).
55
- * Returns the exit code when the process completes.
56
- */
57
- export declare const spawnInherit: (cmd: string, args: string[], opts?: SpawnOptions) => Promise<number>;
58
- /** Get the size of a file in bytes. Returns 0 if the file does not exist. */
59
- export declare const getFileSize: (path: string) => Promise<number>;
60
- /**
61
- * Read a slice of a file as UTF-8 text.
62
- * Reads bytes from `start` to `end` (exclusive).
63
- */
64
- export declare const readFileSlice: (path: string, start: number, end: number) => Promise<string>;
65
- /** Read an environment variable. */
66
- export declare const getEnv: (name: string) => string | undefined;
67
- /** Get the command-line arguments (equivalent to process.argv). */
68
- export declare const getArgv: () => string[];
69
- /** Compute a SHA-256 hex digest of the given data. */
70
- export declare const sha256: (data: string | Uint8Array) => string;
71
- //# sourceMappingURL=runtime.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,+CAA+C;AAC/C,eAAO,MAAM,KAAK,SAA6B,CAAC;AAMhD,iCAAiC;AACjC,eAAO,MAAM,QAAQ,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,MAAM,CAG3D,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,YAAY,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,OAAO,CAGhE,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,SAAS,GAAU,MAAM,MAAM,EAAE,SAA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MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;CAAE,KACjE,gBAwCF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,EAAE,OAAO,YAAY,KAAG,OAAO,CAAC,MAAM,CAkB7F,CAAC;AAMF,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,MAAM,CAQ9D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAU,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,KAAK,MAAM,KAAG,OAAO,CAAC,MAAM,CAW5F,CAAC;AAMF,oCAAoC;AACpC,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,KAAG,MAAM,GAAG,SAG9C,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,OAAO,QAAO,MAAM,EAGhC,CAAC;AAMF,sDAAsD;AACtD,eAAO,MAAM,MAAM,GAAI,MAAM,MAAM,GAAG,UAAU,KAAG,MAOlD,CAAC"}
package/dist/runtime.js DELETED
@@ -1,258 +0,0 @@
1
- /**
2
- * Runtime compatibility layer for Node.js and Bun.
3
- *
4
- * Production code imports these helpers instead of using Bun-specific APIs
5
- * directly. When running under Bun, the fast native APIs are used. When
6
- * running under Node.js, equivalent standard library APIs are used.
7
- *
8
- * Platform-contributor-only code (tests, build scripts, dev mode) may still
9
- * use Bun APIs directly since contributors always have Bun installed.
10
- */
11
- import { spawnSync as nodeSpawnSync, spawn as nodeSpawn } from 'node:child_process';
12
- import { createHash } from 'node:crypto';
13
- import { open, readFile as nodeReadFile, writeFile as nodeWriteFile, unlink, stat } from 'node:fs/promises';
14
- import { Readable } from 'node:stream';
15
- // ---------------------------------------------------------------------------
16
- // Runtime detection
17
- // ---------------------------------------------------------------------------
18
- /** True when running under the Bun runtime. */
19
- export const isBun = typeof Bun !== 'undefined';
20
- // ---------------------------------------------------------------------------
21
- // File I/O
22
- // ---------------------------------------------------------------------------
23
- /** Read a file as UTF-8 text. */
24
- export const readFile = async (path) => {
25
- if (isBun)
26
- return Bun.file(path).text();
27
- return nodeReadFile(path, 'utf-8');
28
- };
29
- /** Read a file and parse it as JSON. */
30
- export const readJsonFile = async (path) => {
31
- const text = await readFile(path);
32
- return JSON.parse(text);
33
- };
34
- /** Write a string to a file (creates or overwrites). */
35
- export const writeFile = async (path, content) => {
36
- if (isBun) {
37
- await Bun.write(path, content);
38
- return;
39
- }
40
- await nodeWriteFile(path, content, 'utf-8');
41
- };
42
- /** Check whether a file exists. */
43
- export const fileExists = async (path) => {
44
- if (isBun)
45
- return Bun.file(path).exists();
46
- try {
47
- await stat(path);
48
- return true;
49
- }
50
- catch {
51
- return false;
52
- }
53
- };
54
- /** Delete a file. Does not throw if the file does not exist. */
55
- export const deleteFile = async (path) => {
56
- if (isBun) {
57
- await Bun.file(path)
58
- .delete()
59
- .catch(() => { });
60
- return;
61
- }
62
- await unlink(path).catch(() => { });
63
- };
64
- /** Spawn a process synchronously and return its exit code and output. */
65
- export const spawnProcessSync = (cmd, args, opts) => {
66
- if (isBun) {
67
- const result = Bun.spawnSync([cmd, ...args], {
68
- cwd: opts?.cwd,
69
- env: opts?.env,
70
- stdin: opts?.stdin ?? 'ignore',
71
- stdout: 'pipe',
72
- stderr: 'pipe',
73
- });
74
- return {
75
- exitCode: result.exitCode,
76
- stdout: result.stdout.toString(),
77
- stderr: result.stderr.toString(),
78
- };
79
- }
80
- const result = nodeSpawnSync(cmd, args, {
81
- cwd: opts?.cwd,
82
- env: opts?.env,
83
- stdio: [opts?.stdin ?? 'ignore', 'pipe', 'pipe'],
84
- });
85
- if (result.error) {
86
- return { exitCode: 1, stdout: '', stderr: result.error.message };
87
- }
88
- return {
89
- exitCode: result.status ?? 1,
90
- stdout: result.stdout.toString(),
91
- stderr: result.stderr.toString(),
92
- };
93
- };
94
- /** Spawn a process asynchronously and return its exit code and output. */
95
- export const spawnProcess = (cmd, args, opts) => {
96
- if (isBun) {
97
- const proc = Bun.spawn([cmd, ...args], {
98
- cwd: opts?.cwd,
99
- env: opts?.env,
100
- stdin: opts?.stdin ?? 'ignore',
101
- stdout: 'pipe',
102
- stderr: 'pipe',
103
- });
104
- return proc.exited.then(async (exitCode) => {
105
- const stdout = await new Response(proc.stdout).text();
106
- const stderr = await new Response(proc.stderr).text();
107
- return { exitCode, stdout, stderr };
108
- });
109
- }
110
- return new Promise((resolve, reject) => {
111
- const child = nodeSpawn(cmd, args, {
112
- cwd: opts?.cwd,
113
- env: opts?.env,
114
- stdio: [opts?.stdin ?? 'ignore', 'pipe', 'pipe'],
115
- });
116
- const stdoutChunks = [];
117
- const stderrChunks = [];
118
- child.stdout?.on('data', (chunk) => stdoutChunks.push(chunk));
119
- child.stderr?.on('data', (chunk) => stderrChunks.push(chunk));
120
- child.on('error', reject);
121
- child.on('close', code => {
122
- resolve({
123
- exitCode: code ?? 1,
124
- stdout: Buffer.concat(stdoutChunks).toString(),
125
- stderr: Buffer.concat(stderrChunks).toString(),
126
- });
127
- });
128
- });
129
- };
130
- /**
131
- * Spawn a process with streaming stdout/stderr.
132
- * Used when the caller needs real-time output (e.g., tee to terminal + log file).
133
- */
134
- export const spawnStreaming = (cmd, args, opts) => {
135
- if (isBun) {
136
- const proc = Bun.spawn([cmd, ...args], {
137
- cwd: opts?.cwd,
138
- env: opts?.env,
139
- stdin: opts?.stdin ?? 'inherit',
140
- stdout: 'pipe',
141
- stderr: 'pipe',
142
- });
143
- return {
144
- stdout: proc.stdout,
145
- stderr: proc.stderr,
146
- kill: (signal) => proc.kill(signal === 'SIGTERM' ? 'SIGTERM' : 'SIGINT'),
147
- exited: proc.exited,
148
- };
149
- }
150
- const child = nodeSpawn(cmd, args, {
151
- cwd: opts?.cwd,
152
- env: opts?.env,
153
- stdio: [opts?.stdin ?? 'inherit', 'pipe', 'pipe'],
154
- });
155
- const toReadableStream = (readable) => {
156
- if (!readable)
157
- return new ReadableStream({
158
- start(c) {
159
- c.close();
160
- },
161
- });
162
- return Readable.toWeb(readable);
163
- };
164
- const exited = new Promise((resolve, reject) => {
165
- child.on('error', reject);
166
- child.on('close', code => resolve(code ?? 1));
167
- });
168
- return {
169
- stdout: toReadableStream(child.stdout),
170
- stderr: toReadableStream(child.stderr),
171
- kill: (signal) => child.kill(signal === 'SIGTERM' ? 'SIGTERM' : 'SIGINT'),
172
- exited,
173
- };
174
- };
175
- /**
176
- * Spawn a process with inherited stdio (pass-through to terminal).
177
- * Returns the exit code when the process completes.
178
- */
179
- export const spawnInherit = (cmd, args, opts) => {
180
- if (isBun) {
181
- const proc = Bun.spawn([cmd, ...args], {
182
- cwd: opts?.cwd,
183
- env: opts?.env,
184
- stdio: ['inherit', 'inherit', 'inherit'],
185
- });
186
- return proc.exited;
187
- }
188
- return new Promise((resolve, reject) => {
189
- const child = nodeSpawn(cmd, args, {
190
- cwd: opts?.cwd,
191
- env: opts?.env,
192
- stdio: 'inherit',
193
- });
194
- child.on('error', reject);
195
- child.on('close', code => resolve(code ?? 1));
196
- });
197
- };
198
- // ---------------------------------------------------------------------------
199
- // File metadata & partial reads
200
- // ---------------------------------------------------------------------------
201
- /** Get the size of a file in bytes. Returns 0 if the file does not exist. */
202
- export const getFileSize = async (path) => {
203
- if (isBun)
204
- return Bun.file(path).size;
205
- try {
206
- const s = await stat(path);
207
- return s.size;
208
- }
209
- catch {
210
- return 0;
211
- }
212
- };
213
- /**
214
- * Read a slice of a file as UTF-8 text.
215
- * Reads bytes from `start` to `end` (exclusive).
216
- */
217
- export const readFileSlice = async (path, start, end) => {
218
- if (isBun)
219
- return Bun.file(path).slice(start, end).text();
220
- const fh = await open(path, 'r');
221
- try {
222
- const length = end - start;
223
- const buf = Buffer.alloc(length);
224
- const { bytesRead } = await fh.read(buf, 0, length, start);
225
- return buf.subarray(0, bytesRead).toString('utf-8');
226
- }
227
- finally {
228
- await fh.close();
229
- }
230
- };
231
- // ---------------------------------------------------------------------------
232
- // Environment & CLI
233
- // ---------------------------------------------------------------------------
234
- /** Read an environment variable. */
235
- export const getEnv = (name) => {
236
- if (isBun)
237
- return Bun.env[name];
238
- return process.env[name];
239
- };
240
- /** Get the command-line arguments (equivalent to process.argv). */
241
- export const getArgv = () => {
242
- if (isBun)
243
- return Bun.argv;
244
- return process.argv;
245
- };
246
- // ---------------------------------------------------------------------------
247
- // Cryptography
248
- // ---------------------------------------------------------------------------
249
- /** Compute a SHA-256 hex digest of the given data. */
250
- export const sha256 = (data) => {
251
- if (isBun) {
252
- const hasher = new Bun.CryptoHasher('sha256');
253
- hasher.update(data);
254
- return hasher.digest('hex');
255
- }
256
- return createHash('sha256').update(data).digest('hex');
257
- };
258
- //# sourceMappingURL=runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,YAAY,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E,+CAA+C;AAC/C,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,GAAG,KAAK,WAAW,CAAC;AAEhD,8EAA8E;AAC9E,WAAW;AACX,8EAA8E;AAE9E,iCAAiC;AACjC,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,IAAY,EAAmB,EAAE;IAC9D,IAAI,KAAK;QAAE,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;IACxC,OAAO,YAAY,CAA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