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

build: token processing updates #5004

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

castastrophe
Copy link
Contributor

@castastrophe castastrophe commented Jan 3, 2025

Description

Main file for review: scripts/generate-tokens-wrapper.js

  • Clean the tools/styles/(tokens|tokens-v2) folders before generating asssets
    • Why? This was not being done previously leading to outdated assets being retained in the library and causing invalid token output.
  • Using require to fetch the packages from node_modules rather than specifying the location to better facilitate linking
  • Remove the custom-*.css assets from import because that content is already concatenated in the (dark|light|medium|large)-vars.css files.
  • Rename the component-vars.css in the tools/styles/tokens* directories to system-theme-bridge.css for improved clarity.

Along for the ride

  • Removed chalk dependency in favor of the smaller colors package
  • tasks/process-spectrum.js removed the chalk reference and as such, also had to resolve the lint errors in order to push up that change (removed unused variables reported and replaced ts-ignore with ts-expect-error)
  • tasks/css-tools.js

Motivation and context

By sourcing the system theming from the components, it lets us ensure the component theming provided matches the version of the component the SWC library supports. Previously, CSS was copying the theming assets from the component packages and bundling them in the token package to streamline their use by SWC. Now that we're making this update though, we can harden that pipeline to ensure the correct system mappings are being used and allowing SWC the freedom to rely on older versions of some components than others might be at while still advancing the tokens library.

How has this been tested?

  • Expect to see no changes in visual regression testing
    1. Though what assets are being shipped for theming has changed, the content of those assets has not changed and so we expect to see no visual change.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • If my change required a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • [n/a] I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices

Best practices

This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against main.

Copy link

changeset-bot bot commented Jan 3, 2025

⚠️ No Changeset found

Latest commit: bc101e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@castastrophe castastrophe self-assigned this Jan 3, 2025
@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch from 3c6a732 to 27dd0c7 Compare January 3, 2025 22:36
Copy link

github-actions bot commented Jan 3, 2025

Branch preview

Review the following VRT differences

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@coveralls
Copy link
Collaborator

coveralls commented Jan 3, 2025

Pull Request Test Coverage Report for Build 12793875349

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.209%

Totals Coverage Status
Change from base Build 12777756120: 0.0%
Covered Lines: 33006
Relevant Lines: 33430

💛 - Coveralls

@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch from 27dd0c7 to 6bb929e Compare January 3, 2025 22:56
Copy link

github-actions bot commented Jan 4, 2025

Tachometer results

Currently, no packages are changed by this PR...

@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch from 6bb929e to b8192bd Compare January 4, 2025 16:26
@TarunAdobe TarunAdobe marked this pull request as ready for review January 9, 2025 06:28
@TarunAdobe TarunAdobe requested a review from a team as a code owner January 9, 2025 06:28
Copy link
Contributor

@TarunAdobe TarunAdobe left a comment

Choose a reason for hiding this comment

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

This looks good!! Thanks for working on it.

package.json Show resolved Hide resolved
tasks/process-spectrum.js Outdated Show resolved Hide resolved
tasks/css-tools.js Show resolved Hide resolved
packages/tags/package.json Outdated Show resolved Hide resolved
@rubencarvalho
Copy link
Collaborator

Is there a possibility of incorporating the changes from #4999 into this PR? Or are these things that should not get addressed together?

scripts/generate-tokens-wrapper.js Show resolved Hide resolved
scripts/generate-tokens-wrapper.js Show resolved Hide resolved
scripts/generate-tokens-wrapper.js Show resolved Hide resolved
scripts/generate-tokens-wrapper.js Show resolved Hide resolved
scripts/generate-tokens-wrapper.js Show resolved Hide resolved
@Rajdeepc
Copy link
Contributor

Rajdeepc commented Jan 10, 2025

Is there a possibility of incorporating the changes from #4999 into this PR? Or are these things that should not get addressed together?

This is a good call to pull in the changes from #4999. I don't see any side effects here

@Rajdeepc Rajdeepc closed this Jan 10, 2025
@Rajdeepc Rajdeepc reopened this Jan 10, 2025
@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch 12 times, most recently from 717720f to d392b20 Compare January 10, 2025 17:51
@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch 8 times, most recently from 93ad92a to f05de1e Compare January 10, 2025 22:06
@@ -14,7 +14,7 @@ parameters:
# 3. Commit this change to the PR branch where the changes exist.
current_golden_images_hash:
type: string
default: a095ed1ef88686fdb24936dad763598ac7981193
default: 93ad92a2fc031db0277fee635434955e438e94a9
Copy link
Contributor Author

Choose a reason for hiding this comment

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

VRTs showed a fix in the checkbox which is now picking up the correct corner radius for Spectrum 2 🥳

@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch 9 times, most recently from 7a16da6 to 535c7bd Compare January 14, 2025 19:33
Copy link
Collaborator

@rubencarvalho rubencarvalho left a comment

Choose a reason for hiding this comment

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

Thank you for landing this! I left a small comment about a JSDoc, but it’s non-blocking.

tasks/css-tools.js Show resolved Hide resolved
@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch from 362be0a to bc101e6 Compare January 15, 2025 15:00
@castastrophe castastrophe force-pushed the castastrophe/build-token-processing-updates branch from bc101e6 to 8fe05ed Compare January 15, 2025 17:36
@castastrophe castastrophe merged commit 8d516db into main Jan 15, 2025
24 of 27 checks passed
@castastrophe castastrophe deleted the castastrophe/build-token-processing-updates branch January 15, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants