Skip to content

Docs samples import from subpaths the packages do not export, and nothing checks them #1301

Description

@borisno2

The problem

docs/content/reference/context-api.md imports getContext from @opensaas/stack-core/context in four places. That subpath is not exported by the package at all, so every one of those samples fails to resolve for a reader who copies it.

Found by a mechanical sweep while fixing the same class of error in the RAG docs on PR #1293. Two more instances there — import { sudo } from '@opensaas/stack-core/context' — were fixed on that PR because they sat inside blocks it had rewritten. These four are pre-existing and in a non-RAG file, so they were left alone rather than widening that diff.

Worth confirming while fixing: sudo is reached as context.sudo() returning a sudo context, not as a free function taking a promise. If context-api.md documents it the other way, that is wrong too.

What to do

Point the samples at the path that genuinely exports getContext, and check the rest of the file's imports the same way.

Worth doing at the same time

Nothing catches this class of error. Markdown is not typechecked, and the docs link-check only validates internal links, so a documentation sample importing from a non-existent subpath builds green and ships. The sweep that found these was a throwaway script parsing every @opensaas/… import in the changed files against the built export surfaces.

That script, made permanent and run over all of docs/content/, would close the gap for good. It is closely related to #1278, which records the same shape of hole for pnpm generate.

Context


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions