Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into sanderspies/fix_2681
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Jul 28, 2024
2 parents 5e5d22a + 461f751 commit 1f0b757
Show file tree
Hide file tree
Showing 416 changed files with 22,408 additions and 101,521 deletions.
1 change: 0 additions & 1 deletion .dune-for-prepublish

This file was deleted.

11 changes: 0 additions & 11 deletions .gitattributes

This file was deleted.

14 changes: 3 additions & 11 deletions .github/workflows/esy-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,23 @@ jobs:
matrix:
os:
- ubuntu-latest
- macos-latest
- macos-13
- windows-latest

ocaml-compiler:
# Please keep the list in sync with the minimal version of OCaml in
# esy.json, reason.esy/reason.opam and rtop.esy/rtop.opam.
- 4.06.x # We support 4.06 because is the one that is used in BuckleScript / ReScript v9
- 4.10.x
- 4.12.x
- 4.14.x

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install esy
run: npm install -g esy@0.6.12
run: npm install -g esy@0.7.3-beta.3

- name: Restore global cache (~/.esy/source)
id: global-cache
Expand All @@ -66,9 +61,6 @@ jobs:
key: esy-build-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('esy.lock.json') }}
restore-keys: esy-build-${{ matrix.os }}-

- name: Instal OCaml ${{ matrix.ocaml-compiler }}
run: esy add ocaml@${{ matrix.ocaml-compiler }}

- name: Install dependencies
run: esy install

Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/nix-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Nix Pipeline

on:
pull_request:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ubuntu-tests:
name: Build and test (Ubuntu) (${{ matrix.ocaml-version }})

strategy:
matrix:
ocaml-version:
- 4_14
- 5_0
- 5_1
- 5_2

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- name: "Run nix-build"
run: nix-build ./nix/ci.nix --argstr ocamlVersion ${{ matrix.ocaml-version }}

macos-tests:
name: Build and test (${{ matrix.os }}) (${{ matrix.ocaml-version }})

strategy:
matrix:
os:
- macos-13
- macos-14
ocaml-version:
- 4_14
- 5_0
- 5_2

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
extra-substituters = https://anmonteiro.nix-cache.workers.dev
extra-trusted-public-keys = ocaml.nix-cache.com-1:/xI2h2+56rwFfKyyFVbkJSeGqSIYMC/Je+7XXqGKDIY=
- name: "Run nix-build"
run: nix-build ./nix/ci.nix --argstr ocamlVersion ${{ matrix.ocaml-version }}

8 changes: 4 additions & 4 deletions .github/workflows/opam-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- macos-latest
- macos-13
- windows-latest

ocaml-compiler:
Expand All @@ -33,7 +33,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v2
Expand All @@ -48,7 +48,7 @@ jobs:
with:
path: ~/.opam
key: opam-${{ matrix.os }}-${{ matrix.ocaml-compiler }}-${{ hashFiles('**.opam') }}

- name: Load opam cache when Windows
if: runner.os == 'Windows'
id: opam-cache-windows
Expand All @@ -64,7 +64,7 @@ jobs:
run: opam exec -- dune build -p reason,rtop

- name: Test
run: opam exec -- dune runtest
run: opam exec -- dune runtest -p reason,rtop

- name: Save cache when not Windows
uses: actions/cache/save@v3
Expand Down
21 changes: 0 additions & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
*.native
*.byte
*.cmt
a.out
_build
*.install
pkg/META
.DS_Store
formatTest/customMLFiles/*.ml
formatTest/customMLFormatOutput.re
formatTest/failed_tests
formatTest/**/actual_output/
formatTest/**/intf_output/
miscTests/reactjs_jsx_ppx_tests/actual*.re
miscTests/reactjs_jsx_ppx_tests/*.cm*
*.log
src/reason_parser.messages.bak
src/reason_parser_message.ml
*~
node_modules
/bspacks/build/
/bspacks/ocaml-migrate-parsetree/
/bspacks/closure-compiler/

# gitignored, but not npmignored. Published by `npm run prepublish`
refmt.js
refmt.map
.merlin

# Esy
_esy
Expand Down
46 changes: 42 additions & 4 deletions HISTORY.md → CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
## 3.9 (unreleased)

## Unreleased

- Support `module%ppx` syntax (@anmonteiro,
[#2771](https://github.com/reasonml/reason/pull/2771))
- Extend open to arbitrary module expression (@anmonteiro,
[#2773](https://github.com/reasonml/reason/pull/2773))
- Wrap `let lazy patterns = ..` in parentheses (`let lazy(patterns) = ..`)
(@anmonteiro, [#2774](https://github.com/reasonml/reason/pull/2774))
- Print poly variants as normal variansts (@Sander Spies) [#2708](https://github.com/reasonml/reason/pull/2708)
- Improve printing of anonymous function return type
- Improve printing of destructuring with local open. [#2684](https://github.com/reasonml/reason/pull/2684)
- Reduce the amount of parentheses around functor usage. [#2683](https://github.com/reasonml/reason/pull/2683)
- Print module type body on separate line (@SanderSpies) [#2709](https://github.com/reasonml/reason/pull/2709)

## 3.12.0

- Add `\u{hex-escape}` syntax (@anmonteiro,
[#2738](https://github.com/reasonml/reason/pull/2738))
- Support local open and let bindings (@SanderSpies) [#2716](https://github.com/reasonml/reason/pull/2716)
- outcome printer: change the printing of `@bs.*` to `@mel.*` (@anmonteiro, [#2755](https://github.com/reasonml/reason/pull/2755))
- Fix outcome printing of optional arguments on OCaml 5.2 (@anmonteiro, [#2753](https://github.com/reasonml/reason/pull/2753))
- support parsing and printing of `external%extension` (@anmonteiro, [#2750](https://github.com/reasonml/reason/pull/2750), [#2766](https://github.com/reasonml/reason/pull/2766), [#2767](https://github.com/reasonml/reason/pull/2767))
- install `refmt` manpage (@anmonteiro, [#2760](https://github.com/reasonml/reason/pull/2760))
- add support for parsing / printing of refutation clause in `switch` (@anmonteiro, [#2765](https://github.com/reasonml/reason/pull/2765))
- support `let%ppx` in signatures (@anmonteiro, [#2770](https://github.com/reasonml/reason/pull/2770))

## 3.11.0

- Print structure items extension nodes correctly inside modules (@anmonteiro,
[#2723](https://github.com/reasonml/reason/pull/2723))
- Print wrapped type constraint on record patterns (@anmonteiro,
[#2725](https://github.com/reasonml/reason/pull/2725))
- Support OCaml 5.2 (@anmonteiro, [#2734](https://github.com/reasonml/reason/pull/2734))

## 3.10.0

- Support `@mel.*` attributes in addition to `@bs.*` (@anmonteiro,
[#2721](https://github.com/reasonml/reason/pull/2721))

## 3.9.0

- Reduce the amount of parentheses around functor usage (@SanderSpies, [#2683](https://github.com/reasonml/reason/pull/2683))
- Print module type body on separate line (@SanderSpies, [#2709](https://github.com/reasonml/reason/pull/2709))
- Fix missing patterns around contraint pattern (a pattern with a type annotation).
- Fix top level extension printing
- Remove the dependency on the `result` package, which isn't needed for OCaml
4.03 and above (@anmonteiro) [#2703](https://github.com/reasonml/reason/pull/2703)
- Fix the binary parser by converting to the internal AST version used by
Reason (@anmonteiro) [#2713](https://github.com/reasonml/reason/pull/2713)
- Port Reason to `ppxlib` (@anmonteiro, [#2711](https://github.com/reasonml/reason/pull/2711))
- Support OCaml 5.1 (@anmonteiro, [#2714](https://github.com/reasonml/reason/pull/2714))

## 3.8.2

Expand Down
50 changes: 16 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ install:
# CI uses opam. Regular workflow needn't.
test-ci: install test-once-installed

# Can be run with esy x - no need to build beforehand.
test-once-installed: clean-tests
./miscTests/rtopIntegrationTest.sh
./miscTests/backportSyntaxTests.sh
cd formatTest; ./test.sh
test-once-installed: test

test:
esy dune runtest

test-watch:
esy dune runtest --watch

.PHONY: coverage
coverage:
Expand All @@ -26,53 +28,33 @@ coverage:
bisect-ppx-report -ignore-missing-files -I _build/ -html coverage-after/ bisect*.out ./*/*/*/bisect*.out
find -iname "bisect*.out" -exec rm {} \;

clean-tests:
rm -rf ./formatTest/**/actual_output
rm -rf ./formatTest/**/intf_output
rm -rf ./formatTest/**/**/TestTest.cmi
rm -f ./formatTest/failed_tests
rm -f ./miscTests/reactjs_jsx_ppx_tests/*.cm*

testFormat: build clean-tests
cd formatTest; ./test.sh
testFormat: build test-once-installed

all_errors:
@ echo "Regenerate all the possible error states for Menhir."
@ echo "Warning: This will take a while and use a lot of CPU and memory."
@ echo "---"
menhir --explain --strict --unused-tokens src/reason-parser/reason_parser.mly --list-errors > src/reason-parser/reason_parser.messages.checked-in

clean: clean-tests
clean:
dune clean

clean-for-ci: clean-tests
clean-for-ci:
rm -rf ./_build

.PHONY: build clean

# For publishing esy releases to npm
esy-prepublish: build clean-tests
esy-prepublish: build
node ./scripts/esy-prepublish.js

# For OPAM
release_check:
./scripts/release-check.sh

# For OPAM
release: release_check
git add package.json src/refmt/package.ml reason.opam
git commit -m "Version $(version)"
git tag -a $(version) -m "Version $(version)."
# Push first the objects, then the tag.
git push "[email protected]:reasonml/reason.git"
git push "[email protected]:reasonml/reason.git" tag $(version)
git clean -fdx
./scripts/opam-release.sh

.PHONY: release

all-supported-ocaml-versions:
# the --dev flag has been omitted here but should be re-introduced eventually
dune build @install @runtest --root .

.PHONY: all-supported-ocaml-versions

doc:
esy dune build @doc

.PHONY: doc
Loading

0 comments on commit 1f0b757

Please sign in to comment.