Skip to content

Commit

Permalink
Version 0.7.0 (#324)
Browse files Browse the repository at this point in the history
Release of version 0.7.0
See below the full CHANGELOG details.

Added:
- [DemoApp] Add code sample for tokens usages in token pages ([#283](#283))
- [Library] Color some new semantic tokens `colorContentStatus*`,  `colorContentOnBrand*`, `colorContentOnStatus*`, `colorGradient*`, `colorBorder*`, `colorContentOnAction*`
- [Tool] Add UI tests in CI/CD pipelines ([#298](#298))
- [DemoApp] Add more UI tests on demo app ([#154](#154))

Changed:
- [Library] Update `GridSemanticTokens` tokens (tokenator *20241129080807*)
- [Library] Types `GridExtraCompactSemanticToken`, `GridCompactSemanticToken` and `GridRegularSemanticToken` replaced by `GridSemanticToken` to make tokenator updates integration easier 
- [DemoApp] Update space tokens screen ([#275](#275))
- [Library] Update `GridRawTokens` tokens (tokenator *20241128161629*)
- [DemoApp] Update color tokens screen 
- [Library] Update `ColorSemanticTokens` tokens (tokenator *20241127112301*)
- [Library] Update `SpaceSemanticTokens` tokens (tokenator *20241127074206*)
- [Library] Update `SizeSemanticTokens` with rename of tokens (tokenator *20241126134156*)
- [Library] Update `ElevationSemanticTokens` (tokenator *20241126120657*)
- [Library] Improve Multiple-based objects for tokenator values integration ([#279](#279))
- [Tool] Use `macos-15` runner for GitHub Actions builds ([#296](#296))

Removed:
- [Library] Grid semantic tokens `gridExtraCompactColumnCount`, `gridCompactColumnCount` and `gridRegularColumnCount`
- [Library] Grid raw tokens `gridMargin900`
- [Library] Color semantic tokens `colorContentOnBg*`, `colorBorderOnBg*`, `colorBorderStatus*`, some `colorAction*OnBg*`, `colorDecorative{Primary,Secondary,Tertiary}`, `colorAlwaysOnBg*`, `colorBgBrand{Secondary,Tertiary}`, `colorContentBrand{Secondary,Tertiary}`, `colorBorderBrand{Secondary,Tertiary}`, `colorContentStatusAccent`, ...
- [Library] Some space semantic tokens type aliases to help tokenator job (`SpacePaddingInlineSemanticToken`, `SpacePaddingBlockSemanticToken`, `SpaceGapInlineSemanticToken`, `SpaceGapStackSemanticToken`)
- [Library] All dimension semantic tokens ([#308](#308))

Fixed:
- [DemoApp] Fix VoiceOver issue with element grouping in presentation tokens and update accessibility statement ([#212](#285))
- [Library] Warning issues for DocC catalogs ([#293](#293))

Co-authored-by: Pierre-Yves Lapersonne <[email protected]>
Co-authored-by: Ludovic Pinel <[email protected]>
Co-authored-by: Tayeb Sedraia <[email protected]>
Co-authored-by: boosted-bot <[email protected]>
  • Loading branch information
4 people authored Nov 29, 2024
2 parents bfcabaf + 848a6b9 commit 7463f43
Show file tree
Hide file tree
Showing 1,822 changed files with 15,212 additions and 5,876 deletions.
92 changes: 82 additions & 10 deletions .github/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,73 @@ To run these UI tests follow some steps:
2. `bundle exec pod install`
3. Open *Showcase.xcworkspace*
4. Select *ShowcaseTests* scheme
5. Select some simulator (tests designed for *iPhone 13 Pro Max* and *iPhone 14 Pro Max* but works elsewhere)
5. Select *iPhone 16 Pro* simulator (the device used to tests and views rendering)
6. Run tests (Product -> Test)

Beware, if you add new UI tests using [swift-snapshot-testing](https://github.com/pointfreeco/swift-snapshot-testing) library, you may have new tests which fail at first time.
Indeed for new tests the tool makes snapshots of the views, thus for the first run no preview exist making the tests fail. You should run the tests twice for new tests.
Indeed for new tests the tool makes snapshots of the views, thus for the first run no previews exist making the tests fail. You should run the tests twice for new tests.

Such tests here are used to as to be sure the look and feel of any components and tokens rendering remain the expected ones.

Any interface modifications require regenerating the illustrations using the tool, i.e. run the tests twice. The reference illustrations have already been saved within the project.

**Note today because the showcase app is hosted in the repository, the tests assets are versioned too, thus the _Swift Package_ will be heavy when being downloaded because Xcode downloads the entire repository. When the showcase app will be extracted to an internal repository, the _Swift Package_ will be lighter**.

#### How to use to use swift-snapshot-testing library

1. Locate where are the reference images:
- In the Package directory, you will find the reference screenshots for the Orange and Inverse themes (Light/Dark), which will serve as comparison baselines.
```text
OUDS -> Showcase -> ShowcaseTests -> __Snapshots__
```
2. Navigate to the project :
- Open your project in Xcode and go to a directory containing tests (e.g. here *OUDSTokensOpacityUITests*):
```shell
Showcase -> ShowcaseTests -> OUDSTokensOpacityUITests -> OUDSTokensOpacityUITests.swift
```
3. Open a test file (e.g. here *OUDSTokensOpacityUITests*):
- Open the file `OUDSTokensOpacityUITests.swift`.
4. Run the snapshot test (success):
- Locate and execute some function like `testAllOpacitiesOrangeThemeLight()`.
<img width="897" alt="OrangeThemeLight_OpacityTest_Success" src="https://github.com/user-attachments/assets/550bed90-6bc9-4d68-aaf0-8e04de35d916">
The snapshot tool fetched the reference image to compare it against the current screen and detected no differences, resulting in a success
5. Run the snapshot test (failure):
- We will deliberately change the image by setting the `OpacityOpaque` token to `OpacityTransparent` in class `OpacityTokenPage.swift`
<img width="561" alt="IntentionalTokenModification" src="https://github.com/user-attachments/assets/1d138b7b-2998-40b7-bf39-d9a597ced6c0">
- Test result failure :
<img width="897" alt="IntentionalUITestError" src="https://github.com/user-attachments/assets/0a6bb578-adba-42f1-abe8-e2f50ddba2a7">
The *swift-snapshot-testing tool* indicates that the issue originates from the transparent token illustration. We can observe that there are two paths: the first corresponds to our reference illustration (the one we intend to base our comparison on), while the second path is the illustration used for the current image of the application. You can open both paths and visually compare the differences.
7. Verify the output:
- It is recommended to use the `Show the Report Navigator` tool in Xcode :
<img width="512" alt="ShowReportNavigator_Xcode" src="https://github.com/user-attachments/assets/8d866d79-5dfc-46c7-934e-8d03ec1fc667">
- In Xcode go to :
```shell
ShowcaseTests -> ShowcaseTests/ShowcaseTests
```
<img width="1206" alt="TestResult_Failed_testAllOpacitiesOrangeThemeLight" src="https://github.com/user-attachments/assets/1793df83-ffc1-4226-8be2-fbd7e2b71deb">
8. Comparison (reference and failure):
**Reference:**
<img width="1307" alt="OpacityReferenceImage" src="https://github.com/user-attachments/assets/493dabde-4139-468f-a57b-10ee5a5269c1">
**Failure:**
<img width="1364" alt="OpacityFailureImage" src="https://github.com/user-attachments/assets/03cfe17f-3752-4aba-a482-f89d3b89f53d">
Such tests here are used to as to be sure the look and feel of any components and tokens rendering remaing the expected ones.
## Build phases
Expand Down Expand Up @@ -229,12 +289,24 @@ Signed-off-by: Foo FOO <foo email>
Signed-off-by: Bar BAR <bar email>
```

#### Integration of tokenator updates

You should refer to the [dedicated page in the wiki for more details](https://github.com/Orange-OpenSource/ouds-ios/wiki/20-%E2%80%90-How-to-update-tokens).

Keep in mind the commit adding *tokenator* updates in the codebase must be formatted like

```text
chore(🤖): update `OpacityRawTokens` (tokenator generation 20241021134644) (#225)
```

i.e. precise the tokens updated, the *tokenator* generation timestamp and the pull request number.

### About release note and changelog

We try also to apply [keep a changelog](https://keepachangelog.com/en/1.0.0/), and [semantic versioning](https://semver.org/spec/v2.0.0.html) both with [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).

We do not generate yet `RELEASE_NOTE.md` file using the Git history and [git cliff](https://git-cliff.org/) tool.
Today we update the unique CHANGELOG manualy, but you can find [in the wiki more details about the use of git-cliff](https://github.com/Orange-OpenSource/ouds-ios/wiki/8-%E2%80%90-About-changelog,-release-notes-and-hooks)
Today we update the unique CHANGELOG manualy, but you can find [in the wiki more details about the use of git-cliff](https://github.com/Orange-OpenSource/ouds-ios/wiki/52-%E2%80%90-About-changelog,-release-notes-and-hooks)

## Use of Gitleaks

Expand Down Expand Up @@ -299,23 +371,23 @@ Do not forget if possible to enable the warnings in the end of the file to reduc

### GitHub Action

We use also *GitHub Actions* so as to define a workflow with some actions to build demo application and test the library.
We use *GitHub Actions* so as to define a workflow with some actions to build demo application and test the library.
It will help us to ensure code on pull requests or being merged compiles and has all tests green.
This workflow is defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/build-and-test.yml)
This workflow is defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/build-and-test.yml), and makes build, unit tests and UI tests. Keep in mind we may have [some troubles with UI tests](https://github.com/Orange-OpenSource/ouds-ios/issues/305).

We have also a *gitleaks* workflow making some scans on the code to loook fo secrets leaks, defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/gitleaks-action.yml).
We have also a *gitleaks* workflow making some scans on the code to look fo secrets leaks, defined in [this YAML](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/workflows/gitleaks-action.yml).

We use also two GitHub apps making controls on pull requests and defining wether or not prerequisites are filled or not.
There is on control to check if [PR template are all defined ](https://github.com/stilliard/github-task-list-completed), and one if [DCO is applied](https://probot.github.io/apps/dco/).
There is one control to check if [PR template are all defined ](https://github.com/stilliard/github-task-list-completed), and one if [DCO is applied](https://probot.github.io/apps/dco/).

Finaly we have [this *GitHub Action*](https://github.com/cirruslabs/swiftlint-action) using _SwiftLint_ to ensure no warnings are in our codebase.

### GitLab CI (internal)

We use *GitLab CI*for CI/CD with our own runners so as to keep private our sensitive files likes certificates and provisioning profiles.
Our currant plan does not allow to make GitHub mirroring, so we use GitHub HTTP REST API to download sources, before using Xcode to build and sign.
Our current plan does not allow to make GitHub mirroring, so we use GitHub HTTP REST API to download sources, before using Xcode to build and sign.
However of course you will have to define all the variables, secrets and have the mandatory files.

You can find more details about the pipelines, how to set up runners and scripts to use [in the wiki](https://github.com/Orange-OpenSource/ouds-ios/wiki/9-%E2%80%90-About-continuous-integration-and-delivery).
You can find more details about the pipelines, how to set up runners and scripts to use [in the wiki](https://github.com/Orange-OpenSource/ouds-ios/wiki/51-%E2%80%90-About-continuous-integration-and-delivery).

In few words, there is a pipeline containing some stages and jobs to build alpha, nightly/beta and production releases.
35 changes: 32 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# Software description: A SwiftUI components library with code examples for Orange Unified Design System
#

# About runners: https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners
# Runners details: https://github.com/actions/runner-images/tree/main/images/macos

name: Build and Test

on:
Expand All @@ -32,7 +35,7 @@ on:
jobs:
# Build the app (if there are linter errors or compiler issues, it will fail)
build:
runs-on: macos-latest
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -56,8 +59,8 @@ jobs:
bundle exec fastlane buildDebugApp
# Test the library with unit tests
test:
runs-on: macos-latest
unit-test:
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -80,3 +83,29 @@ jobs:
cd Showcase
bundle exec pod install
bundle exec fastlane ios test
# Test the library with UI tests
ui-test:
runs-on: macos-15
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Xcode 16
run: |
sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'

- name: Install Fastlane
run: |
bundle install
- name: Run UI-based unit tests on demo app
run: |
cd Showcase
bundle exec pod install
bundle exec fastlane test_ui
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.6.0...0.7.0) - 2024-11-29

### Added

- [DemoApp] Add code sample for tokens usages in token pages ([#283](https://github.com/Orange-OpenSource/ouds-ios/issues/283))
- [Library] Color some new semantic tokens `colorContentStatus*`, `colorContentOnBrand*`, `colorContentOnStatus*`, `colorGradient*`, `colorBorder*`, `colorContentOnAction*`
- [Tool] Add UI tests in CI/CD pipelines ([#298](https://github.com/Orange-OpenSource/ouds-ios/issues/298))
- [DemoApp] Add more UI tests on demo app ([#154](https://github.com/Orange-OpenSource/ouds-ios/issues/154))

### Changed

- [Library] Update `GridSemanticTokens` tokens (tokenator *20241129080807*)
- [Library] Types `GridExtraCompactSemanticToken`, `GridCompactSemanticToken` and `GridRegularSemanticToken` replaced by `GridSemanticToken` to make tokenator updates integration easier
- [DemoApp] Update space tokens screen ([#275](https://github.com/Orange-OpenSource/ouds-ios/issues/275))
- [Library] Update `GridRawTokens` tokens (tokenator *20241128161629*)
- [DemoApp] Update color tokens screen
- [Library] Update `ColorSemanticTokens` tokens (tokenator *20241127112301*)
- [Library] Update `SpaceSemanticTokens` tokens (tokenator *20241127074206*)
- [Library] Update `SizeSemanticTokens` with rename of tokens (tokenator *20241126134156*)
- [Library] Update `ElevationSemanticTokens` (tokenator *20241126120657*)
- [Library] Improve Multiple-based objects for tokenator values integration ([#279](https://github.com/Orange-OpenSource/ouds-ios/issues/279))
- [Tool] Use `macos-15` runner for GitHub Actions builds ([#296](https://github.com/Orange-OpenSource/ouds-ios/issues/296))

### Removed

- [Library] Grid semantic tokens `gridExtraCompactColumnCount`, `gridCompactColumnCount` and `gridRegularColumnCount`
- [Library] Grid raw tokens `gridMargin900`
- [Library] Color semantic tokens `colorContentOnBg*`, `colorBorderOnBg*`, `colorBorderStatus*`, some `colorAction*OnBg*`, `colorDecorative{Primary,Secondary,Tertiary}`, `colorAlwaysOnBg*`, `colorBgBrand{Secondary,Tertiary}`, `colorContentBrand{Secondary,Tertiary}`, `colorBorderBrand{Secondary,Tertiary}`, `colorContentStatusAccent`, ...
- [Library] Some space semantic tokens type aliases to help tokenator job (`SpacePaddingInlineSemanticToken`, `SpacePaddingBlockSemanticToken`, `SpaceGapInlineSemanticToken`, `SpaceGapStackSemanticToken`)
- [Library] All dimension semantic tokens ([#308](https://github.com/Orange-OpenSource/ouds-ios/issues/308))

### Fixed

- [DemoApp] Fix VoiceOver issue with element grouping in presentation tokens and update accessibility statement ([#212](https://github.com/Orange-OpenSource/ouds-ios/issues/285))
- [Library] Warning issues for DocC catalogs ([#293](https://github.com/Orange-OpenSource/ouds-ios/issues/293))

## [0.6.0](https://github.com/Orange-OpenSource/ouds-ios/compare/0.5.0...0.6.0) - 2024-11-15

### Added
Expand Down
3 changes: 3 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Any use or displaying shall constitute an infringement under intellectual proper
./Showcase/Showcase/Resources/Assets.xcassets/Illustrations/il_tokens_grid_max_width.imageset/il_tokens_grid_max_width_dark.png
./Showcase/Showcase/Resources/Assets.xcassets/Illustrations/il_tokens_grid_min_width.imageset/il_tokens_grid_min_width.png
./Showcase/Showcase/Resources/Assets.xcassets/Illustrations/il_tokens_grid_min_width.imageset/il_tokens_grid_min_width_dark.png
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_chevron-down.imageset/ic_chevron-down.png
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_chevron-up.imageset/ic_chevron-up.png
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_copy.imageset/ic_copy.png
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_border.imageset/ic_border.svg
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_dimension.imageset/ic_dimension.svg
./Showcase/Showcase/Resources/Assets.xcassets/Tokens/ic_filter_effects.imageset/ic_filter_effects.svg
Expand Down
72 changes: 0 additions & 72 deletions OUDS/Core/Components/Sources/Buttons/OUDSButton.swift

This file was deleted.

4 changes: 2 additions & 2 deletions OUDS/Core/Components/Sources/Extensions/View+Font.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ extension View {
/// - familyName: The font family name to load later (e.g. "Luciole")
/// - token: The typography token to use to get useful values for `compact` or `regular` mode
/// - Returns: The `View` with the custom font applied
func customFont(familyName: String, typography token: MultipleTypographyTokens) -> some View {
func customFont(familyName: String, typography token: MultipleTypographyCompositeRawTokens) -> some View {
self.modifier(CustomFontModifier(token: token, fontFamilyName: familyName))
}

/// Applies a `FontModifier` to use the system font on the current `View` with a specific token
/// - Parameter token: The typography token to use to get useful values for `compact` or `regular` mode
/// - Returns: The `View` with the custom font applied
func systemFont(typography token: MultipleTypographyTokens) -> some View {
func systemFont(typography token: MultipleTypographyCompositeRawTokens) -> some View {
self.modifier(FontModifier(token: token))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct BorderModifier: ViewModifier {
private let radius: BorderRadiusSemanticToken

/// The color token used for the border
private let color: ColorSemanticToken
private let color: MultipleColorSemanticTokens

/// Color to apply depending to the `colorScheme`
private var colorToApply: Color {
Expand All @@ -45,7 +45,7 @@ struct BorderModifier: ViewModifier {
init(_ style: BorderStyleSemanticToken,
_ width: BorderWidthSemanticToken,
_ radius: BorderRadiusSemanticToken,
_ color: ColorSemanticToken) {
_ color: MultipleColorSemanticTokens) {
self.style = style
self.width = width
self.radius = radius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extension View {
style: BorderStyleSemanticToken,
width: BorderWidthSemanticToken,
radius: BorderRadiusSemanticToken,
color: ColorSemanticToken) -> some View {
color: MultipleColorSemanticTokens) -> some View {
self.modifier(BorderModifier(style, width, radius, color))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct CustomFontModifier: ViewModifier {
// MARK: - Properties

/// The typography style to apply
let token: MultipleTypographyTokens
let token: MultipleTypographyCompositeRawTokens

/// The name of the custom font family, should be registered previously in the app, like "Luciole".
let fontFamilyName: String
Expand Down
Loading

0 comments on commit 7463f43

Please sign in to comment.