diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index f5132c5..0000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,9 +0,0 @@ -Please answer the following questions and leave the below in as part of your PR. - -- [ ] I have read the [developer documentation](https://github.com/babashka/scittle/blob/main/doc/dev.md). - -- [ ] This PR corresponds to an [issue with a clear problem statement](https://github.com/babashka/scittle/blob/main/doc/dev.md#start-with-an-issue-before-writing-code). - - - -- [ ] I have updated the [CHANGELOG.md](https://github.com/babashka/scittle/blob/main/CHANGELOG.md) file with a description of the addressed issue. diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e26d706..0000000 --- a/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -.cpcache -.nrepl-port -target -repl -scratch.clj -.shadow-cljs -target -yarn.lock -node_modules/ -.DS_Store -resources/public/js -.store -gh-pages/ -gh-pages/ -/.lsp -/dist -/.clj-kondo/.cache -/.clj-kondo/rewrite-clj -/plugins/demo/resources/public/js/ -.portal -resources/public/test/scratch.html diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b2fff67..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,117 +0,0 @@ -# Changelog - -[Scittle](https://github.com/babashka/scittle): execute Clojure(Script) directly from browser script tags via SCI! - - - - - - - - -- [#114](https://github.com/babashka/scittle/issues/114): Enable source maps ([@jeroenvandijk](https://github.com/jeroenvandijk)) -- [#140](https://github.com/babashka/scittle/issues/140): Enable customizing the nrepl websocket port ([@PEZ](https://github.com/PEZ)) - -## v0.7.28 (2025-09-13) - -- [#137](https://github.com/babashka/scittle/issues/137): fix JS interop with reserved JS keyword (incorrectly munged) by bumping SCI - -## v0.7.27 (2025-08-21) - -- [#95](https://github.com/babashka/scittle/issues/121): support string requires - of `globalThis` js deps ([@chr15m](https://github.com/chr15m)). See - [docs](https://github.com/babashka/scittle/blob/main/doc/js-libraries.md). -- Potentially breaking: `(.-foo-bar {})` now behaves as `{}.foo_bar`, i.e. the property or method name is munged. - -## v0.7.26 (2025-08-20) - -- [#121](https://github.com/babashka/scittle/issues/121): add `cjohansen/dataspex` plugin ([@jeroenvandijk](https://github.com/jeroenvandijk)) -- [#118](https://github.com/babashka/scittle/issues/118): add `goog.string/format` ([@jeroenvandijk](https://github.com/jeroenvandijk)) -- Support alternative `(set! #js {} -a 1)` CLJS syntax (by bumping SCI) -- Add source maps to distribution -- Add dev versions of all modules in the `dev` folder of the distribution + a `dev/scitte.cljs-devtools.js` module - -## v0.7.23 (2025-06-18) - -- [#107](https://github.com/babashka/scittle/issues/107): add `replicant` plugin ([@jeroenvandijk](https://github.com/jeroenvandijk)) -- [#102](https://github.com/babashka/scittle/issues/102): add `applied-science/js-interop` plugin ([@chr15m](https://github.com/chr15m)) -- [#105](https://github.com/babashka/scittle/issues/105): add `goog.string/htmlEscape` ([@ikappaki](https://github.com/ikappaki) ) -- [#113](https://github.com/babashka/scittle/issues/113): add `unchecked-set` and `unchecked-get` - -## v0.6.22 (2024-12-19) - -- [#99](https://github.com/babashka/scittle/issues/99): make `js/import` work - -## v0.6.20 (2024-11-24) - -- [#55](https://github.com/babashka/scittle/issues/55): create gh-pages dir before using. -- [#89](https://github.com/babashka/scittle/issues/89): allow `evaluate_script_tags` to specify individual scripts. -- [#87](https://github.com/babashka/scittle/issues/87): prod build on fresh checkout fails - -## v0.6.19 (2024-10-08) - -- Add `cljs.pprint/code-dispatch` and `cljs.pprint/with-pprint-dispatch` - -## v0.6.18 (2024-04-30) - -- [#77](https://github.com/babashka/scittle/issues/77): make dependency on browser (`js/document`) optional so scittle can run in webworkers, Node.js, etc. - -## v0.6.17 (2024-04-22) - -- [#69](https://github.com/babashka/scittle/issues/69): executing script tag with src + whitespace doesn't work -- [#72](https://github.com/babashka/scittle/issues/72): add clojure 1.11 functions like `update-vals` -- [#75](https://github.com/babashka/scittle/issues/75): Support reader conditionals in source code - -## v0.6.16 (2023-05-04) - -- [#58](https://github.com/babashka/scittle/issues/58): build system for creating scittle distribution with custom libraries. See [plugins/demo](plugins/demo). -- Use `window.location.hostname` for WebSocket connection instead of hardcoding `"localhost"` ([@pyrmont](https://github.com/pyrmont)) -- Upgrade `sci.configs` to `"33bd51e53700b224b4cb5bda59eb21b62f962745"` -- Update nREPL implementation: implement `eldoc` (`info`, `lookup`) ([@benjamin-asdf](https://github.com/benjamin-asdf)) - -## v0.6.15 (2023-01-05) - -- Fix destructuring in `defmethod` (by upgrading SCI) - -## v0.5.13 (2022-12-23) - -- Fix `cljs.pprint` plugin - -## v0.5.12 (2022-12-23) - -- Fix `reagent` `with-let` macro with advanced compiled builds -- Upgrade promesa and shadow-cljs -- Fix `#queue` literal -- SCI: performance improvements - -## v0.4.11 (2022-11-23) - -- Add `scittle.re-frame` plugin. This gives access to the - [re-frame](https://github.com/day8/re-frame) library. -- Fix for [44](https://github.com/babashka/scittle/issues/44): Honoring `SCITTLE_NREPL_WEBSOCKET_PORT` in `scittle.nrepl` -- Add all public vars of `cljs-ajax` `ajax.core` -- Upgrade several built-in libraries - -## v0.3.10 - -- Add `scittle.promesa.js` plugin. This gives access to the [promesa](https://cljdoc.org/d/funcool/promesa/8.0.450/doc/user-guide) library. -- Add `scittle.pprint.js` plugin. This gives access to [cljs.pprint](https://cljs.github.io/api/cljs.pprint/). -- Improve error messages - -## v0.2.8 - -- Upgrade to SCI 0.3.1 -- Upgrade to Reagent 1.1.0 -- Add support for Reagent's `create-class` and `with-let` - -## v0.1.1 - -- Upgrade to SCI 0.3.0 - -## v0.1.0 - -- Fixes for `try/catch` - -## v0.0.1 - -Initial release. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 11ecb79..0000000 --- a/LICENSE +++ /dev/null @@ -1,198 +0,0 @@ -Eclipse Public License - v 1.0 - -THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC -LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM -CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. - -1. DEFINITIONS - -"Contribution" means: - -a) in the case of the initial Contributor, the initial code and documentation - distributed under this Agreement, and -b) in the case of each subsequent Contributor: - i) changes to the Program, and - ii) additions to the Program; - - where such changes and/or additions to the Program originate from and are - distributed by that particular Contributor. A Contribution 'originates' from - a Contributor if it was added to the Program by such Contributor itself or - anyone acting on such Contributor's behalf. Contributions do not include - additions to the Program which: (i) are separate modules of software - distributed in conjunction with the Program under their own license - agreement, and (ii) are not derivative works of the Program. - -"Contributor" means any person or entity that distributes the Program. - -"Licensed Patents" mean patent claims licensable by a Contributor which are -necessarily infringed by the use or sale of its Contribution alone or when -combined with the Program. - -"Program" means the Contributions distributed in accordance with this Agreement. - -"Recipient" means anyone who receives the Program under this Agreement, -including all Contributors. - -2. GRANT OF RIGHTS - a) Subject to the terms of this Agreement, each Contributor hereby grants - Recipient a non-exclusive, worldwide, royalty-free copyright license to - reproduce, prepare derivative works of, publicly display, publicly perform, - distribute and sublicense the Contribution of such Contributor, if any, and - such derivative works, in source code and object code form. - b) Subject to the terms of this Agreement, each Contributor hereby grants - Recipient a non-exclusive, worldwide, royalty-free patent license under - Licensed Patents to make, use, sell, offer to sell, import and otherwise - transfer the Contribution of such Contributor, if any, in source code and - object code form. This patent license shall apply to the combination of the - Contribution and the Program if, at the time the Contribution is added by - the Contributor, such addition of the Contribution causes such combination - to be covered by the Licensed Patents. The patent license shall not apply - to any other combinations which include the Contribution. No hardware per - se is licensed hereunder. - c) Recipient understands that although each Contributor grants the licenses to - its Contributions set forth herein, no assurances are provided by any - Contributor that the Program does not infringe the patent or other - intellectual property rights of any other entity. Each Contributor - disclaims any liability to Recipient for claims brought by any other entity - based on infringement of intellectual property rights or otherwise. As a - condition to exercising the rights and licenses granted hereunder, each - Recipient hereby assumes sole responsibility to secure any other - intellectual property rights needed, if any. For example, if a third party - patent license is required to allow Recipient to distribute the Program, it - is Recipient's responsibility to acquire that license before distributing - the Program. - d) Each Contributor represents that to its knowledge it has sufficient - copyright rights in its Contribution, if any, to grant the copyright - license set forth in this Agreement. - -3. REQUIREMENTS - -A Contributor may choose to distribute the Program in object code form under its -own license agreement, provided that: - - a) it complies with the terms and conditions of this Agreement; and - b) its license agreement: - i) effectively disclaims on behalf of all Contributors all warranties and - conditions, express and implied, including warranties or conditions of - title and non-infringement, and implied warranties or conditions of - merchantability and fitness for a particular purpose; - ii) effectively excludes on behalf of all Contributors all liability for - damages, including direct, indirect, special, incidental and - consequential damages, such as lost profits; - iii) states that any provisions which differ from this Agreement are offered - by that Contributor alone and not by any other party; and - iv) states that source code for the Program is available from such - Contributor, and informs licensees how to obtain it in a reasonable - manner on or through a medium customarily used for software exchange. - -When the Program is made available in source code form: - - a) it must be made available under this Agreement; and - b) a copy of this Agreement must be included with each copy of the Program. - Contributors may not remove or alter any copyright notices contained within - the Program. - -Each Contributor must identify itself as the originator of its Contribution, if -any, in a manner that reasonably allows subsequent Recipients to identify the -originator of the Contribution. - -4. COMMERCIAL DISTRIBUTION - -Commercial distributors of software may accept certain responsibilities with -respect to end users, business partners and the like. While this license is -intended to facilitate the commercial use of the Program, the Contributor who -includes the Program in a commercial product offering should do so in a manner -which does not create potential liability for other Contributors. Therefore, if -a Contributor includes the Program in a commercial product offering, such -Contributor ("Commercial Contributor") hereby agrees to defend and indemnify -every other Contributor ("Indemnified Contributor") against any losses, damages -and costs (collectively "Losses") arising from claims, lawsuits and other legal -actions brought by a third party against the Indemnified Contributor to the -extent caused by the acts or omissions of such Commercial Contributor in -connection with its distribution of the Program in a commercial product -offering. The obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In order -to qualify, an Indemnified Contributor must: a) promptly notify the Commercial -Contributor in writing of such claim, and b) allow the Commercial Contributor to -control, and cooperate with the Commercial Contributor in, the defense and any -related settlement negotiations. The Indemnified Contributor may participate in -any such claim at its own expense. - -For example, a Contributor might include the Program in a commercial product -offering, Product X. That Contributor is then a Commercial Contributor. If that -Commercial Contributor then makes performance claims, or offers warranties -related to Product X, those performance claims and warranties are such -Commercial Contributor's responsibility alone. Under this section, the -Commercial Contributor would have to defend claims against the other -Contributors related to those performance claims and warranties, and if a court -requires any other Contributor to pay any damages as a result, the Commercial -Contributor must pay those damages. - -5. NO WARRANTY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR -IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, -NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each -Recipient is solely responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its exercise of -rights under this Agreement , including but not limited to the risks and costs -of program errors, compliance with applicable laws, damage to or loss of data, -programs or equipment, and unavailability or interruption of operations. - -6. DISCLAIMER OF LIABILITY - -EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY -CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST -PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS -GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -7. GENERAL - -If any provision of this Agreement is invalid or unenforceable under applicable -law, it shall not affect the validity or enforceability of the remainder of the -terms of this Agreement, and without further action by the parties hereto, such -provision shall be reformed to the minimum extent necessary to make such -provision valid and enforceable. - -If Recipient institutes patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Program itself -(excluding combinations of the Program with other software or hardware) -infringes such Recipient's patent(s), then such Recipient's rights granted under -Section 2(b) shall terminate as of the date such litigation is filed. - -All Recipient's rights under this Agreement shall terminate if it fails to -comply with any of the material terms or conditions of this Agreement and does -not cure such failure in a reasonable period of time after becoming aware of -such noncompliance. If all Recipient's rights under this Agreement terminate, -Recipient agrees to cease use and distribution of the Program as soon as -reasonably practicable. However, Recipient's obligations under this Agreement -and any licenses granted by Recipient relating to the Program shall continue and -survive. - -Everyone is permitted to copy and distribute copies of this Agreement, but in -order to avoid inconsistency the Agreement is copyrighted and may only be -modified in the following manner. The Agreement Steward reserves the right to -publish new versions (including revisions) of this Agreement from time to time. -No one other than the Agreement Steward has the right to modify this Agreement. -The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation -may assign the responsibility to serve as the Agreement Steward to a suitable -separate entity. Each new version of the Agreement will be given a -distinguishing version number. The Program (including Contributions) may always -be distributed subject to the version of the Agreement under which it was -received. In addition, after a new version of the Agreement is published, -Contributor may elect to distribute the Program (including its Contributions) -under the new version. Except as expressly stated in Sections 2(a) and 2(b) -above, Recipient receives no rights or licenses to the intellectual property of -any Contributor under this Agreement, whether expressly, by implication, -estoppel or otherwise. All rights in the Program not expressly granted under -this Agreement are reserved. - -This Agreement is governed by the laws of the State of New York and the -intellectual property laws of the United States of America. No party to this -Agreement will bring a legal action under this Agreement more than one year -after the cause of action arose. Each party waives its rights to a jury trial in -any resulting litigation. diff --git a/README.md b/README.md deleted file mode 100644 index 01e1607..0000000 --- a/README.md +++ /dev/null @@ -1,59 +0,0 @@ -# Scittle - -The [Small Clojure Interpreter](https://github.com/babashka/sci) exposed for usage in script tags. - -Try it out on [CodePen](https://codepen.io/Prestance/pen/PoOdZQw)! - -See [Github pages](https://babashka.org/scittle/) for usage. - -See -[babashka-scittle-guestbook](https://github.com/kloimhardt/babashka-scittle-guestbook) -for a minimal full stack web application. - -See [releases](https://github.com/babashka/scittle/releases) for links to -[JSDelivr](https://www.jsdelivr.com) to get versioned artifacts. - -## Serving assets - -To serve assets you can use the -[babashka.http-server](https://github.com/babashka/http-server) dependency (with -babashka or Clojure JVM): - -``` clojure -(require '[babashka.http-server :as http]) -(http/serve {:port 1341 :dir "resources/public"}) -@(promise) ;; wait until process is killed -``` - -### nREPL - -See [doc/nrepl](doc/nrepl). - -### Service worker - -See [doc/serviceworker.md](doc/serviceworker.md). - -## Tasks - -Run `bb tasks` to see all available tasks: - -``` -$ bb tasks -The following tasks are available: - -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 - -Idea by Arne Brasseur a.k.a [plexus](https://github.com/plexus). -Name by Alessandra Sierra (the name occurs first in [this](https://stuartsierra.com/2019/12/21/clojure-start-time-in-2019/) blog post). - -## License - -Copyright © 2021 - 2022 Michiel Borkent - -Distributed under the EPL License. See LICENSE. diff --git a/resources/public/base.html b/base.html similarity index 93% rename from resources/public/base.html rename to base.html index a9aac58..12c9501 100644 --- a/resources/public/base.html +++ b/base.html @@ -16,7 +16,7 @@
<head>
- <script src="https://babashka.github.io/scittle/js/scittle.js" type="application/javascript"></script>
+ <script src="https://borkdude.github.io/scittle/js/scittle.js" type="application/javascript"></script>
<script type="application/x-scittle">
(defn my-alert []
diff --git a/bb.edn b/bb.edn
deleted file mode 100644
index f76e437..0000000
--- a/bb.edn
+++ /dev/null
@@ -1,76 +0,0 @@
-{:deps {io.github.babashka/sci.nrepl
- #_{:local/root "../sci.nrepl"}
- {:git/sha "2f8a9ed2d39a1b09d2b4d34d95494b56468f4a23"}
- io.github.babashka/http-server
- {:git/sha "b38c1f16ad2c618adae2c3b102a5520c261a7dd3"}
- io.github.scittle/build
- {:local/root "build"}}
-
- :tasks
- {:requires ([scittle.build :as build]
- [babashka.fs :as fs]
- [cheshire.core :as json]
- [babashka.process :as p :refer [process]])
-
- clean {:doc "Start from clean slate."
- :task (do (fs/delete-tree (fs/file "resources" "public" "js"))
- (fs/delete-tree ".cpcache")
- (fs/delete-tree ".shadow-cljs"))}
-
- shadow:watch {:doc "Development build. Starts webserver and watches for changes."
- :task (build/build {:action "watch"
- :args *command-line-args*})}
-
- http-server {: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"))}
-
- browser-nrepl {:doc "Start browser nREPL"
- :requires ([sci.nrepl.browser-server :as bp])
- :task (bp/start! {})}
-
- -dev {:depends [shadow:watch browser-nrepl http-server]}
-
- dev {:doc "Development build. Starts webserver and watches for changes."
- :task (do (run '-dev {:parallel true})
- (deref (promise)))}
-
- prod {:doc "Builds production artifacts."
- :task (build/build {})
- :depends [clean]}
-
- dist {:doc "Prepare dist folder for npm package"
- :depends [prod]
- :task (do
- (fs/delete-tree "dist")
- (fs/create-dirs "dist/dev")
- (run! (fn [f] (fs/copy f "dist" {:replace-existing true}))
- (fs/glob "resources/public/js" "*.{js,js.map}"))
- (run! (fn [f] (fs/copy f "dist/dev" {:replace-existing true}))
- (fs/glob "resources/public/js/dev" "*.{js,js.map}")))}
-
- bump-version {:doc "Bumps package.json and pushes new git tag"
- :task (do (shell "npm version patch")
- (shell "git push --atomic origin main"
- (str "v" (:version (json/parse-string (slurp "package.json") true)))))}
-
- npm-publish {:doc "Updates NPM ibrary"
- :task (do (run 'dist)
- (run 'bump-version)
- (shell "npm publish"))}
-
- replace-version {:doc "Ported from bash one-liners. Expects two versions.
- TODO: port to Clojure.
- TODO: skip changelog.md
- "
- :task
- (let [[prev next] *command-line-args*]
- (-> (process ["bash" "-c"
- (format "rg %s --files-with-matches -g '!/CHANGELOG.md' | xargs sed -i '' 's/%s/%s/g'"
- prev prev next)]
- {:inherit true})
- p/check))}
-
- gh-pages {:doc "Updates Github pages with new release build."
- :task (shell "script/release.clj")}}}
diff --git a/resources/public/bookmarklet.html b/bookmarklet.html
similarity index 84%
rename from resources/public/bookmarklet.html
rename to bookmarklet.html
index e2cc947..7dddbe0 100644
--- a/resources/public/bookmarklet.html
+++ b/bookmarklet.html
@@ -3,10 +3,11 @@
-
-
-
-
+
+
+
+
+
diff --git a/build/deps.edn b/build/deps.edn
deleted file mode 100644
index 0967ef4..0000000
--- a/build/deps.edn
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/build/src/scittle/build.clj b/build/src/scittle/build.clj
deleted file mode 100644
index 02382e5..0000000
--- a/build/src/scittle/build.clj
+++ /dev/null
@@ -1,83 +0,0 @@
-(ns scittle.build
- "Provides bb tasks for building and releasing scittle"
- (:require
- [babashka.classpath :as classpath]
- [babashka.fs :as fs]
- [babashka.tasks :refer [clojure]]
- [clojure.edn :as edn]
- [clojure.string :as str]))
-
-(defn- feature-files
- []
- (filter fs/exists?
- (map (fn [d]
- (fs/file d "scittle_plugin.edn"))
- (classpath/split-classpath (classpath/get-classpath)))))
-
-(defn- read-configs
- [files]
- (->> files
- (mapcat (comp edn/read-string slurp str))))
-
-(defn- build-cmd [cmd scittle-dir]
- (let [files (feature-files)
- feature-configs (read-configs files)
- ;; Each ./src/scittle_plugin.edn has a ./deps.edn
- feature-dirs (map (comp fs/parent fs/parent) files)
- cmd' (if (seq files)
- (format "-Sdeps '%s' %s"
- {:deps
- (merge (into {}
- (map (fn [dir]
- [(symbol (str (fs/file-name dir) "/deps"))
- {:local/root (str dir)}])
- feature-dirs))
- {'scittle/deps {:local/root scittle-dir}})}
- cmd)
- cmd)]
- (when (seq feature-configs)
- (println "Building features:" (str/join ", " (map :name feature-configs)) "..."))
- (if (seq feature-configs)
- (apply str cmd'
- (map (fn [m] (format " --config-merge '%s'" (pr-str (:shadow-config m))))
- feature-configs))
- cmd')))
-
-(defn- build*
- [cmd]
- (let [building-outside-scittle? (not (fs/exists? "shadow-cljs.edn"))
- scittle-dir (when building-outside-scittle?
- (->> (classpath/get-classpath)
- classpath/split-classpath
- ;; Pull out scittle from local/root or git/url
- (some #(when (re-find #"(scittle/[0-9a-f]+|scittle)/src" %) %))
- fs/parent))]
- (when building-outside-scittle?
- (fs/copy (fs/file scittle-dir "shadow-cljs.edn") "shadow-cljs.edn"))
- (let [cmd (build-cmd cmd (str scittle-dir))]
- (println "> clojure" cmd)
- (clojure {:extra-env {"SCI_ELIDE_VARS" "true"}} cmd))
- (when building-outside-scittle?
- (fs/delete "shadow-cljs.edn"))))
-
-(defn build
- "Build scittle shadow builds using clojure cmd and commandline args. Features on
- classpath are automatically added.
-
- Options:
-
- * :action - compile action, defaults to release, but may also be compile or watch"
- [{:keys [action
- args] :or {action "release"}}]
- (build* (format "-M -m shadow.cljs.devtools.cli --force-spawn %s main %s" action (str/join " " args)))
- (when (= "release" action)
- (println "Also building dev release build")
- (build* (format "-M -m shadow.cljs.devtools.cli --force-spawn %s main %s %s"
- action
- "--config-merge '{:compiler-options {:optimizations :simple
- :pretty-print true
- :pseudo-names true}
- :output-dir \"resources/public/js/dev\"
- :modules {:scittle.cljs-devtools {:entries [scittle.cljs-devtools]
- :depends-on #{:scittle}}}}'"
- (str/join " " args)))))
diff --git a/resources/public/cljs/bookmarklet.cljs b/cljs/bookmarklet.cljs
similarity index 96%
rename from resources/public/cljs/bookmarklet.cljs
rename to cljs/bookmarklet.cljs
index 69d2169..79b0585 100644
--- a/resources/public/cljs/bookmarklet.cljs
+++ b/cljs/bookmarklet.cljs
@@ -41,7 +41,7 @@
}
};"
"if(typeof scittle === 'undefined'){"
- (append-tag :script {:src "https://babashka.github.io/scittle/js/scittle.js"
+ (append-tag :script {:src "https://borkdude.github.io/scittle/js/scittle.js"
:onerror "function(){alert('Error loading ' + this.src)}"
:onload "runCode"})
"} else {
@@ -134,7 +134,6 @@
[:br]
[(fn []
[:a {:href (str "?name=" (js/encodeURIComponent @*bookmark-name)
- "&code=" (js/encodeURIComponent @*code)
- "%20")} "Copy this link to share ⤴️"])]]))
+ "&code=" (js/encodeURIComponent @*code))} "Copy this link to share ⤴️"])]]))
(rdom/render [workspace] (.getElementById js/document "app"))
diff --git a/resources/public/cljs/script.cljs b/cljs/script.cljs
similarity index 100%
rename from resources/public/cljs/script.cljs
rename to cljs/script.cljs
diff --git a/resources/public/cljs/tictactoe.cljs b/cljs/tictactoe.cljs
similarity index 100%
rename from resources/public/cljs/tictactoe.cljs
rename to cljs/tictactoe.cljs
diff --git a/resources/public/css/style.css b/css/style.css
similarity index 100%
rename from resources/public/css/style.css
rename to css/style.css
diff --git a/deps.edn b/deps.edn
deleted file mode 100644
index f7a5121..0000000
--- a/deps.edn
+++ /dev/null
@@ -1,30 +0,0 @@
-{:paths ["src" "resources"]
- :deps
- {org.clojure/clojure {:mvn/version "1.12.2"}
- thheller/shadow-cljs {:mvn/version "3.1.8"}
- org.babashka/sci {:git/url "https://github.com/babashka/sci"
- :git/sha "6758ba028da559c536a06becbbedade7b0ba6448"}
- #_{:local/root "../babashka/sci"}
- reagent/reagent {:mvn/version "1.1.1"}
- no.cjohansen/replicant {:mvn/version "2025.03.27"}
- re-frame/re-frame {:mvn/version "1.3.0"}
- cljsjs/react {:mvn/version "18.2.0-1"}
- cljsjs/react-dom {:mvn/version "18.2.0-1"}
- cljsjs/react-dom-server {:mvn/version "18.2.0-1"}
- cljs-ajax/cljs-ajax {:mvn/version "0.8.4"}
- applied-science/js-interop {:mvn/version "0.4.2"}
- funcool/promesa {:mvn/version "11.0.678"}
- io.github.babashka/sci.nrepl
- #_{:local/root "../sci.nrepl"}
- {:git/url "https://github.com/babashka/sci.nrepl"
- :git/sha "75f379c685bbd58c3e23f531339eb144e104937d"}
- io.github.babashka/sci.configs
- #_{:local/root "/Users/borkdude/dev/sci.configs"}
- {:git/url "https://github.com/babashka/sci.configs"
- :git/sha "aa84a1b4f1fe45735e5b748769309fc842f737c1"
- :exclusions [org.babashka/sci]}
- binaryage/devtools {:mvn/version "1.0.7"}}
- :aliases
- {:dev
- {:extra-paths ["dev"]
- :extra-deps {}}}}
diff --git a/resources/public/disable_auto_eval.html b/disable_auto_eval.html
similarity index 100%
rename from resources/public/disable_auto_eval.html
rename to disable_auto_eval.html
diff --git a/doc/dev.md b/doc/dev.md
deleted file mode 100644
index b6bd354..0000000
--- a/doc/dev.md
+++ /dev/null
@@ -1,109 +0,0 @@
-# Dev
-
-## Workflow
-
-### Start with an issue before writing code
-
-Before writing any code, please create an issue first that describes the problem
-you are trying to solve with alternatives that you have considered. A little bit
-of prior communication can save a lot of time on coding. Keep the problem as
-small as possible. If there are two problems, make two issues. We discuss the
-issue and if we reach an agreement on the approach, it's time to move on to a
-PR.
-
-### Follow up with a pull request
-
-Post a corresponding PR with the smallest change possible to address the
-issue. Then we discuss the PR, make changes as needed and if we reach an
-agreement, the PR will be merged.
-
-
-
-
-
-
-### Force-push
-
-Please do not use `git push --force` on your PR branch for the following
-reasons:
-
-- It makes it more difficult for others to contribute to your branch if needed.
-- It makes it harder to review incremental commits.
-- Links (in e.g. e-mails and notifications) go stale and you're confronted with:
- this code isn't here anymore, when clicking on them.
-- CircleCI doesn't play well with it: it might try to fetch a commit which
- doesn't exist anymore.
-- Your PR will be squashed anyway.
-
-## Developing
-
-Run `bb dev` to start shadow-cljs compilation in watch mode.
-
-
-
-
-
-## Release
-
-Static files including compiled JS are hosted on Github. This is set up like
-described
-[here](https://medium.com/linagora-engineering/deploying-your-js-app-to-github-pages-the-easy-way-or-not-1ef8c48424b7):
-
-All the commands below assume that you already have a git project initialized and that you are in its root folder.
-
-```
-# Create an orphan branch named gh-pages
-git checkout --orphan gh-pages
-# Remove all files from staging
-git rm -rf .
-# Create an empty commit so that you will be able to push on the branch next
-git commit --allow-empty -m "Init empty branch"
-# Push the branch
-git push origin gh-pages
-```
-
-Now that the branch is created and pushed to origin, let’s configure the worktree correctly:
-
-```
-# Come back to master
-git checkout main
-# Add gh-pages to .gitignore
-echo "gh-pages/" >> .gitignore
-git worktree add gh-pages gh-pages
-```
-
-After cloning this repo to a new dir:
-
-```
-git fetch origin gh-pages
-git worktree prune
-git worktree add gh-pages gh-pages
-```
-
-To deploy to Github Pages:
-
-```
-script/release.clj
-```
-
-To create a new NPM release:
-
-- Prepare version `package.json`, except patch (if anything should change here)
-- Run `bb npm-publish`: this will compile, bump patch version, create tag and and push to npm and Github
-- `bb replace-version 0.6.16 0.7.28`
-- Create Github release with updated links from `doc/links.md`
-- `bb gh-pages`
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/js-libraries.md b/doc/js-libraries.md
deleted file mode 100644
index 72cafb8..0000000
--- a/doc/js-libraries.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Loading JS libraries
-
-Since `v0.7.28` scittle allows to load libraries from the global enviroment.
-This means you can load a library in a `
-
-
-
-
-
-