create-ts-project
Advanced tools
Comparing version 1.0.5 to 1.0.6
#!/usr/bin/env node | ||
const child_process = require('child_process'); | ||
const util = require('util'); | ||
const child_process = require("child_process"); | ||
const util = require("util"); | ||
const exec = util.promisify(child_process.exec); | ||
const yargs = require('yargs'); | ||
const ora = require('ora'); | ||
const replaceInFiles = require('replace-in-files'); | ||
const yargs = require("yargs"); | ||
const replaceInFiles = require("replace-in-files"); | ||
const argv = yargs | ||
.usage('Usage\n\n create-ts-project <name>') | ||
.epilog('Copyright @ 2019') | ||
.argv; | ||
.usage("Usage\n\n create-ts-project <name>") | ||
.epilog("Copyright @ 2019").argv; | ||
const name = argv._[0]; | ||
const package = 'https://github.com/piecioshka/create-ts-project/archive/master.zip'; | ||
const package = | ||
"https://github.com/piecioshka/create-ts-project/archive/master.zip"; | ||
@@ -32,8 +31,5 @@ if (!name) { | ||
from: /create-ts-project/g, | ||
to: name | ||
to: name, | ||
}; | ||
const state = ora(); | ||
state.start(); | ||
async function isFileExist(name) { | ||
@@ -49,4 +45,12 @@ try { | ||
const log = (text) => console.info("[+] " + text); | ||
const fail = (text) => console.error("[-] " + text); | ||
function task(command) { | ||
log("Command: " + command); | ||
return exec(command); | ||
} | ||
(async () => { | ||
state.info(`Create project: ${name}`); | ||
log(`Create project: ${name}`); | ||
try { | ||
@@ -58,15 +62,16 @@ const isDirectoryExist = await isFileExist(name); | ||
// Fetch github.com/piecioshka/create-ts-project | ||
await exec(`wget ${package} -O create-ts-project.zip`); | ||
await exec(`unzip create-ts-project.zip`); | ||
await exec(`mv create-ts-project-master ${name}`); | ||
await exec(`rm -rf create-ts-project.zip`); | ||
await task(`wget ${package} -O create-ts-project.zip`); | ||
await task(`unzip create-ts-project.zip`); | ||
await task(`mv create-ts-project-master ${name}`); | ||
await task(`rm -rf create-ts-project.zip`); | ||
// Replace all "create-ts-project" by "NAME" | ||
await replaceInFiles(options); | ||
// Git setup & commit | ||
await exec(`cd ${name} && git init && git add . && git commit -am "Generate project"`); | ||
state.succeed('Project created'); | ||
state.stop(); | ||
await task( | ||
`cd ${name} && git init && git add . && git commit -am "Generate project"` | ||
); | ||
log("Project created"); | ||
} catch (reason) { | ||
state.fail(`Project does not created properly: ${reason.message}`); | ||
fail(`Project does not created properly: ${reason.message}`); | ||
} | ||
})(); |
{ | ||
"name": "create-ts-project", | ||
"description": "", | ||
"version": "1.0.5", | ||
"description": "Create a project with TypeScript support", | ||
"version": "1.0.6", | ||
"license": "MIT", | ||
@@ -19,10 +19,8 @@ "author": { | ||
"dependencies": { | ||
"@types/node": "^12.11.5", | ||
"ora": "^4.0.2", | ||
"replace-in-files": "^2.0.3", | ||
"ts-node": "^8.4.1", | ||
"typescript": "^3.6.4", | ||
"yargs": "^14.2.0" | ||
"@types/node": "^20.9.0", | ||
"replace-in-files": "^3.0.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.2.2", | ||
"yargs": "^17.7.2" | ||
}, | ||
"devDependencies": {}, | ||
"repository": { | ||
@@ -29,0 +27,0 @@ "type": "git", |
# create-ts-project | ||
[![npm version](https://badge.fury.io/js/create-ts-project.svg)](https://badge.fury.io/js/create-ts-project) | ||
[![downloads count](https://img.shields.io/npm/dt/create-ts-project.svg)](https://www.npmjs.com/package/create-ts-project) | ||
:hammer: Create a simple project with TypeScript support | ||
:hammer: Create a project with TypeScript support | ||
@@ -28,18 +27,4 @@ > Give a ⭐️ if this project helped you! | ||
## 🤝 Contributing | ||
Contributions, issues and feature requests are welcome!<br/> | ||
Feel free to check [issues page](https://github.com/piecioshka/create-ts-project/issues/). | ||
## Related | ||
* [test-mocha-typescript](https://github.com/piecioshka/test-mocha-typescript) | ||
* [test-jasmine-typescript](https://github.com/piecioshka/test-jasmine-typescript) | ||
* [test-flowtype-vs-typescript](https://github.com/piecioshka/test-flowtype-vs-typescript) | ||
* [test-typescript-parcel](https://github.com/piecioshka/test-typescript-parcel) | ||
* [test-typescript-webpack](https://github.com/piecioshka/test-typescript-webpack) | ||
* [test-jest-typescript](https://github.com/piecioshka/test-jest-typescript) | ||
## License | ||
[The MIT License](http://piecioshka.mit-license.org) @ 2019 | ||
[The MIT License](http://piecioshka.mit-license.org) @ 2019-2023 |
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
5
137
9800
5
30
+ Added@cspotcode/source-map-support@0.8.1(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.9(transitive)
+ Added@tsconfig/node10@1.0.11(transitive)
+ Added@tsconfig/node12@1.0.11(transitive)
+ Added@tsconfig/node14@1.0.3(transitive)
+ Added@tsconfig/node16@1.0.4(transitive)
+ Added@types/node@20.17.12(transitive)
+ Addedacorn@8.14.0(transitive)
+ Addedacorn-walk@8.3.4(transitive)
+ Addedcliui@8.0.1(transitive)
+ Addedcreate-require@1.1.1(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedglobby@11.1.0(transitive)
+ Addedis-binary@0.1.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedreplace-in-files@3.0.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedts-node@10.9.2(transitive)
+ Addedtypescript@5.7.3(transitive)
+ Addedundici-types@6.19.8(transitive)
+ Addedv8-compile-cache-lib@3.0.1(transitive)
+ Addedwrap-ansi@7.0.0(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@17.7.2(transitive)
+ Addedyargs-parser@21.1.1(transitive)
- Removedora@^4.0.2
- Removed@types/glob@7.2.0(transitive)
- Removed@types/minimatch@5.1.2(transitive)
- Removed@types/node@12.20.55(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbinaryextensions@2.3.0(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedchalk@2.4.23.0.0(transitive)
- Removedcli-cursor@3.1.0(transitive)
- Removedcli-spinners@2.9.2(transitive)
- Removedcliui@5.0.0(transitive)
- Removedclone@1.0.4(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddefaults@1.0.4(transitive)
- Removededitions@2.3.1(transitive)
- Removedemoji-regex@7.0.3(transitive)
- Removederrlop@2.2.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedfind-up@3.0.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedglobby@10.0.2(transitive)
- Removedhas-flag@3.0.04.0.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedis-interactive@1.0.0(transitive)
- Removedistextorbinary@2.6.0(transitive)
- Removedlocate-path@3.0.0(transitive)
- Removedlog-symbols@3.0.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmute-stream@0.0.8(transitive)
- Removedonce@1.4.0(transitive)
- Removedonetime@5.1.2(transitive)
- Removedora@4.1.1(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@3.0.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@3.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedreplace-in-files@2.0.3(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedrestore-cursor@3.1.0(transitive)
- Removedsemver@6.3.1(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-support@0.5.21(transitive)
- Removedstring-width@3.1.0(transitive)
- Removedstrip-ansi@5.2.0(transitive)
- Removedsupports-color@5.5.07.2.0(transitive)
- Removedtextextensions@2.6.0(transitive)
- Removedts-node@8.10.2(transitive)
- Removedtypescript@3.9.10(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwrap-ansi@5.1.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyargs@14.2.3(transitive)
- Removedyargs-parser@15.0.3(transitive)
Updated@types/node@^20.9.0
Updatedreplace-in-files@^3.0.0
Updatedts-node@^10.9.1
Updatedtypescript@^5.2.2
Updatedyargs@^17.7.2