@mono-labs/cli 0.0.125 → 0.0.127

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.
@@ -14,7 +14,7 @@ import path from 'node:path';
14
14
  */
15
15
  export async function runHasteCommand(configObject, options = {}) {
16
16
  const { config } = getHasteConfig();
17
-
17
+ console.log('runHasteCommand options:', options);
18
18
  const devConfig = configObject.environments?.dev ?? {};
19
19
 
20
20
  // Usage:
@@ -53,18 +53,16 @@ export async function runHasteCommand(configObject, options = {}) {
53
53
  const preactions = configObject.preactions ?? [];
54
54
  const actions = configObject.actions ?? [];
55
55
 
56
-
57
-
58
-
56
+ console.log(
59
57
  `→ Executing haste command: ${configObject.name || 'Unnamed Command'}`
60
58
  );
61
-
62
-
63
-
59
+ console.log(`→ Using AWS profile: ${awsProfile}`);
60
+ console.log(`→ Using environment: ${options.stage ? 'stage' : 'dev'}`);
61
+ console.log('→ Environment variables:', envObj);
64
62
 
65
63
  // Run preactions sequentially
66
64
  for (const cmd of preactions) {
67
-
65
+ console.log(`→ pre-action: ${cmd}`);
68
66
  await runForeground(cmd, envObj, options);
69
67
  }
70
68
 
@@ -74,11 +72,11 @@ export async function runHasteCommand(configObject, options = {}) {
74
72
  const fg = actions[actions.length - 1];
75
73
 
76
74
  for (const cmd of bg) {
77
-
75
+ console.log(`→ background action: ${cmd}`);
78
76
  runBackground(cmd, envObj, options);
79
77
  }
80
78
 
81
-
79
+ console.log(`→ foreground action (attached): ${fg}`);
82
80
  try {
83
81
  await runBackground(fg, envObj, options, true);
84
82
  } finally {
@@ -1,48 +1,50 @@
1
- import { execSync } from 'child_process'
1
+ import { execSync } from 'child_process';
2
2
 
3
- const log = (...args) =>
4
- const err = (...args) => console.error(...args)
3
+ const log = (...args) => console.log(...args);
4
+ const err = (...args) => console.error(...args);
5
5
  export function pruneRepo() {
6
6
  try {
7
7
  // Fetch and prune remote branches
8
- log('Fetching latest branch data from origin...')
9
- execSync('git fetch --prune', { stdio: 'inherit' })
8
+ log('Fetching latest branch data from origin...');
9
+ execSync('git fetch --prune', { stdio: 'inherit' });
10
10
 
11
11
  // Get local branches (trim whitespace)
12
12
  const localBranches = execSync("git branch --format '%(refname:short)'")
13
13
  .toString()
14
14
  .trim()
15
15
  .split('\n')
16
- .map((branch) => branch.trim().replaceAll("'", ''))
16
+ .map((branch) => branch.trim().replaceAll("'", ''));
17
17
 
18
18
  // Get remote branches (remove "origin/" prefix)
19
19
  const remoteBranches = execSync('git branch -r')
20
20
  .toString()
21
21
  .trim()
22
22
  .split('\n')
23
- .map((branch) => branch.replace(/^\s*origin\//, '').trim())
23
+ .map((branch) => branch.replace(/^\s*origin\//, '').trim());
24
24
 
25
25
  // Find local branches that are NOT in remote branches
26
- const branchesToDelete = localBranches.filter((branch) => !remoteBranches.includes(branch))
26
+ const branchesToDelete = localBranches.filter(
27
+ (branch) => !remoteBranches.includes(branch)
28
+ );
27
29
  if (branchesToDelete.length === 0) {
28
- log('No local branches to delete.')
29
- process.exit(0)
30
+ log('No local branches to delete.');
31
+ process.exit(0);
30
32
  }
31
33
 
32
34
  // Delete untracked local branches
33
- log('Deleting local branches that are not on origin...')
35
+ log('Deleting local branches that are not on origin...');
34
36
  branchesToDelete.forEach((branch) => {
35
- log(`Attempting to delete: ${branch}`)
37
+ log(`Attempting to delete: ${branch}`);
36
38
  try {
37
- execSync(`git branch -D ${branch}`, { stdio: 'inherit' })
38
- log(`Deleted: ${branch}`)
39
+ execSync(`git branch -D ${branch}`, { stdio: 'inherit' });
40
+ log(`Deleted: ${branch}`);
39
41
  } catch (error) {
40
- error(`Failed to delete branch ${branch}:`, error.message)
42
+ error(`Failed to delete branch ${branch}:`, error.message);
41
43
  }
42
- })
44
+ });
43
45
 
44
- log('Cleanup complete!')
46
+ log('Cleanup complete!');
45
47
  } catch (error) {
46
- err('An error occurred:', error.message)
48
+ err('An error occurred:', error.message);
47
49
  }
48
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.125",
3
+ "version": "0.0.127",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",