Skip to content

Commit

Permalink
fix: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Mar 26, 2020
1 parent c04a539 commit 3df3951
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
12 changes: 12 additions & 0 deletions core/loader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Overview](#overview)
- [Installation](#installation)
- [API](#api)
- [deepMerge](#deepmerge)
- [injectedStories](#injectedstories)
- [storyStore](#storystore)
- [loadStoryStore](#loadstorystore)
Expand Down Expand Up @@ -34,6 +35,17 @@ $ npm install @component-controls/loader --save-dev

<!-- START-TSDOC-TYPESCRIPT -->

## deepMerge

_defined in [@component-controls/loader/src/story-store-data.ts](https://github.com/ccontrols/component-controls/tree/master/core/loader/src/story-store-data.ts#L4)_



### properties

| Name | Type | Description |
| ---- | ---- | ----------- |

## injectedStories

_defined in [@component-controls/loader/src/story-store-data.ts](https://github.com/ccontrols/component-controls/tree/master/core/loader/src/story-store-data.ts#L6)_
Expand Down
2 changes: 1 addition & 1 deletion core/loader/src/story-store-data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/camelcase */
import { StoriesStore, Story } from '@component-controls/specification';
import * as deepMerge from 'deepmerge';
const deepMerge = require('deepmerge');
import { toId, storyNameFromExport } from '@storybook/csf';
const injectedStories = '__STORIES_HASH__INJECTED_STORIES__';

Expand Down
36 changes: 29 additions & 7 deletions core/loader/tmp-out-typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"originalName": "",
"children": [
{
"id": 79,
"id": 80,
"name": "\"loader/src/loader\"",
"kind": 1,
"kindString": "Module",
Expand Down Expand Up @@ -34,6 +34,27 @@
"children": [
{
"id": 75,
"name": "deepMerge",
"kind": 32,
"kindString": "Variable",
"flags": {
"isConst": true
},
"sources": [
{
"fileName": "loader/src/story-store-data.ts",
"line": 4,
"character": 15
}
],
"type": {
"type": "intrinsic",
"name": "any"
},
"defaultValue": "require('deepmerge')"
},
{
"id": 76,
"name": "injectedStories",
"kind": 32,
"kindString": "Variable",
Expand All @@ -54,7 +75,7 @@
"defaultValue": "\"__STORIES_HASH__INJECTED_STORIES__\""
},
{
"id": 76,
"id": 77,
"name": "storyStore",
"kind": 32,
"kindString": "Variable",
Expand Down Expand Up @@ -84,7 +105,7 @@
"defaultValue": "undefined"
},
{
"id": 77,
"id": 78,
"name": "loadStoryStore",
"kind": 64,
"kindString": "Function",
Expand All @@ -93,7 +114,7 @@
},
"signatures": [
{
"id": 78,
"id": 79,
"name": "loadStoryStore",
"kind": 4096,
"kindString": "Call signature",
Expand Down Expand Up @@ -128,14 +149,15 @@
"kind": 32,
"children": [
75,
76
76,
77
]
},
{
"title": "Functions",
"kind": 64,
"children": [
77
78
]
}
],
Expand Down Expand Up @@ -1817,7 +1839,7 @@
"title": "Modules",
"kind": 1,
"children": [
79,
80,
74,
1
]
Expand Down
5 changes: 5 additions & 0 deletions integrations/storybook/src/config-legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ addDecorator(
controls: ComponentControls;
}[] = [];
const injectedStoryStore = storyStoreData;

Object.keys(injectedStoryStore.stories).forEach((id: string) => {
const story = injectedStoryStore.stories[id];
if (storyStore._data[id]) {
story.storyFn = storyStore._data[id].storyFn;
}

const { controls } = story;
const parameters = story.parameters || {};
const { addonControls = {} } = parameters;
Expand Down

0 comments on commit 3df3951

Please sign in to comment.