chore: add electron repl

pull/1179/head
Tienson Qin 2021-01-20 11:34:58 +08:00
parent ca973f6560
commit 9d1d148afe
5 changed files with 26 additions and 1 deletions

View File

@ -26,6 +26,7 @@
},
"scripts": {
"watch": "run-p gulp:build gulp:watch cljs:watch",
"electron-watch": "run-p gulp:build gulp:watch cljs:electron-watch",
"release": "run-s gulp:build cljs:release",
"watch-app": "run-p gulp:watch cljs:watch-app",
"release-app": "run-s gulp:build cljs:release-app",
@ -40,6 +41,7 @@
"gulp:watch": "gulp watch",
"gulp:build": "cross-env NODE_ENV=production gulp build",
"cljs:watch": "clojure -M:cljs watch app publishing electron",
"cljs:electron-watch": "clojure -M:cljs watch app electron",
"cljs:release": "clojure -M:cljs release app publishing",
"cljs:test": "clojure -A:test compile test",
"cljs:run-test": "node static/tests.js",
@ -55,6 +57,7 @@
"codemirror": "^5.58.1",
"diff": "5.0.0",
"diff-match-patch": "^1.0.5",
"electron-better-ipc": "^1.1.1",
"fs": "^0.0.1-security",
"fuzzysort": "^1.1.4",
"gulp-cached": "^1.1.1",

View File

@ -5,3 +5,8 @@
[]
(api/watch :app)
(api/repl :app))
(defn electron-repl
[]
(api/watch :electron)
(api/repl :electron))

View File

@ -1,5 +1,6 @@
(ns electron.core
(:require [electron.init :refer [init-channel]]
[electron.handler :as handler]
["fs" :as fs]
["path" :as path]
["electron" :refer [BrowserWindow app] :as electron]

View File

@ -0,0 +1,2 @@
(ns electron.handler
(:require [electron-better-ipc :refer [ipcMain]]))

View File

@ -1746,6 +1746,13 @@ each-props@^1.3.0:
is-plain-object "^2.0.1"
object.defaults "^1.1.0"
electron-better-ipc@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/electron-better-ipc/-/electron-better-ipc-1.1.1.tgz#bbb1aa567b97a0cdcf61bcc464a35df4ec6fd664"
integrity sha512-Y8Ty54HJtzT6aWNTyE092W/7q8y3+yJz0XvRpOKGIsLDL2H7oWIFkUegmB+6h5SszjtBiQFpmNmHOKfkDZ8HbQ==
dependencies:
serialize-error "^5.0.0"
electron-to-chromium@^1.3.621:
version "1.3.625"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.625.tgz#a7bd18da4dc732c180b2e95e0e296c0bf22f3bd6"
@ -5221,6 +5228,13 @@ semver@^7.3.2:
dependencies:
lru-cache "^6.0.0"
serialize-error@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-5.0.0.tgz#a7ebbcdb03a5d71a6ed8461ffe0fc1a1afed62ac"
integrity sha512-/VtpuyzYf82mHYTtI4QKtwHa79vAdU5OQpNPAmE/0UDdlGT0ZxHwC+J6gXkw29wwoVI8fMPsfcVHOwXtUQYYQA==
dependencies:
type-fest "^0.8.0"
set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
@ -5925,7 +5939,7 @@ type-fest@^0.6.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b"
integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==
type-fest@^0.8.1:
type-fest@^0.8.0, type-fest@^0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==