@agiflowai/scaffold-mcp 0.3.0 → 0.3.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.
@@ -0,0 +1,3 @@
1
+ const require_ScaffoldConfigLoader = require('./ScaffoldConfigLoader-CvIJEFcI.js');
2
+
3
+ exports.ScaffoldConfigLoader = require_ScaffoldConfigLoader.ScaffoldConfigLoader;
@@ -1,42 +1,46 @@
1
- import path from "node:path";
2
- import yaml from "js-yaml";
3
- import { z } from "zod";
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ let node_path = require("node:path");
3
+ node_path = require_chunk.__toESM(node_path);
4
+ let js_yaml = require("js-yaml");
5
+ js_yaml = require_chunk.__toESM(js_yaml);
6
+ let zod = require("zod");
7
+ zod = require_chunk.__toESM(zod);
4
8
 
5
9
  //#region src/services/ScaffoldConfigLoader.ts
6
- const VariablesSchemaSchema = z.object({
7
- type: z.literal("object"),
8
- properties: z.record(z.any()),
9
- required: z.array(z.string()),
10
- additionalProperties: z.boolean()
10
+ const VariablesSchemaSchema = zod.z.object({
11
+ type: zod.z.literal("object"),
12
+ properties: zod.z.record(zod.z.any()),
13
+ required: zod.z.array(zod.z.string()),
14
+ additionalProperties: zod.z.boolean()
11
15
  });
12
- const ScaffoldConfigEntrySchema = z.object({
13
- name: z.string(),
14
- description: z.string().optional(),
15
- instruction: z.string().optional(),
16
- targetFolder: z.string().optional(),
16
+ const ScaffoldConfigEntrySchema = zod.z.object({
17
+ name: zod.z.string(),
18
+ description: zod.z.string().optional(),
19
+ instruction: zod.z.string().optional(),
20
+ targetFolder: zod.z.string().optional(),
17
21
  variables_schema: VariablesSchemaSchema,
18
- includes: z.array(z.string()),
19
- generator: z.string().optional(),
20
- patterns: z.array(z.string()).optional()
22
+ includes: zod.z.array(zod.z.string()),
23
+ generator: zod.z.string().optional(),
24
+ patterns: zod.z.array(zod.z.string()).optional()
21
25
  });
22
- const ScaffoldYamlSchema = z.object({
23
- boilerplate: z.union([ScaffoldConfigEntrySchema, z.array(ScaffoldConfigEntrySchema)]).optional(),
24
- features: z.union([ScaffoldConfigEntrySchema, z.array(ScaffoldConfigEntrySchema)]).optional()
25
- }).catchall(z.union([ScaffoldConfigEntrySchema, z.array(ScaffoldConfigEntrySchema)]));
26
+ const ScaffoldYamlSchema = zod.z.object({
27
+ boilerplate: zod.z.union([ScaffoldConfigEntrySchema, zod.z.array(ScaffoldConfigEntrySchema)]).optional(),
28
+ features: zod.z.union([ScaffoldConfigEntrySchema, zod.z.array(ScaffoldConfigEntrySchema)]).optional()
29
+ }).catchall(zod.z.union([ScaffoldConfigEntrySchema, zod.z.array(ScaffoldConfigEntrySchema)]));
26
30
  var ScaffoldConfigLoader = class {
27
31
  constructor(fileSystem, templateService) {
28
32
  this.fileSystem = fileSystem;
29
33
  this.templateService = templateService;
30
34
  }
31
35
  async parseArchitectConfig(templatePath) {
32
- const architectPath = path.join(templatePath, "scaffold.yaml");
36
+ const architectPath = node_path.default.join(templatePath, "scaffold.yaml");
33
37
  if (!await this.fileSystem.pathExists(architectPath)) return null;
34
38
  try {
35
39
  const content = await this.fileSystem.readFile(architectPath, "utf8");
36
- const rawConfig = yaml.load(content);
40
+ const rawConfig = js_yaml.default.load(content);
37
41
  return ScaffoldYamlSchema.parse(rawConfig);
38
42
  } catch (error) {
39
- if (error instanceof z.ZodError) {
43
+ if (error instanceof zod.z.ZodError) {
40
44
  const errorMessages = error.errors.map((err) => `${err.path.join(".")}: ${err.message}`).join("; ");
41
45
  throw new Error(`scaffold.yaml validation failed: ${errorMessages}`);
42
46
  }
@@ -124,7 +128,7 @@ var ScaffoldConfigLoader = class {
124
128
  const config = architectConfig[scaffoldType];
125
129
  if (config.includes && Array.isArray(config.includes)) for (const includeFile of config.includes) {
126
130
  const parsed = this.parseIncludeEntry(includeFile, {});
127
- const sourcePath = path.join(templatePath, parsed.sourcePath);
131
+ const sourcePath = node_path.default.join(templatePath, parsed.sourcePath);
128
132
  const liquidSourcePath = `${sourcePath}.liquid`;
129
133
  const sourceExists = await this.fileSystem.pathExists(sourcePath);
130
134
  const liquidExists = await this.fileSystem.pathExists(liquidSourcePath);
@@ -139,4 +143,9 @@ var ScaffoldConfigLoader = class {
139
143
  };
140
144
 
141
145
  //#endregion
142
- export { ScaffoldConfigLoader };
146
+ Object.defineProperty(exports, 'ScaffoldConfigLoader', {
147
+ enumerable: true,
148
+ get: function () {
149
+ return ScaffoldConfigLoader;
150
+ }
151
+ });
@@ -0,0 +1,4 @@
1
+ require('./logger-Dno88AK9.js');
2
+ const require_ScaffoldService = require('./ScaffoldService-N6X24Vw0.js');
3
+
4
+ exports.ScaffoldService = require_ScaffoldService.ScaffoldService;
@@ -1,12 +1,12 @@
1
- import { createRequire } from "node:module";
2
- import path from "node:path";
3
- import * as fs$1 from "fs-extra";
4
- import { fileURLToPath } from "node:url";
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const require_logger = require('./logger-Dno88AK9.js');
3
+ let node_path = require("node:path");
4
+ node_path = require_chunk.__toESM(node_path);
5
+ let fs_extra = require("fs-extra");
6
+ fs_extra = require_chunk.__toESM(fs_extra);
7
+ let node_url = require("node:url");
8
+ node_url = require_chunk.__toESM(node_url);
5
9
 
6
- //#region rolldown:runtime
7
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
8
-
9
- //#endregion
10
10
  //#region src/services/ScaffoldProcessingService.ts
11
11
  /**
12
12
  * Shared service for common scaffolding operations like processing templates and tracking files
@@ -43,7 +43,7 @@ var ScaffoldProcessingService = class {
43
43
  * Automatically handles .liquid template files by stripping the extension
44
44
  */
45
45
  async copyAndProcess(sourcePath, targetPath, variables, createdFiles, existingFiles) {
46
- await this.fileSystem.ensureDir(path.dirname(targetPath));
46
+ await this.fileSystem.ensureDir(node_path.default.dirname(targetPath));
47
47
  if (await this.fileSystem.pathExists(targetPath) && existingFiles) {
48
48
  await this.trackExistingFiles(targetPath, existingFiles);
49
49
  return;
@@ -66,18 +66,18 @@ var ScaffoldProcessingService = class {
66
66
  try {
67
67
  items = await this.fileSystem.readdir(dirPath);
68
68
  } catch (error) {
69
- console.warn(`Cannot read directory ${dirPath}: ${error}`);
69
+ require_logger.log.warn(`Cannot read directory ${dirPath}: ${error}`);
70
70
  return;
71
71
  }
72
72
  for (const item of items) {
73
73
  if (!item) continue;
74
- const itemPath = path.join(dirPath, item);
74
+ const itemPath = node_path.default.join(dirPath, item);
75
75
  try {
76
76
  const stat = await this.fileSystem.stat(itemPath);
77
77
  if (stat.isDirectory()) await this.trackCreatedFilesRecursive(itemPath, createdFiles);
78
78
  else if (stat.isFile()) createdFiles.push(itemPath);
79
79
  } catch (error) {
80
- console.warn(`Cannot stat ${itemPath}: ${error}`);
80
+ require_logger.log.warn(`Cannot stat ${itemPath}: ${error}`);
81
81
  }
82
82
  }
83
83
  }
@@ -89,18 +89,18 @@ var ScaffoldProcessingService = class {
89
89
  try {
90
90
  items = await this.fileSystem.readdir(dirPath);
91
91
  } catch (error) {
92
- console.warn(`Cannot read directory ${dirPath}: ${error}`);
92
+ require_logger.log.warn(`Cannot read directory ${dirPath}: ${error}`);
93
93
  return;
94
94
  }
95
95
  for (const item of items) {
96
96
  if (!item) continue;
97
- const itemPath = path.join(dirPath, item);
97
+ const itemPath = node_path.default.join(dirPath, item);
98
98
  try {
99
99
  const stat = await this.fileSystem.stat(itemPath);
100
100
  if (stat.isDirectory()) await this.trackExistingFilesRecursive(itemPath, existingFiles);
101
101
  else if (stat.isFile()) existingFiles.push(itemPath);
102
102
  } catch (error) {
103
- console.warn(`Cannot stat ${itemPath}: ${error}`);
103
+ require_logger.log.warn(`Cannot stat ${itemPath}: ${error}`);
104
104
  }
105
105
  }
106
106
  }
@@ -129,32 +129,32 @@ var TemplatesManager = class TemplatesManager {
129
129
  */
130
130
  static async findTemplatesPath(startPath = process.cwd()) {
131
131
  const workspaceRoot = await TemplatesManager.findWorkspaceRoot(startPath);
132
- const toolkitConfigPath = path.join(workspaceRoot, TemplatesManager.TOOLKIT_CONFIG_FILE);
133
- if (await fs$1.pathExists(toolkitConfigPath)) {
132
+ const toolkitConfigPath = node_path.default.join(workspaceRoot, TemplatesManager.TOOLKIT_CONFIG_FILE);
133
+ if (await fs_extra.pathExists(toolkitConfigPath)) {
134
134
  const yaml = await import("js-yaml");
135
- const content = await fs$1.readFile(toolkitConfigPath, "utf-8");
135
+ const content = await fs_extra.readFile(toolkitConfigPath, "utf-8");
136
136
  const config = yaml.load(content);
137
137
  if (config?.templatesPath) {
138
- const templatesPath$1 = path.isAbsolute(config.templatesPath) ? config.templatesPath : path.join(workspaceRoot, config.templatesPath);
139
- if (await fs$1.pathExists(templatesPath$1)) return templatesPath$1;
138
+ const templatesPath$1 = node_path.default.isAbsolute(config.templatesPath) ? config.templatesPath : node_path.default.join(workspaceRoot, config.templatesPath);
139
+ if (await fs_extra.pathExists(templatesPath$1)) return templatesPath$1;
140
140
  else throw new Error(`Templates path specified in toolkit.yaml does not exist: ${templatesPath$1}`);
141
141
  }
142
142
  }
143
- const templatesPath = path.join(workspaceRoot, TemplatesManager.TEMPLATES_FOLDER);
144
- if (await fs$1.pathExists(templatesPath)) return templatesPath;
143
+ const templatesPath = node_path.default.join(workspaceRoot, TemplatesManager.TEMPLATES_FOLDER);
144
+ if (await fs_extra.pathExists(templatesPath)) return templatesPath;
145
145
  throw new Error(`Templates folder not found at ${templatesPath}.\nEither create a 'templates' folder or specify templatesPath in toolkit.yaml`);
146
146
  }
147
147
  /**
148
148
  * Find the workspace root by searching upwards for .git folder
149
149
  */
150
150
  static async findWorkspaceRoot(startPath) {
151
- let currentPath = path.resolve(startPath);
152
- const rootPath = path.parse(currentPath).root;
151
+ let currentPath = node_path.default.resolve(startPath);
152
+ const rootPath = node_path.default.parse(currentPath).root;
153
153
  while (true) {
154
- const gitPath = path.join(currentPath, ".git");
155
- if (await fs$1.pathExists(gitPath)) return currentPath;
154
+ const gitPath = node_path.default.join(currentPath, ".git");
155
+ if (await fs_extra.pathExists(gitPath)) return currentPath;
156
156
  if (currentPath === rootPath) return process.cwd();
157
- currentPath = path.dirname(currentPath);
157
+ currentPath = node_path.default.dirname(currentPath);
158
158
  }
159
159
  }
160
160
  /**
@@ -167,32 +167,32 @@ var TemplatesManager = class TemplatesManager {
167
167
  */
168
168
  static findTemplatesPathSync(startPath = process.cwd()) {
169
169
  const workspaceRoot = TemplatesManager.findWorkspaceRootSync(startPath);
170
- const toolkitConfigPath = path.join(workspaceRoot, TemplatesManager.TOOLKIT_CONFIG_FILE);
171
- if (fs$1.pathExistsSync(toolkitConfigPath)) {
172
- const yaml = __require("js-yaml");
173
- const content = fs$1.readFileSync(toolkitConfigPath, "utf-8");
170
+ const toolkitConfigPath = node_path.default.join(workspaceRoot, TemplatesManager.TOOLKIT_CONFIG_FILE);
171
+ if (fs_extra.pathExistsSync(toolkitConfigPath)) {
172
+ const yaml = require("js-yaml");
173
+ const content = fs_extra.readFileSync(toolkitConfigPath, "utf-8");
174
174
  const config = yaml.load(content);
175
175
  if (config?.templatesPath) {
176
- const templatesPath$1 = path.isAbsolute(config.templatesPath) ? config.templatesPath : path.join(workspaceRoot, config.templatesPath);
177
- if (fs$1.pathExistsSync(templatesPath$1)) return templatesPath$1;
176
+ const templatesPath$1 = node_path.default.isAbsolute(config.templatesPath) ? config.templatesPath : node_path.default.join(workspaceRoot, config.templatesPath);
177
+ if (fs_extra.pathExistsSync(templatesPath$1)) return templatesPath$1;
178
178
  else throw new Error(`Templates path specified in toolkit.yaml does not exist: ${templatesPath$1}`);
179
179
  }
180
180
  }
181
- const templatesPath = path.join(workspaceRoot, TemplatesManager.TEMPLATES_FOLDER);
182
- if (fs$1.pathExistsSync(templatesPath)) return templatesPath;
181
+ const templatesPath = node_path.default.join(workspaceRoot, TemplatesManager.TEMPLATES_FOLDER);
182
+ if (fs_extra.pathExistsSync(templatesPath)) return templatesPath;
183
183
  throw new Error(`Templates folder not found at ${templatesPath}.\nEither create a 'templates' folder or specify templatesPath in toolkit.yaml`);
184
184
  }
185
185
  /**
186
186
  * Find the workspace root synchronously by searching upwards for .git folder
187
187
  */
188
188
  static findWorkspaceRootSync(startPath) {
189
- let currentPath = path.resolve(startPath);
190
- const rootPath = path.parse(currentPath).root;
189
+ let currentPath = node_path.default.resolve(startPath);
190
+ const rootPath = node_path.default.parse(currentPath).root;
191
191
  while (true) {
192
- const gitPath = path.join(currentPath, ".git");
193
- if (fs$1.pathExistsSync(gitPath)) return currentPath;
192
+ const gitPath = node_path.default.join(currentPath, ".git");
193
+ if (fs_extra.pathExistsSync(gitPath)) return currentPath;
194
194
  if (currentPath === rootPath) return process.cwd();
195
- currentPath = path.dirname(currentPath);
195
+ currentPath = node_path.default.dirname(currentPath);
196
196
  }
197
197
  }
198
198
  /**
@@ -202,8 +202,8 @@ var TemplatesManager = class TemplatesManager {
202
202
  * @returns true if templates folder exists and is a directory
203
203
  */
204
204
  static async isInitialized(templatesPath) {
205
- if (!await fs$1.pathExists(templatesPath)) return false;
206
- return (await fs$1.stat(templatesPath)).isDirectory();
205
+ if (!await fs_extra.pathExists(templatesPath)) return false;
206
+ return (await fs_extra.stat(templatesPath)).isDirectory();
207
207
  }
208
208
  /**
209
209
  * Get the scaffold config file name
@@ -237,8 +237,8 @@ var ScaffoldService = class {
237
237
  async useBoilerplate(options) {
238
238
  try {
239
239
  const { projectName, packageName, targetFolder, templateFolder, boilerplateName, variables = {} } = options;
240
- const targetPath = path.isAbsolute(targetFolder) ? path.join(targetFolder, projectName) : path.join(process.cwd(), targetFolder, projectName);
241
- const templatePath = path.join(this.templatesRootPath, templateFolder);
240
+ const targetPath = node_path.default.isAbsolute(targetFolder) ? node_path.default.join(targetFolder, projectName) : node_path.default.join(process.cwd(), targetFolder, projectName);
241
+ const templatePath = node_path.default.join(this.templatesRootPath, templateFolder);
242
242
  const validationResult = await this.scaffoldConfigLoader.validateTemplate(templatePath, "boilerplate");
243
243
  if (!validationResult.isValid) return {
244
244
  success: false,
@@ -287,9 +287,9 @@ var ScaffoldService = class {
287
287
  async useFeature(options) {
288
288
  try {
289
289
  const { projectPath, templateFolder, featureName, variables = {} } = options;
290
- const targetPath = path.resolve(projectPath);
291
- const templatePath = path.join(this.templatesRootPath, templateFolder);
292
- const projectName = path.basename(targetPath);
290
+ const targetPath = node_path.default.resolve(projectPath);
291
+ const templatePath = node_path.default.join(this.templatesRootPath, templateFolder);
292
+ const projectName = node_path.default.basename(targetPath);
293
293
  const validationResult = await this.scaffoldConfigLoader.validateTemplate(templatePath, "features");
294
294
  if (!validationResult.isValid) return {
295
295
  success: false,
@@ -338,12 +338,12 @@ var ScaffoldService = class {
338
338
  */
339
339
  async processScaffold(params) {
340
340
  const { config, targetPath, templatePath, allVariables, scaffoldType } = params;
341
- console.log("Config generator:", config.generator);
342
- console.log("Config:", JSON.stringify(config, null, 2));
341
+ require_logger.log.debug("Config generator:", config.generator);
342
+ require_logger.log.debug("Config:", JSON.stringify(config, null, 2));
343
343
  if (config.generator) {
344
- console.log("Using custom generator:", config.generator);
344
+ require_logger.log.info("Using custom generator:", config.generator);
345
345
  try {
346
- const generator = (await import(path.join(templatePath, "generators", config.generator))).default;
346
+ const generator = (await import(node_path.default.join(templatePath, "generators", config.generator))).default;
347
347
  if (typeof generator !== "function") return {
348
348
  success: false,
349
349
  message: `Invalid generator: ${config.generator} does not export a default function`
@@ -358,12 +358,12 @@ var ScaffoldService = class {
358
358
  variableReplacer: this.variableReplacer,
359
359
  ScaffoldProcessingService: this.processingService.constructor,
360
360
  getRootPath: () => {
361
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
362
- return path.join(__dirname, "../../../../..");
361
+ const __dirname$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
362
+ return node_path.default.join(__dirname$1, "../../../../..");
363
363
  },
364
364
  getProjectPath: (projectPath) => {
365
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
366
- const rootPath = path.join(__dirname, "../../../../..");
365
+ const __dirname$1 = node_path.default.dirname((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href));
366
+ const rootPath = node_path.default.join(__dirname$1, "../../../../..");
367
367
  return projectPath.replace(rootPath, "").replace("/", "");
368
368
  }
369
369
  });
@@ -380,15 +380,15 @@ var ScaffoldService = class {
380
380
  const parsed = this.scaffoldConfigLoader.parseIncludeEntry(includeEntry, allVariables);
381
381
  if (!this.scaffoldConfigLoader.shouldIncludeFile(parsed.conditions, allVariables)) continue;
382
382
  parsedIncludes.push(parsed);
383
- const targetFilePath = path.join(targetPath, parsed.targetPath);
383
+ const targetFilePath = node_path.default.join(targetPath, parsed.targetPath);
384
384
  if (await this.fileSystem.pathExists(targetFilePath)) warnings.push(`File/folder ${parsed.targetPath} already exists and will be preserved`);
385
385
  }
386
386
  await this.fileSystem.ensureDir(targetPath);
387
387
  const createdFiles = [];
388
388
  const existingFiles = [];
389
389
  for (const parsed of parsedIncludes) {
390
- const sourcePath = path.join(templatePath, parsed.sourcePath);
391
- const targetFilePath = path.join(targetPath, parsed.targetPath);
390
+ const sourcePath = node_path.default.join(templatePath, parsed.sourcePath);
391
+ const targetFilePath = node_path.default.join(targetPath, parsed.targetPath);
392
392
  await this.processingService.copyAndProcess(sourcePath, targetFilePath, allVariables, createdFiles, existingFiles);
393
393
  }
394
394
  let message = `Successfully scaffolded ${scaffoldType} at ${targetPath}`;
@@ -405,4 +405,15 @@ var ScaffoldService = class {
405
405
  };
406
406
 
407
407
  //#endregion
408
- export { ScaffoldService, TemplatesManager };
408
+ Object.defineProperty(exports, 'ScaffoldService', {
409
+ enumerable: true,
410
+ get: function () {
411
+ return ScaffoldService;
412
+ }
413
+ });
414
+ Object.defineProperty(exports, 'TemplatesManager', {
415
+ enumerable: true,
416
+ get: function () {
417
+ return TemplatesManager;
418
+ }
419
+ });
@@ -1,14 +1,18 @@
1
- import { Liquid } from "liquidjs";
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const require_logger = require('./logger-Dno88AK9.js');
3
+ let liquidjs = require("liquidjs");
4
+ liquidjs = require_chunk.__toESM(liquidjs);
2
5
 
3
6
  //#region src/services/TemplateService.ts
4
7
  var TemplateService = class {
5
8
  liquid;
6
9
  constructor() {
7
- this.liquid = new Liquid({
10
+ this.liquid = new liquidjs.Liquid({
8
11
  strictFilters: false,
9
12
  strictVariables: false
10
13
  });
11
14
  this.setupCustomFilters();
15
+ require_logger.log.info("TemplateService initialized");
12
16
  }
13
17
  toPascalCase(str) {
14
18
  const camelCase = str.replace(/[-_\s]+(.)?/g, (_, char) => char ? char.toUpperCase() : "");
@@ -46,12 +50,25 @@ var TemplateService = class {
46
50
  else if (str.endsWith("s") && !str.endsWith("ss")) return str.slice(0, -1);
47
51
  else return str;
48
52
  });
53
+ this.liquid.registerFilter("strip", (str) => {
54
+ return str.trim();
55
+ });
49
56
  }
50
57
  renderString(template, variables) {
51
58
  try {
52
- return this.liquid.parseAndRenderSync(template, variables);
59
+ require_logger.log.debug("Rendering template", {
60
+ variables,
61
+ templatePreview: template.substring(0, 100)
62
+ });
63
+ const result = this.liquid.parseAndRenderSync(template, variables);
64
+ require_logger.log.debug("Rendered template", { resultPreview: result.substring(0, 100) });
65
+ return result;
53
66
  } catch (error) {
54
- console.warn(`LiquidJS rendering error: ${error}`);
67
+ require_logger.log.error("LiquidJS rendering error", {
68
+ error: error instanceof Error ? error.message : String(error),
69
+ templatePreview: template.substring(0, 200),
70
+ variables
71
+ });
55
72
  return template;
56
73
  }
57
74
  }
@@ -61,4 +78,9 @@ var TemplateService = class {
61
78
  };
62
79
 
63
80
  //#endregion
64
- export { TemplateService };
81
+ Object.defineProperty(exports, 'TemplateService', {
82
+ enumerable: true,
83
+ get: function () {
84
+ return TemplateService;
85
+ }
86
+ });
@@ -0,0 +1,4 @@
1
+ require('./logger-Dno88AK9.js');
2
+ const require_TemplateService = require('./TemplateService-Em2i9bb7.js');
3
+
4
+ exports.TemplateService = require_TemplateService.TemplateService;
@@ -1,4 +1,7 @@
1
- import path from "node:path";
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ const require_logger = require('./logger-Dno88AK9.js');
3
+ let node_path = require("node:path");
4
+ node_path = require_chunk.__toESM(node_path);
2
5
 
3
6
  //#region src/services/VariableReplacementService.ts
4
7
  var VariableReplacementService = class {
@@ -30,18 +33,18 @@ var VariableReplacementService = class {
30
33
  try {
31
34
  items = await this.fileSystem.readdir(dirPath);
32
35
  } catch (error) {
33
- console.warn(`Skipping directory ${dirPath}: ${error}`);
36
+ require_logger.log.warn(`Skipping directory ${dirPath}: ${error}`);
34
37
  return;
35
38
  }
36
39
  for (const item of items) {
37
40
  if (!item) continue;
38
- const itemPath = path.join(dirPath, item);
41
+ const itemPath = node_path.default.join(dirPath, item);
39
42
  try {
40
43
  const stat = await this.fileSystem.stat(itemPath);
41
44
  if (stat.isDirectory()) await this.processFilesForVariableReplacement(itemPath, variables);
42
45
  else if (stat.isFile()) await this.replaceVariablesInFile(itemPath, variables);
43
46
  } catch (error) {
44
- console.warn(`Skipping item ${itemPath}: ${error}`);
47
+ require_logger.log.warn(`Skipping item ${itemPath}: ${error}`);
45
48
  }
46
49
  }
47
50
  }
@@ -52,14 +55,19 @@ var VariableReplacementService = class {
52
55
  const renderedContent = this.templateService.renderString(content, variables);
53
56
  await this.fileSystem.writeFile(filePath, renderedContent, "utf8");
54
57
  } catch (error) {
55
- console.warn(`Skipping file ${filePath}: ${error}`);
58
+ require_logger.log.warn(`Skipping file ${filePath}: ${error}`);
56
59
  }
57
60
  }
58
61
  isBinaryFile(filePath) {
59
- const ext = path.extname(filePath).toLowerCase();
62
+ const ext = node_path.default.extname(filePath).toLowerCase();
60
63
  return this.binaryExtensions.includes(ext);
61
64
  }
62
65
  };
63
66
 
64
67
  //#endregion
65
- export { VariableReplacementService };
68
+ Object.defineProperty(exports, 'VariableReplacementService', {
69
+ enumerable: true,
70
+ get: function () {
71
+ return VariableReplacementService;
72
+ }
73
+ });
@@ -0,0 +1,4 @@
1
+ require('./logger-Dno88AK9.js');
2
+ const require_VariableReplacementService = require('./VariableReplacementService-BGmF2DVE.js');
3
+
4
+ exports.VariableReplacementService = require_VariableReplacementService.VariableReplacementService;
@@ -0,0 +1,30 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+
25
+ Object.defineProperty(exports, '__toESM', {
26
+ enumerable: true,
27
+ get: function () {
28
+ return __toESM;
29
+ }
30
+ });