google-labs-code / google-labs-code/design.md

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

Open Beginner friendly
#153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the getSpecContent() implementation indicated by the stack trace and reproduce the failure with npx @google/design.md@0.3.0 spec. Compare the path it reads with the published dist/linter/spec.md location and inspect the build output. Done when the spec command works from the built package and a packaging test catches path drift.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system, cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.