3.6 KiB
3.6 KiB
Tasks: enterprise-docs
Change ID: enterprise-docs
Package: @suaveplan/docs
Target path: packages/devtools/docs/docs
1. Scaffold
- Create
packages/devtools/docs/docs/per design layout. - Add
markdowncatalog key to rootpackage.jsoncarryingglob,gray-matter,remark-parse,remark-gfm,unified,unist-util-visit,@types/mdast. - Write
package.jsonat version0.1.0with subpath exports per feature. - Write
tsconfig.lib.json,vite.config.ts,vitest.config.ts,README.md.
2. Errors
- Implement
src/errors/errors.tswithDOCS_CODESregistry (eight codes) andDocsError extends SuaveplanError<DocsErrorCode>. - Write
src/errors/errors.test.tscovering registry shape, every code, and round-trip through cause chain.
3. Observability
- Implement
src/observability/observability.tsandobservability.types.tsexposingcreateDocsObservability. - Test against
@opentelemetry/apino-op providers.
4. Types
- Implement
src/types/docs.types.tscarryingDocFile,DocLink,DocCategory(eighteen-category union),DocGraph,DocNode,DiscoverOptions,SearchResult,DiscoverOptionsSchema.
5. Parser
- Implement
src/parser/parse.tsusing typed mdast traversal, noas any, timing instrumented via observability. - Write
src/parser/parse.test.tscovering title extraction, frontmatter, link extraction, GFM tables, ID stability, category derivation across all eighteen genesis categories, root tier, and PARSE_FAILED branch.
6. Discovery
- Implement
src/discovery/discover.ts: Zod-validate options,AbortSignalpropagation, per-file IO error counter, glob error wrap. - Write
src/discovery/discover.test.tscovering happy path, includeApps, ignore, sorting, abort, invalid options, IO error surfacing.
7. Graph
- Implement
src/graph/build-graph.tsandsrc/graph/find-orphans.ts. - Write tests covering link resolution, anchor + external link rejection, fragment handling, fuzzy basename match, self-link skip, orphan detection, and findOrphans suggestedParent.
8. Hierarchy
- Implement
src/hierarchy/build-hierarchy.tswith configurablemaxDepth. - Write tests covering nesting, category grouping, circular safety, sort
order, and
HIERARCHY_CYCLE_LIMIT(when maxDepth=0).
9. Search
- Implement
src/search/search.tswith timing + counter instrumentation andDOCS.SEARCH_INVALID_QUERYon non-string input. - Write tests covering scoring, snippets, limit, sort, case insensitivity.
10. Barrel + subpath exports
- Author
src/index.tswith explicit named re-exports — neverexport *. - Confirm
package.jsonexportsmap has one subpath per feature.
11. Docs
- Sibling
.mdfor every.ts(excl.index.ts,.test.ts,.types.ts). Each ≥200 words across six required sections. README.mdwith Purpose, Install, Quick Start, Modules.
12. Gate
bunx turbo lint typecheck test build --filter=@suaveplan/docsgreen.bunx turbo test:coverage --filter=@suaveplan/docsat 100/100/100/100.- Banned-pattern scan clean.
- Test-runner import scan clean.
- MANIFEST refreshed via
bun scripts/folder-reorg/generate-manifest.ts.
13. Archive
- Fold
specs/docs/spec.mdintoopenspec/specs/docs/spec.md. - Move change folder to
openspec/archive/2026-05-25-enterprise-docs/. - Flip STATUS.md row
–→✅with one-line summary; bump counts.