@carbon/upgrade 11.38.0 → 11.39.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.
- package/README.md +2 -0
- package/cli.js +211 -93
- package/package.json +2 -2
- package/transforms/__testfixtures__/ibm-products-update-coachmark.input.js +73 -0
- package/transforms/__testfixtures__/ibm-products-update-coachmark.output.js +66 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header.input.js +17 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header.output.js +13 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header2.input.js +6 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header2.output.js +6 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header3.input.js +3 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header3.output.js +3 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header4.input.js +18 -0
- package/transforms/__testfixtures__/ibm-products-update-page-header4.output.js +18 -0
- package/transforms/__tests__/ibm-products-update-coachmark-test.js +12 -0
- package/transforms/__tests__/ibm-products-update-page-header-test.js +30 -0
- package/transforms/ibm-products-update-coachmark.js +504 -0
- package/transforms/ibm-products-update-page-header.js +233 -0
package/README.md
CHANGED
|
@@ -48,6 +48,8 @@ Options:
|
|
|
48
48
|
[boolean] [default: false]
|
|
49
49
|
-v, --verbose optionally include additional logs, useful for debugging
|
|
50
50
|
[boolean] [default: false]
|
|
51
|
+
--decoratorsBeforeExport parse decorators before export declarations
|
|
52
|
+
[boolean] [default: false]
|
|
51
53
|
```
|
|
52
54
|
|
|
53
55
|
### Migrations
|
package/cli.js
CHANGED
|
@@ -1672,6 +1672,22 @@ var require_execa = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1672
1672
|
};
|
|
1673
1673
|
}));
|
|
1674
1674
|
//#endregion
|
|
1675
|
+
//#region ../../node_modules/concat-map/index.js
|
|
1676
|
+
var require_concat_map = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1677
|
+
module.exports = function(xs, fn) {
|
|
1678
|
+
var res = [];
|
|
1679
|
+
for (var i = 0; i < xs.length; i++) {
|
|
1680
|
+
var x = fn(xs[i], i);
|
|
1681
|
+
if (isArray(x)) res.push.apply(res, x);
|
|
1682
|
+
else res.push(x);
|
|
1683
|
+
}
|
|
1684
|
+
return res;
|
|
1685
|
+
};
|
|
1686
|
+
var isArray = Array.isArray || function(xs) {
|
|
1687
|
+
return Object.prototype.toString.call(xs) === "[object Array]";
|
|
1688
|
+
};
|
|
1689
|
+
}));
|
|
1690
|
+
//#endregion
|
|
1675
1691
|
//#region ../../node_modules/balanced-match/index.js
|
|
1676
1692
|
var require_balanced_match = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1677
1693
|
module.exports = balanced;
|
|
@@ -1721,8 +1737,9 @@ var require_balanced_match = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
1721
1737
|
}
|
|
1722
1738
|
}));
|
|
1723
1739
|
//#endregion
|
|
1724
|
-
//#region ../../node_modules/brace-expansion/index.js
|
|
1740
|
+
//#region ../../node_modules/minimatch/node_modules/brace-expansion/index.js
|
|
1725
1741
|
var require_brace_expansion = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1742
|
+
var concatMap = require_concat_map();
|
|
1726
1743
|
var balanced = require_balanced_match();
|
|
1727
1744
|
module.exports = expandTop;
|
|
1728
1745
|
var escSlash = "\0SLASH" + Math.random() + "\0";
|
|
@@ -1757,10 +1774,12 @@ var require_brace_expansion = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
1757
1774
|
parts.push.apply(parts, p);
|
|
1758
1775
|
return parts;
|
|
1759
1776
|
}
|
|
1760
|
-
function expandTop(str) {
|
|
1777
|
+
function expandTop(str, options) {
|
|
1761
1778
|
if (!str) return [];
|
|
1779
|
+
options = options || {};
|
|
1780
|
+
var max = options.max == null ? Infinity : options.max;
|
|
1762
1781
|
if (str.substr(0, 2) === "{}") str = "\\{\\}" + str.substr(2);
|
|
1763
|
-
return expand(escapeBraces(str), true).map(unescapeBraces);
|
|
1782
|
+
return expand(escapeBraces(str), max, true).map(unescapeBraces);
|
|
1764
1783
|
}
|
|
1765
1784
|
function embrace(str) {
|
|
1766
1785
|
return "{" + str + "}";
|
|
@@ -1774,78 +1793,74 @@ var require_brace_expansion = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
1774
1793
|
function gte(i, y) {
|
|
1775
1794
|
return i >= y;
|
|
1776
1795
|
}
|
|
1777
|
-
function expand(str, isTop) {
|
|
1796
|
+
function expand(str, max, isTop) {
|
|
1778
1797
|
var expansions = [];
|
|
1779
1798
|
var m = balanced("{", "}", str);
|
|
1780
|
-
if (!m) return [str];
|
|
1781
|
-
var
|
|
1782
|
-
var
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1799
|
+
if (!m || /\$$/.test(m.pre)) return [str];
|
|
1800
|
+
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
|
1801
|
+
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
|
1802
|
+
var isSequence = isNumericSequence || isAlphaSequence;
|
|
1803
|
+
var isOptions = m.body.indexOf(",") >= 0;
|
|
1804
|
+
if (!isSequence && !isOptions) {
|
|
1805
|
+
if (m.post.match(/,(?!,).*\}/)) {
|
|
1806
|
+
str = m.pre + "{" + m.body + escClose + m.post;
|
|
1807
|
+
return expand(str, max, true);
|
|
1808
|
+
}
|
|
1809
|
+
return [str];
|
|
1810
|
+
}
|
|
1811
|
+
var n;
|
|
1812
|
+
if (isSequence) n = m.body.split(/\.\./);
|
|
1787
1813
|
else {
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
var isOptions = m.body.indexOf(",") >= 0;
|
|
1792
|
-
if (!isSequence && !isOptions) {
|
|
1793
|
-
if (m.post.match(/,(?!,).*\}/)) {
|
|
1794
|
-
str = m.pre + "{" + m.body + escClose + m.post;
|
|
1795
|
-
return expand(str);
|
|
1796
|
-
}
|
|
1797
|
-
return [str];
|
|
1798
|
-
}
|
|
1799
|
-
var n;
|
|
1800
|
-
if (isSequence) n = m.body.split(/\.\./);
|
|
1801
|
-
else {
|
|
1802
|
-
n = parseCommaParts(m.body);
|
|
1814
|
+
n = parseCommaParts(m.body);
|
|
1815
|
+
if (n.length === 1) {
|
|
1816
|
+
n = expand(n[0], max, false).map(embrace);
|
|
1803
1817
|
if (n.length === 1) {
|
|
1804
|
-
|
|
1805
|
-
|
|
1818
|
+
var post = m.post.length ? expand(m.post, max, false) : [""];
|
|
1819
|
+
return post.map(function(p) {
|
|
1806
1820
|
return m.pre + n[0] + p;
|
|
1807
1821
|
});
|
|
1808
1822
|
}
|
|
1809
1823
|
}
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1824
|
+
}
|
|
1825
|
+
var pre = m.pre;
|
|
1826
|
+
var post = m.post.length ? expand(m.post, max, false) : [""];
|
|
1827
|
+
var N;
|
|
1828
|
+
if (isSequence) {
|
|
1829
|
+
var x = numeric(n[0]);
|
|
1830
|
+
var y = numeric(n[1]);
|
|
1831
|
+
var width = Math.max(n[0].length, n[1].length);
|
|
1832
|
+
var incr = n.length == 3 ? Math.max(Math.abs(numeric(n[2])), 1) : 1;
|
|
1833
|
+
var test = lte;
|
|
1834
|
+
if (y < x) {
|
|
1835
|
+
incr *= -1;
|
|
1836
|
+
test = gte;
|
|
1837
|
+
}
|
|
1838
|
+
var pad = n.some(isPadded);
|
|
1839
|
+
N = [];
|
|
1840
|
+
for (var i = x; test(i, y); i += incr) {
|
|
1841
|
+
var c;
|
|
1842
|
+
if (isAlphaSequence) {
|
|
1843
|
+
c = String.fromCharCode(i);
|
|
1844
|
+
if (c === "\\") c = "";
|
|
1845
|
+
} else {
|
|
1846
|
+
c = String(i);
|
|
1847
|
+
if (pad) {
|
|
1848
|
+
var need = width - c.length;
|
|
1849
|
+
if (need > 0) {
|
|
1850
|
+
var z = new Array(need + 1).join("0");
|
|
1851
|
+
if (i < 0) c = "-" + z + c.slice(1);
|
|
1852
|
+
else c = z + c;
|
|
1837
1853
|
}
|
|
1838
1854
|
}
|
|
1839
|
-
N.push(c);
|
|
1840
1855
|
}
|
|
1841
|
-
|
|
1842
|
-
N = [];
|
|
1843
|
-
for (var j = 0; j < n.length; j++) N.push.apply(N, expand(n[j], false));
|
|
1844
|
-
}
|
|
1845
|
-
for (var j = 0; j < N.length; j++) for (var k = 0; k < post.length; k++) {
|
|
1846
|
-
var expansion = pre + N[j] + post[k];
|
|
1847
|
-
if (!isTop || isSequence || expansion) expansions.push(expansion);
|
|
1856
|
+
N.push(c);
|
|
1848
1857
|
}
|
|
1858
|
+
} else N = concatMap(n, function(el) {
|
|
1859
|
+
return expand(el, max, false);
|
|
1860
|
+
});
|
|
1861
|
+
for (var j = 0; j < N.length; j++) for (var k = 0; k < post.length && expansions.length < max; k++) {
|
|
1862
|
+
var expansion = pre + N[j] + post[k];
|
|
1863
|
+
if (!isTop || isSequence || expansion) expansions.push(expansion);
|
|
1849
1864
|
}
|
|
1850
1865
|
return expansions;
|
|
1851
1866
|
}
|
|
@@ -3204,7 +3219,7 @@ var require_cli_width = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3204
3219
|
}
|
|
3205
3220
|
}));
|
|
3206
3221
|
//#endregion
|
|
3207
|
-
//#region ../../node_modules/ansi-regex/index.js
|
|
3222
|
+
//#region ../../node_modules/strip-ansi/node_modules/ansi-regex/index.js
|
|
3208
3223
|
var require_ansi_regex = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3209
3224
|
module.exports = ({ onlyFirst = false } = {}) => {
|
|
3210
3225
|
const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");
|
|
@@ -30688,6 +30703,39 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
30688
30703
|
module.exports = coerce;
|
|
30689
30704
|
}));
|
|
30690
30705
|
//#endregion
|
|
30706
|
+
//#region ../../node_modules/semver/functions/truncate.js
|
|
30707
|
+
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
30708
|
+
const parse = require_parse$2();
|
|
30709
|
+
const constants = require_constants$3();
|
|
30710
|
+
const SemVer = require_semver$1();
|
|
30711
|
+
const truncate = (version, truncation, options) => {
|
|
30712
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) return null;
|
|
30713
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
30714
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
30715
|
+
};
|
|
30716
|
+
const cloneInputVersion = (version, options) => {
|
|
30717
|
+
return parse(version instanceof SemVer ? version.version : version, options);
|
|
30718
|
+
};
|
|
30719
|
+
const doTruncation = (version, truncation) => {
|
|
30720
|
+
if (isPrerelease(truncation)) return version.version;
|
|
30721
|
+
version.prerelease = [];
|
|
30722
|
+
switch (truncation) {
|
|
30723
|
+
case "major":
|
|
30724
|
+
version.minor = 0;
|
|
30725
|
+
version.patch = 0;
|
|
30726
|
+
break;
|
|
30727
|
+
case "minor":
|
|
30728
|
+
version.patch = 0;
|
|
30729
|
+
break;
|
|
30730
|
+
}
|
|
30731
|
+
return version.format();
|
|
30732
|
+
};
|
|
30733
|
+
const isPrerelease = (type) => {
|
|
30734
|
+
return type.startsWith("pre");
|
|
30735
|
+
};
|
|
30736
|
+
module.exports = truncate;
|
|
30737
|
+
}));
|
|
30738
|
+
//#endregion
|
|
30691
30739
|
//#region ../../node_modules/semver/internal/lrucache.js
|
|
30692
30740
|
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
30693
30741
|
var LRUCache = class {
|
|
@@ -31422,6 +31470,7 @@ var import_semver = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exp
|
|
|
31422
31470
|
lte: require_lte(),
|
|
31423
31471
|
cmp: require_cmp(),
|
|
31424
31472
|
coerce: require_coerce(),
|
|
31473
|
+
truncate: require_truncate(),
|
|
31425
31474
|
Comparator: require_comparator(),
|
|
31426
31475
|
Range: require_range(),
|
|
31427
31476
|
satisfies: require_satisfies(),
|
|
@@ -43742,8 +43791,9 @@ async function getSelectedWorkspace(workspaces) {
|
|
|
43742
43791
|
* LICENSE file in the root directory of this source tree.
|
|
43743
43792
|
*/
|
|
43744
43793
|
async function run$1(options) {
|
|
43745
|
-
const { dry, parser = "babylon", paths, print = dry, transform, verbose } = options;
|
|
43794
|
+
const { dry, parser = "babylon", decoratorsBeforeExport = false, paths, print = dry, transform, verbose, ...transformOptions } = options;
|
|
43746
43795
|
await jscodeshift_src_Runner_js.run(transform, paths, {
|
|
43796
|
+
...transformOptions,
|
|
43747
43797
|
dry,
|
|
43748
43798
|
parser,
|
|
43749
43799
|
parserConfig: {
|
|
@@ -43769,7 +43819,7 @@ async function run$1(options) {
|
|
|
43769
43819
|
"dynamicImport",
|
|
43770
43820
|
"nullishCoalescingOperator",
|
|
43771
43821
|
"optionalChaining",
|
|
43772
|
-
["decorators", { decoratorsBeforeExport
|
|
43822
|
+
["decorators", { decoratorsBeforeExport }]
|
|
43773
43823
|
]
|
|
43774
43824
|
},
|
|
43775
43825
|
print,
|
|
@@ -43801,6 +43851,12 @@ async function run$1(options) {
|
|
|
43801
43851
|
* LICENSE file in the root directory of this source tree.
|
|
43802
43852
|
*/
|
|
43803
43853
|
const TRANSFORM_DIR = path.default.join(__dirname, "transforms");
|
|
43854
|
+
async function runCodemod(options, config) {
|
|
43855
|
+
await run$1({
|
|
43856
|
+
...config,
|
|
43857
|
+
decoratorsBeforeExport: options.decoratorsBeforeExport
|
|
43858
|
+
});
|
|
43859
|
+
}
|
|
43804
43860
|
/**
|
|
43805
43861
|
* @typedef Upgrade
|
|
43806
43862
|
* @property {string} name
|
|
@@ -43922,7 +43978,7 @@ const upgrades = [
|
|
|
43922
43978
|
"**/storybook-static/**"
|
|
43923
43979
|
]
|
|
43924
43980
|
});
|
|
43925
|
-
await
|
|
43981
|
+
await runCodemod(options, {
|
|
43926
43982
|
dry: !options.write,
|
|
43927
43983
|
transform,
|
|
43928
43984
|
paths,
|
|
@@ -43945,7 +44001,7 @@ const upgrades = [
|
|
|
43945
44001
|
"**/storybook-static/**"
|
|
43946
44002
|
]
|
|
43947
44003
|
});
|
|
43948
|
-
await
|
|
44004
|
+
await runCodemod(options, {
|
|
43949
44005
|
dry: !options.write,
|
|
43950
44006
|
transform,
|
|
43951
44007
|
paths,
|
|
@@ -43968,7 +44024,7 @@ const upgrades = [
|
|
|
43968
44024
|
"**/storybook-static/**"
|
|
43969
44025
|
]
|
|
43970
44026
|
});
|
|
43971
|
-
await
|
|
44027
|
+
await runCodemod(options, {
|
|
43972
44028
|
dry: !options.write,
|
|
43973
44029
|
transform,
|
|
43974
44030
|
paths,
|
|
@@ -43991,7 +44047,7 @@ const upgrades = [
|
|
|
43991
44047
|
"**/storybook-static/**"
|
|
43992
44048
|
]
|
|
43993
44049
|
});
|
|
43994
|
-
await
|
|
44050
|
+
await runCodemod(options, {
|
|
43995
44051
|
dry: !options.write,
|
|
43996
44052
|
transform,
|
|
43997
44053
|
paths,
|
|
@@ -44014,7 +44070,7 @@ const upgrades = [
|
|
|
44014
44070
|
"**/storybook-static/**"
|
|
44015
44071
|
]
|
|
44016
44072
|
});
|
|
44017
|
-
await
|
|
44073
|
+
await runCodemod(options, {
|
|
44018
44074
|
dry: !options.write,
|
|
44019
44075
|
transform,
|
|
44020
44076
|
paths,
|
|
@@ -44051,7 +44107,7 @@ const upgrades = [
|
|
|
44051
44107
|
"**/storybook-static/**"
|
|
44052
44108
|
]
|
|
44053
44109
|
});
|
|
44054
|
-
await
|
|
44110
|
+
await runCodemod(options, {
|
|
44055
44111
|
dry: !options.write,
|
|
44056
44112
|
transform,
|
|
44057
44113
|
paths,
|
|
@@ -44085,7 +44141,7 @@ const upgrades = [
|
|
|
44085
44141
|
"**/storybook-static/**"
|
|
44086
44142
|
]
|
|
44087
44143
|
});
|
|
44088
|
-
await
|
|
44144
|
+
await runCodemod(options, {
|
|
44089
44145
|
dry: !options.write,
|
|
44090
44146
|
transform,
|
|
44091
44147
|
paths,
|
|
@@ -44130,7 +44186,7 @@ const upgrades = [
|
|
|
44130
44186
|
"**/coverage/**"
|
|
44131
44187
|
]
|
|
44132
44188
|
});
|
|
44133
|
-
await
|
|
44189
|
+
await runCodemod(options, {
|
|
44134
44190
|
dry: !options.write,
|
|
44135
44191
|
transform,
|
|
44136
44192
|
paths,
|
|
@@ -44165,7 +44221,7 @@ const upgrades = [
|
|
|
44165
44221
|
"**/storybook-static/**"
|
|
44166
44222
|
]
|
|
44167
44223
|
});
|
|
44168
|
-
await
|
|
44224
|
+
await runCodemod(options, {
|
|
44169
44225
|
dry: !options.write,
|
|
44170
44226
|
transform,
|
|
44171
44227
|
paths,
|
|
@@ -44221,7 +44277,7 @@ const upgrades = [
|
|
|
44221
44277
|
"**/coverage/**"
|
|
44222
44278
|
]
|
|
44223
44279
|
});
|
|
44224
|
-
await
|
|
44280
|
+
await runCodemod(options, {
|
|
44225
44281
|
dry: !options.write,
|
|
44226
44282
|
transform,
|
|
44227
44283
|
paths,
|
|
@@ -44250,7 +44306,7 @@ const upgrades = [
|
|
|
44250
44306
|
"**/storybook-static/**"
|
|
44251
44307
|
]
|
|
44252
44308
|
});
|
|
44253
|
-
await
|
|
44309
|
+
await runCodemod(options, {
|
|
44254
44310
|
dry: !options.write,
|
|
44255
44311
|
transform,
|
|
44256
44312
|
paths,
|
|
@@ -44305,7 +44361,7 @@ const upgrades = [
|
|
|
44305
44361
|
"**/coverage/**"
|
|
44306
44362
|
]
|
|
44307
44363
|
});
|
|
44308
|
-
await
|
|
44364
|
+
await runCodemod(options, {
|
|
44309
44365
|
dry: !options.write,
|
|
44310
44366
|
transform,
|
|
44311
44367
|
paths,
|
|
@@ -44334,7 +44390,7 @@ const upgrades = [
|
|
|
44334
44390
|
"**/storybook-static/**"
|
|
44335
44391
|
]
|
|
44336
44392
|
});
|
|
44337
|
-
await
|
|
44393
|
+
await runCodemod(options, {
|
|
44338
44394
|
dry: !options.write,
|
|
44339
44395
|
transform,
|
|
44340
44396
|
paths,
|
|
@@ -44342,6 +44398,35 @@ const upgrades = [
|
|
|
44342
44398
|
});
|
|
44343
44399
|
}
|
|
44344
44400
|
},
|
|
44401
|
+
{
|
|
44402
|
+
name: "ibm-products-update-page-header",
|
|
44403
|
+
description: "Rewrites PageHeader imports to IBM Products packages",
|
|
44404
|
+
migrate: async (options) => {
|
|
44405
|
+
const transform = path.default.join(TRANSFORM_DIR, "ibm-products-update-page-header.js");
|
|
44406
|
+
const paths = Array.isArray(options.paths) && options.paths.length > 0 ? options.paths : await (0, import_out.default)([
|
|
44407
|
+
"**/*.js",
|
|
44408
|
+
"**/*.jsx",
|
|
44409
|
+
"**/*.ts",
|
|
44410
|
+
"**/*.tsx"
|
|
44411
|
+
], {
|
|
44412
|
+
cwd: options.workspaceDir,
|
|
44413
|
+
ignore: [
|
|
44414
|
+
"**/es/**",
|
|
44415
|
+
"**/lib/**",
|
|
44416
|
+
"**/umd/**",
|
|
44417
|
+
"**/node_modules/**",
|
|
44418
|
+
"**/storybook-static/**"
|
|
44419
|
+
]
|
|
44420
|
+
});
|
|
44421
|
+
await runCodemod(options, {
|
|
44422
|
+
dry: !options.write,
|
|
44423
|
+
transform,
|
|
44424
|
+
paths,
|
|
44425
|
+
verbose: options.verbose,
|
|
44426
|
+
parser: "tsx"
|
|
44427
|
+
});
|
|
44428
|
+
}
|
|
44429
|
+
},
|
|
44345
44430
|
{
|
|
44346
44431
|
name: "ibm-products-update-userprofileimage",
|
|
44347
44432
|
description: "Rewrites UserProfileImage to UserAvatar",
|
|
@@ -44362,7 +44447,35 @@ const upgrades = [
|
|
|
44362
44447
|
"**/storybook-static/**"
|
|
44363
44448
|
]
|
|
44364
44449
|
});
|
|
44365
|
-
await
|
|
44450
|
+
await runCodemod(options, {
|
|
44451
|
+
dry: !options.write,
|
|
44452
|
+
transform,
|
|
44453
|
+
paths,
|
|
44454
|
+
verbose: options.verbose
|
|
44455
|
+
});
|
|
44456
|
+
}
|
|
44457
|
+
},
|
|
44458
|
+
{
|
|
44459
|
+
name: "ibm-products-update-coachmark",
|
|
44460
|
+
description: "Rewrites old Coachmark to new composable Coachmark",
|
|
44461
|
+
migrate: async (options) => {
|
|
44462
|
+
const transform = path.default.join(TRANSFORM_DIR, "ibm-products-update-coachmark.js");
|
|
44463
|
+
const paths = Array.isArray(options.paths) && options.paths.length > 0 ? options.paths : await (0, import_out.default)([
|
|
44464
|
+
"**/*.js",
|
|
44465
|
+
"**/*.jsx",
|
|
44466
|
+
"**/*.ts",
|
|
44467
|
+
"**/*.tsx"
|
|
44468
|
+
], {
|
|
44469
|
+
cwd: options.workspaceDir,
|
|
44470
|
+
ignore: [
|
|
44471
|
+
"**/es/**",
|
|
44472
|
+
"**/lib/**",
|
|
44473
|
+
"**/umd/**",
|
|
44474
|
+
"**/node_modules/**",
|
|
44475
|
+
"**/storybook-static/**"
|
|
44476
|
+
]
|
|
44477
|
+
});
|
|
44478
|
+
await runCodemod(options, {
|
|
44366
44479
|
dry: !options.write,
|
|
44367
44480
|
transform,
|
|
44368
44481
|
paths,
|
|
@@ -44390,7 +44503,7 @@ const upgrades = [
|
|
|
44390
44503
|
"**/storybook-static/**"
|
|
44391
44504
|
]
|
|
44392
44505
|
});
|
|
44393
|
-
await
|
|
44506
|
+
await runCodemod(options, {
|
|
44394
44507
|
dry: !options.write,
|
|
44395
44508
|
transform,
|
|
44396
44509
|
paths,
|
|
@@ -44418,7 +44531,7 @@ const upgrades = [
|
|
|
44418
44531
|
"**/storybook-static/**"
|
|
44419
44532
|
]
|
|
44420
44533
|
});
|
|
44421
|
-
await
|
|
44534
|
+
await runCodemod(options, {
|
|
44422
44535
|
dry: !options.write,
|
|
44423
44536
|
transform,
|
|
44424
44537
|
paths,
|
|
@@ -44446,7 +44559,7 @@ const upgrades = [
|
|
|
44446
44559
|
"**/storybook-static/**"
|
|
44447
44560
|
]
|
|
44448
44561
|
});
|
|
44449
|
-
await
|
|
44562
|
+
await runCodemod(options, {
|
|
44450
44563
|
dry: !options.write,
|
|
44451
44564
|
transform,
|
|
44452
44565
|
paths,
|
|
@@ -44516,7 +44629,7 @@ const upgrades = [
|
|
|
44516
44629
|
"**/coverage/**"
|
|
44517
44630
|
]
|
|
44518
44631
|
});
|
|
44519
|
-
await
|
|
44632
|
+
await runCodemod(options, {
|
|
44520
44633
|
dry: !options.write,
|
|
44521
44634
|
transform,
|
|
44522
44635
|
paths,
|
|
@@ -44545,7 +44658,7 @@ const upgrades = [
|
|
|
44545
44658
|
//#endregion
|
|
44546
44659
|
//#region package.json
|
|
44547
44660
|
var name = "@carbon/upgrade";
|
|
44548
|
-
var version = "11.
|
|
44661
|
+
var version = "11.39.0";
|
|
44549
44662
|
//#endregion
|
|
44550
44663
|
//#region ../../node_modules/y18n/build/index.cjs
|
|
44551
44664
|
var require_build$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -45462,7 +45575,7 @@ var require_build$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
45462
45575
|
module.exports = yargsParser;
|
|
45463
45576
|
}));
|
|
45464
45577
|
//#endregion
|
|
45465
|
-
//#region ../../node_modules/wrap-ansi/index.js
|
|
45578
|
+
//#region ../../node_modules/cliui/node_modules/wrap-ansi/index.js
|
|
45466
45579
|
var require_wrap_ansi = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
45467
45580
|
const stringWidth = require_string_width();
|
|
45468
45581
|
const stripAnsi = require_strip_ansi();
|
|
@@ -47819,13 +47932,19 @@ async function main({ argv, cwd }) {
|
|
|
47819
47932
|
default: true,
|
|
47820
47933
|
describe: "wrap the migration with a feature flag",
|
|
47821
47934
|
type: "boolean"
|
|
47935
|
+
}).option("decoratorsBeforeExport", {
|
|
47936
|
+
default: false,
|
|
47937
|
+
describe: "parse decorators before export declarations",
|
|
47938
|
+
type: "boolean"
|
|
47822
47939
|
});
|
|
47823
47940
|
cli.usage("Usage: $0 [options]").command(["upgrade", "$0"], "upgrade your project", {}, run(async (args) => {
|
|
47824
|
-
const { verbose, write } = args;
|
|
47941
|
+
const { decoratorsBeforeExport, verbose, write, wrapWithFeatureFlag } = args;
|
|
47825
47942
|
await upgrade({
|
|
47826
47943
|
cwd: cwd(),
|
|
47944
|
+
decoratorsBeforeExport,
|
|
47827
47945
|
verbose,
|
|
47828
|
-
write
|
|
47946
|
+
write,
|
|
47947
|
+
wrapWithFeatureFlag
|
|
47829
47948
|
}, upgrades);
|
|
47830
47949
|
}));
|
|
47831
47950
|
cli.command("migrate <migration> [paths...]", "run a Carbon migration on your source files", async (cli) => {
|
|
@@ -47838,17 +47957,16 @@ async function main({ argv, cwd }) {
|
|
|
47838
47957
|
}, upgrades);
|
|
47839
47958
|
}, true));
|
|
47840
47959
|
}, run(async (args) => {
|
|
47841
|
-
const { verbose, migration, write, paths, wrapWithFeatureFlag } = args;
|
|
47842
|
-
|
|
47960
|
+
const { verbose, decoratorsBeforeExport, migration, write, paths, wrapWithFeatureFlag } = args;
|
|
47961
|
+
await migrate({
|
|
47843
47962
|
cwd: cwd(),
|
|
47844
47963
|
verbose,
|
|
47964
|
+
decoratorsBeforeExport,
|
|
47845
47965
|
write,
|
|
47846
47966
|
migration,
|
|
47847
47967
|
paths,
|
|
47848
47968
|
wrapWithFeatureFlag
|
|
47849
|
-
};
|
|
47850
|
-
console.log("CLI options wrapWithFeatureFlag:", options.wrapWithFeatureFlag);
|
|
47851
|
-
await migrate(options, upgrades);
|
|
47969
|
+
}, upgrades);
|
|
47852
47970
|
}));
|
|
47853
47971
|
cli.strict().parse(argv.slice(2));
|
|
47854
47972
|
}
|
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.
|
|
4
|
+
"version": "11.39.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
7
7
|
"carbon-upgrade": "./bin/carbon-upgrade.js"
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"@ibm/telemetry-js": "^1.5.0",
|
|
61
61
|
"jscodeshift": "^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "2d98f4ee9914fa44acba58f62599c3f5382acad0"
|
|
64
64
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Coachmark,
|
|
4
|
+
CoachmarkBeacon,
|
|
5
|
+
CoachmarkButton,
|
|
6
|
+
CoachmarkOverlayElements,
|
|
7
|
+
CoachmarkOverlayElement,
|
|
8
|
+
BEACON_KIND,
|
|
9
|
+
COACHMARK_OVERLAY_KIND,
|
|
10
|
+
} from '@carbon/ibm-products';
|
|
11
|
+
import { Crossroads } from '@carbon/react/icons';
|
|
12
|
+
|
|
13
|
+
// Example 1: Basic Coachmark with Beacon and dark theme
|
|
14
|
+
export const Example1 = () => (
|
|
15
|
+
<Coachmark
|
|
16
|
+
align="bottom"
|
|
17
|
+
closeIconDescription="Close"
|
|
18
|
+
positionTune={{ x: 0, y: 0 }}
|
|
19
|
+
target={
|
|
20
|
+
<CoachmarkBeacon label="Show information" kind={BEACON_KIND.DEFAULT} />
|
|
21
|
+
}
|
|
22
|
+
theme="light">
|
|
23
|
+
<CoachmarkOverlayElements closeButtonLabel="Done">
|
|
24
|
+
<CoachmarkOverlayElement
|
|
25
|
+
title="Hello World"
|
|
26
|
+
description="this is a description test"
|
|
27
|
+
/>
|
|
28
|
+
</CoachmarkOverlayElements>
|
|
29
|
+
</Coachmark>
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
// Example 2: Coachmark with Button target and light theme
|
|
33
|
+
export const Example2 = () => (
|
|
34
|
+
<Coachmark
|
|
35
|
+
align="top"
|
|
36
|
+
closeIconDescription="Close"
|
|
37
|
+
positionTune={{ x: 10, y: 20 }}
|
|
38
|
+
target={
|
|
39
|
+
<CoachmarkButton
|
|
40
|
+
kind="tertiary"
|
|
41
|
+
size="md"
|
|
42
|
+
label="Show information"
|
|
43
|
+
renderIcon={Crossroads}>
|
|
44
|
+
Click Me
|
|
45
|
+
</CoachmarkButton>
|
|
46
|
+
}
|
|
47
|
+
theme="light">
|
|
48
|
+
<CoachmarkOverlayElements closeButtonLabel="Got it">
|
|
49
|
+
<CoachmarkOverlayElement
|
|
50
|
+
title="Welcome"
|
|
51
|
+
description="This is your dashboard"
|
|
52
|
+
/>
|
|
53
|
+
</CoachmarkOverlayElements>
|
|
54
|
+
</Coachmark>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
// Example 3: Floating Coachmark
|
|
58
|
+
export const Example3 = () => (
|
|
59
|
+
<Coachmark
|
|
60
|
+
align="bottom-left"
|
|
61
|
+
closeIconDescription="Dismiss"
|
|
62
|
+
positionTune={{ x: 5, y: 5 }}
|
|
63
|
+
overlayKind={COACHMARK_OVERLAY_KIND.FLOATING}
|
|
64
|
+
target={<CoachmarkBeacon label="Learn more" kind={BEACON_KIND.DEFAULT} />}
|
|
65
|
+
theme="dark">
|
|
66
|
+
<CoachmarkOverlayElements closeButtonLabel="Close">
|
|
67
|
+
<CoachmarkOverlayElement
|
|
68
|
+
title="New Feature"
|
|
69
|
+
description="Check out this new feature"
|
|
70
|
+
/>
|
|
71
|
+
</CoachmarkOverlayElements>
|
|
72
|
+
</Coachmark>
|
|
73
|
+
);
|