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
17
script/changelog.clj
Executable file
17
script/changelog.clj
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(ns changelog
|
||||
(:require [clojure.string :as str]))
|
||||
|
||||
(let [changelog (slurp "CHANGELOG.md")
|
||||
replaced (str/replace changelog
|
||||
#" #(\d+)"
|
||||
(fn [[_ issue after]]
|
||||
(format " [#%s](https://github.com/babashka/scittle/issues/%s)%s"
|
||||
issue issue (str after))))
|
||||
replaced (str/replace replaced
|
||||
#"@([a-zA-Z0-9-_]+)([, \.)])"
|
||||
(fn [[_ name after]]
|
||||
(format "[@%s](https://github.com/%s)%s"
|
||||
name name after)))]
|
||||
(spit "CHANGELOG.md" replaced))
|
||||
83
script/release.clj
Executable file
83
script/release.clj
Executable file
|
|
@ -0,0 +1,83 @@
|
|||
#!/usr/bin/env bb
|
||||
|
||||
(require '[babashka.fs :as fs]
|
||||
'[babashka.tasks :refer [shell]])
|
||||
|
||||
(fs/create-dirs "gh-pages")
|
||||
|
||||
(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})
|
||||
|
||||
(fs/copy "resources/public/bookmarklet.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(fs/copy "resources/public/wordle.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(fs/copy "resources/public/disable_auto_eval.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(fs/copy "resources/public/codemirror.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(fs/copy "resources/public/replicant_tictactoe.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(def html-source-dir (fs/file "resources" "public" "html"))
|
||||
(def html-target-dir (fs/file "gh-pages" "html"))
|
||||
(fs/create-dirs html-target-dir)
|
||||
(doseq [html ["export.html" "reagent.html" "cljs-ajax.html"]]
|
||||
(fs/copy (fs/file html-source-dir html) html-target-dir
|
||||
{:replace-existing true}))
|
||||
|
||||
(def style-source-dir (fs/file "resources" "public" "css"))
|
||||
(def style-target-dir (fs/file "gh-pages" "css"))
|
||||
(fs/create-dirs style-target-dir)
|
||||
(fs/copy "resources/public/css/style.css" style-target-dir
|
||||
{:replace-existing true})
|
||||
|
||||
(def js-source-dir (fs/file "resources" "public" "js"))
|
||||
(def js-target-dir (fs/file "gh-pages" "js"))
|
||||
(fs/create-dirs js-target-dir)
|
||||
|
||||
(println "Compiling CLJS")
|
||||
(shell "bb prod")
|
||||
|
||||
(fs/copy "resources/public/js/report.html" "gh-pages"
|
||||
{:replace-existing true})
|
||||
|
||||
(def index-file (fs/file "gh-pages" "index.html"))
|
||||
|
||||
(def cljs-source-dir (fs/file "resources" "public" "cljs"))
|
||||
(def cljs-target-dir (fs/file "gh-pages" "cljs"))
|
||||
(fs/create-dirs cljs-target-dir)
|
||||
|
||||
(run! (fn [f]
|
||||
(println "Copying" (str f))
|
||||
(fs/copy f
|
||||
cljs-target-dir
|
||||
{:replace-existing true}))
|
||||
(fs/glob cljs-source-dir "*.cljs"))
|
||||
|
||||
(println "Copying dir resources/public/cljs/replicant_tictactoe")
|
||||
(fs/copy-tree (fs/file cljs-source-dir "replicant_tictactoe") (fs/file cljs-target-dir "replicant_tictactoe") {:replace-existing true})
|
||||
|
||||
(run! (fn [f]
|
||||
(println "Copying" (str f))
|
||||
(fs/copy f
|
||||
js-target-dir
|
||||
{:replace-existing true}))
|
||||
(fs/glob js-source-dir "scittle*.js"))
|
||||
|
||||
(def with-gh-pages (partial shell {:dir "gh-pages"}))
|
||||
(with-gh-pages "git add .")
|
||||
(with-gh-pages "git commit -m 'update build'")
|
||||
(with-gh-pages "git push origin gh-pages")
|
||||
|
||||
nil
|
||||
15
script/release.old
Normal file
15
script/release.old
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
clojure -M:dev -m shadow.cljs.devtools.cli release main
|
||||
cp resources/public/index.html gh-pages
|
||||
sed -i 's/main.js/sci_script_tag.js/' gh-pages/index.html
|
||||
|
||||
mkdir -p gh-pages/js
|
||||
cp resources/public/js/main.js gh-pages/js/sci_script_tag.js
|
||||
|
||||
cd gh-pages
|
||||
git add .
|
||||
git commit -m "update build"
|
||||
git push origin gh-pages
|
||||
Loading…
Add table
Add a link
Reference in a new issue