feat(cli): ADR-0048 follow-up — namespace-prefix lint warning#1804
Merged
Conversation
Shifts the cross-package metadata collision detection (ADR-0048 runtime MetadataCollisionError) left to authoring time. `os lint` now emits a non-fatal `naming/namespace-prefix` warning when a bare-named UI/automation item (app/page/dashboard/flow/action/report/dataset) is not prefixed with the package namespace — the clash these names risk fails loudly at registration; this nudges authors to prefix before it ever gets there. - Exempts an app named after the namespace (ADR-0019 single-app convention, e.g. `crm`) and `sys_`-reserved names. - Objects (already prefix-enforced as an error) and object-derived views are untouched; `doc` keeps its own build-time strict lint. - Warning-only: never fails `os lint` (only errors exit non-zero) and `os build` does not run lintConfig, so example builds are unaffected. - Marks the ADR-0048 §4 lint follow-up as implemented. Tests: 7 cases (warn/accept/app-exemption/sys_/all-types/no-namespace/ objects-views-untouched). Full lint suite green (38). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the deferred §4 follow-up of ADR-0048 (cross-package metadata collision, merged in #1796).
ADR-0048 added a runtime guard: a cross-package clash on a bare-named item's registry key (
org/type/name) now fails loudly at registration withMetadataCollisionError. This PR shifts that detection left to authoring time —os lintnow nudges authors to prefix bare-named metadata with the package namespace, so the clash is unlikely to ever reach install.What it does
New
naming/namespace-prefixwarning inlintConfig:app/page/dashboard/flow/action/report/dataset— has anamenot prefixed withmanifest.namespace.crm), andsys_-reserved names.defineStack), object-derived views, anddoc(its own strict build-time lint).os lintexits non-zero only on errors, andos builddoes not runlintConfig— so no example build or CI run breaks from this.Also marks the ADR-0048 §4 lint follow-up as implemented.
Test plan
packages/cli/test/lint-namespace-prefix.test.ts— 7 cases: warns on bare name, accepts prefixed, exempts app-named-after-namespace, exemptssys_, covers all 7 types, silent without a namespace, leaves objects/views alone.🤖 Generated with Claude Code