Skip to content

Commit 746e015

Browse files
committed
buggy merge conflicts
2 parents 9c6ce27 + 9a8d9d9 commit 746e015

File tree

271 files changed

+28090
-8800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+28090
-8800
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ src/haz3lweb/exercises/**/*.ml linguist-generated
1111

1212
hazel.opam linguist-generated
1313
hazel.opam.locked linguist-generated
14+
package-lock.json linguist-generated
1415

1516
*.md linguist-documentation
1617
docs/** linguist-documentation

.github/workflows/deploy_branches.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ jobs:
1616
path: source
1717
- name: Add the name of the current branch to the environment as BRANCH_NAME
1818
uses: nelonoel/[email protected]
19+
- name: Install node/npm
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 'latest'
23+
- name: Install NPM dependencies
24+
run: npm install
25+
working-directory: ./source
1926
- name: Set-up OCaml
2027
uses: ocaml/setup-ocaml@v3
2128
with:
@@ -70,14 +77,20 @@ jobs:
7077
id: test
7178
run: |
7279
eval $(opam env)
73-
make test
80+
make ci
7481
working-directory: ./source
7582
- name: Test Report
7683
uses: dorny/test-reporter@v1
7784
with:
7885
name: Test Report
79-
path: junit_tests*.xml
86+
path: ./_build/default/test/junit_tests*.xml
8087
reporter: java-junit
8188
fail-on-error: true
8289
fail-on-empty: true # Use an empty test report to detect when something failed with the test runner
83-
working-directory: ./source
90+
working-directory: ./source
91+
- name: Send coverage report to Codecov
92+
run: opam exec -- bisect-ppx-report send-to Codecov --verbose
93+
env:
94+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
95+
PULL_REQUEST_NUMBER: ${{ github.event.number }}
96+
working-directory: ./source

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ hazel.opam.locked.old
5959

6060
# Code coverage
6161
_coverage/
62+
node_modules/**

Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ all: dev
99
deps:
1010
opam update
1111
opam install ./hazel.opam.locked --deps-only --with-test --with-doc
12+
npm install
1213

1314
change-deps:
1415
opam update
@@ -64,13 +65,17 @@ test:
6465
node $(TEST_DIR)/haz3ltest.bc.js
6566

6667
watch-test:
67-
dune build @ocaml-index @fmt @runtest --auto-promote --watch
68+
dune build @ocaml-index @fmt @runtest @default --profile dev --auto-promote --watch
6869

6970
coverage:
7071
dune build @src/fmt @test/fmt --auto-promote src test --profile dev
7172
dune runtest --instrument-with bisect_ppx --force
7273
bisect-ppx-report summary
7374

75+
ci:
76+
dune build --profile dev
77+
dune runtest --instrument-with bisect_ppx --force
78+
7479
generate-coverage-html:
7580
bisect-ppx-report html
7681

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Hazel ![Build Status](https://github.com/hazelgrove/hazel/actions/workflows/deploy_branches.yml/badge.svg)
1+
# Hazel ![Build Status](https://github.com/hazelgrove/hazel/actions/workflows/deploy_branches.yml/badge.svg) [![codecov](https://codecov.io/gh/hazelgrove/hazel/graph/badge.svg?token=lOGAH9Shqe)](https://codecov.io/gh/hazelgrove/hazel)
22

33
Hazel is a live functional-programming environment rooted in the principles of
44
type theory. You can find the relevant papers and more motivation at [the Hazel
@@ -17,7 +17,7 @@ can also be accessed at:
1717

1818
### Short version
1919

20-
If you already have `ocaml` version 5.2.0 and at least version 2.0 of `opam`
20+
If you already have `ocaml` version 5.2.0, at least version 2.0 of `opam`, and `npm`
2121
installed, you can build Hazel by running the following commands.
2222

2323
- `git clone [email protected]:hazelgrove/hazel.git`
@@ -211,7 +211,7 @@ It usually takes about 2 minutes if the build environment cache hits, or
211211
20+ minutes if not. You can view the status of the build in the [Actions
212212
tab on Github](https://github.com/hazelgrove/hazel/actions).
213213

214-
Builds prior to July 2024 are archived at `https://hazel.org/build/<branch name>`.
214+
Builds prior to July 2024 are archived at `https://hazel.org/build-pre-july2024/<branch name>`.
215215

216216
Note: If another archive needs to be performed, make sure to redeploy the following
217217
branches manually since we refer to them in various public material (websites and

codecov.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
codecov:
2+
branch: dev
3+
4+
coverage:
5+
status:
6+
project: # more options at https://docs.codecov.com/docs/commit-status
7+
default:
8+
target: auto # Monotonically increasing coverage
9+
threshold: 2% # Allows coverage to drop by 2%
10+
informational: true
11+
patch:
12+
default:
13+
informational: true
14+
15+
comment:
16+
layout: " diff, files"
17+
behavior: default # update comment, if exists. Otherwise post new
18+
require_changes: true
19+
require_base: false
20+
require_head: true
21+
hide_project_coverage: false

docs/Change-JS-Dependencies.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Adding JavaScript Dependencies
2+
3+
Follow these steps to add and manage JavaScript dependencies in the project:
4+
5+
## 1. Add Dependencies to `package.json`
6+
- Open the `package.json` file in the project root.
7+
- Add the required dependencies under the `"dependencies"` section.
8+
Example:
9+
```json
10+
"dependencies": {
11+
"example-library": "^1.0.0"
12+
}
13+
```
14+
15+
## 2. Update the Lock File
16+
- Run the following command to install the new dependencies and update the `package-lock.json` file:
17+
```bash
18+
make deps
19+
```
20+
**Note:** This command runs `npm install` under the hood. It installs the dependencies listed in the `package.json` file and updates the `package-lock.json` file to reflect the exact versions of the installed packages. This ensures consistent dependency resolution across environments.
21+
22+
## 3. Reference Dependencies in JavaScript Files
23+
- Make sure the desired dependency is referenced by `src/haz3lweb/www/prebundle.js`
24+
Example:
25+
```javascript
26+
import exampleLibrary from 'example-library';
27+
28+
exampleLibrary.doSomething();
29+
```
30+
- If you add a new toplevel js file (outside of prebundle.js) you need to ensure it is bundled and included
31+
- Ensure the `dune` build step is configured to use `esbuild` for bundling the JavaScript files.
32+
- This is the current step in `src/haz3lweb/dune`
33+
```dune
34+
(rule
35+
(targets bundled.js)
36+
(action
37+
(run
38+
%{project_root}/node_modules/esbuild/bin/esbuild
39+
prebundle.js
40+
--bundle
41+
--outfile=bundled.js)))
42+
```
43+
- We need the bundled js for every loaded js file we depend on
44+
- This means that dependencies should be added to already bundled files or a new bundle needs to be added.
45+
- The dependencies will be bundled automatically during the build process.

dune-project

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
(>= 2.1.0)
5151
:with-test))
5252
ocaml-lsp-server
53+
ocaml-index
5354
qcheck
5455
qcheck-alcotest
5556
ppx_deriving_qcheck))

hazel.opam

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)