@carbon/upgrade 11.15.0 → 11.16.0-rc.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.
Files changed (2) hide show
  1. package/cli.js +54 -49
  2. package/package.json +4 -4
package/cli.js CHANGED
@@ -39918,7 +39918,7 @@ var require_utils4 = __commonJS({
39918
39918
  return (Number(max) - Number(min)) / Number(step) >= limit;
39919
39919
  };
39920
39920
  exports2.escapeNode = (block, n = 0, type) => {
39921
- let node = block.nodes[n];
39921
+ const node = block.nodes[n];
39922
39922
  if (!node) return;
39923
39923
  if (type && node.type === type || node.type === "open" || node.type === "close") {
39924
39924
  if (node.escaped !== true) {
@@ -39963,8 +39963,14 @@ var require_utils4 = __commonJS({
39963
39963
  const result = [];
39964
39964
  const flat = (arr) => {
39965
39965
  for (let i = 0; i < arr.length; i++) {
39966
- let ele = arr[i];
39967
- Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
39966
+ const ele = arr[i];
39967
+ if (Array.isArray(ele)) {
39968
+ flat(ele);
39969
+ continue;
39970
+ }
39971
+ if (ele !== void 0) {
39972
+ result.push(ele);
39973
+ }
39968
39974
  }
39969
39975
  return result;
39970
39976
  };
@@ -39980,9 +39986,9 @@ var require_stringify = __commonJS({
39980
39986
  "use strict";
39981
39987
  var utils = require_utils4();
39982
39988
  module2.exports = (ast, options = {}) => {
39983
- let stringify = (node, parent = {}) => {
39984
- let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
39985
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
39989
+ const stringify = (node, parent = {}) => {
39990
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
39991
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
39986
39992
  let output = "";
39987
39993
  if (node.value) {
39988
39994
  if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
@@ -39994,7 +40000,7 @@ var require_stringify = __commonJS({
39994
40000
  return node.value;
39995
40001
  }
39996
40002
  if (node.nodes) {
39997
- for (let child of node.nodes) {
40003
+ for (const child of node.nodes) {
39998
40004
  output += stringify(child);
39999
40005
  }
40000
40006
  }
@@ -40280,7 +40286,7 @@ var require_fill_range = __commonJS({
40280
40286
  while (input.length < maxLength) input = "0" + input;
40281
40287
  return negative ? "-" + input : input;
40282
40288
  };
40283
- var toSequence = (parts, options) => {
40289
+ var toSequence = (parts, options, maxLen) => {
40284
40290
  parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
40285
40291
  parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
40286
40292
  let prefix = options.capture ? "" : "?:";
@@ -40288,10 +40294,10 @@ var require_fill_range = __commonJS({
40288
40294
  let negatives = "";
40289
40295
  let result;
40290
40296
  if (parts.positives.length) {
40291
- positives = parts.positives.join("|");
40297
+ positives = parts.positives.map((v) => toMaxLen(String(v), maxLen)).join("|");
40292
40298
  }
40293
40299
  if (parts.negatives.length) {
40294
- negatives = `-(${prefix}${parts.negatives.join("|")})`;
40300
+ negatives = `-(${prefix}${parts.negatives.map((v) => toMaxLen(String(v), maxLen)).join("|")})`;
40295
40301
  }
40296
40302
  if (positives && negatives) {
40297
40303
  result = `${positives}|${negatives}`;
@@ -40368,7 +40374,7 @@ var require_fill_range = __commonJS({
40368
40374
  index++;
40369
40375
  }
40370
40376
  if (options.toRegex === true) {
40371
- return step > 1 ? toSequence(parts, options) : toRegex(range, null, { wrap: false, ...options });
40377
+ return step > 1 ? toSequence(parts, options, maxLen) : toRegex(range, null, { wrap: false, ...options });
40372
40378
  }
40373
40379
  return range;
40374
40380
  };
@@ -40433,16 +40439,17 @@ var require_compile = __commonJS({
40433
40439
  var fill = require_fill_range();
40434
40440
  var utils = require_utils4();
40435
40441
  var compile = (ast, options = {}) => {
40436
- let walk = (node, parent = {}) => {
40437
- let invalidBlock = utils.isInvalidBrace(parent);
40438
- let invalidNode = node.invalid === true && options.escapeInvalid === true;
40439
- let invalid = invalidBlock === true || invalidNode === true;
40440
- let prefix = options.escapeInvalid === true ? "\\" : "";
40442
+ const walk = (node, parent = {}) => {
40443
+ const invalidBlock = utils.isInvalidBrace(parent);
40444
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
40445
+ const invalid = invalidBlock === true || invalidNode === true;
40446
+ const prefix = options.escapeInvalid === true ? "\\" : "";
40441
40447
  let output = "";
40442
40448
  if (node.isOpen === true) {
40443
40449
  return prefix + node.value;
40444
40450
  }
40445
40451
  if (node.isClose === true) {
40452
+ console.log("node.isClose", prefix, node.value);
40446
40453
  return prefix + node.value;
40447
40454
  }
40448
40455
  if (node.type === "open") {
@@ -40458,14 +40465,14 @@ var require_compile = __commonJS({
40458
40465
  return node.value;
40459
40466
  }
40460
40467
  if (node.nodes && node.ranges > 0) {
40461
- let args = utils.reduce(node.nodes);
40462
- let range = fill(...args, { ...options, wrap: false, toRegex: true });
40468
+ const args = utils.reduce(node.nodes);
40469
+ const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
40463
40470
  if (range.length !== 0) {
40464
40471
  return args.length > 1 && range.length > 1 ? `(${range})` : range;
40465
40472
  }
40466
40473
  }
40467
40474
  if (node.nodes) {
40468
- for (let child of node.nodes) {
40475
+ for (const child of node.nodes) {
40469
40476
  output += walk(child, node);
40470
40477
  }
40471
40478
  }
@@ -40485,16 +40492,16 @@ var require_expand3 = __commonJS({
40485
40492
  var stringify = require_stringify();
40486
40493
  var utils = require_utils4();
40487
40494
  var append = (queue = "", stash = "", enclose = false) => {
40488
- let result = [];
40495
+ const result = [];
40489
40496
  queue = [].concat(queue);
40490
40497
  stash = [].concat(stash);
40491
40498
  if (!stash.length) return queue;
40492
40499
  if (!queue.length) {
40493
40500
  return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
40494
40501
  }
40495
- for (let item of queue) {
40502
+ for (const item of queue) {
40496
40503
  if (Array.isArray(item)) {
40497
- for (let value of item) {
40504
+ for (const value of item) {
40498
40505
  result.push(append(value, stash, enclose));
40499
40506
  }
40500
40507
  } else {
@@ -40507,8 +40514,8 @@ var require_expand3 = __commonJS({
40507
40514
  return utils.flatten(result);
40508
40515
  };
40509
40516
  var expand = (ast, options = {}) => {
40510
- let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
40511
- let walk = (node, parent = {}) => {
40517
+ const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
40518
+ const walk = (node, parent = {}) => {
40512
40519
  node.queue = [];
40513
40520
  let p = parent;
40514
40521
  let q = parent.queue;
@@ -40525,7 +40532,7 @@ var require_expand3 = __commonJS({
40525
40532
  return;
40526
40533
  }
40527
40534
  if (node.nodes && node.ranges > 0) {
40528
- let args = utils.reduce(node.nodes);
40535
+ const args = utils.reduce(node.nodes);
40529
40536
  if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
40530
40537
  throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
40531
40538
  }
@@ -40537,7 +40544,7 @@ var require_expand3 = __commonJS({
40537
40544
  node.nodes = [];
40538
40545
  return;
40539
40546
  }
40540
- let enclose = utils.encloseBrace(node);
40547
+ const enclose = utils.encloseBrace(node);
40541
40548
  let queue = node.queue;
40542
40549
  let block = node;
40543
40550
  while (block.type !== "brace" && block.type !== "root" && block.parent) {
@@ -40545,7 +40552,7 @@ var require_expand3 = __commonJS({
40545
40552
  queue = block.queue;
40546
40553
  }
40547
40554
  for (let i = 0; i < node.nodes.length; i++) {
40548
- let child = node.nodes[i];
40555
+ const child = node.nodes[i];
40549
40556
  if (child.type === "comma" && node.type === "brace") {
40550
40557
  if (i === 1) queue.push("");
40551
40558
  queue.push("");
@@ -40576,7 +40583,7 @@ var require_constants2 = __commonJS({
40576
40583
  "../../node_modules/braces/lib/constants.js"(exports2, module2) {
40577
40584
  "use strict";
40578
40585
  module2.exports = {
40579
- MAX_LENGTH: 1024 * 64,
40586
+ MAX_LENGTH: 1e4,
40580
40587
  // Digits
40581
40588
  CHAR_0: "0",
40582
40589
  /* 0 */
@@ -40710,21 +40717,20 @@ var require_parse3 = __commonJS({
40710
40717
  if (typeof input !== "string") {
40711
40718
  throw new TypeError("Expected a string");
40712
40719
  }
40713
- let opts = options || {};
40714
- let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
40720
+ const opts = options || {};
40721
+ const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
40715
40722
  if (input.length > max) {
40716
40723
  throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
40717
40724
  }
40718
- let ast = { type: "root", input, nodes: [] };
40719
- let stack = [ast];
40725
+ const ast = { type: "root", input, nodes: [] };
40726
+ const stack = [ast];
40720
40727
  let block = ast;
40721
40728
  let prev = ast;
40722
40729
  let brackets = 0;
40723
- let length = input.length;
40730
+ const length = input.length;
40724
40731
  let index = 0;
40725
40732
  let depth = 0;
40726
40733
  let value;
40727
- let memo = {};
40728
40734
  const advance = () => input[index++];
40729
40735
  const push = (node) => {
40730
40736
  if (node.type === "text" && prev.type === "dot") {
@@ -40757,7 +40763,6 @@ var require_parse3 = __commonJS({
40757
40763
  }
40758
40764
  if (value === CHAR_LEFT_SQUARE_BRACKET) {
40759
40765
  brackets++;
40760
- let closed = true;
40761
40766
  let next;
40762
40767
  while (index < length && (next = advance())) {
40763
40768
  value += next;
@@ -40796,7 +40801,7 @@ var require_parse3 = __commonJS({
40796
40801
  continue;
40797
40802
  }
40798
40803
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
40799
- let open = value;
40804
+ const open = value;
40800
40805
  let next;
40801
40806
  if (options.keepQuotes !== true) {
40802
40807
  value = "";
@@ -40817,8 +40822,8 @@ var require_parse3 = __commonJS({
40817
40822
  }
40818
40823
  if (value === CHAR_LEFT_CURLY_BRACE) {
40819
40824
  depth++;
40820
- let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
40821
- let brace = {
40825
+ const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
40826
+ const brace = {
40822
40827
  type: "brace",
40823
40828
  open: true,
40824
40829
  close: false,
@@ -40838,7 +40843,7 @@ var require_parse3 = __commonJS({
40838
40843
  push({ type: "text", value });
40839
40844
  continue;
40840
40845
  }
40841
- let type = "close";
40846
+ const type = "close";
40842
40847
  block = stack.pop();
40843
40848
  block.close = true;
40844
40849
  push({ type, value });
@@ -40849,7 +40854,7 @@ var require_parse3 = __commonJS({
40849
40854
  if (value === CHAR_COMMA && depth > 0) {
40850
40855
  if (block.ranges > 0) {
40851
40856
  block.ranges = 0;
40852
- let open = block.nodes.shift();
40857
+ const open = block.nodes.shift();
40853
40858
  block.nodes = [open, { type: "text", value: stringify(block) }];
40854
40859
  }
40855
40860
  push({ type: "comma", value });
@@ -40857,7 +40862,7 @@ var require_parse3 = __commonJS({
40857
40862
  continue;
40858
40863
  }
40859
40864
  if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
40860
- let siblings = block.nodes;
40865
+ const siblings = block.nodes;
40861
40866
  if (depth === 0 || siblings.length === 0) {
40862
40867
  push({ type: "text", value });
40863
40868
  continue;
@@ -40878,7 +40883,7 @@ var require_parse3 = __commonJS({
40878
40883
  }
40879
40884
  if (prev.type === "range") {
40880
40885
  siblings.pop();
40881
- let before = siblings[siblings.length - 1];
40886
+ const before = siblings[siblings.length - 1];
40882
40887
  before.value += prev.value + value;
40883
40888
  prev = before;
40884
40889
  block.ranges--;
@@ -40900,8 +40905,8 @@ var require_parse3 = __commonJS({
40900
40905
  node.invalid = true;
40901
40906
  }
40902
40907
  });
40903
- let parent = stack[stack.length - 1];
40904
- let index2 = parent.nodes.indexOf(block);
40908
+ const parent = stack[stack.length - 1];
40909
+ const index2 = parent.nodes.indexOf(block);
40905
40910
  parent.nodes.splice(index2, 1, ...block.nodes);
40906
40911
  }
40907
40912
  } while (stack.length > 0);
@@ -40923,8 +40928,8 @@ var require_braces = __commonJS({
40923
40928
  var braces = (input, options = {}) => {
40924
40929
  let output = [];
40925
40930
  if (Array.isArray(input)) {
40926
- for (let pattern of input) {
40927
- let result = braces.create(pattern, options);
40931
+ for (const pattern of input) {
40932
+ const result = braces.create(pattern, options);
40928
40933
  if (Array.isArray(result)) {
40929
40934
  output.push(...result);
40930
40935
  } else {
@@ -53118,7 +53123,7 @@ var upgrades = [
53118
53123
  var package_default = {
53119
53124
  name: "@carbon/upgrade",
53120
53125
  description: "A tool for upgrading Carbon versions",
53121
- version: "11.15.0",
53126
+ version: "11.16.0-rc.0",
53122
53127
  license: "Apache-2.0",
53123
53128
  bin: {
53124
53129
  "carbon-upgrade": "./bin/carbon-upgrade.js"
@@ -53158,7 +53163,7 @@ var package_default = {
53158
53163
  devDependencies: {
53159
53164
  chalk: "^4.1.1",
53160
53165
  "change-case": "^4.1.2",
53161
- esbuild: "^0.21.0",
53166
+ esbuild: "^0.23.0",
53162
53167
  execa: "^5.1.1",
53163
53168
  "fast-glob": "^3.2.11",
53164
53169
  "fs-extra": "^11.0.0",
@@ -53170,7 +53175,7 @@ var package_default = {
53170
53175
  memfs: "^4.0.0",
53171
53176
  nanoid: "^3.1.30",
53172
53177
  "npm-which": "^3.0.1",
53173
- rimraf: "^5.0.0",
53178
+ rimraf: "^6.0.0",
53174
53179
  semver: "^7.3.5",
53175
53180
  yargs: "^17.0.1"
53176
53181
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/upgrade",
3
3
  "description": "A tool for upgrading Carbon versions",
4
- "version": "11.15.0",
4
+ "version": "11.16.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
7
7
  "carbon-upgrade": "./bin/carbon-upgrade.js"
@@ -41,7 +41,7 @@
41
41
  "devDependencies": {
42
42
  "chalk": "^4.1.1",
43
43
  "change-case": "^4.1.2",
44
- "esbuild": "^0.21.0",
44
+ "esbuild": "^0.23.0",
45
45
  "execa": "^5.1.1",
46
46
  "fast-glob": "^3.2.11",
47
47
  "fs-extra": "^11.0.0",
@@ -53,7 +53,7 @@
53
53
  "memfs": "^4.0.0",
54
54
  "nanoid": "^3.1.30",
55
55
  "npm-which": "^3.0.1",
56
- "rimraf": "^5.0.0",
56
+ "rimraf": "^6.0.0",
57
57
  "semver": "^7.3.5",
58
58
  "yargs": "^17.0.1"
59
59
  },
@@ -61,5 +61,5 @@
61
61
  "@ibm/telemetry-js": "^1.5.0",
62
62
  "jscodeshift": "^0.13.1"
63
63
  },
64
- "gitHead": "574070ef9eef05d6e1e5899354bbadc77ba5f3ee"
64
+ "gitHead": "5e14bf5949724bee568601e514b5ce18e50d4525"
65
65
  }