hsh19900502 1.0.13 → 1.0.14

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,6 @@
1
1
  {
2
2
  "cSpell.words": [
3
- "branchout"
3
+ "branchout",
4
+ "glab"
4
5
  ]
5
6
  }
@@ -1,5 +1,6 @@
1
1
  import 'zx/globals';
2
2
  export declare const gcm: (message: string, isPush?: boolean) => Promise<void>;
3
3
  export declare const merge: (branch: string) => Promise<void>;
4
+ export declare const createMR: () => Promise<void>;
4
5
  export declare const branchout: (branch: string) => Promise<void>;
5
6
  export declare const push: () => Promise<void>;
@@ -21,6 +21,10 @@ export const merge = async (branch) => {
21
21
  await $ `git merge ${branch}`;
22
22
  console.log(chalk.green('Merged branch into current branch successfully!\n'));
23
23
  };
24
+ export const createMR = async () => {
25
+ await $ `glab mr create --remove-source-branch --squash-before-merge`;
26
+ console.log(chalk.green('MR created successfully!\n'));
27
+ };
24
28
  export const branchout = async (branch) => {
25
29
  await $ `git checkout master`;
26
30
  await $ `git pull origin master`;
package/dist/hsh.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { branchout, gcm, merge, push } from './commands/git.js';
2
+ import { branchout, createMR, gcm, merge, push } from './commands/git.js';
3
3
  import { Command } from 'commander';
4
4
  import { initMonoRepo, monoCd } from './commands/mono.js';
5
5
  import { getPackageJson } from './util.js';
@@ -29,6 +29,15 @@ program.command('merge')
29
29
  .action((branch) => {
30
30
  merge(branch);
31
31
  });
32
+ program.command('mr')
33
+ .description('create a merge request')
34
+ .argument('<action>')
35
+ .action((action) => {
36
+ if (action === 'create') {
37
+ // handle create case for now
38
+ createMR();
39
+ }
40
+ });
32
41
  program.command('branchout')
33
42
  .description('create a new branch')
34
43
  .argument('<branch>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hsh19900502",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "index.js",
@@ -25,6 +25,11 @@ export const merge = async (branch: string) => {
25
25
  console.log(chalk.green('Merged branch into current branch successfully!\n'));
26
26
  }
27
27
 
28
+ export const createMR = async () => {
29
+ await $`glab mr create --remove-source-branch --squash-before-merge`;
30
+ console.log(chalk.green('MR created successfully!\n'));
31
+ }
32
+
28
33
  export const branchout = async (branch: string) => {
29
34
  await $`git checkout master`;
30
35
  await $`git pull origin master`;
package/src/hsh.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { branchout, gcm, merge, push } from './commands/git.js';
2
+ import { branchout, createMR, gcm, merge, push } from './commands/git.js';
3
3
  import { Command } from 'commander';
4
4
  import { initMonoRepo, monoCd } from './commands/mono.js';
5
5
  import { RepoDirLevel } from './types/index.js';
@@ -37,6 +37,16 @@ program.command('merge')
37
37
  merge(branch);
38
38
  })
39
39
 
40
+ program.command('mr')
41
+ .description('create a merge request')
42
+ .argument('<action>')
43
+ .action((action: string) => {
44
+ if(action === 'create') {
45
+ // handle create case for now
46
+ createMR();
47
+ }
48
+ })
49
+
40
50
  program.command('branchout')
41
51
  .description('create a new branch')
42
52
  .argument('<branch>')