본문으로 건너뛰기
cccskills
무료GitHub에 공개

spark-component-model

Create or update an model file in the Model folder in Sources of a spark-ios-component-XXX and add or update unit tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md2.7 KB
  • template/example1/XXXSizes.swift295 B
  • template/example1/XXXSizesTests.swift1.3 KB
  • template/example2/XXXContentColors.swift677 B
  • template/example2/XXXContentColorsTests.swift2.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Add Repository Skill

Overview & Prerequisites

This skill guides you to implement/update an model in spark component.

Component Selection

Parameter Handling:

  • If the skill is invoked with a parameter (e.g., /spark-component-model button):

    • Use the parameter as the component name
    • Verify the folder exists in Modules/Components/{component-name}/
    • If found, use that component and skip the selection step
  • If no parameter is provided:

    • List all folders in the Modules/Components/ directory
    • Use AskUserQuestion to let the user select ONE component from the list
    • Format: Display folder names as options (e.g., "button", "card", "checkbox")

Once 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 model and the unit tests.

Rules

The Model file must respect theses rules :

  • must be located in Sources/Core/Model and in Tests/UnitTests/Model.

  • must be Equatable

  • should add prefix on some properties :

    • any TypographyFontToken type -> var xxxFontToken (example: titleFontToken)
    • any ColorToken type -> var xxxColorToken (example: tintColorToken)
  • should have default values for all properties :

    • CGSize type -> .zero
    • CGFloat type -> .zero
    • any TypographyFontToken type -> TypographyFontTokenClear() (Must import @_spi(SI_SPI) import SparkTheming)
    • any ColorToken type -> ColorTokenClear() (Must import @_spi(SI_SPI) import SparkTheming)
    • String type -> .empty
    • Number type -> .zero

Workflow

  • Add/Update the code.
  • Add/Update the documentation if the enum is public.
  • Run swiftlint $ swiftlint.
  • Run sourcery $ sourcery
  • Implement the unit tests. Read theses folders to get mocks :
    • spark-ios-component-XXX/Sources/Testing
    • spark-ios-common/Sources/Testing
    • spark-ios-theming/Sources/Testing

Code Conventions

  • File headers follow pattern: Created by {firstname.lastname} on DD/MM/YYYY
  • Copyright line includes current year
  • No empty lines contain whitespace or tabs
  • All class members accessed with self.
  • Protocol marked with // sourcery: AutoMockable
  • Proper MARK comments in place

Test Implementation

  • Tests must be written in Swift Testing framework
  • Proper imports (SparkComponentXXX, SparkCommon, SparkTheming, @testable, @_spi(SI_SPI) @testable import SparkComponentXXXTesting, Testing, ...)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Update the CHANGELOG.md with the description of the changes between the last released version and the new one

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

Launch some action before create push in git

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

Create or update a constants file in the Constants folder in Sources of a spark-ios-component-XXX and add or update unit tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

Create or update the DocC documentation in Sources of a spark-ios-component-XXX.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

Create or update an enum file in the Enum folder in Sources of a spark-ios-component-XXX and add or update unit tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

leboncoin/spark-ios222026년 10월 8일 업데이트

leboncoin의 스킬 모두 보기

이 스킬의 문제 신고