Repository navigation
test(library): import LibraryType from the declarations that export it - #22093
alexander-akait wants to merge 1 commit into
Conversation
`LibraryType` is exported from `declarations/WebpackOptions`, not from the package root, so reading it off the root failed `lint:types-test` with TS2694 and took every branch off `main` with it.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe change updates one JSDoc import in the library script output configuration. It references ChangesLibrary script output configuration
Priority: ⬇️ Low Change: Other Merge Risk: ⚪ Minimal · up to This change only corrects a JSDoc type import and does not affect webpack behavior or emitted output. 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
Full details: Title checkExplanation The title uses the required Conventional Commit format and accurately describes the test change. The available context does not include the branch prefix, so the required type-prefix match cannot be verified. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This PR is packaged and the instant preview is available (3bc8388). Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@3bc8388
yarn add -D webpack@https://pkg.pr.new/webpack@3bc8388
pnpm add -D webpack@https://pkg.pr.new/webpack@3bc8388 |
Types CoverageCoverage after merging test/library-type-declaration-import into main will be
Coverage Report< |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22093 +/- ##
=======================================
Coverage 94.96% 94.96%
=======================================
Files 729 729
Lines 97509 97509
Branches 29696 29696
=======================================
+ Hits 92596 92600 +4
+ Misses 4913 4909 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
`LibraryType` is exported from `declarations/WebpackOptions.d.ts`, not re-exported from the package root, so `lint:types-test` fails on `main` with TS2694. Same one-line change as #22093, ported here to unblock this PR's `lint` rather than wait on that PR to land.
Generated code sizeComparing
No asset changed size. No runtime gained or lost a runtime module. Built |
Merging this PR will degrade performance by 20.79%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | benchmark "side-effects-reexport", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
171.5 KB | 902.7 KB | -81.01% |
| ⚡ | Memory | benchmark "no-exports-analysis", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
902.6 KB | 456.3 KB | +97.78% |
| ⚡ | Memory | benchmark "cache-filesystem", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
1.5 MB | 1.1 MB | +32.32% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing test/library-type-declaration-import (3bc8388) with main (2cf714f)2
Footnotes
-
6 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(5a41278) during the generation of this report, so 2cf714f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
* fix(parser): answer an absent export from the spec namespace
A static reference to a name the module does not export read and wrote the
exports object, so every name `Object.prototype` carries — `__proto__`,
`toString`, `constructor` — showed through where the spec reports undefined,
and a write quietly created a property instead of failing. Route those names
through the namespace, which answers both as the spec does.
Unskips `module-code/namespace/internals/{get-str-not-found,set}.js` and
`module-code/export-expname-binding-index.js`.
* test(library): import LibraryType from the declarations that export it
`LibraryType` is exported from `declarations/WebpackOptions.d.ts`, not
re-exported from the package root, so `lint:types-test` fails on `main`
with TS2694. Same one-line change as #22093, ported here to unblock this
PR's `lint` rather than wait on that PR to land.
Summary
lintis failing onmainin itslint:types-teststage, and every branch offmaininherits it:LibraryTypeis exported fromdeclarations/WebpackOptionsbut not re-exported from the package root, so reading it offimport("../../../../")does not resolve. Point the one JSDoc tag at the declarations instead, which is whattest/configCases/externals/side-effects-library-types/webpack.config.js:17already does for the same type. One line, no behaviour change.Introduced in #22088; noticed because it was the only thing left red on #22092.
What kind of change does this PR introduce?
test
Did you add tests for your changes?
n/a — it repairs the type annotation of an existing case,
configCases/library/script-type-keeps-script-output, which still passes (12 checks across the normal and persistent-cache suites). The check this fixes islint:types-testitself, which now passes locally where it failed before.Does this PR introduce a breaking change?
No — a JSDoc type reference in one test config; nothing webpack emits changes.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
AI was used. It read the failing
lintjob, established the error was onmainrather than in the branch it was working on, found the type's real export site and the existing convention for referencing it, made the change and confirmedlint:types-testpasses; I reviewed the result before opening this.Generated by Claude Code
Summary by CodeRabbit
expectScriptOutputparameter.