@storybook/codemod 7.0.0-beta.57 → 7.0.0-beta.59

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/codemod",
3
- "version": "7.0.0-beta.57",
3
+ "version": "7.0.0-beta.59",
4
4
  "description": "A collection of codemod scripts written with JSCodeshift",
5
5
  "keywords": [
6
6
  "storybook"
@@ -45,27 +45,27 @@
45
45
  "prep": "../../../scripts/prepare/bundle.ts"
46
46
  },
47
47
  "dependencies": {
48
+ "@babel/core": "~7.21.0",
49
+ "@babel/preset-env": "~7.20.2",
50
+ "@babel/types": "~7.21.2",
48
51
  "@storybook/csf": "next",
49
- "@storybook/csf-tools": "7.0.0-beta.57",
50
- "@storybook/node-logger": "7.0.0-beta.57",
51
- "@storybook/types": "7.0.0-beta.57",
52
+ "@storybook/csf-tools": "7.0.0-beta.59",
53
+ "@storybook/node-logger": "7.0.0-beta.59",
54
+ "@storybook/types": "7.0.0-beta.59",
55
+ "cross-spawn": "^7.0.3",
56
+ "globby": "^11.0.2",
57
+ "jscodeshift": "^0.14.0",
58
+ "lodash": "^4.17.21",
59
+ "prettier": "^2.8.0",
52
60
  "recast": "^0.23.1"
53
61
  },
54
62
  "devDependencies": {
55
- "@babel/core": "^7.21.0",
56
- "@babel/preset-env": "^7.20.2",
57
- "@babel/types": "^7.21.2",
58
63
  "@types/jscodeshift": "^0.11.6",
59
64
  "ansi-regex": "^5.0.1",
60
- "cross-spawn": "^7.0.3",
61
- "globby": "^11.0.2",
62
65
  "jest": "^29.3.1",
63
66
  "jest-specific-snapshot": "^7.0.0",
64
- "jscodeshift": "^0.14.0",
65
- "lodash": "^4.17.21",
66
67
  "mdast-util-mdx-jsx": "^2.1.2",
67
68
  "mdast-util-mdxjs-esm": "^1.3.1",
68
- "prettier": "^2.8.0",
69
69
  "remark": "^14.0.2",
70
70
  "remark-mdx": "^2.2.1",
71
71
  "ts-dedent": "^2.2.0",
@@ -97,5 +97,5 @@
97
97
  "cjs"
98
98
  ]
99
99
  },
100
- "gitHead": "40424e73ad881740b16d5017507f7790fe8d27c5"
100
+ "gitHead": "c808723218b9a07aa5c92a440babb23c0411db99"
101
101
  }
@@ -235,11 +235,6 @@ describe('csf-2-to-3', () => {
235
235
  ).toThrowErrorMatchingInlineSnapshot(`
236
236
  This codemod does not support namespace imports for a @storybook/react package.
237
237
  Replace the namespace import with named imports and try again.
238
- > 1 | import * as SB from '@storybook/react';
239
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
240
- 2 | import { CatProps } from './Cat';
241
- 3 |
242
- 4 | const meta = { title: 'Cat', component: Cat } as Meta<CatProps>
243
238
  `);
244
239
  });
245
240
  it('should keep local names', () => {
@@ -225,7 +225,11 @@ class StorybookImportHelper {
225
225
  if (source.startsWith('@storybook/csf') || !source.startsWith('@storybook')) return;
226
226
  const isRendererImport = path.get('specifiers').some((specifier) => {
227
227
  if (specifier.isImportNamespaceSpecifier()) {
228
- throw path.buildCodeFrameError(
228
+ // throw path.buildCodeFrameError(
229
+ // `This codemod does not support namespace imports for a ${path.node.source.value} package.\n` +
230
+ // 'Replace the namespace import with named imports and try again.'
231
+ // );
232
+ throw new Error(
229
233
  `This codemod does not support namespace imports for a ${path.node.source.value} package.\n` +
230
234
  'Replace the namespace import with named imports and try again.'
231
235
  );