2019-12-11 00:35:22 +00:00
|
|
|
;; shadow-cljs configuration
|
2023-12-26 08:31:37 +00:00
|
|
|
{:deps true
|
2021-12-17 08:35:06 +00:00
|
|
|
:nrepl {:port 8701}
|
2019-12-11 00:35:22 +00:00
|
|
|
|
2021-12-18 12:36:17 +00:00
|
|
|
;; "." for /static
|
2022-09-11 04:20:51 +00:00
|
|
|
:dev-http {3001 ["static" "."]}
|
2022-05-17 02:50:16 +00:00
|
|
|
|
2024-01-16 15:45:15 +00:00
|
|
|
:js-options {:js-package-dirs ["node_modules" "packages/tldraw/apps"]}
|
2021-12-18 12:36:17 +00:00
|
|
|
|
2019-12-11 00:35:22 +00:00
|
|
|
:builds
|
2021-12-17 08:35:06 +00:00
|
|
|
{:app {:target :browser
|
|
|
|
:module-loader true
|
2024-01-22 04:08:37 +00:00
|
|
|
:js-options {:ignore-asset-requires true
|
|
|
|
:resolve {"react" {:target :global
|
|
|
|
:global "React"}
|
|
|
|
"react-dom" {:target :global
|
|
|
|
:global "ReactDOM"}}} ;; handle `require(xxx.css)`
|
2023-11-16 07:26:51 +00:00
|
|
|
:modules {:shared
|
|
|
|
{:entries []}
|
|
|
|
:main
|
2024-01-19 15:00:52 +00:00
|
|
|
{:init-fn frontend.core/init
|
2023-11-16 07:26:51 +00:00
|
|
|
:depends-on #{:shared}}
|
2021-12-17 08:35:06 +00:00
|
|
|
:code-editor
|
2024-01-19 15:00:52 +00:00
|
|
|
{:entries [frontend.extensions.code]
|
2021-12-18 12:36:17 +00:00
|
|
|
:depends-on #{:main}}
|
2021-12-17 08:35:06 +00:00
|
|
|
:excalidraw
|
2024-01-19 15:00:52 +00:00
|
|
|
{:entries [frontend.extensions.excalidraw]
|
2022-04-29 15:46:52 +00:00
|
|
|
:depends-on #{:main}}
|
2022-05-16 17:06:45 +00:00
|
|
|
:tldraw
|
2024-01-19 15:00:52 +00:00
|
|
|
{:entries [frontend.extensions.tldraw]
|
2023-11-16 07:26:51 +00:00
|
|
|
:depends-on #{:main}}
|
|
|
|
:db-worker
|
2024-01-19 15:00:52 +00:00
|
|
|
{:init-fn frontend.db-worker/init
|
2023-11-16 07:26:51 +00:00
|
|
|
:depends-on #{:shared}
|
|
|
|
:web-worker true}}
|
|
|
|
|
2021-12-17 08:35:06 +00:00
|
|
|
:output-dir "./static/js"
|
|
|
|
:asset-path "/static/js"
|
|
|
|
:release {:asset-path "https://asset.logseq.com/static/js"}
|
|
|
|
:compiler-options {:infer-externs :auto
|
|
|
|
:output-feature-set :es-next-in
|
2023-12-26 08:31:37 +00:00
|
|
|
:source-map true
|
|
|
|
:externs ["datascript/externs.js"
|
|
|
|
"externs.js"]
|
|
|
|
:warnings {:fn-deprecated false
|
2024-01-22 15:05:19 +00:00
|
|
|
:redef false}
|
|
|
|
:cross-chunk-method-motion false}
|
2023-12-26 08:31:37 +00:00
|
|
|
:build-hooks [(shadow.hooks/git-revision-hook "--long --always --dirty")]
|
|
|
|
:closure-defines {goog.debug.LOGGING_ENABLED true
|
|
|
|
frontend.modules.instrumentation.sentry/SENTRY-DSN #shadow/env "LOGSEQ_SENTRY_DSN"
|
|
|
|
frontend.modules.instrumentation.posthog/POSTHOG-TOKEN #shadow/env "LOGSEQ_POSTHOG_TOKEN"
|
|
|
|
frontend.config/ENABLE-PLUGINS #shadow/env ["ENABLE_PLUGINS" :as :bool :default true]
|
|
|
|
;; Set to switch file sync server to dev, set this to false in `yarn watch`
|
|
|
|
frontend.config/ENABLE-FILE-SYNC-PRODUCTION #shadow/env ["ENABLE_FILE_SYNC_PRODUCTION" :as :bool :default true]
|
|
|
|
frontend.config/REVISION #shadow/env ["LOGSEQ_REVISION" :default "dev"]} ;; set by git-revision-hook
|
2020-11-24 07:41:34 +00:00
|
|
|
|
2022-03-09 09:40:08 +00:00
|
|
|
;; NOTE: electron, browser/mobile-app use different asset-paths.
|
|
|
|
;; For browser/mobile-app devs, assets are located in /static/js(via HTTP root).
|
|
|
|
;; For electron devs, assets are located in ./js(via relative path).
|
2022-05-17 02:50:16 +00:00
|
|
|
;; :dev {:asset-path "./js"}
|
2023-12-26 08:31:37 +00:00
|
|
|
:devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function
|
|
|
|
:after-load frontend.core/start ;; after live-reloading finishes call this function
|
|
|
|
:watch-path "/static"
|
|
|
|
:preloads [devtools.preload
|
|
|
|
shadow.remote.runtime.cljs.browser]}}
|
2020-11-23 14:56:19 +00:00
|
|
|
|
2023-12-26 08:31:37 +00:00
|
|
|
:electron {:target :node-script
|
|
|
|
:output-to "static/electron.js"
|
|
|
|
:main electron.core/main
|
|
|
|
:devtools {:before-load electron.core/stop
|
|
|
|
:after-load electron.core/start}
|
|
|
|
:compiler-options {:infer-externs :auto
|
|
|
|
:source-map true
|
2021-12-17 08:35:06 +00:00
|
|
|
:source-map-include-sources-content true
|
2023-12-26 08:31:37 +00:00
|
|
|
:source-map-detail-level :all
|
2021-01-18 15:46:44 +00:00
|
|
|
|
2023-12-26 08:31:37 +00:00
|
|
|
:externs ["datascript/externs.js"
|
|
|
|
"externs.js"]
|
2022-05-21 15:23:30 +00:00
|
|
|
:warnings {:fn-deprecated false
|
|
|
|
:redef false}}}
|
2021-08-18 09:02:40 +00:00
|
|
|
|
2023-12-26 08:31:37 +00:00
|
|
|
:test {:target :node-test
|
|
|
|
:output-to "static/tests.js"
|
|
|
|
:closure-defines {frontend.util/NODETEST true
|
|
|
|
logseq.shui.util/NODETEST true}
|
|
|
|
:devtools {:enabled false}
|
2022-03-02 20:45:01 +00:00
|
|
|
;; disable :static-fns to allow for with-redefs and repl development
|
2022-12-07 15:26:57 +00:00
|
|
|
:compiler-options {:static-fns false}
|
2023-12-26 08:31:37 +00:00
|
|
|
:main frontend.test.frontend-node-test-runner/main}
|
2020-09-29 15:07:42 +00:00
|
|
|
|
2023-01-08 12:33:27 +00:00
|
|
|
:gen-malli-kondo-config {:target :node-script
|
|
|
|
:closure-defines {frontend.util/NODETEST true}
|
2023-12-26 08:31:37 +00:00
|
|
|
:devtools {:enabled false}
|
2023-01-08 12:33:27 +00:00
|
|
|
:compiler-options {:static-fns false}
|
|
|
|
:output-to "static/gen-malli-kondo-config.js"
|
|
|
|
:main gen-malli-kondo-config.core/main}
|
|
|
|
|
2023-12-26 08:31:37 +00:00
|
|
|
:publishing {:target :browser
|
2021-12-17 08:35:06 +00:00
|
|
|
:module-loader true
|
2024-01-24 14:07:37 +00:00
|
|
|
:js-options {;; handle `require(xxx.css)`
|
|
|
|
:ignore-asset-requires true
|
2024-01-22 04:08:37 +00:00
|
|
|
:resolve {"react" {:target :global
|
|
|
|
:global "React"}
|
|
|
|
"react-dom" {:target :global
|
2024-01-24 14:07:37 +00:00
|
|
|
:global "ReactDOM"}}}
|
2024-01-18 18:32:35 +00:00
|
|
|
:modules {:shared
|
|
|
|
{:entries []}
|
|
|
|
:main
|
|
|
|
{:init-fn frontend.publishing/init
|
|
|
|
:depends-on #{:shared}}
|
2021-12-17 08:35:06 +00:00
|
|
|
:code-editor
|
|
|
|
{:entries [frontend.extensions.code]
|
2021-12-18 12:36:17 +00:00
|
|
|
:depends-on #{:main}}
|
2021-12-17 08:35:06 +00:00
|
|
|
:excalidraw
|
|
|
|
{:entries [frontend.extensions.excalidraw]
|
2022-04-29 15:46:52 +00:00
|
|
|
:depends-on #{:main}}
|
2022-05-16 17:06:45 +00:00
|
|
|
:tldraw
|
|
|
|
{:entries [frontend.extensions.tldraw]
|
2024-01-18 18:32:35 +00:00
|
|
|
:depends-on #{:main}}
|
|
|
|
:db-worker
|
|
|
|
{:init-fn frontend.db-worker/init
|
|
|
|
:depends-on #{:shared}
|
|
|
|
:web-worker true}}
|
2023-11-16 07:26:51 +00:00
|
|
|
|
2021-12-18 12:36:17 +00:00
|
|
|
:output-dir "./static/js/publishing"
|
|
|
|
:asset-path "static/js"
|
2021-12-17 08:35:06 +00:00
|
|
|
:closure-defines {frontend.config/PUBLISHING true
|
|
|
|
goog.debug.LOGGING_ENABLED true}
|
|
|
|
:compiler-options {:infer-externs :auto
|
|
|
|
:output-feature-set :es-next
|
|
|
|
:externs ["datascript/externs.js"
|
|
|
|
"externs.js"]
|
2022-05-21 15:23:30 +00:00
|
|
|
:warnings {:fn-deprecated false
|
2024-01-19 15:52:38 +00:00
|
|
|
:redef false}
|
|
|
|
;; https://github.com/thheller/shadow-cljs/issues/611#issuecomment-620845276
|
|
|
|
;; fixes cljs.spec bug with code splitting
|
|
|
|
:cross-chunk-method-motion false}
|
2021-12-17 08:35:06 +00:00
|
|
|
:devtools {:before-load frontend.core/stop
|
|
|
|
:after-load frontend.core/start
|
2024-01-22 04:08:37 +00:00
|
|
|
:preloads [devtools.preload]}}
|
2023-12-26 08:31:37 +00:00
|
|
|
|
|
|
|
:stories-dev {:target :npm-module
|
|
|
|
:entries [logseq.shui.storybook]
|
|
|
|
:output-dir "packages/ui/.storybook/cljs"
|
|
|
|
:devtools {:enabled true}
|
|
|
|
:compiler-options {:optimizations :simple}}}}
|