@@ -5,6 +5,9 @@ Overview for Developers
5
5
6
6
Modules with ** \[\< AutoOpen\>\] ** does not require ` open ` to use.
7
7
8
+ - ` build/ ` ... build scripts
9
+ - ` BindingUpdater.fs ` ... a utility to update bindings in ` lib/Bindings/ `
10
+ - ` build.fs ` ... the main build script
8
11
- ` lib/ ` ... target-agnostic part of the tool (will be separated to a different repo in near future)
9
12
- ` Bindings/ ` ... bindings to JS libraries (typescript, browser-or-node)
10
13
- ` Extensions.fs ` ... ** \[\< AutoOpen\>\] ** extensions for standard library and JS libraries
@@ -26,17 +29,19 @@ Modules with **\[\<AutoOpen\>\]** does not require `open` to use.
26
29
- ` Target.fs ` ... generic definitions for each targets (` ITarget<_> ` )
27
30
- ` Targets/ ` ... targets should be placed into here
28
31
- ` 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
34
37
- ` Main.fs ` ... entry point
35
38
- ` 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
37
41
- ` dist/ `
38
42
- ` js/ ` ... output directory for NPM packaging
39
43
- ` jsoo/ ` ... output directory for OPAM packaging
44
+ - ` jsoo/ ` ... output directory for NPM packaging of the stdlib for ReScript
40
45
- ` output/ ` ... temporary output directory for automated testing, etc
41
46
42
47
## Requirements
@@ -53,6 +58,15 @@ Modules with **\[\<AutoOpen\>\]** does not require `open` to use.
53
58
- Node 14.0 or higher
54
59
- [ yarn] ( https://yarnpkg.com/ ) is required.
55
60
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
+
56
70
## Debugging
57
71
58
72
` ./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`.
89
103
- Copy the bindings to ` test/jsoo/src/ `
90
104
- Perform ` dune build ` in ` test/jsoo/ `
91
105
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
+
92
122
> Tests for other targets will be added here
93
123
94
124
## Publishing
0 commit comments