Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed windows path in loader output #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"test": "jest",
"build": "tsup",
"start": "yarn build && yarn storybook -- --quiet\"",
"release": "STORYBOOK_DISABLE_TELEMETRY=1 yarn build && auto shipit",
"storybook": "STORYBOOK_DISABLE_TELEMETRY=1 STORYBOOK_ENABLE_CRASH_REPORTS=false storybook dev -p 6006",
"release": "cross-env STORYBOOK_DISABLE_TELEMETRY=1 yarn build && auto shipit",
"storybook": "cross-env STORYBOOK_DISABLE_TELEMETRY=1 STORYBOOK_ENABLE_CRASH_REPORTS=false storybook dev -p 6006",
"build-storybook": "storybook build",
"prettier": "prettier",
"prepare": "husky install"
Expand Down Expand Up @@ -58,6 +58,7 @@
"babel-jest": "^27.0.6",
"babel-loader": "^8.1.0",
"concurrently": "^7.0.0",
"cross-env": "^7.0.3",
"husky": ">=6",
"jest": "^27.0.6",
"jest-environment-jsdom": "^27.0.6",
Expand All @@ -67,6 +68,7 @@
"prettier": "^2.3.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"slash": "^5.1.0",
"storybook": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"ts-dedent": "^2.2.0",
"ts-jest": "^27.0.4",
Expand Down
3 changes: 2 additions & 1 deletion src/sb-mdx-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import camelCase from 'lodash/camelCase';
import jsStringEscape from 'js-string-escape';
import { transformJSXSync } from './jsx';
import { JSXOptions } from './types';
import slash from 'slash';

const generate = (node: any, context: any) => _generate(node, context);

Expand Down Expand Up @@ -521,7 +522,7 @@ function extractExports(root: Element, options: CompilerOptions) {
const defaultJsx = toJSX(root, {}, { ...options, skipExport: true });
const mdxReactPackage = dirname(require.resolve('@mdx-js/react/package.json'));
const fullJsx = [
`import { mdx } from '${mdxReactPackage}';
`import { mdx } from '${slash(mdxReactPackage)}';
import { assertIsFn, AddContext } from "@storybook/addon-docs";`,
defaultJsx,
...storyExports,
Expand Down
14 changes: 13 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4595,7 +4595,14 @@ create-require@^1.1.0:
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==

cross-spawn@^7.0.0, cross-spawn@^7.0.3:
cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down Expand Up @@ -9201,6 +9208,11 @@ slash@^3.0.0:
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==

slash@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-5.1.0.tgz#be3adddcdf09ac38eebe8dcdc7b1a57a75b095ce"
integrity sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==

slice-ansi@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-3.0.0.tgz#31ddc10930a1b7e0b67b08c96c2f49b77a789787"
Expand Down