From 07367e1781e78764bbcaa941a890616c5607279d Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 26 May 2021 12:42:20 +0200 Subject: [PATCH] Rename to skittle --- README.md | 12 +++++----- bb.edn | 8 +++---- resources/public/base.html | 6 ++--- resources/public/index.html | 22 +++++++++---------- resources/public/tictactoe.html | 8 +++---- script/release.clj | 5 ++++- shadow-cljs.edn | 6 ++--- .../script_tag.cljs => scittle/core.cljs} | 2 +- .../reagent.cljs} | 6 ++--- 9 files changed, 39 insertions(+), 36 deletions(-) rename src/{sci/script_tag.cljs => scittle/core.cljs} (99%) rename src/{sci/script_tag/plugin_reagent.cljs => scittle/reagent.cljs} (82%) diff --git a/README.md b/README.md index 8b4f374..35342b1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# sci.script-tag +# Scittle The [Small Clojure Interpreter](https://github.com/borkdude/sci) exposed for usage in script tags. -See [Github pages](https://borkdude.github.io/sci-script-tag) for usage. +See [Github pages](https://borkdude.github.io/scittle) for usage. ## Tasks @@ -12,10 +12,10 @@ Run `bb tasks` to see all available tasks: $ bb tasks The following tasks are available: -clean Start from clean slate. -build:dev Development build. Starts webserver and watches for changes. -build:release Builds release artifacts. -release Updates Github pages with new release build. +clean Start from clean slate. +dev Development build. Starts webserver and watches for changes. +prod Builds production artifacts. +release Updates Github pages with new release build. ``` ## Credits diff --git a/bb.edn b/bb.edn index 7b973ea..98ec6f8 100644 --- a/bb.edn +++ b/bb.edn @@ -2,9 +2,9 @@ {:requires ([babashka.fs :as fs]) clean {:doc "Start from clean slate." :task (run! fs/delete (fs/list-dir (fs/file "resources" "public" "js") "**.*"))} - build:dev {:doc "Development build. Starts webserver and watches for changes." - :task (clojure "-M:dev -m shadow.cljs.devtools.cli watch main")} - build:release {:doc "Builds release artifacts." - :task (clojure "-M:dev -m shadow.cljs.devtools.cli release main")} + dev {:doc "Development build. Starts webserver and watches for changes." + :task (clojure "-M:dev -m shadow.cljs.devtools.cli watch main")} + prod {:doc "Builds production artifacts." + :task (clojure "-M:dev -m shadow.cljs.devtools.cli release main")} release {:doc "Updates Github pages with new release build." :task (shell "script/release.clj")}}} diff --git a/resources/public/base.html b/resources/public/base.html index 78d2940..90f65b6 100644 --- a/resources/public/base.html +++ b/resources/public/base.html @@ -2,7 +2,7 @@ - + -

SCI script tag

+

Scittle

       
 <head>
-  <script src="https://borkdude.github.io/sci-script-tag/js/sci-script-tag.js" type="application/javascript"></script>
+  <script src="https://borkdude.github.io/scittle/js/scittle.js" type="application/javascript"></script>
 
   <script type="application/x-sci">
     (defn my-alert []
diff --git a/resources/public/index.html b/resources/public/index.html
index ff8d882..b1bf610 100644
--- a/resources/public/index.html
+++ b/resources/public/index.html
@@ -2,10 +2,10 @@
 
   
     
-    
+    
     
     
-    
+    
     
+    
 
     
     
-    
+    
 
     
 
@@ -16,8 +16,8 @@
 
   
   
-    

SCI script tag: Reagent tic-tac-toe

-

What is SCI script tag?

+

Scittle tic-tac-toe

+

What is Scittle?

Read the main page for more details.

Reagent tic tac toe

diff --git a/script/release.clj b/script/release.clj index 8c22500..cc90c5b 100755 --- a/script/release.clj +++ b/script/release.clj @@ -6,6 +6,9 @@ (fs/copy "resources/public/index.html" "gh-pages" {:replace-existing true}) +(fs/copy "resources/public/base.html" "gh-pages" + {:replace-existing true}) + (fs/copy "resources/public/tictactoe.html" "gh-pages" {:replace-existing true}) @@ -40,7 +43,7 @@ (fs/copy f js-target-dir {:replace-existing true})) - (fs/glob js-source-dir "sci-script-tag*.js")) + (fs/glob js-source-dir "scittle*.js")) (def with-gh-pages (partial shell {:dir "gh-pages"})) (with-gh-pages "git add .") diff --git a/shadow-cljs.edn b/shadow-cljs.edn index aeff75b..b09b7e4 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -13,9 +13,9 @@ "react-dom" {:target :global :global "ReactDOM"}}} :modules - {:sci-script-tag {:entries [sci.script-tag]} - :sci-script-tag-plugin-reagent {:entries [sci.script-tag.plugin-reagent] - :depends-on #{:sci-script-tag}}} + {:scittle {:entries [scittle.core]} + :scittle.reagent {:entries [scittle.reagent] + :depends-on #{:scittle}}} :build-hooks [(shadow.cljs.build-report/hook)] :output-dir "resources/public/js" :devtools {:repl-pprint true}}}} diff --git a/src/sci/script_tag.cljs b/src/scittle/core.cljs similarity index 99% rename from src/sci/script_tag.cljs rename to src/scittle/core.cljs index dc69110..2417d21 100644 --- a/src/sci/script_tag.cljs +++ b/src/scittle/core.cljs @@ -1,4 +1,4 @@ -(ns sci.script-tag +(ns scittle.core (:refer-clojure :exclude [defn time]) (:require [clojure.core :as c] [goog.object :as gobject] diff --git a/src/sci/script_tag/plugin_reagent.cljs b/src/scittle/reagent.cljs similarity index 82% rename from src/sci/script_tag/plugin_reagent.cljs rename to src/scittle/reagent.cljs index 81a29dd..72afaad 100644 --- a/src/sci/script_tag/plugin_reagent.cljs +++ b/src/scittle/reagent.cljs @@ -1,8 +1,8 @@ -(ns sci.script-tag.plugin-reagent +(ns scittle.reagent (:require [reagent.core :as r] [reagent.dom :as rdom] [sci.core :as sci] - [sci.script-tag :as st])) + [scittle.core :as scittle])) (def rns (sci/create-ns 'reagent.core nil)) @@ -14,7 +14,7 @@ (def reagent-dom-namespace {'render (sci/copy-var rdom/render rdns)}) -(st/register-plugin! +(scittle/register-plugin! ::reagent {:namespaces {'reagent.core reagent-namespace 'reagent.dom reagent-dom-namespace}})