question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

storysource addon: source of transpiled files

See original GitHub issue

Is your feature request related to a problem? Please describe. In my project I have to operate on transpiled (from TS to es6) *.stories.js files. They include source maps. Example:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_1 = require("@storybook/react");
react_1.storiesOf("Foo", module).add("test", () => React.createElement("div", null, "Foo"));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRm9vLnN0b3JpZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvU3RhdHVzTGFiZWwvX19kb2NzX18vRm9vLnN0b3JpZXMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUErQjtBQUMvQiw0Q0FBNkM7QUFFN0MsaUJBQVMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUUsQ0FBQyx1Q0FBYyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgKiBhcyBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IHN0b3JpZXNPZiB9IGZyb20gXCJAc3Rvcnlib29rL3JlYWN0XCI7XG5cbnN0b3JpZXNPZihcIkZvb1wiLCBtb2R1bGUpLmFkZChcInRlc3RcIiwgKCkgPT4gPGRpdj5Gb288L2Rpdj4pO1xuIl19

Describe the solution you’d like It would be great if storysource addon would support that kind of files. Currently it seems not recognize it and shows

1 loading source…

message. After debugging I noticed that loader is returning at line 11: https://github.com/storybooks/storybook/blob/next/addons/storysource/src/loader/index.js#L11

Describe alternatives you’ve considered No alternatives considered.

Are you able to assist bring the feature to reality? I can try.

Additional context Tagging @igor-dv as author of this plugin. Maybe you have some ideas/tips/workarounds how to achieve that?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
libetlcommented, Apr 23, 2019

Working on storysource V2, you will see the original source code of the story PLUS the local dependencies too.

0reactions
stale[bot]commented, Jun 19, 2019

Hey there, it’s me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Read more comments on GitHub >

github_iconTop Results From Across the Web

storysource addon: source of transpiled files #6593 - GitHub
In my project I have to operate on transpiled (from TS to es6) *.stories.js files. ... storysource addon: source of transpiled files #6593....
Read more >
@storybook/addon-storysource - npm
This addon is used to show stories source in the addon panel. Framework Support · Storysource Demo. Getting Started. Install using preset.
Read more >
@storybook/addon-storysource | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Writing a Storybook addon to show code examples - Medium
Import addon-storysource to the initial story file and use it in the decorator with the stringified source from #2.
Read more >
Dependencies | father | npm - Open Source Insights
arrow_right @babel/plugin‑proposal‑decorators. 7.4.4 Notes Relation Version 7.4.4 Published April 26, 2019 Descri... arrow_right @storybook/addon‑a11y. 5.3.22 Notes Relation Version 5.3.22 Published January 10, 2022 Descri...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found