Skip to content

chore: update doc-kit - #237

Merged
avivkeller merged 3 commits into
mainfrom
update
Aug 11, 2026
Merged

chore: update doc-kit#237
avivkeller merged 3 commits into
mainfrom
update

Conversation

@avivkeller

@avivkeller avivkeller commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Author and sponsor avatars now display consistently across rendering environments.
  • Refactor
    • Updated documentation generation and HTML bundling to use the latest tooling.
    • Simplified styling integration with Vite and Tailwind CSS.
    • Updated component and metadata integrations for improved compatibility.
  • Documentation
    • Updated contribution and pipeline documentation to reflect the current documentation tooling.

@vercel

vercel Bot commented Aug 10, 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 Aug 10, 2026 3:05pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change migrates the project from @node-core/doc-kit to the @doc-kit packages. HTML generation now uses the doc-kit CLI, Vite, and the Tailwind Vite plugin. Component imports and metadata types use the new package paths. Author and sponsor content renders without CLIENT guards. ESLint no longer declares custom SERVER and CLIENT globals.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: updating the doc-kit tooling and package references.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file theme blog tooling labels Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

⚡ Lighthouse report

Audited the Vercel preview deployment: https://webpack-doc-61tzsrls1-openjs.vercel.app

URL Performance Accessibility Best Practices SEO Report
/ 🟢 99 🟢 96 🟢 100 🟢 100 🔗
/about 🟢 100 🟢 97 🟢 100 🟢 100 🔗
/about/sponsors 🟠 86 🟢 95 🟢 96 🟢 100 🔗
/blog 🟢 100 🟢 96 🟢 100 🟢 100 🔗
/blog/posts/2026-02-04-roadmap-2026 🟢 100 🟢 93 🟢 100 🟢 100 🔗
/guides/getting-started 🟢 100 🟢 93 🟢 100 🟢 100 🔗
/docs/api/options 🟢 99 🟢 96 🟢 100 🟢 100 n/a
/docs/loaders/css-loader 🟢 100 🟢 97 🟢 100 🟠 83 🔗

Scores are advisory (warn at 90); they do not fail the build. See .lighthouserc.json.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f34f94a3-6af1-43de-826b-d1c4c0fb208a

📥 Commits

Reviewing files that changed from the base of the PR and between 3791e53 and c418edd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (15)
  • CONTRIBUTING.md
  • README.md
  • components/Blog/Byline/index.jsx
  • components/Layout.jsx
  • components/MetaBar/index.jsx
  • components/NavBar.jsx
  • components/Sponsors/BackerWall/index.jsx
  • components/Sponsors/Card/index.jsx
  • eslint.config.mjs
  • layouts/Post/index.jsx
  • package.json
  • plugins/processor/router.mjs
  • scripts/html/doc-kit.config.mjs
  • scripts/html/index.mjs
  • scripts/html/tailwind.mjs
💤 Files with no reviewable changes (1)
  • scripts/html/tailwind.mjs

