@agiflowai/scaffold-mcp 0.0.0 → 0.1.0
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/index.js +16 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -519,11 +519,25 @@ boilerplateCommand.command("info <boilerplateName>").description("Show detailed
|
|
|
519
519
|
//#endregion
|
|
520
520
|
//#region src/cli/init.ts
|
|
521
521
|
/**
|
|
522
|
+
* Find the workspace root by searching upwards for .git folder
|
|
523
|
+
*/
|
|
524
|
+
async function findWorkspaceRoot(startPath = process.cwd()) {
|
|
525
|
+
let currentPath = path.resolve(startPath);
|
|
526
|
+
const rootPath = path.parse(currentPath).root;
|
|
527
|
+
while (true) {
|
|
528
|
+
const gitPath = path.join(currentPath, ".git");
|
|
529
|
+
if (await fs$1.pathExists(gitPath)) return currentPath;
|
|
530
|
+
if (currentPath === rootPath) return process.cwd();
|
|
531
|
+
currentPath = path.dirname(currentPath);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
522
535
|
* Init command - initialize templates folder
|
|
523
536
|
*/
|
|
524
|
-
const initCommand = new Command("init").description("Initialize templates folder structure
|
|
537
|
+
const initCommand = new Command("init").description("Initialize templates folder structure at workspace root").action(async () => {
|
|
525
538
|
try {
|
|
526
|
-
const
|
|
539
|
+
const workspaceRoot = await findWorkspaceRoot();
|
|
540
|
+
const templatesPath = path.join(workspaceRoot, "templates");
|
|
527
541
|
logger.info(`${icons.rocket} Initializing templates folder at: ${templatesPath}`);
|
|
528
542
|
await fs$1.ensureDir(templatesPath);
|
|
529
543
|
await fs$1.ensureDir(path.join(templatesPath, "boilerplates"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agiflowai/scaffold-mcp",
|
|
3
3
|
"description": "MCP server for scaffolding applications with boilerplate templates",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "AgiflowIO",
|
|
7
7
|
"repository": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"js-yaml": "4.1.0",
|
|
43
43
|
"liquidjs": "10.21.1",
|
|
44
44
|
"zod": "3.25.76",
|
|
45
|
-
"@agiflowai/scaffold-generator": "0.
|
|
45
|
+
"@agiflowai/scaffold-generator": "0.1.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/express": "^5.0.0",
|