@agiflowai/scaffold-mcp 1.0.0 → 1.0.1

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.
@@ -0,0 +1,3 @@
1
+ const require_ScaffoldService = require('./ScaffoldService-BwDmXt83.cjs');
2
+
3
+ exports.ScaffoldService = require_ScaffoldService.ScaffoldService;
@@ -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 (await this.fileSystem.pathExists(targetPath)) return {
134
- success: false,
135
- message: `Directory ${targetPath} already exists`
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({
@@ -0,0 +1,3 @@
1
+ import { ScaffoldService } from "./ScaffoldService-DB7-Cyod.js";
2
+
3
+ export { ScaffoldService };
@@ -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 (await this.fileSystem.pathExists(targetPath)) return {
130
- success: false,
131
- message: `Directory ${targetPath} already exists`
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({
@@ -1,3 +1,3 @@
1
- import { VariableReplacementService } from "./VariableReplacementService-B3qARIC9.js";
1
+ import { VariableReplacementService } from "./VariableReplacementService-DRxd9ILB.js";
2
2
 
3
3
  export { VariableReplacementService };
@@ -1,3 +1,3 @@
1
- const require_VariableReplacementService = require('./VariableReplacementService-BL84vnKk.cjs');
1
+ const require_VariableReplacementService = require('./VariableReplacementService-D0QnWKUW.cjs');
2
2
 
3
3
  exports.VariableReplacementService = require_VariableReplacementService.VariableReplacementService;
@@ -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 {
@@ -1,5 +1,5 @@
1
- import path from "node:path";
2
1
  import { log } from "@agiflowai/aicode-utils";
2
+ import path from "node:path";
3
3
 
4
4
  //#region src/services/VariableReplacementService.ts
5
5
  var VariableReplacementService = class {