Skip to content

Commit

Permalink
New tsconfig for electron
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jun 19, 2024
1 parent 3ed6517 commit 418889c
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 2 deletions.
2 changes: 2 additions & 0 deletions products/jbrowse-desktop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ yarn-error.log*
coverage/
public/electron.js
public/generateFastaIndex.js
public/electron.d.ts
public/generateFastaIndex.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ async function updatePreconfiguredSessions() {
}

async function createWindow() {
// esm module needs async import
import('electron-debug')
.then(m => m.default({ showDevTools: false }))
.catch(e => console.error(e))

// no need to await, just update in background
// eslint-disable-next-line @typescript-eslint/no-floating-promises
updatePreconfiguredSessions()
Expand Down
3 changes: 2 additions & 1 deletion products/jbrowse-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"scripts": {
"start": "cross-env BROWSER=none node scripts/start.js",
"electron": "electron . --no-sandbox",
"electron-ts": "tsc --strict --esModuleInterop --module esnext --skipLibCheck public/electron.ts",
"electron-ts": "tsc -b tsconfig.electron.json",
"preelectron": "npm run electron-ts",
"prebuild": "npm run electron-ts",
"prepack": "npm run build",
Expand Down Expand Up @@ -82,6 +82,7 @@
"clone": "^2.1.2",
"date-fns": "^3.6.0",
"deepmerge": "^4.2.2",
"electron-debug": "^4.0.0",
"electron-updater": "^6.1.1",
"electron-window-state": "^5.0.3",
"json-parse-even-better-errors": "^3.0.0",
Expand Down
7 changes: 7 additions & 0 deletions products/jbrowse-desktop/public/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"include": ["src"],
"compilerOptions": {
"module": "esnext",
"strict": true
}
}
10 changes: 10 additions & 0 deletions products/jbrowse-desktop/tsconfig.electron.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"include": ["electron"],
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"outDir": "public",
"noEmit": false
}
}
40 changes: 39 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8001,7 +8001,7 @@ debug@2.6.9, debug@^2.6.0:
dependencies:
ms "2.0.0"

debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5:
debug@4, debug@^4.0.1, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@^4.3.5:
version "4.3.5"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e"
integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==
Expand Down Expand Up @@ -8556,6 +8556,34 @@ electron-builder@^24.9.0:
simple-update-notifier "2.0.0"
yargs "^17.6.2"

electron-debug@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/electron-debug/-/electron-debug-4.0.0.tgz#ec424edd8ea58fbf81857f65e816d6d397150075"
integrity sha512-GuDHlug+EGBcZezEFzwXyal/YI28rxtSzRPNfRfc+BQ3siEkqy2voN5bI1c0cGEloK40mV/LzRMaiI84KCNvqg==
dependencies:
electron-is-dev "^3.0.1"
electron-localshortcut "^3.2.1"

electron-is-accelerator@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz#509e510c26a56b55e17f863a4b04e111846ab27b"
integrity sha512-fLGSAjXZtdn1sbtZxx52+krefmtNuVwnJCV2gNiVt735/ARUboMl8jnNC9fZEqQdlAv2ZrETfmBUsoQci5evJA==

electron-is-dev@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-3.0.1.tgz#1cbc79b1dd046787903acd357efdfab6549dc17a"
integrity sha512-8TjjAh8Ec51hUi3o4TaU0mD3GMTOESi866oRNavj9A3IQJ7pmv+MJVmdZBFGw4GFT36X7bkqnuDNYvkQgvyI8Q==

electron-localshortcut@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/electron-localshortcut/-/electron-localshortcut-3.2.1.tgz#cfc83a3eff5e28faf98ddcc87f80a2ce4f623cd3"
integrity sha512-DWvhKv36GsdXKnaFFhEiK8kZZA+24/yFLgtTwJJHc7AFgDjNRIBJZ/jq62Y/dWv9E4ypYwrVWN2bVrCYw1uv7Q==
dependencies:
debug "^4.0.1"
electron-is-accelerator "^0.1.0"
keyboardevent-from-electron-accelerator "^2.0.0"
keyboardevents-areequal "^0.2.1"

electron-mock-ipc@^0.3.8:
version "0.3.12"
resolved "https://registry.yarnpkg.com/electron-mock-ipc/-/electron-mock-ipc-0.3.12.tgz#f9a7dca9a23a95dbe5a62f27cca12768d4cb88c0"
Expand Down Expand Up @@ -11919,6 +11947,16 @@ jsonparse@^1.2.0, jsonparse@^1.3.1:
object.assign "^4.1.4"
object.values "^1.1.6"

keyboardevent-from-electron-accelerator@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/keyboardevent-from-electron-accelerator/-/keyboardevent-from-electron-accelerator-2.0.0.tgz#ace21b1aa4e47148815d160057f9edb66567c50c"
integrity sha512-iQcmNA0M4ETMNi0kG/q0h/43wZk7rMeKYrXP7sqKIJbHkTU8Koowgzv+ieR/vWJbOwxx5nDC3UnudZ0aLSu4VA==

keyboardevents-areequal@^0.2.1:
version "0.2.2"
resolved "https://registry.yarnpkg.com/keyboardevents-areequal/-/keyboardevents-areequal-0.2.2.tgz#88191ec738ce9f7591c25e9056de928b40277194"
integrity sha512-Nv+Kr33T0mEjxR500q+I6IWisOQ0lK1GGOncV0kWE6n4KFmpcu7RUX5/2B0EUtX51Cb0HjZ9VJsSY3u4cBa0kw==

keyv@^4.0.0, keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
Expand Down

0 comments on commit 418889c

Please sign in to comment.