File tree 14 files changed +105
-77
lines changed
14 files changed +105
-77
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ jobs:
152
152
# matrix.ocaml_compiler may contain commas
153
153
- name : Get OPAM cache key
154
154
shell : bash
155
- run : echo "opam_cache_key=opam-env-v7-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project ') }}" | sed 's/,/-/g' >> $GITHUB_ENV
155
+ run : echo "opam_cache_key=opam-env-v7-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam ') }}" | sed 's/,/-/g' >> $GITHUB_ENV
156
156
157
157
- name : Restore OPAM environment
158
158
id : cache-opam-env
@@ -249,7 +249,7 @@ jobs:
249
249
id : compiler-build-state-key
250
250
shell : bash
251
251
run : |
252
- echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('dune-project ') }}" \
252
+ echo "value=compiler-build-state-v1-${{ matrix.os }}-${{ matrix.ocaml_compiler }}-${{ hashFiles('*.opam ') }}" \
253
253
| sed 's/,/-/g' >> "$GITHUB_OUTPUT"
254
254
255
255
- name : Restore compiler build state
Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues"
9
9
depends: [
10
10
"ocaml" {>= "4.14"}
11
11
"cppo" {= "1.8.0"}
12
- "dune"
12
+ "dune" {>= "3.17"}
13
+ "odoc" {with-doc}
13
14
]
14
15
build: [
15
- ["dune" "subst"] {pinned }
16
+ ["dune" "subst"] {dev }
16
17
[
17
18
"dune"
18
19
"build"
Original file line number Diff line number Diff line change 1
- (dirs bsb bsb_exe bsb_helper bsb_helper_exe bsc cmij common core depends ext
2
- frontend gentype jsoo js_parser ml syntax)
1
+ (dirs
2
+ bsb
3
+ bsb_exe
4
+ bsb_helper
5
+ bsb_helper_exe
6
+ bsc
7
+ cmij
8
+ common
9
+ core
10
+ depends
11
+ ext
12
+ frontend
13
+ gentype
14
+ jsoo
15
+ js_parser
16
+ ml
17
+ syntax)
3
18
4
19
(env
5
20
(dev
Original file line number Diff line number Diff line change 3
3
(wrapped false)
4
4
(preprocess
5
5
(action
6
- (run %{bin:cppo} -V OCAML:%{ocaml_version} %{env:CPPO_FLAGS=}
7
- %{input-file})))
6
+ (run
7
+ %{bin:cppo}
8
+ -V
9
+ OCAML:%{ocaml_version}
10
+ %{env:CPPO_FLAGS=}
11
+ %{input-file})))
8
12
(flags
9
13
(:standard -w +a-4-42-40-9-48-70))
10
14
(foreign_stubs
Original file line number Diff line number Diff line change 2
2
3
3
(executables
4
4
(names jsoo_playground_main)
5
- (modes js)
5
+ (modes js wasm )
6
6
(enabled_if
7
7
(= %{profile} browser))
8
8
(flags
9
9
(:standard -w +a-4-9-40-42-44-45))
10
- (libraries core syntax ml js_of_ocaml))
10
+ (libraries core syntax ml js_of_ocaml)
11
+ (preprocess
12
+ (pps js_of_ocaml-ppx)))
Original file line number Diff line number Diff line change @@ -54,8 +54,6 @@ let api_version = "5"
54
54
55
55
module Js = Js_of_ocaml. Js
56
56
57
- let export (field : string ) v = Js.Unsafe. set Js.Unsafe. global field v
58
-
59
57
module Lang = struct
60
58
type t = Res
61
59
@@ -676,11 +674,9 @@ module Export = struct
676
674
end
677
675
678
676
let () =
679
- export " rescript_compiler"
680
- Js.Unsafe. (
681
- obj
682
- [|
683
- (" api_version" , inject @@ Js. string api_version);
684
- (" version" , inject @@ Js. string Bs_version. version);
685
- (" make" , inject @@ Export. make);
686
- |])
677
+ Js. export " rescript_compiler"
678
+ (object % js
679
+ val api_version = api_version
680
+ val version = Bs_version. version
681
+ method make = Export. make ()
682
+ end)
Original file line number Diff line number Diff line change 26
26
*)
27
27
module Color = struct
28
28
(* use ANSI color codes, see https://en.wikipedia.org/wiki/ANSI_escape_code *)
29
- type color =
30
- | Black [ @ live]
29
+ type [ @ warning " -37 " ] color =
30
+ | Black
31
31
| Red
32
- | Green [ @ live]
32
+ | Green
33
33
| Yellow
34
- | Blue [ @ live]
34
+ | Blue
35
35
| Magenta
36
36
| Cyan
37
- | White [ @ live]
37
+ | White
38
38
39
- type style =
39
+ type [ @ warning " -37 " ] style =
40
40
| FG of color (* foreground *)
41
- | BG of color [ @ live] (* background *)
41
+ | BG of color (* background *)
42
42
| Bold
43
43
| Reset
44
44
| Dim
@@ -132,7 +132,7 @@ module Color = struct
132
132
let term = try Sys. getenv " TERM" with Not_found -> " " in
133
133
term <> " dumb" && term <> " " && isatty stderr
134
134
135
- type setting = Auto [ @ live] | Always [ @ live] | Never [ @ live]
135
+ type [ @ warning " -37 " ] setting = Auto | Always | Never
136
136
137
137
let setup =
138
138
let first = ref true in
Original file line number Diff line number Diff line change 1
- (lang dune 2 .3 )
1
+ (lang dune 3 .17 )
2
2
3
3
(name rescript)
4
4
16
16
17
17
( package
18
18
(name rescript)
19
- (synopsis " ReScript compiler" )
20
- ( depends
21
- ( ocaml
22
- ( >= 4 .14) )
23
- ( ocamlformat
24
- ( and
25
- :with -test
26
- ( = 0 .27.0) ) )
27
- ( yojson
28
- ( and
29
- :with -test
30
- ( = 2 .2.2) ) )
31
- ( ocaml-lsp-server
32
- ( and
33
- :with -dev-setup
34
- ( = 1 .22.0) ) )
35
- ( cppo
36
- ( = 1 .8.0) )
37
- (js_of_ocaml
38
- ( = 6 .0.1) )
39
- ( ounit2
40
- ( = 2 .2.7) )
41
- dune) )
19
+ (synopsis " ReScript compiler" ))
42
20
43
21
( package
44
22
(name analysis)
Original file line number Diff line number Diff line change 1
- require ( "./compiler.js" )
1
+ // Playground bundle is UMD module
2
+ // It uses `module.exports` in current context, or fallback to `globalThis`
3
+ const { rescript_compiler } = require ( "./compiler.js" )
4
+
2
5
require ( "./packages/compiler-builtins/cmij.js" )
3
6
require ( "./packages/@rescript/react/cmij.js" )
4
7
Original file line number Diff line number Diff line change 6
6
license: "LGPL-3.0-or-later"
7
7
homepage: "https://github.com/rescript-lang/rescript-compiler"
8
8
bug-reports: "https://github.com/rescript-lang/rescript-compiler/issues"
9
- depends: [
10
- "ocaml" {>= "4.14"}
11
- "ocamlformat" {with-test & = "0.27.0"}
12
- "yojson" {with-test & = "2.2.2"}
13
- "ocaml-lsp-server" {with-dev-setup & = "1.22.0"}
14
- "cppo" {= "1.8.0"}
15
- "js_of_ocaml" {= "6.0.1"}
16
- "ounit2" {= "2.2.7"}
17
- "dune"
18
- ]
19
9
build: [
20
- ["dune" "subst"] {pinned }
10
+ ["dune" "subst"] {dev }
21
11
[
22
12
"dune"
23
13
"build"
@@ -30,3 +20,17 @@ build: [
30
20
"@doc" {with-doc}
31
21
]
32
22
]
23
+ depends: [
24
+ "ocaml" {>= "4.14"}
25
+ "ocamlformat" {with-test & = "0.27.0"}
26
+ "yojson" {with-test & = "2.2.2"}
27
+ "ocaml-lsp-server" {with-dev-setup & = "1.22.0"}
28
+ "cppo" {= "1.8.0"}
29
+ "ounit2" {= "2.2.7"}
30
+ "dune" {>= "3.17"}
31
+ "odoc" {with-doc}
32
+ # Dependencies that could be broken on Windows runners
33
+ "js_of_ocaml" {= "6.0.1" & os != "win32"}
34
+ "js_of_ocaml-ppx" {= "6.0.1" & os != "win32"}
35
+ "wasm_of_ocaml-compiler" {= "6.0.1" & os != "win32"}
36
+ ]
Original file line number Diff line number Diff line change
1
+ depends: [
2
+ "ocaml" {>= "4.14"}
3
+ "cppo" {= "1.8.0"}
4
+ "dune" {>= "3.17"}
5
+ "ocamlformat" {with-test & = "0.27.0"}
6
+ "yojson" {with-test & = "2.2.2"}
7
+ "ounit2" {with-test & = "2.2.7"}
8
+ "odoc" {with-doc}
9
+ "ocaml-lsp-server" {with-dev-setup & = "1.22.0"}
10
+
11
+ # Test dependencies that would be broken on Windows runners
12
+ "js_of_ocaml" {os != "win32" & with-test & = "6.0.1"}
13
+ "js_of_ocaml-ppx" {os != "win32" & with-test & = "6.0.1"}
14
+ "wasm_of_ocaml-compiler" {os != "win32" & with-test & = "6.0.1"}
15
+ ]
Original file line number Diff line number Diff line change @@ -24,10 +24,19 @@ function copyExe(dir, exe) {
24
24
fs . rmSync ( dest ) ;
25
25
}
26
26
27
- fs . copyFileSync ( src , dest ) ;
28
-
29
- if ( process . platform !== "win32" ) {
30
- child_process . execSync ( `strip ${ dest } ` ) ;
27
+ let mode = 0o755 ;
28
+ if ( fs . existsSync ( dest ) ) {
29
+ mode = fs . statSync ( dest ) . mode & 0o777 ;
30
+ fs . chmodSync ( dest , mode | 0o200 ) ; // u+w
31
+ }
32
+ try {
33
+ fs . copyFileSync ( src , dest ) ;
34
+ if ( process . platform !== "win32" ) {
35
+ fs . chmodSync ( dest , mode | 0o200 ) ; // u+w
36
+ child_process . execSync ( `strip ${ dest } ` ) ;
37
+ }
38
+ } finally {
39
+ fs . chmodSync ( dest , mode ) ;
31
40
}
32
41
}
33
42
Original file line number Diff line number Diff line change @@ -33,16 +33,16 @@ module Time : sig
33
33
34
34
val now : unit -> t
35
35
36
- val to_uint64 : t -> int64 [ @@ live]
36
+ val [ @ warning " -32 " ] to_uint64 : t -> int64
37
37
38
38
(* let of_uint64_ns ns = ns *)
39
39
40
- val nanosecond : t [ @@ live]
41
- val microsecond : t [ @@ live]
42
- val millisecond : t [ @@ live]
43
- val second : t [ @@ live]
44
- val minute : t [ @@ live]
45
- val hour : t [ @@ live]
40
+ val [ @ warning " -32 " ] nanosecond : t
41
+ val [ @ warning " -32 " ] microsecond : t
42
+ val [ @ warning " -32 " ] millisecond : t
43
+ val [ @ warning " -32 " ] second : t
44
+ val [ @ warning " -32 " ] minute : t
45
+ val [ @ warning " -32 " ] hour : t
46
46
47
47
val zero : t
48
48
Original file line number Diff line number Diff line change @@ -10,10 +10,11 @@ depends: [
10
10
"ocaml" {>= "4.14"}
11
11
"cppo" {= "1.8.0"}
12
12
"analysis"
13
- "dune"
13
+ "dune" {>= "3.17"}
14
+ "odoc" {with-doc}
14
15
]
15
16
build: [
16
- ["dune" "subst"] {pinned }
17
+ ["dune" "subst"] {dev }
17
18
[
18
19
"dune"
19
20
"build"
You can’t perform that action at this time.
0 commit comments