We hit this wiring up @tanstack/intent for @stainless-code/persist. In the published 0.3.4 (latest), the maintainer commands that read meta/ all fail:
$ intent setup
No templates directory found. Is @tanstack/intent installed?
$ intent meta
Meta-skills directory not found.
scaffold and setup-github-actions hit the same thing — they all go through getMetaDir().
Root cause
packages/intent/src/commands/support.ts:
export function getMetaDir(): string {
const thisDir = dirname(fileURLToPath(import.meta.url))
return join(thisDir, '..', '..', 'meta')
}
The ../../meta depth is correct in source — the module lives at src/commands/support.ts, so two .. lands on the package root where meta/ lives. But the build bundles the module flat into dist/ (tsdown src/cli.ts … → dist/support-*.mjs at the dist root). From dist/, two .. overshoots past the package root into @tanstack/, so it looks for @tanstack/meta (doesn't exist) instead of @tanstack/intent/meta (one .. up, where it actually is).
Runtime proof from a consumer install:
getMetaDir() -> …/node_modules/@tanstack/meta # doesn't exist
templates at -> …/node_modules/@tanstack/intent/meta/templates/workflows # exists
So it's a build-layout mismatch, not a naming thing — the code does look for <metaDir>/templates/workflows, it just computes metaDir one level too high once src/commands/ is flattened to dist/.
Blast radius
Only the getMetaDir-backed maintainer commands: setup, setup-github-actions, meta, scaffold. Consumer commands (list, load, validate, stale, install, exclude, hooks) don't use it and work fine. Still present on main (same two lines).
Fix
Walk up to the first meta/ instead of hardcoding the depth — works for both src/commands/ and flat dist/, and for symlinked installs (pnpm). PR incoming.
We hit this wiring up
@tanstack/intentfor@stainless-code/persist. In the published0.3.4(latest), the maintainer commands that readmeta/all fail:$ intent setup No templates directory found. Is @tanstack/intent installed? $ intent meta Meta-skills directory not found.scaffoldandsetup-github-actionshit the same thing — they all go throughgetMetaDir().Root cause
packages/intent/src/commands/support.ts:The
../../metadepth is correct in source — the module lives atsrc/commands/support.ts, so two..lands on the package root wheremeta/lives. But the build bundles the module flat intodist/(tsdown src/cli.ts …→dist/support-*.mjsat the dist root). Fromdist/, two..overshoots past the package root into@tanstack/, so it looks for@tanstack/meta(doesn't exist) instead of@tanstack/intent/meta(one..up, where it actually is).Runtime proof from a consumer install:
So it's a build-layout mismatch, not a naming thing — the code does look for
<metaDir>/templates/workflows, it just computesmetaDirone level too high oncesrc/commands/is flattened todist/.Blast radius
Only the
getMetaDir-backed maintainer commands:setup,setup-github-actions,meta,scaffold. Consumer commands (list,load,validate,stale,install,exclude,hooks) don't use it and work fine. Still present onmain(same two lines).Fix
Walk up to the first
meta/instead of hardcoding the depth — works for bothsrc/commands/and flatdist/, and for symlinked installs (pnpm). PR incoming.