@vercel/ruby 2.3.0 → 2.3.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 (2) hide show
  1. package/dist/index.js +31 -12
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7260,8 +7260,22 @@ async function run(cmd, args, opts) {
7260
7260
  env: opts.env,
7261
7261
  stdio: ["ignore", "pipe", "pipe"]
7262
7262
  });
7263
- child.stdout?.on("data", (buf) => process.stdout.write(buf));
7264
- child.stderr?.on("data", (buf) => process.stderr.write(buf));
7263
+ child.stdout?.on("data", (data) => {
7264
+ const chunk = Buffer.isBuffer(data) ? data : Buffer.from(data);
7265
+ if (opts.onStdout) {
7266
+ opts.onStdout(chunk);
7267
+ } else {
7268
+ process.stdout.write(chunk.toString());
7269
+ }
7270
+ });
7271
+ child.stderr?.on("data", (data) => {
7272
+ const chunk = Buffer.isBuffer(data) ? data : Buffer.from(data);
7273
+ if (opts.onStderr) {
7274
+ opts.onStderr(chunk);
7275
+ } else {
7276
+ process.stderr.write(chunk.toString());
7277
+ }
7278
+ });
7265
7279
  child.on("close", (code, signal) => resolve({ code, signal }));
7266
7280
  });
7267
7281
  }
@@ -7329,7 +7343,12 @@ var startDevServer = async (opts) => {
7329
7343
  const check = await run(
7330
7344
  bundlerPath,
7331
7345
  ["check", "--gemfile", gemfile],
7332
- { cwd: projectDir, env }
7346
+ {
7347
+ cwd: projectDir,
7348
+ env,
7349
+ onStdout: opts.onStdout,
7350
+ onStderr: opts.onStderr
7351
+ }
7333
7352
  );
7334
7353
  if (check.code !== 0) {
7335
7354
  return false;
@@ -7356,21 +7375,21 @@ var startDevServer = async (opts) => {
7356
7375
  const child = (0, import_child_process2.spawn)(cmd, args, {
7357
7376
  cwd: workPath,
7358
7377
  env,
7359
- stdio: ["inherit", "pipe", "pipe"]
7378
+ stdio: ["ignore", "pipe", "pipe"]
7360
7379
  });
7361
7380
  childProcess = child;
7362
7381
  stdoutLogListener = (buf) => {
7363
- const s = buf.toString();
7364
- for (const line of s.split(/\r?\n/)) {
7365
- if (line)
7366
- process.stdout.write(line.endsWith("\n") ? line : line + "\n");
7382
+ if (opts.onStdout) {
7383
+ opts.onStdout(buf);
7384
+ } else {
7385
+ process.stdout.write(buf.toString());
7367
7386
  }
7368
7387
  };
7369
7388
  stderrLogListener = (buf) => {
7370
- const s = buf.toString();
7371
- for (const line of s.split(/\r?\n/)) {
7372
- if (line)
7373
- process.stderr.write(line.endsWith("\n") ? line : line + "\n");
7389
+ if (opts.onStderr) {
7390
+ opts.onStderr(buf);
7391
+ } else {
7392
+ process.stderr.write(buf.toString());
7374
7393
  }
7375
7394
  };
7376
7395
  child.stdout?.on("data", stdoutLogListener);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/ruby",
3
3
  "author": "Nathan Cahill <nathan@nathancahill.com>",
4
- "version": "2.3.0",
4
+ "version": "2.3.1",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index",
7
7
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/ruby",
@@ -24,7 +24,7 @@
24
24
  "jest-junit": "16.0.0",
25
25
  "semver": "6.3.1",
26
26
  "which": "3.0.0",
27
- "@vercel/build-utils": "13.3.3"
27
+ "@vercel/build-utils": "13.4.0"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "node ../../utils/build-builder.mjs",