Repository navigation
Conversation
…g types (AI-assisted) The dogfooding sidebars imported them from the lib/sidebars/types deep import. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…log, live-codeblock and mermaid packages (AI-assisted) They were added for Jest 28, which the repository no longer uses. They made every file of these packages a public entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…AI-assisted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isted) validateAuthorsMap() was an exact copy of validateAuthorsMapInput(), and only tests used it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction entry (AI-assisted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…assisted) Knip reports them now that the lib/* and src/* wildcard exports don't make every file a public entry point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (AI-assisted) plugin-content-docs.d.ts re-exports them with import() types in a "declare module" block, which Knip doesn't follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (AI-assisted)" This reverts commit c97f125. The validateAuthorsMap() removal has its own PR. (AI-assisted) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 17
✨ Finishing Touches
Comment |
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 12.1 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
Collaborator
Author
|
not doing this for now |
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.
Breaking Changes
The
@docusaurus/plugin-content-docs,@docusaurus/plugin-content-blog,@docusaurus/theme-live-codeblockand@docusaurus/theme-mermaidpackages no longer expose theirlib/*andsrc/*files in theirpackage.jsonexportsfield. Deep imports like@docusaurus/plugin-content-docs/lib/sidebars/typesfail to resolve.How to upgrade: import from the public entry points instead:
@docusaurus/plugin-content-docs,@docusaurus/plugin-content-docs/client,@docusaurus/plugin-content-docs/server@docusaurus/plugin-content-blog,@docusaurus/plugin-content-blog/client@docusaurus/theme-live-codeblock,@docusaurus/theme-live-codeblock/client@docusaurus/theme-mermaid,@docusaurus/theme-mermaid/clientFor example, the sidebar types are now exported by the main entry point:
If you need something that only a deep import provides, please open an issue so that we can consider exposing it as public API.
Motivation
The wildcard exports were added for Jest 28 in #7243: its
moduleNameMapperresolved@docusaurus/plugin-content-docs/clientto@docusaurus/plugin-content-docs/src/client/index.ts, and Jest 28 started enforcing theexportsfield. Then #7962 exposedlib/*so that sites could use internal docs plugin utilities (#7961), and the other packages copied this pattern. We now use Vitest, which aliases these modules to absolute file paths, and these wildcards make every file of these packages a public entry point. Internals that we can't change without breaking sites shouldn't be public API.They were also the biggest blind spot of the Knip dead code checks: Knip never reports the unused exports of entry points, so it ignored all the exports of these 4 packages. Once the wildcards are gone, Knip finds:
pnpm lint:knipsrc/markdownLoader.tswebpack loader as an unused file: it is resolved withpath.resolve(__dirname, ...), so it is now a production entry inknip.config.ts.exportkeywords only used in their own file: docs pluginsidebars/{index,normalization,types,utils}.ts,versions/version.ts,routes.ts,client/docsUtils.tsx, andSchemain the live-codeblock and mermaidvalidateThemeConfig.ts. Removed.CategoryMetadataFilenameBaseconstant, fully unused. Removed.Prop*types of the docssidebars/types.ts: false positives. They are public API, re-exported byplugin-content-docs.d.tsthroughimport()types in adeclare moduleblock, which Knip doesn't follow. They are now tagged/** @public */, which Knip never reports.pnpm lint:knip:productionvalidateAuthorsMap(), an exact copy ofvalidateAuthorsMapInput()only used by tests. It is removed in refactor(blog): remove test-onlyvalidateAuthorsMap()duplicate (AI-assisted) #12770.This PR depends on #12770: until it is merged,
pnpm lint:knip:productionfails onvalidateAuthorsMap, and only on it.The only deep import in the repository was in the JSDoc of
website/_dogfooding/docs-tests-sidebars.js. The docs plugin now exports theSidebarItemConfigandSidebarItemCategoryConfigtypes it needed.Each kind of change has its own commit.
Test Plan
pnpm build:packages,pnpm test,pnpm typecheck:tests,pnpm --filter website typecheckpnpm lint:knip,pnpm lint:knip:production(onlyvalidateAuthorsMapfails, see refactor(blog): remove test-onlyvalidateAuthorsMap()duplicate (AI-assisted) #12770)The website
tscdoesn't check JS files, so I checked the dogfood sidebars withcheckJs: the former deep import now fails withTS2307, and the new public types resolve.Test links
Deploy preview: https://deploy-preview-12772--docusaurus-2.netlify.app/
Related issues/PRs
validateAuthorsMap()duplicate (AI-assisted) #12770: removesvalidateAuthorsMap(), required forpnpm lint:knip:production(AI-assisted)
🤖 Generated with Claude Code