Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-storybook-loader

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-storybook-loader - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

31

package.json
{
"name": "react-native-storybook-loader",
"version": "1.8.0",
"version": "1.8.1",
"repository": "https://github.com/elderfo/react-native-storybook-loader.git",

@@ -12,15 +12,11 @@ "bugs": "https://github.com/elderfo/react-native-storybook-loader/issues",

"devDependencies": {
"codecov": "^2.3.0",
"cz-conventional-changelog": "^2.0.0",
"eslint": "^3.16.1",
"eslint-config-elderfo": "^1.2.3",
"eslint-watch": "^3.0.0",
"codecov": "^3.5.0",
"faker": "^4.1.0",
"husky": "^0.13.1",
"jest": "^20.0.4",
"lint-staged": "^4.0.2",
"husky": "^3.0.5",
"jest": "^24.9.0",
"lint-staged": "^9.2.5",
"mock-fs": "^4.4.1",
"npm-run-all": "^4.1.2",
"prettier": "^1.5.3",
"semantic-release": "^6.3.2",
"semantic-release": "^15.13.24",
"uuid": "^3.0.1"

@@ -30,6 +26,5 @@ },

"colors": "^1.1.2",
"dot": "^1.1.1",
"findup": "^0.1.5",
"glob": "^7.1.1",
"yargs": "^8.0.2"
"yargs": "^14.0.0"
},

@@ -40,9 +35,7 @@ "scripts": {

"test:ci": "jest --coverage && codecov",
"lint": "esw ./",
"lint:watch": "yarn run lint -- --watch",
"start": "node src/rnstl-cli.js",
"start:help": "node src/rnstl-cli.js --help",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"semantic-release": "semantic-release",
"precommit": "lint-staged",
"ci": "npm-run-all test:ci lint start"
"ci": "npm-run-all test:ci start"
},

@@ -52,3 +45,2 @@ "lint-staged": {

"prettier --single-quote --trailing-comma es5 --write",
"eslint --fix",
"git add",

@@ -76,7 +68,4 @@ "jest --bail --findRelatedTests"

"outputFile": "./output/storyLoader.js"
},
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
}
const fs = require('fs');
const path = require('path');
const dot = require('dot');

@@ -11,10 +10,16 @@ const {

dot.templateSettings.strip = false;
function getRelativePaths(fromDir, files) {
return files.map(file => getRelativePath(file, fromDir)).concat().sort();
return files
.map(file => getRelativePath(file, fromDir))
.concat()
.sort();
}
const templateContents = `
// Auto-generated file created by react-native-storybook-loader
const formatter = (files, frms, separator) => {
const formatted = files.map(f => frms(f));
return formatted.join(separator);
};
const template = files =>
`// Auto-generated file created by react-native-storybook-loader
// Do not edit.

@@ -25,9 +30,7 @@ //

function loadStories() {
{{~it.files :value:index}}require('{{=value}}');
{{~}}
${formatter(files, file => `\trequire('${file}');`, '\n')}
}
const stories = [
{{~it.files :value:index}}'{{=value}}',
{{~}}
${formatter(files, file => `\t'${file}'`, ',\n')}
];

@@ -42,9 +45,7 @@

const writeFile = (files, outputFile) => {
const template = dot.template(templateContents);
const relativePaths = getRelativePaths(
path.dirname(outputFile),
files
).map(file => file.substring(0, file.lastIndexOf('.'))); // strip file extensions
const relativePaths = getRelativePaths(path.dirname(outputFile), files).map(
file => file.substring(0, file.lastIndexOf('.'))
); // strip file extensions
const output = template({ files: relativePaths });
const output = template(relativePaths);

@@ -57,4 +58,3 @@ ensureFileDirectoryExists(outputFile);

module.exports = {
templateContents,
writeFile,
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc