Skip to content

targets: gets a hint too, pointing at sound: - #47

Merged
ninjudd merged 1 commit into
mainfrom
fix/targets-hint
Aug 7, 2026
Merged

ninjudd merged 1 commit into
mainfrom
fix/targets-hint

Conversation

@ninjudd

@ninjudd ninjudd commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

targets was the package the layout migration (#31) renamed to sounds, one PR before packages went singular (#41). The singular hint only knew about plurals, so the one spelling every pre-#31 doc produces fell through it and got nothing back:

$ field build //songs/creek/targets:pad-sc
pattern matched no labels: //songs/creek/targets:pad-sc

A flat dead end — and it was reachable from every command in the sample project's README until okamnesiac/bloom#2 rewrote it. Now:

$ field build //songs/creek/targets:pad-sc
pattern matched no labels: //songs/creek/targets:pad-sc (targets: is now sound: try //songs/creek/sound:pad-sc)

The wording is its own, deliberately

"packages are singular" is true of sounds and false of targets, which was a rename, not a pluralization. Borrowing the grammar lesson would teach the wrong thing. So the lead-in moved into the table beside each mapping:

const PACKAGE_HINTS: Record<string, { to: string; why: string }> = {
  sounds:  { to: 'sound', why: 'packages are singular:' },
  ...
  targets: { to: 'sound', why: 'targets: is now sound:' },
};

Each why carries its own punctuation — the two lead-ins don't share a shape, and gluing a colon on in the template gave targets: two of them.

Everything else is unchanged: the suggestion still keeps the shape it was given (:all → :all, tree → tree), and still fires only when the target package actually exists.

Verified

New test covers the label, tree, and :all shapes for targets, and asserts the plural wording alongside them so the two cannot drift. pnpm typecheck clean; 297 passed, 23 skipped.

The schema-side hint in common.ts needed no change — a source: only ever takes a bare name or //shared/asset:, so targets was never reachable there.


Note

Low Risk
User-facing error-message improvements only; no build graph or label resolution behavior beyond hint text and the new targets mapping.

Overview
Label resolution now gives actionable hints when users type the pre-migration targets: package (renamed in layout #31), which previously produced a bare “no labels” error with no correction.

The plural/singular hint logic moves into a PACKAGE_HINTS table where each legacy spelling has its own why text. targets maps to sound with “targets: is now sound:” instead of the “packages are singular” message, which would be misleading for a rename rather than a plural.

Hint behavior is unchanged: suggestions preserve pattern shape (label, tree ..., or :all) and only appear when the corrected package exists in the graph.

Tests cover targets: in all three shapes and lock in that sounds: still uses the singular-package wording.

Reviewed by Cursor Bugbot for commit b1b2f3a. Configure here.

`targets` was the package the layout migration (#31) renamed to `sounds`,
one PR before packages went singular (#41). The singular hint only knew
about plurals, so the one spelling every pre-#31 doc produces fell
through it and got nothing:

    $ field build //songs/creek/targets:pad-sc
    pattern matched no labels: //songs/creek/targets:pad-sc

That is a flat dead end, and it was reachable from every command in the
sample project's README until bloom#2 rewrote it. It now corrects to
`sound:`, keeping the shape it was given as the plural hint does.

The wording is its own: "packages are singular" is true of `sounds` and
false of `targets`, which was a rename, not a pluralization. So the
lead-in moved into the table beside each mapping and carries its own
punctuation — gluing a colon on in the template gave `targets:` two.

The plural mapping is unchanged and still says what it always said,
asserted alongside the new case so the two cannot drift.
@ninjudd
ninjudd merged commit 59e3778 into main Aug 7, 2026
2 checks passed
@ninjudd
ninjudd deleted the fix/targets-hint branch September 28, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant