From 59d0bcc962d6fe7fb71456b2e7b758999a2d10b1 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 9 Dec 2022 23:36:16 +0100 Subject: [PATCH] Revert "fix migrate command" This reverts commit c6f4baba2a22aee6d183683ac7ca7a1f3bec1d64. --- code/lib/cli/src/migrate.ts | 7 +++++-- code/lib/codemod/package.json | 21 ++------------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/code/lib/cli/src/migrate.ts b/code/lib/cli/src/migrate.ts index 0e4ab495a744..89e3e6759fa9 100644 --- a/code/lib/cli/src/migrate.ts +++ b/code/lib/cli/src/migrate.ts @@ -1,10 +1,13 @@ import { listCodemods, runCodemod } from '@storybook/codemod'; -export async function migrate(migration: any, { glob, dryRun, list, rename, logger, parser }: any) { +export async function migrate( + migration: any, + { configDir, glob, dryRun, list, rename, logger, parser }: any +) { if (list) { listCodemods().forEach((key: any) => logger.log(key)); } else if (migration) { - await runCodemod(migration, { glob, dryRun, logger, rename, parser }); + await runCodemod(migration, { configDir, glob, dryRun, logger, rename, parser }); } else { throw new Error('Migrate: please specify a migration name or --list'); } diff --git a/code/lib/codemod/package.json b/code/lib/codemod/package.json index 2ee00d118c30..80177688847a 100644 --- a/code/lib/codemod/package.json +++ b/code/lib/codemod/package.json @@ -26,19 +26,11 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, - "./dist/transforms/add-component-parameters.js": "./dist/transforms/add-component-parameters.js", - "./dist/transforms/csf-2-to-3.js": "./dist/transforms/csf-2-to-3.js", - "./dist/transforms/csf-hoist-story-annotations.js": "./dist/transforms/csf-hoist-story-annotations.js", - "./dist/transforms/csf-to-mdx.js": "./dist/transforms/csf-to-mdx.js", - "./dist/transforms/move-builtin-addons.js": "./dist/transforms/move-builtin-addons.js", - "./dist/transforms/storiesof-to-csf.js": "./dist/transforms/storiesof-to-csf.js", - "./dist/transforms/update-addon-info.js": "./dist/transforms/update-addon-info.js", - "./dist/transforms/update-organisation-name.js": "./dist/transforms/update-organisation-name.js", - "./dist/transforms/upgrade-hierarchy-separators.js": "./dist/transforms/upgrade-hierarchy-separators.js", "./package.json": "./package.json" }, "main": "dist/index.js", "module": "dist/index.mjs", + "jsnext:main": "src/index.js", "types": "dist/index.d.ts", "scripts": { "check": "../../../scripts/node_modules/.bin/tsc --noEmit", @@ -69,16 +61,7 @@ "bundler": { "platform": "node", "entries": [ - "./src/index.js", - "./src/transforms/add-component-parameters.js", - "./src/transforms/csf-2-to-3.js", - "./src/transforms/csf-hoist-story-annotations.js", - "./src/transforms/csf-to-mdx.js", - "./src/transforms/move-builtin-addons.js", - "./src/transforms/storiesof-to-csf.js", - "./src/transforms/update-addon-info.js", - "./src/transforms/update-organisation-name.js", - "./src/transforms/upgrade-hierarchy-separators.js" + "./src/index.js" ] }, "gitHead": "66a0d588184add900c48d49f3a62743fa9cc5185"