costrix 1.0.12 → 1.0.13
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/package.json +1 -1
- package/src/scaffold.js +6 -4
- package/templates/gitignore +25 -0
package/package.json
CHANGED
package/src/scaffold.js
CHANGED
|
@@ -46,7 +46,10 @@ function copyTemplateDir(templateDir, projectDir, appName, rootTemplateDir) {
|
|
|
46
46
|
entries.forEach((entry) => {
|
|
47
47
|
const sourcePath = path.join(templateDir, entry.name);
|
|
48
48
|
const relativePath = path.relative(rootTemplateDir, sourcePath);
|
|
49
|
-
const
|
|
49
|
+
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
50
|
+
const outputRelativePath =
|
|
51
|
+
normalizedRelativePath === "gitignore" ? ".gitignore" : normalizedRelativePath;
|
|
52
|
+
const targetPath = path.join(projectDir, outputRelativePath);
|
|
50
53
|
|
|
51
54
|
if (entry.isDirectory()) {
|
|
52
55
|
fs.mkdirSync(targetPath, { recursive: true });
|
|
@@ -54,7 +57,6 @@ function copyTemplateDir(templateDir, projectDir, appName, rootTemplateDir) {
|
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
const normalizedRelativePath = relativePath.replace(/\\/g, "/");
|
|
58
60
|
let created = false;
|
|
59
61
|
if (normalizedRelativePath === "package.json") {
|
|
60
62
|
const rawContent = fs.readFileSync(sourcePath, "utf8");
|
|
@@ -65,11 +67,11 @@ function copyTemplateDir(templateDir, projectDir, appName, rootTemplateDir) {
|
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
if (created) {
|
|
68
|
-
logStep(`Created ${
|
|
70
|
+
logStep(`Created ${outputRelativePath}`);
|
|
69
71
|
return;
|
|
70
72
|
}
|
|
71
73
|
|
|
72
|
-
logWarn(`Skipped ${
|
|
74
|
+
logWarn(`Skipped ${outputRelativePath} (already exists)`);
|
|
73
75
|
});
|
|
74
76
|
}
|
|
75
77
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
coverage/
|
|
4
|
+
|
|
5
|
+
# Build and cache
|
|
6
|
+
.cache/
|
|
7
|
+
.webpack/
|
|
8
|
+
*.tsbuildinfo
|
|
9
|
+
|
|
10
|
+
# Logs
|
|
11
|
+
npm-debug.log*
|
|
12
|
+
yarn-debug.log*
|
|
13
|
+
yarn-error.log*
|
|
14
|
+
pnpm-debug.log*
|
|
15
|
+
|
|
16
|
+
# Environment files
|
|
17
|
+
.env
|
|
18
|
+
.env.*
|
|
19
|
+
!.env.example
|
|
20
|
+
|
|
21
|
+
# OS/editor noise
|
|
22
|
+
.DS_Store
|
|
23
|
+
Thumbs.db
|
|
24
|
+
.idea/
|
|
25
|
+
.vscode/
|