You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(errors): tighten weak error messages to state the rule
Audit pass against the ERROR MESSAGES doctrine (what/where/saw/fix).
Four messages said "invalid" or "illegal" without naming the rule;
rewrite each to state the actual contract. Terse, library-API tier —
the four ingredients collapse into a single line per message.
- npm.ts: "Invalid scoped package specifier" → "npm scoped specifier
must contain '/' after scope (e.g. '@scope/name')"
- vers.ts: "invalid semver version 'X'" → "semver version 'X' must
match MAJOR.MINOR.PATCH (e.g. '1.2.3')"
- validate.ts qualifier: "qualifier 'X' contains an illegal
character" → "qualifier key 'X' must match [a-z0-9.\-_]"
- validate.ts type: "type 'X' contains an illegal character" →
"type 'X' must match [A-Za-z0-9.\-]"
- vers.ts: "empty constraint" → "VERS constraint must not be empty
(use '*' for the wildcard)"
Test assertions updated to match the new messages. All 1775 tests
green. Other throws audited and left alone — they already state the
rule (e.g. "bazel requires a 'version' component", "cpan
'namespace' component must be UPPERCASE").
0 commit comments