dsh-bash-terminal-ts 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.en.md +99 -1
  2. package/README.md +195 -2
  3. package/cordis.patch.yml +66 -0
  4. package/dist/client.core.js +8018 -157
  5. package/dist/client.js +8018 -157
  6. package/dsh.plugin.json +22 -22
  7. package/lib/browser-i18n.d.ts +4 -0
  8. package/lib/browser-i18n.js +23 -0
  9. package/lib/client.js +8018 -157
  10. package/lib/dsh-types.d.ts +10 -0
  11. package/lib/dsh.d.ts +2 -0
  12. package/lib/index.d.ts +43 -0
  13. package/lib/index.js +196 -10
  14. package/lib/locales.d.ts +4 -0
  15. package/lib/locales.js +422 -0
  16. package/lib/settings-surface.d.ts +20 -0
  17. package/lib/settings-surface.js +49 -0
  18. package/lib/shell-id.d.ts +2 -0
  19. package/lib/shell-id.js +9 -0
  20. package/lib/shells.d.ts +114 -0
  21. package/lib/shells.js +187 -0
  22. package/lib/terminal.d.ts +30 -1
  23. package/lib/terminal.js +18 -5
  24. package/lib/webterminals/catalog.d.ts +36 -0
  25. package/lib/webterminals/catalog.js +93 -0
  26. package/lib/webterminals/host.d.ts +67 -0
  27. package/lib/webterminals/host.js +278 -0
  28. package/lib/webterminals/mount.d.ts +46 -0
  29. package/lib/webterminals/mount.js +171 -0
  30. package/lib/webterminals/protocol.d.ts +94 -0
  31. package/lib/webterminals/protocol.js +9 -0
  32. package/lib/webterminals/pty.d.ts +42 -0
  33. package/lib/webterminals/pty.js +64 -0
  34. package/lib/webterminals/registry.d.ts +139 -0
  35. package/lib/webterminals/registry.js +353 -0
  36. package/lib/webterminals/ws.d.ts +54 -0
  37. package/lib/webterminals/ws.js +140 -0
  38. package/locale/de.json +4 -0
  39. package/locale/en.json +4 -0
  40. package/locale/es.json +4 -0
  41. package/locale/fr.json +4 -0
  42. package/locale/it.json +4 -0
  43. package/locale/ja.json +4 -0
  44. package/locale/ko.json +4 -0
  45. package/locale/ru.json +4 -0
  46. package/locale/zh.json +4 -0
  47. package/package.json +131 -125
  48. package/scripts/build-browser-tests.mjs +36 -0
  49. package/scripts/build-client.mjs +10 -0
  50. package/scripts/check-artifacts.mjs +93 -0
  51. package/scripts/link-shells.mjs +75 -0
  52. package/src/browser-i18n.ts +27 -0
  53. package/src/client.tsx +622 -192
  54. package/src/dsh-types.ts +6 -0
  55. package/src/dsh.ts +2 -0
  56. package/src/index.ts +226 -10
  57. package/src/locales.ts +434 -0
  58. package/src/settings-surface.ts +59 -0
  59. package/src/shell-id.ts +11 -0
  60. package/src/shells.ts +250 -0
  61. package/src/terminal.ts +34 -5
  62. package/src/webterminals/browser/api.ts +212 -0
  63. package/src/webterminals/browser/bridge.ts +188 -0
  64. package/src/webterminals/browser/css.d.ts +16 -0
  65. package/src/webterminals/browser/face.ts +151 -0
  66. package/src/webterminals/browser/shell-picker.tsx +98 -0
  67. package/src/webterminals/browser/store.ts +40 -0
  68. package/src/webterminals/browser/tab.tsx +136 -0
  69. package/src/webterminals/browser/testkit.ts +21 -0
  70. package/src/webterminals/browser/url.ts +70 -0
  71. package/src/webterminals/browser/view.ts +381 -0
  72. package/src/webterminals/browser/xterm.ts +269 -0
  73. package/src/webterminals/catalog.ts +114 -0
  74. package/src/webterminals/host.ts +361 -0
  75. package/src/webterminals/mount.ts +227 -0
  76. package/src/webterminals/protocol.ts +78 -0
  77. package/src/webterminals/pty.ts +90 -0
  78. package/src/webterminals/registry.ts +447 -0
  79. package/src/webterminals/ws.ts +166 -0
  80. package/tsconfig.client.json +9 -1
  81. package/tsconfig.json +1 -1
