Skip to content

Commit 986dcaa

Browse files
authored
minor comment and type fixes (#100)
1 parent bb986b4 commit 986dcaa

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

packages/addon-mcp/src/mcp-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export async function incomingMessageToWebRequest(
148148
return new Request(url, {
149149
method: req.method,
150150
headers: req.headers as HeadersInit,
151-
// oxlint-disable-next-line no-invalid-fetch-options -- We now req.method is always 'POST', linter doesn't
151+
// oxlint-disable-next-line no-invalid-fetch-options -- We know req.method is always 'POST', linter doesn't
152152
body: bodyBuffer.length > 0 ? new Uint8Array(bodyBuffer) : undefined,
153153
});
154154
}

packages/addon-mcp/src/preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import htmlTemplate from './template.html';
88
export const experimental_devServer: PresetProperty<
99
'experimental_devServer'
1010
> = async (app, options) => {
11-
// There is error handling here. The can make the whole storybook app crash with.
11+
// There is no error handling here. This can make the whole storybook app crash with:
1212
// ValiError: Invalid type: Expected boolean but received "false"
1313
const addonOptions = v.parse(AddonOptions, {
1414
toolsets: 'toolsets' in options ? options.toolsets : {},

packages/addon-mcp/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export type AddonOptionsOutput = v.InferOutput<typeof AddonOptions>;
2424
* Contains Storybook-specific configuration and runtime information.
2525
* Extends StorybookContext to be compatible with @storybook/mcp tools.
2626
*/
27-
export interface AddonContext extends StorybookContext {
27+
export type AddonContext = StorybookContext & {
2828
/**
2929
* The Storybook options object containing configuration,
3030
* port, presets, and other runtime information.
@@ -43,7 +43,7 @@ export interface AddonContext extends StorybookContext {
4343
disableTelemetry: boolean;
4444

4545
toolsets?: NonNullable<AddonOptionsOutput>['toolsets'];
46-
}
46+
};
4747

4848
/**
4949
* Schema for a single story input when requesting story URLs.

packages/mcp/bin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ const args = parseArgs({
5757
const format = args.values.format as OutputFormat;
5858

5959
transport.listen({
60-
source: args.values.manifestPath,
6160
format,
6261
manifestProvider: async () => {
6362
const { manifestPath } = args.values;

packages/mcp/src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type OutputFormat = 'xml' | 'markdown';
1010
* Custom context passed to MCP server and tools.
1111
* Contains the request object and optional manifest provider.
1212
*/
13-
export interface StorybookContext extends Record<string, unknown> {
13+
export type StorybookContext = {
1414
/**
1515
* The incoming HTTP request being processed.
1616
*/
@@ -50,7 +50,7 @@ export interface StorybookContext extends Record<string, unknown> {
5050
input: { componentId: string };
5151
foundComponent?: ComponentManifest;
5252
}) => void | Promise<void>;
53-
}
53+
};
5454

5555
const JSDocTag = v.record(v.string(), v.array(v.string()));
5656

0 commit comments

Comments
 (0)