Skip to content

Commit c2c2be3

Browse files
authored
cherry pick changes from playground fix (#235)
1 parent 50c6ac6 commit c2c2be3

13 files changed

Lines changed: 45 additions & 64 deletions

File tree

.github/workflows/publish-version.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v6
17+
with:
18+
submodules: recursive
1719
- name: Setup Node
1820
uses: actions/setup-node@v6
1921
with:
@@ -22,19 +24,28 @@ jobs:
2224
- uses: ocaml/setup-ocaml@v3
2325
with:
2426
ocaml-compiler: 5.4.0
27+
opam-pin: false
2528
dune-cache: false # can cause trouble when generating melange docs in step below: https://github.com/ocaml/dune/issues/7720
2629
- name: Install all deps
2730
run: make install
28-
- name: Generate melange docs
29-
run: opam reinstall -y melange --with-doc --keep-build-dir
30-
- name: Copy melange docs in ml syntax
31+
- name: Check vendored sources exist
32+
run: |
33+
test -d melange
34+
test -d reason-react
35+
- name: Generate melange docs in ml syntax
3136
run: |
37+
ODOC_SYNTAX="ml" opam exec -- dune build --root melange @doc
3238
mkdir -p docs/public/api/
33-
cp -r `opam var melange:build`/_build/default/_doc/_html docs/public/api/ml
39+
cp -r melange/_build/default/_doc/_html docs/public/api/ml
3440
- name: Generate melange docs in re syntax
35-
run: ODOC_SYNTAX="re" opam reinstall -y melange --with-doc --keep-build-dir
36-
- name: Copy melange docs in re syntax
37-
run: cp -r `opam var melange:build`/_build/default/_doc/_html docs/public/api/re
41+
run: |
42+
opam exec -- dune clean --root melange
43+
ODOC_SYNTAX="re" opam exec -- dune build --root melange @doc
44+
cp -r melange/_build/default/_doc/_html docs/public/api/re
45+
- name: Build playground assets
46+
run: |
47+
opam exec -- dune build melange/melange.install
48+
opam exec -- dune build @playground-assets
3849
# only uncomment after a new version is released, from inside a `x.x.x-patches` branch
3950
# - name: Run canonical script
4051
# run: opam exec -- dune exec add_canonical docs/public/api

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ node_modules
77
docs/.vitepress/cache
88
docs/.vitepress/dist
99
docs/public/playground
10-
11-
melange

.gitmodules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[submodule "melange"]
2+
path = melange
3+
url = https://github.com/melange-re/melange.git
4+
branch = v6-54
5+
[submodule "reason-react"]
6+
path = reason-react
7+
url = https://github.com/reasonml/reason-react.git

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ create-switch: ## Create opam switch
1717
.PHONY: init
1818
init: create-switch install ## Configure everything to develop this repository in local
1919

20+
.PHONY: init-submodules
21+
init-submodules:
22+
git submodule update --init --recursive
23+
2024
.PHONY: install
21-
install: ## Install development dependencies
25+
install: init-submodules ## Install development dependencies
2226
opam update
2327
opam install -y . --deps-only --with-doc
24-
opam pin -y add $(project_name).dev .
25-
opam source melange.$$(opam show melange -f version --color never) --dir melange
2628

2729
.PHONY: check-reason
2830
check-reason: ## Checks that Reason syntax snippets are well formed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ https://github.com/melange-re/melange.
1111
1212
## Working locally
1313

14-
After cloning the repository, install the necessary JavaScript packages:
14+
After cloning the repository, initialize submodules and install the necessary JavaScript packages:
1515

1616
```bash
17+
git submodule update --init --recursive
1718
yarn
1819
```
1920

2021
Then run `make dev` from the folder where the repository lives.
2122

2223
## (Optional) Fetch melange documentation API
2324

24-
Optionally, to fetch the melange odoc documentation and generate markdown into docs/api, you will need the melange package installed into your switch and run:
25+
Optionally, to generate melange odoc documentation markdown into docs/api, initialize the vendored `melange` submodule and run:
2526

2627
```bash
28+
git submodule update --init --recursive
2729
make pull-melange-docs SYNTAX="re"
2830
make pull-melange-docs SYNTAX="ml"
2931
```

documentation-site.opam

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ license: "MIT"
1414
homepage: "https://github.com/melange-re/melange-re.github.io"
1515
bug-reports: "https://github.com/melange-re/melange-re.github.io/issues"
1616
depends: [
17+
"dune" {>= "3.8"}
1718
"ocaml"
18-
"dune" {>= "3.8" & >= "3.8"}
1919
"reason" {>= "3.17"}
20-
"reason-react"
21-
"reason-react-ppx"
2220
"ocamlformat"
2321
"js_of_ocaml"
2422
"cmarkit" {dev}
@@ -40,8 +38,3 @@ build: [
4038
]
4139
]
4240
dev-repo: "git+https://github.com/melange-re/melange-re.github.io.git"
43-
pin-depends: [
44-
[ "reason-react-ppx.dev" "git+https://github.com/reasonml/reason-react.git#8f49cb937cdafcc4e2d83a2edcca66aa24bf8e20"]
45-
[ "reason-react.dev" "git+https://github.com/reasonml/reason-react.git#8f49cb937cdafcc4e2d83a2edcca66aa24bf8e20"]
46-
[ "dune.dev" "git+https://github.com/ocaml/dune.git#e7ca9f7f2652761b77dd687787436bdd31b1571c"]
47-
]

dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(vendored_dirs melange)
1+
(vendored_dirs melange reason-react)

dune-project

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
"Antonio Nuno Monteiro <anmonteiro@gmail.com>"
1616
"Javier Chávarri <javier.chavarri@gmail.com>")
1717

