Skip to content

spec command fails on v0.3.0: reads dist/spec.md but the build emits dist/linter/spec.md #153

Description

@solethus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions