Skip to content

plugin-auth/examples/basic-usage.ts imports @objectstack/plugin-hono-server, which the package declares in no dependency block #10869

Description

@os-zhuang

Surfaced by the #10756 census (the source-coverage blind spot), not repaired there: the
repair is a manifest change (or an example rewrite), which is a different surface from
that card's gate work.

The measurement

packages/plugins/plugin-auth/examples/basic-usage.ts line 12:

import{HonoServerPlugin}from'@objectstack/plugin-hono-server';

Compiled against the package's own config with the dependency closure built, on main @
5886ee6d22:

packages/plugins/plugin-auth/examples/basic-usage.ts(12,34): error TS2307: Cannot find
module '@objectstack/plugin-hono-server' or its corresponding type declarations.

packages/plugins/plugin-auth/package.json declares @objectstack/plugin-hono-server in
none of dependencies, devDependencies or peerDependencies. (It does declare
hono itself, which is a different package.) So the import cannot resolve, and the
example as written cannot run or compile for anybody who copies it.

Why nothing caught it

packages/plugins/plugin-auth/tsconfig.json selects include: ["src/**/*"], so
examples/ is in no tsc program the package's typecheck script runs — the exact
blind spot #10756 measures. Nothing else reads the directory either: it is not a test,
tsup builds only src, and no file imports it. It is the census's single instance of
source that is in no tsc program at all rather than merely outside its package's own.

The two repairs, both defensible

  1. Add the dependency (devDependencies, workspace:*) so the example compiles.
    Right if the example is meant to be a working reference for the hono pairing.
  2. Rewrite or delete the example. Right if it is stale — it is the only file in the
    directory and nothing references it.

Not choosing here. Whichever is taken, packages/plugins/plugin-auth/examples is an
entry in UNCHECKED_SOURCE_DEBT (scripts/check-type-check-coverage.mjs), and putting
the directory in a tsc program means deleting that entry — which RECONCILED forces.

Dedupe

search_issues for the import, the example path, and the missing-dependency shape
returns nothing.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions