Gathering detailed insights and metrics for react-native-storysource-transformer
Gathering detailed insights and metrics for react-native-storysource-transformer
Gathering detailed insights and metrics for react-native-storysource-transformer
Gathering detailed insights and metrics for react-native-storysource-transformer
Provides storybook source in react-native to display on storybook web server
npm install react-native-storysource-transformer
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
10 Commits
1 Watchers
11 Branches
2 Contributors
Updated on Oct 01, 2022
Latest Version
0.0.5
Package Id
react-native-storysource-transformer@0.0.5
Unpacked Size
11.67 kB
Size
3.66 kB
File Count
8
NPM Version
6.14.5
Node Version
13.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Enables storybook storysource addon for react-native.
This package makes storysource addon compatible with react-native which is not supported by default.
1yarn add react-native-storysource-transformer --dev
Merge your metro.config.js
file with this config :
metro.config.js
:
1module.exports = { 2 transformer: { 3 babelTransformerPath: require.resolve( 4 "react-native-storysource-transformer" 5 ), 6 }, 7};
If you already use another transformer, you can reference an intermediate file like this :
metro.customTransformer.js
:
1const svgTransformer = require("react-native-svg-transformer"); 2const storyTransformer = require("react-native-storysource-transformer"); 3 4module.exports.transform = function (options) { 5 if (options.filename.endsWith(".svg")) { 6 return svgTransformer.transform(options); 7 } else { 8 return storyTransformer.transform(options); 9 } 10};
Install storysource addon and source-loader dependencies:
1yarn add @storybook/addon-storysource --dev 2yarn add @storybook/source-loader --dev
Add this line in your storybook/addons.js file :
1import "@storybook/addon-storysource/register";
react-native-storysource-transformer is controlled by the react-native-storysource-transformer section of the project's package.json.
Setting | Type | Description | Default |
---|---|---|---|
filePatterns | string[] | An array of blobs to match your stories files. | ["**/*.stories.{js,ts}{x,}", "**/stories/index.{js,ts}{x,}"] will match all files named *.stories.js/jsx/ts/tsx and the default index story file |
storyMatcher (Advanced) | string | A regular expression used to parse a story. May be needed if your stories are not written using the usual convention : storiesOf('Welcome', module).add(... | "(storiesOf.*?\\(.*?module\\))" |
Example below will handle every stories ending with .stories.js
or .stories.jsx
.
package.json
1{ 2 "name": "AwesomeProject", 3 "config": { 4 "react-native-storysource-transformer": { 5 "filePatterns": ["**/*.stories.js", "**/*.stories.jsx"] 6 } 7 } 8}
You may need to run yarn react-native start --reset-cache
if you change any of these options.
Run your storybook server and your storybook app as usual :
1yarn storybook
1react-native run-ios
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/7 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More