mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-04-27 07:40:55 -07:00
fix: types
This commit is contained in:
parent
32f8d1d025
commit
82ec4be66d
11 changed files with 142 additions and 92 deletions
172
package-lock.json
generated
172
package-lock.json
generated
|
|
@ -14,7 +14,7 @@
|
|||
"best-effort-json-parser": "0.1.1",
|
||||
"bluebird": "3.7.2",
|
||||
"default-gateway": "6.0.3",
|
||||
"electron-ipc-cat": "1.2.6",
|
||||
"electron-ipc-cat": "^1.2.7",
|
||||
"electron-is-packaged": "1.0.2",
|
||||
"electron-settings": "4.0.2",
|
||||
"electron-squirrel-startup": "1.0.0",
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
"electron-window-state": "5.0.3",
|
||||
"errio": "1.2.2",
|
||||
"fs-extra": "10.0.0",
|
||||
"git-sync-js": "1.0.1",
|
||||
"git-sync-js": "^1.0.2",
|
||||
"i18next": "21.6.11",
|
||||
"i18next-electron-fs-backend": "2.0.0",
|
||||
"i18next-fs-backend": "1.1.4",
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
"ts-loader": "9.2.6",
|
||||
"ts-migrate": "0.1.28",
|
||||
"ts-node": "10.5.0",
|
||||
"tw5-typed": "^0.1.4",
|
||||
"tw5-typed": "^0.1.5",
|
||||
"typeface-roboto": "1.1.13",
|
||||
"typescript": "4.5.5",
|
||||
"typescript-plugin-styled-components": "2.0.0",
|
||||
|
|
@ -5875,9 +5875,9 @@
|
|||
"integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
|
||||
},
|
||||
"node_modules/async-lock": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.3.0.tgz",
|
||||
"integrity": "sha512-8A7SkiisnEgME2zEedtDYPxUPzdv3x//E7n5IFktPAtMYSEAV7eNJF0rMwrVyUFj6d/8rgajLantbjcNRQYXIg=="
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.3.1.tgz",
|
||||
"integrity": "sha512-zK7xap9UnttfbE23JmcrNIyueAn6jWshihJqA33U/hEnKprF/lVGBDsBv/bqLm2YMMl1DnpHhUY044eA0t1TUw=="
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
|
|
@ -9019,28 +9019,20 @@
|
|||
}
|
||||
},
|
||||
"node_modules/electron-ipc-cat": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/electron-ipc-cat/-/electron-ipc-cat-1.2.6.tgz",
|
||||
"integrity": "sha512-U5v0eOqVlhfSQbpaa4mlZwkmk+ZReG7Lqn+ny48ARlMnuM+SudU1pPVyosS+CbSDlvyTONLnbyGMCR5aYQwD1g==",
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/electron-ipc-cat/-/electron-ipc-cat-1.2.7.tgz",
|
||||
"integrity": "sha512-IPPcPX/vcMnRiHsDU2pMLYG4ZBk1xeJZXGsDQ2CWCoGROjXz9gQdmH8URaNfECqF7X6GYzC/W4gCBtwOZHJNWQ==",
|
||||
"dependencies": {
|
||||
"errio": "1.2.2",
|
||||
"lodash": "4.17.21",
|
||||
"rxjs": "7.5.2",
|
||||
"type-fest": "^2.11.0",
|
||||
"rxjs": "7.5.4",
|
||||
"type-fest": "^2.12.0",
|
||||
"uuid": "8.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"electron": ">= 13.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-ipc-cat/node_modules/rxjs": {
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.2.tgz",
|
||||
"integrity": "sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/electron-is-dev": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npm.taobao.org/electron-is-dev/download/electron-is-dev-1.2.0.tgz",
|
||||
|
|
@ -12393,13 +12385,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/git-sync-js": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/git-sync-js/-/git-sync-js-1.0.1.tgz",
|
||||
"integrity": "sha512-5NB8v2tKScGVnClUIJ03IXUNHW5C+yUSwj6WfehhxrimJpWTOKcvA205EKzxZchlCN4dKT49RmS2xNmdhLsYuA==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/git-sync-js/-/git-sync-js-1.0.2.tgz",
|
||||
"integrity": "sha512-Cv4EeSa9kdzUjVXSwp9vXWZH9tiFcm2cwMHf0OLNyzSRa4TL72NklSEb8Wm59Yk260Fo0gHQZ7jUrNjCb6y1VA==",
|
||||
"dependencies": {
|
||||
"dugite": "^1.104.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"isomorphic-git": "^1.11.0",
|
||||
"isomorphic-git": "^1.11.2",
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
},
|
||||
|
|
@ -13883,9 +13875,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/isomorphic-git": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.11.0.tgz",
|
||||
"integrity": "sha512-zTz3P85TZWDvCE3zX7Yija9jgEvYlLCiX3SDlFLnczFx2jVJqUrhTBeEiigkX/xdFCKJNLcDbwfploXt6SlPMw==",
|
||||
"version": "1.11.2",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.11.2.tgz",
|
||||
"integrity": "sha512-7gSW+dMftHYyDufoeLCOagxlN0KsAYvR/qddSke9pnPH8vwL4OwqQ2BvkG0O02OnEFqg1pZXyIzBPFBfOMYXUA==",
|
||||
"dependencies": {
|
||||
"async-lock": "^1.1.0",
|
||||
"clean-git-ref": "^2.0.1",
|
||||
|
|
@ -13897,7 +13889,7 @@
|
|||
"pify": "^4.0.1",
|
||||
"readable-stream": "^3.4.0",
|
||||
"sha.js": "^2.4.9",
|
||||
"simple-get": "^3.0.2"
|
||||
"simple-get": "^4.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"isogit": "cli.cjs"
|
||||
|
|
@ -13906,6 +13898,31 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/isomorphic-git/node_modules/decompress-response": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
|
||||
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
|
||||
"dependencies": {
|
||||
"mimic-response": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isomorphic-git/node_modules/mimic-response": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
|
||||
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/isomorphic-git/node_modules/readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
|
|
@ -13919,6 +13936,30 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/isomorphic-git/node_modules/simple-get": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
|
||||
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"decompress-response": "^6.0.0",
|
||||
"once": "^1.3.1",
|
||||
"simple-concat": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/isstream": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||
|
|
@ -21542,9 +21583,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/tw5-typed": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tw5-typed/-/tw5-typed-0.1.4.tgz",
|
||||
"integrity": "sha512-+4HsZyFx/2TUUJceJpy9t0uwTvwBtZ4sxSPI8IkWDInJbNCKVS8oIqKRKBI+BZmdpe/AYITBnE/MkMpitpNfUw==",
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/tw5-typed/-/tw5-typed-0.1.5.tgz",
|
||||
"integrity": "sha512-qq+cJ65MLalQgJ3PabLGI9WqlBVXeIfSi8udpLwQ4vi80fvXz2Q3OwGuN0ytaaj3OzdWbh3B0pGb5Zn+ISqFsQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/tweetnacl": {
|
||||
|
|
@ -27776,9 +27817,9 @@
|
|||
"integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g=="
|
||||
},
|
||||
"async-lock": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.3.0.tgz",
|
||||
"integrity": "sha512-8A7SkiisnEgME2zEedtDYPxUPzdv3x//E7n5IFktPAtMYSEAV7eNJF0rMwrVyUFj6d/8rgajLantbjcNRQYXIg=="
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/async-lock/-/async-lock-1.3.1.tgz",
|
||||
"integrity": "sha512-zK7xap9UnttfbE23JmcrNIyueAn6jWshihJqA33U/hEnKprF/lVGBDsBv/bqLm2YMMl1DnpHhUY044eA0t1TUw=="
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
|
|
@ -30201,25 +30242,15 @@
|
|||
}
|
||||
},
|
||||
"electron-ipc-cat": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmjs.org/electron-ipc-cat/-/electron-ipc-cat-1.2.6.tgz",
|
||||
"integrity": "sha512-U5v0eOqVlhfSQbpaa4mlZwkmk+ZReG7Lqn+ny48ARlMnuM+SudU1pPVyosS+CbSDlvyTONLnbyGMCR5aYQwD1g==",
|
||||
"version": "1.2.7",
|
||||
"resolved": "https://registry.npmjs.org/electron-ipc-cat/-/electron-ipc-cat-1.2.7.tgz",
|
||||
"integrity": "sha512-IPPcPX/vcMnRiHsDU2pMLYG4ZBk1xeJZXGsDQ2CWCoGROjXz9gQdmH8URaNfECqF7X6GYzC/W4gCBtwOZHJNWQ==",
|
||||
"requires": {
|
||||
"errio": "1.2.2",
|
||||
"lodash": "4.17.21",
|
||||
"rxjs": "7.5.2",
|
||||
"type-fest": "^2.11.0",
|
||||
"rxjs": "7.5.4",
|
||||
"type-fest": "^2.12.0",
|
||||
"uuid": "8.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"rxjs": {
|
||||
"version": "7.5.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.2.tgz",
|
||||
"integrity": "sha512-PwDt186XaL3QN5qXj/H9DGyHhP3/RYYgZZwqBv9Tv8rsAaiwFH1IsJJlcgD37J7UW5a6O67qX0KWKS3/pu0m4w==",
|
||||
"requires": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"electron-is-dev": {
|
||||
|
|
@ -32778,13 +32809,13 @@
|
|||
}
|
||||
},
|
||||
"git-sync-js": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/git-sync-js/-/git-sync-js-1.0.1.tgz",
|
||||
"integrity": "sha512-5NB8v2tKScGVnClUIJ03IXUNHW5C+yUSwj6WfehhxrimJpWTOKcvA205EKzxZchlCN4dKT49RmS2xNmdhLsYuA==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/git-sync-js/-/git-sync-js-1.0.2.tgz",
|
||||
"integrity": "sha512-Cv4EeSa9kdzUjVXSwp9vXWZH9tiFcm2cwMHf0OLNyzSRa4TL72NklSEb8Wm59Yk260Fo0gHQZ7jUrNjCb6y1VA==",
|
||||
"requires": {
|
||||
"dugite": "^1.104.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"isomorphic-git": "^1.11.0",
|
||||
"isomorphic-git": "^1.11.2",
|
||||
"lodash": "^4.17.21"
|
||||
}
|
||||
},
|
||||
|
|
@ -33889,9 +33920,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"isomorphic-git": {
|
||||
"version": "1.11.0",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.11.0.tgz",
|
||||
"integrity": "sha512-zTz3P85TZWDvCE3zX7Yija9jgEvYlLCiX3SDlFLnczFx2jVJqUrhTBeEiigkX/xdFCKJNLcDbwfploXt6SlPMw==",
|
||||
"version": "1.11.2",
|
||||
"resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.11.2.tgz",
|
||||
"integrity": "sha512-7gSW+dMftHYyDufoeLCOagxlN0KsAYvR/qddSke9pnPH8vwL4OwqQ2BvkG0O02OnEFqg1pZXyIzBPFBfOMYXUA==",
|
||||
"requires": {
|
||||
"async-lock": "^1.1.0",
|
||||
"clean-git-ref": "^2.0.1",
|
||||
|
|
@ -33903,9 +33934,22 @@
|
|||
"pify": "^4.0.1",
|
||||
"readable-stream": "^3.4.0",
|
||||
"sha.js": "^2.4.9",
|
||||
"simple-get": "^3.0.2"
|
||||
"simple-get": "^4.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"decompress-response": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
|
||||
"integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
|
||||
"requires": {
|
||||
"mimic-response": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"mimic-response": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
|
||||
"integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
|
||||
|
|
@ -33915,6 +33959,16 @@
|
|||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"simple-get": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
|
||||
"integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
|
||||
"requires": {
|
||||
"decompress-response": "^6.0.0",
|
||||
"once": "^1.3.1",
|
||||
"simple-concat": "^1.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -39965,9 +40019,9 @@
|
|||
}
|
||||
},
|
||||
"tw5-typed": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/tw5-typed/-/tw5-typed-0.1.4.tgz",
|
||||
"integrity": "sha512-+4HsZyFx/2TUUJceJpy9t0uwTvwBtZ4sxSPI8IkWDInJbNCKVS8oIqKRKBI+BZmdpe/AYITBnE/MkMpitpNfUw==",
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/tw5-typed/-/tw5-typed-0.1.5.tgz",
|
||||
"integrity": "sha512-qq+cJ65MLalQgJ3PabLGI9WqlBVXeIfSi8udpLwQ4vi80fvXz2Q3OwGuN0ytaaj3OzdWbh3B0pGb5Zn+ISqFsQ==",
|
||||
"dev": true
|
||||
},
|
||||
"tweetnacl": {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"best-effort-json-parser": "0.1.1",
|
||||
"bluebird": "3.7.2",
|
||||
"default-gateway": "6.0.3",
|
||||
"electron-ipc-cat": "1.2.6",
|
||||
"electron-ipc-cat": "^1.2.7",
|
||||
"electron-is-packaged": "1.0.2",
|
||||
"electron-settings": "4.0.2",
|
||||
"electron-squirrel-startup": "1.0.0",
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
"electron-window-state": "5.0.3",
|
||||
"errio": "1.2.2",
|
||||
"fs-extra": "10.0.0",
|
||||
"git-sync-js": "1.0.1",
|
||||
"git-sync-js": "^1.0.2",
|
||||
"i18next": "21.6.11",
|
||||
"i18next-electron-fs-backend": "2.0.0",
|
||||
"i18next-fs-backend": "1.1.4",
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
"ts-loader": "9.2.6",
|
||||
"ts-migrate": "0.1.28",
|
||||
"ts-node": "10.5.0",
|
||||
"tw5-typed": "^0.1.4",
|
||||
"tw5-typed": "^0.1.5",
|
||||
"typeface-roboto": "1.1.13",
|
||||
"typescript": "4.5.5",
|
||||
"typescript-plugin-styled-components": "2.0.0",
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ export function useRestartSnackbar(waitBeforeCountDown = 1000, waitBeforeRestart
|
|||
inCountDownSetter(true);
|
||||
openedSetter(true);
|
||||
},
|
||||
[openedSetter, inCountDown, inCountDownSetter],
|
||||
waitBeforeCountDown,
|
||||
{ leading: false },
|
||||
[openedSetter, inCountDown, inCountDownSetter],
|
||||
);
|
||||
|
||||
const requestRestartCountDown = useCallback(() => {
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ function SearchGithubRepoResultList({
|
|||
},
|
||||
skipCache: true,
|
||||
});
|
||||
const refetchDebounced = useDebouncedCallback(refetch, 300);
|
||||
const refetchDebounced = useDebouncedCallback(refetch, [], 300);
|
||||
// clear list on logout, which will cause accessToken change
|
||||
useEffect(() => {
|
||||
const timeoutHandle = setTimeout(async () => {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ import fs from 'fs-extra';
|
|||
import path from 'path';
|
||||
import { LOCALIZATION_FOLDER } from '@/constants/paths';
|
||||
|
||||
export const supportedLanguagesMap = JSON.parse(fs.readFileSync(path.join(LOCALIZATION_FOLDER, 'supportedLanguages.json'))) as Record<string, string>;
|
||||
export const tiddlywikiLanguagesMap = JSON.parse(fs.readFileSync(path.join(LOCALIZATION_FOLDER, 'tiddlywikiLanguages.json'))) as Record<
|
||||
string,
|
||||
string | undefined
|
||||
>;
|
||||
export const supportedLanguagesMap = fs.readJsonSync(path.join(LOCALIZATION_FOLDER, 'supportedLanguages.json')) as Record<string, string>;
|
||||
export const tiddlywikiLanguagesMap = fs.readJsonSync(path.join(LOCALIZATION_FOLDER, 'tiddlywikiLanguages.json')) as Record<string, string | undefined>;
|
||||
|
||||
export const supportedLanguagesKNames = Object.keys(supportedLanguagesMap);
|
||||
|
|
|
|||
|
|
@ -45,9 +45,8 @@ export function usePromiseValueAndSetter<T, DefaultValueType = T | undefined>(
|
|||
void asyncSetter(value);
|
||||
}
|
||||
},
|
||||
300,
|
||||
undefined,
|
||||
[asyncValue, asyncSetter],
|
||||
300,
|
||||
);
|
||||
|
||||
const setter = useCallback(
|
||||
|
|
|
|||
|
|
@ -5,6 +5,18 @@ import 'winston-daily-rotate-file';
|
|||
|
||||
export * from './wikiOutput';
|
||||
|
||||
const levels = {
|
||||
emerg: 0,
|
||||
alert: 1,
|
||||
crit: 2,
|
||||
error: 3,
|
||||
warning: 4,
|
||||
warn: 5,
|
||||
notice: 6,
|
||||
info: 7,
|
||||
debug: 8,
|
||||
};
|
||||
export type ILogLevels = keyof typeof levels;
|
||||
const logger = (
|
||||
process.env.NODE_ENV === 'test'
|
||||
? Object.assign(console, {
|
||||
|
|
@ -16,17 +28,7 @@ const logger = (
|
|||
debug: console.log.bind(console),
|
||||
})
|
||||
: winston.createLogger({
|
||||
levels: {
|
||||
emerg: 0,
|
||||
alert: 1,
|
||||
crit: 2,
|
||||
error: 3,
|
||||
warning: 4,
|
||||
warn: 5,
|
||||
notice: 6,
|
||||
info: 7,
|
||||
debug: 8,
|
||||
},
|
||||
levels,
|
||||
transports: [
|
||||
new winston.transports.Console(),
|
||||
new winston.transports.DailyRotateFile({
|
||||
|
|
|
|||
|
|
@ -10,14 +10,13 @@ import serviceIdentifier from '@services/serviceIdentifier';
|
|||
import { IWikiService, ZxWorkerControlActions } from '@services/wiki/interface';
|
||||
import { IWorkspaceService } from '@services/workspaces/interface';
|
||||
import { ZX_FOLDER } from '@/constants/paths';
|
||||
import { logger } from '@services/libs/log';
|
||||
import { ILogLevels, logger } from '@services/libs/log';
|
||||
import { findEditorOrDefault, findGitGUIAppOrDefault, launchExternalEditor } from './externalApp';
|
||||
import { reportErrorToGithubWithTemplates } from './reportError';
|
||||
import { IZxFileInput } from '@services/wiki/wikiWorker';
|
||||
import { ZxNotInitializedError } from './error';
|
||||
import { lazyInject } from '@services/container';
|
||||
import i18next from 'i18next';
|
||||
import winston from 'winston';
|
||||
|
||||
@injectable()
|
||||
export class NativeService implements INativeService {
|
||||
|
|
@ -148,7 +147,7 @@ ${message.message}
|
|||
app.quit();
|
||||
}
|
||||
|
||||
public async log(level: winston.level, message: string, meta?: Record<string, unknown>): Promise<void> {
|
||||
public async log(level: ILogLevels, message: string, meta?: Record<string, unknown>): Promise<void> {
|
||||
logger.log(level, message, meta);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { I$TW } from '@tiddlygit/tiddlywiki';
|
||||
import type { ITiddlyWiki } from '@tiddlygit/tiddlywiki';
|
||||
import vm, { Context } from 'vm';
|
||||
import _ from 'lodash';
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export interface ITWVMContext {
|
|||
* Get context that has global variables like `console` and `$tw`, and a result output buffer that contains result from the `console`.
|
||||
* @returns
|
||||
*/
|
||||
export function getTWVmContext(wikiInstance: I$TW): ITWVMContext {
|
||||
export function getTWVmContext(wikiInstance: ITiddlyWiki): ITWVMContext {
|
||||
const executionResults: string[] = [];
|
||||
const proxyConsole = new Proxy(
|
||||
{},
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import 'source-map-support/register';
|
||||
import { expose } from 'threads/worker';
|
||||
import path from 'path';
|
||||
import type { I$TW } from 'tiddlywiki';
|
||||
import tiddlywiki from '@tiddlygit/tiddlywiki';
|
||||
import { TiddlyWiki, type ITiddlyWiki } from '@tiddlygit/tiddlywiki';
|
||||
import { Observable } from 'rxjs';
|
||||
import intercept from 'intercept-stdout';
|
||||
import { Server } from 'http';
|
||||
|
|
@ -16,7 +15,7 @@ import { defaultServerIP } from '@/constants/urls';
|
|||
import { executeScriptInTWContext, extractTWContextScripts, getTWVmContext } from './plugin/zxPlugin';
|
||||
|
||||
fixPath();
|
||||
let wikiInstance: I$TW | undefined;
|
||||
let wikiInstance: ITiddlyWiki | undefined;
|
||||
|
||||
function startNodeJSWiki({
|
||||
homePath,
|
||||
|
|
@ -41,7 +40,7 @@ function startNodeJSWiki({
|
|||
);
|
||||
|
||||
try {
|
||||
wikiInstance = tiddlywiki.TiddlyWiki();
|
||||
wikiInstance = TiddlyWiki();
|
||||
process.env.TIDDLYWIKI_PLUGIN_PATH = path.resolve(homePath, 'plugins');
|
||||
process.env.TIDDLYWIKI_THEME_PATH = path.resolve(homePath, 'themes');
|
||||
// add tiddly filesystem back https://github.com/Jermolene/TiddlyWiki5/issues/4484#issuecomment-596779416
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
"types": ["reflect-metadata", "tw5-typed"] /* Type declaration files to be included in compilation. */,
|
||||
"types": ["reflect-metadata", "tw5-typed", "webdriverio/async"] /* Type declaration files to be included in compilation. */,
|
||||
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue