Skip to content

T-AZKG-harden-vendored-augmented-ts-packages

Status: closed/done · Impact: medium · Complexity: small

The augmented_books adoption (T-LVLY, merged #911) vendored packages into packages/ts/, and the consuming Nuxt apps (T-6C0Z, T-KTGF) surfaced four packaging gaps in those vendored packages. Close all four so the packages build cleanly through moon and don’t dirty consumer worktrees.

LocationRole today
packages/ts/*/moon.ymlVendored packages have test/check tasks but no build task, so moon run <consumer>:build can’t build the dependency subgraph (^:build)
.gitignoreNo ignore for packages/ts/*/dist/; building a package leaves untracked artifacts that dirty the worktree
packages/ts/render/src/wikilinks/plugin.tsLine 87 has a real TS2322 (string assigned to hast’s Properties.className, typed string[]); tsc emits dist anyway
packages/ts/entity/package.jsonexports["."] points at dist/index.js, but src/ has no index.ts, so the main export is broken (build emits dist/entity/…)

Each vendored packages/ts/* package with a build script has a moon build task with deps: ['^:build']; packages/ts/*/dist/ is gitignored; render typechecks clean; and @augmented/entity’s . export resolves.

  1. Add a build moon task (command: 'bun run build', deps: ['^:build'], toolchains: 'system') to each vendored package that carries a build script.
  2. Add packages/ts/*/dist/ to the root .gitignore (verify nothing is currently tracked there first).
  3. Fix render’s className to a token array ([cssClass]) — the idiomatic hast shape, not a cast.
  4. Add packages/ts/entity/src/index.ts re-exporting the package’s v1 public barrel so the build emits dist/index.js.
LocationKindChange
packages/ts/books/moon.ymlmodifyAdd build task (+ 9 sibling packages)
.gitignoremodifyIgnore packages/ts/*/dist/
packages/ts/render/src/wikilinks/plugin.tsmodifyclassName: [cssClass]
packages/ts/entity/src/index.tsnewRe-export the v1 public barrel
  • AC-1: Each vendored packages/ts/* package with a build script has a moon build task with deps: ['^:build'].
  • AC-2: packages/ts/*/dist/ is gitignored and no dist/ is untracked after building.
  • AC-3: bunx tsc --noEmit in packages/ts/render is clean.
  • AC-4: @augmented/entity’s . export resolves (import … from '@augmented/entity' yields the public API).
  • AC-5: Root bunx tsc --noEmit is clean; all vendored packages build in dependency order.
  • Migrating apps/augmented_web / apps/vimit_prototype off the legacy moon-1.x schema that breaks moon run repo-wide — a separate follow-up (see post-mortem).
  • The h3 v1/v2 skew (T-CTJF).
  • none — the vendored packages are already on origin/main (#911).
  • Surfaced by T-6C0Z’s post-mortem while building learn_web (which consumes 8 of these packages).

Captured by /sdlc:task-work on 2026-07-19. PR: pending.

  • AC-1: agent-manual — build task added to 9 packages (books, context, entity, hierarchy, logging, render, utils, json-canvas-core, json-canvas-vue); test-vue-component skipped (no build script). A tenth (obsidian-bases-augment) was covered here but dropped when the merge with main picked up 09d8f775, which deletes that vendored fork wholesale. No existing packages/ts/* build task to mirror (build tasks lived only in apps/*), so modeled on the sibling test/check tasks + the app ^:build convention.
  • AC-2: auto — packages/ts/*/dist/ added to root .gitignore; git ls-files 'packages/ts/*/dist' was empty (nothing tracked); post-build git status shows no dist.
  • AC-3: auto — render className: cssClass[cssClass] (hast Properties.className is string[]); tsc --noEmit in render exits 0.
  • AC-4: agent-manual — added packages/ts/entity/src/index.ts (export * from "./entity/v1/index.js"); build emits dist/index.js + .d.ts; import … from '@augmented/entity' resolved createService from a consumer.
  • AC-5: auto — all packages build in topological order (utils/logging/context/hierarchy/render/json-canvas-core → entity/json-canvas-vue → books), each exit 0; root bunx tsc --noEmit exit 0.
  • The ^:build dependency ordering the new moon tasks declare matches the real build graph (e.g. entity resolves @augmented/utils only once utils/dist exists).
  • The two package bugs (render type, entity export) were both small, correct fixes — not casts or workarounds.
  • moon run is broken repo-wide (new follow-up): apps/augmented_web/moon.yml (from #925) and apps/vimit_prototype/moon.yml (from #926) carry legacy moon-1.x schema (type: application, local: true) that moon 2.4.3 rejects during global project-graph parse, so moon run <anything> aborts before running. Present on main. The new build tasks here are therefore validated structurally + by building each package in dependency order, not via moon run. Fix: migrate those two app moon.yml files to the moon 2.x schema (layer:/stack:/language:; drop/port local:) — worth its own task.
  • No packages/ts/* package shipped a moon build task from the vendor, and their dist/ wasn’t gitignored — both should be part of the adoption recipe for vendoring a buildable TS package.

← Back to Tasks