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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "costrix",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "npx initializer for a TypeScript + Webpack + Jest project",
5
5
  "bin": {
6
6
  "costrix": "./bin/costrix.js"
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 targetPath = path.join(projectDir, relativePath);
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 ${normalizedRelativePath}`);
70
+ logStep(`Created ${outputRelativePath}`);
69
71
  return;
70
72
  }
71
73
 
72
- logWarn(`Skipped ${normalizedRelativePath} (already exists)`);
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/