@kubb/cli 3.18.3 → 4.0.2

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.
@@ -95,8 +95,7 @@ const stringToUint8Array = (string) => textEncoder$1.encode(string);
95
95
  const textDecoder = new TextDecoder();
96
96
  const uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array);
97
97
  const joinToString = (uint8ArraysOrStrings, encoding) => {
98
- const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding);
99
- return strings.join("");
98
+ return uint8ArraysToStrings(uint8ArraysOrStrings, encoding).join("");
100
99
  };
101
100
  const uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => {
102
101
  if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) return uint8ArraysOrStrings;
@@ -270,12 +269,11 @@ const parseFd = (fdName) => {
270
269
  };
271
270
  const FD_REGEXP = /^fd(\d+)$/;
272
271
  const addDefaultValue$1 = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue);
273
- const verboseDefault = debuglog("execa").enabled ? "full" : "none";
274
272
  const DEFAULT_OPTIONS = {
275
273
  lines: false,
276
274
  buffer: true,
277
275
  maxBuffer: 1e3 * 1e3 * 100,
278
- verbose: verboseDefault,
276
+ verbose: debuglog("execa").enabled ? "full" : "none",
279
277
  stripFinalNewline: true
280
278
  };
281
279
  const FD_SPECIFIC_OPTIONS = [
@@ -640,7 +638,7 @@ var figures_default = figures;
640
638
  const replacements = Object.entries(specialMainSymbols);
641
639
 
642
640
  //#endregion
643
- //#region ../../node_modules/.pnpm/yoctocolors@2.1.1/node_modules/yoctocolors/base.js
641
+ //#region ../../node_modules/.pnpm/yoctocolors@2.1.2/node_modules/yoctocolors/base.js
644
642
  const hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;
645
643
  const format = (open, close) => {
646
644
  if (!hasColors) return (input) => input;
@@ -652,8 +650,9 @@ const format = (open, close) => {
652
650
  if (index === -1) return openCode + string + closeCode;
653
651
  let result = openCode;
654
652
  let lastIndex = 0;
653
+ const replaceCode = (close === 22 ? closeCode : "") + openCode;
655
654
  while (index !== -1) {
656
- result += string.slice(lastIndex, index) + openCode;
655
+ result += string.slice(lastIndex, index) + replaceCode;
657
656
  lastIndex = index + closeCode.length;
658
657
  index = string.indexOf(closeCode, lastIndex);
659
658
  }
@@ -776,16 +775,14 @@ const getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split(
776
775
  message
777
776
  }));
778
777
  const getPrintedLine = (verboseObject) => {
779
- const verboseLine = defaultVerboseFunction(verboseObject);
780
778
  return {
781
- verboseLine,
779
+ verboseLine: defaultVerboseFunction(verboseObject),
782
780
  verboseObject
783
781
  };
784
782
  };
785
783
  const serializeVerboseMessage = (message) => {
786
784
  const messageString = typeof message === "string" ? message : inspect(message);
787
- const escapedMessage = escapeLines(messageString);
788
- return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE));
785
+ return escapeLines(messageString).replaceAll(" ", " ".repeat(TAB_SIZE));
789
786
  };
790
787
  const TAB_SIZE = 2;
791
788
 
@@ -904,8 +901,7 @@ var require_mode = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/isexe@
904
901
  var g = parseInt("010", 8);
905
902
  var o$1 = parseInt("001", 8);
906
903
  var ug = u$1 | g;
907
- var ret = mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
908
- return ret;
904
+ return mod & o$1 || mod & g && gid === myGid || mod & u$1 && uid === myUid || mod & ug && myUid === 0;
909
905
  }
910
906
  }) });
911
907
 
@@ -1013,8 +1009,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
1013
1009
  for (let j = 0; j < pathExt.length; j++) {
1014
1010
  const cur = p + pathExt[j];
1015
1011
  try {
1016
- const is = isexe.sync(cur, { pathExt: pathExtExe });
1017
- if (is) if (opt.all) found.push(cur);
1012
+ if (isexe.sync(cur, { pathExt: pathExtExe })) if (opt.all) found.push(cur);
1018
1013
  else return cur;
1019
1014
  } catch (ex) {}
1020
1015
  }
@@ -1032,8 +1027,7 @@ var require_which = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/which
1032
1027
  var require_path_key = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js": ((exports, module) => {
1033
1028
  const pathKey$1 = (options = {}) => {
1034
1029
  const environment = options.env || process.env;
1035
- const platform$1 = options.platform || process.platform;
1036
- if (platform$1 !== "win32") return "PATH";
1030
+ if ((options.platform || process.platform) !== "win32") return "PATH";
1037
1031
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
1038
1032
  };
