Skip to content
This repository has been archived by the owner on Apr 13, 2022. It is now read-only.

TS and new structures #97

Merged
merged 16 commits into from
Feb 19, 2020
Merged

TS and new structures #97

merged 16 commits into from
Feb 19, 2020

Conversation

danrosenthal
Copy link
Contributor

No description provided.

@kaelig kaelig temporarily deployed to polaris-toke-ts-and-new-jungi5 February 5, 2020 20:46 Inactive
@danrosenthal danrosenthal changed the base branch from master to next February 5, 2020 20:46
src/utils.ts Outdated
}

function tokensToJson(data) {
// TODO: type data
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll need to address this one, but I still need to wrap my head around the shape of data

@kaelig kaelig temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 01:46 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 02:33 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 03:05 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 03:14 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 03:14 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 05:32 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 05:37 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 20:00 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 6, 2020 20:07 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 01:21 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 01:24 Inactive
@BPScott
Copy link
Member

BPScott commented Feb 19, 2020

Hoo boy this does a bunch of stuff.

Most of this is based around the idea that having one dist folder that both new and old stuff go into is confusing, and that we should stop that, so that the delineation is clearer and we have a more obvious migration path when it comes to removing the old tokens.

  • Adds typescript! and moves the color-factory stuff from formats/utils into src. The contents of the src file then get compiled into dist-modern
  • Migrates the tests folder to use typescript
  • build the generated themes and palettes into dist-modern/themes and dist-modern/palettes folders
  • The dist-modern folder is ignored by git and it is built as part of the shipit publish (the dist folder remains because the .clr files can only be build on macs. We should remove this in v3 to allow the dist folder generated on demand instead of checked in to git)
  • Renames some of the build scripts so now there is a build-modern (which generates stuff in dist-modern) and build-legacy (which generates stuff in dist) and build-docs (which generates stuff in docs).
  • Removes the yarn.lock from the published package because it's 700kb of pointless

To test

Run yarn run build and see that the contents of the dist-modern folder are populated, and that the contents of the dist folder is unchanged.
Run npm pack to create a .tgz then unzip it and confirm that dist-modern is included the npm package
Run bundle exec rake build followed by gem unpack pkg/* and confirm that dist-modern is included in the rubygem


After this gets merged into the next branch:

  • Cut a new beta release - While the above looks good it'd be nice to prove we can use the created packages and that the dist-modern folder gets created within shipit before publish.
  • Consider the structure of themes and palettes and how they'd play nice with adding future customizable tokens (e.g. spacing) into those data structures in a non-breaking way. If about to call this a 2.x minor release with no breaking changes from the existing dist contents then it'd be nice to have a plan for adding extra tokens without needing a breaking change.
  • Merge next into master and call this a 2.x release that

@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 01:41 Inactive
@BPScott BPScott changed the title [WIP] TS and new structures TS and new structures Feb 19, 2020
@BPScott BPScott marked this pull request as ready for review February 19, 2020 17:33
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 19:39 Inactive
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 19:41 Inactive
BPScott and others added 4 commits February 19, 2020 11:43
Removes root color-factory.js (instead import from
polaris-tokens/dist-modern/)

compile to cjs

Update theo transform to read from dist-modern

Run ts build before gulp runs

Colocate color-factory test next to color-factory.ts
@BPScott BPScott temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 19:43 Inactive
@kaelig kaelig temporarily deployed to polaris-toke-ts-and-new-yeornv February 19, 2020 19:51 Inactive
@BPScott BPScott merged commit 29e49bd into next Feb 19, 2020
@BPScott BPScott deleted the ts-and-new-structures branch February 19, 2020 19:54
danrosenthal added a commit that referenced this pull request Feb 20, 2020
  * Added surface disabled variant and updated other variant configs ([#101](#101))
  * Added TypeScript build for modern tokens, and shifted directory structures to differentiate between legacy and modern tokens ([#97](#97))
  * Updated variant names and descriptions ([#96](#96))
  * Added decorative icon variants ([#94](#94))
  * Built changes from previous release, and added textOnInteractive variant ([#93](#93))
  * Fixed an issue where legacy themes caused the color factory to throw ([#92](#92))
  * Update color variants for consistency with changes in Polaris React ([#91](#91))
  * Marked the config as optional and the colors as partial ([dd3d8fc](https://github.com/Shopify/polaris-tokens/commit/
  * Actually exporting the types would be helpful ([4998856](4998856))
  * Added the Color Factory. Long live the Color Factory! ([#89](#89))

Co-authored-by: Dan Rosenthal <dan.rosenthal@shopify.com>
Co-authored-by: Ben Scott <227292+BPScott@users.noreply.github.com>
Co-authored-by: Kyle Durand <kyle.durand@shopify.com>
Co-authored-by: Sara Hill <sara.hill@shopify.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants