Added virtually the whole of the Scittle distribution, as it proves to be
virtually necessary to do development.
This commit is contained in:
parent
fcb023ecc5
commit
0a200aca94
741 changed files with 174111 additions and 11 deletions
4
plugins/datascript/deps.edn
Normal file
4
plugins/datascript/deps.edn
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{:deps
|
||||
{datascript/datascript {:mvn/version "1.3.12"}
|
||||
io.github.babashka/sci.configs {:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
||||
:exclusions [org.babashka/sci]}}}
|
||||
9
plugins/datascript/src/scittle/datascript.cljs
Normal file
9
plugins/datascript/src/scittle/datascript.cljs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns scittle.datascript
|
||||
{:no-doc true}
|
||||
(:require [sci.configs.tonsky.datascript :refer [config]]
|
||||
[scittle.core :as scittle]))
|
||||
|
||||
(defn init []
|
||||
(scittle/register-plugin!
|
||||
::datascript
|
||||
config))
|
||||
12
plugins/datascript/src/scittle_plugin.edn
Normal file
12
plugins/datascript/src/scittle_plugin.edn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[{:name scittle/datascript
|
||||
:namespaces [datascript.core datascript.db]
|
||||
:js "./scittle.datascript.js"
|
||||
:shadow-config
|
||||
{:compiler-options {:externs ["datascript/externs.js"]}
|
||||
:modules
|
||||
{:scittle.datascript
|
||||
{:init-fn scittle.datascript/init
|
||||
;; From https://github.com/tonsky/datascript/issues/298#issuecomment-813790783
|
||||
:prepend "globalThis.datascript = {};"
|
||||
:depends-on #{:scittle}
|
||||
:entries [datascript.core]}}}}]
|
||||
8
plugins/dataspex/deps.edn
Normal file
8
plugins/dataspex/deps.edn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{:deps
|
||||
{no.cjohansen/dataspex {:git/url "https://github.com/cjohansen/dataspex"
|
||||
:git/sha "02112200651c2bd932907bb69fba1ff50b881741"
|
||||
:exclusions [ring/ring-core
|
||||
ring/ring-jetty-adapter
|
||||
com.cognitect/transit-clj]}
|
||||
io.github.babashka/sci.configs {:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
||||
:exclusions [org.babashka/sci]}}}
|
||||
9
plugins/dataspex/src/scittle/dataspex.cljs
Normal file
9
plugins/dataspex/src/scittle/dataspex.cljs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns scittle.dataspex
|
||||
{:no-doc true}
|
||||
(:require [sci.configs.cjohansen.dataspex :refer [config]]
|
||||
[scittle.core :as scittle]))
|
||||
|
||||
(defn init []
|
||||
(scittle/register-plugin!
|
||||
::dataspex
|
||||
config))
|
||||
8
plugins/dataspex/src/scittle_plugin.edn
Normal file
8
plugins/dataspex/src/scittle_plugin.edn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[{:name scittle/dataspex
|
||||
:namespaces [dataspex.core]
|
||||
:js "./scittle.dataspex.js"
|
||||
:shadow-config
|
||||
{:modules
|
||||
{:scittle.dataspex {:init-fn scittle.dataspex/init
|
||||
:depends-on #{:scittle :scittle.datascript}
|
||||
:entries [dataspex.core]}}}}]
|
||||
29
plugins/demo/README.md
Normal file
29
plugins/demo/README.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Demo
|
||||
|
||||
A demo project of a custom scittle build.
|
||||
|
||||
This demo project uses the `scittle.javelin` and `scittle.hoplon` plugins which aren't part of the normal scittle distribution.
|
||||
|
||||
To produce release `.js` files, run: `bb release`.
|
||||
|
||||
See:
|
||||
|
||||
- `bb.edn` with
|
||||
- `:deps` which includes:
|
||||
- a dependency on the `scittle.build` project to build scittle + custom features
|
||||
- zero or more plugin dependencies
|
||||
- helpers like static file server
|
||||
- development `:tasks`. Run `bb dev` for development and `bb release` to produce release artifacts.
|
||||
- `deps.edn`: this only contains a dependency on scittle itself
|
||||
|
||||
Available plugins are in the `plugins` directory inside the top level directory of this repo.
|
||||
|
||||
Writing a plugin involves writing
|
||||
|
||||
- SCI configuration (this can be shared via the [sci.configs](https://github.com/babashka/sci.configs) project too)
|
||||
- Adding a `scittle_plugin.edn` file on the plugin's classpath (e.g. in the `src` directory). This EDN file contains:
|
||||
- `:name`, name of the plugin
|
||||
- `:namespaces`: the namespaces exposed to SCI
|
||||
- `:js`: the name of the produced `.js` module file
|
||||
- `:shadow-config`: the shadow-cljs configuration specific to this plugin
|
||||
- A `.cljs` file with an `init` function which calls `scittle/register-plugin!`.
|
||||
22
plugins/demo/bb.edn
Normal file
22
plugins/demo/bb.edn
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{:deps {io.github.babashka/scittle.build {:local/root "../../build"}
|
||||
;; datascript plugin
|
||||
; io.github.babashka/scittle.datascript {:local/root "../../plugins/datascript"}
|
||||
io.github.babashka/scittle.dataspex {:local/root "../../plugins/dataspex"}
|
||||
io.github.babashka/scittle.javelin {:local/root "../../plugins/javelin"}
|
||||
io.github.babashka/scittle.hoplon {:local/root "../../plugins/hoplon"}
|
||||
io.github.babashka/http-server
|
||||
{:git/sha "b38c1f16ad2c618adae2c3b102a5520c261a7dd3"}}
|
||||
:tasks
|
||||
{:requires ([scittle.build :as build])
|
||||
watch {:doc "Watch build"
|
||||
:task (build/build {:action "watch"})}
|
||||
serve {:doc "Starts http server for serving static files"
|
||||
:requires ([babashka.http-server :as http])
|
||||
:task (do (http/serve {:port 1341 :dir "resources/public"})
|
||||
(println "Serving static assets at http://localhost:1341"))}
|
||||
-dev {:depends [watch serve]}
|
||||
dev {:doc "Run compilation in watch mode and start http server"
|
||||
:task (do (run '-dev {:parallel true})
|
||||
(deref (promise)))}
|
||||
release {:doc "Release build (advanced compiled JS)"
|
||||
:task (build/build {})}}}
|
||||
1
plugins/demo/deps.edn
Normal file
1
plugins/demo/deps.edn
Normal file
|
|
@ -0,0 +1 @@
|
|||
{:deps {io.github.babashka/scittle {:local/root "../.."}}}
|
||||
21
plugins/demo/resources/public/index.html
Normal file
21
plugins/demo/resources/public/index.html
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<!-- <link rel="stylesheet" href="/css/style.css"> -->
|
||||
<script src="/js/scittle.js" type="application/javascript"></script>
|
||||
<script src="/js/scittle.javelin.js" type="application/javascript"></script>
|
||||
<script src="/js/scittle.hoplon.js" type="application/javascript"></script>
|
||||
<script type="application/x-scittle">
|
||||
(require '[hoplon.core :as h])
|
||||
(require '[javelin.core :as j])
|
||||
|
||||
(j/defc title "From Hoplon")
|
||||
(h/body
|
||||
(h/h1 (h/text "~{title}")))
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello Hoplon!</h1>
|
||||
</body>
|
||||
</html>
|
||||
32
plugins/demo/shadow-cljs.edn
Normal file
32
plugins/demo/shadow-cljs.edn
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{:deps
|
||||
{:aliases [:dev]}
|
||||
|
||||
:dev-http
|
||||
{8000 "classpath:public"}
|
||||
|
||||
:builds
|
||||
{:main
|
||||
{:target :browser
|
||||
:js-options
|
||||
{:resolve {"react" {:target :global
|
||||
:global "React"}
|
||||
"react-dom" {:target :global
|
||||
:global "ReactDOM"}}}
|
||||
:modules
|
||||
{:scittle {:entries [scittle.core]}
|
||||
:scittle.nrepl {:entries [scittle.nrepl]
|
||||
:depends-on #{:scittle}}
|
||||
:scittle.promesa {:entries [scittle.promesa]
|
||||
:depends-on #{:scittle}}
|
||||
:scittle.pprint {:entries [scittle.pprint]
|
||||
:depends-on #{:scittle}}
|
||||
:scittle.reagent {:entries [scittle.reagent]
|
||||
:depends-on #{:scittle}}
|
||||
:scittle.re-frame {:entries [scittle.re-frame]
|
||||
:depends-on #{:scittle.reagent
|
||||
:scittle}}
|
||||
:scittle.cljs-ajax {:entries [scittle.cljs-ajax]
|
||||
:depends-on #{:scittle}}}
|
||||
:build-hooks [(shadow.cljs.build-report/hook)]
|
||||
:output-dir "resources/public/js"
|
||||
:devtools {:repl-pprint true}}}}
|
||||
4
plugins/hoplon/deps.edn
Normal file
4
plugins/hoplon/deps.edn
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{:deps
|
||||
{hoplon/hoplon {:mvn/version "7.5.0"}
|
||||
io.github.babashka/sci.configs {:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
||||
:exclusions [org.babashka/sci]}}}
|
||||
9
plugins/hoplon/src/scittle/hoplon.cljs
Normal file
9
plugins/hoplon/src/scittle/hoplon.cljs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns scittle.hoplon
|
||||
{:no-doc true}
|
||||
(:require [sci.configs.hoplon.hoplon :refer [config]]
|
||||
[scittle.core :as scittle]))
|
||||
|
||||
(defn init []
|
||||
(scittle/register-plugin!
|
||||
::hoplon
|
||||
config))
|
||||
9
plugins/hoplon/src/scittle/javelin.cljs
Normal file
9
plugins/hoplon/src/scittle/javelin.cljs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns scittle.javelin
|
||||
{:no-doc true}
|
||||
(:require [sci.configs.hoplon.javelin :refer [config]]
|
||||
[scittle.core :as scittle]))
|
||||
|
||||
(defn init []
|
||||
(scittle/register-plugin!
|
||||
::javelin
|
||||
config))
|
||||
13
plugins/hoplon/src/scittle_plugin.edn
Normal file
13
plugins/hoplon/src/scittle_plugin.edn
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[{:name scittle/hoplon
|
||||
:namespaces [javelin.core
|
||||
hoplon.core
|
||||
hoplon.dom]
|
||||
:js "./scittle.hoplon.js"
|
||||
:shadow-config
|
||||
{:modules
|
||||
{:scittle.hoplon {:init-fn scittle.hoplon/init
|
||||
:depends-on #{:scittle :scittle.javelin}
|
||||
:entries [hoplon.core hoplon.dom]}
|
||||
:scittle.javelin {:init-fn scittle.javelin/init
|
||||
:depends-on #{:scittle}
|
||||
:entries [javelin.core]}}}}]
|
||||
4
plugins/javelin/deps.edn
Normal file
4
plugins/javelin/deps.edn
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{:deps
|
||||
{hoplon/javelin {:mvn/version "3.9.3"}
|
||||
io.github.babashka/sci.configs {:git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
|
||||
:exclusions [org.babashka/sci]}}}
|
||||
9
plugins/javelin/src/scittle/javelin.cljs
Normal file
9
plugins/javelin/src/scittle/javelin.cljs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
(ns scittle.javelin
|
||||
{:no-doc true}
|
||||
(:require [sci.configs.hoplon.javelin :refer [config]]
|
||||
[scittle.core :as scittle]))
|
||||
|
||||
(defn init []
|
||||
(scittle/register-plugin!
|
||||
::javelin
|
||||
config))
|
||||
8
plugins/javelin/src/scittle_plugin.edn
Normal file
8
plugins/javelin/src/scittle_plugin.edn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[{:name scittle/javelin
|
||||
:namespaces [javelin.core]
|
||||
:js "./scittle.javelin.js"
|
||||
:shadow-config
|
||||
{:modules
|
||||
{:scittle.javelin {:init-fn scittle.javelin/init
|
||||
:depends-on #{:scittle}
|
||||
:entries [javelin.core]}}}}]
|
||||
Loading…
Add table
Add a link
Reference in a new issue