Skip to content

Commit

Permalink
Fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Jan 3, 2024
1 parent ad66a20 commit c1df8f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions code/lib/codemod/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
},
"devDependencies": {
"@types/jscodeshift": "^0.11.10",
"@types/mdast": "^3.0.0",
"ansi-regex": "^5.0.1",
"mdast-util-mdx-jsx": "^2.1.2",
"mdast-util-mdxjs-esm": "^1.3.1",
Expand Down
3 changes: 1 addition & 2 deletions code/lib/codemod/src/transforms/mdx-to-csf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import * as fs from 'node:fs';
import camelCase from 'lodash/camelCase';
import type { MdxFlowExpression } from 'mdast-util-mdx-expression';

const mdxProcessor = remark().use(remarkMdx) as ReturnType<typeof remark>;
const mdxProcessor = remark().use(remarkMdx as any) as ReturnType<typeof remark>;

export default function jscodeshift(info: FileInfo) {
const parsed = path.parse(info.path);
Expand Down Expand Up @@ -136,7 +136,6 @@ export function transform(source: string, baseName: string): [string, string] {
value: `/* ${nodeString} is deprecated, please migrate it to <Story of={referenceToStory} /> see: https://storybook.js.org/migration-guides/7.0 */`,
};
storiesMap.set(idAttribute.value as string, { type: 'id' });
// @ts-ignore need to check with @kasperpeulen, this happened with the upgrade of
// mdast-util-mdx-jsx version
parent?.children.splice(index as number, 0, newNode);
// current index is the new comment, and index + 1 is current node
Expand Down
1 change: 1 addition & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5347,6 +5347,7 @@ __metadata:
"@storybook/types": "workspace:*"
"@types/cross-spawn": "npm:^6.0.2"
"@types/jscodeshift": "npm:^0.11.10"
"@types/mdast": "npm:^3.0.0"
ansi-regex: "npm:^5.0.1"
cross-spawn: "npm:^7.0.3"
globby: "npm:^11.0.2"
Expand Down

0 comments on commit c1df8f0

Please sign in to comment.