generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #339 from storybookjs/feat/multiple-roots-monorepo
Support importing stories from separate packages
- Loading branch information
Showing
5 changed files
with
51 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { relative, resolve } from 'path'; | ||
import { normalizeStories } from '@storybook/core-common'; | ||
import { join } from 'path'; | ||
import { normalizeStories, getProjectRoot } from '@storybook/core-common'; | ||
import { getStorybookMain } from './getStorybookMain'; | ||
|
||
export const getStorybookMetadata = () => { | ||
const workingDir = resolve(); | ||
const workingDir = getProjectRoot(); | ||
const configDir = process.env.STORYBOOK_CONFIG_DIR; | ||
|
||
const main = getStorybookMain(configDir); | ||
|
@@ -17,7 +17,7 @@ export const getStorybookMetadata = () => { | |
|
||
const storiesPaths = normalizedStoriesEntries | ||
.map((entry) => entry.directory + '/' + entry.files) | ||
.map((dir) => '<rootDir>/' + relative(workingDir, dir)) | ||
.map((dir) => join(workingDir, dir)) | ||
.join(';'); | ||
|
||
// @ts-ignore -- this is added in @storybook/[email protected], which we don't depend on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters