netcore-blueprint 1.0.11 → 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/create.js +4 -25
- package/package.json +1 -1
package/create.js
CHANGED
|
@@ -32,9 +32,9 @@ function copyAndRename(src, dest) {
|
|
|
32
32
|
} else {
|
|
33
33
|
let content = fs.readFileSync(src, 'utf8');
|
|
34
34
|
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
content = content.replace(
|
|
35
|
+
// Rename Solution and Project Names
|
|
36
|
+
content = content.replace(/Blueprint\.API/g, projectName.toUpperCase());
|
|
37
|
+
content = content.replace(/Blueprint/g, projectName.toUpperCase());
|
|
38
38
|
|
|
39
39
|
fs.writeFileSync(dest, content);
|
|
40
40
|
}
|
|
@@ -48,7 +48,7 @@ if (fs.existsSync(destinationPath)) {
|
|
|
48
48
|
|
|
49
49
|
fs.mkdirSync(destinationPath, { recursive: true });
|
|
50
50
|
|
|
51
|
-
// Copy
|
|
51
|
+
// Copy template files
|
|
52
52
|
templateItems.forEach(item => {
|
|
53
53
|
const srcPath = path.join(__dirname, item);
|
|
54
54
|
let destPath = path.join(destinationPath, item);
|
|
@@ -66,25 +66,4 @@ templateItems.forEach(item => {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
|
-
// Rename Directories & Solution File
|
|
70
|
-
const renameItems = [
|
|
71
|
-
{ old: "Blueprint.API", new: `${projectName}.API` },
|
|
72
|
-
{ old: "Blueprint.Core", new: `${projectName}.Core` },
|
|
73
|
-
{ old: "Blueprint.Infra", new: `${projectName}.Infra` },
|
|
74
|
-
{ old: "Blueprint.Test", new: `${projectName}.Test` },
|
|
75
|
-
{ old: "Blueprint.API.sln", new: `${projectName}.sln` }
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
renameItems.forEach(({ old, new: newName }) => {
|
|
79
|
-
const oldPath = path.join(destinationPath, old);
|
|
80
|
-
const newPath = path.join(destinationPath, newName);
|
|
81
|
-
|
|
82
|
-
if (fs.existsSync(oldPath)) {
|
|
83
|
-
fs.renameSync(oldPath, newPath);
|
|
84
|
-
console.log(`🔄 Renamed ${old} -> ${newName}`);
|
|
85
|
-
} else {
|
|
86
|
-
console.warn(`⚠️ Warning: ${old} not found.`);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
69
|
console.log(`🎉 Project "${projectName}" created successfully at ${destinationPath}`);
|