@oclif/plugin-test-esbuild 0.5.2 → 0.5.4

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/README.md CHANGED
@@ -17,7 +17,7 @@ $ npm install -g @oclif/plugin-test-esbuild
17
17
  $ bundle COMMAND
18
18
  running command...
19
19
  $ bundle (--version)
20
- @oclif/plugin-test-esbuild/0.5.2 linux-x64 node-v20.14.0
20
+ @oclif/plugin-test-esbuild/0.5.4 linux-x64 node-v20.14.0
21
21
  $ bundle --help [COMMAND]
22
22
  USAGE
23
23
  $ bundle COMMAND
@@ -10498,7 +10498,7 @@ var require_utils2 = __commonJS({
10498
10498
  return (Number(max) - Number(min)) / Number(step) >= limit;
10499
10499
  };
10500
10500
  exports.escapeNode = (block, n = 0, type) => {
10501
- let node = block.nodes[n];
10501
+ const node = block.nodes[n];
10502
10502
  if (!node) return;
10503
10503
  if (type && node.type === type || node.type === "open" || node.type === "close") {
10504
10504
  if (node.escaped !== true) {
@@ -10543,8 +10543,14 @@ var require_utils2 = __commonJS({
10543
10543
  const result = [];
10544
10544
  const flat = (arr) => {
10545
10545
  for (let i = 0; i < arr.length; i++) {
10546
- let ele = arr[i];
10547
- Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
10546
+ const ele = arr[i];
10547
+ if (Array.isArray(ele)) {
10548
+ flat(ele);
10549
+ continue;
10550
+ }
10551
+ if (ele !== void 0) {
10552
+ result.push(ele);
10553
+ }
10548
10554
  }
10549
10555
  return result;
10550
10556
  };
@@ -10561,9 +10567,9 @@ var require_stringify = __commonJS({
10561
10567
  init_cjs_shims();
10562
10568
  var utils = require_utils2();
10563
10569
  module.exports = (ast, options = {}) => {
10564
- let stringify = (node, parent = {}) => {
10565
- let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
10566
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
10570
+ const stringify = (node, parent = {}) => {
10571
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
10572
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
10567
10573
  let output = "";
10568
10574
  if (node.value) {
10569
10575
  if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
@@ -10575,7 +10581,7 @@ var require_stringify = __commonJS({
10575
10581
  return node.value;
10576
10582
  }
10577
10583
  if (node.nodes) {
10578
- for (let child of node.nodes) {
10584
+ for (const child of node.nodes) {
10579
10585
  output += stringify(child);
10580
10586
  }
10581
10587
  }
@@ -10864,7 +10870,7 @@ var require_fill_range = __commonJS({
10864
10870
  while (input.length < maxLength) input = "0" + input;
10865
10871
  return negative ? "-" + input : input;
10866
10872
  };
10867
- var toSequence = (parts, options) => {
10873
+ var toSequence = (parts, options, maxLen) => {
10868
10874
  parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
10869
10875
  parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
10870
10876
  let prefix = options.capture ? "" : "?:";
@@ -10872,10 +10878,10 @@ var require_fill_range = __commonJS({
10872
10878
  let negatives = "";
10873
10879
  let result;
10874
10880
  if (parts.positives.length) {
10875
- positives = parts.positives.join("|");
10881
+ positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
10876
10882
  }
10877
10883
  if (parts.negatives.length) {
10878
- negatives = `-(${prefix}${parts.negatives.join("|")})`;
10884
+ negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
10879
10885
  }
10880
10886
  if (positives && negatives) {
10881
10887
  result = `${positives}|${negatives}`;
@@ -10952,7 +10958,7 @@ var require_fill_range = __commonJS({
10952
10958
  index++;
10953
10959
  }
10954
10960
  if (options.toRegex === true) {
10955
- return step > 1 ? toSequence(parts, options) : toRegex(range, null, { wrap: false, ...options });
10961
+ return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options });
10956
10962
  }
10957
10963
  return range;
10958
10964
  };
@@ -11018,16 +11024,17 @@ var require_compile = __commonJS({
11018
11024
  var fill = require_fill_range();
11019
11025
  var utils = require_utils2();
11020
11026
  var compile = (ast, options = {}) => {
11021
- let walk = (node, parent = {}) => {
11022
- let invalidBlock = utils.isInvalidBrace(parent);
11023
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
11024
- let invalid = invalidBlock === true || invalidNode === true;
11025
- let prefix = options.escapeInvalid === true ? "\\" : "";
11027
+ const walk = (node, parent = {}) => {
11028
+ const invalidBlock = utils.isInvalidBrace(parent);
11029
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
11030
+ const invalid = invalidBlock === true || invalidNode === true;
11031
+ const prefix = options.escapeInvalid === true ? "\\" : "";
11026
11032
  let output = "";
11027
11033
  if (node.isOpen === true) {
11028
11034
  return prefix + node.value;
11029
11035
  }
11030
11036
  if (node.isClose === true) {
11037
+ console.log("node.isClose", prefix, node.value);
11031
11038
  return prefix + node.value;
11032
11039
  }
11033
11040
  if (node.type === "open") {
@@ -11043,14 +11050,14 @@ var require_compile = __commonJS({
11043
11050
  return node.value;
11044
11051
  }
11045
11052
  if (node.nodes && node.ranges > 0) {
11046
- let args = utils.reduce(node.nodes);
11047
- let range = fill(...args, { ...options, wrap: false, toRegex: true });
11053
+ const args = utils.reduce(node.nodes);
11054
+ const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
11048
11055
  if (range.length !== 0) {
11049
11056
  return args.length > 1 && range.length > 1 ? `(${range})` : range;
11050
11057
  }
11051
11058
  }
11052
11059
  if (node.nodes) {
11053
- for (let child of node.nodes) {
11060
+ for (const child of node.nodes) {
11054
11061
  output += walk(child, node);
11055
11062
  }
11056
11063
  }
@@ -11071,16 +11078,16 @@ var require_expand = __commonJS({
11071
11078
  var stringify = require_stringify();
11072
11079
  var utils = require_utils2();
11073
11080
  var append = (queue = "", stash = "", enclose = false) => {
11074
- let result = [];
11081
+ const result = [];
11075
11082
  queue = [].concat(queue);
11076
11083
  stash = [].concat(stash);
11077
11084
  if (!stash.length) return queue;
11078
11085
  if (!queue.length) {
11079
11086
  return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
11080
11087
  }
11081
- for (let item of queue) {
11088
+ for (const item of queue) {
11082
11089
  if (Array.isArray(item)) {
11083
- for (let value of item) {
11090
+ for (const value of item) {
11084
11091
  result.push(append(value, stash, enclose));
11085
11092
  }
11086
11093
  } else {
@@ -11093,8 +11100,8 @@ var require_expand = __commonJS({
11093
11100
  return utils.flatten(result);
11094
11101
  };
11095
11102
  var expand = (ast, options = {}) => {
11096
- let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
11097
- let walk = (node, parent = {}) => {
11103
+ const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
11104
+ const walk = (node, parent = {}) => {
11098
11105
  node.queue = [];
11099
11106
  let p = parent;
11100
11107
  let q = parent.queue;
@@ -11111,7 +11118,7 @@ var require_expand = __commonJS({
11111
11118
  return;
11112
11119
  }
11113
11120
  if (node.nodes && node.ranges > 0) {
11114
- let args = utils.reduce(node.nodes);
11121
+ const args = utils.reduce(node.nodes);
11115
11122
  if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
11116
11123
  throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
11117
11124
  }
@@ -11123,7 +11130,7 @@ var require_expand = __commonJS({
11123
11130
  node.nodes = [];
11124
11131
  return;
11125
11132
  }
11126
- let enclose = utils.encloseBrace(node);
11133
+ const enclose = utils.encloseBrace(node);
11127
11134
  let queue = node.queue;
11128
11135
  let block = node;
11129
11136
  while (block.type !== "brace" && block.type !== "root" && block.parent) {
@@ -11131,7 +11138,7 @@ var require_expand = __commonJS({
11131
11138
  queue = block.queue;
11132
11139
  }
11133
11140
  for (let i = 0; i < node.nodes.length; i++) {
11134
- let child = node.nodes[i];
11141
+ const child = node.nodes[i];
11135
11142
  if (child.type === "comma" && node.type === "brace") {
11136
11143
  if (i === 1) queue.push("");
11137
11144
  queue.push("");
@@ -11163,7 +11170,7 @@ var require_constants = __commonJS({
11163
11170
  "use strict";
11164
11171
  init_cjs_shims();
11165
11172
  module.exports = {
11166
- MAX_LENGTH: 1024 * 64,
11173
+ MAX_LENGTH: 1e4,
11167
11174
  // Digits
11168
11175
  CHAR_0: "0",
11169
11176
  /* 0 */
@@ -11298,21 +11305,20 @@ var require_parse = __commonJS({
11298
11305
  if (typeof input !== "string") {
11299
11306
  throw new TypeError("Expected a string");
11300
11307
  }
11301
- let opts = options || {};
11302
- let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
11308
+ const opts = options || {};
11309
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
11303
11310
  if (input.length > max) {
11304
11311
  throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
11305
11312
  }
11306
- let ast = { type: "root", input, nodes: [] };
11307
- let stack = [ast];
11313
+ const ast = { type: "root", input, nodes: [] };
11314
+ const stack = [ast];
11308
11315
  let block = ast;
11309
11316
  let prev = ast;
11310
11317
  let brackets = 0;
11311
- let length = input.length;
11318
+ const length = input.length;
11312
11319
  let index = 0;
11313
11320
  let depth = 0;
11314
11321
  let value;
11315
- let memo = {};
11316
11322
  const advance = () => input[index++];
11317
11323
  const push = (node) => {
11318
11324
  if (node.type === "text" && prev.type === "dot") {
@@ -11345,7 +11351,6 @@ var require_parse = __commonJS({
11345
11351
  }
11346
11352
  if (value === CHAR_LEFT_SQUARE_BRACKET) {
11347
11353
  brackets++;
11348
- let closed = true;
11349
11354
  let next;
11350
11355
  while (index < length && (next = advance())) {
11351
11356
  value += next;
@@ -11384,7 +11389,7 @@ var require_parse = __commonJS({
11384
11389
  continue;
11385
11390
  }
11386
11391
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
11387
- let open = value;
11392
+ const open = value;
11388
11393
  let next;
11389
11394
  if (options.keepQuotes !== true) {
11390
11395
  value = "";
@@ -11405,8 +11410,8 @@ var require_parse = __commonJS({
11405
11410
  }
11406
11411
  if (value === CHAR_LEFT_CURLY_BRACE) {
11407
11412
  depth++;
11408
- let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
11409
- let brace = {
11413
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
11414
+ const brace = {
11410
11415
  type: "brace",
11411
11416
  open: true,
11412
11417
  close: false,
@@ -11426,7 +11431,7 @@ var require_parse = __commonJS({
11426
11431
  push({ type: "text", value });
11427
11432
  continue;
11428
11433
  }
11429
- let type = "close";
11434
+ const type = "close";
11430
11435
  block = stack.pop();
11431
11436
  block.close = true;
11432
11437
  push({ type, value });
@@ -11437,7 +11442,7 @@ var require_parse = __commonJS({
11437
11442
  if (value === CHAR_COMMA && depth > 0) {
11438
11443
  if (block.ranges > 0) {
11439
11444
  block.ranges = 0;
11440
- let open = block.nodes.shift();
11445
+ const open = block.nodes.shift();
11441
11446
  block.nodes = [open, { type: "text", value: stringify(block) }];
11442
11447
  }
11443
11448
  push({ type: "comma", value });
@@ -11445,7 +11450,7 @@ var require_parse = __commonJS({
11445
11450
  continue;
11446
11451
  }
11447
11452
  if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
11448
- let siblings = block.nodes;
11453
+ const siblings = block.nodes;
11449
11454
  if (depth === 0 || siblings.length === 0) {
11450
11455
  push({ type: "text", value });
11451
11456
  continue;
@@ -11466,7 +11471,7 @@ var require_parse = __commonJS({
11466
11471
  }
11467
11472
  if (prev.type === "range") {
11468
11473
  siblings.pop();
11469
- let before = siblings[siblings.length - 1];
11474
+ const before = siblings[siblings.length - 1];
11470
11475
  before.value += prev.value + value;
11471
11476
  prev = before;
11472
11477
  block.ranges--;
@@ -11488,8 +11493,8 @@ var require_parse = __commonJS({
11488
11493
  node.invalid = true;
11489
11494
  }
11490
11495
  });
11491
- let parent = stack[stack.length - 1];
11492
- let index2 = parent.nodes.indexOf(block);
11496
+ const parent = stack[stack.length - 1];
11497
+ const index2 = parent.nodes.indexOf(block);
11493
11498
  parent.nodes.splice(index2, 1, ...block.nodes);
11494
11499
  }
11495
11500
  } while (stack.length > 0);
@@ -11512,8 +11517,8 @@ var require_braces = __commonJS({
11512
11517
  var braces = (input, options = {}) => {
11513
11518
  let output = [];
11514
11519
  if (Array.isArray(input)) {
11515
- for (let pattern of input) {
11516
- let result = braces.create(pattern, options);
11520
+ for (const pattern of input) {
11521
+ const result = braces.create(pattern, options);
11517
11522
  if (Array.isArray(result)) {
11518
11523
  output.push(...result);
11519
11524
  } else {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_lib
3
- } from "./chunk-5SUCPGFA.js";
3
+ } from "./chunk-ARIG64MM.js";
4
4
  import {
5
5
  __toESM,
6
6
  init_cjs_shims
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_lib
3
- } from "./chunk-5SUCPGFA.js";
3
+ } from "./chunk-ARIG64MM.js";
4
4
  import {
5
5
  __toESM,
6
6
  init_cjs_shims
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_lib
3
- } from "./chunk-5SUCPGFA.js";
3
+ } from "./chunk-ARIG64MM.js";
4
4
  import {
5
5
  __toESM,
6
6
  init_cjs_shims
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_lib
3
- } from "./chunk-5SUCPGFA.js";
3
+ } from "./chunk-ARIG64MM.js";
4
4
  import {
5
5
  __toESM,
6
6
  init_cjs_shims
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ESBuild
3
- } from "../chunk-OPQR7U44.js";
4
- import "../chunk-5SUCPGFA.js";
3
+ } from "../chunk-WAQ24WK2.js";
4
+ import "../chunk-ARIG64MM.js";
5
5
  import "../chunk-A4WCMQ5V.js";
6
6
  import "../chunk-RRP6KXWN.js";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Hello
3
- } from "../../chunk-MN6CETUK.js";
4
- import "../../chunk-5SUCPGFA.js";
3
+ } from "../../chunk-AWNX4XTK.js";
4
+ import "../../chunk-ARIG64MM.js";
5
5
  import "../../chunk-A4WCMQ5V.js";
6
6
  import "../../chunk-RRP6KXWN.js";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  World
3
- } from "../../chunk-EKA2OJBU.js";
4
- import "../../chunk-5SUCPGFA.js";
3
+ } from "../../chunk-XQXS2F5X.js";
4
+ import "../../chunk-ARIG64MM.js";
5
5
  import "../../chunk-A4WCMQ5V.js";
6
6
  import "../../chunk-RRP6KXWN.js";
7
7
  export {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  init_default
3
- } from "../../chunk-THX4UIMR.js";
4
- import "../../chunk-5SUCPGFA.js";
3
+ } from "../../chunk-YYNWCE4H.js";
4
+ import "../../chunk-ARIG64MM.js";
5
5
  import "../../chunk-A4WCMQ5V.js";
6
6
  import "../../chunk-RRP6KXWN.js";
7
7
  export {
package/dist/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  ESBuild
3
- } from "./chunk-OPQR7U44.js";
3
+ } from "./chunk-WAQ24WK2.js";
4
4
  import {
5
5
  Hello
6
- } from "./chunk-MN6CETUK.js";
6
+ } from "./chunk-AWNX4XTK.js";
7
7
  import {
8
8
  World
9
- } from "./chunk-EKA2OJBU.js";
9
+ } from "./chunk-XQXS2F5X.js";
10
10
  import {
11
11
  init_default
12
- } from "./chunk-THX4UIMR.js";
12
+ } from "./chunk-YYNWCE4H.js";
13
13
  import {
14
14
  require_ansis,
15
15
  require_lib,
16
16
  require_src
17
- } from "./chunk-5SUCPGFA.js";
17
+ } from "./chunk-ARIG64MM.js";
18
18
  import "./chunk-A4WCMQ5V.js";
19
19
  import {
20
20
  require_lib as require_lib2,
@@ -474,5 +474,5 @@
474
474
  "enableJsonFlag": false
475
475
  }
476
476
  },
477
- "version": "0.5.2"
477
+ "version": "0.5.4"
478
478
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oclif/plugin-test-esbuild",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Bundled plugin for testing",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/plugin-test-esbuild/issues",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@oclif/core": "^4",
15
- "@oclif/plugin-test-esm-1": "^0.8.0",
15
+ "@oclif/plugin-test-esm-1": "^0.8.4",
16
16
  "@oclif/plugin-plugins": "^5.2.3"
17
17
  },
18
18
  "devDependencies": {
@@ -28,7 +28,7 @@
28
28
  "eslint-config-oclif-typescript": "^3",
29
29
  "eslint-config-prettier": "^9.1.0",
30
30
  "mocha": "^10",
31
- "oclif": "^4.13.1",
31
+ "oclif": "^4.13.6",
32
32
  "shx": "^0.3.4",
33
33
  "ts-node": "^10.9.2",
34
34
  "typescript": "^5"