@crave/farmblocks-dev-scaffold
Advanced tools
Comparing version 1.1.0-alpha.9bff8ddb to 1.1.0-alpha.9eea1bd7
@@ -6,4 +6,4 @@ # Change Log | ||
<a name="1.1.0-alpha.9bff8ddb"></a> | ||
# [1.1.0-alpha.9bff8ddb](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.0...@crave/farmblocks-dev-scaffold@1.1.0-alpha.9bff8ddb) (2018-11-09) | ||
<a name="1.1.0-alpha.9eea1bd7"></a> | ||
# [1.1.0-alpha.9eea1bd7](https://github.com/CraveFood/farmblocks/compare/@crave/farmblocks-dev-scaffold@1.0.2...@crave/farmblocks-dev-scaffold@1.1.0-alpha.9eea1bd7) (2019-01-04) | ||
@@ -15,2 +15,18 @@ | ||
<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> | ||
## [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) | ||
**Note:** Version bump only for package @crave/farmblocks-dev-scaffold | ||
<a name="1.0.0"></a> | ||
@@ -17,0 +33,0 @@ # 1.0.0 (2018-10-29) |
#!/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"), | ||
@@ -7,3 +5,3 @@ format = _require.format; | ||
var peerDependencies = { | ||
react: "^16.6.0", | ||
react: "^16.6.3", | ||
"prop-types": "^15.6.0", | ||
@@ -17,6 +15,8 @@ "styled-components": "^4.0.2" | ||
_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.9bff8ddb", | ||
"version": "1.1.0-alpha.9eea1bd7", | ||
"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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9514
115
8