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

Core: Fix support for main.ts/preview.ts files #11885

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Aug 11, 2020

Issue: #11763

This is basically the same as #10099, for in depth information please check the description of that PR.

What I did

TLDR: @babel/register is a dependency of a few libs in the monorepo, and that's why the examples using main.ts work. As soon as a user installs storybook in their projects, they don't have that dependency, which is required for server to be able to resolve ts files.

How to test

1 - start a new storybook project with storybook 6 or just use sb upgrade in an existing project
2 - run yarn storybook and see it working fine.
2 - rename main.js to main.ts
3 - run yarn storybook and see it failing.
4 - install yarn add @babel/register -D
5 - run yarn storybook and see it working fine again.

- This is currently required to add support for
typescript config files like maint.ts and preview.ts
@yannbf yannbf self-assigned this Aug 11, 2020
@yannbf yannbf added core patch:yes Bugfix & documentation PR that need to be picked to main branch labels Aug 11, 2020
@github-actions
Copy link
Contributor

Fails
🚫

PR is not labeled with one of: ["cleanup","doc-dependencies:update","BREAKING CHANGE","feature request","bug","documentation","maintenance","dependencies:update","dependencies","other"]

Generated by 🚫 dangerJS against 236f3f4

@shilman shilman added bug and removed patch:yes Bugfix & documentation PR that need to be picked to main branch labels Aug 11, 2020
@shilman shilman changed the base branch from next to master August 11, 2020 09:38
@shilman shilman changed the base branch from master to next August 11, 2020 09:40
@shilman shilman added the patch:yes Bugfix & documentation PR that need to be picked to main branch label Aug 11, 2020
@shilman shilman changed the base branch from next to master August 11, 2020 09:41
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

@yannbf LGTM! 🙏

@shilman shilman changed the base branch from master to next August 11, 2020 09:42
@shilman shilman merged commit da13fa1 into next Aug 11, 2020
@shilman shilman changed the title Core: Improve support for main.ts/preview.ts files Core: Fix support for main.ts/preview.ts files Aug 11, 2020
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Aug 11, 2020
shilman added a commit that referenced this pull request Aug 11, 2020
…support

Core: Improve support for main.ts/preview.ts files
Copy link
Member

@jimmyandrade jimmyandrade left a comment

Choose a reason for hiding this comment

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

LGTM

@stof stof deleted the patch/add-ts-config-files-support branch May 25, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants