@astrale-os/adapter-cloudflare 0.5.0-beta.39 → 0.5.0-beta.40

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.
@@ -11,5 +11,7 @@ export declare function wranglerProcessEnv(projectDir: string): NodeJS.ProcessEn
11
11
  export declare function runCapture(cmd: string, args: string[], cwd: string, onLog?: (line: string) => void, signal?: AbortSignal, redact?: (input: string) => string): Promise<{
12
12
  code: number;
13
13
  out: string;
14
+ stdout: string;
15
+ stderr: string;
14
16
  }>;
15
17
  export declare function stopChild(child: ChildProcess): Promise<void>;
@@ -38,6 +38,8 @@ export function runCapture(cmd, args, cwd, onLog, signal, redact = (input) => in
38
38
  env: wranglerProcessEnv(cwd),
39
39
  });
40
40
  let out = '';
41
+ let stdout = '';
42
+ let stderr = '';
41
43
  let outputBytes = 0;
42
44
  let terminating;
43
45
  const timeout = setTimeout(() => terminate(new Error('Wrangler process timed out.')), 300_000);
@@ -60,16 +62,21 @@ export function runCapture(cmd, args, cwd, onLog, signal, redact = (input) => in
60
62
  child.kill('SIGKILL');
61
63
  }, 1_000);
62
64
  }
63
- const onData = (buffer) => {
65
+ const onData = (buffer, stream) => {
64
66
  outputBytes += buffer.byteLength;
65
67
  if (outputBytes > 1024 * 1024) {
66
68
  terminate(new Error('Wrangler process exceeded its output limit.'));
67
69
  return;
68
70
  }
69
- out += buffer.toString();
71
+ const chunk = buffer.toString();
72
+ out += chunk;
73
+ if (stream === 'stdout')
74
+ stdout += chunk;
75
+ else
76
+ stderr += chunk;
70
77
  };
71
- child.stdout?.on('data', onData);
72
- child.stderr?.on('data', onData);
78
+ child.stdout?.on('data', (buffer) => onData(buffer, 'stdout'));
79
+ child.stderr?.on('data', (buffer) => onData(buffer, 'stderr'));
73
80
  child.on('exit', (code) => {
74
81
  cleanup();
75
82
  if (terminating !== undefined)
@@ -79,7 +86,12 @@ export function runCapture(cmd, args, cwd, onLog, signal, redact = (input) => in
79
86
  for (const line of safe.split('\n'))
80
87
  if (line.trim())
81
88
  onLog?.(line);
82
- resolve({ code: code ?? 1, out: safe });
89
+ resolve({
90
+ code: code ?? 1,
91
+ out: safe,
92
+ stdout: redact(stdout),
93
+ stderr: redact(stderr),
94
+ });
83
95
  }
84
96
  });
85
97
  child.on('error', (cause) => {
@@ -14,7 +14,7 @@ export async function runWranglerDeploymentStatus(args) {
14
14
  if (result.code !== 0) {
15
15
  throw new Error(`wrangler deployments status failed (code ${result.code}):\n${result.out.slice(-2000)}`);
16
16
  }
17
- return admitWranglerDeploymentStatus(result.out);
17
+ return admitWranglerDeploymentStatus(result.stdout);
18
18
  }
19
19
  export function admitWranglerDeploymentStatus(output) {
20
20
  let decoded;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/adapter-cloudflare",
3
- "version": "0.5.0-beta.39",
3
+ "version": "0.5.0-beta.40",
4
4
  "description": "Deploy an Astrale application through Cloudflare Workers",
5
5
  "keywords": [
6
6
  "adapter",
@@ -45,7 +45,7 @@
45
45
  "hono": "^4.6.20",
46
46
  "jose": "^6.1.3",
47
47
  "wrangler": "4.123.0",
48
- "@astrale-os/sdk": "^0.5.0-beta.36"
48
+ "@astrale-os/sdk": "^0.5.0-beta.37"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@astrale-os/ox": ">=0.1.0 <1.0.0",