Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Add preview web app
Browse files Browse the repository at this point in the history
  • Loading branch information
tmattio committed May 31, 2021
1 parent e9359ab commit 3df0f83
Show file tree
Hide file tree
Showing 39 changed files with 1,931 additions and 11 deletions.
24 changes: 21 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
_build
_opam
# Dune generated files
_build/
*.install

# Local OPAM switch
_opam/

# Merlin configuration files
.merlin

# Normal npm stuff
npm-debug.log
yarn-error.log
node_modules/
.cache/
dist/
build/

# ReScript
/lib/bs
/lib/**/*.js
.vscode

# IDE related
.vscode*
30 changes: 22 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,38 @@ $(eval $(ARGS):;@:)
all:
opam exec -- dune build --root . @install

.PHONY: dev
dev: ## Install development dependencies
opam switch create . --no-install -y
.PHONY: deps
deps: ## Install development dependencies
opam pin -n -y [email protected]:aantron/dream.git
opam pin -n -y [email protected]:tmattio/dream-cli.git
opam pin -n -y [email protected]:tmattio/dream-livereload.git
opam install -y dune-release ocamlformat utop ocaml-lsp-server
npm install
opam install --deps-only --with-test --with-doc -y .

.PHONY: create_switch
create_switch:
opam switch create . 4.10.2 --no-install

.PHONY: switch
switch: create_switch deps ## Create an opam switch and install development dependencies

.PHONY: lock
lock: ## Generate a lock file
opam lock -y .

.PHONY: build
build: ## Build the project, including non installable libraries and executables
opam exec -- dune build --root .

.PHONY: start
start: all ## Start the project
opam exec -- dune exec --root . src/bin/main.exe $(ARGS)

.PHONY: install
install: all ## Install the packages on the system
opam exec -- dune install --root .

.PHONY: preview
preview: all ## Run the produced executable
opam exec -- ./preview/script/watch.sh

.PHONY: test
test: ## Run the unit tests
opam exec -- dune runtest --root .
Expand All @@ -43,7 +57,7 @@ servedoc: doc ## Open odoc documentation with default web browser

.PHONY: fmt
fmt: ## Format the codebase with ocamlformat
opam exec -- dune build --root . @fmt --auto-promote
opam exec -- dune build --root . --auto-promote @fmt

.PHONY: watch
watch: ## Watch for the filesystem and rebuild on every change
Expand Down
17 changes: 17 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@
"The ood binary performs data linting, Netlify CMS configuration generation from types etc.")
(depends lib-ood))

(package
(name ood-preview)
(synopsis "Preview ood content")
(description "Preview ood content")
(depends
(ocaml
(>= 4.08.0))
dune
crunch
dream
dream-cli
dream-livereload
yaml
omd
(alcotest :with-test)
(odoc :with-doc)))

(package
(name netlify-cms)
(synopsis "OCaml encoding of Netlify CMS Configuration Files")
Expand Down
36 changes: 36 additions & 0 deletions ood-preview.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
synopsis: "Preview ood content"
description: "Preview ood content"
maintainer: ["[email protected]"]
authors: ["Patrick Ferris"]
license: "ISC"
homepage: "https://github.com/patricoferris/ood"
bug-reports: "https://github.com/patricoferris/ood/issues"
depends: [
"ocaml" {>= "4.08.0"}
"dune" {>= "2.8"}
"crunch"
"dream"
"dream-cli"
"dream-livereload"
"yaml"
"omd"
"alcotest" {with-test}
"odoc" {with-doc}
]
build: [
["dune" "subst"] {dev}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/patricoferris/ood.git"
Loading

0 comments on commit 3df0f83

Please sign in to comment.