git-stack-cli 2.0.1-beta → 2.1.0-beta

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.
package/dist/js/index.js CHANGED
@@ -37796,7 +37796,7 @@ function Url(props) {
37796
37796
  import fs7 from "node:fs";
37797
37797
  import path4 from "node:path";
37798
37798
  function is_command_available(command) {
37799
- const PATH = "/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/.bun/bin:/Users/noah/Library/Caches/fnm_multishells/10609_1737115106756/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/Users/noah/.dotfiles/bin:/usr/local/sbin:/usr/local/bin:/Users/noah/.rvm/gems/ruby-2.6.3/bin:/Users/noah/.rvm/gems/ruby-2.6.3@global/bin:/Users/noah/.rvm/rubies/ruby-2.6.3/bin:/Users/noah/Library/pnpm:/Users/noah/.bun/bin:/Users/noah/Library/Caches/fnm_multishells/7244_1737114463742/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/Users/noah/.dotfiles/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/noah/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin:/usr/local/opt/fzf/bin:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin:/Users/noah/.rvm/bin:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin";
37799
+ const PATH = "/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/github/git-stack-cli/node_modules/.bin:/Users/noah/.cache/node/corepack/v1/pnpm/9.15.4/dist/node-gyp-bin:/Users/noah/.rvm/gems/ruby-2.6.3/bin:/Users/noah/.rvm/gems/ruby-2.6.3@global/bin:/Users/noah/.rvm/rubies/ruby-2.6.3/bin:/Users/noah/Library/pnpm:/Users/noah/.bun/bin:/Users/noah/Library/Caches/fnm_multishells/45565_1737429645385/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/usr/local/sbin:/Users/noah/.dotfiles/bin:/usr/local/sbin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/Users/noah/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin:/usr/local/opt/fzf/bin:/Users/noah/google-cloud-sdk/bin:/Users/noah/.yarn/bin:/Users/noah/.fastlane/bin:/Users/noah/.rvm/bin";
37800
37800
  invariant(PATH, "PATH env must exist");
37801
37801
  const path_list = PATH.split(path4.delimiter);
37802
37802
  for (const dir of path_list) {
@@ -38054,7 +38054,7 @@ async function pr_status(branch) {
38054
38054
  const cache4 = state.pr[branch];
38055
38055
  if (cache4) {
38056
38056
  if (actions.isDebug()) {
38057
- actions.output(/* @__PURE__ */ React24.createElement(Text, null, /* @__PURE__ */ React24.createElement(Text, {
38057
+ actions.debug(/* @__PURE__ */ React24.createElement(Text, null, /* @__PURE__ */ React24.createElement(Text, {
38058
38058
  dimColor: true
38059
38059
  }, "Github pr_status cache"), /* @__PURE__ */ React24.createElement(Text, null, " "), /* @__PURE__ */ React24.createElement(Text, {
38060
38060
  bold: true,
@@ -38066,7 +38066,7 @@ async function pr_status(branch) {
38066
38066
  return cache4;
38067
38067
  }
38068
38068
  if (actions.isDebug()) {
38069
- actions.output(/* @__PURE__ */ React24.createElement(Text, null, /* @__PURE__ */ React24.createElement(Text, {
38069
+ actions.debug(/* @__PURE__ */ React24.createElement(Text, null, /* @__PURE__ */ React24.createElement(Text, {
38070
38070
  dimColor: true
38071
38071
  }, "Github pr_status cache"), /* @__PURE__ */ React24.createElement(Text, null, " "), /* @__PURE__ */ React24.createElement(Text, {
38072
38072
  bold: true,
@@ -38226,13 +38226,25 @@ async function range(commit_group_map) {
38226
38226
  const group_value_list = Array.from(group_map.values());
38227
38227
  const group_list = [];
38228
38228
  let unassigned_group;
38229
+ const pr_status_promise_list = {};
38230
+ for (const group of group_value_list) {
38231
+ if (group.id !== UNASSIGNED) {
38232
+ pr_status_promise_list[group.id] = pr_status(group.id);
38233
+ }
38234
+ }
38235
+ await Promise.all(Array.from(Object.values(pr_status_promise_list)));
38236
+ for (const [group_id, pr_status_promise] of Object.entries(pr_status_promise_list)) {
38237
+ const pr_status2 = await pr_status_promise;
38238
+ if (pr_status2) {
38239
+ pr_lookup[group_id] = pr_status2;
38240
+ }
38241
+ }
38229
38242
  for (let i2 = 0;i2 < group_value_list.length; i2++) {
38230
38243
  const group = group_value_list[i2];
38231
38244
  if (group.id !== UNASSIGNED) {
38232
- const pr_result = await pr_status(group.id);
38245
+ let pr_result = pr_lookup[group.id];
38233
38246
  if (pr_result && pr_result.state !== "CLOSED") {
38234
38247
  group.pr = pr_result;
38235
- pr_lookup[group.id] = pr_result;
38236
38248
  }
38237
38249
  }
38238
38250
  if (group.id === UNASSIGNED) {
@@ -45594,7 +45606,7 @@ var yargs_default = Yargs;
45594
45606
 
45595
45607
  // src/command.ts
45596
45608
  async function command2() {
45597
- return yargs_default(hideBin(process.argv)).usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.0.1-beta").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45609
+ return yargs_default(hideBin(process.argv)).usage("Usage: git stack [command] [options]").command("$0", "Sync commit ranges to Github", (yargs) => yargs.options(DefaultOptions)).command("fixup [commit]", "Amend staged changes to a specific commit in history", (yargs) => yargs.positional("commit", FixupOptions.commit)).command("log [args...]", "Print an abbreviated log with numbered commits, useful for git stack fixup", (yargs) => yargs.strict(false)).command("rebase", "Update local branch via rebase with latest changes from origin master branch", (yargs) => yargs).option("verbose", GlobalOptions.verbose).wrap(123).strict().version("2.1.0-beta").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45598
45610
  }
45599
45611
  var GlobalOptions = {
45600
45612
  verbose: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "2.0.1-beta",
3
+ "version": "2.1.0-beta",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -25,7 +25,9 @@ const previous_formula_path = path.join(HOMEBREW_DIR, "Formula", "git-stack.rb")
25
25
  // version = "1.0.4"
26
26
  //
27
27
  let previous_formula = await file.read_text(previous_formula_path);
28
- const re_version = /version(?: =)? "(?<version>\d+\.\d+\.\d+)"/m;
28
+
29
+ // https://regex101.com/r/BnvdqK/1
30
+ const re_version = /version(?: =)? "(?<version>\d+\.\d+\.\d+(?:-.+)?)"/m;
29
31
  const previous_version_match = previous_formula.match(re_version);
30
32
 
31
33
  if (!previous_version_match?.groups) {
@@ -6,7 +6,8 @@ import * as github from "~/core/github";
6
6
  export type CommitMetadata = Awaited<ReturnType<typeof commit>>;
7
7
  export type CommitRange = Awaited<ReturnType<typeof range>>;
8
8
 
9
- type PullRequest = NonNullable<Awaited<ReturnType<typeof github.pr_status>>>;
9
+ type GithubPRStatus = ReturnType<typeof github.pr_status>;
10
+ type PullRequest = NonNullable<Awaited<GithubPRStatus>>;
10
11
 
11
12
  type CommitGroup = {
12
13
  id: string;
@@ -93,15 +94,31 @@ export async function range(commit_group_map?: CommitGroupMap) {
93
94
  const group_list = [];
94
95
  let unassigned_group;
95
96
 
97
+ // collect github pr status in parallel
98
+ const pr_status_promise_list: Record<string, GithubPRStatus> = {};
99
+ for (const group of group_value_list) {
100
+ if (group.id !== UNASSIGNED) {
101
+ pr_status_promise_list[group.id] = github.pr_status(group.id);
102
+ }
103
+ }
104
+
105
+ await Promise.all(Array.from(Object.values(pr_status_promise_list)));
106
+
107
+ for (const [group_id, pr_status_promise] of Object.entries(pr_status_promise_list)) {
108
+ const pr_status = await pr_status_promise;
109
+ if (pr_status) {
110
+ pr_lookup[group_id] = pr_status;
111
+ }
112
+ }
113
+
96
114
  for (let i = 0; i < group_value_list.length; i++) {
97
115
  const group = group_value_list[i];
98
116
 
99
117
  if (group.id !== UNASSIGNED) {
100
- const pr_result = await github.pr_status(group.id);
118
+ let pr_result = pr_lookup[group.id];
101
119
 
102
120
  if (pr_result && pr_result.state !== "CLOSED") {
103
121
  group.pr = pr_result;
104
- pr_lookup[group.id] = pr_result;
105
122
  }
106
123
  }
107
124
 
@@ -68,7 +68,7 @@ export async function pr_status(branch: string): Promise<null | PullRequest> {
68
68
 
69
69
  if (cache) {
70
70
  if (actions.isDebug()) {
71
- actions.output(
71
+ actions.debug(
72
72
  <Ink.Text>
73
73
  <Ink.Text dimColor>Github pr_status cache</Ink.Text>
74
74
  <Ink.Text> </Ink.Text>
@@ -85,7 +85,7 @@ export async function pr_status(branch: string): Promise<null | PullRequest> {
85
85
  }
86
86
 
87
87
  if (actions.isDebug()) {
88
- actions.output(
88
+ actions.debug(
89
89
  <Ink.Text>
90
90
  <Ink.Text dimColor>Github pr_status cache</Ink.Text>
91
91
  <Ink.Text> </Ink.Text>