mycontext-cli 2.0.2 → 2.0.3
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/dist/agents/implementations/CodeGenSubAgent.d.ts.map +1 -1
- package/dist/agents/implementations/CodeGenSubAgent.js +69 -0
- package/dist/agents/implementations/CodeGenSubAgent.js.map +1 -1
- package/dist/agents/implementations/PromptConstructorAgent.d.ts.map +1 -1
- package/dist/agents/implementations/PromptConstructorAgent.js +23 -0
- package/dist/agents/implementations/PromptConstructorAgent.js.map +1 -1
- package/dist/cli.js +11 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/health-check.d.ts +28 -0
- package/dist/commands/health-check.d.ts.map +1 -0
- package/dist/commands/health-check.js +271 -0
- package/dist/commands/health-check.js.map +1 -0
- package/dist/package.json +1 -1
- package/dist/utils/NextJSProjectGenerator.d.ts +70 -0
- package/dist/utils/NextJSProjectGenerator.d.ts.map +1 -0
- package/dist/utils/NextJSProjectGenerator.js +811 -0
- package/dist/utils/NextJSProjectGenerator.js.map +1 -0
- package/dist/utils/NextJSProjectValidator.d.ts +103 -0
- package/dist/utils/NextJSProjectValidator.d.ts.map +1 -0
- package/dist/utils/NextJSProjectValidator.js +759 -0
- package/dist/utils/NextJSProjectValidator.js.map +1 -0
- package/dist/utils/PreCommandValidator.d.ts +77 -0
- package/dist/utils/PreCommandValidator.d.ts.map +1 -0
- package/dist/utils/PreCommandValidator.js +251 -0
- package/dist/utils/PreCommandValidator.js.map +1 -0
- package/dist/utils/ProjectHealthMonitor.d.ts +131 -0
- package/dist/utils/ProjectHealthMonitor.d.ts.map +1 -0
- package/dist/utils/ProjectHealthMonitor.js +454 -0
- package/dist/utils/ProjectHealthMonitor.js.map +1 -0
- package/dist/utils/ProjectInitializationSafeguards.d.ts +81 -0
- package/dist/utils/ProjectInitializationSafeguards.d.ts.map +1 -0
- package/dist/utils/ProjectInitializationSafeguards.js +620 -0
- package/dist/utils/ProjectInitializationSafeguards.js.map +1 -0
- package/dist/utils/ProjectStructureRepair.d.ts +110 -0
- package/dist/utils/ProjectStructureRepair.d.ts.map +1 -0
- package/dist/utils/ProjectStructureRepair.js +785 -0
- package/dist/utils/ProjectStructureRepair.js.map +1 -0
- package/dist/utils/ProjectStructureValidator.d.ts +128 -0
- package/dist/utils/ProjectStructureValidator.d.ts.map +1 -0
- package/dist/utils/ProjectStructureValidator.js +662 -0
- package/dist/utils/ProjectStructureValidator.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.ProjectInitializationSafeguards = void 0;
|
|
40
|
+
const fs = __importStar(require("fs-extra"));
|
|
41
|
+
const path = __importStar(require("path"));
|
|
42
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
43
|
+
const ProjectStructureValidator_1 = require("./ProjectStructureValidator");
|
|
44
|
+
class ProjectInitializationSafeguards {
|
|
45
|
+
constructor() {
|
|
46
|
+
this.validator = new ProjectStructureValidator_1.ProjectStructureValidator();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Comprehensive project initialization with safeguards
|
|
50
|
+
*/
|
|
51
|
+
async initializeProject(options) {
|
|
52
|
+
const result = {
|
|
53
|
+
success: false,
|
|
54
|
+
warnings: [],
|
|
55
|
+
errors: [],
|
|
56
|
+
projectPath: options.projectPath,
|
|
57
|
+
structureValid: false,
|
|
58
|
+
};
|
|
59
|
+
console.log(chalk_1.default.blue("🛡️ Initializing project with safeguards..."));
|
|
60
|
+
console.log(chalk_1.default.blue("==========================================\n"));
|
|
61
|
+
try {
|
|
62
|
+
// Step 1: Validate target location
|
|
63
|
+
await this.validateTargetLocation(options.projectPath, result);
|
|
64
|
+
// Step 2: Check for existing project conflicts
|
|
65
|
+
await this.checkExistingProjectConflicts(options.projectPath, result);
|
|
66
|
+
// Step 3: Create project structure safely
|
|
67
|
+
await this.createProjectStructure(options, result);
|
|
68
|
+
// Step 4: Initialize package.json with safeguards
|
|
69
|
+
await this.initializePackageJson(options, result);
|
|
70
|
+
// Step 5: Set up framework-specific configuration
|
|
71
|
+
await this.setupFrameworkConfiguration(options, result);
|
|
72
|
+
// Step 6: Initialize MyContext configuration
|
|
73
|
+
await this.initializeMyContextConfig(options, result);
|
|
74
|
+
// Step 7: Final validation
|
|
75
|
+
await this.performFinalValidation(options.projectPath, result);
|
|
76
|
+
if (result.errors.length === 0) {
|
|
77
|
+
result.success = true;
|
|
78
|
+
console.log(chalk_1.default.green("\n✅ Project initialization completed successfully!"));
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
console.log(chalk_1.default.red("\n❌ Project initialization completed with errors"));
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
result.errors.push(`Initialization failed: ${error}`);
|
|
87
|
+
console.log(chalk_1.default.red(`❌ Project initialization failed: ${error}`));
|
|
88
|
+
return result;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate target location for project creation
|
|
93
|
+
*/
|
|
94
|
+
async validateTargetLocation(projectPath, result) {
|
|
95
|
+
console.log(chalk_1.default.blue("📍 Validating target location..."));
|
|
96
|
+
// Check if path contains spaces
|
|
97
|
+
if (projectPath.includes(" ")) {
|
|
98
|
+
result.warnings.push("Project path contains spaces, which may cause issues with some tools");
|
|
99
|
+
}
|
|
100
|
+
// Check path length
|
|
101
|
+
if (projectPath.length > 200) {
|
|
102
|
+
result.warnings.push("Project path is very long, consider using a shorter path");
|
|
103
|
+
}
|
|
104
|
+
// Check for invalid characters
|
|
105
|
+
if (/[<>:"|?*]/.test(projectPath)) {
|
|
106
|
+
result.errors.push("Project path contains invalid characters");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Check if directory exists and is writable
|
|
110
|
+
try {
|
|
111
|
+
if (await fs.pathExists(projectPath)) {
|
|
112
|
+
const stats = await fs.stat(projectPath);
|
|
113
|
+
if (!stats.isDirectory()) {
|
|
114
|
+
result.errors.push("Target path exists but is not a directory");
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
// Create parent directory if it doesn't exist
|
|
120
|
+
const parentDir = path.dirname(projectPath);
|
|
121
|
+
if (!(await fs.pathExists(parentDir))) {
|
|
122
|
+
await fs.ensureDir(parentDir);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
result.errors.push(`Cannot access target location: ${error}`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
console.log(chalk_1.default.green("✅ Target location validated"));
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Check for existing project conflicts
|
|
134
|
+
*/
|
|
135
|
+
async checkExistingProjectConflicts(projectPath, result) {
|
|
136
|
+
console.log(chalk_1.default.blue("🔍 Checking for existing project conflicts..."));
|
|
137
|
+
const conflictFiles = [
|
|
138
|
+
"package.json",
|
|
139
|
+
"package-lock.json",
|
|
140
|
+
"yarn.lock",
|
|
141
|
+
"pnpm-lock.yaml",
|
|
142
|
+
"bun.lockb",
|
|
143
|
+
"tsconfig.json",
|
|
144
|
+
"next.config.js",
|
|
145
|
+
"next.config.ts",
|
|
146
|
+
".mycontext",
|
|
147
|
+
];
|
|
148
|
+
const existingFiles = [];
|
|
149
|
+
for (const file of conflictFiles) {
|
|
150
|
+
const filePath = path.join(projectPath, file);
|
|
151
|
+
if (await fs.pathExists(filePath)) {
|
|
152
|
+
existingFiles.push(file);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (existingFiles.length > 0) {
|
|
156
|
+
result.warnings.push(`Found existing project files: ${existingFiles.join(", ")}`);
|
|
157
|
+
// Check if this looks like a MyContext project
|
|
158
|
+
if (existingFiles.includes(".mycontext")) {
|
|
159
|
+
result.warnings.push("This appears to be an existing MyContext project");
|
|
160
|
+
}
|
|
161
|
+
// Check for package manager conflicts
|
|
162
|
+
const lockFiles = existingFiles.filter((file) => file.includes("lock") || file.includes("lockb"));
|
|
163
|
+
if (lockFiles.length > 1) {
|
|
164
|
+
result.errors.push(`Multiple package managers detected: ${lockFiles.join(", ")}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
console.log(chalk_1.default.green("✅ Conflict check completed"));
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create project structure safely
|
|
171
|
+
*/
|
|
172
|
+
async createProjectStructure(options, result) {
|
|
173
|
+
console.log(chalk_1.default.blue("🏗️ Creating project structure..."));
|
|
174
|
+
try {
|
|
175
|
+
// Ensure project directory exists
|
|
176
|
+
await fs.ensureDir(options.projectPath);
|
|
177
|
+
// Create essential directories
|
|
178
|
+
const directories = [
|
|
179
|
+
"src",
|
|
180
|
+
"components",
|
|
181
|
+
"lib",
|
|
182
|
+
"hooks",
|
|
183
|
+
"types",
|
|
184
|
+
"public",
|
|
185
|
+
".mycontext",
|
|
186
|
+
];
|
|
187
|
+
for (const dir of directories) {
|
|
188
|
+
const dirPath = path.join(options.projectPath, dir);
|
|
189
|
+
await fs.ensureDir(dirPath);
|
|
190
|
+
}
|
|
191
|
+
// Create .gitignore if it doesn't exist
|
|
192
|
+
const gitignorePath = path.join(options.projectPath, ".gitignore");
|
|
193
|
+
if (!(await fs.pathExists(gitignorePath))) {
|
|
194
|
+
const gitignoreContent = this.generateGitignoreContent();
|
|
195
|
+
await fs.writeFile(gitignorePath, gitignoreContent);
|
|
196
|
+
}
|
|
197
|
+
console.log(chalk_1.default.green("✅ Project structure created"));
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
result.errors.push(`Failed to create project structure: ${error}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Initialize package.json with safeguards
|
|
205
|
+
*/
|
|
206
|
+
async initializePackageJson(options, result) {
|
|
207
|
+
console.log(chalk_1.default.blue("📦 Initializing package.json..."));
|
|
208
|
+
const packageJsonPath = path.join(options.projectPath, "package.json");
|
|
209
|
+
// Check if package.json already exists
|
|
210
|
+
if (await fs.pathExists(packageJsonPath)) {
|
|
211
|
+
result.warnings.push("package.json already exists, skipping initialization");
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
const packageJson = this.generatePackageJson(options);
|
|
216
|
+
await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 });
|
|
217
|
+
console.log(chalk_1.default.green("✅ package.json initialized"));
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
result.errors.push(`Failed to initialize package.json: ${error}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Set up framework-specific configuration
|
|
225
|
+
*/
|
|
226
|
+
async setupFrameworkConfiguration(options, result) {
|
|
227
|
+
console.log(chalk_1.default.blue("⚙️ Setting up framework configuration..."));
|
|
228
|
+
try {
|
|
229
|
+
if (options.framework === "nextjs") {
|
|
230
|
+
await this.setupNextJSConfiguration(options.projectPath, result);
|
|
231
|
+
}
|
|
232
|
+
// Set up TypeScript configuration
|
|
233
|
+
await this.setupTypeScriptConfiguration(options.projectPath, result);
|
|
234
|
+
// Set up Tailwind CSS if requested
|
|
235
|
+
if (options.withShadcn && !options.skipShadcn) {
|
|
236
|
+
await this.setupTailwindConfiguration(options.projectPath, result);
|
|
237
|
+
}
|
|
238
|
+
console.log(chalk_1.default.green("✅ Framework configuration completed"));
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
result.errors.push(`Failed to setup framework configuration: ${error}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Set up Next.js configuration
|
|
246
|
+
*/
|
|
247
|
+
async setupNextJSConfiguration(projectPath, result) {
|
|
248
|
+
const nextConfigPath = path.join(projectPath, "next.config.ts");
|
|
249
|
+
if (await fs.pathExists(nextConfigPath)) {
|
|
250
|
+
result.warnings.push("next.config.ts already exists");
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
const nextConfig = `import type { NextConfig } from "next";
|
|
254
|
+
|
|
255
|
+
const nextConfig: NextConfig = {
|
|
256
|
+
experimental: {
|
|
257
|
+
turbo: true,
|
|
258
|
+
},
|
|
259
|
+
typescript: {
|
|
260
|
+
ignoreBuildErrors: false,
|
|
261
|
+
},
|
|
262
|
+
eslint: {
|
|
263
|
+
ignoreDuringBuilds: false,
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export default nextConfig;
|
|
268
|
+
`;
|
|
269
|
+
await fs.writeFile(nextConfigPath, nextConfig);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Set up TypeScript configuration
|
|
273
|
+
*/
|
|
274
|
+
async setupTypeScriptConfiguration(projectPath, result) {
|
|
275
|
+
const tsConfigPath = path.join(projectPath, "tsconfig.json");
|
|
276
|
+
if (await fs.pathExists(tsConfigPath)) {
|
|
277
|
+
result.warnings.push("tsconfig.json already exists");
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const tsConfig = {
|
|
281
|
+
compilerOptions: {
|
|
282
|
+
target: "es5",
|
|
283
|
+
lib: ["dom", "dom.iterable", "es6"],
|
|
284
|
+
allowJs: true,
|
|
285
|
+
skipLibCheck: true,
|
|
286
|
+
strict: true,
|
|
287
|
+
noEmit: true,
|
|
288
|
+
esModuleInterop: true,
|
|
289
|
+
module: "esnext",
|
|
290
|
+
moduleResolution: "bundler",
|
|
291
|
+
resolveJsonModule: true,
|
|
292
|
+
isolatedModules: true,
|
|
293
|
+
jsx: "preserve",
|
|
294
|
+
incremental: true,
|
|
295
|
+
plugins: [
|
|
296
|
+
{
|
|
297
|
+
name: "next",
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
paths: {
|
|
301
|
+
"@/*": ["./*"],
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
include: ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
|
305
|
+
exclude: ["node_modules"],
|
|
306
|
+
};
|
|
307
|
+
await fs.writeJson(tsConfigPath, tsConfig, { spaces: 2 });
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Set up Tailwind CSS configuration
|
|
311
|
+
*/
|
|
312
|
+
async setupTailwindConfiguration(projectPath, result) {
|
|
313
|
+
const tailwindConfigPath = path.join(projectPath, "tailwind.config.ts");
|
|
314
|
+
if (await fs.pathExists(tailwindConfigPath)) {
|
|
315
|
+
result.warnings.push("tailwind.config.ts already exists");
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const tailwindConfig = `import type { Config } from "tailwindcss";
|
|
319
|
+
|
|
320
|
+
const config: Config = {
|
|
321
|
+
content: [
|
|
322
|
+
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
323
|
+
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
324
|
+
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
325
|
+
],
|
|
326
|
+
theme: {
|
|
327
|
+
extend: {
|
|
328
|
+
colors: {
|
|
329
|
+
background: "var(--background)",
|
|
330
|
+
foreground: "var(--foreground)",
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
plugins: [],
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
export default config;
|
|
338
|
+
`;
|
|
339
|
+
await fs.writeFile(tailwindConfigPath, tailwindConfig);
|
|
340
|
+
// Create postcss.config.js
|
|
341
|
+
const postcssConfigPath = path.join(projectPath, "postcss.config.js");
|
|
342
|
+
if (!(await fs.pathExists(postcssConfigPath))) {
|
|
343
|
+
const postcssConfig = `module.exports = {
|
|
344
|
+
plugins: {
|
|
345
|
+
tailwindcss: {},
|
|
346
|
+
autoprefixer: {},
|
|
347
|
+
},
|
|
348
|
+
};
|
|
349
|
+
`;
|
|
350
|
+
await fs.writeFile(postcssConfigPath, postcssConfig);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Initialize MyContext configuration
|
|
355
|
+
*/
|
|
356
|
+
async initializeMyContextConfig(options, result) {
|
|
357
|
+
console.log(chalk_1.default.blue("🎯 Initializing MyContext configuration..."));
|
|
358
|
+
try {
|
|
359
|
+
const myContextDir = path.join(options.projectPath, ".mycontext");
|
|
360
|
+
await fs.ensureDir(myContextDir);
|
|
361
|
+
// Create initial context files
|
|
362
|
+
const contextFiles = [
|
|
363
|
+
"01-prd.md",
|
|
364
|
+
"02-user-stories.md",
|
|
365
|
+
"03-technical-specs.md",
|
|
366
|
+
"04-edge-cases.md",
|
|
367
|
+
];
|
|
368
|
+
for (const file of contextFiles) {
|
|
369
|
+
const filePath = path.join(myContextDir, file);
|
|
370
|
+
if (!(await fs.pathExists(filePath))) {
|
|
371
|
+
await fs.writeFile(filePath, `# ${file.replace(".md", "").replace("-", " ").toUpperCase()}\n\n<!-- Add your content here -->\n`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// Create component list
|
|
375
|
+
const componentListPath = path.join(myContextDir, "component-list.json");
|
|
376
|
+
if (!(await fs.pathExists(componentListPath))) {
|
|
377
|
+
const componentList = {
|
|
378
|
+
components: [],
|
|
379
|
+
groups: [],
|
|
380
|
+
metadata: {
|
|
381
|
+
created: new Date().toISOString(),
|
|
382
|
+
version: "1.0.0",
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
await fs.writeJson(componentListPath, componentList, { spaces: 2 });
|
|
386
|
+
}
|
|
387
|
+
console.log(chalk_1.default.green("✅ MyContext configuration initialized"));
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
result.errors.push(`Failed to initialize MyContext configuration: ${error}`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Perform final validation
|
|
395
|
+
*/
|
|
396
|
+
async performFinalValidation(projectPath, result) {
|
|
397
|
+
console.log(chalk_1.default.blue("🔍 Performing final validation..."));
|
|
398
|
+
try {
|
|
399
|
+
// Update validator to use the new project path
|
|
400
|
+
this.validator = new ProjectStructureValidator_1.ProjectStructureValidator(projectPath);
|
|
401
|
+
const validationReport = await this.validator.validate();
|
|
402
|
+
result.structureValid = validationReport.isValid;
|
|
403
|
+
if (!validationReport.isValid) {
|
|
404
|
+
result.warnings.push(`Project structure validation found ${validationReport.issues.length} issues`);
|
|
405
|
+
// Auto-fix if possible
|
|
406
|
+
if (validationReport.autoFixable) {
|
|
407
|
+
const fixResult = await this.validator.autoFix();
|
|
408
|
+
if (fixResult.fixed > 0) {
|
|
409
|
+
result.warnings.push(`Auto-fixed ${fixResult.fixed} issues`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
console.log(chalk_1.default.green("✅ Final validation completed"));
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
result.errors.push(`Final validation failed: ${error}`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Generate package.json content
|
|
421
|
+
*/
|
|
422
|
+
generatePackageJson(options) {
|
|
423
|
+
const basePackageJson = {
|
|
424
|
+
name: options.projectName.toLowerCase().replace(/[^a-z0-9-]/g, "-"),
|
|
425
|
+
version: "0.1.0",
|
|
426
|
+
private: true,
|
|
427
|
+
scripts: {
|
|
428
|
+
dev: "next dev",
|
|
429
|
+
build: "next build",
|
|
430
|
+
start: "next start",
|
|
431
|
+
lint: "next lint",
|
|
432
|
+
"type-check": "tsc --noEmit",
|
|
433
|
+
},
|
|
434
|
+
packageManager: "pnpm@10.11.0",
|
|
435
|
+
};
|
|
436
|
+
if (options.framework === "nextjs") {
|
|
437
|
+
basePackageJson.dependencies = {
|
|
438
|
+
react: "^18.0.0",
|
|
439
|
+
"react-dom": "^18.0.0",
|
|
440
|
+
next: "^14.0.0",
|
|
441
|
+
};
|
|
442
|
+
basePackageJson.devDependencies = {
|
|
443
|
+
typescript: "^5.0.0",
|
|
444
|
+
"@types/node": "^20.0.0",
|
|
445
|
+
"@types/react": "^18.0.0",
|
|
446
|
+
"@types/react-dom": "^18.0.0",
|
|
447
|
+
eslint: "^8.0.0",
|
|
448
|
+
"eslint-config-next": "^14.0.0",
|
|
449
|
+
};
|
|
450
|
+
if (options.withShadcn && !options.skipShadcn) {
|
|
451
|
+
basePackageJson.devDependencies = {
|
|
452
|
+
...basePackageJson.devDependencies,
|
|
453
|
+
tailwindcss: "^3.0.0",
|
|
454
|
+
autoprefixer: "^10.0.0",
|
|
455
|
+
postcss: "^8.0.0",
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return basePackageJson;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Generate .gitignore content
|
|
463
|
+
*/
|
|
464
|
+
generateGitignoreContent() {
|
|
465
|
+
return `# Dependencies
|
|
466
|
+
node_modules/
|
|
467
|
+
.pnp
|
|
468
|
+
.pnp.js
|
|
469
|
+
|
|
470
|
+
# Production builds
|
|
471
|
+
.next/
|
|
472
|
+
out/
|
|
473
|
+
build/
|
|
474
|
+
dist/
|
|
475
|
+
|
|
476
|
+
# Environment variables
|
|
477
|
+
.env
|
|
478
|
+
.env.local
|
|
479
|
+
.env.development.local
|
|
480
|
+
.env.test.local
|
|
481
|
+
.env.production.local
|
|
482
|
+
|
|
483
|
+
# Logs
|
|
484
|
+
npm-debug.log*
|
|
485
|
+
yarn-debug.log*
|
|
486
|
+
yarn-error.log*
|
|
487
|
+
pnpm-debug.log*
|
|
488
|
+
lerna-debug.log*
|
|
489
|
+
|
|
490
|
+
# Runtime data
|
|
491
|
+
pids
|
|
492
|
+
*.pid
|
|
493
|
+
*.seed
|
|
494
|
+
*.pid.lock
|
|
495
|
+
|
|
496
|
+
# Coverage directory used by tools like istanbul
|
|
497
|
+
coverage/
|
|
498
|
+
*.lcov
|
|
499
|
+
|
|
500
|
+
# nyc test coverage
|
|
501
|
+
.nyc_output
|
|
502
|
+
|
|
503
|
+
# Dependency directories
|
|
504
|
+
node_modules/
|
|
505
|
+
jspm_packages/
|
|
506
|
+
|
|
507
|
+
# TypeScript cache
|
|
508
|
+
*.tsbuildinfo
|
|
509
|
+
|
|
510
|
+
# Optional npm cache directory
|
|
511
|
+
.npm
|
|
512
|
+
|
|
513
|
+
# Optional eslint cache
|
|
514
|
+
.eslintcache
|
|
515
|
+
|
|
516
|
+
# Optional REPL history
|
|
517
|
+
.node_repl_history
|
|
518
|
+
|
|
519
|
+
# Output of 'npm pack'
|
|
520
|
+
*.tgz
|
|
521
|
+
|
|
522
|
+
# Yarn Integrity file
|
|
523
|
+
.yarn-integrity
|
|
524
|
+
|
|
525
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
526
|
+
.cache
|
|
527
|
+
.parcel-cache
|
|
528
|
+
|
|
529
|
+
# Next.js build output
|
|
530
|
+
.next
|
|
531
|
+
|
|
532
|
+
# Nuxt.js build / generate output
|
|
533
|
+
.nuxt
|
|
534
|
+
dist
|
|
535
|
+
|
|
536
|
+
# Gatsby files
|
|
537
|
+
.cache/
|
|
538
|
+
public
|
|
539
|
+
|
|
540
|
+
# Storybook build outputs
|
|
541
|
+
.out
|
|
542
|
+
.storybook-out
|
|
543
|
+
|
|
544
|
+
# Temporary folders
|
|
545
|
+
tmp/
|
|
546
|
+
temp/
|
|
547
|
+
|
|
548
|
+
# Editor directories and files
|
|
549
|
+
.vscode/
|
|
550
|
+
.idea/
|
|
551
|
+
*.swp
|
|
552
|
+
*.swo
|
|
553
|
+
*~
|
|
554
|
+
|
|
555
|
+
# OS generated files
|
|
556
|
+
.DS_Store
|
|
557
|
+
.DS_Store?
|
|
558
|
+
._*
|
|
559
|
+
.Spotlight-V100
|
|
560
|
+
.Trashes
|
|
561
|
+
ehthumbs.db
|
|
562
|
+
Thumbs.db
|
|
563
|
+
|
|
564
|
+
# MyContext specific
|
|
565
|
+
.mycontext/.env
|
|
566
|
+
.mycontext/logs/
|
|
567
|
+
.mycontext/cache/
|
|
568
|
+
`;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Check if a directory is safe to initialize a project in
|
|
572
|
+
*/
|
|
573
|
+
async isSafeToInitialize(projectPath) {
|
|
574
|
+
const warnings = [];
|
|
575
|
+
const errors = [];
|
|
576
|
+
try {
|
|
577
|
+
// Check if directory exists and is writable
|
|
578
|
+
if (await fs.pathExists(projectPath)) {
|
|
579
|
+
const stats = await fs.stat(projectPath);
|
|
580
|
+
if (!stats.isDirectory()) {
|
|
581
|
+
errors.push("Target path exists but is not a directory");
|
|
582
|
+
return { safe: false, warnings, errors };
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
// Check for existing project files
|
|
586
|
+
const conflictFiles = ["package.json", "tsconfig.json", ".mycontext"];
|
|
587
|
+
const existingFiles = [];
|
|
588
|
+
for (const file of conflictFiles) {
|
|
589
|
+
const filePath = path.join(projectPath, file);
|
|
590
|
+
if (await fs.pathExists(filePath)) {
|
|
591
|
+
existingFiles.push(file);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
if (existingFiles.length > 0) {
|
|
595
|
+
warnings.push(`Found existing project files: ${existingFiles.join(", ")}`);
|
|
596
|
+
}
|
|
597
|
+
// Check path issues
|
|
598
|
+
if (projectPath.includes(" ")) {
|
|
599
|
+
warnings.push("Project path contains spaces");
|
|
600
|
+
}
|
|
601
|
+
if (projectPath.length > 200) {
|
|
602
|
+
warnings.push("Project path is very long");
|
|
603
|
+
}
|
|
604
|
+
if (/[<>:"|?*]/.test(projectPath)) {
|
|
605
|
+
errors.push("Project path contains invalid characters");
|
|
606
|
+
}
|
|
607
|
+
return {
|
|
608
|
+
safe: errors.length === 0,
|
|
609
|
+
warnings,
|
|
610
|
+
errors,
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
catch (error) {
|
|
614
|
+
errors.push(`Cannot access target location: ${error}`);
|
|
615
|
+
return { safe: false, warnings, errors };
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
exports.ProjectInitializationSafeguards = ProjectInitializationSafeguards;
|
|
620
|
+
//# sourceMappingURL=ProjectInitializationSafeguards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProjectInitializationSafeguards.js","sourceRoot":"","sources":["../../src/utils/ProjectInitializationSafeguards.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,2CAA6B;AAC7B,kDAA0B;AAC1B,2EAAwE;AAoBxE,MAAa,+BAA+B;IAG1C;QACE,IAAI,CAAC,SAAS,GAAG,IAAI,qDAAyB,EAAE,CAAC;IACnD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,iBAAiB,CACrB,OAAqC;QAErC,MAAM,MAAM,GAAyB;YACnC,OAAO,EAAE,KAAK;YACd,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE;YACV,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,cAAc,EAAE,KAAK;SACtB,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC,CAAC;QACxE,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC,CAAC;QAExE,IAAI,CAAC;YACH,mCAAmC;YACnC,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAE/D,+CAA+C;YAC/C,MAAM,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAEtE,0CAA0C;YAC1C,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAEnD,kDAAkD;YAClD,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YAElD,kDAAkD;YAClD,MAAM,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC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