Comment on lines +32 to +38
.map(backer => (
<Avatar
image={backer.imageUrl}
name={backer.name}
nickname={backer.slug}
fallback={initialsOf(backer.name)}
url={`${OC_BASE}/${backer.slug}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu

file="$(git ls-files | grep -F 'components/Sponsors/BackerWall/index.jsx' | head -n 1)"
printf '%s\n' "FILE=$file"
ast-grep outline "$file" || true
printf '%s\n' '--- relevant source ---'
cat -n "$file" | sed -n '1,100p'
printf '%s\n' '--- related list and Avatar usage ---'
rg -n -C 3 'BackerWall|Avatar|shuffle|sort\\(|\\.map\\(' components package.json yarn.lock package-lock.json pnpm-lock.yaml 2>/dev/null | head -n 240 || true

Repository: webpack/webpack-doc-kit

Length of output: 2292


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- manifests and React versions ---'
rg -n -C 2 '"react"|"react-dom"|`@node-core/ui-components`|doc-kit|generator-react' \
  package.json packages components .github 2>/dev/null | head -n 240 || true

printf '%s\n' '--- Avatar implementation and imports ---'
rg -l --hidden --glob '!node_modules' --glob '!dist' --glob '!build' \
  'Common/AvatarGroup/Avatar|function Avatar|const Avatar|export default.*Avatar' . \
  | head -n 80
rg -n -C 5 'Common/AvatarGroup/Avatar|<Avatar([ >]|$)' \
  --glob '*.js' --glob '*.jsx' --glob '*.ts' --glob '*.tsx' . \
  | head -n 300 || true

printf '%s\n' '--- BackerWall callers and backer identity fields ---'
rg -n -C 5 'BackerWall|backers|backer\\.slug|slug:' \
  --glob '*.js' --glob '*.jsx' --glob '*.ts' --glob '*.tsx' . \
  | head -n 320 || true

Repository: webpack/webpack-doc-kit

Length of output: 20940


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- package metadata and lockfile entries ---'
cat -n package.json | sed -n '1,80p'
for lock in yarn.lock package-lock.json pnpm-lock.yaml; do
  if [ -f "$lock" ]; then
    printf '%s\n' "--- $lock ---"
    rg -n -C 3 '`@doc-kit/generator-react`|react@|react-dom@|\"react\"' "$lock" | head -n 180 || true
  fi
done

printf '%s\n' '--- sponsor hook and data sources ---'
hook="$(git ls-files | grep -E '(^|/)useSponsors\\.mjs$' | head -n 1 || true)"
printf '%s\n' "HOOK=$hook"
if [ -n "$hook" ]; then
  ast-grep outline "$hook" || true
  cat -n "$hook" | sed -n '1,220p'
fi
rg -n -C 4 'imageUrl|allTime|slug|contributors|Open Collective|backers' \
  --glob '*.mjs' --glob '*.js' --glob '*.jsx' --glob '*.json' \
  . | head -n 360 || true

printf '%s\n' '--- renderer and hydration configuration ---'
rg -n -C 4 'hydrateRoot|hydrate\\(|renderTo|SSR|server|client|hydration|static|prerender' \
  --glob '*.mjs' --glob '*.js' --glob '*.jsx' --glob '*.ts' --glob '*.tsx' \
  . | head -n 320 || true

Repository: webpack/webpack-doc-kit

Length of output: 30829


🏁 Script executed:

#!/bin/bash
set -eu

printf '%s\n' '--- sponsor hook ---'
cat -n hooks/useSponsors.mjs | sed -n '1,140p'

printf '%s\n' '--- sponsor aggregation ---'
cat -n api/sponsors.mjs | sed -n '95,165p'

printf '%s\n' '--- render and hydration APIs ---'
rg -n -C 4 'hydrateRoot|hydrate|renderTo|createRoot|ReactDOM|clientEntry|serverEntry|entrypoint|is-land' \
  --glob '*.mjs' --glob '*.js' --glob '*.jsx' --glob '*.ts' --glob '*.tsx' \
  . 2>/dev/null | head -n 360 || true

printf '%s\n' '--- generator configuration and build scripts ---'
rg -n -C 5 'generator-react|build:html|static|ssg|island|hydrate|client' \
  --glob '*.json' --glob '*.mjs' --glob '*.js' --glob '*.jsx' \
  . 2>/dev/null | head -n 360 || true

Repository: webpack/webpack-doc-kit

Length of output: 15429


🏁 Script executed:

#!/bin/bash
set -eu

python3 - <<'PY'
from pathlib import Path
import re

wall = Path("components/Sponsors/BackerWall/index.jsx").read_text()
api = Path("api/sponsors.mjs").read_text()
hook = Path("hooks/useSponsors.mjs").read_text()

checks = {
    "avatar list lacks key": not re.search(r"<Avatar\b[^>]*\bkey\s*=", wall, re.S),
    "avatar list is shuffled before map": bool(
        re.search(r"shuffle\(backers\).*?\.map\(backer\s*=>", wall, re.S)
    ),
    "backer aggregation keys by slug": "const bySlug = new Map()" in api
    and "bySlug.get(account.slug)" in api
    and "bySlug.set(account.slug, existing)" in api,
    "backer output carries slug": bool(
        re.search(r"backers\.push\(\{.*?\bslug:\s*entry\.slug", api, re.S)
    ),
    "sponsor data starts empty and loads in effect": "useState(EMPTY_DATA)" in hook
    and "useEffect(() =>" in hook
    and "setData(value)" in hook,
}

for name, passed in checks.items():
    print(f"{'PASS' if passed else 'FAIL'}: {name}")

assert all(checks.values())
PY

Repository: webpack/webpack-doc-kit

Length of output: 353


Add key={backer.slug} to each Avatar.

The list is shuffled before rendering. Without a stable key, React tracks avatars by position when the order changes.

🧰 Tools
🪛 ast-grep (0.45.0)

[warning] 32-38: A list component should have a key to prevent re-rendering
Context: <Avatar
image={backer.imageUrl}
name={backer.name}
nickname={backer.slug}
fallback={initialsOf(backer.name)}
url={${OC_BASE}/${backer.slug}}
/>
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(list-component-needs-key)

Source: Linters/SAST tools

@@ -1,4 +1,4 @@
import createNodeSlugger from '@node-core/doc-kit/src/generators/metadata/utils/slugger.mjs';
import createNodeSlugger from '@doc-kit/core/src/generators/metadata/utils/slugger.mjs';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

jq '.dependencies | {
  core: ."`@doc-kit/core`",
  cli: ."`@doc-kit/cli`",
  generatorReact: ."`@doc-kit/generator-react`"
}' package.json

fd -HI 'package-lock.json|npm-shrinkwrap.json' . -d 2 -x \
  jq -r '.packages["node_modules/@doc-kit/core"].version // empty' {}

Repository: webpack/webpack-doc-kit

Length of output: 235


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- manifest ---'
cat package.json

printf '%s\n' '--- lockfile locations ---'
fd -HI 'package-lock.json|npm-shrinkwrap.json|yarn.lock|pnpm-lock.yaml' . -d 3

printf '%s\n' '--- core lock entries ---'
for f in $(fd -HI 'package-lock.json|npm-shrinkwrap.json' . -d 3); do
  echo "FILE: $f"
  jq -r '
    .packages
    | to_entries[]
    | select(.key | test("(^|/)node_modules/@doc-kit/core($|/)"))
    | [.key, .value.version, (.value.resolved // ""), (.value.dependencies // {})]
    | `@json`
  ' "$f" 2>/dev/null || true
done

printf '%s\n' '--- package references and import usage ---'
rg -n --hidden -g '!node_modules' '`@doc-kit/core`|slugger\.mjs|doc-kit' .

printf '%s\n' '--- repository files that describe the package ---'
fd -HI . | rg '(^|/)(package\.json|.*slugger.*|.*core.*)$' | head -200

Repository: webpack/webpack-doc-kit

Length of output: 18931


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '--- installed core metadata ---'
cat node_modules/@doc-kit/core/package.json

printf '%s\n' '--- slugger files ---'
fd -HI 'slugger(\.mjs)?$' node_modules/@doc-kit/core -d 8 -x sh -c 'echo "FILE: $1"; cat -n "$1"' sh

printf '%s\n' '--- relevant lockfile package metadata ---'
jq '.packages["node_modules/@doc-kit/cli"], .packages["node_modules/@doc-kit/generator-react"], .packages["node_modules/@doc-kit/core"]' package-lock.json

printf '%s\n' '--- npm package layout and exports ---'
python3 - <<'PY'
import json
from pathlib import Path

p = Path("node_modules/@doc-kit/core")
meta = json.loads((p / "package.json").read_text())
print("package:", meta.get("name"))
print("version:", meta.get("version"))
print("exports:", meta.get("exports"))
print("files:", meta.get("files"))
target = p / "src/generators/metadata/utils/slugger.mjs"
print("target_exists:", target.is_file())
PY

Repository: webpack/webpack-doc-kit

Length of output: 265


🏁 Script executed:

#!/bin/bash
set -euo pipefail

python3 - <<'PY'
import json
import tarfile
import tempfile
import urllib.request
from pathlib import Path

url = "https://registry.npmjs.org/@doc-kit%2fcore/1.0.0"
with urllib.request.urlopen(url) as response:
    metadata = json.load(response)

dist = metadata["dist"]
print("name:", metadata["name"])
print("version:", metadata["version"])
print("tarball:", dist["tarball"])
print("integrity:", dist.get("integrity"))

with tempfile.TemporaryDirectory() as tmp:
    archive = Path(tmp) / "core.tgz"
    urllib.request.urlretrieve(dist["tarball"], archive)
    with tarfile.open(archive, "r:gz") as tf:
        names = tf.getnames()
        target = "package/src/generators/metadata/utils/slugger.mjs"
        print("target_in_tarball:", target in names)
        print("matching_slugger_paths:")
        for name in names:
            if "slugger" in name:
                print(name)
        package_json = json.loads(tf.extractfile("package/package.json").read())
        print("package_exports:", package_json.get("exports"))
        print("package_files:", package_json.get("files"))
PY

Repository: webpack/webpack-doc-kit

Length of output: 2447


🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT

curl -fsSLk 'https://registry.npmjs.org/@doc-kit%2fcore/1.0.0' -o "$tmp/metadata.json"
python3 - "$tmp/metadata.json" <<'PY'
import json
import sys
from pathlib import Path

metadata = json.loads(Path(sys.argv[1]).read_text())
print("name:", metadata["name"])
print("version:", metadata["version"])
print("tarball:", metadata["dist"]["tarball"])
print("integrity:", metadata["dist"].get("integrity"))
PY

tarball=$(python3 - "$tmp/metadata.json" <<'PY'
import json
import sys
from pathlib import Path
print(json.loads(Path(sys.argv[1]).read_text())["dist"]["tarball"])
PY
)
curl -fsSLk "$tarball" -o "$tmp/core.tgz"

tar -tzf "$tmp/core.tgz" | grep -E '(^|/)slugger(\.mjs)?$|(^|/)package\.json$' || true
tar -xOf "$tmp/core.tgz" package/package.json | jq '{name, version, exports, files}'

Repository: webpack/webpack-doc-kit

Length of output: 1051


Add @doc-kit/core as a direct dependency.

The router imports @doc-kit/core directly, but package.json declares it only transitively. Add "@doc-kit/core": "^1.0.0" to dependencies. Version 1.0.0 includes and exports the imported source path.

@avivkeller
avivkeller merged commit d98b6a9 into main Aug 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation theme tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant