close
The Wayback Machine - https://web.archive.org/web/20220318201121/https://github.com/storybookjs/storybook/pull/11885
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 requested review from alterx, igor-dv and tmeasday as code owners Aug 11, 2020
@yannbf yannbf self-assigned this Aug 11, 2020
@github-actions
Copy link

@github-actions github-actions bot commented Aug 11, 2020

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

@yannbf yannbf requested review from shilman and ndelangen Aug 11, 2020
@shilman shilman added bug and removed patch labels Aug 11, 2020
@shilman shilman changed the base branch from next to master Aug 11, 2020
@shilman shilman changed the base branch from master to next Aug 11, 2020
@shilman shilman added the patch label Aug 11, 2020
@shilman shilman changed the base branch from next to master Aug 11, 2020
Copy link
Member

@shilman shilman left a comment

@yannbf LGTM! 🙏

@shilman shilman changed the base branch from master to next Aug 11, 2020
@shilman shilman merged commit da13fa1 into next Aug 11, 2020
41 of 43 checks passed
@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 picked label Aug 11, 2020
shilman added a commit that referenced this issue Aug 11, 2020
…support

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

@jimmyandrade jimmyandrade left a comment

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants