TidGi-Desktop/packages/tidgi-shared/package.json
linonetwo b677088a48 Expose TidGi services to $tw.tidgi and add types
Make TidGi IPC service proxies available inside the TiddlyWiki sandbox and provide typings for plugin authors. Added docs (docs/TidGiServiceAPI.md), bumped tidgi-shared to 0.1.2, and introduced shared type files (packages/tidgi-shared/src/{global.d.ts,tidgiGlobal.ts}) and tsconfig include for .d.ts files. Preload now exposes service via contextBridge and attaches it to $tw.tidgi.service (with DOMContentLoaded retry). Updated various wiki plugin files to use $tw.tidgi.service instead of window.service, adjusted worker-side service exports (no automatic global attach), and updated startNodeJSWiki to safely inject service into the wiki sandbox with proper typing. Added runtime TiddlyWiki type augmentations (src/types/tidgi-tw.d.ts). These changes ensure plugins running in the VM can reliably access typed service proxies.
2026-02-10 02:41:32 +08:00

62 lines
1.3 KiB
JSON

{
"name": "tidgi-shared",
"version": "0.1.2",
"description": "Shared service interfaces and IPC descriptors for TidGi plugins",
"license": "MPL-2.0",
"author": "linonetwo <linonetwo012@gmail.com>",
"homepage": "https://github.com/tiddly-gittly/TidGi-Desktop#readme",
"repository": {
"type": "git",
"url": "https://github.com/tiddly-gittly/TidGi-Desktop.git",
"directory": "packages/tidgi-shared"
},
"bugs": {
"url": "https://github.com/tiddly-gittly/TidGi-Desktop/issues"
},
"keywords": [
"tidgi",
"tiddlywiki",
"plugin",
"ipc",
"service",
"interface",
"types",
"typescript"
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"check": "tsc --noEmit",
"prepublishOnly": "pnpm run check && pnpm run build"
},
"dependencies": {
"electron-ipc-cat": "^2.1.0"
},
"peerDependencies": {
"rxjs": ">=7"
},
"peerDependenciesMeta": {
"rxjs": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^22.0.0",
"rxjs": "^7.8.1",
"tsup": "^8.0.0",
"tw5-typed": "^1.1.1",
"type-fest": "^4.0.0",
"typescript": "^5.7.0"
}
}