Skip to content

Commit

Permalink
Merge pull request #1420 from vivliostyle/fix/react-storybook
Browse files Browse the repository at this point in the history
fix: error in react/storybook
  • Loading branch information
MurakamiShinyu authored Nov 17, 2024
2 parents e26e9fb + 7e947f9 commit 88bdebc
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 960 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Vivliostyle Foundation",
"scripts": {
"build": "tsc --emitDeclarationOnly && esbuild src/vivliostyle.ts --bundle --outfile=lib/vivliostyle.js --format=cjs --define:VIVLIOSTYLE_DEBUG=false --minify --sourcemap --target=es2018",
"build-dev": "esbuild src/vivliostyle.ts --bundle --outfile=lib/vivliostyle.js --format=cjs --define:VIVLIOSTYLE_DEBUG=true --sourcemap --target=es2018",
"build-dev": "tsc --emitDeclarationOnly && esbuild src/vivliostyle.ts --bundle --outfile=lib/vivliostyle.js --format=cjs --define:VIVLIOSTYLE_DEBUG=true --sourcemap --target=es2018",
"clean": "shx rm -rf lib/* .cache",
"dev": "yarn build-dev --watch=forever",
"format": "prettier --write \"{*.{js,md,json},{src,types,test,resources}/**/*.{ts,js}}\"",
Expand Down
8 changes: 4 additions & 4 deletions packages/react/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ module.exports = {
"@storybook/addon-actions",
"@storybook/addon-links",
"@storybook/addon-knobs",
"@storybook/addon-docs",
// "@storybook/addon-docs",
],

framework: {
name: "@storybook/react-webpack5",
options: {},
},

docs: {
autodocs: true,
},
// docs: {
// autodocs: true,
// },
};
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"version": "2.30.5",
"author": "Yasuaki Uechi <y@uechi.io>",
"scripts": {
"build": "microbundle-crl --format modern,cjs && shx rm -rf dist/stories",
"build-dev": "microbundle-crl --no-compress --format cjs",
"build": "microbundle --format modern,cjs && shx rm -rf dist/stories",
"build-dev": "microbundle --no-compress --format cjs",
"build-storybook": "storybook build",
"clean": "shx rm -rf dist",
"dev": "yarn storybook",
Expand Down Expand Up @@ -36,7 +36,7 @@
"@types/jest": "^29.5.14",
"@types/react": "^18.0.27",
"cross-env": "^7.0.2",
"microbundle-crl": "^0.13.10",
"microbundle": "^0.15.1",
"npm-run-all": "^4.1.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
11 changes: 9 additions & 2 deletions packages/react/src/stories/Renderer.stories.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import React from "react";
import { action } from "@storybook/addon-actions";
import { withKnobs, text, boolean, number, color, select } from "@storybook/addon-knobs";
import {
withKnobs,
text,
boolean,
number,
color,
select,
} from "@storybook/addon-knobs";

import { Renderer } from "../renderer";

Expand Down Expand Up @@ -87,7 +94,7 @@ export const Narrowed = () => (
onLoad={action("loaded")}
onError={action("error")}
onNavigation={action("navigation")}
onMessage={(msg, type) => action("message")(type, msg.messages[0])}
onMessage={(msg, type) => action("message")(type, msg)}
onReadyStateChange={action("readyStateChange")}
onHyperlink={action("hyperlink")}
/>
Expand Down
1 change: 1 addition & 0 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["dom", "esnext"],
"moduleResolution": "node",
"jsx": "react",
"jsxFactory": "React.createElement",
"sourceMap": true,
"declaration": true,
"esModuleInterop": true,
Expand Down
Loading

0 comments on commit 88bdebc

Please sign in to comment.