Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into feat/tldraw-basic
Browse files Browse the repository at this point in the history
  • Loading branch information
pengx17 committed May 16, 2022
2 parents 9712044 + 7f256b8 commit a62d6e7
Show file tree
Hide file tree
Showing 104 changed files with 2,552 additions and 2,177 deletions.
4 changes: 3 additions & 1 deletion .carve/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
;; Ignore b/c too many false positives
frontend.db
;; Used for debugging
frontend.db.debug]
frontend.db.debug
;; carve doesn't detect nbb only usage
logseq.graph-parser.log]
:report {:format :ignore}}
6 changes: 4 additions & 2 deletions .carve/ignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ frontend.extensions.zotero.api/item
;; For repl
frontend.external.roam/reset-state!
;; For repl
frontend.format.mldoc/ast-export-markdown
logseq.graph-parser.mldoc/ast-export-markdown
;; Protocol fn wrapper that could be used
frontend.fs/readdir
;; Referenced in TODO
Expand Down Expand Up @@ -74,5 +74,7 @@ frontend.util/trace!
frontend.util.pool/terminate-pool!
;; Repl fn
frontend.util.property/add-page-properties
;; Used by shadow
;; Test runner used by shadow
frontend.test.node-test-runner/main
;; Test runner for nbb
logseq.graph-parser.nbb-test-runner/run-tests
11 changes: 10 additions & 1 deletion .clj-kondo/config.edn
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@
frontend.db.react react
frontend.db.query-react query-react
frontend.util util
frontend.util.property property
frontend.config config
frontend.format.mldoc mldoc
frontend.format.block block
frontend.handler.extract extract
logseq.graph-parser.text text
logseq.graph-parser.block gp-block
logseq.graph-parser.mldoc gp-mldoc
logseq.graph-parser.util gp-util
logseq.graph-parser.config gp-config}}}
logseq.graph-parser.property gp-property
logseq.graph-parser.config gp-config
logseq.graph-parser.date-time-util date-time-util}}}

:hooks {:analyze-call {rum.core/defc hooks.rum/defc
rum.core/defcs hooks.rum/defcs}}
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ jobs:
- name: Fetch yarn deps
run: yarn install --frozen-lockfile

- name: Run ClojureScript test
- name: Run ClojureScript tests
run: |
yarn cljs:test
node static/tests.js
- name: Run nbb tests for graph-parser
run: yarn nbb-logseq -cp src/main:src/test -m logseq.graph-parser.nbb-test-runner/run-tests
# In this job because it depends on an npm package
- name: Load nbb compatible namespaces
run: bb test:load-nbb-compatible-namespaces
Expand Down
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation project(':capacitor-camera')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-share')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-voice-recorder')
Expand Down
4 changes: 4 additions & 0 deletions android/app/src/main/assets/capacitor.plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"pkg": "@capacitor/keyboard",
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
},
{
"pkg": "@capacitor/share",
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
},
{
"pkg": "@capacitor/splash-screen",
"classpath": "com.capacitorjs.plugins.splashscreen.SplashScreenPlugin"
Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacit
include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')

include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')

include ':capacitor-splash-screen'
project(':capacitor-splash-screen').projectDir = new File('../node_modules/@capacitor/splash-screen/android')

Expand Down
6 changes: 3 additions & 3 deletions docs/dev-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ For this workflow:
1. Add `^:focus` metadata flags to tests e.g. `(deftest ^:focus test-name ...)`.
2. In another shell, run `node static/tests.js -i focus` to only run those
tests. To run all tests except those tests run `node static/tests.js -e focus`.
3. Or focus namespaces: Using the regex option `-r`, run tests for `frontend.text-test` with `node static/tests.js -r text`.
3. Or focus namespaces: Using the regex option `-r`, run tests for `frontend.util.page-property-test` with `node static/tests.js -r page-property`.

Multiple options can be specified to AND selections. For example, to run all `frontend.text-test` tests except for the focused one: `node static/tests.js -r text -e focus`
Multiple options can be specified to AND selections. For example, to run all `frontend.util.page-property-test` tests except for the focused one: `node static/tests.js -r page-property -e focus`

For help on more options, run `node static/tests.js -h`.

Expand All @@ -114,7 +114,7 @@ shadow-cljs watch test --config-merge '{:autorun true}'`. The test output may
appear where shadow-cljs was first invoked e.g. where `yarn watch` is running.
Specific namespace(s) can be auto run with the `:ns-regexp` option e.g. `npx
shadow-cljs watch test --config-merge '{:autorun true :ns-regexp
"frontend.text-test"}'`.
"frontend.util.page-property-test"}'`.

## Logging

Expand Down
3 changes: 3 additions & 0 deletions externs.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ dummy.getNodesObjects = function() {};
dummy.getEdgesObjects = function() {};
dummy.alphaTarget = function() {};
dummy.restart = function() {};
dummy.observe = function() {};
dummy.contentRect = function() {};
dummy.height = function() {};

/**
* @typedef {{
Expand Down
1 change: 1 addition & 0 deletions ios/App/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def capacitor_pods
pod 'CapacitorClipboard', :path => '../../node_modules/@capacitor/clipboard'
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
pod 'CapacitorShare', :path => '../../node_modules/@capacitor/share'
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
pod 'CapacitorVoiceRecorder', :path => '../../node_modules/capacitor-voice-recorder'
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"main": "static/electron.js",
"devDependencies": {
"@capacitor/cli": "3.2.2",
"@logseq/nbb-logseq": "^0.3.99",
"@playwright/test": "^1.19.2",
"@tailwindcss/ui": "0.7.2",
"@types/gulp": "^4.0.7",
Expand All @@ -13,7 +14,6 @@
"del": "^6.0.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"@logseq/nbb-logseq": "^0.3.10",
"npm-run-all": "^4.1.5",
"playwright": "^1.19.2",
"postcss": "8.2.13",
Expand Down Expand Up @@ -72,6 +72,7 @@
"@capacitor/filesystem": "1.0.6",
"@capacitor/ios": "3.2.2",
"@capacitor/keyboard": "^1.2.0",
"@capacitor/share": "^1.1.2",
"@capacitor/splash-screen": "1.1.3",
"@capacitor/status-bar": "1.0.6",
"@excalidraw/excalidraw": "0.10.0",
Expand Down Expand Up @@ -115,6 +116,7 @@
"react-textarea-autosize": "8.3.3",
"react-tippy": "1.4.0",
"react-transition-group": "4.3.0",
"react-visibility-sensor": "^5.1.1",
"reakit": "0.11.1",
"remove-accents": "0.4.2",
"send-intent": "3.0.11",
Expand Down
10 changes: 10 additions & 0 deletions resources/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,11 @@ li p:last-child,
background-color: var(--ls-primary-background-color, #fff);
}

.bg-base-4 {
background-color: var(--ls-tertiary-background-color);
}


.pre-white-space {
white-space: pre;
}
Expand Down Expand Up @@ -1169,3 +1174,8 @@ html[data-theme='dark'] .keyboard-shortcut > code {
overflow: hidden;
text-overflow: ellipsis;
}

.lazy-visibility {
min-width: 1px;
min-height: 1px;
}
2 changes: 1 addition & 1 deletion resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@sentry/electron": "2.5.1",
"posthog-js": "1.10.2",
"@logseq/rsapi": "0.0.11",
"electron-deeplink": "1.0.9"
"electron-deeplink": "1.0.10"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.57",
Expand Down
4 changes: 4 additions & 0 deletions src/electron/electron/handler.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@
(defmethod handle :getLogseqDotDirRoot []
(utils/get-ls-dotdir-root))

(defmethod handle :testProxyUrl [win [_ url]]
(p/let [_ (utils/fetch url)]
(utils/send-to-renderer win :notification {:type "success" :payload (str "Successfully: " url)})))

(defmethod handle :getUserDefaultPlugins []
(utils/get-ls-default-plugins))

Expand Down
2 changes: 1 addition & 1 deletion src/electron/electron/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
([window kind payload]
(when window
(.. ^js window -webContents
(send kind (bean/->js payload))))))
(send (name kind) (bean/->js payload))))))

(defn get-graph-dir
[graph-name]
Expand Down
6 changes: 3 additions & 3 deletions src/main/frontend/commands.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@

(defn compute-pos-delta-when-change-marker
[edit-content marker pos]
(let [old-marker (some->> (first (gp-util/safe-re-find marker/bare-marker-pattern edit-content))
(let [old-marker (some->> (first (util/safe-re-find marker/bare-marker-pattern edit-content))
(string/trim))
pos-delta (- (count marker)
(count old-marker))
Expand All @@ -536,7 +536,7 @@
(if-let [matches (seq (util/re-pos new-line-re-pattern prefix))]
(let [[start-pos content] (last matches)]
(+ start-pos (count content)))
(count (gp-util/safe-re-find re-pattern prefix))))
(count (util/safe-re-find re-pattern prefix))))
new-value (str (subs edit-content 0 pos)
(string/replace-first (subs edit-content pos)
(marker/marker-pattern format)
Expand Down Expand Up @@ -577,7 +577,7 @@
(let [edit-content (gobj/get current-input "value")
heading-pattern #"^#+\s+"
new-value (cond
(gp-util/safe-re-find heading-pattern edit-content)
(util/safe-re-find heading-pattern edit-content)
(string/replace-first edit-content
heading-pattern
(str heading " "))
Expand Down
Loading

0 comments on commit a62d6e7

Please sign in to comment.