Skip to content

Upgrade to Storybook 6.x #24

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 10 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
.bsb.lock
npm-debug.log
/node_modules/
src/*.js
**/*.bs.js
lib
package-lock.json
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
99 changes: 0 additions & 99 deletions example/bindings/Storybook.bs.js

This file was deleted.

24 changes: 12 additions & 12 deletions example/bindings/Storybook.re
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ module Notes = {
};

module Knobs = {
[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
[@bs.val] [@bs.module "@storybook/addon-knobs"]
external withKnobs: Main.decorator;

[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
[@bs.val] [@bs.module "@storybook/addon-knobs"]
external extText: (string, Js.null_undefined(string)) => string = "text";

let text = (~label: string, ~defaultValue: option(string)=?, ()) =>
extText(label, Js.Nullable.fromOption(defaultValue));

[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
[@bs.val] [@bs.module "@storybook/addon-knobs"]
external extBoolean: (string, bool) => bool = "boolean";

let boolean = (~label: string, ~defaultValue=false, ()) =>
Expand All @@ -79,24 +79,24 @@ module Knobs = {
step: float,
};

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external number:
(~label: string, ~defaultValue: float, ~range: rangeConfig=?, unit) =>
float =
"number";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external object_:
(~label: string, ~defaultValue: Js.t('a), unit) => Js.t('a) =
"object";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external color: (~label: string, ~defaultValue: string=?, unit) => string =
"color";

type selectConfig('a) = 'a;

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external select:
(
~label: string,
Expand All @@ -107,31 +107,31 @@ module Knobs = {
string =
"select";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external selectFromArray:
(~label: string, ~options: array('a), ~defaultValue: string, unit) => 'a =
"select";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external selectFromDict:
(~label: string, ~options: Js.Dict.t('a), ~defaultValue: string, unit) =>
'a =
"select";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external selectFromAny:
(~label: string, ~options: 'a, ~defaultValue: string, unit) => 'a =
"select";

[@bs.module "@storybook/addon-knobs/react"]
[@bs.module "@storybook/addon-knobs"]
external extDate: (string, Js.null_undefined(Js_date.t)) => string = "date";

let date = (~label: string, ~defaultValue: option(Js_date.t)=?, ()) =>
extDate(label, Js.Nullable.fromOption(defaultValue));

type button;

[@bs.val] [@bs.module "@storybook/addon-knobs/react"]
[@bs.val] [@bs.module "@storybook/addon-knobs"]
external extButton: (string, ReactEvent.Mouse.t => unit) => button =
"button";

Expand Down
18 changes: 11 additions & 7 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"reason-react": "^0.7.1"
"reason-react": "^0.9.1"
},
"devDependencies": {
"@babel/core": "^7.9.6",
"@storybook/addon-actions": "^5.3.18",
"@storybook/addon-knobs": "^5.3.18",
"@storybook/addon-links": "^5.3.18",
"@storybook/addons": "^5.3.18",
"@storybook/react": "^5.3.18",
"@storybook/addon-actions": "^6.1.20",
"@storybook/addon-knobs": "^6.1.20",
"@storybook/addon-links": "^6.1.20",
"@storybook/addons": "^6.1.20",
"@storybook/react": "^6.1.20",
"babel-loader": "^8.1.0",
"bs-platform": "7.1.1"
"bs-platform": "8.4.2"
},
"scripts": {
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"bs:start": "bsb -make-world -w"
},
"peerDependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
}
}
22 changes: 0 additions & 22 deletions example/src/MyButton.bs.js

This file was deleted.

38 changes: 0 additions & 38 deletions example/stories/ExampleCSFStories.bs.js

This file was deleted.

Loading