-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump the storybook group across 1 directory with 3 updates Bumps the storybook group with 3 updates in the /generators/react-native/templates directory: [@storybook/addons](https://github.com/storybookjs/storybook/tree/HEAD/code/deprecated/addons), [@storybook/react-native](https://github.com/storybookjs/react-native/tree/HEAD/packages/react-native) and [@storybook/theming](https://github.com/storybookjs/storybook/tree/HEAD/code/lib/theming). Updates `@storybook/addons` from 7.6.13 to 7.6.17 - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/v7.6.17/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v7.6.17/code/deprecated/addons) Updates `@storybook/react-native` from 6.5.7 to 7.6.19 - [Release notes](https://github.com/storybookjs/react-native/releases) - [Changelog](https://github.com/storybookjs/react-native/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/react-native/commits/v7.6.19/packages/react-native) Updates `@storybook/theming` from 7.6.17 to 8.1.6 - [Release notes](https://github.com/storybookjs/storybook/releases) - [Changelog](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md) - [Commits](https://github.com/storybookjs/storybook/commits/v8.1.6/code/lib/theming) --- updated-dependencies: - dependency-name: "@storybook/addons" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: storybook - dependency-name: "@storybook/react-native" dependency-type: direct:development update-type: version-update:semver-major dependency-group: storybook - dependency-name: "@storybook/theming" dependency-type: direct:development update-type: version-update:semver-major dependency-group: storybook ... Signed-off-by: dependabot[bot] <support@github.com> * storybook migration * adjust to @storybook/react-native * add storybook.requires * convert to ts * Update storybook.requires.ts.ejs * Update storybook.requires.ts.ejs * Use recommendation for setting storage * Upgrade to Expo 51.0.12 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matt Raible <matt@raibledesigns.com>
- Loading branch information
1 parent
1f8272d
commit 9c41188
Showing
7 changed files
with
129 additions
and
2 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
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
85 changes: 85 additions & 0 deletions
85
generators/react-native/templates/storybook/storybook.requires.ts.ejs
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* do not change this file, it is auto generated by storybook. */ | ||
|
||
import { | ||
start, | ||
prepareStories, | ||
getProjectAnnotations, | ||
} from "@storybook/react-native"; | ||
|
||
/* | ||
import "@storybook/addon-ondevice-notes/register"; | ||
import "@storybook/addon-ondevice-controls/register"; | ||
import "@storybook/addon-ondevice-knobs/register"; | ||
import "@storybook/addon-ondevice-backgrounds/register"; | ||
import "@storybook/addon-ondevice-actions/register"; | ||
*/ | ||
|
||
const normalizedStories = [ | ||
{ | ||
titlePrefix: "", | ||
directory: "./components", | ||
files: "**/*.stories.?(ts|tsx|js|jsx)", | ||
importPathMatcher: | ||
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/, | ||
// @ts-ignore | ||
req: require.context( | ||
"../components", | ||
true, | ||
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/ | ||
), | ||
}, | ||
{ | ||
titlePrefix: "OtherComponents", | ||
directory: "./other_components", | ||
files: "**/*.stories.?(ts|tsx|js|jsx)", | ||
importPathMatcher: | ||
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/, | ||
// @ts-ignore | ||
req: require.context( | ||
"../other_components", | ||
true, | ||
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/ | ||
), | ||
}, | ||
]; | ||
|
||
declare global { | ||
var view: ReturnType<typeof start>; | ||
var STORIES: typeof normalizedStories; | ||
} | ||
|
||
const annotations = [ | ||
// require("./preview"), | ||
require("@storybook/react-native/dist/preview"), | ||
// require("@storybook/addon-actions/preview"), | ||
]; | ||
|
||
global.STORIES = normalizedStories; | ||
|
||
// @ts-ignore | ||
module?.hot?.accept?.(); | ||
|
||
const options = { playFn: false }; | ||
|
||
if (!global.view) { | ||
global.view = start({ | ||
annotations, | ||
storyEntries: normalizedStories, | ||
options, | ||
}); | ||
} else { | ||
const { importMap } = prepareStories({ | ||
storyEntries: normalizedStories, | ||
options, | ||
}); | ||
|
||
global.view._preview.onStoriesChanged({ | ||
importFn: async (importPath: string) => importMap[importPath], | ||
}); | ||
|
||
global.view._preview.onGetProjectAnnotationsChanged({ | ||
getProjectAnnotations: getProjectAnnotations(global.view, annotations), | ||
}); | ||
} | ||
|
||
export const view = global.view; |