豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

chore: fix bundling for the CLI#1111

Merged
OrKoN merged 1 commit intomainfrom
orkon/extract-fixes
Mar 5, 2026
Merged

chore: fix bundling for the CLI#1111
OrKoN merged 1 commit intomainfrom
orkon/extract-fixes

Conversation

@OrKoN
Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN commented Mar 5, 2026

extracts non-launch related fixes from #1100

@OrKoN OrKoN requested a review from zyzyzyryxy March 5, 2026 08:17
@OrKoN OrKoN force-pushed the orkon/extract-fixes branch from dafd006 to 992eec4 Compare March 5, 2026 08:19
@OrKoN OrKoN enabled auto-merge March 5, 2026 08:21
@OrKoN OrKoN added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit 88da3b8 Mar 5, 2026
20 checks passed
@OrKoN OrKoN deleted the orkon/extract-fixes branch March 5, 2026 08:35
github-merge-queue bot pushed a commit that referenced this pull request Apr 1, 2026
…bundle (#1189)

## Summary

- Adds a custom ESLint rule `@local/no-direct-third-party-imports` that
flags value imports of bundled third-party packages
(`@modelcontextprotocol/sdk`, `puppeteer-core`, `@puppeteer/browsers`,
`yargs`, `debug`, `zod`, `core-js`) when used outside of
`src/third_party/`
- Type-only imports (`import type`) are allowed since they are erased at
compile time and don't affect the bundle
- The rule is scoped to `src/**/*.ts` so development scripts and tests
are unaffected

This prevents the class of bugs where a direct npm import works during
development (devDependencies installed) but breaks in the published
package (only bundled code ships). PR #1111 was an example of this exact
issue caught through manual `npm pack` testing.

Closes #1123

## Test plan

- [x] Verified `npx eslint --no-cache src/` passes with no violations on
the current codebase
- [x] Verified the rule correctly catches a test file with `import
{Client} from '@modelcontextprotocol/sdk/client/index.js'`
- [x] Verified the rule allows `import type {Flags} from 'lighthouse'`
(type-only import)
- [x] Verified the rule does not fire inside `src/third_party/index.ts`
(the barrel itself)
- [x] Verified scripts/ and tests/ are unaffected (rule scoped to
`src/**/*.ts`)

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants