1 | "use strict";
|
2 |
|
3 | require("core-js/modules/es.promise.js");
|
4 |
|
5 | Object.defineProperty(exports, "__esModule", {
|
6 | value: true
|
7 | });
|
8 | exports.migrate = migrate;
|
9 |
|
10 | var _codemod = require("@storybook/codemod");
|
11 |
|
12 | async function migrate(migration, {
|
13 | configDir,
|
14 | glob,
|
15 | dryRun,
|
16 | list,
|
17 | rename,
|
18 | logger,
|
19 | parser
|
20 | }) {
|
21 | if (list) {
|
22 | (0, _codemod.listCodemods)().forEach(key => logger.log(key));
|
23 | } else if (migration) {
|
24 | await (0, _codemod.runCodemod)(migration, {
|
25 | configDir,
|
26 | glob,
|
27 | dryRun,
|
28 | logger,
|
29 | rename,
|
30 | parser
|
31 | });
|
32 | } else {
|
33 | throw new Error('Migrate: please specify a migration name or --list');
|
34 | }
|
35 | } |
\ | No newline at end of file |