Skip to content

feat(theme): add doc-kit.config.mjs with webpack theming#18

Open
shivxmsharma wants to merge 3 commits intowebpack:mainfrom
shivxmsharma:feat/theming
Open

feat(theme): add doc-kit.config.mjs with webpack theming#18
shivxmsharma wants to merge 3 commits intowebpack:mainfrom
shivxmsharma:feat/theming

Conversation

@shivxmsharma
Copy link
Contributor

Summary

Adds a doc-kit.config.mjs configuration file to wire up webpack's branding and project-specific settings into the doc-kit web generator. Also adds a WebpackLogo component used by the NavBar.

Three files are added/changed:

  • doc-kit.config.mjs (new) — sets global.repository to webpack/webpack (drives the GitHub icon link in the navbar), web.title to webpack (page title), and remaps the #config/Logo bundle alias to the new webpack logo component instead of the default Node.js logo.

  • plugins/theme/ui/WebpackLogo.jsx (new) — a Preact component that renders the official webpack cube SVG (sourced from webpack/media) using the brand colors #8ed6fb and #1c78c0. Accepts and forwards props so the NavBar can pass className, width, etc.

  • package.json (modified) — adds --config-file ./doc-kit.config.mjs to the build-html script so doc-kit loads the config on every build.

Note: Local testing of npm run build-html requires Node.js v22+ due to findPackageJSON usage inside @node-core/doc-kit. The build was not tested locally (running Node v20) but the config structure follows the doc-kit configuration API and will be validated by CI.


What kind of change does this PR introduce?

feat


Did you add tests for your changes?

No. This is a configuration and branding change with no testable logic. Correctness is verified by the build-html CI step.


Does this PR introduce a breaking change?

No.


If relevant, what needs to be documented once your changes are merged or what have you already documented?

No documentation changes needed.


Use of AI

I used Claude to assist with drafting parts of the implementation. All code was reviewed and understood before committing. I have read the AI policy at https://github.com/webpack/governance/blob/main/AI_POLICY.md.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid tasks like theming, naming, branding and etc, they will be fully rewritten after we finished the main goal - automatic doc generation

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, this isn't part of the typedoc theme, rather, it's part of doc-kit.

For better organization, let's make a new root folder, say ui/ (or whatever name you want)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — moved WebpackLogo.jsx to a new root-level ui/ folder and updated the path in doc-kit.config.mjs accordingly.

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.

3 participants