@meltstudio/meltctl 2.3.0 → 2.4.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.
@@ -1,5 +1,5 @@
1
1
  interface CleanOptions {
2
- placeholder?: never;
2
+ yes?: boolean;
3
3
  }
4
- export declare function cleanCommand(_options?: CleanOptions): Promise<void>;
4
+ export declare function cleanCommand(options?: CleanOptions): Promise<void>;
5
5
  export {};
@@ -13,7 +13,7 @@ const MELT_COMMAND_FILES = [
13
13
  'melt-complete.md',
14
14
  'melt-debug.md',
15
15
  ];
16
- export async function cleanCommand(_options = {}) {
16
+ export async function cleanCommand(options = {}) {
17
17
  intro(chalk.blue('🧹 Melt Project - Clean'));
18
18
  const currentDir = process.cwd();
19
19
  const meltDir = path.join(currentDir, '.melt');
@@ -36,13 +36,17 @@ export async function cleanCommand(_options = {}) {
36
36
  }
37
37
  // Show what will be cleaned
38
38
  displayCleanupPlan(analysisResult);
39
- // Get confirmation
40
- const shouldProceed = await confirm({
41
- message: 'Do you want to proceed with cleaning? This action cannot be undone.',
42
- });
39
+ // Get confirmation (skip if --yes flag is provided)
40
+ let shouldProceed = options.yes || false;
43
41
  if (!shouldProceed) {
44
- outro(chalk.gray('Clean operation cancelled.'));
45
- return;
42
+ const confirmResult = await confirm({
43
+ message: 'Do you want to proceed with cleaning? This action cannot be undone.',
44
+ });
45
+ if (confirmResult !== true) {
46
+ outro(chalk.gray('Clean operation cancelled.'));
47
+ return;
48
+ }
49
+ shouldProceed = true;
46
50
  }
47
51
  // Perform the cleanup
48
52
  const s = spinner();
@@ -76,7 +76,8 @@ export async function initCommand(options = {}) {
76
76
  console.log(` • ${chalk.cyan('.melt/outputs/plans/')}`);
77
77
  console.log(` • ${chalk.cyan('.melt/outputs/implementations/')}`);
78
78
  console.log(` • ${chalk.cyan('.melt/outputs/reviews/')}`);
79
- console.log(` • ${chalk.cyan('.melt/scripts/' + selectedShell + '/')}`);
79
+ console.log(` • ${chalk.cyan('.melt/scripts/sh/')}`);
80
+ console.log(` • ${chalk.cyan('.melt/scripts/ps/')}`);
80
81
  console.log(` • ${chalk.cyan('.melt/templates/')}`);
81
82
  console.log();
82
83
  console.log('Next steps:');
@@ -100,7 +101,8 @@ function createDirectoryStructure(baseDir, shell) {
100
101
  '.melt/outputs/plans',
101
102
  '.melt/outputs/implementations',
102
103
  '.melt/outputs/reviews',
103
- `.melt/scripts/${shell}`,
104
+ '.melt/scripts/sh',
105
+ '.melt/scripts/ps',
104
106
  '.melt/templates',
105
107
  ];
106
108
  dirs.forEach(dir => {
@@ -129,11 +131,15 @@ async function copyTemplates(baseDir, shell) {
129
131
  contextContent = contextContent.replace(/{{timestamp}}/g, timestamp);
130
132
  fs.writeFileSync(contextDestPath, contextContent, 'utf8');
131
133
  }
132
- // Copy shell scripts from CLI package
133
- const scriptsSourceDir = join(__dirname, '../../../scripts', shell);
134
- const scriptsDestDir = join(baseDir, '.melt', 'scripts', shell);
135
- if (existsSync(scriptsSourceDir)) {
136
- fs.copySync(scriptsSourceDir, scriptsDestDir);
134
+ // Copy shell scripts from CLI package (copy both sh and ps scripts)
135
+ const scriptsBaseDir = join(__dirname, '../../../scripts');
136
+ const shellTypes = ['sh', 'ps'];
137
+ for (const shellType of shellTypes) {
138
+ const scriptsSourceDir = join(scriptsBaseDir, shellType);
139
+ const scriptsDestDir = join(baseDir, '.melt', 'scripts', shellType);
140
+ if (existsSync(scriptsSourceDir)) {
141
+ fs.copySync(scriptsSourceDir, scriptsDestDir);
142
+ }
137
143
  }
138
144
  }
139
145
  function createVersionFile(meltDir) {
package/dist/index.js CHANGED
@@ -43,8 +43,9 @@ projectCommand
43
43
  projectCommand
44
44
  .command('clean')
45
45
  .description('Remove all Melt-generated files from the project')
46
- .action(() => {
47
- return cleanCommand();
46
+ .option('-y, --yes', 'skip confirmation prompt')
47
+ .action(options => {
48
+ return cleanCommand({ yes: options.yes });
48
49
  });
49
50
  // Version check command
50
51
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meltstudio/meltctl",
3
- "version": "2.3.0",
3
+ "version": "2.4.1",
4
4
  "description": "CLI tool for Melt development process automation - initialize and update project configurations",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",