Skip to content

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

TypeScript

spec(AST-093): Swift components live in the one apple/ package (#8245)

Cindy Zhangdc9d7767a38b
diff --git a/docs/specs/AST-093-native-component-guidelines/spec.md b/docs/specs/AST-093-native-component-guidelines/spec.md
index 10f5fae044..7f42878945 100644
--- a/docs/specs/AST-093-native-component-guidelines/spec.md
+++ b/docs/specs/AST-093-native-component-guidelines/spec.md
@@ -55,17 +55,15 @@ validating, and reviewing individual native components while
- **FR1 — A native component's spec lives beside its implementation.** Each
native component has its own folder in its language's implementation, named
as the core component, and its spec is `<Name>.spec.md` in that folder, as
- core does (`packages/core/src/<Name>/<Name>.spec.md`). For Swift that is
- `packages/native/swift-ios-<n>/core/<Name>/<Name>.spec.md`, beside the
- component's views. `<Name>` is the core component's name. The spec follows
+ core does (`packages/core/src/<Name>/<Name>.spec.md`). Each language has one
+ implementation package; for Swift that is `packages/native/apple/`, and the
+ spec is `packages/native/apple/Sources/Astryx/<Name>/<Name>.spec.md`, beside
+ the component's views. `<Name>` is the core component's name. The spec follows
`packages/native/specs/TEMPLATE.md`: summary, contract, native control,
platform guidelines, brand through the theme, states, accessibility, test and
validation, and open questions. One spec covers every implementation of the
component in that language, on every platform the language serves (Swift
- serves `ios` and `macos`). When more than one package in a language implements
- a component, such as a later `swift-ios-<n>` generation or a macOS-only
- package, the spec lives in that component's folder in the lowest-numbered
- live package of the language. Rules that apply across a language's components
+ serves `ios` and `macos`). Rules that apply across a language's components
live under `packages/native/specs/<language>/`. A merged native component spec
describes that component's implementations in that language. It never changes
the core contract and never contradicts `spec:AST-082` or this record; where
@@ -142,9 +140,10 @@ validating, and reviewing individual native components while
- No architecture, family, contributing, or consumer-doc record changes.
- No native component spec exists yet.
- Component folders live inside a language's implementation package. For
- Swift that is `swift-ios-1`, which arrives with the SwiftUI package; until it
- is on `main`, no component folder exists and no component spec can be added.
-- The first Swift views in `swift-ios-1` (Banner, Button, Card, Heading, Text,
+ Swift that is `packages/native/apple/`, whose `Astryx` product holds the
+ SwiftUI views; until they are on `main`, no component folder exists and no
+ component spec can be added.
+- The first Swift views in the `Astryx` product (Banner, Button, Card, Heading, Text,
and TextInput) take hand-written parameters, including `action` for the
contract's `onClick`, until they move to the generated contracts. Until then
they are the only native components exempt from FR5's generated-parameter
diff --git a/packages/native/specs/README.md b/packages/native/specs/README.md
index ca2701c5ba..072ebefc54 100644
--- a/packages/native/specs/README.md
+++ b/packages/native/specs/README.md
@@ -12,7 +12,7 @@ packages/native/
│ ├── TEMPLATE.md # copy this for a new component spec
│ └── swift/ # rules shared by every Swift component
│ └── library/ # rules every Swift component or build step shares
-└── swift-ios-1/core/
+└── apple/Sources/Astryx/
└── <Name>/ # one folder per component, named as core's
├── Astryx<Name>.swift
└── <Name>.spec.md # the component's spec, e.g. Button.spec.md
@@ -40,7 +40,7 @@ the same everywhere. A native spec never renames or changes it.
## Adding a spec
1. Copy `TEMPLATE.md` to the component's folder as `<Name>.spec.md`, for
- Swift `swift-ios-1/core/<Name>/<Name>.spec.md`.
+ Swift `apple/Sources/Astryx/<Name>/<Name>.spec.md`.
2. Fill every section. Write "None" rather than deleting one.
3. Open a pull request that changes only files under `packages/native/`. A spec
can land on its own or with the component it describes.
diff --git a/packages/native/specs/TEMPLATE.md b/packages/native/specs/TEMPLATE.md
index 96b0ebcdc7..53da3081cc 100644
--- a/packages/native/specs/TEMPLATE.md
+++ b/packages/native/specs/TEMPLATE.md
@@ -1,7 +1,7 @@
# <Name> (<language>)
<!-- Copy into the component's folder as <Name>.spec.md (Swift:
-packages/native/swift-ios-1/core/<Name>/<Name>.spec.md). Fill every section;
+packages/native/apple/Sources/Astryx/<Name>/<Name>.spec.md). Fill every section;
write "None" rather than deleting one. Present tense: describe what the
component does, not how it was decided. Rules: AST-093. -->
diff --git a/packages/native/specs/swift/README.md b/packages/native/specs/swift/README.md
index acfdb0be25..483cf0c063 100644
--- a/packages/native/specs/swift/README.md
+++ b/packages/native/specs/swift/README.md
@@ -3,7 +3,7 @@
Rules shared by every Astryx component written in Swift, for iOS and macOS.
A single component's spec lives in that component's own folder, beside its
-views: `packages/native/swift-ios-1/core/<Name>/<Name>.spec.md`, named as the
+views: `packages/native/apple/Sources/Astryx/<Name>/<Name>.spec.md`, named as the
core component (`Button.spec.md`, `TextInput.spec.md`) and copied from
[`../TEMPLATE.md`](../TEMPLATE.md).
diff --git a/packages/native/specs/swift/library/README.md b/packages/native/specs/swift/library/README.md
index 9c52111153..164919b094 100644
--- a/packages/native/specs/swift/library/README.md
+++ b/packages/native/specs/swift/library/README.md
@@ -2,7 +2,7 @@
Rules that every Astryx Swift component or Swift build step shares, one
concern per file. A component spec (`<Name>.spec.md` in the component's own
-folder, such as `swift-ios-1/core/Button/Button.spec.md`, from
+folder, such as `apple/Sources/Astryx/Button/Button.spec.md`, from
`../../TEMPLATE.md`) follows these and records only where a component differs.
These specs apply AST-082 (native-first surfaces) and AST-093 (native component