Commit 3c00cc34 authored by Bruno Burke's avatar Bruno Burke 🍔
Browse files

remove figwheel, webpack; add sortablejs via shadow-cljs

parent 9a6eab3c
Pipeline #116900 passed with stages
in 8 minutes and 21 seconds
^{:watch-dirs ["src/cljs" "src/cljc" "src/devcards"]
:css-dirs ["resources/public/css"]
:extra-main-files {:devcards {:main leukipp.components.core-card}
:standalone-renderer {:main leukipp.components.standalone-renderer}}
:open-url false}
{:main leukipp.components.core
:devcards true}
;; Figwheel-main configuration options see: https://figwheel.org/config-options
;; these will be overriden by the metadata config options in dev.cljs.edn build file
{
;; Set the server port https://figwheel.org/config-options#ring-server-options
:ring-server-options {:port 3004}
;; Change the target directory from the "target" to "resources"
;; https://figwheel.org/config-options#target-dir
:target-dir "resources"
;; Server Ring Handler (optional) https://figwheel.org/docs/ring-handler.html
;; If you want to embed a ring handler into the figwheel server, this
;; is for simple ring servers
;; :ring-handler hello_world.server/handler
;; To be able to open files in your editor from the heads up display
;; you will need to put a script on your path. This script will have
;; to take a file path and a line number ie.
;; in ~/bin/myfile-opener:
;;
;; #! /bin/sh
;; emacsclient -n +$2:$3 $1
;;
;; :open-file-command "myfile-opener"
;; if you are using emacsclient you can just use
;; :open-file-command "emacsclient"
;; Logging output gets printed to the REPL, if you want to redirect it to a file:
;; :log-file "figwheel-main.log"
}
......@@ -18,9 +18,6 @@
[cheshire "5.10.0"] ;;; clj-http json support
[devcards "0.2.7" :exclusions [cljsjs/react]]]
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]
"build-dev" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]}
:min-lein-version "2.9.1"
;;; JDK 10 Setting :jvm-opts ["--add-modules" "java.xml.bind" "-Xmx300m" "-Xms300m" "-XX:+UseG1GC" "-server" "-Dconf=.lein-env"]
:jvm-opts ["-Xmx300m" "-Xms300m" "-XX:+UseG1GC" "-server" "-Dconf=.lein-env"]
......@@ -37,9 +34,6 @@
"resources/public/css"
"resources/public/cljs-out"]
;;;:figwheel {:css-dirs ["resources/public/css"]
;;; :server-port 3004}
;;;:hooks [leiningen.cljsbuild]
:prep-tasks ["compile" ["garden" "once"]]
:garden {:builds [{:id "screen"
......@@ -50,83 +44,11 @@
:profiles
{:dev
{:dependencies [[lein-doo "0.1.11"]
[com.bhauman/figwheel-main "0.2.14"]
[com.bhauman/rebel-readline "0.1.4"]
;; [cider/piggieback "0.3.6"]
;; [figwheel-sidecar "0.5.16"]
]
{:dependencies [[lein-doo "0.1.11"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
:plugins [;; [lein-figwheel "0.5.16"]
[lein-doo "0.1.11"]]}
:plugins [[lein-doo "0.1.11"]]}
:clj-dev
{:dependencies [[lein-doo "0.1.11"]
[org.clojure/data.json "1.0.0"]
[metosin/spec-tools "0.10.5"]]
:plugins [[lein-doo "0.1.10"]]}}
:cljsbuild
{:builds {:min {:source-paths ["src/cljc" "src/cljs"]
:jar true
:compiler {:main leukipp.components.core
:optimizations :whitespace
:output-to "resources/public/js/app.js"
:output-dir "resources/public/js/min"
:elide-asserts true
:closure-defines {goog.DEBUG false}
:install-deps true
:pretty-print false}}
:dev {:source-paths ["src/cljc" "src/cljs"]
:figwheel {:on-jsload "leukipp.components.core/reload"
:websocket-host :js-client-host}
:compiler {:main leukipp.components.core
:optimizations :none
:output-to "resources/public/js/app.js"
:output-dir "resources/public/js/dev"
:asset-path "js/dev"
:install-deps true
:source-map-timestamp true}}
:showcase {:source-paths ["src/cljc" "src/cljs"]
:compiler {:main leukipp.components.showcase
:optimizations :whitespace
:output-to "resources/public/js/showcase.js"
:output-dir "resources/public/js/showcase"
:infer-externs true
:install-deps true
:source-map-timestamp true}}
:standalone {:source-paths ["src/cljc" "src/cljs"]
:compiler {:main leukipp.components.standalone-renderer
:optimizations :advanced
:output-to "resources/public/js/standalone-renderer.js"
:output-dir "resources/public/js/standalone-renderer"
:infer-externs true
:install-deps false
:source-map-timestamp true}}
:devcards {:source-paths ["src/devcards" "src/cljc" "src/cljs"]
:figwheel {:devcards true
:websocket-host :js-client-host}
:compiler {:main "leukipp.components.core-card"
:optimizations :none
:compiler-stats true
:output-to "resources/public/js/devcards.js"
:output-dir "resources/public/js/devcards"
:asset-path "js/devcards"
:parallel-build true
:install-deps true
:source-map-timestamp true}}
:hostedcards {:source-paths ["src/devcards" "src/cljc" "src/cljs"]
:compiler {:main "leukipp.components.core-card"
:optimizations :advanced
:devcards true
:infer-externs true
:output-to "resources/public/js/devcards.js"
:output-dir "resources/public/js/hostedcards"}}
:test {:id "test"
:source-paths ["src/cljc" "src/cljs" "test/cljs"]
:compiler {:output-to "resources/public/js/test.js"
:output-dir "resources/public/js/test"
:main leukipp.components.runner
:optimizations :none}}}})
:plugins [[lein-doo "0.1.10"]]}})
<!doctype html>
<html lang="en">
<head>
<meta charset='utf-8'>
<link href="css/screen.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="app"></div>
<script src="cljs-out/dev-main.js"></script>
<script>leukipp.components.core.main();</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style id="com-rigsomelight-devcards-addons-css"></style>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
</head>
<body>
<script id="pagetest" type="application/edn">
{:type :page,
:settings {},
:content [{:id "2021-05-24T10-26-08-ce106",
:value "<p>Dies ist eine Testseite!</p>",
:type :section}
{:id "2021-05-24T10-26-15-ce127", :value "", :type :line}
{:id "2021-05-24T10-26-26-ce152",
:value "",
:type :exercise,
:core {:type :single-choice,
:task-description [{:id "2021-05-24T10-27-12-ce176",
:value "<p>Was ist die gr&ouml;&szlig;te Zahl?</p>",
:type :section}],
:answers [{:id "ao2021-05-24T10-27-19-G__189",
:text "1",
:selected-points 0,
:unselected-points 0}
{:id "ao2021-05-24T10-27-21-G__192",
:text "2",
:selected-points 0,
:unselected-points 0}
{:id "ao2021-05-24T10-27-22-G__195",
:text "3",
:selected-points 5,
:unselected-points 0}]}}]}
</script>
<div id="app"></div>
<script src="js/bundle.js"></script>
<script src="js/standalone-renderer.js"></script>
<script type="text/javascript">
leukipp.components.standalone_renderer.render_element("pagetest", "app");
</script>
</body>
</html>
#_{:foreign-libs
[{:file "jslibs/materialize.js",
:file-min "jslibs/materialize.min.js",
:provides ["materialize-css"]}
{:file "jslibs/css_bundle.js",
:provides ["components-css-files"]}],
:externs ["components_externs.js"]}
{}
......@@ -7,7 +7,8 @@
[leukipp.components.content-elements.exercise.task-description :refer [default-task-description]]
[oops.core :refer [oset!]]
[reagent.core :as reagent]
[reagent.dom :as rdom]))
[reagent.dom :as rdom]
["sortablejs" :as Sortable]))
(defn answer-input [answer & {:keys [on-change-fn delete-fn idx ordered? result]}]
(fn [answer & {:keys [on-change-fn delete-fn idx ordered? result]}]
......@@ -41,7 +42,7 @@
{:component-did-mount
(fn [this]
(reset! instance
(js/Sortable.create
(Sortable/create
(rdom/dom-node this)
(clj->js {:direction "vertical"
:sort true
......
import 'tinymce/tinymce.js';
import 'bulma/css/bulma.min.css';
import '@fortawesome/fontawesome-free/css/all.min.css';
import '../../resources/public/css/screen.css';
import 'chart.js/dist/Chart.js';
import 'quill/dist/quill.snow.css';
import 'sortablejs/Sortable.js';
import 'codemirror/lib/codemirror.js';
import 'codemirror/mode/python/python.js';
import 'codemirror/mode/clojure/clojure.js';
import 'codemirror/mode/javascript/javascript.js';
import 'codemirror/mode/clike/clike.js';
import 'codemirror/mode/commonlisp/commonlisp.js';
import 'codemirror/mode/markdown/markdown.js';
import 'codemirror/mode/scheme/scheme.js';
import 'katex/dist/katex.min.js';
import 'katex/dist/contrib/auto-render.min.js';
import 'katex/dist/katex.min.css';
import 'mathjs/dist/math.min.js';
import 'codemirror/lib/codemirror.css';
const webpack = require('webpack');
const path = require('path');
const BUILD_DIR = path.resolve(__dirname, 'resources', 'public', 'js');
const APP_DIR = path.resolve(__dirname, 'src', 'js');
const config = {
entry: `${APP_DIR}/main.js`,
mode: 'production',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
target: 'web',
optimization: {
minimize: false
},
module: {
rules: [
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
}
]
}
};
module.exports = config;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment