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

@crave/farmblocks-dev-scaffold

Package Overview
Dependencies
Maintainers
6
Versions
874
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crave/farmblocks-dev-scaffold - npm Package Compare versions

Comparing version 1.1.0-alpha.b4f9d325 to 1.1.0-alpha.b56b7743

12

CHANGELOG.md

@@ -6,4 +6,4 @@ # Change Log

<a name="1.1.0-alpha.b4f9d325"></a>
# [1.1.0-alpha.b4f9d325](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.1...@crave/farmblocks-dev-scaffold@1.1.0-alpha.b4f9d325) (2018-12-26)
<a name="1.1.0-alpha.b56b7743"></a>
# [1.1.0-alpha.b56b7743](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.2...@crave/farmblocks-dev-scaffold@1.1.0-alpha.b56b7743) (2019-01-07)

@@ -15,2 +15,10 @@

<a name="1.0.2"></a>
## [1.0.2](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.1...@crave/farmblocks-dev-scaffold@1.0.2) (2019-01-03)
**Note:** Version bump only for package @crave/farmblocks-dev-scaffold
<a name="1.0.1"></a>

@@ -17,0 +25,0 @@ ## [1.0.1](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.0...@crave/farmblocks-dev-scaffold@1.0.1) (2018-11-21)

35

lib/create-component.js
#!/usr/bin/env node
"use strict";

@@ -8,2 +7,3 @@ var _require = require("inquirer"),

var slug = require("slug");
var upperCamelCase = require("uppercamelcase");

@@ -18,5 +18,9 @@

var packageContents = require("./templates/package");
var readmeContents = require("./templates/readme");
var indexContents = require("./templates/index");
var componentContents = require("./templates/component");
var storyContents = require("./templates/componentStory");

@@ -34,3 +38,5 @@

var fullName = _ref.fullName;
return slug(fullName, { lower: true });
return slug(fullName, {
lower: true
});
},

@@ -57,3 +63,2 @@ message: "Component’s short name"

}];
prompt(questions).then(function (answers) {

@@ -64,17 +69,19 @@ var packageJSON = packageContents(answers);

shortName = answers.shortName;
var componentName = upperCamelCase(fullName);
var index = indexContents(componentName);
var component = componentContents(componentName);
var story = storyContents({ componentName: componentName, fullName: fullName });
var dirName = "packages/" + shortName;
var story = storyContents({
componentName: componentName,
fullName: fullName
});
var dirName = "packages/".concat(shortName);
var inactiveAuthors = answers.inactiveAuthors ? new RegExp(answers.inactiveAuthors, "i") : null;
mkdir("-p", dirName + "/src");
ShellString(packageJSON).to(dirName + "/package.json");
ShellString(readme).to(dirName + "/README.md");
ShellString(index).to(dirName + "/src/index.js");
ShellString(component).to(dirName + "/src/" + componentName + ".js");
ShellString(story).to(dirName + "/src/" + componentName + ".story.js");
cp(["AUTHORS", "LICENSE"], dirName + "/.");
inactiveAuthors && grep("-v", inactiveAuthors, dirName + "/AUTHORS").to(dirName + "/AUTHORS");
mkdir("-p", "".concat(dirName, "/src"));
ShellString(packageJSON).to("".concat(dirName, "/package.json"));
ShellString(readme).to("".concat(dirName, "/README.md"));
ShellString(index).to("".concat(dirName, "/src/index.js"));
ShellString(component).to("".concat(dirName, "/src/").concat(componentName, ".js"));
ShellString(story).to("".concat(dirName, "/src/").concat(componentName, ".story.js"));
cp(["AUTHORS", "LICENSE"], "".concat(dirName, "/."));
inactiveAuthors && grep("-v", inactiveAuthors, "".concat(dirName, "/AUTHORS")).to("".concat(dirName, "/AUTHORS"));
}).catch(console.error); // eslint-disable-line no-console

@@ -1,3 +0,1 @@

"use strict";
var _require = require("prettier"),

@@ -7,5 +5,7 @@ format = _require.format;

var componentTemplate = function componentTemplate(componentName) {
return format("\nimport * as React from \"react\"; \n \nconst " + componentName + " = props => { \n return <div />; \n}; \n \nexport default " + componentName + "; \n", { parser: "babylon" });
return format("\nimport * as React from \"react\"; \n \nconst ".concat(componentName, " = props => { \n return <div />; \n}; \n \nexport default ").concat(componentName, "; \n"), {
parser: "babylon"
});
};
module.exports = componentTemplate;

@@ -1,3 +0,1 @@

"use strict";
var _require = require("prettier"),

@@ -9,5 +7,7 @@ format = _require.format;

fullName = _ref.fullName;
return format("\nimport React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\nimport { withInfo } from \"@storybook/addon-info\";\n\nimport " + componentName + " from \".\";\n\nstoriesOf(\"" + fullName + "\", module).add(\n \"Default\",\n withInfo()(() => <" + componentName + " />)\n);\n", { parser: "babylon" });
return format("\nimport React from \"react\";\nimport { storiesOf } from \"@storybook/react\";\n\nimport ".concat(componentName, " from \".\";\n\nstoriesOf(\"").concat(fullName, "\", module).add(\n \"Default\",\n () => <").concat(componentName, " />)\n);\n"), {
parser: "babylon"
});
};
module.exports = storyTemplate;

@@ -1,7 +0,5 @@

"use strict";
var indexTemplate = function indexTemplate(componentName) {
return "export { default } from \"./" + componentName + "\";";
return "export { default } from \"./".concat(componentName, "\";");
};
module.exports = indexTemplate;

@@ -1,3 +0,1 @@

"use strict";
var _require = require("prettier"),

@@ -16,6 +14,8 @@ format = _require.format;

_ref$keywords = _ref.keywords,
keywords = _ref$keywords === undefined ? ["farmblocks"] : _ref$keywords;
return format("\n{\n \"name\": \"@crave/farmblocks-" + shortName + "\",\n \"version\": \"0.1.0\",\n \"description\": \"" + description + "\",\n \"author\": \"Crave Food Systems and AUTHORS\",\n \"license\": \"MIT\",\n \"main\": \"lib/index.js\",\n \"files\": [\n \"AUTHORS\",\n \"lib\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"clean\": \"rm -rf lib\",\n \"build\": \"yarn clean && babel src -d lib --ignore '*.test.js,*.story.js'\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CraveFood/farmblocks.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/CraveFood/farmblocks/issues\"\n },\n \"homepage\": \"https://github.com/CraveFood/farmblocks#readme\",\n \"keywords\": " + JSON.stringify(keywords) + ",\n \"peerDependencies\": " + JSON.stringify(peerDependencies) + ",\n \"dependencies\": {}\n}\n", { parser: "json" });
keywords = _ref$keywords === void 0 ? ["farmblocks"] : _ref$keywords;
return format("\n{\n \"name\": \"@crave/farmblocks-".concat(shortName, "\",\n \"version\": \"0.1.0\",\n \"description\": \"").concat(description, "\",\n \"author\": \"Crave Food Systems and AUTHORS\",\n \"license\": \"MIT\",\n \"main\": \"lib/index.js\",\n \"files\": [\n \"AUTHORS\",\n \"lib\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"scripts\": {\n \"clean\": \"rm -rf lib\",\n \"build\": \"yarn clean && babel --root-mode upward src -d lib --ignore 'src/**/*.test.js','src/**/*.story.js'\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/CraveFood/farmblocks.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/CraveFood/farmblocks/issues\"\n },\n \"homepage\": \"https://github.com/CraveFood/farmblocks#readme\",\n \"keywords\": ").concat(JSON.stringify(keywords), ",\n \"peerDependencies\": ").concat(JSON.stringify(peerDependencies), ",\n \"dependencies\": {}\n}\n"), {
parser: "json"
});
};
module.exports = packageTemplate;

@@ -1,3 +0,1 @@

"use strict";
var readmeTemplate = function readmeTemplate(_ref) {

@@ -7,5 +5,5 @@ var fullName = _ref.fullName,

description = _ref.description;
return "\n\n# Farmblocks " + fullName + "\n\n" + description + "\n\n## Installation\n\n```\nnpm install @crave/farmblocks-" + shortName + "\n```\n\n## License\n\nMIT\n";
return "\n\n# Farmblocks ".concat(fullName, "\n\n").concat(description, "\n\n## Installation\n\n```\nnpm install @crave/farmblocks-").concat(shortName, "\n```\n\n## License\n\nMIT\n");
};
module.exports = readmeTemplate;
{
"name": "@crave/farmblocks-dev-scaffold",
"version": "1.1.0-alpha.b4f9d325",
"version": "1.1.0-alpha.b56b7743",
"description": "Helper tool for creating a new farmblock component",

@@ -15,3 +15,3 @@ "author": "Crave Food Systems and AUTHORS",

"clean": "rm -rf lib",
"build": "yarn clean && babel src -d lib --ignore '*.test.js,*.story.js'"
"build": "yarn clean && babel --root-mode upward src -d lib --ignore 'src/**/*.test.js','src/**/*.story.js'"
},

@@ -18,0 +18,0 @@ "bin": {

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