Skip to content

Commit 8ed463b

Browse files
committed
adding gentype
1 parent a62745c commit 8ed463b

File tree

7 files changed

+21
-2
lines changed

7 files changed

+21
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ node_modules
1010
*.bs.js
1111
*.re.js
1212
.bsb.lock
13+
14+
# GenType output
15+
*.gen.tsx

bsconfig.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,12 @@
2424
"suffix": ".bs.js",
2525
"bs-dependencies": ["reason-react", "bs-css"],
2626
"namespace": true,
27-
"refmt": 3
27+
"refmt": 3,
28+
"gentypeconfig": {
29+
"language": "typescript",
30+
"debug": {
31+
"all": false,
32+
"basic": true
33+
}
34+
}
2835
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
],
77
"scripts": {
88
"start:bs": "bsb -make-world -w",
9-
"build:bs": "bsb -make-world",
9+
"build:bs": "export BS_CMT_POST_PROCESS_CMD=\"gentype\" && bsb -make-world",
1010
"clean:bs": "bsb -clean-world",
1111
"start:playground": "cd packages/playground && npx webpack-dev-server"
1212
},
1313
"devDependencies": {
1414
"bs-platform": "^4.0.7",
15+
"gentype": "^1.0.0",
1516
"lerna": "^3.3.0"
1617
}
1718
}

packages/button/src/Button.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module Styles = {
3030
]);
3131
};
3232

33+
[@genType]
3334
let make = children => {
3435
...component,
3536
render: _self => <button className={Styles.button()}> ...children </button>,

packages/playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"license": "MIT",
1616
"dependencies": {
1717
"bs-css": "^7.4.0",
18+
"gentype": "^1.0.0",
1819
"react": "^16.2.0",
1920
"react-dom": "^16.2.0",
2021
"reason-react": ">=0.4.0"

packages/switch/src/Switch.re

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ let component = ReasonReact.statelessComponent("Button");
22

33
let s = ReasonReact.string;
44

5+
[@genType]
56
let make = _children => {
67
...component,
78
render: _self => <input type_="checkbox" />,

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,11 @@ genfun@^5.0.0:
27352735
resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537"
27362736
integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA==
27372737

2738+
gentype@^1.0.0:
2739+
version "1.0.0"
2740+
resolved "https://registry.yarnpkg.com/gentype/-/gentype-1.0.0.tgz#6f6b91a08e878711cde46eaecda0f287deae65b6"
2741+
integrity sha512-2ta+Ei8V66Ghx3q+RA20KtXrhtKeVtAB7OZ75nDq2tjUbnqGrVQMb3BkWm4DQt0Y00M64uEIeXLTGdGBr4F5cg==
2742+
27382743
get-caller-file@^1.0.1:
27392744
version "1.0.3"
27402745
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a"

0 commit comments

Comments
 (0)