Update the CHANGELOG.md with the description of the changes between the last released version and the new one
中文简介正在准备中。当前显示原文说明。
Create or update a token file in the Token folder in Sources of a spark-ios-component-XXX and add or update unit tests.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
This skill guides you to implement/update a token in spark component.
Parameter Handling:
If the skill is invoked with a parameter (e.g., /spark-component-token button):
Modules/Components/{component-name}/If no parameter is provided:
Modules/Components/ directoryOnce the component is selected, all operations must be performed in Modules/Components/{component-name}/ folder.
Use the files in the template folder as reference to manage the token and the unit tests. See Modules/Components/Chip/Sources/Core/Token for a full real-world example.
The template uses
Border,Size, andTypographypurely as illustrations of three recurring patterns (see Rules below). A real component's token categories are whatever it actually needs — e.g.Opacity,Layout,Spacing,Color,Icon,Animation, ... Determine the category names and count from the component's design/usage, not from the template names.
The Token file must respect theses rules :
public struct XXXToken: Equatable with one property per token category the component actually needs (there is no fixed list or fixed count — could be one category or a dozen), plus a public init(theme: any Theme) that forwards the theme to every category that needs it.XXXToken+Opacity.swift), containing a public extension XXXToken with a nested struct CategoryName: Equatable.Size in the template) must have a parameterless public init(). On the root struct, its property is a stored default value (public let size = Size()), not assigned in the root init(theme:) body.Border in the template) must have public init(theme: any Theme), and its property must be assigned in the root init(theme:).any ColorToken, any TypographyFontToken, or any other non-natively-Equatable existential (illustrated by Typography in the template) must provide a manual static func == using .equals() — the synthesized Equatable conformance does not work for existential protocol types.///). XXXToken/CategoryName: description)$ swiftlint.$ sourceryCreated by {firstname.lastname} on DD/MM/YYYYself.// sourcery: AutoMockableThemeGeneratedMock.mocked() and ThemeGeneratedMock.mocked2() to cover theme-dependent values and equality/inequalityXXXTokenTests must verify that each property matches a freshly-constructed instance of its own sub-struct (e.g. #expect(token.border == XXXToken.Border(theme: self.theme))), plus equatable true/false at the root levelIf you encounter:
Equatable and it's unclear whether a manual == is neededUse AskUserQuestion to clarify with the user before proceeding.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Update the CHANGELOG.md with the description of the changes between the last released version and the new one
中文简介正在准备中。当前显示原文说明。
Launch some action before create push in git
中文简介正在准备中。当前显示原文说明。
Create or update a accessibility identifier file in the AccessibilityIdentifier folder in Sources of a spark-ios-component-XXX and add or update unit tests.
中文简介正在准备中。当前显示原文说明。
Create or update a constants file in the Constants folder in Sources of a spark-ios-component-XXX and add or update unit tests.
中文简介正在准备中。当前显示原文说明。
Create or update the DocC documentation in Sources of a spark-ios-component-XXX.
中文简介正在准备中。当前显示原文说明。
Create or update an enum file in the Enum folder in Sources of a spark-ios-component-XXX and add or update unit tests.
中文简介正在准备中。当前显示原文说明。