Install typedoc just-in-time for API docs (end Dependabot churn, keep the docs)#7723
Open
amcaplan wants to merge 2 commits into
Open
Install typedoc just-in-time for API docs (end Dependabot churn, keep the docs)#7723amcaplan wants to merge 2 commits into
amcaplan wants to merge 2 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
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>
Contributor
There was a problem hiding this comment.
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
typedocduring the deploy job before generating the API docs. - Removed the unused
open-api-docstarget and added a discoverable link to the published API reference indocs/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 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==} | ||
|
|
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.
What & why
typedocis a doc-only devDependency in@shopify/cli-kitthat 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:
docs/apiis gitignored and never committed; the "Build TSDoc docs" step inpages.ymlregenerates it on every deploy.pages.ymlfires on pushes todocs/**andpackages/cli-kit/package.json(e.g. every release's changeset version bump); recent runs are all green.shopifyFetchandisDevelopmentare 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:
cli-kit/package.jsonorpnpm-lock.yaml→ Dependabot can't see it → no more churn, which was the original goal.pnpm --filter @shopify/cli-kit add --save-dev typedocright 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
open-api-docstarget (the local "build + open in browser" convenience) and itsopenknip entry — nothing invokes it, and it only ever worked with typedoc installed locally.docs/README.mdso 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)
pnpm --filter @shopify/cli-kit add --save-dev typedoc && pnpm build-api-docs— with both pinned0.28.17and unpinned (resolves0.28.19): docs generate successfully (795 files incl.index.html) against the repo's TypeScript5.9.3; the programmatic typedoc API is intact.pnpm knip→ exit 0 (typedoc added to cli-kitignoreDependencies, since the script uses it but it's deliberately not a listed dependency).Trade-off
Local
pnpm build-api-docsnow requires a one-timepnpm --filter @shopify/cli-kit add --save-dev typedocfirst (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.