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

3.0 #636

Merged
merged 92 commits into from
May 25, 2021
Merged

3.0 #636

merged 92 commits into from
May 25, 2021

Conversation

dbanksdesign
Copy link
Member

@dbanksdesign dbanksdesign commented May 24, 2021

Issue #, if available:

Description of changes: This is the merge of the 3.0 branch into main to launch the official release of 3.0!

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

7studio and others added 30 commits July 20, 2020 09:48
Introduce two new entries on property/design token object:

* `filePath`: the file path where the property comes from.
* `isSource`: describe if the property is a source or an include.

Co-authored-by: Xavier Zalawa <xavier@7studio>
Co-authored-by: Danny Banks <djb@amazon.com>
* Added node v14 in .travis.yml + bumped up nodejs to v12 (package.json)
Fixes #307

For any token definition that includes the property
`themeable: true`, a `!default` will now be added in
the scss/variables format.
`style-dictionary build` and `style-dictionary clean` were not using the same config path defaults. This fixes that.
Fixes #208

Transformations can only be executed, if the value to be transformed, has no references in it. So resolving may lead to enable further transformations, and sub sequent resolving may enable even more transformations - and so on. This change enables this transitive dependencies.
backwards compatibility for the transitive transforms functionality, turns it from a breaking change into a non-breaking change
Adding javascript module .cjs format
 Adding an example of how someone could automatically generate 1:1 token files based on a custom filter. #251
dbanksdesign and others added 22 commits March 26, 2021 15:41
fixes #589 

* Organized formatHelpers into their own files
* Renamed getReference to getReferences and changed it to return an array of references for cases when there are multiple references in a single value.
* Renamed sortAllProperties format helper to sortByReference to be more clear and made changes to support interpolated values and to not mutate the allProperties array. This caused some of the sorting changes in some of the snapshots.
* Added createPropertyFormatter format helper which will return a formatting function based on some configuration to be used in formats when iterating over allProperties. The formattedVariables format helper uses this function as well as several formats to remove duplicate code.
* Updated some formats to use the new format helpers
* Updated the flutter/dart.class to use the sorting when using outputReferences
Fixes #608 
Due to the changes we made with for transitive transforms, the code that checks for a circular reference was breaking because it was deferring resolution and therefore created an infinite loop of trying to resolve references but deferring some. This change fixes that by keeping track of how many deferred properties there are and if that number does not decrease with a pass then there is a circular reference. We then try to resolve the object one more time, without deferring any references so that the resolveObject method can record the circular references.
Fixes #612 
Formatting options in the `fileHeader` format helper function were being overridden by the default formatting options.
Fixes #601 

* Remove butterknife
* Update gradle to 6.8.2 and gradle plugin 4.1.3
* Use androidX
* Compile and Target SDK - 30
* Add kotlin support.
* Convert Java to Kotlin
* Upgrade Jackson library to 2.12.3
* Remove unused and commented out code, fix license text

Co-authored-by: mykhailo.kovalyk <mykhailo.kovalyk@eleks.com>
Fixes #478

Add support for Jetpack Compose output via a new `compose/object` format and associated transforms.

Adds a new `compose` transform group includes four new transforms:
* `color/composeColor` (e.g. val backgroundRed = Color(0xFFAA0000))
* `size/compose/em` (e.g. val spacingLarge = 28.em)
* `size/compose/remToSp` (e.g. val spacingLarge = 26.sp)
* `size/compose/remToDp` (e.g. val spacingLarge = 16.00.dp)
Fixes #571 #159 #605
* Renamed "style properties" to "design tokens"
    * Adding tokens and allTokens to the core internal data structure to be consistent with this change. This is purely additional, properties and allProperties still exist and this should not break existing code. Moving forward examples should use tokens rather than properties.
    * properties.md -> tokens.md
    * Adding more content in this doc page about:
        * All potential attributes #605
        * Default attributes Style Dictionary adds
        * More info on what categories the CTI currently supports #571
        * Information on file formats for token files, including JS modules #159, and custom parsers for token files
* Updated broken links (linking to "master" branch instead of "main")
* Updated the examples page with all new examples
* Added a page on custom parsers
* Added information about transitive transforms
* Removed "docs/build_process.md" in favor of "docs/architecture.md" because the content was mostly the same.
* Cleaned up configuration content
    * Updated language around config file formats and how to define the configuration
    * Added information about configuration attributes and separated it out into sections: top-level config attributes including customization, platform attributes, and file attributes, for readability
* Cleaning up some spacing and headers in markdown files
Fixes #615

Token values that are objects as opposed to simple strings were not working with `outputReferences` and throwing an error. These changes fix some behavior and make sure certain scenarios don't fail. This makes explicit what `outputReferences` can and can't do:
* The `value` must be a string at time of formatting. This should be the case anyways, if not you will get `[object Object]` in output files. With `outputReferences` this was failing because an object does not have the `.replace` function. 
* The `value` must have the referenced values in it for `outputReferences` to replace the resolved values with the reference's name. For example if you define a color using an HSL object and transform it to a hex value, we cannot undo that transform to understand which parts of the value to use the reference's name. 
* References to non-token's will not work with `outputReferences` because the references will not have a `name` attribute. Just like the previous point, it will build fine, but just won't output the reference and instead output the transformed and resolved value. 

Changes:
* In `createPropertyFormatter`, rather than looking at the *original* value and replacing references with the referenced token's name, we are now looking at the *transformed* value and replacing any referenced *values* with the reference's name. This allows us to still use `outputReferences` with a value object. 
* Updated `getReferences` to mirror `usesReference` with respect to object values. `usesReference` checks the object values, whereas `getReferences` did not.
Fixes #425
* add 'typescript/es6-declarations' formats for .d.ts
* add 'typescript/module-declarations' formats for .d.ts

Co-authored-by: Michal Szura <michal.szura@ig.com>
* Updating the typescript formats to use the updated format arguments
* Using a shared DesignToken type for typescript/module-definitions format as well as in our types
* Fixed a lot of missing and incorrect things in our type definitions
* Separated types out into their own files for readability
@chazzmoney
Copy link
Collaborator

chazzmoney commented May 24, 2021

This is going to take me a couple months to review...

Copy link
Collaborator

@chazzmoney chazzmoney left a comment

Choose a reason for hiding this comment

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

Just kidding. WOOHOO 3.0!!!!!

LETS GETS THIS MERGED! :shipit:

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.