@carbon/upgrade 11.10.1 → 11.11.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 +59 -293
  2. package/package.json +5 -4
package/cli.js CHANGED
@@ -38750,20 +38750,30 @@ var require_fs = __commonJS({
38750
38750
  });
38751
38751
  });
38752
38752
  };
38753
- if (typeof fs2.writev === "function") {
38754
- exports.writev = function(fd, buffers, ...args) {
38755
- if (typeof args[args.length - 1] === "function") {
38756
- return fs2.writev(fd, buffers, ...args);
38757
- }
38758
- return new Promise((resolve, reject) => {
38759
- fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
38760
- if (err)
38761
- return reject(err);
38762
- resolve({ bytesWritten, buffers: buffers2 });
38763
- });
38753
+ exports.readv = function(fd, buffers, ...args) {
38754
+ if (typeof args[args.length - 1] === "function") {
38755
+ return fs2.readv(fd, buffers, ...args);
38756
+ }
38757
+ return new Promise((resolve, reject) => {
38758
+ fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => {
38759
+ if (err)
38760
+ return reject(err);
38761
+ resolve({ bytesRead, buffers: buffers2 });
38764
38762
  });
38765
- };
38766
- }
38763
+ });
38764
+ };
38765
+ exports.writev = function(fd, buffers, ...args) {
38766
+ if (typeof args[args.length - 1] === "function") {
38767
+ return fs2.writev(fd, buffers, ...args);
38768
+ }
38769
+ return new Promise((resolve, reject) => {
38770
+ fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => {
38771
+ if (err)
38772
+ return reject(err);
38773
+ resolve({ bytesWritten, buffers: buffers2 });
38774
+ });
38775
+ });
38776
+ };
38767
38777
  if (typeof fs2.realpath.native === "function") {
38768
38778
  exports.realpath.native = u(fs2.realpath.native);
38769
38779
  } else {
@@ -39061,9 +39071,13 @@ var require_copy = __commonJS({
39061
39071
  stat.checkParentPaths(src, srcStat, dest, "copy", (err2) => {
39062
39072
  if (err2)
39063
39073
  return cb(err2);
39064
- if (opts.filter)
39065
- return handleFilter(checkParentDir, destStat, src, dest, opts, cb);
39066
- return checkParentDir(destStat, src, dest, opts, cb);
39074
+ runFilter(src, dest, opts, (err3, include) => {
39075
+ if (err3)
39076
+ return cb(err3);
39077
+ if (!include)
39078
+ return cb();
39079
+ checkParentDir(destStat, src, dest, opts, cb);
39080
+ });
39067
39081
  });
39068
39082
  });
39069
39083
  }
@@ -39081,17 +39095,10 @@ var require_copy = __commonJS({
39081
39095
  });
39082
39096
  });
39083
39097
  }
39084
- function handleFilter(onInclude, destStat, src, dest, opts, cb) {
39085
- Promise.resolve(opts.filter(src, dest)).then((include) => {
39086
- if (include)
39087
- return onInclude(destStat, src, dest, opts, cb);
39088
- return cb();
39089
- }, (error) => cb(error));
39090
- }
39091
- function startCopy(destStat, src, dest, opts, cb) {
39092
- if (opts.filter)
39093
- return handleFilter(getStats, destStat, src, dest, opts, cb);
39094
- return getStats(destStat, src, dest, opts, cb);
39098
+ function runFilter(src, dest, opts, cb) {
39099
+ if (!opts.filter)
39100
+ return cb(null, true);
39101
+ Promise.resolve(opts.filter(src, dest)).then((include) => cb(null, include), (error) => cb(error));
39095
39102
  }
39096
39103
  function getStats(destStat, src, dest, opts, cb) {
39097
39104
  const stat2 = opts.dereference ? fs2.stat : fs2.lstat;
@@ -39202,14 +39209,20 @@ var require_copy = __commonJS({
39202
39209
  function copyDirItem(items, item, src, dest, opts, cb) {
39203
39210
  const srcItem = path3.join(src, item);
39204
39211
  const destItem = path3.join(dest, item);
39205
- stat.checkPaths(srcItem, destItem, "copy", opts, (err, stats) => {
39212
+ runFilter(srcItem, destItem, opts, (err, include) => {
39206
39213
  if (err)
39207
39214
  return cb(err);
39208
- const { destStat } = stats;
39209
- startCopy(destStat, srcItem, destItem, opts, (err2) => {
39215
+ if (!include)
39216
+ return copyDirItems(items, src, dest, opts, cb);
39217
+ stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
39210
39218
  if (err2)
39211
39219
  return cb(err2);
39212
- return copyDirItems(items, src, dest, opts, cb);
39220
+ const { destStat } = stats;
39221
+ getStats(destStat, srcItem, destItem, opts, (err3) => {
39222
+ if (err3)
39223
+ return cb(err3);
39224
+ return copyDirItems(items, src, dest, opts, cb);
39225
+ });
39213
39226
  });
39214
39227
  });
39215
39228
  }
@@ -39235,7 +39248,7 @@ var require_copy = __commonJS({
39235
39248
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
39236
39249
  return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
39237
39250
  }
39238
- if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
39251
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
39239
39252
  return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
39240
39253
  }
39241
39254
  return copyLink(resolvedSrc, dest, cb);
@@ -39279,9 +39292,6 @@ var require_copy_sync = __commonJS({
39279
39292
  }
39280
39293
  const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts);
39281
39294
  stat.checkParentPathsSync(src, srcStat, dest, "copy");
39282
- return handleFilterAndCopy(destStat, src, dest, opts);
39283
- }
39284
- function handleFilterAndCopy(destStat, src, dest, opts) {
39285
39295
  if (opts.filter && !opts.filter(src, dest))
39286
39296
  return;
39287
39297
  const destParent = path3.dirname(dest);
@@ -39289,11 +39299,6 @@ var require_copy_sync = __commonJS({
39289
39299
  mkdirsSync(destParent);
39290
39300
  return getStats(destStat, src, dest, opts);
39291
39301
  }
39292
- function startCopy(destStat, src, dest, opts) {
39293
- if (opts.filter && !opts.filter(src, dest))
39294
- return;
39295
- return getStats(destStat, src, dest, opts);
39296
- }
39297
39302
  function getStats(destStat, src, dest, opts) {
39298
39303
  const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync;
39299
39304
  const srcStat = statSync(src);
@@ -39362,8 +39367,10 @@ var require_copy_sync = __commonJS({
39362
39367
  function copyDirItem(item, src, dest, opts) {
39363
39368
  const srcItem = path3.join(src, item);
39364
39369
  const destItem = path3.join(dest, item);
39370
+ if (opts.filter && !opts.filter(srcItem, destItem))
39371
+ return;
39365
39372
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts);
39366
- return startCopy(destStat, srcItem, destItem, opts);
39373
+ return getStats(destStat, srcItem, destItem, opts);
39367
39374
  }
39368
39375
  function onLink(destStat, src, dest, opts) {
39369
39376
  let resolvedSrc = fs2.readlinkSync(src);
@@ -39387,7 +39394,7 @@ var require_copy_sync = __commonJS({
39387
39394
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
39388
39395
  throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
39389
39396
  }
39390
- if (fs2.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
39397
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
39391
39398
  throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
39392
39399
  }
39393
39400
  return copyLink(resolvedSrc, dest);
@@ -39413,261 +39420,17 @@ var require_copy2 = __commonJS({
39413
39420
  }
39414
39421
  });
39415
39422
 
39416
- // ../../node_modules/fs-extra/lib/remove/rimraf.js
39417
- var require_rimraf = __commonJS({
39418
- "../../node_modules/fs-extra/lib/remove/rimraf.js"(exports, module2) {
39419
- "use strict";
39420
- var fs2 = require_graceful_fs();
39421
- var path3 = require("path");
39422
- var assert = require("assert");
39423
- var isWindows = process.platform === "win32";
39424
- function defaults(options) {
39425
- const methods = [
39426
- "unlink",
39427
- "chmod",
39428
- "stat",
39429
- "lstat",
39430
- "rmdir",
39431
- "readdir"
39432
- ];
39433
- methods.forEach((m) => {
39434
- options[m] = options[m] || fs2[m];
39435
- m = m + "Sync";
39436
- options[m] = options[m] || fs2[m];
39437
- });
39438
- options.maxBusyTries = options.maxBusyTries || 3;
39439
- }
39440
- function rimraf(p, options, cb) {
39441
- let busyTries = 0;
39442
- if (typeof options === "function") {
39443
- cb = options;
39444
- options = {};
39445
- }
39446
- assert(p, "rimraf: missing path");
39447
- assert.strictEqual(typeof p, "string", "rimraf: path should be a string");
39448
- assert.strictEqual(typeof cb, "function", "rimraf: callback function required");
39449
- assert(options, "rimraf: invalid options argument provided");
39450
- assert.strictEqual(typeof options, "object", "rimraf: options should be object");
39451
- defaults(options);
39452
- rimraf_(p, options, function CB(er) {
39453
- if (er) {
39454
- if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) {
39455
- busyTries++;
39456
- const time = busyTries * 100;
39457
- return setTimeout(() => rimraf_(p, options, CB), time);
39458
- }
39459
- if (er.code === "ENOENT")
39460
- er = null;
39461
- }
39462
- cb(er);
39463
- });
39464
- }
39465
- function rimraf_(p, options, cb) {
39466
- assert(p);
39467
- assert(options);
39468
- assert(typeof cb === "function");
39469
- options.lstat(p, (er, st) => {
39470
- if (er && er.code === "ENOENT") {
39471
- return cb(null);
39472
- }
39473
- if (er && er.code === "EPERM" && isWindows) {
39474
- return fixWinEPERM(p, options, er, cb);
39475
- }
39476
- if (st && st.isDirectory()) {
39477
- return rmdir(p, options, er, cb);
39478
- }
39479
- options.unlink(p, (er2) => {
39480
- if (er2) {
39481
- if (er2.code === "ENOENT") {
39482
- return cb(null);
39483
- }
39484
- if (er2.code === "EPERM") {
39485
- return isWindows ? fixWinEPERM(p, options, er2, cb) : rmdir(p, options, er2, cb);
39486
- }
39487
- if (er2.code === "EISDIR") {
39488
- return rmdir(p, options, er2, cb);
39489
- }
39490
- }
39491
- return cb(er2);
39492
- });
39493
- });
39494
- }
39495
- function fixWinEPERM(p, options, er, cb) {
39496
- assert(p);
39497
- assert(options);
39498
- assert(typeof cb === "function");
39499
- options.chmod(p, 438, (er2) => {
39500
- if (er2) {
39501
- cb(er2.code === "ENOENT" ? null : er);
39502
- } else {
39503
- options.stat(p, (er3, stats) => {
39504
- if (er3) {
39505
- cb(er3.code === "ENOENT" ? null : er);
39506
- } else if (stats.isDirectory()) {
39507
- rmdir(p, options, er, cb);
39508
- } else {
39509
- options.unlink(p, cb);
39510
- }
39511
- });
39512
- }
39513
- });
39514
- }
39515
- function fixWinEPERMSync(p, options, er) {
39516
- let stats;
39517
- assert(p);
39518
- assert(options);
39519
- try {
39520
- options.chmodSync(p, 438);
39521
- } catch (er2) {
39522
- if (er2.code === "ENOENT") {
39523
- return;
39524
- } else {
39525
- throw er;
39526
- }
39527
- }
39528
- try {
39529
- stats = options.statSync(p);
39530
- } catch (er3) {
39531
- if (er3.code === "ENOENT") {
39532
- return;
39533
- } else {
39534
- throw er;
39535
- }
39536
- }
39537
- if (stats.isDirectory()) {
39538
- rmdirSync(p, options, er);
39539
- } else {
39540
- options.unlinkSync(p);
39541
- }
39542
- }
39543
- function rmdir(p, options, originalEr, cb) {
39544
- assert(p);
39545
- assert(options);
39546
- assert(typeof cb === "function");
39547
- options.rmdir(p, (er) => {
39548
- if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) {
39549
- rmkids(p, options, cb);
39550
- } else if (er && er.code === "ENOTDIR") {
39551
- cb(originalEr);
39552
- } else {
39553
- cb(er);
39554
- }
39555
- });
39556
- }
39557
- function rmkids(p, options, cb) {
39558
- assert(p);
39559
- assert(options);
39560
- assert(typeof cb === "function");
39561
- options.readdir(p, (er, files) => {
39562
- if (er)
39563
- return cb(er);
39564
- let n = files.length;
39565
- let errState;
39566
- if (n === 0)
39567
- return options.rmdir(p, cb);
39568
- files.forEach((f) => {
39569
- rimraf(path3.join(p, f), options, (er2) => {
39570
- if (errState) {
39571
- return;
39572
- }
39573
- if (er2)
39574
- return cb(errState = er2);
39575
- if (--n === 0) {
39576
- options.rmdir(p, cb);
39577
- }
39578
- });
39579
- });
39580
- });
39581
- }
39582
- function rimrafSync(p, options) {
39583
- let st;
39584
- options = options || {};
39585
- defaults(options);
39586
- assert(p, "rimraf: missing path");
39587
- assert.strictEqual(typeof p, "string", "rimraf: path should be a string");
39588
- assert(options, "rimraf: missing options");
39589
- assert.strictEqual(typeof options, "object", "rimraf: options should be object");
39590
- try {
39591
- st = options.lstatSync(p);
39592
- } catch (er) {
39593
- if (er.code === "ENOENT") {
39594
- return;
39595
- }
39596
- if (er.code === "EPERM" && isWindows) {
39597
- fixWinEPERMSync(p, options, er);
39598
- }
39599
- }
39600
- try {
39601
- if (st && st.isDirectory()) {
39602
- rmdirSync(p, options, null);
39603
- } else {
39604
- options.unlinkSync(p);
39605
- }
39606
- } catch (er) {
39607
- if (er.code === "ENOENT") {
39608
- return;
39609
- } else if (er.code === "EPERM") {
39610
- return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er);
39611
- } else if (er.code !== "EISDIR") {
39612
- throw er;
39613
- }
39614
- rmdirSync(p, options, er);
39615
- }
39616
- }
39617
- function rmdirSync(p, options, originalEr) {
39618
- assert(p);
39619
- assert(options);
39620
- try {
39621
- options.rmdirSync(p);
39622
- } catch (er) {
39623
- if (er.code === "ENOTDIR") {
39624
- throw originalEr;
39625
- } else if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") {
39626
- rmkidsSync(p, options);
39627
- } else if (er.code !== "ENOENT") {
39628
- throw er;
39629
- }
39630
- }
39631
- }
39632
- function rmkidsSync(p, options) {
39633
- assert(p);
39634
- assert(options);
39635
- options.readdirSync(p).forEach((f) => rimrafSync(path3.join(p, f), options));
39636
- if (isWindows) {
39637
- const startTime = Date.now();
39638
- do {
39639
- try {
39640
- const ret = options.rmdirSync(p, options);
39641
- return ret;
39642
- } catch {
39643
- }
39644
- } while (Date.now() - startTime < 500);
39645
- } else {
39646
- const ret = options.rmdirSync(p, options);
39647
- return ret;
39648
- }
39649
- }
39650
- module2.exports = rimraf;
39651
- rimraf.sync = rimrafSync;
39652
- }
39653
- });
39654
-
39655
39423
  // ../../node_modules/fs-extra/lib/remove/index.js
39656
39424
  var require_remove = __commonJS({
39657
39425
  "../../node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
39658
39426
  "use strict";
39659
39427
  var fs2 = require_graceful_fs();
39660
39428
  var u = require_universalify().fromCallback;
39661
- var rimraf = require_rimraf();
39662
39429
  function remove(path3, callback) {
39663
- if (fs2.rm)
39664
- return fs2.rm(path3, { recursive: true, force: true }, callback);
39665
- rimraf(path3, callback);
39430
+ fs2.rm(path3, { recursive: true, force: true }, callback);
39666
39431
  }
39667
39432
  function removeSync(path3) {
39668
- if (fs2.rmSync)
39669
- return fs2.rmSync(path3, { recursive: true, force: true });
39670
- rimraf.sync(path3);
39433
+ fs2.rmSync(path3, { recursive: true, force: true });
39671
39434
  }
39672
39435
  module2.exports = {
39673
39436
  remove: u(remove),
@@ -40378,7 +40141,8 @@ var require_move = __commonJS({
40378
40141
  function moveAcrossDevice(src, dest, overwrite, cb) {
40379
40142
  const opts = {
40380
40143
  overwrite,
40381
- errorOnExist: true
40144
+ errorOnExist: true,
40145
+ preserveTimestamps: true
40382
40146
  };
40383
40147
  copy(src, dest, opts, (err) => {
40384
40148
  if (err)
@@ -40437,7 +40201,8 @@ var require_move_sync = __commonJS({
40437
40201
  function moveAcrossDevice(src, dest, overwrite) {
40438
40202
  const opts = {
40439
40203
  overwrite,
40440
- errorOnExist: true
40204
+ errorOnExist: true,
40205
+ preserveTimestamps: true
40441
40206
  };
40442
40207
  copySync(src, dest, opts);
40443
40208
  return removeSync(src);
@@ -54164,7 +53929,7 @@ var upgrades = [
54164
53929
  var package_default = {
54165
53930
  name: "@carbon/upgrade",
54166
53931
  description: "A tool for upgrading Carbon versions",
54167
- version: "11.10.1",
53932
+ version: "11.11.0-rc.0",
54168
53933
  license: "Apache-2.0",
54169
53934
  bin: {
54170
53935
  "carbon-upgrade": "./bin/carbon-upgrade.js"
@@ -54191,7 +53956,8 @@ var package_default = {
54191
53956
  "react"
54192
53957
  ],
54193
53958
  publishConfig: {
54194
- access: "public"
53959
+ access: "public",
53960
+ provenance: true
54195
53961
  },
54196
53962
  scripts: {
54197
53963
  build: "esbuild src/cli.js --bundle --platform=node --outfile=cli.js --target=node14 --external:jscodeshift",
@@ -54204,7 +53970,7 @@ var package_default = {
54204
53970
  esbuild: "^0.18.0",
54205
53971
  execa: "^5.1.1",
54206
53972
  "fast-glob": "^3.2.11",
54207
- "fs-extra": "^10.0.0",
53973
+ "fs-extra": "^11.0.0",
54208
53974
  inquirer: "^8.1.0",
54209
53975
  "is-git-clean": "^1.1.0",
54210
53976
  "jest-diff": "^28.1.0",
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.10.1",
4
+ "version": "11.11.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
7
7
  "carbon-upgrade": "./bin/carbon-upgrade.js"
@@ -28,7 +28,8 @@
28
28
  "react"
29
29
  ],
30
30
  "publishConfig": {
31
- "access": "public"
31
+ "access": "public",
32
+ "provenance": true
32
33
  },
33
34
  "scripts": {
34
35
  "build": "esbuild src/cli.js --bundle --platform=node --outfile=cli.js --target=node14 --external:jscodeshift",
@@ -41,7 +42,7 @@
41
42
  "esbuild": "^0.18.0",
42
43
  "execa": "^5.1.1",
43
44
  "fast-glob": "^3.2.11",
44
- "fs-extra": "^10.0.0",
45
+ "fs-extra": "^11.0.0",
45
46
  "inquirer": "^8.1.0",
46
47
  "is-git-clean": "^1.1.0",
47
48
  "jest-diff": "^28.1.0",
@@ -57,5 +58,5 @@
57
58
  "dependencies": {
58
59
  "jscodeshift": "^0.13.1"
59
60
  },
60
- "gitHead": "22b28f5d05e6caa4565e4e84308abcf2fd977aec"
61
+ "gitHead": "39f36c63d5cb77a525e0a82f0e565b8d6ef658e9"
61
62
  }