@agiflowai/scaffold-mcp 1.0.0 → 1.0.2
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/ScaffoldService-B3En_m4t.cjs +3 -0
- package/dist/{ScaffoldService-B-L4gwHt.cjs → ScaffoldService-BwDmXt83.cjs} +11 -8
- package/dist/ScaffoldService-CJ3vNmAj.js +3 -0
- package/dist/{ScaffoldService-QgQKHMM-.js → ScaffoldService-DB7-Cyod.js} +10 -7
- package/dist/{VariableReplacementService-D8C-IsP-.js → VariableReplacementService-BAwTGv_R.js} +1 -1
- package/dist/{VariableReplacementService-BrJ1PdKm.cjs → VariableReplacementService-CroHkMha.cjs} +1 -1
- package/dist/{VariableReplacementService-BL84vnKk.cjs → VariableReplacementService-D0QnWKUW.cjs} +2 -2
- package/dist/{VariableReplacementService-B3qARIC9.js → VariableReplacementService-DRxd9ILB.js} +1 -1
- package/dist/cli.cjs +147 -731
- package/dist/cli.js +146 -727
- package/dist/index.cjs +142 -8
- package/dist/index.d.cts +28 -12
- package/dist/index.d.ts +28 -12
- package/dist/index.js +133 -3
- package/dist/{stdio-Dmpwju2k.js → stdio-Bxn4A1IU.js} +455 -456
- package/dist/{stdio-Cz5aRdvr.cjs → stdio-TGsG8akc.cjs} +470 -502
- package/package.json +4 -3
- package/dist/ScaffoldService-Cx4ZonaT.cjs +0 -3
- package/dist/ScaffoldService-DVsusUh5.js +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
let node_path = require("node:path");
|
|
3
|
-
node_path = require_chunk.__toESM(node_path);
|
|
4
2
|
let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
|
|
5
3
|
__agiflowai_aicode_utils = require_chunk.__toESM(__agiflowai_aicode_utils);
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_chunk.__toESM(node_path);
|
|
6
6
|
let node_url = require("node:url");
|
|
7
7
|
node_url = require_chunk.__toESM(node_url);
|
|
8
8
|
|
|
@@ -123,17 +123,19 @@ var ScaffoldService = class {
|
|
|
123
123
|
async useBoilerplate(options) {
|
|
124
124
|
try {
|
|
125
125
|
const { projectName, packageName, targetFolder, templateFolder, boilerplateName, variables = {} } = options;
|
|
126
|
-
const targetPath = node_path.default.isAbsolute(targetFolder) ? node_path.default.join(targetFolder, projectName) : node_path.default.join(process.cwd(), targetFolder, projectName);
|
|
126
|
+
const targetPath = node_path.default.isAbsolute(targetFolder) ? projectName ? node_path.default.join(targetFolder, projectName) : targetFolder : projectName ? node_path.default.join(process.cwd(), targetFolder, projectName) : node_path.default.join(process.cwd(), targetFolder);
|
|
127
127
|
const templatePath = node_path.default.join(this.templatesRootPath, templateFolder);
|
|
128
128
|
const validationResult = await this.scaffoldConfigLoader.validateTemplate(templatePath, "boilerplate");
|
|
129
129
|
if (!validationResult.isValid) return {
|
|
130
130
|
success: false,
|
|
131
131
|
message: `Template validation failed: ${[...validationResult.errors, ...validationResult.missingFiles.map((f) => `Template file not found: ${f}`)].join("; ")}`
|
|
132
132
|
};
|
|
133
|
-
if (
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
if (projectName) {
|
|
134
|
+
if (await this.fileSystem.pathExists(targetPath)) return {
|
|
135
|
+
success: false,
|
|
136
|
+
message: `Directory ${targetPath} already exists`
|
|
137
|
+
};
|
|
138
|
+
}
|
|
137
139
|
const architectConfig = await this.scaffoldConfigLoader.parseArchitectConfig(templatePath);
|
|
138
140
|
if (!architectConfig || !architectConfig.boilerplate) return {
|
|
139
141
|
success: false,
|
|
@@ -148,9 +150,10 @@ var ScaffoldService = class {
|
|
|
148
150
|
message: `Boilerplate '${boilerplateName}' not found in scaffold configuration`
|
|
149
151
|
};
|
|
150
152
|
} else config = architectConfig.boilerplate;
|
|
153
|
+
const effectiveProjectName = projectName || (packageName.includes("/") ? packageName.split("/")[1] : packageName);
|
|
151
154
|
const allVariables = {
|
|
152
155
|
...variables,
|
|
153
|
-
projectName,
|
|
156
|
+
projectName: effectiveProjectName,
|
|
154
157
|
packageName
|
|
155
158
|
};
|
|
156
159
|
return await this.processScaffold({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import { TemplatesManagerService, log } from "@agiflowai/aicode-utils";
|
|
2
|
+
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
|
|
5
5
|
//#region src/services/ScaffoldProcessingService.ts
|
|
@@ -119,17 +119,19 @@ var ScaffoldService = class {
|
|
|
119
119
|
async useBoilerplate(options) {
|
|
120
120
|
try {
|
|
121
121
|
const { projectName, packageName, targetFolder, templateFolder, boilerplateName, variables = {} } = options;
|
|
122
|
-
const targetPath = path.isAbsolute(targetFolder) ? path.join(targetFolder, projectName) : path.join(process.cwd(), targetFolder, projectName);
|
|
122
|
+
const targetPath = path.isAbsolute(targetFolder) ? projectName ? path.join(targetFolder, projectName) : targetFolder : projectName ? path.join(process.cwd(), targetFolder, projectName) : path.join(process.cwd(), targetFolder);
|
|
123
123
|
const templatePath = path.join(this.templatesRootPath, templateFolder);
|
|
124
124
|
const validationResult = await this.scaffoldConfigLoader.validateTemplate(templatePath, "boilerplate");
|
|
125
125
|
if (!validationResult.isValid) return {
|
|
126
126
|
success: false,
|
|
127
127
|
message: `Template validation failed: ${[...validationResult.errors, ...validationResult.missingFiles.map((f) => `Template file not found: ${f}`)].join("; ")}`
|
|
128
128
|
};
|
|
129
|
-
if (
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
if (projectName) {
|
|
130
|
+
if (await this.fileSystem.pathExists(targetPath)) return {
|
|
131
|
+
success: false,
|
|
132
|
+
message: `Directory ${targetPath} already exists`
|
|
133
|
+
};
|
|
134
|
+
}
|
|
133
135
|
const architectConfig = await this.scaffoldConfigLoader.parseArchitectConfig(templatePath);
|
|
134
136
|
if (!architectConfig || !architectConfig.boilerplate) return {
|
|
135
137
|
success: false,
|
|
@@ -144,9 +146,10 @@ var ScaffoldService = class {
|
|
|
144
146
|
message: `Boilerplate '${boilerplateName}' not found in scaffold configuration`
|
|
145
147
|
};
|
|
146
148
|
} else config = architectConfig.boilerplate;
|
|
149
|
+
const effectiveProjectName = projectName || (packageName.includes("/") ? packageName.split("/")[1] : packageName);
|
|
147
150
|
const allVariables = {
|
|
148
151
|
...variables,
|
|
149
|
-
projectName,
|
|
152
|
+
projectName: effectiveProjectName,
|
|
150
153
|
packageName
|
|
151
154
|
};
|
|
152
155
|
return await this.processScaffold({
|
package/dist/{VariableReplacementService-BrJ1PdKm.cjs → VariableReplacementService-CroHkMha.cjs}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const require_VariableReplacementService = require('./VariableReplacementService-
|
|
1
|
+
const require_VariableReplacementService = require('./VariableReplacementService-D0QnWKUW.cjs');
|
|
2
2
|
|
|
3
3
|
exports.VariableReplacementService = require_VariableReplacementService.VariableReplacementService;
|
package/dist/{VariableReplacementService-BL84vnKk.cjs → VariableReplacementService-D0QnWKUW.cjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
let node_path = require("node:path");
|
|
3
|
-
node_path = require_chunk.__toESM(node_path);
|
|
4
2
|
let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
|
|
5
3
|
__agiflowai_aicode_utils = require_chunk.__toESM(__agiflowai_aicode_utils);
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_chunk.__toESM(node_path);
|
|
6
6
|
|
|
7
7
|
//#region src/services/VariableReplacementService.ts
|
|
8
8
|
var VariableReplacementService = class {
|