Skip to content

Commit c81af8c

Browse files
committed
Edit docs/development.md
1 parent 956b3ed commit c81af8c

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

docs/development.md

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ Overview for Developers
55

66
Modules with **\[\<AutoOpen\>\]** does not require `open` to use.
77

8+
- `build/` ... build scripts
9+
- `BindingUpdater.fs` ... a utility to update bindings in `lib/Bindings/`
10+
- `build.fs` ... the main build script
811
- `lib/` ... target-agnostic part of the tool (will be separated to a different repo in near future)
912
- `Bindings/` ... bindings to JS libraries (typescript, browser-or-node)
1013
- `Extensions.fs` ... **\[\<AutoOpen\>\]** extensions for standard library and JS libraries
@@ -26,17 +29,19 @@ Modules with **\[\<AutoOpen\>\]** does not require `open` to use.
2629
- `Target.fs` ... generic definitions for each targets (`ITarget<_>`)
2730
- `Targets/` ... targets should be placed into here
2831
- `ParserTest.fs` ... debug target to test parser and typer
29-
- `JsOfOCaml/` ... `js_of_ocaml` target specific codes
30-
- `Common.fs` ... command line options for `js_of_ocaml` target
31-
- `OCamlHelper.fs` ... helper functions to generate OCaml code
32-
- `Writer.fs` ... functions for generating OCaml code from AST
33-
- `Target.fs` ... `ITarget<_>` instance for `js_of_ocaml` target
32+
- `{Target}/` ... target-specific codes
33+
- `Common.fs` ... command line options for the target
34+
- `{Target}Helper.fs` ... helper functions to generate code for the target language
35+
- `Writer.fs` ... functions for generating the code from AST
36+
- `Target.fs` ... `ITarget<_>` instance for the target
3437
- `Main.fs` ... entry point
3538
- `test/`
36-
- `jsoo/` ... test for `js_of_ocaml` target
39+
- `jsoo/` ... test for the `js_of_ocaml` target
40+
- `res/` ... test for the `ReScript` target
3741
- `dist/`
3842
- `js/ `... output directory for NPM packaging
3943
- `jsoo/` ... output directory for OPAM packaging
44+
- `jsoo/` ... output directory for NPM packaging of the stdlib for ReScript
4045
- `output/` ... temporary output directory for automated testing, etc
4146

4247
## Requirements
@@ -53,6 +58,15 @@ Modules with **\[\<AutoOpen\>\]** does not require `open` to use.
5358
- Node 14.0 or higher
5459
- [yarn](https://yarnpkg.com/) is required.
5560

61+
- ReScript 11.0.1 or higher
62+
- Installed by `yarn`.
63+
64+
## Updating TypeScript SDK
65+
66+
- Run `yarn update --latest typescript`
67+
- Run `./fake UpdateBindings` to update the Fable binding (`lib/Bindings/TypeScript.fs`)
68+
- Run `./fake build` and fix type errors
69+
5670
## Debugging
5771

5872
`./fake watch` to live update `dist/js/ts2ocaml.js`.
@@ -89,6 +103,22 @@ The resulting `dist/js/ts2ocaml.js` is then ready to run through `node`.
89103
- Copy the bindings to `test/jsoo/src/`
90104
- Perform `dune build` in `test/jsoo/`
91105

106+
### Test the tool for [`ReScript` target](rescript.md)
107+
108+
- Generate bindings for the following packages:
109+
- TypeScript standard libraries (`node_modules/typescript/lib/lib.*.d.ts`)
110+
- `typescript` with the `full` preset (involving a lot of inheritance)
111+
- `react` with the `full` preset (depending on both `full` packages and `safe` packages)
112+
- `scheduler/tracing` (`safe`)
113+
- `csstype` (`full`)
114+
- `prop-types` (`safe`)
115+
- `react-modal` with the `full` preset (depending on a `full` package)
116+
- `yargs` with the `safe` preset (depending on a `safe` package)
117+
- `yargs-parser` (`safe`)
118+
- The bindings will be placed into `output/test_res/`
119+
- Copy the bindings to `test/res/src/generated/`
120+
- Perform `yarn build` in `test/res/`
121+
92122
> Tests for other targets will be added here
93123
94124
## Publishing

0 commit comments

Comments
 (0)