package/dsh.plugin.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "id": "dsh-bash-terminal-ts",
3
- "name": "dsh-bash-terminal-ts",
4
- "version": "0.7.1",
5
- "description": {
6
- "en": "One shell tool that runs commands through PowerShell, Git Bash, MSYS2 or WSL on Windows, with a user-chosen default terminal in the Web UI settings.",
7
- "zh": "一个 shell 工具,可在 Windows 上通过 PowerShell / Git Bash / MSYS2 / WSL 执行命令,默认终端在 Web UI 设置中选择。"
8
- },
9
- "homepage": "https://github.com/drscrewdriver/dsh-bash-terminal-ts",
10
- "repository": {
11
- "type": "git",
12
- "url": "https://github.com/drscrewdriver/dsh-bash-terminal-ts.git"
13
- },
14
- "license": "MIT",
15
- "engines": {
16
- "dsh": ">=0.2.0-rc.1 <0.2.1-0"
17
- },
18
- "components": {
19
- "host": "lib/index.js",
20
- "client": "dist/client.js"
21
- }
22
- }
1
+ {
2
+ "id": "dsh-bash-terminal-ts",
3
+ "name": "dsh-bash-terminal-ts",
4
+ "version": "0.8.0",
5
+ "description": {
6
+ "en": "One shell tool that runs commands through PowerShell, Git Bash, MSYS2 or WSL on Windows, plus an embedded terminal for the bottom dock with per-shell activation switches and a default-shell fallback chain.",
7
+ "zh": "一个 shell 工具,可在 Windows 上通过 PowerShell / Git Bash / MSYS2 / WSL 执行命令;另提供底部工作台的内嵌终端,支持按 shell 激活开关与默认 shell 回落链。"
8
+ },
9
+ "homepage": "https://github.com/drscrewdriver/dsh-bash-terminal-ts",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/drscrewdriver/dsh-bash-terminal-ts.git"
13
+ },
14
+ "license": "MIT",
15
+ "engines": {
16
+ "dsh": ">=0.1.0-rc.8 <0.2.1-0"
17
+ },
18
+ "components": {
19
+ "host": "lib/index.js",
20
+ "client": "dist/client.js"
21
+ }
22
+ }
@@ -0,0 +1,4 @@
1
+ /** Install the host-bound translator (called once from the client `apply`). */
2
+ export declare function setTranslator(fn: (key: string, params?: Record<string, string | number>) => string): void;
3
+ /** Translate a `settings.bash-terminal` key. */
4
+ export declare function tr(key: string, params?: Record<string, string | number>): string;
@@ -0,0 +1,23 @@
1
+ // The client-side translator handle, in its own module.
2
+ //
3
+ // Both halves of the browser code need it: the settings row (registered through
4
+ // `ctx.slots`) and the bottom-dock tab (rendered by dsh-better-sidebar's own tree,
5
+ // which passes us no provider). A React context would therefore reach neither
6
+ // cleanly, and the previous revision of this plugin solved it by reading the Chinese
7
+ // dictionary object directly - registered seven languages, rendered `zh`, silently
8
+ // wrong on every other locale.
9
+ import { fallbackDict } from "./locales.js";
10
+ /**
11
+ * The active translator. It starts on the Chinese dictionary rather than on the
12
+ * identity function, because the oldest hosts expose no `locale.bind` at all: showing
13
+ * raw keys there would be a regression, and Chinese is what those hosts show.
14
+ */
15
+ let current = (key) => fallbackDict[key] ?? key;
16
+ /** Install the host-bound translator (called once from the client `apply`). */
17
+ export function setTranslator(fn) {
18
+ current = fn;
19
+ }
20
+ /** Translate a `settings.bash-terminal` key. */
21
+ export function tr(key, params) {
22
+ return current(key, params);
23
+ }