Skip to content

Commit

Permalink
rescript: make playwright-core compile
Browse files Browse the repository at this point in the history
  • Loading branch information
cannorin committed Apr 22, 2024
1 parent 4a99fd3 commit 5ae8d0f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ module Test =
"safe", !! "node_modules/@types/yargs/index.d.ts", [];
"minimal", !! "node_modules/@types/vscode/index.d.ts", ["--readable-names"];

// #404: complex package which could break topological sorting
"minimal", !! "node_modules/playwright-core/index.d.ts", [];
// #404: package with mutually recursive files (requires --merge)
"minimal", !! "node_modules/playwright-core/index.d.ts" ++ "node_modules/playwright-core/types/*.d.ts", ["--merge"];
]

for preset, package, additionalOptions in packages do
Expand All @@ -196,6 +196,15 @@ module Test =
$"--preset {preset}"; $"-o {outputDir}"] @ additionalOptions)
package

// patches for playwright-core
Shell.replaceInFiles [
"Readable.t", "Readable.t<'t>"
"URL.t", "NodeJs.Url.t"
] [
outputDir </> "playwright_core.resi"
outputDir </> "playwright_core.res"
]

let build () =
Shell.mkdir srcGeneratedDir
for file in outputDir |> Shell.copyRecursiveTo true srcGeneratedDir do
Expand Down
2 changes: 2 additions & 0 deletions dist/res/src/ts2ocaml.res
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ type true_ = bool
type false_ = bool
type intrinsic = private string
type object = Type.Classify.object
module Object = { type t = object }
type function = Type.Classify.function
module Function = { type t = function }

module Union = {
type container<+'cases>
Expand Down
3 changes: 3 additions & 0 deletions test/res/src/placeholder/SVGElement.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type _svgElement<'a>
type svgElement_like<'a> = Dom.element_like<_svgElement<'a>>
type t = svgElement_like<Dom._baseClass>

0 comments on commit 5ae8d0f

Please sign in to comment.