Skip to content

8.4.2 #22

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

Open
wants to merge 5 commits into
base: master
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# bs-storybook



BuckleScript bindings for **[Storybook](https://storybook.js.org/)**.

The goal of this project is to provide bindings for the main Storybook API, as well as the official add-ons. Currently it supports:
Expand All @@ -16,6 +18,11 @@ First install this package:
npm install bs-storybook
```

## bs-platform versions

- bs-platform 8.4.2 or higher requires `1.1.0`
- anything lower uses `1.0.0`

Next, you'll need to add `bs-storybook` to your `bsconfig.json` as a dependency.

Then, get Storybook up and running according to [their docs](https://storybook.js.org/basics/quick-start-guide/)
Expand Down
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"reason-react": "^0.7.1"
"reason-react": "^0.9.1"
},
"devDependencies": {
"@babel/core": "^7.9.6",
Expand All @@ -14,7 +14,7 @@
"@storybook/addons": "^5.3.18",
"@storybook/react": "^5.3.18",
"babel-loader": "^8.1.0",
"bs-platform": "7.1.1"
"bs-platform": "8.4.2"
},
"scripts": {
"storybook": "start-storybook -p 6006",
Expand Down
23 changes: 10 additions & 13 deletions example/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2565,10 +2565,10 @@ browserslist@^4.11.1, browserslist@^4.8.5:
node-releases "^1.1.53"
pkg-up "^2.0.0"

bs-platform@7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.1.1.tgz#ed4032de7ab15158c61d8994680a05393e3ddd74"
integrity sha512-ckZHR3J+yxyEKXOBHX8+hfzWG2XX5BxhQ4Iw9lulHFGYdAm9Ep9LgKkIah7G6RYADLmVfTxFE48igvY3kkkl+g==
bs-platform@8.4.2:
version "8.4.2"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.4.2.tgz#778dabd1dfb3bc95e0086c58dabae74e4ebdee8a"
integrity sha512-9q7S4/LLV/a68CweN382NJdCCr/lOSsJR3oQYnmPK98ChfO/AdiA3lYQkQTp6T+U0I5Z5RypUAUprNstwDtMDQ==

buffer-from@^1.0.0:
version "1.1.1"
Expand Down Expand Up @@ -6536,7 +6536,7 @@ react-docgen@^5.0.0:
node-dir "^0.1.10"
strip-indent "^3.0.0"

react-dom@>=16.8.1, react-dom@^16.8.3:
react-dom@^16.8.3:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
Expand Down Expand Up @@ -6694,7 +6694,7 @@ react-transition-group@^4.3.0:
loose-envify "^1.4.0"
prop-types "^15.6.2"

react@>=16.8.1, react@^16.8.3:
react@^16.8.3:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
Expand Down Expand Up @@ -6741,13 +6741,10 @@ readdirp@^2.2.1:
micromatch "^3.1.10"
readable-stream "^2.0.2"

reason-react@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.7.1.tgz#e6acea88542cd44398cd980093b8a2ab2722744e"
integrity sha512-Ssx4jZYohMHW9ZiW893IfbYdZw/muSmPFKigAgL+AORUgyiaphb0PP4yRGlx9A7JAxR3EeBn294XKUaClJQhbA==
dependencies:
react ">=16.8.1"
react-dom ">=16.8.1"
reason-react@^0.9.1:
version "0.9.1"
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.9.1.tgz#30a887158200b659aa03e2d75ff4cc54dc462bb0"
integrity sha512-nlH0O2TDy9KzOLOW+vlEQk4ExHOeciyzFdoLcsmmiit6hx6H5+CVDrwJ+8aiaLT/kqK5xFOjy4PS7PftWz4plA==

recast@^0.14.7:
version "0.14.7"
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bs-storybook",
"version": "1.0.0",
"version": "1.1.0",
"description": "BuckleScript bindings for Storybook.js",
"scripts": {
"build": "bsb -make-world",
Expand All @@ -20,16 +20,16 @@
"author": "",
"license": "MIT",
"devDependencies": {
"bs-platform": "^7.0.1",
"reason-react": "^0.7.1"
"bs-platform": "^8.4.2",
"reason-react": "^0.9.1"
},
"peerDependencies": {
"reason-react": "^0.7.1",
"@storybook/addon-actions": "^5.2.3",
"@storybook/addon-knobs": "^5.3.14",
"@storybook/addon-links": "^5.2.3",
"@storybook/addon-options": "^5.3.14",
"@storybook/addons": "^5.2.3",
"@storybook/react": "^5.2.3"
"@storybook/react": "^5.2.3",
"reason-react": "^0.9.1"
}
}
2 changes: 1 addition & 1 deletion src/action.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type actionHandler('a) = 'a => unit;

[@bs.val] [@bs.module "@storybook/addon-actions"]
external action: string => actionHandler('a);
external action: string => actionHandler('a) = "action";
2 changes: 1 addition & 1 deletion src/knobs.re
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
external withKnobs: Main.decorator;
external withKnobs: Main.decorator = "withKnobs";

[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
external extText: (string, Js.null_undefined(string)) => string = "text";
Expand Down
5 changes: 3 additions & 2 deletions src/main.re
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ type chapter = unit => ReasonReact.reactElement;
type section;

[@bs.val] [@bs.module "@storybook/react"]
external storiesOf: (string, 'a) => section;
external storiesOf: (string, 'a) => section = "storiesOf";

[@bs.send] external extAdd: (section, string, chapter) => unit = "add";

type decorator = chapter => ReasonReact.reactElement;

[@bs.send] external addDecorator: (section, decorator) => unit;
[@bs.send]
external addDecorator: (section, decorator) => unit = "addDecorator";

type webpackModule;

Expand Down
2 changes: 1 addition & 1 deletion src/notes.re
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type decoratedChapter = Main.chapter => Main.chapter;

[@bs.module "@storybook/addon-notes"]
external withNotes: string => decoratedChapter;
external withNotes: string => decoratedChapter = "withNotes";
7 changes: 4 additions & 3 deletions src/story.re
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ type chapter = unit => ReasonReact.reactElement;
type decorator = chapter => ReasonReact.reactElement;

[@bs.val] [@bs.module "@storybook/react"]
external storiesOf: (string, webpackModule) => section;
external storiesOf: (string, webpackModule) => section = "storiesOf";

[@bs.send] external add: (section, string, chapter) => section;
[@bs.send] external add: (section, string, chapter) => section = "add";

[@bs.send] external addDecorator: (section, decorator) => section;
[@bs.send]
external addDecorator: (section, decorator) => section = "addDecorator";
79 changes: 9 additions & 70 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,12 @@
# yarn lockfile v1


bs-platform@^7.0.1:
version "7.2.2"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.2.2.tgz#76fdc63e4889458ae3d257a0132107a792f2309c"
integrity sha512-PWcFfN+jCTtT/rMaHDhKh+W9RUTpaRunmSF9vbLYcrJbpgCNW6aFKAY33u0P3mLxwuhshN3b4FxqGUBPj6exZQ==

"js-tokens@^3.0.0 || ^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
dependencies:
js-tokens "^3.0.0 || ^4.0.0"

object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

prop-types@^15.6.2:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.8.1"

react-dom@>=16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.1.tgz#c1bd37331a0486c078ee54c4740720993b2e0e7f"
integrity sha512-81PIMmVLnCNLO/fFOQxdQkvEq/+Hfpv24XNJfpyZhTRfO0QcmQIF/PgCa1zCOj2w1hrn12MFLyaJ/G0+Mxtfag==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.19.1"

react-is@^16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react@>=16.8.1:
version "16.13.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.13.1.tgz#2e818822f1a9743122c063d6410d85c1e3afe48e"
integrity sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"

reason-react@^0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.7.1.tgz#e6acea88542cd44398cd980093b8a2ab2722744e"
integrity sha512-Ssx4jZYohMHW9ZiW893IfbYdZw/muSmPFKigAgL+AORUgyiaphb0PP4yRGlx9A7JAxR3EeBn294XKUaClJQhbA==
dependencies:
react ">=16.8.1"
react-dom ">=16.8.1"

scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
bs-platform@^8.4.2:
version "8.4.2"
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.4.2.tgz#778dabd1dfb3bc95e0086c58dabae74e4ebdee8a"
integrity sha512-9q7S4/LLV/a68CweN382NJdCCr/lOSsJR3oQYnmPK98ChfO/AdiA3lYQkQTp6T+U0I5Z5RypUAUprNstwDtMDQ==

reason-react@^0.9.1:
version "0.9.1"
resolved "https://registry.yarnpkg.com/reason-react/-/reason-react-0.9.1.tgz#30a887158200b659aa03e2d75ff4cc54dc462bb0"
integrity sha512-nlH0O2TDy9KzOLOW+vlEQk4ExHOeciyzFdoLcsmmiit6hx6H5+CVDrwJ+8aiaLT/kqK5xFOjy4PS7PftWz4plA==