react-creates
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -29,7 +29,8 @@ "use strict"; | ||
.option("-t --type <component>", parse_type_1.MESSAGE, parse_type_1.Types.FUNCTION) | ||
.option("-pt --prop-types", "Should to add Prop-types") | ||
.option("-pt --prop-types", "Should add Prop-types") | ||
.option("-f --function", "Generate function component") | ||
.option("-c --class", "Generate class component") | ||
.option("-s --style <styling>", "Selected the style", parse_style_1.Styles.CSS) | ||
.action(async (name, _) => { | ||
let { type, language, entry, style, scss, css, sass, propTypes, function: func, directory: target, } = _.opts(); | ||
let { type, language, entry, style, scss, css, sass, propTypes, function: func, directory: target, class: klass } = _.opts(); | ||
const styles = { scss, css, sass }; | ||
@@ -42,2 +43,5 @@ for (const [styleName, isOn] of Object.entries(styles)) { | ||
} | ||
if (Boolean(klass)) { | ||
type = parse_type_1.Types.CLASS; | ||
} | ||
if (Boolean(func)) { | ||
@@ -48,5 +52,5 @@ type = parse_type_1.Types.FUNCTION; | ||
console.log(` | ||
React Creates: ${chalk_1.default.blueBright.bold("Component")} | ||
React Creates: ${chalk_1.default.blueBright.bold("Component")} | ||
Parsing arguments... | ||
Parsing arguments... | ||
`); | ||
@@ -53,0 +57,0 @@ const options = { |
@@ -12,3 +12,3 @@ "use strict"; | ||
if (Boolean(value)) | ||
console.log(`⚛️ ${lodash_1.startCase(name)}: ${chalk_1.default.bold.green(value)}`); | ||
console.log(` ⚛️ ${lodash_1.startCase(name)}: ${chalk_1.default.bold.green(value)}`); | ||
} | ||
@@ -15,0 +15,0 @@ console.log(''); |
@@ -8,4 +8,4 @@ "use strict"; | ||
exports.runCreateComponent = async (options) => { | ||
const { target, language } = options; | ||
const templatesPath = path_1.join(__dirname, "..", "..", "..", "templates", language, "component"); | ||
const { target, language, type } = options; | ||
const templatesPath = path_1.join(__dirname, "..", "..", "..", "templates", language, "component", type); | ||
await copy_template_1.copyTemplate(templatesPath, target); | ||
@@ -12,0 +12,0 @@ await replace_variables_1.replaceVariables(target, options); |
{ | ||
"name": "react-creates", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Create React Component folder works on macOS, Windows, and Linux.", | ||
@@ -5,0 +5,0 @@ "files": [ |
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
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
29242
45
455