Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Example) Expose routes library in playground #178

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions documentation-site.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ depends: [
"reason" {>= "3.10.0"}
"reason-react"
"reason-react-ppx"
"routes"
"ocamlformat"
"js_of_ocaml"
"cmarkit" {dev}
Expand All @@ -32,6 +33,7 @@ pin-depends: [
[ "reason-react.dev" "git+https://github.com/reasonml/reason-react.git#4ee2eda353628090eda95e0b8dabe4e2be50f954" ]
[ "reason-react-ppx.dev" "git+https://github.com/reasonml/reason-react.git#4ee2eda353628090eda95e0b8dabe4e2be50f954" ]
[ "cmarkit.dev" "git+https://github.com/dbuenzli/cmarkit.git#f37c8ea86fd0be8dba7a8babcee3682e0e047d91" ]
[ "routes.dev" "git+https://github.com/jchavarri/routes.git#57fb76038b429a6adb4e42aeef04cca7079fe157" ]
]
build: [
["dune" "subst"] {dev}
Expand Down
15 changes: 13 additions & 2 deletions playground/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
; melange doesn't include belt and dom anymore, including them below leads to
; `_build/default/playground/output/node_modules` to include the runtimes
melange.belt
melange.dom)
melange.dom
routes)
(modules) ; Empty, we just want to the js artifacts from the libraries
(module_systems es6))

Expand All @@ -19,6 +20,15 @@
(bash
"find $(dirname %{some-cmi}) -name \"*.cmi\" -or -name \"*.cmj\" | xargs js_of_ocaml build-fs -o %{target}")))

(rule
(deps
%{bin:js_of_ocaml}
(:some-cmi %{lib:routes:melange/routes.cmi}))
(target routes-cmijs.js)
(action
(bash
"find $(dirname %{some-cmi}) -name \"*.cmi\" -or -name \"*.cmj\" | xargs js_of_ocaml build-fs -o %{target}")))

(executable
(name format)
(modules format)
Expand All @@ -37,6 +47,7 @@
(deps
(alias playground-runtime-js)
format.bc.js
reason-react-cmijs.js)
reason-react-cmijs.js
routes-cmijs.js)
(action
(echo "assets generated")))
1 change: 1 addition & 0 deletions playground/src/app.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./App.css";
import "../../_build/default/playground/reason-react-cmijs";
import "../../_build/default/playground/routes-cmijs";
import "../../_opam/bin/mel_playground.bc";
import "../../_opam/bin/melange-cmijs";
import "../../_opam/bin/format.bc.js";
Expand Down