-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(melange): incorrect path when public lib depends on private lib (#…
…7652) Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
7e16d5b
commit 239e6ac
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Melange public library depends on private library | ||
|
||
$ cat > dune-project <<EOF | ||
> (lang dune 3.8) | ||
> (package (name foo)) | ||
> (using melange 0.1) | ||
> EOF | ||
$ mkdir -p priv | ||
$ cat > priv/dune <<EOF | ||
> (library | ||
> (name priv) | ||
> (package foo) | ||
> (modes melange)) | ||
> EOF | ||
$ cat > priv/priv.ml <<EOF | ||
> let x = "private" | ||
> EOF | ||
$ mkdir -p lib | ||
$ cat > lib/dune <<EOF | ||
> (library | ||
> (public_name foo) | ||
> (modes melange) | ||
> (libraries priv)) | ||
> EOF | ||
$ cat > lib/foo.ml <<EOF | ||
> let x = "public lib uses " ^ Priv.x | ||
> EOF | ||
$ cat > dune <<EOF | ||
> (melange.emit | ||
> (target output) | ||
> (libraries foo) | ||
> (emit_stdlib false)) | ||
> EOF | ||
$ cat > entry.ml <<EOF | ||
> let () = Js.log Foo.x | ||
> EOF | ||
$ dune build @melange | ||
$ node _build/default/output/entry.js 2>&1 | grep 'Cannot find module' | ||
Error: Cannot find module 'priv/priv.js' | ||
$ cat _build/default/output/node_modules/foo/foo.js | ||
// Generated by Melange | ||
'use strict'; | ||
var Priv = require("priv/priv.js"); | ||
var x = "public lib uses " + Priv.x; | ||
exports.x = x; | ||
/* No side effect */ | ||