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

Melange #29

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ dist/
lib/bs/
*.bs.js
/docs/coverage

# Dune
_build
_opam

.DS_Store
62 changes: 62 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
project_name = relude-fetch

DUNE = opam exec -- dune

.DEFAULT_GOAL := help

.PHONY: help
help: ## Print this help message
@echo "List of available make commands";
@echo "";
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}';
@echo "";

.PHONY: create-switch
create-switch: ## Create opam switch
opam switch create . 5.1.0 -y --deps-only

.PHONY: gen-opam
gen-opam: ## When .opam isn't there
$(DUNE) build $(project_name).opam

.PHONY: init
init: create-switch install ## Configure everything to develop this repository in local

.PHONY: install
install: ## Install development dependencies
npm install # install JavaScript packages that the project might depend on, like `react` or `react-dom`
opam update # make sure that opam has the latest information about published libraries in the opam repository https://opam.ocaml.org/packages/
opam install -y . --deps-only --with-test # install the Melange and OCaml dependencies
opam exec opam-check-npm-deps # check that the versions of the JavaScript packages installed match the requirements defined by Melange libraries

.PHONY: build
build: ## Build the project
$(DUNE) build @test

.PHONY: build_verbose
build_verbose: ## Build the project
$(DUNE) build --verbose @test

.PHONY: serve
serve: ## Serve the application with a local HTTP server
npm run serve

.PHONY: bundle
bundle: ## Bundle the JavaScript application
npm run bundle

.PHONY: clean
clean: ## Clean build artifacts and other generated files
$(DUNE) clean

.PHONY: format
format: ## Format the codebase with ocamlformat
$(DUNE) build @fmt --auto-promote

.PHONY: format-check
format-check: ## Checks if format is correct
$(DUNE) build @fmt

.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
$(DUNE) build --watch @test
2 changes: 1 addition & 1 deletion __tests__/ReludeFetch_test.re
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ describe("ReludeFetch integration tests", () => {
onDone(fail("Failed: " ++ Error.show(e => e, error))),
);
});
});
});
7 changes: 7 additions & 0 deletions __tests__/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(melange.emit
(target output)
(alias test)
(libraries melange melange-jest.jest bastet relude reludeFetch)
(preprocess
(pps melange.ppx))
(module_systems commonjs))
42 changes: 0 additions & 42 deletions bsconfig.json

This file was deleted.

1 change: 1 addition & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(dirs :standard __tests__ \ node_modules)
41 changes: 41 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(lang dune 3.8)

(generate_opam_files)

(using melange 0.1)

(source
(github reazen/relude-fetch))

(name relude-fetch)

(license "MIT")

(maintainers "Michael Martin" "Andy White")

(authors "Michael Martin" "Andy White")

(homepage https://github.com/reazen/relude-fetch)

(bug_reports https://github.com/reazen/relude-fetch/issues)

(package
(name relude-fetch)
(synopsis "Relude Fetch")
(description "Relude interop library for the fetch API")
(depends
dot-merlin-reader
(melange
(>= 2.0.0))
(ocaml
(>= 5.1.0))
(reason
(>= 3.10.0))
ocaml-lsp-server
relude
bastet
(melange-jest
(>= 0.1.0))
opam-check-npm-deps
melange-fetch
melange-jest))
Loading
Loading