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

Migrate @storybook/components to TS - Part II #6500

Merged
merged 6 commits into from
Apr 16, 2019
Merged

Migrate @storybook/components to TS - Part II #6500

merged 6 commits into from
Apr 16, 2019

Conversation

gaetanmaisse
Copy link
Member

Issue: #5030

What I did

  • 📦 Use @storybook/components typings in addons
  • 🛠 Refactor some imports/exports to avoid default exports

@vercel
Copy link

vercel bot commented Apr 12, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Latest deployment for this branch: https://monorepo-git-fork-gaetanmaisse-ts-migratio.storybook.now.sh

@gaetanmaisse
Copy link
Member Author

@ndelangen any idea why @storybook/components do not build before other libs that need it to compile? That's what currently makes build failed:
https://circleci.com/gh/storybooks/storybook/117868?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-checks-link

@codecov
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Merging #6500 into next will not change coverage.
The diff coverage is 93.33%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #6500   +/-   ##
=======================================
  Coverage   40.81%   40.81%           
=======================================
  Files         616      616           
  Lines        8519     8519           
  Branches      535      535           
=======================================
  Hits         3477     3477           
  Misses       4950     4950           
  Partials       92       92
Impacted Files Coverage Δ
...rc/syntaxhighlighter/syntaxhighlighter.stories.tsx 100% <ø> (ø) ⬆️
...ents/src/typography/DocumentFormatting.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/tooltip/WithTooltip.stories.tsx 100% <ø> (ø) ⬆️
.../components/src/tooltip/TooltipMessage.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/tooltip/ListItem.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/form/form.stories.tsx 100% <ø> (ø) ⬆️
...onents/src/syntaxhighlighter/syntaxhighlighter.tsx 56.09% <ø> (ø) ⬆️
lib/components/src/Badge/Badge.stories.tsx 100% <ø> (ø) ⬆️
...ib/components/src/typography/link/link.stories.tsx 100% <ø> (ø) ⬆️
...components/src/placeholder/placeholder.stories.tsx 100% <ø> (ø) ⬆️
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd20c4b...f1279d9. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 15, 2019

Codecov Report

Merging #6500 into next will not change coverage.
The diff coverage is 92.85%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next    #6500   +/-   ##
=======================================
  Coverage   40.77%   40.77%           
=======================================
  Files         616      616           
  Lines        8529     8529           
  Branches      595      595           
=======================================
  Hits         3478     3478           
  Misses       4959     4959           
  Partials       92       92
Impacted Files Coverage Δ
...rc/syntaxhighlighter/syntaxhighlighter.stories.tsx 100% <ø> (ø) ⬆️
...ents/src/typography/DocumentFormatting.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/tooltip/WithTooltip.stories.tsx 100% <ø> (ø) ⬆️
.../components/src/tooltip/TooltipMessage.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/tooltip/ListItem.stories.tsx 100% <ø> (ø) ⬆️
...components/src/placeholder/placeholder.stories.tsx 100% <ø> (ø) ⬆️
...onents/src/syntaxhighlighter/syntaxhighlighter.tsx 56.09% <ø> (ø) ⬆️
lib/components/src/Badge/Badge.stories.tsx 100% <ø> (ø) ⬆️
...ib/components/src/typography/link/link.stories.tsx 100% <ø> (ø) ⬆️
lib/components/src/form/form.stories.tsx 100% <ø> (ø) ⬆️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a55ee0...bb78d74. Read the comment docs.

@gaetanmaisse
Copy link
Member Author

Build is failing for cyclic dependencies reason, for more details see #6523.

Remove `@storybook/react` and `@storybook/addon-actions` from devDependencies of `@storybook/components` to avoid lerna to find cyclic dependency.
Also add them to ts-lint no-implicit-dependencies whitelist to avoid tslint error.

For more details about this see:#6523
As `@storybook/components` is now in TS (and so export its types) there is no more need to declare it in `typings.d.ts` of addons written in TS
Named exports enables better IDE integration and simplify a lot code refactoring
@gaetanmaisse gaetanmaisse merged commit 2887028 into storybookjs:next Apr 16, 2019
@gaetanmaisse gaetanmaisse deleted the ts-migration/components-part-2 branch April 16, 2019 14:38
@gaetanmaisse gaetanmaisse added this to the 5.1.0 milestone Apr 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
components maintenance User-facing maintenance tasks typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants