Summary
The spec command throws Failed to load spec.md on a clean install of @google/design.md@0.3.0. The file it needs is in the published tarball — just at a different path than the command reads. lint, diff, and export are unaffected.
Version
@google/design.md@0.3.0 (installed from npm via npx/bunx and via npm install).
Repro
npx @google/design.md@0.3.0 spec
Actual
ERROR Failed to load spec.md.
Bundled path: .../node_modules/@google/design.md/dist/spec.md
Dev path: .../@google/docs/spec.md
If running from a built bundle, ensure the build script copies docs/spec.md into dist/.
at getSpecContent (.../dist/index.js:24408:11)
at Object.run (.../dist/index.js:24474:18)
Root cause
getSpecContent() looks for dist/spec.md, but the published package ships the file at dist/linter/spec.md:
$ ls node_modules/@google/design.md/dist/spec.md # -> No such file
$ ls node_modules/@google/design.md/dist/linter/spec.md # -> exists
So the build does emit spec.md, just under dist/linter/ rather than dist/, and the command's expected path wasn't updated to match (or vice-versa).
Suggested fix
Either point getSpecContent() at dist/linter/spec.md, or have the build copy docs/spec.md to dist/spec.md (as the error hint suggests). A packaging test that runs design.md spec against the built tarball would catch this class of path drift.
Impact
Low — only the spec command (which prints the format reference) is broken. But it's the command agents/humans reach for to learn the format, so the failure is user-facing at an inconvenient moment.
Summary
The
speccommand throwsFailed to load spec.mdon a clean install of@google/design.md@0.3.0. The file it needs is in the published tarball — just at a different path than the command reads.lint,diff, andexportare unaffected.Version
@google/design.md@0.3.0(installed from npm vianpx/bunxand vianpm install).Repro
Actual
Root cause
getSpecContent()looks fordist/spec.md, but the published package ships the file atdist/linter/spec.md:So the build does emit
spec.md, just underdist/linter/rather thandist/, and the command's expected path wasn't updated to match (or vice-versa).Suggested fix
Either point
getSpecContent()atdist/linter/spec.md, or have the build copydocs/spec.mdtodist/spec.md(as the error hint suggests). A packaging test that runsdesign.md specagainst the built tarball would catch this class of path drift.Impact
Low — only the
speccommand (which prints the format reference) is broken. But it's the command agents/humans reach for to learn the format, so the failure is user-facing at an inconvenient moment.