18+
(homepage "https://github.com/melange-re/melange-re.github.io")
19+
20+
(bug_reports "https://github.com/melange-re/melange-re.github.io/issues")
21+
1822
(package
1923
(name documentation-site)
2024
(synopsis "Melange documentation site")
2125
(description "Content for the Melange documentation site")
2226
(depends
2327
ocaml
24-
(dune (>= 3.8))
2528
(reason (>= 3.17))
26-
reason-react
27-
reason-react-ppx
2829
ocamlformat
2930
js_of_ocaml
3031
(cmarkit :dev)

flake.nix

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,6 @@
3232
runHook postBuild
3333
'';
3434
});
35-
melange = osuper.melange.overrideAttrs (_: {
36-
src = super.fetchFromGitHub {
37-
owner = "melange-re";
38-
repo = "melange";
39-
rev = "0c7fbb6b6734d54e60b7e73d2d696ec31e90a0c8";
40-
fetchSubmodules = true;
41-
hash = "sha256-HOLqyVCfHfpbJwcrYH1M1jT8Y6v45oFG42SKJVYJm/4=";
42-
};
43-
});
44-
melange-playground =
45-
with oself;
46-
buildDunePackage {
47-
pname = "melange-playground";
48-
inherit (melange) src version;
49-
nativeBuildInputs = [
50-
cppo
51-
js_of_ocaml
52-
];
53-
propagatedBuildInputs = [
54-
js_of_ocaml-compiler
55-
melange
56-
reason
57-
reason-react-ppx
58-
];
59-
};
6035
}
6136
);
6237
}
@@ -98,8 +73,8 @@
9873
dune
9974
ocaml
10075
findlib
101-
melange
102-
melange-playground
76+
js_of_ocaml
77+
js_of_ocaml-compiler
10378
reason
10479
];
10580
buildInputs =
@@ -110,8 +85,6 @@
11085
pkgs.yarn
11186
]
11287
++ (with pkgs.ocamlPackages; [
113-
reason-react
114-
reason-react-ppx
11588
ocamlformat
11689
js_of_ocaml
11790
cmarkit

melange

Submodule melange added at 0c7fbb6

0 commit comments

Comments
 (0)