@mono-labs/cli 0.0.94 → 0.0.95

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.
@@ -4,11 +4,12 @@ import runHasteCommand from './runHasteCommand.js';
4
4
  import { verifyOptionValue } from './validators.js';
5
5
  import { mergeData, setData } from './dataLayer.js';
6
6
  import { getHasteConfig } from '../loadFromRoot.js';
7
+ import { pruneRepo } from '../prune/prune.js';
7
8
  /**
8
9
  * Register commander commands for each haste file definition.
9
10
  * Handles argument, options, validation, and action wiring.
10
11
  */
11
- export function createCliCommands() {
12
+ export function createConfigCommands() {
12
13
  const config = new Command('config').description('Manage configuration');
13
14
 
14
15
  config
@@ -35,6 +36,19 @@ export function createCliCommands() {
35
36
  return config;
36
37
  }
37
38
 
39
+ export function createCliCommands() {
40
+ const tools = new Command('tools').description('Manage tools');
41
+
42
+ tools
43
+ .command('prune')
44
+ .description('Prune unused branches in git')
45
+ .action(() => {
46
+ console.log('Pruning unused branches...');
47
+ });
48
+
49
+ return tools;
50
+ }
51
+
38
52
  export function buildCommands(files) {
39
53
  const { config } = getHasteConfig();
40
54
  Object.entries(files).forEach(([commandName, configObject]) => {
@@ -1,37 +1,39 @@
1
- import assert from 'assert'
2
- import { spawn } from 'child_process'
3
- import { readFileSync } from 'fs'
1
+ import assert from 'assert';
2
+ import { spawn } from 'child_process';
3
+ import { readFileSync } from 'fs';
4
4
 
5
- import { program } from '../../app.js'
5
+ import { program } from '../../app.js';
6
6
 
7
7
  import { join } from 'node:path';
8
- const packageJSON = JSON.parse(readFileSync(join(process.cwd(), 'package.json'), 'utf8'));
8
+ const packageJSON = JSON.parse(
9
+ readFileSync(join(process.cwd(), 'package.json'), 'utf8')
10
+ );
9
11
 
10
- console.log('Deploy command loaded')
12
+ console.log('Deploy command loaded');
11
13
 
12
- const awsObject = packageJSON['aws'] || {}
14
+ const awsObject = packageJSON['aws'] || {};
13
15
 
14
- const accountId = process.env.CDK_DEPLOY_ACCOUNT
15
- const awsProfile = process.env.CDK_DEPLOY_PROFILE || 'default'
16
+ const accountId = process.env.CDK_DEPLOY_ACCOUNT;
17
+ const awsProfile = process.env.CDK_DEPLOY_PROFILE || 'default';
16
18
 
17
19
  program
18
- .command('init')
19
- .description('Execute cdk deploy command')
20
- .action((str, options) => {
21
- const owner = str || 'dev'
22
- const region = options.region || 'us-east-2'
23
- console.log(`Deploying to ${owner} environment`)
24
- const command = `workspace infra cdk bootstrap`
25
- const child = spawn('yarn', [`${command}`], {
26
- stdio: 'inherit',
27
- shell: true, // required if using shell-style commands or cross-platform support
28
- env: {
29
- AWS_PROFILE: awsProfile,
30
- },
31
- })
20
+ .command('init2')
21
+ .description('Execute cdk deploy command')
22
+ .action((str, options) => {
23
+ const owner = str || 'dev';
24
+ const region = options.region || 'us-east-2';
25
+ console.log(`Deploying to ${owner} environment`);
26
+ const command = `workspace infra cdk bootstrap`;
27
+ const child = spawn('yarn', [`${command}`], {
28
+ stdio: 'inherit',
29
+ shell: true, // required if using shell-style commands or cross-platform support
30
+ env: {
31
+ AWS_PROFILE: awsProfile,
32
+ },
33
+ });
32
34
 
33
- child.on('exit', (code) => {
34
- console.log(`Process exited with code ${code}`)
35
- process.exit(code ?? 0)
36
- })
37
- })
35
+ child.on('exit', (code) => {
36
+ console.log(`Process exited with code ${code}`);
37
+ process.exit(code ?? 0);
38
+ });
39
+ });
@@ -1,12 +1,12 @@
1
- import { spawn } from 'child_process'
1
+ import { spawn } from 'child_process';
2
2
 
3
- import { program } from '../../app.js'
4
- import { pruneRepo } from './prune.js'
3
+ import { program } from '../../app.js';
4
+ import { pruneRepo } from './prune.js';
5
5
 
6
6
  program
7
- .command('prune')
7
+ .command('prune2')
8
8
  .description('Prune local branches that are not on origin')
9
9
 
10
10
  .action(() => {
11
- pruneRepo()
12
- })
11
+ pruneRepo();
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mono-labs/cli",
3
- "version": "0.0.94",
3
+ "version": "0.0.95",
4
4
  "description": "A CLI tool for building and deploying projects",
5
5
  "type": "module",
6
6
  "main": "index.js",