@leo-h/create-nodejs-app 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +5 -1
- package/templates/clean/gitignore +132 -0
- package/templates/clean/npmrc +1 -0
- package/templates/fastify/gitignore +132 -0
- package/templates/fastify/npmrc +1 -0
- package/templates/nest/gitignore +132 -0
- package/templates/nest/npmrc +1 -0
package/dist/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
const index=require("./src/config/index.js"),commander=require("commander"),path=require("path"),picocolors=require("picocolors"),
|
2
|
+
const index=require("./src/config/index.js"),commander=require("commander"),promises=require("fs/promises"),path=require("path"),picocolors=require("picocolors"),V=require("prompts"),_package=require("./package.json.js"),copyTemplate_compose=require("./src/compose-app/copy-template.compose.js"),replaceContentInFile_compose=require("./src/compose-app/replace-content-in-file.compose.js"),logs=require("./src/utils/logs.js"),onCancel=require("./src/utils/on-cancel.js"),framework_validation=require("./src/validations/framework.validation.js"),packageManager_validation=require("./src/validations/package-manager.validation.js"),projectNameValidation=require("./src/validations/project-name-validation.js"),template_validation=require("./src/validations/template.validation.js"),w=new commander.Command().name(_package.default.name).description(_package.default.description);w.argument("[project-directory]","Name of the project or relative path of the project considering where the script was called.").option("-pm, --package-manager <package-manager>","Package manager that will be used in the project.").option("-t, --template <template-name>","Template that will be used in the project.").option("-f, --framework <framework-name>","Framework that will be used in the project.").action(async(i,o)=>{const r={projectDirectory:{value:i,validation:projectNameValidation.ProjectNameValidation.create({path:i})},packageManager:{value:o.packageManager,validation:packageManager_validation.PackageManagerValidation.create({packageManager:o.packageManager})},template:{value:o.template,validation:template_validation.TemplateValidation.create({template:o.template})},framework:{value:o.framework,validation:framework_validation.FrameworkValidation.create({framework:o.framework})}},s=Object.keys(r);for(const a of s){const t=r[a];t.value&&await t.validation.fromCli()}const{projectDirectory:e,packageManager:l,template:p,framework:n}=r,v=await V([{type:e.value?null:"text",name:"projectDirectory",message:"What is your project name?",validate:async a=>await e.validation.fromPrompt({path:a})},{type:l.value?null:"select",name:"packageManager",message:"What is your favorite package manager?",choices:packageManager_validation.packageManagers,initial:2},{type:!p.value&&!n.value?"select":null,name:"template",message:"Select your template:",choices:template_validation.templates},{type:(a,t)=>!n.value&&(p.value==="api"||t.template==="api")?"select":null,name:"framework",message:"What is your favorite framework?",choices:framework_validation.frameworks}],{onCancel:onCancel.onCancelPrompt});for(const a of s){const t=v[a];t&&(r[a].value=t)}n.value&&(r.template.value="api");const c=path.basename(e.value);e.value=path.resolve(index.GENERATED_APP_TARGET_ROOT_PATH,e.value),await copyTemplate_compose.copyTemplateCompose(e.value,n.value??"clean");const g=path.resolve(e.value,"package.json"),d=path.resolve(e.value,".env.example"),k=path.resolve(e.value,".husky/pre-commit"),m=path.resolve(e.value,"gitignore"),u=path.resolve(e.value,"npmrc");await Promise.all([replaceContentInFile_compose.replaceContentInFileCompose(g,[["app-name",c]]),replaceContentInFile_compose.replaceContentInFileCompose(d,[["app-name",c]]),replaceContentInFile_compose.replaceContentInFileCompose(k,[["pnpm",l.value]]),promises.rename(m,path.resolve(path.dirname(m),".gitignore")),promises.rename(u,path.resolve(path.dirname(u),".npmrc"))]),logs.successLog(`Success in creating new app ${picocolors.cyan(c)}!`,`> ${e.value}`)});(async()=>await w.parseAsync(process.argv))();
|
package/dist/package.json.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0});const name="@leo-h/create-nodejs-app",version="1.0.
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0});const name="@leo-h/create-nodejs-app",version="1.0.12",packageManager="pnpm@9.1.1",author="Leonardo Henrique <leonardo0507.business@gmail.com>",description="Create a modern Node.js app with TypeScript using one command.",license="MIT",keywords=["node","node.js","typescript"],bin={"create-nodejs-app":"./dist/index.js"},files=["./dist","./templates"],repository={type:"git",url:"https://github.com/Leo-Henrique/create-nodejs-app"},scripts={prepare:"husky",start:"node ./dist/index.js","start:dev":"tsx ./src/index.ts","start:dev:watch":"tsx watch ./src/index.ts",typecheck:"tsc --noEmit",lint:"eslint . --ext .ts --max-warnings 0 --cache","lint:fix":"pnpm lint --fix",format:"prettier . --write --cache","test:unit":"vitest run","test:unit:watch":"vitest","test:e2e":"vitest run --config ./vitest.config.e2e.mts","test:e2e:watch":"vitest --config ./vitest.config.e2e.mts","test:coverage":"vitest run --coverage.enabled=true",template:"tsx ./scripts/template-cli.ts",prebuild:"rimraf ./dist",build:"unbuild",prepublishOnly:"pnpm build"},dependencies={commander:"12.1.0",picocolors:"1.0.1",prompts:"2.4.2","validate-npm-package-name":"5.0.1",zod:"3.23.8"},devDependencies={"@faker-js/faker":"8.4.1","@types/node":"20.12.12","@types/prompts":"2.4.9","@types/validate-npm-package-name":"4.0.2","@typescript-eslint/eslint-plugin":"7.10.0","@typescript-eslint/parser":"7.10.0","conventional-changelog-conventionalcommits":"8.0.0",eslint:"8.57.0","eslint-config-prettier":"9.1.0","eslint-plugin-vitest":"0.4.0",husky:"9.0.11","lint-staged":"15.2.2","npm-run-all":"4.1.5",prettier:"3.2.5",rimraf:"5.0.7",tsx:"4.10.5",typescript:"5.4.5",unbuild:"2.0.0","vite-tsconfig-paths":"4.3.2",vitest:"1.6.0"},d={name,version,packageManager,author,description,license,keywords,bin,files,repository,scripts,dependencies,devDependencies};exports.author=author;exports.bin=bin;exports.default=d;exports.dependencies=dependencies;exports.description=description;exports.devDependencies=devDependencies;exports.files=files;exports.keywords=keywords;exports.license=license;exports.name=name;exports.packageManager=packageManager;exports.repository=repository;exports.scripts=scripts;exports.version=version;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@leo-h/create-nodejs-app",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.12",
|
4
4
|
"packageManager": "pnpm@9.1.1",
|
5
5
|
"author": "Leonardo Henrique <leonardo0507.business@gmail.com>",
|
6
6
|
"description": "Create a modern Node.js app with TypeScript using one command.",
|
@@ -13,6 +13,10 @@
|
|
13
13
|
"bin": {
|
14
14
|
"create-nodejs-app": "./dist/index.js"
|
15
15
|
},
|
16
|
+
"files": [
|
17
|
+
"./dist",
|
18
|
+
"./templates"
|
19
|
+
],
|
16
20
|
"repository": {
|
17
21
|
"type": "git",
|
18
22
|
"url": "https://github.com/Leo-Henrique/create-nodejs-app"
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# Logs
|
2
|
+
logs
|
3
|
+
*.log
|
4
|
+
npm-debug.log*
|
5
|
+
yarn-debug.log*
|
6
|
+
yarn-error.log*
|
7
|
+
lerna-debug.log*
|
8
|
+
.pnpm-debug.log*
|
9
|
+
|
10
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
11
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
12
|
+
|
13
|
+
# Runtime data
|
14
|
+
pids
|
15
|
+
*.pid
|
16
|
+
*.seed
|
17
|
+
*.pid.lock
|
18
|
+
|
19
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
20
|
+
lib-cov
|
21
|
+
|
22
|
+
# Coverage directory used by tools like istanbul
|
23
|
+
coverage
|
24
|
+
*.lcov
|
25
|
+
|
26
|
+
# nyc test coverage
|
27
|
+
.nyc_output
|
28
|
+
|
29
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
30
|
+
.grunt
|
31
|
+
|
32
|
+
# Bower dependency directory (https://bower.io/)
|
33
|
+
bower_components
|
34
|
+
|
35
|
+
# node-waf configuration
|
36
|
+
.lock-wscript
|
37
|
+
|
38
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
39
|
+
build/Release
|
40
|
+
|
41
|
+
# Dependency directories
|
42
|
+
node_modules/
|
43
|
+
jspm_packages/
|
44
|
+
|
45
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
46
|
+
web_modules/
|
47
|
+
|
48
|
+
# TypeScript cache
|
49
|
+
*.tsbuildinfo
|
50
|
+
|
51
|
+
# Optional npm cache directory
|
52
|
+
.npm
|
53
|
+
|
54
|
+
# Optional eslint cache
|
55
|
+
.eslintcache
|
56
|
+
|
57
|
+
# Optional stylelint cache
|
58
|
+
.stylelintcache
|
59
|
+
|
60
|
+
# Microbundle cache
|
61
|
+
.rpt2_cache/
|
62
|
+
.rts2_cache_cjs/
|
63
|
+
.rts2_cache_es/
|
64
|
+
.rts2_cache_umd/
|
65
|
+
|
66
|
+
# Optional REPL history
|
67
|
+
.node_repl_history
|
68
|
+
|
69
|
+
# Output of 'npm pack'
|
70
|
+
*.tgz
|
71
|
+
|
72
|
+
# Yarn Integrity file
|
73
|
+
.yarn-integrity
|
74
|
+
|
75
|
+
# parcel-bundler cache (https://parceljs.org/)
|
76
|
+
.cache
|
77
|
+
.parcel-cache
|
78
|
+
|
79
|
+
# Next.js build output
|
80
|
+
.next
|
81
|
+
out
|
82
|
+
|
83
|
+
# Nuxt.js build / generate output
|
84
|
+
.nuxt
|
85
|
+
dist
|
86
|
+
|
87
|
+
# Gatsby files
|
88
|
+
.cache/
|
89
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
90
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
91
|
+
# public
|
92
|
+
|
93
|
+
# vuepress build output
|
94
|
+
.vuepress/dist
|
95
|
+
|
96
|
+
# vuepress v2.x temp and cache directory
|
97
|
+
.temp
|
98
|
+
.cache
|
99
|
+
|
100
|
+
# Docusaurus cache and generated files
|
101
|
+
.docusaurus
|
102
|
+
|
103
|
+
# Serverless directories
|
104
|
+
.serverless/
|
105
|
+
|
106
|
+
# FuseBox cache
|
107
|
+
.fusebox/
|
108
|
+
|
109
|
+
# DynamoDB Local files
|
110
|
+
.dynamodb/
|
111
|
+
|
112
|
+
# TernJS port file
|
113
|
+
.tern-port
|
114
|
+
|
115
|
+
# Stores VSCode versions used for testing VSCode extensions
|
116
|
+
.vscode-test
|
117
|
+
|
118
|
+
# yarn v2
|
119
|
+
.yarn/cache
|
120
|
+
.yarn/unplugged
|
121
|
+
.yarn/build-state.yml
|
122
|
+
.yarn/install-state.gz
|
123
|
+
.pnp.*
|
124
|
+
|
125
|
+
# dotenv environment variable files
|
126
|
+
.env
|
127
|
+
.env.development
|
128
|
+
.env.test
|
129
|
+
.env.production
|
130
|
+
|
131
|
+
# OS
|
132
|
+
.DS_Store
|
@@ -0,0 +1 @@
|
|
1
|
+
save-exact=true
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# Logs
|
2
|
+
logs
|
3
|
+
*.log
|
4
|
+
npm-debug.log*
|
5
|
+
yarn-debug.log*
|
6
|
+
yarn-error.log*
|
7
|
+
lerna-debug.log*
|
8
|
+
.pnpm-debug.log*
|
9
|
+
|
10
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
11
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
12
|
+
|
13
|
+
# Runtime data
|
14
|
+
pids
|
15
|
+
*.pid
|
16
|
+
*.seed
|
17
|
+
*.pid.lock
|
18
|
+
|
19
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
20
|
+
lib-cov
|
21
|
+
|
22
|
+
# Coverage directory used by tools like istanbul
|
23
|
+
coverage
|
24
|
+
*.lcov
|
25
|
+
|
26
|
+
# nyc test coverage
|
27
|
+
.nyc_output
|
28
|
+
|
29
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
30
|
+
.grunt
|
31
|
+
|
32
|
+
# Bower dependency directory (https://bower.io/)
|
33
|
+
bower_components
|
34
|
+
|
35
|
+
# node-waf configuration
|
36
|
+
.lock-wscript
|
37
|
+
|
38
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
39
|
+
build/Release
|
40
|
+
|
41
|
+
# Dependency directories
|
42
|
+
node_modules/
|
43
|
+
jspm_packages/
|
44
|
+
|
45
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
46
|
+
web_modules/
|
47
|
+
|
48
|
+
# TypeScript cache
|
49
|
+
*.tsbuildinfo
|
50
|
+
|
51
|
+
# Optional npm cache directory
|
52
|
+
.npm
|
53
|
+
|
54
|
+
# Optional eslint cache
|
55
|
+
.eslintcache
|
56
|
+
|
57
|
+
# Optional stylelint cache
|
58
|
+
.stylelintcache
|
59
|
+
|
60
|
+
# Microbundle cache
|
61
|
+
.rpt2_cache/
|
62
|
+
.rts2_cache_cjs/
|
63
|
+
.rts2_cache_es/
|
64
|
+
.rts2_cache_umd/
|
65
|
+
|
66
|
+
# Optional REPL history
|
67
|
+
.node_repl_history
|
68
|
+
|
69
|
+
# Output of 'npm pack'
|
70
|
+
*.tgz
|
71
|
+
|
72
|
+
# Yarn Integrity file
|
73
|
+
.yarn-integrity
|
74
|
+
|
75
|
+
# parcel-bundler cache (https://parceljs.org/)
|
76
|
+
.cache
|
77
|
+
.parcel-cache
|
78
|
+
|
79
|
+
# Next.js build output
|
80
|
+
.next
|
81
|
+
out
|
82
|
+
|
83
|
+
# Nuxt.js build / generate output
|
84
|
+
.nuxt
|
85
|
+
dist
|
86
|
+
|
87
|
+
# Gatsby files
|
88
|
+
.cache/
|
89
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
90
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
91
|
+
# public
|
92
|
+
|
93
|
+
# vuepress build output
|
94
|
+
.vuepress/dist
|
95
|
+
|
96
|
+
# vuepress v2.x temp and cache directory
|
97
|
+
.temp
|
98
|
+
.cache
|
99
|
+
|
100
|
+
# Docusaurus cache and generated files
|
101
|
+
.docusaurus
|
102
|
+
|
103
|
+
# Serverless directories
|
104
|
+
.serverless/
|
105
|
+
|
106
|
+
# FuseBox cache
|
107
|
+
.fusebox/
|
108
|
+
|
109
|
+
# DynamoDB Local files
|
110
|
+
.dynamodb/
|
111
|
+
|
112
|
+
# TernJS port file
|
113
|
+
.tern-port
|
114
|
+
|
115
|
+
# Stores VSCode versions used for testing VSCode extensions
|
116
|
+
.vscode-test
|
117
|
+
|
118
|
+
# yarn v2
|
119
|
+
.yarn/cache
|
120
|
+
.yarn/unplugged
|
121
|
+
.yarn/build-state.yml
|
122
|
+
.yarn/install-state.gz
|
123
|
+
.pnp.*
|
124
|
+
|
125
|
+
# dotenv environment variable files
|
126
|
+
.env
|
127
|
+
.env.development
|
128
|
+
.env.test
|
129
|
+
.env.production
|
130
|
+
|
131
|
+
# OS
|
132
|
+
.DS_Store
|
@@ -0,0 +1 @@
|
|
1
|
+
save-exact=true
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# Logs
|
2
|
+
logs
|
3
|
+
*.log
|
4
|
+
npm-debug.log*
|
5
|
+
yarn-debug.log*
|
6
|
+
yarn-error.log*
|
7
|
+
lerna-debug.log*
|
8
|
+
.pnpm-debug.log*
|
9
|
+
|
10
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
11
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
12
|
+
|
13
|
+
# Runtime data
|
14
|
+
pids
|
15
|
+
*.pid
|
16
|
+
*.seed
|
17
|
+
*.pid.lock
|
18
|
+
|
19
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
20
|
+
lib-cov
|
21
|
+
|
22
|
+
# Coverage directory used by tools like istanbul
|
23
|
+
coverage
|
24
|
+
*.lcov
|
25
|
+
|
26
|
+
# nyc test coverage
|
27
|
+
.nyc_output
|
28
|
+
|
29
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
30
|
+
.grunt
|
31
|
+
|
32
|
+
# Bower dependency directory (https://bower.io/)
|
33
|
+
bower_components
|
34
|
+
|
35
|
+
# node-waf configuration
|
36
|
+
.lock-wscript
|
37
|
+
|
38
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
39
|
+
build/Release
|
40
|
+
|
41
|
+
# Dependency directories
|
42
|
+
node_modules/
|
43
|
+
jspm_packages/
|
44
|
+
|
45
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
46
|
+
web_modules/
|
47
|
+
|
48
|
+
# TypeScript cache
|
49
|
+
*.tsbuildinfo
|
50
|
+
|
51
|
+
# Optional npm cache directory
|
52
|
+
.npm
|
53
|
+
|
54
|
+
# Optional eslint cache
|
55
|
+
.eslintcache
|
56
|
+
|
57
|
+
# Optional stylelint cache
|
58
|
+
.stylelintcache
|
59
|
+
|
60
|
+
# Microbundle cache
|
61
|
+
.rpt2_cache/
|
62
|
+
.rts2_cache_cjs/
|
63
|
+
.rts2_cache_es/
|
64
|
+
.rts2_cache_umd/
|
65
|
+
|
66
|
+
# Optional REPL history
|
67
|
+
.node_repl_history
|
68
|
+
|
69
|
+
# Output of 'npm pack'
|
70
|
+
*.tgz
|
71
|
+
|
72
|
+
# Yarn Integrity file
|
73
|
+
.yarn-integrity
|
74
|
+
|
75
|
+
# parcel-bundler cache (https://parceljs.org/)
|
76
|
+
.cache
|
77
|
+
.parcel-cache
|
78
|
+
|
79
|
+
# Next.js build output
|
80
|
+
.next
|
81
|
+
out
|
82
|
+
|
83
|
+
# Nuxt.js build / generate output
|
84
|
+
.nuxt
|
85
|
+
dist
|
86
|
+
|
87
|
+
# Gatsby files
|
88
|
+
.cache/
|
89
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
90
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
91
|
+
# public
|
92
|
+
|
93
|
+
# vuepress build output
|
94
|
+
.vuepress/dist
|
95
|
+
|
96
|
+
# vuepress v2.x temp and cache directory
|
97
|
+
.temp
|
98
|
+
.cache
|
99
|
+
|
100
|
+
# Docusaurus cache and generated files
|
101
|
+
.docusaurus
|
102
|
+
|
103
|
+
# Serverless directories
|
104
|
+
.serverless/
|
105
|
+
|
106
|
+
# FuseBox cache
|
107
|
+
.fusebox/
|
108
|
+
|
109
|
+
# DynamoDB Local files
|
110
|
+
.dynamodb/
|
111
|
+
|
112
|
+
# TernJS port file
|
113
|
+
.tern-port
|
114
|
+
|
115
|
+
# Stores VSCode versions used for testing VSCode extensions
|
116
|
+
.vscode-test
|
117
|
+
|
118
|
+
# yarn v2
|
119
|
+
.yarn/cache
|
120
|
+
.yarn/unplugged
|
121
|
+
.yarn/build-state.yml
|
122
|
+
.yarn/install-state.gz
|
123
|
+
.pnp.*
|
124
|
+
|
125
|
+
# dotenv environment variable files
|
126
|
+
.env
|
127
|
+
.env.development
|
128
|
+
.env.test
|
129
|
+
.env.production
|
130
|
+
|
131
|
+
# OS
|
132
|
+
.DS_Store
|
@@ -0,0 +1 @@
|
|
1
|
+
save-exact=true
|