netcore-blueprint 0.0.32 → 0.0.34

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.
Files changed (2) hide show
  1. package/bin/copy-module.js +18 -24
  2. package/package.json +1 -1
@@ -22,9 +22,9 @@ if (!sourceModuleName) {
22
22
  const modulesPath = process.cwd();
23
23
 
24
24
  const templateRoot = path.join(modulesPath, sourceModuleName);
25
- const targetModuleRoot = path.join(modulesPath, `${sourceModuleName}Module`);
25
+ const targetModuleRoot = path.join(modulesPath, '..', 'BlueprintTemplate', 'Modules', `${sourceModuleName}Module`);
26
26
 
27
- const solutionFile = findSolutionFileUpwards(modulesPath);
27
+ const solutionFile = findSolutionFileFixed(modulesPath);
28
28
 
29
29
  if (!fs.existsSync(templateRoot)) {
30
30
  console.error(`❌ Source module folder not found: ${templateRoot}`);
@@ -57,7 +57,7 @@ fs.mkdirSync(targetModuleRoot, { recursive: true });
57
57
  // =====================================================
58
58
 
59
59
  const projects = [
60
- { name: `${sourceModuleName}Module.API`, type: 'webapi' },
60
+ { name: `${sourceModuleName}Module.API`, type: 'classlib' },
61
61
  { name: `${sourceModuleName}Module.Core`, type: 'classlib' },
62
62
  { name: `${sourceModuleName}Module.Infrastructure`, type: 'classlib' },
63
63
  ];
@@ -147,27 +147,21 @@ function copyRecursive(src, dest) {
147
147
  }
148
148
  }
149
149
 
150
- function findSolutionFileUpwards(startDir) {
151
- let current = startDir;
152
-
153
- while (true) {
154
- // 1. Check current folder
155
- const files = fs.readdirSync(current);
156
- let sln = files.find(f => f.endsWith('.sln') || f.endsWith('.slnx'));
157
- if (sln) return path.join(current, sln);
158
-
159
- // 2. Check BlueprintTemplate sibling
160
- const blueprintTemplate = path.join(current, 'BlueprintTemplate');
161
- if (fs.existsSync(blueprintTemplate)) {
162
- const btFiles = fs.readdirSync(blueprintTemplate);
163
- sln = btFiles.find(f => f.endsWith('.sln') || f.endsWith('.slnx'));
164
- if (sln) return path.join(blueprintTemplate, sln);
165
- }
150
+ function findSolutionFileFixed(startDir) {
151
+ // startDir = .../Modules/SomeModule
152
+ const root = path.dirname(startDir);
153
+ const blueprintTemplate = path.join(root, 'BlueprintTemplate');
166
154
 
167
- // 3. Go up
168
- const parent = path.dirname(current);
169
- if (parent === current) return null;
170
- current = parent;
155
+ if (!fs.existsSync(blueprintTemplate)) {
156
+ throw new Error('BlueprintTemplate folder not found');
171
157
  }
172
- }
173
158
 
159
+ const btFiles = fs.readdirSync(blueprintTemplate);
160
+ const sln = btFiles.find(f => f.endsWith('.sln') || f.endsWith('.slnx'));
161
+
162
+ if (!sln) {
163
+ throw new Error('No .sln file found in BlueprintTemplate');
164
+ }
165
+
166
+ return path.join(blueprintTemplate, sln);
167
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "netcore-blueprint",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "A custom project blueprint",
5
5
  "main": "create.js",
6
6
  "bin": {