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

chore: ts strict fixes for ui theme #3400

Merged
merged 3 commits into from
Feb 8, 2023
Merged

chore: ts strict fixes for ui theme #3400

merged 3 commits into from
Feb 8, 2023

Conversation

dbanksdesign
Copy link
Contributor

Description of changes

Issue #, if available

Description of how you validated changes

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated
  • No side effects or sideEffects field updated
  • Relevant documentation is changed or added (and PR referenced)

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

@dbanksdesign dbanksdesign requested a review from a team as a code owner February 8, 2023 20:43
@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2023

🦋 Changeset detected

Latest commit: a8d9c4c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@aws-amplify/ui Patch
@aws-amplify/ui-react-core Patch
@aws-amplify/ui-react-native Patch
@aws-amplify/ui-react Patch
@aws-amplify/ui-vue Patch
@aws-amplify/ui-angular Patch

Not sure what this means? Click here to learn what changesets are.

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

@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 21:02 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 21:02 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 21:02 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 21:02 — with GitHub Actions Inactive
0618
0618 previously approved these changes Feb 8, 2023
@@ -65,7 +65,7 @@ export function isDesignToken(value: unknown): value is WebDesignToken {
return isObject(value) && has(value, 'value');
}

export function isShadowToken(value: unknown): value is ShadowValue {
export function isShadowToken(value: unknown): value is ShadowValue & object {
Copy link
Member

Choose a reason for hiding this comment

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

Fairly certain that the definition of ShadowValue can resolve to either an object of shadow props or string. Not fully related to this PR but maybe we should rename this to something more explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, isShadowObject it is

declare module 'style-dictionary/lib/utils/references/usesReference.js' {
// based on the typing specified by style-dictionary:
// https://github.com/amzn/style-dictionary/blob/main/lib/utils/references/usesReference.js
export default function usesReference(value: string): boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there potential for drift on these types? I'm assuming these types cannot be exported from style-dictionary, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct, something if I ever get time to do I would like to rewrite the whole thing in TS and expose the correct types with better exports so we don't have to import specific files. There are a lot of projects that do this so I promise not to break any of these paths :)

reesscot
reesscot previously approved these changes Feb 8, 2023
wlee221
wlee221 previously approved these changes Feb 8, 2023
@dbanksdesign dbanksdesign dismissed stale reviews from wlee221, reesscot, and 0618 via a8d9c4c February 8, 2023 22:55
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 23:39 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 23:39 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 23:39 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign temporarily deployed to ci February 8, 2023 23:39 — with GitHub Actions Inactive
@dbanksdesign dbanksdesign enabled auto-merge (squash) February 8, 2023 23:48
@dbanksdesign dbanksdesign merged commit d214551 into main Feb 8, 2023
@dbanksdesign dbanksdesign deleted the ts-strict/ui-theme branch February 8, 2023 23:51
@github-actions github-actions bot mentioned this pull request Feb 8, 2023
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