create-nodets-app-nish 1.0.6 → 1.0.7
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/bin/index.js +21 -1
- package/package.json +1 -1
- package/templates/nodejs-typescript/gitignore +44 -0
package/bin/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import fs from 'fs-extra';
|
|
4
4
|
import path from 'path';
|
|
@@ -55,6 +55,26 @@ async function main() {
|
|
|
55
55
|
|
|
56
56
|
fs.copySync(templatePath, projectName, { overwrite: false });
|
|
57
57
|
|
|
58
|
+
// npm strips .gitignore from packages, so we store it as "gitignore"
|
|
59
|
+
// and rename it back after copying
|
|
60
|
+
const gitignoreSrc = path.join(projectName, 'gitignore');
|
|
61
|
+
const gitignoreDest = path.join(projectName, '.gitignore');
|
|
62
|
+
if (fs.existsSync(gitignoreSrc)) {
|
|
63
|
+
fs.renameSync(gitignoreSrc, gitignoreDest);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Remove .gitkeep placeholder files (they were only needed for npm packing)
|
|
67
|
+
const gitkeepFiles = [
|
|
68
|
+
path.join(projectName, 'src', 'controllers', 'admin', '.gitkeep'),
|
|
69
|
+
path.join(projectName, 'src', 'controllers', 'user', '.gitkeep'),
|
|
70
|
+
path.join(projectName, 'src', 'middlewares', '.gitkeep'),
|
|
71
|
+
path.join(projectName, 'src', 'routers', '.gitkeep'),
|
|
72
|
+
path.join(projectName, 'public', '.gitkeep'),
|
|
73
|
+
];
|
|
74
|
+
gitkeepFiles.forEach((f) => {
|
|
75
|
+
if (fs.existsSync(f)) fs.removeSync(f);
|
|
76
|
+
});
|
|
77
|
+
|
|
58
78
|
// Update package.json with project name
|
|
59
79
|
const packageJsonPath = path.join(projectName, 'package.json');
|
|
60
80
|
const packageJson = fs.readJsonSync(packageJsonPath);
|
package/package.json
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
/.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Testing
|
|
7
|
+
/coverage
|
|
8
|
+
|
|
9
|
+
# Production
|
|
10
|
+
/dist
|
|
11
|
+
/build
|
|
12
|
+
|
|
13
|
+
# Misc
|
|
14
|
+
.DS_Store
|
|
15
|
+
*.pem
|
|
16
|
+
|
|
17
|
+
# Debug
|
|
18
|
+
npm-debug.log*
|
|
19
|
+
yarn-debug.log*
|
|
20
|
+
yarn-error.log*
|
|
21
|
+
|
|
22
|
+
# Local env files
|
|
23
|
+
.env
|
|
24
|
+
.env.local
|
|
25
|
+
.env.development.local
|
|
26
|
+
.env.test.local
|
|
27
|
+
.env.production.local
|
|
28
|
+
|
|
29
|
+
# IDE
|
|
30
|
+
.vscode/
|
|
31
|
+
.idea/
|
|
32
|
+
*.swp
|
|
33
|
+
*.swo
|
|
34
|
+
*~
|
|
35
|
+
.project
|
|
36
|
+
.classpath
|
|
37
|
+
.c9/
|
|
38
|
+
*.launch
|
|
39
|
+
.settings/
|
|
40
|
+
*.sublime-workspace
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
Thumbs.db
|
|
44
|
+
.DS_Store
|