Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

spec(AST-093): a native component's views live in the folder that mirrors its core component root (FR1) (#9341)

Cindy Zhang8119a0f20875
diff --git a/docs/specs/AST-093-native-component-guidelines/spec.md b/docs/specs/AST-093-native-component-guidelines/spec.md
index b1fa6ce33a..89f01d602e 100644
--- a/docs/specs/AST-093-native-component-guidelines/spec.md
+++ b/docs/specs/AST-093-native-component-guidelines/spec.md
@@ -53,14 +53,19 @@ validating, and reviewing individual native components while
## Requirements
- **FR1 — A native component's spec lives beside the core component's.** Each
- native component has its own folder in its language's implementation, named
- as the core component. Its spec is `<Name>.<language>.spec.md` in the core
+ native component's views live in its language's implementation, in the
+ folder that mirrors its core component root (the core source directory):
+ `<ComponentRoot>`, which is `<Name>` when core keeps the component in its own
+ folder, so core's `Avatar/AvatarStatusDot` puts the Swift AvatarStatusDot
+ views in `Avatar/` too. Spec lookup routes a native view to its component's
+ records by that folder, which is why the folder is part of the contract. Its
+ spec is `<Name>.<language>.spec.md` in the core
component's folder under `docs/specs/components/`, beside the core record
(`docs/specs/components/<ComponentRoot>/<Name>.spec.md`), as
`architecture:knowledge-contracts` DEC-15 places every component record. Each
language has one implementation package; for Swift that is
`packages/native/apple/`, with the component's views in
- `packages/native/apple/Sources/Astryx/<Name>/`, and its spec is
+ `packages/native/apple/Sources/Astryx/<ComponentRoot>/`, and its spec is
`docs/specs/components/<ComponentRoot>/<Name>.swift.spec.md`. `<Name>` is the
core component's name, and `<ComponentRoot>` the folder core keeps it in. The spec is a
knowledge record of kind `component` with id `component:<language>/<Name>`
@@ -173,14 +178,14 @@ validating, and reviewing individual native components while
## Verification
-| Contract | Verification | Representative states | Mutation or failure expectation |
-| -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| FR1 | Review of the spec's path beside the core component's spec, plus `pnpm check:knowledge` on its record frontmatter, id, and `platform_of` | a spec per language; a spec for a component with no core contract | A component spec outside the core component's folder under `docs/specs/components/`, without valid record frontmatter, under another id, naming no core component, or renaming a core prop passes |
-| FR2 | The spec's account of the platform control it builds on, or why none fits, and the state captures | a component built on a platform control; a component with no platform control | A component draws its own control where a platform control fits, with no reason in its spec |
-| FR3 | The spec's account of the platform guidelines it follows, and the captures | hit target size; largest Dynamic Type; Reduce Motion; VoiceOver focus | A capture shows a hit target below the platform minimum or text that does not scale |
-| FR4 | Theme test with two themes, plus source review for literals | default theme; a second theme with different color, type, and shape | A brand value stays the same across both themes, or a platform-only visual prop is added |
-| FR5 | The package's tests on every supported platform and the captures attached to the change | light; dark; largest text; every state the core contract names | A change merges without tests, without captures, or with a capture-based claim backed only by source |
-| FR6 | Changed paths, commit authors, the review app's exact-head review, the spec review's findings, and the approval | all native paths by group members; a spec-defined requirement unmet; behavior no spec defines; a native component spec under `docs/specs/components/`; a path outside `packages/native/` and those specs; a commit from someone else | An approval without an exact-head review-app pass or a spec review, an approval with a spec-defined requirement unmet, an out-of-scope pull request approved without review, or an in-scope one blocked only for behavior no spec defines |
+| Contract | Verification | Representative states | Mutation or failure expectation |
+| -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| FR1 | Review of the views' folder and of the spec's path beside the core component's spec, plus `pnpm check:knowledge` on its record frontmatter, id, and `platform_of` | a spec per language; a spec for a component with no core contract; a member component core keeps in another component's folder | Views outside the folder that mirrors the core component root, a component spec outside the core component's folder under `docs/specs/components/`, without valid record frontmatter, under another id, naming no core component, or renaming a core prop passes |
+| FR2 | The spec's account of the platform control it builds on, or why none fits, and the state captures | a component built on a platform control; a component with no platform control | A component draws its own control where a platform control fits, with no reason in its spec |
+| FR3 | The spec's account of the platform guidelines it follows, and the captures | hit target size; largest Dynamic Type; Reduce Motion; VoiceOver focus | A capture shows a hit target below the platform minimum or text that does not scale |
+| FR4 | Theme test with two themes, plus source review for literals | default theme; a second theme with different color, type, and shape | A brand value stays the same across both themes, or a platform-only visual prop is added |
+| FR5 | The package's tests on every supported platform and the captures attached to the change | light; dark; largest text; every state the core contract names | A change merges without tests, without captures, or with a capture-based claim backed only by source |
+| FR6 | Changed paths, commit authors, the review app's exact-head review, the spec review's findings, and the approval | all native paths by group members; a spec-defined requirement unmet; behavior no spec defines; a native component spec under `docs/specs/components/`; a path outside `packages/native/` and those specs; a commit from someone else | An approval without an exact-head review-app pass or a spec review, an approval with a spec-defined requirement unmet, an out-of-scope pull request approved without review, or an in-scope one blocked only for behavior no spec defines |
## Decision log