create-uk-node-server 1.0.10 → 1.0.11

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/index.js CHANGED
@@ -31,9 +31,11 @@ async function main() {
31
31
  const pkg = fs.readJsonSync(pkgPath);
32
32
  pkg.name = answers.projectName;
33
33
  fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });
34
+ console.log("Installing dependencies...")
34
35
  execSync(`cd ${projectPath} && npm install`);
35
36
  console.log('success!')
36
- console.log(`cd ${answers.projectName} and change DB connection in .env file and run npm start`)
37
+ console.log(`create .env file and add DB_URL = "your-db-connection-string"`)
38
+ console.log(`run npm start`)
37
39
  })
38
40
  }
39
41
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-uk-node-server",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A CLI tool to quickly scaffold server projects with JavaScript or TypeScript templates",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,60 +0,0 @@
1
- export default function createPackageJsonFile(projectPath, projectName, language) {
2
- let packageJson = `
3
- {
4
- "name": "${projectName}",
5
- "version": "1.0.0",
6
- "description": "",
7
- "main": "index.js",
8
- "scripts": {
9
- "start": "node index.js",
10
- "dev": "nodemon index.js",
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
- },
13
- "keywords": [],
14
- "author": "",
15
- "license": "ISC",
16
- "type": "module",
17
- "dependencies": {
18
- "bcrypt": "^6.0.0",
19
- "dotenv": "^16.5.0",
20
- "express": "^5.1.0",
21
- "mongoose": "^8.15.0",
22
- "nodemon": "^3.1.10"
23
- }
24
- }
25
- `
26
- // if language is typescript
27
- if (language === "typescript") {
28
- packageJson = `
29
- {
30
- "name": "${projectName}",
31
- "version": "1.0.0",
32
- "description": "TypeScript server template",
33
- "main": "dist/index.js",
34
- "scripts": {
35
- "start": "node dist/index.js",
36
- "dev": "ts-node src/index.ts",
37
- "build": "tsc",
38
- "watch": "tsc --watch"
39
- },
40
- "dependencies": {
41
- "express": "^4.18.2",
42
- "dotenv": "^16.3.1",
43
- "cors": "^2.8.5",
44
- "mongoose": "^8.0.3"
45
- },
46
- "devDependencies": {
47
- "@types/express": "^4.17.21",
48
- "@types/node": "^20.10.0",
49
- "@types/cors": "^2.8.17",
50
- "typescript": "^5.3.2",
51
- "ts-node": "^10.9.1"
52
- },
53
- "keywords": [],
54
- "author": "",
55
- "license": "ISC"
56
- }
57
- `
58
- }
59
- fs.writeFileSync(path.join(projectPath, "package.json"), packageJson)
60
- }