Skip to content

feat: add governance docs fetcher under pages/contribute/governance#127

Open
ryzrr wants to merge 2 commits into
mainfrom
feat/governance-docs
Open

feat: add governance docs fetcher under pages/contribute/governance#127
ryzrr wants to merge 2 commits into
mainfrom
feat/governance-docs

Conversation

@ryzrr

@ryzrr ryzrr commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary
Adds a script scripts/markdown/governance.mjs that fetches the webpack governance repository's markdown files.

What kind of change does this PR introduce?
Automated governance docs fetching.

Did you add tests for your changes?
No

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?
None

Use of AI
For Regex logic and lookaheads

Copilot AI review requested due to automatic review settings June 9, 2026 18:05
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webpack-doc-kit Ready Ready Preview, Comment Jun 10, 2026 2:15pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an automated markdown fetch step to pull webpack/governance documents into this site under /contribute/governance, and wires the generated sidebar into the global site sidebar.

Changes:

  • Added scripts/markdown/governance.mjs to fetch specific governance markdown files, rewrite cross-links, and generate a site.json sidebar for the section.
  • Updated pages/site.mjs to include the governance sidebar.
  • Updated package.json to run the new governance fetcher as part of build:md, and updated .gitignore to ignore the generated governance pages directory.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
scripts/markdown/governance.mjs New fetcher script for governance markdown, link rewriting, and sidebar generation.
pages/site.mjs Includes the generated governance sidebar into the overall sidebar export.
package.json Adds build:md:governance and includes it in build:md.
.gitignore Ignores generated pages/contribute/governance output.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +4 to +8
const { GH_TOKEN } = process.env;

const BASE_HEADERS = {
...(GH_TOKEN && { Authorization: `Bearer ${GH_TOKEN}` }),
};
Comment thread scripts/markdown/governance.mjs
Comment on lines +10 to +12
// Maps source filenames in webpack/governance repo to their output slug and sidebar label.
// Insertion order determines sidebar order, this could be changed as per need.
const FILE_MAP = {
Comment thread pages/site.mjs
Comment on lines 2 to 5
import loaders from './loaders/site.json' with { type: 'json' };
import plugins from './plugins/site.json' with { type: 'json' };
import contribute from './contribute/governance/site.json' with { type: 'json' };

Comment thread scripts/markdown/governance.mjs Outdated
Copilot AI review requested due to automatic review settings June 9, 2026 20:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +27 to +33
// Derived from FILE_MAP - stays in sync automatically if entries are added/removed.
const LINK_REWRITE_MAP = Object.fromEntries(
Object.entries(FILE_MAP).map(([source, { output }]) => [
source,
`/contribute/governance/${output}`,
])
);
Comment thread scripts/markdown/governance.mjs
Comment thread .gitignore
/pages/loaders
/pages/plugins
/generated
/pages/contribute/governance

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/pages/contribute/governance
/pages/about/governance

What do we think about this subdirectory?

Comment thread pages/site.mjs
groupName: 'Loaders & Plugins',
items: [...loaders.sidebar, ...plugins.sidebar],
},
...contribute.sidebar,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

maybe put this under a groupName of About

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