create-duck
Advanced tools
Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "create-duck", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "CLI script for creating Redux ducks", | ||
@@ -5,0 +5,0 @@ "main": "./src/create-duck.js", |
@@ -1,2 +0,2 @@ | ||
#!/usr/bin/env node | ||
#!/usr/bin/env nodejs | ||
@@ -7,2 +7,3 @@ const prompt = require("prompt"); | ||
const duckTemplate = require("./duck.template"); | ||
const generateDuckNames = require("./util").generateDuckNames; | ||
@@ -12,3 +13,3 @@ const schema = { | ||
name: { | ||
description: 'Duck name', | ||
description: 'Duck name (kebab-case)', | ||
type: 'string', | ||
@@ -28,5 +29,6 @@ message: 'Duck name is required', | ||
const { name } = result; | ||
const duckNames = generateDuckNames(name); | ||
const filename = path.resolve(name + ".js"); | ||
fs.writeSync(fs.openSync(filename, "w"), duckTemplate(name)); | ||
fs.writeSync(fs.openSync(filename, "w"), duckTemplate(duckNames)); | ||
console.log(`Created ${name} duck`); | ||
}); | ||
}); |
@@ -1,5 +0,5 @@ | ||
module.exports = (duckName) => { | ||
const name = duckName.toLowerCase(); | ||
const NAME = duckName.toUpperCase(); | ||
const Name = duckName[0].toUpperCase() + name.substr(1); | ||
module.exports = (names) => { | ||
var name = names.name, | ||
Name = names.Name, | ||
NAME = names.NAME; | ||
return ( | ||
@@ -43,3 +43,3 @@ `import { createLogic } from 'redux-logic'; | ||
*/ | ||
const initialState = {}; | ||
@@ -103,2 +103,2 @@ | ||
); | ||
}; | ||
}; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4756
6
128
0