-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e76368c
commit f8881f4
Showing
9 changed files
with
169 additions
and
97 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,62 @@ | ||
project_name = astexplorer-refmt | ||
|
||
DUNE = opam exec -- dune | ||
opam_file = $(project_name).opam | ||
|
||
.PHONY: help | ||
help: | ||
@echo ""; | ||
@echo "List of available make commands"; | ||
@echo ""; | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'; | ||
@echo ""; | ||
|
||
.PHONY: build-dev | ||
dev: | ||
$(DUNE) build -w | ||
|
||
.PHONY: build-prod | ||
prod: | ||
yarn install | ||
$(DUNE) build | ||
mkdir -p dist | ||
chmod -R 777 dist | ||
yarn build:prod | ||
|
||
.PHONY: clean | ||
clean: ## Clean artifacts | ||
$(DUNE) clean | ||
|
||
.PHONY: exec | ||
exec: ## Run the project | ||
$(DUNE) exec $(demo) | ||
|
||
.PHONY: format | ||
format: | ||
DUNE_CONFIG__GLOBAL_LOCK=disabled $(DUNE) build @fmt --auto-promote | ||
|
||
.PHONY: format-check | ||
format-check: | ||
$(DUNE) build @fmt | ||
|
||
.PHONY: create-switch | ||
create-switch: ## Create opam switch | ||
opam switch create . 5.2.1 --deps-only --with-dev-setup -y | ||
|
||
.PHONY: install | ||
install: | ||
yarn install | ||
$(DUNE) build @install | ||
opam install . --deps-only --with-test | ||
|
||
.PHONY: init | ||
init: create-switch install | ||
|
||
.PHONY: demo | ||
demo: | ||
yarn install | ||
$(DUNE) build | ||
mkdir -p src/example/dist | ||
chmod -R 777 src/example/dist | ||
cp _build/default/src/ast_explorer_refmt.bc.js ./src/example/dist/ast_explorer_refmt.bc.js | ||
yarn serve -p 3030 src/example |
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
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 |
---|---|---|
@@ -1,7 +1,10 @@ | ||
# This file is generated by dune, edit dune-project instead | ||
opam-version: "2.0" | ||
synopsis: "OCaml AST explorer for Reason and OCaml" | ||
maintainer: ["Javier Chávarri <[email protected]>"] | ||
maintainer: [ | ||
"Javier Chávarri <[email protected]>" | ||
"Pedro Lisboa <[email protected]>" | ||
] | ||
authors: ["Javier Chávarri <[email protected]>"] | ||
license: "ISC" | ||
homepage: "https://github.com/jchavarri/astexplorer-refmt" | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
(dirs src) | ||
(dirs src) |
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
(license ISC) | ||
|
||
(maintainers "Javier Chávarri <[email protected]>") | ||
(maintainers "Javier Chávarri <[email protected]>" "Pedro Lisboa <[email protected]>") | ||
|
||
(authors "Javier Chávarri <[email protected]>") | ||
|
||
|
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
(executable | ||
(name ast_explorer_refmt) | ||
(libraries reason ppxlib js_of_ocaml ppxlib.astlib compiler-libs.bytecomp) | ||
(modes js)) | ||
(libraries reason ppxlib js_of_ocaml ppxlib.astlib compiler-libs.common) | ||
(modes js)) |
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,4 @@ | ||
let code = "let x = 1"; | ||
|
||
let ast = window.parseReason(code); | ||
window.document.querySelector("#app").innerHTML = ast; |
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