Repository navigation
chore: enable isolatedDeclarations - #3293
Merged
Merged
Conversation
Enable `isolatedDeclarations` (and `declaration`, which it requires) in tsconfig.json. Declare the parsed option types explicitly instead of inferring them from the Yargs option objects: - Add `BrowserArguments`, `PuppeteerArguments`, `ToolArguments`, `CategoryArguments` and `McpArguments`. `ParsedArguments` is now defined in mcp-options.ts from `McpArguments`. - Add `McpOptionsFor<TArgs>`, which derives the Yargs option map from an arguments interface and checks each option's `type`, `default`, `choices` and `coerce` against it. Optional (`?`) arguments are the options without a default. - Import `ParsedArguments` from mcp-options.ts everywhere and drop the re-exports from ServerConfig.ts and ConfigParser.ts. Exclude the emitted `.d.ts` files from the npm package so that the published contents do not change.
OrKoN
force-pushed
the
feat/isolated-declarations
branch
from
October 21, 2026 17:21
43b8fea to
191f5dd
Compare
OrKoN
approved these changes
Oct 21, 2026
yashdesai87
pushed a commit
to yashdesai87/chrome-devtools-mcp
that referenced
this pull request
Oct 21, 2026
Stacked on ChromeDevTools#3293. ChromeDevTools#1948 enabled source maps for local debugging and added `!*.js.map` to `files` in `package.json` to keep them out of the npm package. npm matches a negated `files` entry only at the package root, so the entry never matched the source maps in `build/src`, and the package has included them since then. This PR changes the entry to `!**/*.js.map`, the same form that ChromeDevTools#3293 uses for `.d.ts` files. The published maps were of little use: they do not embed `sourcesContent`, and the TypeScript sources that they reference are not in the package. ## User-visible changes - The npm package no longer includes `.js.map` files (100 files in a local `npm pack --dry-run`). - The published `.js` files still end with `//# sourceMappingURL=` comments, which now point to files that are not in the package. Tools that load source maps, such as debuggers, can warn that the map is missing. ## Testing - `npm pack --dry-run` lists no `.js.map` files and still lists the `.js` files. - `npm run format` - `npm run test`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #3290.
Enables
isolatedDeclarationsintsconfig.json. The option requiresdeclaration, so that is enabled too.isolatedDeclarationsrequires explicit types on exports, so the CLI option types are now declared instead of inferred from the Yargs option objects:BrowserArguments,PuppeteerArguments,ToolArguments,CategoryArgumentsandMcpArgumentsdeclare the parsed value of each option.ParsedArgumentsis now defined inmcp-options.tsfromMcpArgumentsinstead ofInferredOptionTypes<typeof mcpOptions>.McpOptionsFor<TArgs, TBase>derives the type of an option map from its arguments interface. It checks each option'stype,default,choicesandcoerceagainst the declared value type. A required argument must have adefault. An optional (?) argument has nodefault.ParsedArgumentsis imported frommcp-options.tseverywhere. The re-exports fromServerConfig.tsandConfigParser.tsare removed, and so is an unusedMcpOptionre-export.package.jsonexcludes the emitted.d.tsfiles from the npm package. npm matches a negatedfilesentry such as!*.d.tsonly at the package root, so the entry is!**/*.d.ts.User-visible changes
None. The option definitions, defaults and generated docs do not change (
npm run genproduces no diff).npm pack --dry-runlists no.d.tsfiles.Testing
npm run formatnpm run testnpm run gen(no changes)