generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use git root as jest root to allow for externally imported stories
- Loading branch information
Showing
4 changed files
with
44 additions
and
37 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 | ||
|