Skip to content

Commit

Permalink
Merge pull request #792 from ocsigen/tmplt
Browse files Browse the repository at this point in the history
Update basic template to be easier to use for beginner
  • Loading branch information
balat committed Mar 22, 2024
2 parents dcd9900 + 10fb0b5 commit a07abdb
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The client-side code is compiled to JS using Ocsigen Js_of_ocaml or to Wasm usin
(js_of_ocaml-tyxml (>= 3.6.0))
lwt_log
(lwt_ppx (>= 1.2.3))
(tyxml (and (>= 4.4.0) (< 4.5.0)))
(tyxml (and (>= 4.6.0) (< 4.7.0)))
(ocsigenserver (and (>= 5.1.0) (< 6.0.0)))
(ipaddr (>= 2.1))
(reactiveData (>= 0.2.1))
Expand Down
2 changes: 1 addition & 1 deletion eliom.opam
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ depends: [
"js_of_ocaml-tyxml" {>= "3.6.0"}
"lwt_log"
"lwt_ppx" {>= "1.2.3"}
"tyxml" {>= "4.6.0"}
"tyxml" {>= "4.6.0" & < "4.7.0"}
"ocsigenserver" {>= "5.1.0" & < "6.0.0"}
"ipaddr" {>= "2.1"}
"reactiveData" {>= "0.2.1"}
Expand Down
4 changes: 2 additions & 2 deletions pkg/distillery/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(data_only_dirs templates)
(install
(section lib)
(files (glob_files templates/client-server.basic/*)
(glob_files templates/basic.ppx/*)))
(files (glob_files templates/client-server.basic/**)
(glob_files templates/basic.ppx/**)))
24 changes: 24 additions & 0 deletions pkg/distillery/templates/client-server.basic/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <https://unlicense.org>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<extension findlib-package="ocsigenserver.ext.staticmod"/>
<!--
<extension findlib-package="ocsipersist.dbm">
<!-- delayloading val="true"/ -->
<delayloading val="false"/>
<store dir="%%DATADIR%%"/>
<ocsidbm name="ocsidbm"/>
</extension>
Expand Down
4 changes: 2 additions & 2 deletions pkg/distillery/templates/client-server.basic/client!dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(pps
js_of_ocaml-ppx
lwt_ppx
ocsigen-i18n
-- --prefix %%%MODULE_NAME%%%_ --suffix _i18n --default-module %%%MODULE_NAME%%%_i18n
; ocsigen-i18n
; -- --prefix %%%MODULE_NAME%%%_ --suffix _i18n --default-module %%%MODULE_NAME%%%_i18n
)
)
(js_of_ocaml
Expand Down
8 changes: 4 additions & 4 deletions pkg/distillery/templates/client-server.basic/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
(executables
(names %%%PROJECT_NAME%%%)
(modes (byte plugin) (native plugin))
(libraries eliom.server ocsipersist.dbm)
(libraries eliom.server ocsipersist.sqlite)
(preprocess
(pps
lwt_ppx
pgocaml_ppx
; pgocaml_ppx
js_of_ocaml-ppx_deriving_json
ocsigen-i18n
; ocsigen-i18n
ocsigen-ppx-rpc --rpc-raw
eliom.ppx.server
-- --prefix %%%MODULE_NAME%%%_ --suffix _i18n --default-module %%%MODULE_NAME%%%_i18n
; -- --prefix %%%MODULE_NAME%%%_ --suffix _i18n --default-module %%%MODULE_NAME%%%_i18n
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/filelist.ml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ let ppx_extra =
exts ["cmi"] ppx.interface @ exts ["cmx"] (ppx.interface @ ppx.internal)

let ppx_api = ppx.interface
let templates_dir = "pkg/distillery"
let templates_dir = "pkg/distillery/templates"
let templates = Array.to_list (Sys.readdir templates_dir)

let templates_files =
Expand Down

0 comments on commit a07abdb

Please sign in to comment.