@salesforce/core-bundle 7.4.0 → 7.5.0

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.
@@ -1945,7 +1945,7 @@ var require_package = __commonJS({
1945
1945
  "node_modules/thread-stream/package.json"(exports2, module2) {
1946
1946
  module2.exports = {
1947
1947
  name: "thread-stream",
1948
- version: "2.7.0",
1948
+ version: "3.1.0",
1949
1949
  description: "A streaming way to send data to a Node.js Worker Thread",
1950
1950
  main: "index.js",
1951
1951
  types: "index.d.ts",
@@ -1960,7 +1960,7 @@ var require_package = __commonJS({
1960
1960
  fastbench: "^1.0.1",
1961
1961
  husky: "^9.0.6",
1962
1962
  "pino-elasticsearch": "^8.0.0",
1963
- "sonic-boom": "^3.0.0",
1963
+ "sonic-boom": "^4.0.1",
1964
1964
  standard: "^17.0.0",
1965
1965
  tap: "^16.2.0",
1966
1966
  "ts-node": "^10.8.0",
@@ -1968,7 +1968,8 @@ var require_package = __commonJS({
1968
1968
  "why-is-node-running": "^2.2.2"
1969
1969
  },
1970
1970
  scripts: {
1971
- test: 'standard && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',
1971
+ build: "tsc --noEmit",
1972
+ test: 'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',
1972
1973
  "test:ci": "standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts",
1973
1974
  "test:ci:js": 'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',
1974
1975
  "test:ci:ts": 'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',
@@ -1978,7 +1979,8 @@ var require_package = __commonJS({
1978
1979
  },
1979
1980
  standard: {
1980
1981
  ignore: [
1981
- "test/ts/**/*"
1982
+ "test/ts/**/*",
1983
+ "test/syntax-error.mjs"
1982
1984
  ]
1983
1985
  },
1984
1986
  repository: {
@@ -2554,7 +2556,10 @@ var require_transport = __commonJS({
2554
2556
  stream.flushSync();
2555
2557
  }
2556
2558
  function transport(fullOptions) {
2557
- const { pipeline, targets, levels, dedupe, options = {}, worker = {}, caller = getCallers() } = fullOptions;
2559
+ const { pipeline: pipeline2, targets, levels, dedupe, worker = {}, caller = getCallers() } = fullOptions;
2560
+ const options = {
2561
+ ...fullOptions.options
2562
+ };
2558
2563
  const callers = typeof caller === "string" ? [caller] : caller;
2559
2564
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
2560
2565
  let target = fullOptions.target;
@@ -2563,20 +2568,30 @@ var require_transport = __commonJS({
2563
2568
  }
2564
2569
  if (targets) {
2565
2570
  target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js");
2566
- options.targets = targets.map((dest) => {
2571
+ options.targets = targets.filter((dest) => dest.target).map((dest) => {
2567
2572
  return {
2568
2573
  ...dest,
2569
2574
  target: fixTarget(dest.target)
2570
2575
  };
2571
2576
  });
2572
- } else if (pipeline) {
2573
- target = bundlerOverrides["pino-pipeline-worker"] || join(__dirname, "worker-pipeline.js");
2574
- options.targets = pipeline.map((dest) => {
2577
+ options.pipelines = targets.filter((dest) => dest.pipeline).map((dest) => {
2578
+ return dest.pipeline.map((t) => {
2579
+ return {
2580
+ ...t,
2581
+ level: dest.level,
2582
+ // duplicate the pipeline `level` property defined in the upper level
2583
+ target: fixTarget(t.target)
2584
+ };
2585
+ });
2586
+ });
2587
+ } else if (pipeline2) {
2588
+ target = bundlerOverrides["pino-worker"] || join(__dirname, "worker.js");
2589
+ options.pipelines = [pipeline2.map((dest) => {
2575
2590
  return {
2576
2591
  ...dest,
2577
2592
  target: fixTarget(dest.target)
2578
2593
  };
2579
- });
2594
+ })];
2580
2595
  }
2581
2596
  if (levels) {
2582
2597
  options.levels = levels;
@@ -3159,7 +3174,7 @@ var require_levels = __commonJS({
3159
3174
  var require_meta = __commonJS({
3160
3175
  "node_modules/pino/lib/meta.js"(exports2, module2) {
3161
3176
  "use strict";
3162
- module2.exports = { version: "8.21.0" };
3177
+ module2.exports = { version: "9.2.0" };
3163
3178
  }
3164
3179
  });
3165
3180
 
@@ -4123,7 +4138,7 @@ var require_pino = __commonJS({
4123
4138
  return f(p);
4124
4139
  }
4125
4140
  }
4126
- globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pipeline-worker": pinoBundlerAbsolutePath("./pino-pipeline-worker.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4141
+ globalThis.__bundlerPathsOverrides = { ...globalThis.__bundlerPathsOverrides || {}, "thread-stream-worker": pinoBundlerAbsolutePath("./thread-stream-worker.js"), "pino-worker": pinoBundlerAbsolutePath("./pino-worker.js"), "pino/file": pinoBundlerAbsolutePath("./pino-file.js"), "pino-pretty": pinoBundlerAbsolutePath("./pino-pretty.js") };
4127
4142
  var os = require("os");
4128
4143
  var stdSerializers = require_pino_std_serializers();
4129
4144
  var caller = require_caller();
@@ -6750,12 +6765,12 @@ var require_legacy = __commonJS({
6750
6765
  "node_modules/pino-abstract-transport/node_modules/readable-stream/lib/internal/streams/legacy.js"(exports2, module2) {
6751
6766
  "use strict";
6752
6767
  var { ArrayIsArray, ObjectSetPrototypeOf } = require_primordials();
6753
- var { EventEmitter: EE } = require("events");
6768
+ var { EventEmitter: EE2 } = require("events");
6754
6769
  function Stream(opts) {
6755
- EE.call(this, opts);
6770
+ EE2.call(this, opts);
6756
6771
  }
6757
- ObjectSetPrototypeOf(Stream.prototype, EE.prototype);
6758
- ObjectSetPrototypeOf(Stream, EE);
6772
+ ObjectSetPrototypeOf(Stream.prototype, EE2.prototype);
6773
+ ObjectSetPrototypeOf(Stream, EE2);
6759
6774
  Stream.prototype.pipe = function(dest, options) {
6760
6775
  const source = this;
6761
6776
  function ondata(chunk) {
@@ -6790,7 +6805,7 @@ var require_legacy = __commonJS({
6790
6805
  }
6791
6806
  function onerror(er) {
6792
6807
  cleanup();
6793
- if (EE.listenerCount(this, "error") === 0) {
6808
+ if (EE2.listenerCount(this, "error") === 0) {
6794
6809
  this.emit("error", er);
6795
6810
  }
6796
6811
  }
@@ -7206,7 +7221,7 @@ var require_readable = __commonJS({
7206
7221
  } = require_primordials();
7207
7222
  module2.exports = Readable;
7208
7223
  Readable.ReadableState = ReadableState;
7209
- var { EventEmitter: EE } = require("events");
7224
+ var { EventEmitter: EE2 } = require("events");
7210
7225
  var { Stream, prependListener } = require_legacy();
7211
7226
  var { Buffer: Buffer2 } = require("buffer");
7212
7227
  var { addAbortSignal } = require_add_abort_signal();
@@ -7362,7 +7377,7 @@ var require_readable = __commonJS({
7362
7377
  Readable.prototype._destroy = function(err, cb) {
7363
7378
  cb(err);
7364
7379
  };
7365
- Readable.prototype[EE.captureRejectionSymbol] = function(err) {
7380
+ Readable.prototype[EE2.captureRejectionSymbol] = function(err) {
7366
7381
  this.destroy(err);
7367
7382
  };
7368
7383
  Readable.prototype[SymbolAsyncDispose] = function() {
@@ -8220,7 +8235,7 @@ var require_writable = __commonJS({
8220
8235
  } = require_primordials();
8221
8236
  module2.exports = Writable;
8222
8237
  Writable.WritableState = WritableState;
8223
- var { EventEmitter: EE } = require("events");
8238
+ var { EventEmitter: EE2 } = require("events");
8224
8239
  var Stream = require_legacy().Stream;
8225
8240
  var { Buffer: Buffer2 } = require("buffer");
8226
8241
  var destroyImpl = require_destroy();
@@ -8828,7 +8843,7 @@ var require_writable = __commonJS({
8828
8843
  Writable.prototype._destroy = function(err, cb) {
8829
8844
  cb(err);
8830
8845
  };
8831
- Writable.prototype[EE.captureRejectionSymbol] = function(err) {
8846
+ Writable.prototype[EE2.captureRejectionSymbol] = function(err) {
8832
8847
  this.destroy(err);
8833
8848
  };
8834
8849
  var webStreamsAdapters;
@@ -9424,16 +9439,16 @@ var require_passthrough = __commonJS({
9424
9439
  "node_modules/pino-abstract-transport/node_modules/readable-stream/lib/internal/streams/passthrough.js"(exports2, module2) {
9425
9440
  "use strict";
9426
9441
  var { ObjectSetPrototypeOf } = require_primordials();
9427
- module2.exports = PassThrough;
9442
+ module2.exports = PassThrough2;
9428
9443
  var Transform = require_transform();
9429
- ObjectSetPrototypeOf(PassThrough.prototype, Transform.prototype);
9430
- ObjectSetPrototypeOf(PassThrough, Transform);
9431
- function PassThrough(options) {
9432
- if (!(this instanceof PassThrough))
9433
- return new PassThrough(options);
9444
+ ObjectSetPrototypeOf(PassThrough2.prototype, Transform.prototype);
9445
+ ObjectSetPrototypeOf(PassThrough2, Transform);
9446
+ function PassThrough2(options) {
9447
+ if (!(this instanceof PassThrough2))
9448
+ return new PassThrough2(options);
9434
9449
  Transform.call(this, options);
9435
9450
  }
9436
- PassThrough.prototype._transform = function(chunk, encoding, cb) {
9451
+ PassThrough2.prototype._transform = function(chunk, encoding, cb) {
9437
9452
  cb(null, chunk);
9438
9453
  };
9439
9454
  }
@@ -9471,7 +9486,7 @@ var require_pipeline = __commonJS({
9471
9486
  isReadableFinished
9472
9487
  } = require_utils();
9473
9488
  var AbortController = globalThis.AbortController || require_abort_controller().AbortController;
9474
- var PassThrough;
9489
+ var PassThrough2;
9475
9490
  var Readable;
9476
9491
  var addAbortListener;
9477
9492
  function destroyer(stream, reading, writing) {
@@ -9597,7 +9612,7 @@ var require_pipeline = __commonJS({
9597
9612
  }
9598
9613
  }
9599
9614
  }
9600
- function pipeline(...streams) {
9615
+ function pipeline2(...streams) {
9601
9616
  return pipelineImpl(streams, once(popCallback(streams)));
9602
9617
  }
9603
9618
  function pipelineImpl(streams, callback, opts) {
@@ -9705,10 +9720,10 @@ var require_pipeline = __commonJS({
9705
9720
  }
9706
9721
  } else {
9707
9722
  var _ret2;
9708
- if (!PassThrough) {
9709
- PassThrough = require_passthrough();
9723
+ if (!PassThrough2) {
9724
+ PassThrough2 = require_passthrough();
9710
9725
  }
9711
- const pt = new PassThrough({
9726
+ const pt = new PassThrough2({
9712
9727
  objectMode: true
9713
9728
  });
9714
9729
  const then = (_ret2 = ret) === null || _ret2 === void 0 ? void 0 : _ret2.then;
@@ -9863,7 +9878,7 @@ var require_pipeline = __commonJS({
9863
9878
  }
9864
9879
  module2.exports = {
9865
9880
  pipelineImpl,
9866
- pipeline
9881
+ pipeline: pipeline2
9867
9882
  };
9868
9883
  }
9869
9884
  });
@@ -9872,7 +9887,7 @@ var require_pipeline = __commonJS({
9872
9887
  var require_compose = __commonJS({
9873
9888
  "node_modules/pino-abstract-transport/node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) {
9874
9889
  "use strict";
9875
- var { pipeline } = require_pipeline();
9890
+ var { pipeline: pipeline2 } = require_pipeline();
9876
9891
  var Duplex = require_duplex();
9877
9892
  var { destroyer } = require_destroy();
9878
9893
  var {
@@ -9932,7 +9947,7 @@ var require_compose = __commonJS({
9932
9947
  }
9933
9948
  }
9934
9949
  const head = streams[0];
9935
- const tail = pipeline(streams, onfinished);
9950
+ const tail = pipeline2(streams, onfinished);
9936
9951
  const writable = !!(isWritable(head) || isWritableStream(head) || isTransformStream(head));
9937
9952
  const readable = !!(isReadable(tail) || isReadableStream(tail) || isTransformStream(tail));
9938
9953
  d = new Duplex({
@@ -10476,7 +10491,7 @@ var require_promises = __commonJS({
10476
10491
  var { pipelineImpl: pl } = require_pipeline();
10477
10492
  var { finished } = require_end_of_stream();
10478
10493
  require_stream();
10479
- function pipeline(...streams) {
10494
+ function pipeline2(...streams) {
10480
10495
  return new Promise2((resolve, reject) => {
10481
10496
  let signal;
10482
10497
  let end;
@@ -10504,7 +10519,7 @@ var require_promises = __commonJS({
10504
10519
  }
10505
10520
  module2.exports = {
10506
10521
  finished,
10507
- pipeline
10522
+ pipeline: pipeline2
10508
10523
  };
10509
10524
  }
10510
10525
  });
@@ -10523,7 +10538,7 @@ var require_stream = __commonJS({
10523
10538
  } = require_errors();
10524
10539
  var compose = require_compose();
10525
10540
  var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state2();
10526
- var { pipeline } = require_pipeline();
10541
+ var { pipeline: pipeline2 } = require_pipeline();
10527
10542
  var { destroyer } = require_destroy();
10528
10543
  var eos = require_end_of_stream();
10529
10544
  var promises = require_promises();
@@ -10591,7 +10606,7 @@ var require_stream = __commonJS({
10591
10606
  Stream.Duplex = require_duplex();
10592
10607
  Stream.Transform = require_transform();
10593
10608
  Stream.PassThrough = require_passthrough();
10594
- Stream.pipeline = pipeline;
10609
+ Stream.pipeline = pipeline2;
10595
10610
  var { addAbortSignal } = require_add_abort_signal();
10596
10611
  Stream.addAbortSignal = addAbortSignal;
10597
10612
  Stream.finished = eos;
@@ -10607,7 +10622,7 @@ var require_stream = __commonJS({
10607
10622
  return promises;
10608
10623
  }
10609
10624
  });
10610
- ObjectDefineProperty(pipeline, customPromisify, {
10625
+ ObjectDefineProperty(pipeline2, customPromisify, {
10611
10626
  __proto__: null,
10612
10627
  enumerable: true,
10613
10628
  get() {
@@ -10836,7 +10851,7 @@ var require_transport_stream = __commonJS({
10836
10851
  async function loadTransportStreamBuilder2(target) {
10837
10852
  let fn;
10838
10853
  try {
10839
- const toLoad = "file://" + target;
10854
+ const toLoad = target.startsWith("file://") ? target : "file://" + target;
10840
10855
  if (toLoad.endsWith(".ts") || toLoad.endsWith(".cts")) {
10841
10856
  if (process[Symbol.for("ts-node.register.instance")]) {
10842
10857
  realRequire("ts-node/register");
@@ -10850,7 +10865,7 @@ var require_transport_stream = __commonJS({
10850
10865
  } catch (error) {
10851
10866
  if (error.code === "ENOTDIR" || error.code === "ERR_MODULE_NOT_FOUND") {
10852
10867
  fn = realRequire(target);
10853
- } else if (error.code === void 0) {
10868
+ } else if (error.code === void 0 || error.code === "ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING") {
10854
10869
  fn = realRequire(decodeURIComponent(target));
10855
10870
  } else {
10856
10871
  throw error;
@@ -10868,37 +10883,69 @@ var require_transport_stream = __commonJS({
10868
10883
  });
10869
10884
 
10870
10885
  // node_modules/pino/lib/worker.js
10886
+ var EE = require("events");
10887
+ var { pipeline, PassThrough } = require("stream");
10871
10888
  var pino = require_pino();
10872
10889
  var build = require_pino_abstract_transport();
10873
10890
  var loadTransportStreamBuilder = require_transport_stream();
10874
- module.exports = async function({ targets, levels, dedupe }) {
10875
- targets = await Promise.all(targets.map(async (t) => {
10876
- const fn = await loadTransportStreamBuilder(t.target);
10877
- const stream = await fn(t.options);
10878
- return {
10879
- level: t.level,
10880
- stream
10881
- };
10882
- }));
10883
- return build(process2, {
10884
- parse: "lines",
10885
- metadata: true,
10886
- close(err, cb) {
10887
- let expected = 0;
10888
- for (const transport of targets) {
10889
- expected++;
10890
- transport.stream.on("close", closeCb);
10891
- transport.stream.end();
10892
- }
10893
- function closeCb() {
10894
- if (--expected === 0) {
10895
- cb(err);
10891
+ module.exports = async function({ targets, pipelines, levels, dedupe }) {
10892
+ const targetStreams = [];
10893
+ if (targets && targets.length) {
10894
+ targets = await Promise.all(targets.map(async (t) => {
10895
+ const fn = await loadTransportStreamBuilder(t.target);
10896
+ const stream = await fn(t.options);
10897
+ return {
10898
+ level: t.level,
10899
+ stream
10900
+ };
10901
+ }));
10902
+ targetStreams.push(...targets);
10903
+ }
10904
+ if (pipelines && pipelines.length) {
10905
+ pipelines = await Promise.all(
10906
+ pipelines.map(async (p) => {
10907
+ let level;
10908
+ const pipeDests = await Promise.all(
10909
+ p.map(
10910
+ async (t) => {
10911
+ level = t.level;
10912
+ const fn = await loadTransportStreamBuilder(t.target);
10913
+ const stream = await fn(t.options);
10914
+ return stream;
10915
+ }
10916
+ )
10917
+ );
10918
+ return {
10919
+ level,
10920
+ stream: createPipeline(pipeDests)
10921
+ };
10922
+ })
10923
+ );
10924
+ targetStreams.push(...pipelines);
10925
+ }
10926
+ if (targetStreams.length === 1) {
10927
+ return targetStreams[0].stream;
10928
+ } else {
10929
+ return build(process2, {
10930
+ parse: "lines",
10931
+ metadata: true,
10932
+ close(err, cb) {
10933
+ let expected = 0;
10934
+ for (const transport of targetStreams) {
10935
+ expected++;
10936
+ transport.stream.on("close", closeCb);
10937
+ transport.stream.end();
10938
+ }
10939
+ function closeCb() {
10940
+ if (--expected === 0) {
10941
+ cb(err);
10942
+ }
10896
10943
  }
10897
10944
  }
10898
- }
10899
- });
10945
+ });
10946
+ }
10900
10947
  function process2(stream) {
10901
- const multi = pino.multistream(targets, { levels, dedupe });
10948
+ const multi = pino.multistream(targetStreams, { levels, dedupe });
10902
10949
  stream.on("data", function(chunk) {
10903
10950
  const { lastTime, lastMsg, lastObj, lastLevel } = this;
10904
10951
  multi.lastLevel = lastLevel;
@@ -10908,4 +10955,22 @@ module.exports = async function({ targets, levels, dedupe }) {
10908
10955
  multi.write(chunk + "\n");
10909
10956
  });
10910
10957
  }
10958
+ function createPipeline(streams) {
10959
+ const ee = new EE();
10960
+ const stream = new PassThrough({
10961
+ autoDestroy: true,
10962
+ destroy(_, cb) {
10963
+ ee.on("error", cb);
10964
+ ee.on("closed", cb);
10965
+ }
10966
+ });
10967
+ pipeline(stream, ...streams, function(err) {
10968
+ if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
10969
+ ee.emit("error", err);
10970
+ return;
10971
+ }
10972
+ ee.emit("closed");
10973
+ });
10974
+ return stream;
10975
+ }
10911
10976
  };
@@ -121,7 +121,11 @@ async function start() {
121
121
  if ((error.code === "ENOTDIR" || error.code === "ERR_MODULE_NOT_FOUND") && filename.startsWith("file://")) {
122
122
  worker = realRequire(decodeURIComponent(filename.replace("file://", "")));
123
123
  } else if (error.code === void 0 || error.code === "ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING") {
124
- worker = realRequire(decodeURIComponent(filename.replace(process.platform === "win32" ? "file:///" : "file://", "")));
124
+ try {
125
+ worker = realRequire(decodeURIComponent(filename.replace(process.platform === "win32" ? "file:///" : "file://", "")));
126
+ } catch {
127
+ throw error;
128
+ }
125
129
  } else {
126
130
  throw error;
127
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core-bundle",
3
- "version": "7.4.0",
3
+ "version": "7.5.0",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",
@@ -37,9 +37,9 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@jsforce/jsforce-node": "^3.2.0",
40
- "@salesforce/kit": "^3.1.2",
40
+ "@salesforce/kit": "^3.1.6",
41
41
  "@salesforce/schemas": "^1.9.0",
42
- "@salesforce/ts-types": "^2.0.9",
42
+ "@salesforce/ts-types": "^2.0.10",
43
43
  "ajv": "^8.15.0",
44
44
  "change-case": "^4.1.2",
45
45
  "fast-levenshtein": "^3.0.0",
@@ -48,16 +48,16 @@
48
48
  "js2xmlparser": "^4.0.1",
49
49
  "jsonwebtoken": "9.0.2",
50
50
  "jszip": "3.10.1",
51
- "pino": "^8.21.0",
51
+ "pino": "^9.2.0",
52
52
  "pino-abstract-transport": "^1.2.0",
53
- "pino-pretty": "^10.3.1",
53
+ "pino-pretty": "^11.2.1",
54
54
  "proper-lockfile": "^4.1.2",
55
55
  "semver": "^7.6.2",
56
56
  "ts-retry-promise": "^0.8.1"
57
57
  },
58
58
  "devDependencies": {
59
- "@salesforce/dev-scripts": "^8.5.0",
60
- "@salesforce/ts-sinon": "^1.4.19",
59
+ "@salesforce/dev-scripts": "^10.1.1",
60
+ "@salesforce/ts-sinon": "^1.4.22",
61
61
  "@types/benchmark": "^2.1.5",
62
62
  "@types/chai-string": "^1.4.5",
63
63
  "@types/fast-levenshtein": "^0.0.4",
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __commonJS = (cb, mod) => function __require() {
4
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
- };
6
-
7
- // node_modules/real-require/src/index.js
8
- var require_src = __commonJS({
9
- "node_modules/real-require/src/index.js"(exports2, module2) {
10
- var realImport = new Function("modulePath", "return import(modulePath)");
11
- function realRequire(modulePath) {
12
- if (typeof __non_webpack__require__ === "function") {
13
- return __non_webpack__require__(modulePath);
14
- }
15
- return require(modulePath);
16
- }
17
- module2.exports = { realImport, realRequire };
18
- }
19
- });
20
-
21
- // node_modules/pino/lib/transport-stream.js
22
- var require_transport_stream = __commonJS({
23
- "node_modules/pino/lib/transport-stream.js"(exports2, module2) {
24
- "use strict";
25
- var { realImport, realRequire } = require_src();
26
- module2.exports = loadTransportStreamBuilder2;
27
- async function loadTransportStreamBuilder2(target) {
28
- let fn;
29
- try {
30
- const toLoad = "file://" + target;
31
- if (toLoad.endsWith(".ts") || toLoad.endsWith(".cts")) {
32
- if (process[Symbol.for("ts-node.register.instance")]) {
33
- realRequire("ts-node/register");
34
- } else if (process.env && process.env.TS_NODE_DEV) {
35
- realRequire("ts-node-dev");
36
- }
37
- fn = realRequire(decodeURIComponent(target));
38
- } else {
39
- fn = await realImport(toLoad);
40
- }
41
- } catch (error) {
42
- if (error.code === "ENOTDIR" || error.code === "ERR_MODULE_NOT_FOUND") {
43
- fn = realRequire(target);
44
- } else if (error.code === void 0) {
45
- fn = realRequire(decodeURIComponent(target));
46
- } else {
47
- throw error;
48
- }
49
- }
50
- if (typeof fn === "object")
51
- fn = fn.default;
52
- if (typeof fn === "object")
53
- fn = fn.default;
54
- if (typeof fn !== "function")
55
- throw Error("exported worker is not a function");
56
- return fn;
57
- }
58
- }
59
- });
60
-
61
- // node_modules/pino/lib/worker-pipeline.js
62
- var EE = require("events");
63
- var loadTransportStreamBuilder = require_transport_stream();
64
- var { pipeline, PassThrough } = require("stream");
65
- module.exports = async function({ targets }) {
66
- const streams = await Promise.all(targets.map(async (t) => {
67
- const fn = await loadTransportStreamBuilder(t.target);
68
- const stream2 = await fn(t.options);
69
- return stream2;
70
- }));
71
- const ee = new EE();
72
- const stream = new PassThrough({
73
- autoDestroy: true,
74
- destroy(_, cb) {
75
- ee.on("error", cb);
76
- ee.on("closed", cb);
77
- }
78
- });
79
- pipeline(stream, ...streams, function(err) {
80
- if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") {
81
- ee.emit("error", err);
82
- return;
83
- }
84
- ee.emit("closed");
85
- });
86
- return stream;
87
- };