Skip to content

Commit 4768007

Browse files
committed
fix(plugin-terminals): adapt to upstream main (nostics v1, required metadata, per-package typecheck)
Merge upstream/main and reconcile the plugin with its newer baseline: - resolve to nostics ^1.1.4 via the catalog and regenerate the lockfile (fixes the broken merged lockfile that failed frozen CI installs). - supply the now-required DevframeDefinition metadata (version, packageName, homepage, description) from package.json. - add a `typecheck` script and switch tsconfig to explicit include/exclude (drop composite) so `turbo run typecheck` passes for the package. - refresh tsnapi snapshots for the nostics v1 diagnostics handle shape.
1 parent dbb1303 commit 4768007

6 files changed

Lines changed: 51 additions & 43 deletions

File tree

plugins/terminals/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"watch": "tsdown --watch",
4545
"dev": "node bin.mjs",
4646
"test": "vitest run",
47+
"typecheck": "tsc --noEmit",
4748
"prepack": "pnpm run build"
4849
},
4950
"peerDependencies": {

plugins/terminals/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { DevframeDefinition } from 'devframe/types'
22
import type { TerminalsOptions } from './types'
33
import { fileURLToPath } from 'node:url'
44
import { defineDevframe } from 'devframe/types'
5+
import pkg from '../package.json' with { type: 'json' }
56
import {
67
DEFAULT_PORT,
78
PLUGIN_ID,
@@ -40,6 +41,10 @@ export function createTerminalsDevframe(options: TerminalsOptions = {}): Devfram
4041
return defineDevframe({
4142
id: PLUGIN_ID,
4243
name: 'Terminals',
44+
version: pkg.version,
45+
packageName: pkg.name,
46+
homepage: pkg.homepage,
47+
description: pkg.description,
4348
icon: 'ph:terminal-window-duotone',
4449
// Leave undefined so `resolveBasePath` picks `/` standalone and
4550
// `/__<id>/` when hosted. Authors override via `options.basePath`.

plugins/terminals/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"composite": true,
54
"lib": ["esnext", "dom"]
6-
}
5+
},
6+
"include": ["src", "test", "tsdown.config.ts"],
7+
"exclude": ["dist", "node_modules"]
78
}

pnpm-lock.yaml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/__snapshots__/tsnapi/@devframes/plugin-terminals/index.snapshot.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
/**
22
* Generated by tsnapi — public API snapshot of `@devframes/plugin-terminals`
33
*/
4-
// #region Functions
5-
export function createTerminalsDevframe(_) {}
6-
// #endregion
7-
84
// #region Default Export
9-
var _default /* const */
10-
export default _default
5+
export default terminals
116
// #endregion
127

138
// #region Other
9+
export { createTerminalsDevframe }
1410
export { DEFAULT_PORT }
1511
export { PLUGIN_ID }
1612
export { PRESETS_STATE_KEY }

tests/__snapshots__/tsnapi/@devframes/plugin-terminals/node.snapshot.d.ts

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,43 @@ export declare function setupTerminals(_: DevframeNodeContext, _?: TerminalsOpti
4444
// #endregion
4545

4646
// #region Variables
47-
export declare const diagnostics: {
48-
readonly DP_TERMINALS_0001: _$nostics.DiagnosticHandle<{
49-
id: string;
50-
}, {
51-
method?: "log" | "warn" | "error" | undefined;
52-
}>;
53-
readonly DP_TERMINALS_0002: _$nostics.DiagnosticHandle<{
54-
command: string;
55-
}, {
56-
method?: "log" | "warn" | "error" | undefined;
57-
}>;
58-
readonly DP_TERMINALS_0003: _$nostics.DiagnosticHandle<{
59-
id: string;
60-
}, {
61-
method?: "log" | "warn" | "error" | undefined;
62-
}>;
63-
readonly DP_TERMINALS_0004: _$nostics.DiagnosticHandle<{
64-
command: string;
65-
reason: string;
66-
}, {
67-
method?: "log" | "warn" | "error" | undefined;
68-
}>;
69-
readonly DP_TERMINALS_0005: _$nostics.DiagnosticHandle<{}, {
70-
method?: "log" | "warn" | "error" | undefined;
71-
}>;
72-
readonly DP_TERMINALS_0006: _$nostics.DiagnosticHandle<{
73-
id: string;
74-
}, {
75-
method?: "log" | "warn" | "error" | undefined;
76-
}>;
77-
readonly DP_TERMINALS_0007: _$nostics.DiagnosticHandle<{}, {
78-
method?: "log" | "warn" | "error" | undefined;
79-
}>;
80-
};
47+
export declare const diagnostics: _$nostics.Diagnostics<{
48+
readonly DP_TERMINALS_0001: {
49+
readonly why: (p: {
50+
id: string;
51+
}) => string;
52+
readonly fix: "Spawn a session first, or refresh the session list.";
53+
};
54+
readonly DP_TERMINALS_0002: {
55+
readonly why: (p: {
56+
command: string;
57+
}) => string;
58+
readonly fix: "Add it to `presets`, or pass `allowArbitraryCommands: true` to createTerminalsDevframe().";
59+
};
60+
readonly DP_TERMINALS_0003: {
61+
readonly why: (p: {
62+
id: string;
63+
}) => string;
64+
readonly fix: "Spawn the session with `mode: \"interactive\"` to accept input.";
65+
};
66+
readonly DP_TERMINALS_0004: {
67+
readonly why: (p: {
68+
command: string;
69+
reason: string;
70+
}) => string;
71+
};
72+
readonly DP_TERMINALS_0005: {
73+
readonly why: "PTY backend (@homebridge/node-pty-prebuilt-multiarch) is unavailable; interactive sessions fall back to a piped child process. Full-screen TUIs may not render correctly.";
74+
readonly fix: "Install @homebridge/node-pty-prebuilt-multiarch to enable real pseudo-terminals.";
75+
};
76+
readonly DP_TERMINALS_0006: {
77+
readonly why: (p: {
78+
id: string;
79+
}) => string;
80+
};
81+
readonly DP_TERMINALS_0007: {
82+
readonly why: "Terminals manager is not initialised on this context";
83+
readonly fix: "Call setupTerminals(ctx) (or use createTerminalsDevframe) before invoking terminal RPCs.";
84+
};
85+
}, readonly [typeof reporter]>;
8186
// #endregion

0 commit comments

Comments
 (0)