Skip to content

Commit

Permalink
Merge branch 'main' into IOS-10448-RowList-A11y-update
Browse files Browse the repository at this point in the history
  • Loading branch information
dhidalgofadrique committed Sep 6, 2024
2 parents e6703fa + fe554bb commit 89cd6bb
Show file tree
Hide file tree
Showing 390 changed files with 11,815 additions and 1,074 deletions.
54 changes: 32 additions & 22 deletions .github/workflows/generate-mistica-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@ name: Generate Mistica Tokens

on:
workflow_dispatch:
inputs:
ref:
description: 'mistica-design repo changeset or branch'
required: false
default: 'production'

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
get-design-tokens:
name: Get Design Tokens
runs-on: self-hosted-novum-mac
build:
name: Build & generate tokens
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: scripts/mistica-skin-generator

- name: Generate Skin
run: make skin ref=${{github.event.inputs.ref}}
- name: Generate tokens
run: npm run generate
working-directory: scripts/mistica-skin-generator

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.NOVUM_PRIVATE_REPOS }}
add-paths: 'Sources/MisticaCommon/*'
commit-message: 'feat(skin): update design tokens'
title: 'feat(skin): update design tokens from mistica-design branch: ${{github.event.inputs.ref}}'
branch: 'import-design-tokens'
team-reviewers: 'ios'
delete-branch: true
- name: Create Pull Request
id: create_pr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.NOVUM_PRIVATE_REPOS }}
add-paths: 'Sources/MisticaCommon/*'
commit-message: 'feat(skin): update design tokens'
title: 'feat(skin): update design tokens from mistica-design'
branch: 'import-design-tokens'
team-reviewers: 'ios'
delete-branch: true
- name: Show URL in summary annotation
run: echo '::notice::Pull Request generated ${{ steps.create_pr.outputs.pull-request-url }}'
30 changes: 30 additions & 0 deletions .github/workflows/mistica-skin-generator-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mistica skin generator tests

on:
workflow_dispatch:
push:
paths:
- 'scripts/mistica-skin-generator/**'

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build & execute tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Install dependencies
run: npm install
working-directory: scripts/mistica-skin-generator

- name: Run tests
run: npm run test
working-directory: scripts/mistica-skin-generator
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ fastlane/test_output
# ci
.ruby-version
vendor/

# Mistica skin generator
scripts/mistica-skin-generator/.vscode
scripts/mistica-skin-generator/node_modules
scripts/mistica-skin-generator/package-lock.json
30 changes: 0 additions & 30 deletions .hygen.js

This file was deleted.

6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"eslint.workingDirectories": [
"scripts/mistica-skin-generator"
]
}
99 changes: 99 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,102 @@
# [33.0.0](https://github.com/Telefonica/mistica-ios/compare/v32.0.0...v33.0.0) (2024-08-26)


### Feat

* **Title:** Update title component and Mistica tokens ([#396](https://github.com/Telefonica/mistica-ios/issues/396)) ([d3df994](https://github.com/Telefonica/mistica-ios/commit/d3df994e732ac11151022c8aa7c8a4c74c6785eb)), closes [#397](https://github.com/Telefonica/mistica-ios/issues/397)


### BREAKING CHANGES

* **Title:** Add some title styles and modify the existing ones. Rename the color tokens from mistica-design.

* Update tokens

* Update tokens again

* Fix breaking change

# [32.0.0](https://github.com/Telefonica/mistica-ios/compare/v31.4.1...v32.0.0) (2024-08-19)


### Features

* **Title:** Split Title component and UIKit ([#395](https://github.com/Telefonica/mistica-ios/issues/395)) ([161ac6d](https://github.com/Telefonica/mistica-ios/commit/161ac6d6b50a2a0f98e9c4d068418aee445c4b00))


### BREAKING CHANGES

* **Title:** Rename TitleView with TitleHeaderFooterView. TitleHeaderFooterView will wrap the TitleView (Title component)

* Enable link interactions

* Extract Title component from TitleView (UITableViewHeaderFooterView)

* Rename and some fixes

* Rename tests path

* CR changes

## [31.4.1](https://github.com/Telefonica/mistica-ios/compare/v31.4.0...v31.4.1) (2024-08-01)


### Bug Fixes

* **Padding:** IOS-10430 fix component padding ([#393](https://github.com/Telefonica/mistica-ios/issues/393)) ([8ddd7eb](https://github.com/Telefonica/mistica-ios/commit/8ddd7eb8550e976df25447b707f2d56fcec90adc))

# [31.4.0](https://github.com/Telefonica/mistica-ios/compare/v31.3.0...v31.4.0) (2024-07-26)


### Features

* **Crouton:** Allow to show crouton on a exact viewController ([e30d0bc](https://github.com/Telefonica/mistica-ios/commit/e30d0bc8643b5a8d95de6cc436bd7f0b854a0698))

# [31.3.0](https://github.com/Telefonica/mistica-ios/compare/v31.2.0...v31.3.0) (2024-07-23)


### Features

* **Skeletons:** added Mistica Skeletons components for SwiftUI and UIKit ([e99d295](https://github.com/Telefonica/mistica-ios/commit/e99d29539843b3aacada462645ef6a51b53badc0))

# [31.2.0](https://github.com/Telefonica/mistica-ios/compare/v31.1.0...v31.2.0) (2024-07-18)


### Features

* **Snackbar:** allow setting the accesibility identifier via SnackbarConfig ([#386](https://github.com/Telefonica/mistica-ios/issues/386)) ([4f1e08c](https://github.com/Telefonica/mistica-ios/commit/4f1e08c8cd4a401fb93e450c53cf2676ec83aa01))

# [31.1.0](https://github.com/Telefonica/mistica-ios/compare/v31.0.0...v31.1.0) (2024-07-15)


### Features

* **InputField:** add numeric style and option to set textContentType ([#385](https://github.com/Telefonica/mistica-ios/issues/385)) ([1db8499](https://github.com/Telefonica/mistica-ios/commit/1db84993111c9042f4c958521d69637edee72180))

# [31.0.0](https://github.com/Telefonica/mistica-ios/compare/v30.5.0...v31.0.0) (2024-07-12)


### Features

* **MisticaColors:** Update MisticaColors and VivoNew palette ([24a0a7c](https://github.com/Telefonica/mistica-ios/commit/24a0a7c217d3d0c8e11508235d5d5e8feb7ef708))


### BREAKING CHANGES

* **MisticaColors:** Refactor backgroundContainerBrand color token as MisticaColor

# [30.5.0](https://github.com/Telefonica/mistica-ios/compare/v30.4.0...v30.5.0) (2024-07-12)


### Bug Fixes

* **iOS14:** Upgrade package to iOS 14 and remove iOS 13 dependencies ([f8e6578](https://github.com/Telefonica/mistica-ios/commit/f8e6578f85ddfea1022653a0dc7c32a62e82588c))


### Features

* **Accesibility:** Set sheet title label accessibility trait to header ([#384](https://github.com/Telefonica/mistica-ios/issues/384)) ([72ade6d](https://github.com/Telefonica/mistica-ios/commit/72ade6d1219fd546673041b1af9486e51ecfe9d6))

# [30.4.0](https://github.com/Telefonica/mistica-ios/compare/v30.3.0...v30.4.0) (2024-06-27)


Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ In order to automatise this, we can execute this [GitHub action](.github/.workfl
You can also execute it manually using the actions defined in the [Makefile](Makefile).
Example:
```bash
make skin ref=production
make skin
```

## Testing
Expand Down
64 changes: 9 additions & 55 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help setup format test simulator archive export clean skinGeneratorSetup colorPaletteGeneration cornerRadiusGeneration fontWeightsGeneration fontSizesGeneration skin
.PHONY: help setup format test simulator archive export clean skin

# Simulator
OS_VERSION := 17.2
Expand All @@ -22,53 +22,24 @@ BUILD_PATH := $(ROOT_DIR)/build
EXPORTED_OPTIONS_PATH := $(ROOT_DIR)/enterprise.plist
ARCHIVE_PATH := $(TMP_ROOT_PATH)/ios.xcarchive
XCODEBUILD := set -o pipefail && xcodebuild
MISTICA_DESIGN_PATH := $(ROOT_DIR)/tmp/mistica-design
MISTICA_DESIGN_TOKENS_PATH := /tokens
MISTICA_DESIGN_URL := https://raw.githubusercontent.com/Telefonica/mistica-design/$(ref)/tokens

#Skin tokens config
#These variables will be used to get the json file from mistica design repository and later to create the appropiate file and class/struct names. If a new brand/skin needs to be added, it should be added here. All of the brand names should be in lowercase.
Movistar:= movistar
Blau:= blau
O2:= o2
O2New:= o2-new
Vivo:= vivo
VivoNew:= vivo-new
Telefonica:= telefonica
TU:= tu
BRAND_FILES:= $(Movistar) $(Blau) $(O2) $(O2New) $(Vivo) $(VivoNew) $(Telefonica) $(TU) # List of all the brand names that will be procesed.

# Xcode
ifneq ($(origin GITHUB_ACTION),undefined)
export DEVELOPER_DIR=/Applications/Xcode-15.2.app/Contents/Developer
endif

# TokenGenerator func to be used in all token generators.
define tokenGenerator
@echo "Generating Mistica $(2) interfaces"
hygen $(1) Mistica$(2) --json $(MISTICA_DESIGN_PATH)$(MISTICA_DESIGN_TOKENS_PATH)/$(Movistar).json

for key in $(BRAND_FILES) ; do \
echo "Generating $$key $(2) palette"; \
hygen $(1) Brand$(2) --name $$key --json $(MISTICA_DESIGN_PATH)$(MISTICA_DESIGN_TOKENS_PATH)/$$key.json ; \
done
endef

# Targets
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " setup to set up dependencies"
@echo " format to execute swiftformat in Sources directory"
@echo " test to build and test the main target"
@echo " simulator to install the simulator for testing"
@echo " export to export the archived project as an .ipa"
@echo " export to export the archived project as an .ipa"
@echo " clean to remove all temporal files"
@echo " skinGeneratorSetup to setup skin dependencies"
@echo " colorPaletteGeneration ref=<ref> to setup and regenerate MisticaColors with new palettes from mistica design where <ref> is the branch from mistica-design repository from where we want to generate the tokens"
@echo " cornerRadiusGeneration ref=<ref> to setup and regenerate MisticaCornerRadius with new palettes from mistica design where <ref> is the branch from mistica-design repository from where we want to generate the tokens"
@echo " fontWeightsGeneration ref=<ref> to setup and regenerate MisticaFontWeights with new palettes from mistica design where <ref> is the branch from mistica-design repository from where we want to generate the tokens"
@echo " fontSizesGeneration ref=<ref> to setup and regenerate MisticaFontSizes with new palettes from mistica design where <ref> is the branch from mistica-design repository from where we want to generate the tokens"
@echo " skin ref=<ref> to setup, regenerate and format tokens from mistica design where <ref> is the branch from mistica-design repository from where we want to generate the tokens"
@echo " skin to regenerate and format tokens from mistica design"

trace:
@echo "Current xcodebuild configuration"
Expand All @@ -85,9 +56,9 @@ setup: trace
@brew ls xcbeautify --versions || brew install xcbeautify

skinGeneratorSetup:
@echo "Installing tokens generators dependencies"
@echo "Installing tokens generator dependencies"
@brew ls node --versions || brew install node
@brew ls hygen --versions || (brew tap jondot/tap && brew install hygen)
cd scripts/mistica-skin-generator && npm install

format:
Scripts/swiftformat .
Expand Down Expand Up @@ -131,25 +102,8 @@ export: clean setup

@rm -rf "$(TMP_ROOT_PATH)"

getMisticaDesignTokenFiles:
@echo "Obtaining mistica token files"
for key in $(BRAND_FILES) ; do \
curl -o $(MISTICA_DESIGN_PATH)$(MISTICA_DESIGN_TOKENS_PATH)/$$key.json --create-dirs $(MISTICA_DESIGN_URL)/$$key.json ; \
done

colorPaletteGeneration: skinGeneratorSetup getMisticaDesignTokenFiles
$(call tokenGenerator,ColorTokenGenerator,Colors)

cornerRadiusGeneration: skinGeneratorSetup getMisticaDesignTokenFiles
$(call tokenGenerator,CornerRadiusTokenGenerator,CornerRadius)

fontWeightsGeneration: skinGeneratorSetup getMisticaDesignTokenFiles
$(call tokenGenerator,FontWeightsTokenGenerator,FontWeights)

fontSizesGeneration: skinGeneratorSetup getMisticaDesignTokenFiles
$(call tokenGenerator,FontSizesTokenGenerator,FontSizes)

removeMisticaDesignTokenFolder:
rm -rf $(MISTICA_DESIGN_PATH)
tokensGeneration:
@echo "Executing tokens generation tool..."
cd scripts/mistica-skin-generator && npm run generate

skin: colorPaletteGeneration cornerRadiusGeneration fontWeightsGeneration fontSizesGeneration removeMisticaDesignTokenFolder format
skin: tokensGeneration format
Loading

0 comments on commit 89cd6bb

Please sign in to comment.