Skip to content

Install typedoc just-in-time for API docs (end Dependabot churn, keep the docs)#7723

Open
amcaplan wants to merge 2 commits into
mainfrom
remove-dep/typedoc
Open

Install typedoc just-in-time for API docs (end Dependabot churn, keep the docs)#7723
amcaplan wants to merge 2 commits into
mainfrom
remove-dep/typedoc

Conversation

@amcaplan
Copy link
Copy Markdown
Contributor

@amcaplan amcaplan commented Jun 5, 2026

What & why

typedoc is a doc-only devDependency in @shopify/cli-kit that drives recurring Dependabot churn — 35 version bumps over the last 24 months. Its only consumer is the cli-kit API-docs generator (packages/cli-kit/scripts/build-api-docs.js).

An earlier version of this PR removed typedoc and the API-docs generation, on the assumption the generated docs were unused. That was incorrect. The cli-kit API reference at https://shopify.github.io/cli/api/cli-kit/ is:

  • Generated at GitHub Pages deploy timedocs/api is gitignored and never committed; the "Build TSDoc docs" step in pages.yml regenerates it on every deploy.
  • Continuously redeployedpages.yml fires on pushes to docs/** and packages/cli-kit/package.json (e.g. every release's changeset version bump); recent runs are all green.
  • Live and search-indexed — deep pages such as shopifyFetch and isDevelopment are crawlable. Dropping generation would have silently 404'd them on the next Pages run.

The fix

Keep the API-docs pipeline, but take typedoc out of tracked dependencies and install it just-in-time in the Pages job:

  • typedoc is no longer in cli-kit/package.json or pnpm-lock.yamlDependabot can't see it → no more churn, which was the original goal.
  • The Pages job runs pnpm --filter @shopify/cli-kit add --save-dev typedoc right before building the docs. Left unpinned so docs track the latest typedoc and stay compatible with the repo's TypeScript automatically. Nothing it installs is committed.

Also in this PR

  • Dropped the open-api-docs target (the local "build + open in browser" convenience) and its open knip entry — nothing invokes it, and it only ever worked with typedoc installed locally.
  • Linked the API reference from docs/README.md so it's discoverable from the docs site rather than orphaned (previously reachable only by direct URL — it isn't linked from anywhere in the repo).

Validation (local, on this branch)

  • Ran the exact Pages sequence — pnpm --filter @shopify/cli-kit add --save-dev typedoc && pnpm build-api-docs — with both pinned 0.28.17 and unpinned (resolves 0.28.19): docs generate successfully (795 files incl. index.html) against the repo's TypeScript 5.9.3; the programmatic typedoc API is intact.
  • pnpm knip → exit 0 (typedoc added to cli-kit ignoreDependencies, since the script uses it but it's deliberately not a listed dependency).

Trade-off

Local pnpm build-api-docs now requires a one-time pnpm --filter @shopify/cli-kit add --save-dev typedoc first (CI does this automatically). Accepted, since it removes the dependency from Dependabot's view while keeping the docs.

Changeset

None — devDependency/CI/docs-only, invisible to consumers of the published package.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Jun 5, 2026
@amcaplan amcaplan added dependency-removal Removes a dependency to cut Dependabot churn (cleanup initiative) claudeception Pull request created by Claudeception agents labels Jun 5, 2026
The previous commit removed typedoc and the API-docs generation on the
assumption the generated docs were unused. They are not: the cli-kit API
reference at https://shopify.github.io/cli/api/cli-kit/ is generated at
GitHub Pages deploy time (docs/api is gitignored, never committed) and
redeployed on every push to docs/** and cli-kit/package.json. Removing the
"Build TSDoc docs" step would have silently 404'd a live, search-indexed
artifact on the next Pages run.

Instead of dropping the docs, take typedoc out of cli-kit's tracked
devDependencies (the source of Dependabot churn) and install it just-in-time
in the Pages job. It's committed nowhere, so Dependabot can't see it, and it's
left unpinned so docs track the latest typedoc and stay compatible with the
repo's TypeScript automatically.

Also:
- Restore build-api-docs (script, nx target, package scripts, knip entry).
- Drop the open-api-docs convenience target: nothing invokes it and it only
  worked with typedoc installed locally.
- Link the API reference from docs/README.md so it's no longer orphaned from
  the docs site navigation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amcaplan amcaplan changed the title Remove typedoc from cli-kit (drop unused API-docs generation) Install typedoc just-in-time for API docs (end Dependabot churn, keep the docs) Jun 7, 2026
@amcaplan amcaplan marked this pull request as ready for review June 7, 2026 14:50
@amcaplan amcaplan requested a review from a team as a code owner June 7, 2026 14:50
Copilot AI review requested due to automatic review settings June 7, 2026 14:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes typedoc from tracked @shopify/cli-kit devDependencies to avoid recurring Dependabot churn, while preserving the generated cli-kit API reference by installing typedoc just-in-time during the GitHub Pages deployment workflow.

Changes:

  • Removed typedoc (and its lockfile entries) from the repo’s tracked dependencies for @shopify/cli-kit.
  • Updated the Pages workflow to install typedoc during the deploy job before generating the API docs.
  • Removed the unused open-api-docs target and added a discoverable link to the published API reference in docs/README.md.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pnpm-lock.yaml Drops typedoc and updates lockfile content accordingly (currently includes broad structural churn).
packages/cli-kit/project.json Removes the open-api-docs Nx target.
packages/cli-kit/package.json Removes the open-api-docs script and the typedoc devDependency.
package.json Updates Knip config to ignore typedoc for cli-kit since it’s intentionally untracked.
docs/README.md Adds a link to the published cli-kit API reference.
.github/workflows/pages.yml Installs typedoc during Pages build before running build-api-docs.

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

Comment on lines +41 to +47
# typedoc is needed only to generate the cli-kit API docs published to
# GitHub Pages. It's installed here just-in-time rather than tracked as a
# cli-kit devDependency so it doesn't generate Dependabot churn. Left
# unpinned so docs track the latest typedoc (and stay compatible with the
# repo's TypeScript) automatically; nothing here is committed.
- name: Install typedoc (docs generation only)
run: pnpm --filter @shopify/cli-kit add --save-dev typedoc
Comment thread pnpm-lock.yaml
Comment on lines 801 to 803
'@acemir/cssom@0.9.31':
resolution: {integrity: sha512-ZnR3GSaH+/vJ0YlHau21FjfLYjMpYVIzTD8M8vIEQvIGxeOXyXdzCI140rrCY862p/C/BbzWsjc1dgnM9mkoTA==, tarball: https://registry.npmjs.org/@acemir/cssom/-/cssom-0.9.31.tgz}
resolution: {integrity: sha512-ZnR3GSaH+/vJ0YlHau21FjfLYjMpYVIzTD8M8vIEQvIGxeOXyXdzCI140rrCY862p/C/BbzWsjc1dgnM9mkoTA==}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudeception Pull request created by Claudeception agents dependency-removal Removes a dependency to cut Dependabot churn (cleanup initiative) no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants