clarity-cli
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -11,3 +11,5 @@ { | ||
"create-project", | ||
"project-name" | ||
"project-name2", | ||
"--type", | ||
"system" | ||
], | ||
@@ -14,0 +16,0 @@ "preLaunchTask": "compile", |
@@ -21,9 +21,18 @@ "use strict"; | ||
var templates = { | ||
babel: "project-template", | ||
system: "system-project-template" | ||
}; | ||
exports.default = function (program) { | ||
program.version("0.0.1").option("-t, --type [type]", "Type of project. Options are: 'babel' (default), 'system' (dispatcher system).").parse(process.argv); | ||
var args = program.args; | ||
var command = args[0]; | ||
var projectName = args[1]; | ||
var type = program.type || "babel"; | ||
var templateName = templates[type] || templates.babel; | ||
var templateDirectory = path.join(__dirname, "../../template"); | ||
var templateDirectory = path.join(__dirname, "../../", templateName); | ||
var projectDirectory = path.join(process.cwd(), projectName); | ||
@@ -36,11 +45,18 @@ var packageJsonFile = path.join(projectDirectory, "package.json"); | ||
console.log("Creating template...."); | ||
fs.copy(templateDirectory, projectDirectory).then(function () { | ||
console.log("Modifying package.json..."); | ||
return fs.readJson(packageJsonFile); | ||
}).then(function (packageJson) { | ||
packageJson.name = projectName; | ||
console.log("Saving package.json..."); | ||
return fs.writeJson(packageJsonFile, packageJson); | ||
}).then(function () { | ||
console.log("Running npm for you, this may take a while..."); | ||
return childProcess.exec("npm install", { cwd: projectDirectory }); | ||
}).then(function () { | ||
console.log("Locked and loaded, you are ready to go. Happy coding."); | ||
}); | ||
}; | ||
//# sourceMappingURL=create-project.js.map |
@@ -39,9 +39,12 @@ #!/usr/bin/env node | ||
var hasInitialized = false; | ||
_commander2.default.version("0.0.1").arguments("<cmd> [env]", "create a vscode project").action(function (name) { | ||
setTimeout(function () { | ||
if (!hasInitialized) { | ||
hasInitialized = true; | ||
if (typeof commands[name] === "function") { | ||
commands[name](_commander2.default); | ||
} | ||
}, 0); | ||
} | ||
}).parse(process.argv); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "clarity-cli", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Clarity setup for vscode.", | ||
@@ -23,2 +23,2 @@ "main": "lib/index.js", | ||
"license": "MIT" | ||
} | ||
} |
@@ -5,9 +5,20 @@ import * as fs from "fs-extra"; | ||
var templates = { | ||
babel: "project-template", | ||
system: "system-project-template" | ||
}; | ||
export default (program) => { | ||
program.version("0.0.1") | ||
.option("-t, --type [type]", "Type of project. Options are: 'babel' (default), 'system' (dispatcher system).") | ||
.parse(process.argv); | ||
var args = program.args; | ||
var command = args[0]; | ||
var projectName = args[1]; | ||
var type = program.type || "babel" | ||
var templateName = templates[type] || templates.babel; | ||
var templateDirectory = path.join(__dirname, "../../template"); | ||
var templateDirectory = path.join(__dirname, "../../", templateName); | ||
var projectDirectory = path.join(process.cwd(), projectName); | ||
@@ -20,11 +31,18 @@ var packageJsonFile = path.join(projectDirectory, "package.json"); | ||
console.log("Creating template...."); | ||
fs.copy(templateDirectory, projectDirectory).then(() => { | ||
console.log("Modifying package.json..."); | ||
return fs.readJson(packageJsonFile); | ||
}).then((packageJson) => { | ||
packageJson.name = projectName; | ||
console.log("Saving package.json..."); | ||
return fs.writeJson(packageJsonFile, packageJson); | ||
}).then(() => { | ||
console.log("Running npm for you, this may take a while..."); | ||
return childProcess.exec("npm install", { cwd: projectDirectory }); | ||
}).then(()=>{ | ||
console.log("Locked and loaded, you are ready to go. Happy coding."); | ||
}); | ||
} |
@@ -26,12 +26,14 @@ #!/usr/bin/env node | ||
var hasInitialized = false; | ||
program.version("0.0.1") | ||
.arguments("<cmd> [env]", "create a vscode project").action((name) => { | ||
setTimeout(() => { | ||
if (!hasInitialized) { | ||
hasInitialized = true; | ||
if (typeof commands[name] === "function") { | ||
commands[name](program); | ||
} | ||
}, 0); | ||
} | ||
}) | ||
.parse(process.argv); | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
34206
37
661
15
1