79 Commits

Author SHA1 Message Date
Eirik Sletteberg
6e250f9110 Import extraverse with ESM import instead of require()
Reason: When using modern builders like Vite, the source code in Storybook
must be ESM-compatible. The mix of imports and require in the same file
confused the Vite build tool, preventing the essential addons from working.
2021-04-18 10:38:45 +02:00
Michael Shilman
9f95a20ec6 Source-loader: Revert sourcemaps 2021-03-11 12:33:34 +08:00
Norbert de Langen
04acc44510
Change /dist to ESM && upgrade required dependencies to make this happen & deal with the consequences 2020-11-26 10:50:46 +01:00
Michael Shilman
3231e8d755
Merge pull request #12277 from ankon/pr/source-loader-sourcemaps
Source-loader: Generate sourcemaps
2020-10-07 11:08:15 +08:00
Josh Soref
7fe8e014bf spelling: store
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2020-09-29 09:42:31 -04:00
Andreas Kohn
bf0a59cc13
Generate sourcemaps in the source-loader 2020-09-11 23:51:06 +02:00
Michael Shilman
0c8b9ac0d9 Soruce-loader: Export extract-source in its own entry point 2020-09-09 16:52:18 +08:00
Blaine Bublitz
f1fe9dae38 Split extractSource into own module & export 2020-08-24 18:38:03 -07:00
Peter Mikitsh
dc607d9cf7 fix(storysource): support default exports of type TSAsExpression 2020-08-17 22:59:40 -07:00
Michael Shilman
dfc86f6e99 Source-loader: Fix .add detection 2020-08-12 16:26:54 +08:00
Michael Shilman
f58efb32c5 Fix deepscan 2020-08-03 11:25:13 +08:00
Michael Shilman
e5e7a33b41 Fix deepscan 2020-08-03 11:22:59 +08:00
Michael Shilman
5b28117124 Source-loader: Always generate __STORY__ preamble to fix storiesOf source 2020-08-03 11:07:22 +08:00
Michael Shilman
b4deb2422a Source-loader: Expand X.bind({}) stories in CSF 2020-07-28 18:38:54 +08:00
Michael Shilman
ef3da027cf Source-loader: injectParameters => injectStoryParameters 2020-07-28 15:11:46 +08:00
Michael Shilman
ee45f72e3f Source-loader: Inject source snippets as story parameters 2020-07-28 15:04:31 +08:00
Adam Borowski
1c8964a123 #9582 do not refer to story title in addsMap keys
(snapshots were updated and manually compared because cases were reordered due to change in id (title was removed from key)
2020-05-28 09:22:51 +02:00
Norbert de Langen
f6242d2b99
MIGRATE source-loader to prettier v2 && FIX snapshots 2020-03-27 20:15:36 +01:00
Norbert de Langen
341fc2d90d
FIX linting 2020-03-27 20:04:50 +01:00
Norbert de Langen
3f3e65001f
FIX snapshots 2020-03-27 20:02:54 +01:00
atanasster
e3bf436379 code changes according to shilman comments 2020-01-21 10:56:08 -05:00
atanasster
a810ff4b8b re-generate test snapshots 2020-01-20 01:11:24 -05:00
atanasster
a38d2a48f6 clean up further 2020-01-20 01:04:40 -05:00
atanasster
554b379bfa initial check0in 2020-01-19 23:35:50 -05:00
atanasster
018b6d2a07 bypass source-loader if no exports 2020-01-17 02:04:13 -05:00
Michael Shilman
dbce4215c7 Source-loader: Also disable typescript checking on intermediate file 2020-01-16 18:47:26 +08:00
Michael Shilman
bea119a459 Source-loader: Add imports to top of file 2020-01-16 18:15:41 +08:00
Michael Shilman
06dbf2ab6f Source-loader: Disable linting altogether 2020-01-14 04:59:30 +08:00
Michael Shilman
eeeac9c36a Source-loader: Disable eslint entirely for generated code 2020-01-13 21:26:54 +08:00
Michael Shilman
bb96262bd8
Revert "Source-loader: Disable no-implicit-any linting" 2020-01-06 17:54:26 +08:00
Michael Shilman
d31b414a47 Source-loader: Disable no-impliicit-any linting 2019-12-31 02:42:45 +08:00
Michael Shilman
23283b81bf Source-loader: Tighten up include/exclude handling 2019-12-09 18:55:29 +08:00
Michael Shilman
fc01ec35b8 Handle RegExpLiteral include/exclude 2019-12-09 17:30:42 +08:00
Michael Shilman
971809db71 Source-loader: Handle includeStories/excludeStories in CSF 2019-12-09 16:45:55 +08:00
Michael Shilman
022816d3f0 Remove test code 2019-12-09 12:25:26 +08:00
Michael Shilman
b436339376 Refactor router utils into CSF library 2019-12-09 12:16:01 +08:00
Shota Fuji
d9fad400a1
Source-loader: Support function declaration exports
Added support for named exports with function declaration in
source-loader, in order to fix that the story's source code doesn't show
up in Docs mode's code preview.

The changes in generate-helpers.js is necessary because we can't wrap
named export functions:

```
export function foo() {}

// turns into this if we just wrapped it

export wrapper(function foo() {}) // syntax error!
```
2019-12-07 11:43:45 +00:00
atanasster
bcf66e3524 restore snapshot file 2019-11-30 10:11:17 -05:00
atanasster
4299c34a48 simplify conditional 2019-11-29 15:54:27 -05:00
atanasster
4140383883 Merge branch 'csf-title-template-string' of https://github.com/atanasster/storybook into csf-title-template-string 2019-11-29 11:02:45 -05:00
atanasster
6e98d2c84a make changecompatible backwards 2019-11-29 11:01:09 -05:00
Michael Shilman
178cc317f5 Update inject-decorator.csf.test.js.snap 2019-11-29 00:53:06 +08:00
atanasster
91b0d7a4e3 handle template strings in csf title 2019-11-28 06:16:05 -05:00
Donald Pipowitch
0e80a46d4d fixed logger 2019-11-11 07:26:38 +01:00
Donald Pipowitch
e4ab56d9a3 updated logging based on feedback 2019-11-10 19:51:49 +01:00
Donald Pipowitch
01ca39589b check context in source-loader 2019-11-09 14:50:55 +01:00
lionel benychou
fa7a82f331 test fixes 2019-11-01 22:28:21 +01:00
lionel benychou
2bd6aad28b some other mistakes fixed 2019-11-01 22:22:43 +01:00
libetl
bd1e689ea5 fixed some tests 2019-10-30 23:57:56 +01:00
Michael Shilman
a5810c98dd Fix bad import 2019-10-30 17:02:41 +08:00