Skip to content

Commit

Permalink
feat: electron wip
Browse files Browse the repository at this point in the history
Copy the code from defclass/electron to build ipc layer
  • Loading branch information
tiensonqin committed Jan 20, 2021
1 parent d53ed3f commit 53f799d
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -28,3 +28,4 @@ report.html
strings.csv

.calva
resources/electron.js
2 changes: 1 addition & 1 deletion deps.edn
Expand Up @@ -32,7 +32,7 @@
expound/expound {:mvn/version "0.8.6"}
lambdaisland/glogi {:mvn/version "1.0.74"}}

:aliases {:cljs {:extra-paths ["src/dev-cljs/" "src/test/"]
:aliases {:cljs {:extra-paths ["src/dev-cljs/" "src/test/" "src/electron/"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.764"}
binaryage/devtools {:mvn/version "1.0.2"}
org.clojure/tools.namespace {:mvn/version "0.2.11"}
Expand Down
10 changes: 8 additions & 2 deletions package.json
Expand Up @@ -2,6 +2,7 @@
"name": "logseq",
"version": "0.0.1",
"private": true,
"main": "static/electron.js",
"devDependencies": {
"@tailwindcss/ui": "0.7.2",
"@types/gulp": "^4.0.7",
Expand Down Expand Up @@ -36,7 +37,7 @@
"style:lint": "stylelint \"src/**/*.css\" ",
"gulp:watch": "gulp watch",
"gulp:build": "cross-env NODE_ENV=production gulp build",
"cljs:watch": "clojure -M:cljs watch app publishing",
"cljs:watch": "clojure -M:cljs watch app publishing electron",
"cljs:release": "clojure -M:cljs release app publishing",
"cljs:test": "clojure -A:test compile test",
"cljs:run-test": "node static/tests.js",
Expand All @@ -45,23 +46,28 @@
"cljs:release-publishing": "clojure -M:cljs release publishing",
"cljs:dev-release-app": "clojure -M:cljs release app --config-merge '{:closure-defines {frontend.config/DEV-RELEASE true}}'",
"cljs:debug": "clojure -M:cljs release app --debug",
"cljs:report": "clojure -M:cljs run shadow.cljs.build-report app report.html"
"cljs:report": "clojure -M:cljs run shadow.cljs.build-report app report.html",
"cljs:build-electron": "clojure -A:cljs compile app electron"
},
"dependencies": {
"codemirror": "^5.58.1",
"diff": "5.0.0",
"diff-match-patch": "^1.0.5",
"electron": "^11.2.0",
"fs": "^0.0.1-security",
"fuzzysort": "^1.1.4",
"gulp-cached": "^1.1.1",
"ignore": "^5.1.8",
"jszip": "^3.5.0",
"mldoc": "^0.3.7",
"mousetrap": "^1.6.5",
"path": "^0.12.7",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-resize-context": "^3.0.0",
"react-textarea-autosize": "^8.0.1",
"react-transition-group": "^4.3.0",
"url": "^0.11.0",
"yargs-parser": "^20.2.4"
}
}
5 changes: 4 additions & 1 deletion shadow-cljs.edn
Expand Up @@ -3,7 +3,10 @@
:nrepl {:port 8701}

:builds
{:app
{:electron {:target :node-script
:output-to "./static/electron.js"
:main electron.core/main}
:app
{:target :browser
:module-loader true
:modules {:main {:init-fn frontend.core/init}
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/components/header.cljs
Expand Up @@ -161,9 +161,9 @@
[:a {:on-click toggle-fn}
[:span.ml-1.text-sm (t :login)]])
(let [list [{:title (t :login-google)
:url "/login/google"}
:url (str config/website "/login/google")}
{:title (t :login-github)
:url "/login/github"}]]
:url (str config/website "/login/github")}]]
(mapv
(fn [{:keys [title url]}]
{:title title
Expand Down

0 comments on commit 53f799d

Please sign in to comment.