1039
1033
  module.exports = pathKey$1;
@@ -1161,12 +1155,11 @@ var require_parse = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/cross
1161
1155
  parsed.command = path$1.normalize(parsed.command);
1162
1156
  parsed.command = escape.command(parsed.command);
1163
1157
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
1164
- const shellCommand = [parsed.command].concat(parsed.args).join(" ");
1165
1158
  parsed.args = [
1166
1159
  "/d",
1167
1160
  "/s",
1168
1161
  "/c",
1169
- `"${shellCommand}"`
1162
+ `"${[parsed.command].concat(parsed.args).join(" ")}"`
1170
1163
  ];
1171
1164
  parsed.command = process.env.comspec || "cmd.exe";
1172
1165
  parsed.options.windowsVerbatimArguments = true;
@@ -1640,16 +1633,14 @@ const SIGNALS = [
1640
1633
  //#region ../../node_modules/.pnpm/human-signals@8.0.1/node_modules/human-signals/build/src/signals.js
1641
1634
  const getSignals = () => {
1642
1635
  const realtimeSignals = getRealtimeSignals();
1643
- const signals$1 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
1644
- return signals$1;
1636
+ return [...SIGNALS, ...realtimeSignals].map(normalizeSignal$1);
1645
1637
  };
1646
1638
  const normalizeSignal$1 = ({ name, number: defaultNumber, description, action, forced = false, standard }) => {
1647
1639
  const { signals: { [name]: constantSignal } } = constants;
1648
1640
  const supported = constantSignal !== void 0;
1649
- const number = supported ? constantSignal : defaultNumber;
1650
1641
  return {
1651
1642
  name,
1652
- number,
1643
+ number: supported ? constantSignal : defaultNumber,
1653
1644
  description,
1654
1645
  supported,
1655
1646
  action,
@@ -3168,7 +3159,7 @@ function parseMilliseconds(milliseconds) {
3168
3159
  }
3169
3160
 
3170
3161
  //#endregion
3171
- //#region ../../node_modules/.pnpm/pretty-ms@9.2.0/node_modules/pretty-ms/index.js
3162
+ //#region ../../node_modules/.pnpm/pretty-ms@9.3.0/node_modules/pretty-ms/index.js
3172
3163
  const isZero = (value) => value === 0 || value === 0n;
3173
3164
  const pluralize = (word, count$1) => count$1 === 1 || count$1 === 1n ? word : `${word}s`;
3174
3165
  const SECOND_ROUNDING_EPSILON = 1e-7;
@@ -3193,8 +3184,7 @@ function prettyMilliseconds(milliseconds, options) {
3193
3184
  let result = [];
3194
3185
  const floorDecimals = (value, decimalDigits) => {
3195
3186
  const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON);
3196
- const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits;
3197
- return flooredValue.toFixed(decimalDigits);
3187
+ return (Math.round(flooredInterimValue) / 10 ** decimalDigits).toFixed(decimalDigits);
3198
3188
  };
3199
3189
  const add = (value, long, short, valueString) => {
3200
3190
  if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) return;
@@ -3218,7 +3208,7 @@ function prettyMilliseconds(milliseconds, options) {
3218
3208
  add(Number(parsed.hours), "hour", "h");
3219
3209
  }
3220
3210
  add(Number(parsed.minutes), "minute", "m");
3221
- if (!options.hideSeconds) if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) {
3211
+ if (!options.hideSeconds) if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3 && !options.subSecondsAsDecimals) {
3222
3212
  const seconds = Number(parsed.seconds);
3223
3213
  const milliseconds$1 = Number(parsed.milliseconds);
3224
3214
  const microseconds = Number(parsed.microseconds);
@@ -3231,8 +3221,7 @@ function prettyMilliseconds(milliseconds, options) {
3231
3221
  } else {
3232
3222
  const millisecondsAndBelow = milliseconds$1 + microseconds / 1e3 + nanoseconds / 1e6;
3233
3223
  const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
3234
- const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
3235
- const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
3224
+ const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
3236
3225
  add(Number.parseFloat(millisecondsString), "millisecond", "ms", millisecondsString);
3237
3226
  }
3238
3227
  } else {
@@ -3397,10 +3386,9 @@ const TYPE_TO_MESSAGE = {
3397
3386
  const getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms);
3398
3387
  const getOutputObjectModes = (objectMode, index, newTransforms) => {
3399
3388
  const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode;
3400
- const readableObjectMode = objectMode ?? writableObjectMode;
3401
3389
  return {
3402
3390
  writableObjectMode,
3403
- readableObjectMode
3391
+ readableObjectMode: objectMode ?? writableObjectMode
3404
3392
  };
3405
3393
  };
3406
3394
  const getInputObjectModes = (objectMode, index, newTransforms) => {
@@ -3737,8 +3725,7 @@ const throwOnDuplicateStream = (stdioItem, optionName, type) => {
3737
3725
  //#endregion
3738
3726
  //#region ../../node_modules/.pnpm/execa@9.6.0/node_modules/execa/lib/stdio/handle.js
3739
3727
  const handleStdio = (addProperties$2, options, verboseInfo, isSync) => {
3740
- const stdio = normalizeStdioOption(options, verboseInfo, isSync);
3741
- const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({
3728
+ const initialFileDescriptors = normalizeStdioOption(options, verboseInfo, isSync).map((stdioOption, fdNumber) => getFileDescriptor({
3742
3729
  stdioOption,
3743
3730
  fdNumber,
3744
3731
  options,
@@ -3779,8 +3766,7 @@ const getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => {
3779
3766
  };
3780
3767
  };
3781
3768
  const initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => {
3782
- const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption];
3783
- const initialStdioItems = [...values.map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
3769
+ const initialStdioItems = [...(Array.isArray(stdioOption) ? stdioOption : [stdioOption]).map((value) => initializeStdioItem(value, optionName)), ...handleInputOptions(options, fdNumber)];
3784
3770
  const stdioItems = filterDuplicates(initialStdioItems);
3785
3771
  const isStdioArray = stdioItems.length > 1;
3786
3772
  validateStdioArray(stdioItems, isStdioArray, optionName);
@@ -3972,8 +3958,7 @@ const appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) {
3972
3958
  yield chunk;
3973
3959
  return;
3974
3960
  }
3975
- const newline = isWindowsNewline ? windowsNewline : unixNewline;
3976
- yield concatBytes(chunk, newline);
3961
+ yield concatBytes(chunk, isWindowsNewline ? windowsNewline : unixNewline);
3977
3962
  };
3978
3963
  const concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`;
3979
3964
  const linesStringInfo = {
@@ -4118,7 +4103,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
4118
4103
  const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state) : pushChunksSync.bind(void 0, transformChunkSync);
4119
4104
  const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state) : pushChunksSync.bind(void 0, finalChunksSync);
4120
4105
  const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state) : void 0;
4121
- const stream = new Transform({
4106
+ return { stream: new Transform({
4122
4107
  writableObjectMode,
4123
4108
  writableHighWaterMark: getDefaultHighWaterMark(writableObjectMode),
4124
4109
  readableObjectMode,
@@ -4134,8 +4119,7 @@ const generatorToStream = ({ value, value: { transform, final, writableObjectMod
4134
4119
  finalMethod([generators], this, done);
4135
4120
  },
4136
4121
  destroy: destroyMethod
4137
- });
4138
- return { stream };
4122
+ }) };
4139
4123
  };
4140
4124
  const runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => {
4141
4125
  const generators = stdioItems.filter(({ type }) => type === "generator");
@@ -4180,8 +4164,7 @@ const addInputOptionSync = (fileDescriptors, fdNumber, options) => {
4180
4164
  const [{ type, optionName }] = allStdioItems;
4181
4165
  throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type]} with synchronous methods.`);
4182
4166
  }
4183
- const allContents = allStdioItems.map(({ contents }) => contents);
4184
- const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
4167
+ const transformedContents = allStdioItems.map(({ contents }) => contents).map((contents) => applySingleInputGeneratorsSync(contents, stdioItems));
4185
4168
  options.input = joinToUint8Array(transformedContents);
4186
4169
  };
4187
4170
  const applySingleInputGeneratorsSync = (contents, stdioItems) => {
@@ -4222,17 +4205,16 @@ const transformOutputSync = ({ fileDescriptors, syncResult: { output }, options,
4222
4205
  if (output === null) return { output: Array.from({ length: 3 }) };
4223
4206
  const state = {};
4224
4207
  const outputFiles = /* @__PURE__ */ new Set([]);
4225
- const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({
4226
- result,
4227
- fileDescriptors,
4228
- fdNumber,
4229
- state,
4230
- outputFiles,
4231
- isMaxBuffer,
4232
- verboseInfo
4233
- }, options));
4234
4208
  return {
4235
- output: transformedOutput,
4209
+ output: output.map((result, fdNumber) => transformOutputResultSync({
4210
+ result,
4211
+ fileDescriptors,
4212
+ fdNumber,
4213
+ state,
4214
+ outputFiles,
4215
+ isMaxBuffer,
4216
+ verboseInfo
4217
+ }, options)),
4236
4218
  ...state
4237
4219
  };
4238
4220
  };
@@ -4733,8 +4715,7 @@ const addProperties = {
4733
4715
  nodeStream: ({ value }) => ({ stream: value }),
4734
4716
  webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) {
4735
4717
  const objectMode = writableObjectMode || readableObjectMode;
4736
- const stream = Duplex.fromWeb(transform, { objectMode });
4737
- return { stream };
4718
+ return { stream: Duplex.fromWeb(transform, { objectMode }) };
4738
4719
  },
4739
4720
  duplex: ({ value: { transform } }) => ({ stream: transform }),
4740
4721
  native() {}
@@ -5257,19 +5238,15 @@ const getDestinationStream = (boundOptions, createNested, pipeArguments) => {
5257
5238
  }
5258
5239
  };
5259
5240
  const getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => {
5260
- if (Array.isArray(firstArgument)) {
5261
- const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
5262
- return {
5263
- destination,
5264
- pipeOptions: boundOptions
5265
- };
5266
- }
5241
+ if (Array.isArray(firstArgument)) return {
5242
+ destination: createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments),
5243
+ pipeOptions: boundOptions
5244
+ };
5267
5245
  if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
5268
5246
  if (Object.keys(boundOptions).length > 0) throw new TypeError("Please use .pipe(\"file\", ..., options) or .pipe(execa(\"file\", ..., options)) instead of .pipe(options)(\"file\", ...).");
5269
5247
  const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments);
5270
- const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions);
5271
5248
  return {
5272
- destination,
5249
+ destination: createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions),
5273
5250
  pipeOptions: rawOptions
5274
5251
  };
5275
5252
  }
@@ -5289,8 +5266,7 @@ const mapDestinationArguments = ({ options }) => ({ options: {
5289
5266
  } });
5290
5267
  const getSourceStream = (source, from) => {
5291
5268
  try {
5292
- const sourceStream = getFromStream(source, from);
5293
- return { sourceStream };
5269
+ return { sourceStream: getFromStream(source, from) };
5294
5270
  } catch (error) {
5295
5271
  return { sourceError: error };
5296
5272
  }
@@ -5384,9 +5360,8 @@ const unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ?
5384
5360
  const unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => {
5385
5361
  await aborted(unpipeSignal, sourceStream);
5386
5362
  await mergedStream.remove(sourceStream);
5387
- const error = /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option.");
5388
5363
  throw createNonCommandError({
5389
- error,
5364
+ error: /* @__PURE__ */ new Error("Pipe canceled by `unpipeSignal` option."),
5390
5365
  fileDescriptors,
5391
5366
  sourceOptions,
5392
5367
  startTime
@@ -5870,9 +5845,8 @@ const addConcurrentStream = (concurrentStreams, stream, waitName) => {
5870
5845
  const promises = weakMap.get(stream);
5871
5846
  const promise = createDeferred();
5872
5847
  promises.push(promise);
5873
- const resolve = promise.resolve.bind(promise);
5874
5848
  return {
5875
- resolve,
5849
+ resolve: promise.resolve.bind(promise),
5876
5850
  promises
5877
5851
  };
5878
5852
  };
@@ -6520,8 +6494,7 @@ function getErrorCauses(errors) {
6520
6494
  //#endregion
6521
6495
  //#region src/utils/parseHrtimeToSeconds.ts
6522
6496
  function parseHrtimeToSeconds(hrtime$1) {
6523
- const seconds = (hrtime$1[0] + hrtime$1[1] / 1e9).toFixed(3);
6524
- return seconds;
6497
+ return (hrtime$1[0] + hrtime$1[1] / 1e9).toFixed(3);
6525
6498
  }
6526
6499
 
6527
6500
  //#endregion
@@ -6547,7 +6520,6 @@ function getSummary({ pluginManager, filesCreated, status, hrStart, config }) {
6547
6520
  [`${pc.bold("Output:")} ${meta.output}`, true]
6548
6521
  ].map((item) => {
6549
6522
  if (item.at(1)) return item.at(0);
6550
- return void 0;
6551
6523
  }).filter(Boolean).join("\n"));
6552
6524
  return [...logs];
6553
6525
  }
@@ -6729,4 +6701,4 @@ async function generate({ input, config, progressCache, args }) {
6729
6701
 
6730
6702
  //#endregion
6731
6703
  export { generate };
6732
- //# sourceMappingURL=generate-DvSF6lmv.js.map
6704
+ //# sourceMappingURL=generate-vHDmA5Mm.js.map