mirror of
https://github.com/logseq/logseq.git
synced 2026-05-21 19:24:17 +00:00
fix: mobile build
This commit is contained in:
87
externs/mobile.txt
Normal file
87
externs/mobile.txt
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
require
|
||||||
|
DEBUG
|
||||||
|
convertFileSrc
|
||||||
|
getPlatform
|
||||||
|
handleError
|
||||||
|
isLoggingEnabled
|
||||||
|
isNative
|
||||||
|
isNativePlatform
|
||||||
|
isPluginAvailable
|
||||||
|
platform
|
||||||
|
pluginMethodNoop
|
||||||
|
registerPlugin
|
||||||
|
registerHelper
|
||||||
|
Pass
|
||||||
|
showHint
|
||||||
|
createRef
|
||||||
|
call
|
||||||
|
setState
|
||||||
|
forceUpdate
|
||||||
|
memo
|
||||||
|
createElement
|
||||||
|
render
|
||||||
|
unmount
|
||||||
|
createContext
|
||||||
|
createPortal
|
||||||
|
createRef
|
||||||
|
createElement
|
||||||
|
ref
|
||||||
|
path
|
||||||
|
current
|
||||||
|
useState
|
||||||
|
useReducer
|
||||||
|
useEffect
|
||||||
|
useLayoutEffect
|
||||||
|
useCallback
|
||||||
|
useMemo
|
||||||
|
useRef
|
||||||
|
renderToString
|
||||||
|
idb-keyval
|
||||||
|
newStore
|
||||||
|
isError
|
||||||
|
value
|
||||||
|
CodeMirror
|
||||||
|
over
|
||||||
|
forEachNode
|
||||||
|
on
|
||||||
|
getTextArea
|
||||||
|
setUser
|
||||||
|
nativeEvent
|
||||||
|
which
|
||||||
|
multipliedBy
|
||||||
|
minus
|
||||||
|
plus
|
||||||
|
isInteger
|
||||||
|
isPositive
|
||||||
|
isLessThan
|
||||||
|
toNumber
|
||||||
|
modulo
|
||||||
|
exponentiatedBy
|
||||||
|
dividedBy
|
||||||
|
multipliedBy
|
||||||
|
negated
|
||||||
|
isZero
|
||||||
|
isGreaterThanOrEqualTo
|
||||||
|
isLessThan
|
||||||
|
shiftedBy
|
||||||
|
s
|
||||||
|
dividedToIntegerBy
|
||||||
|
abs
|
||||||
|
toFraction
|
||||||
|
e
|
||||||
|
getCursor
|
||||||
|
getLineTokens
|
||||||
|
getTokenAt
|
||||||
|
getValue
|
||||||
|
completionActive
|
||||||
|
state
|
||||||
|
mime
|
||||||
|
getWrapperElement
|
||||||
|
doc
|
||||||
|
lastLine
|
||||||
|
getLine
|
||||||
|
setOption
|
||||||
|
string
|
||||||
|
dispose
|
||||||
|
path
|
||||||
|
base64String
|
||||||
@@ -78,8 +78,8 @@
|
|||||||
"gulp:mobile-watch": "gulp watchMobile",
|
"gulp:mobile-watch": "gulp watchMobile",
|
||||||
"css:mobile-build": "postcss tailwind.mobile.css -o static/mobile/style.css --verbose --env production",
|
"css:mobile-build": "postcss tailwind.mobile.css -o static/mobile/style.css --verbose --env production",
|
||||||
"css:mobile-watch": "cross-env TAILWIND_MODE=watch postcss tailwind.mobile.css -o static/mobile/style.css --verbose --watch",
|
"css:mobile-watch": "cross-env TAILWIND_MODE=watch postcss tailwind.mobile.css -o static/mobile/style.css --verbose --watch",
|
||||||
"cljs:mobile-watch": "clojure -M:cljs watch mobile workers",
|
"cljs:mobile-watch": "clojure -M:cljs watch mobile workers --config-merge \"{:output-dir \\\"./static/mobile/js\\\" :asset-path \\\"/static/mobile/js\\\" :release {:asset-path \\\"http://localhost\\\"}}\"",
|
||||||
"cljs:release-mobile": "clojure -M:cljs release mobile workers",
|
"cljs:release-mobile": "clojure -M:cljs release mobile workers --config-merge \"{:output-dir \\\"./static/mobile/js\\\" :asset-path \\\"/static/mobile/js\\\" :release {:asset-path \\\"http://localhost\\\"}}\"",
|
||||||
"cljs:dev-watch": "clojure -M:cljs watch app workers electron mobile",
|
"cljs:dev-watch": "clojure -M:cljs watch app workers electron mobile",
|
||||||
"cljs:app-watch": "clojure -M:cljs watch app workers",
|
"cljs:app-watch": "clojure -M:cljs watch app workers",
|
||||||
"cljs:electron-watch": "clojure -M:cljs watch app workers electron --config-merge \"{:asset-path \\\"./js\\\"}\"",
|
"cljs:electron-watch": "clojure -M:cljs watch app workers electron --config-merge \"{:asset-path \\\"./js\\\"}\"",
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ const portal = new MagicPortal(worker);
|
|||||||
<script defer src="./js/amplify.js"></script>
|
<script defer src="./js/amplify.js"></script>
|
||||||
<script defer src="./ionic.js"></script>
|
<script defer src="./ionic.js"></script>
|
||||||
<script defer src="./js/main-bundle.js"></script>
|
<script defer src="./js/main-bundle.js"></script>
|
||||||
<script defer src="./js/shared.js"></script>
|
|
||||||
<script defer src="./js/main.js"></script>
|
<script defer src="./js/main.js"></script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|||||||
@@ -101,11 +101,6 @@
|
|||||||
:redef false}
|
:redef false}
|
||||||
:cross-chunk-method-motion false}
|
:cross-chunk-method-motion false}
|
||||||
:closure-defines {goog.debug.LOGGING_ENABLED true}
|
:closure-defines {goog.debug.LOGGING_ENABLED true}
|
||||||
|
|
||||||
;; 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).
|
|
||||||
;; :dev {:asset-path "./js"}
|
|
||||||
:devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function
|
: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
|
:after-load frontend.core/start ;; after live-reloading finishes call this function
|
||||||
:watch-path "/static"
|
:watch-path "/static"
|
||||||
@@ -124,11 +119,8 @@
|
|||||||
"react-dom" {:target :global
|
"react-dom" {:target :global
|
||||||
:global "ReactDOM"}}}
|
:global "ReactDOM"}}}
|
||||||
;; handle `require(xxx.css)`
|
;; handle `require(xxx.css)`
|
||||||
:modules {:shared
|
:modules {:main
|
||||||
{:entries []}
|
{:init-fn mobile.core/init}
|
||||||
:main
|
|
||||||
{:init-fn mobile.core/init
|
|
||||||
:depends-on #{:shared}}
|
|
||||||
:code-editor
|
:code-editor
|
||||||
{:entries [frontend.extensions.code]
|
{:entries [frontend.extensions.code]
|
||||||
:depends-on #{:main}}}
|
:depends-on #{:main}}}
|
||||||
|
|||||||
@@ -12,24 +12,6 @@
|
|||||||
(string/trim out))
|
(string/trim out))
|
||||||
(println err))))
|
(println err))))
|
||||||
|
|
||||||
(defn purge-css
|
|
||||||
{:shadow.build/stage :flush}
|
|
||||||
[state {:keys [css-source
|
|
||||||
js-globs
|
|
||||||
public-dir]}]
|
|
||||||
(case (:shadow.build/mode state)
|
|
||||||
:release
|
|
||||||
(exec "purgecss --css " css-source
|
|
||||||
(for [content (if (string? js-globs) [js-globs] js-globs)]
|
|
||||||
(str "--content " content))
|
|
||||||
"-o" public-dir)
|
|
||||||
|
|
||||||
:dev
|
|
||||||
(do
|
|
||||||
(exec "mkdir -p" public-dir)
|
|
||||||
(exec "cp" css-source (str public-dir "/" (last (string/split css-source #"/"))))))
|
|
||||||
state)
|
|
||||||
|
|
||||||
(defn git-revision-hook
|
(defn git-revision-hook
|
||||||
{:shadow.build/stage :configure}
|
{:shadow.build/stage :configure}
|
||||||
[build-state & args]
|
[build-state & args]
|
||||||
|
|||||||
Reference in New Issue
Block a user