Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-10444 Mistica tokens generator #387

Merged
merged 11 commits into from
Jul 31, 2024
Merged

IOS-10444 Mistica tokens generator #387

merged 11 commits into from
Jul 31, 2024

Conversation

amegias
Copy link
Contributor

@amegias amegias commented Jul 22, 2024

🎟️ Jira ticket

https://jira.tid.es/browse/IOS-10444

πŸ₯… What's the goal?

Fix the mistica tokens generator which is broken due to the gradient colors.

🚧 How do we do it?

  • I've created a sub-folder in the project and develop a new tool in js to get the files and add the logic to resolve the Mistica colors problem. The previous tool was very simple and I need to add logic to decide if a color is gradient, solid,... depending on the rest of the brands.
    image

  • I've added doc to this folder

  • I've added tests to this tool. I will execute it from GH actions.

  • I will automatise it from GH actions since it can be executed in a linux runner (IOS-10444 Mistica importer from GH ActionsΒ #390).

πŸ§ͺ How can I verify this?

Part I

Captura de pantalla 2024-07-23 a las 10 28 21
I've generated & pushed the new generated files. The tests passed.
I've restored because I don't want to add noise to this PR.

Part II

  1. Check out this branch
  2. Execute make skin
  3. Verify it doesn't throw errors + it has generated our Swift files

@amegias amegias force-pushed the mistica-importer branch 3 times, most recently from 80b37cb to 7e32160 Compare July 22, 2024 15:59
@@ -17,15 +12,16 @@ jobs:
uses: actions/checkout@v3

- name: Generate Skin
run: make skin ref=${{github.event.inputs.ref}}
run: make skin
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still pending, I want to modify this to have:

  • one action to generate tokens in a linux machine (we don't need a macslave here)
  • one action to execute tests when something changes in /scripts/mistica-tokens-generator


import UIKit

public extension BrandStyle {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a different file since it shouldn't be auto-generated

@amegias
Copy link
Contributor Author

amegias commented Jul 23, 2024

@atabel could you give me feedback about js stuff please? :)
setup, package, dependencies, tests, generic rules in my js code ;)

@amegias amegias changed the title Mistica importer Mistica tokens generator Jul 23, 2024
@amegias amegias marked this pull request as ready for review July 23, 2024 10:22
@amegias amegias changed the title Mistica tokens generator IOS-10444 Mistica tokens generator Jul 23, 2024
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will always get the production branch.
I've added doc to change this but I think it was not useful in the past...

import { reduceColors } from "../reduce-colors";
import { generateBrandColors } from "../brand-colors-generator";

describe("generateBrandColors", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each test file is in charge of one generator.
I pass a real input and compare with an expected content

@amegias amegias requested review from DavidMarinCalleja and removed request for idenjoe July 24, 2024 07:45
Copy link
Contributor

@DavidMarinCalleja DavidMarinCalleja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@alejandroruizponce alejandroruizponce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Master in JS!

* Tests action for the tool

* Create a new workflow for mistica-skin-generator-tests and modify the generation flow to generate tokens

* Test show URL

* Clean up
@amegias amegias merged commit b63687b into main Jul 31, 2024
2 checks passed
@amegias amegias deleted the mistica-importer branch July 31, 2024 09:52
@tuentisre
Copy link
Collaborator

πŸŽ‰ This PR is included in version 31.4.1 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants