git-stack-cli 2.3.0 → 2.3.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.
package/dist/js/index.js CHANGED
@@ -39193,15 +39193,15 @@ function encode(value) {
39193
39193
  }
39194
39194
 
39195
39195
  // src/commands/Rebase.tsx
39196
- function Rebase() {
39196
+ function Rebase(props) {
39197
39197
  return /* @__PURE__ */ React34.createElement(Await, {
39198
39198
  fallback: /* @__PURE__ */ React34.createElement(Text, {
39199
39199
  color: colors.yellow
39200
39200
  }, "Rebasing commits…"),
39201
- function: Rebase.run
39201
+ function: () => Rebase.run(props)
39202
39202
  });
39203
39203
  }
39204
- Rebase.run = async function run5() {
39204
+ Rebase.run = async function run5(props) {
39205
39205
  const state = Store.getState();
39206
39206
  const actions = state.actions;
39207
39207
  const branch_name = state.branch_name;
@@ -39293,8 +39293,12 @@ Rebase.run = async function run5() {
39293
39293
  actions.set((state2) => {
39294
39294
  state2.commit_range = next_commit_range;
39295
39295
  });
39296
- actions.output(/* @__PURE__ */ React34.createElement(Status, null));
39297
- actions.exit(0);
39296
+ if (props.onComplete) {
39297
+ props.onComplete();
39298
+ } else {
39299
+ actions.output(/* @__PURE__ */ React34.createElement(Status, null));
39300
+ actions.exit(0);
39301
+ }
39298
39302
  function restore_git() {
39299
39303
  const spawn_options = { ignoreExitCode: true };
39300
39304
  cli.sync(`git reset --hard`, spawn_options);
@@ -39319,7 +39323,14 @@ Rebase.run = async function run5() {
39319
39323
 
39320
39324
  // src/app/LocalMergeRebase.tsx
39321
39325
  function LocalMergeRebase() {
39322
- return /* @__PURE__ */ React35.createElement(Rebase, null);
39326
+ const actions = Store.useActions();
39327
+ return /* @__PURE__ */ React35.createElement(Rebase, {
39328
+ onComplete: () => {
39329
+ actions.set((state) => {
39330
+ state.step = "status";
39331
+ });
39332
+ }
39333
+ });
39323
39334
  }
39324
39335
 
39325
39336
  // src/app/ManualRebase.tsx
@@ -45653,7 +45664,7 @@ var yargs_default = Yargs;
45653
45664
 
45654
45665
  // src/command.ts
45655
45666
  async function command2() {
45656
- return yargs_default(hideBin(process.argv)).scriptName("git stack").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.3.0").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45667
+ return yargs_default(hideBin(process.argv)).scriptName("git stack").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.3.1").showHidden("show-hidden", "Show hidden options via `git stack help --show-hidden`").help("help", "Show usage via `git stack help`").argv;
45657
45668
  }
45658
45669
  var GlobalOptions = {
45659
45670
  verbose: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-stack-cli",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "",
5
5
  "author": "magus",
6
6
  "license": "MIT",
@@ -1,7 +1,18 @@
1
1
  import * as React from "react";
2
2
 
3
+ import { Store } from "~/app/Store";
3
4
  import { Rebase } from "~/commands/Rebase";
4
5
 
5
6
  export function LocalMergeRebase() {
6
- return <Rebase />;
7
+ const actions = Store.useActions();
8
+
9
+ return (
10
+ <Rebase
11
+ onComplete={() => {
12
+ actions.set((state) => {
13
+ state.step = "status";
14
+ });
15
+ }}
16
+ />
17
+ );
7
18
  }
@@ -15,16 +15,20 @@ import { colors } from "~/core/colors";
15
15
  import { invariant } from "~/core/invariant";
16
16
  import { short_id } from "~/core/short_id";
17
17
 
18
- export function Rebase() {
18
+ type Props = {
19
+ onComplete?: () => void;
20
+ };
21
+
22
+ export function Rebase(props: Props) {
19
23
  return (
20
24
  <Await
21
25
  fallback={<Ink.Text color={colors.yellow}>Rebasing commits…</Ink.Text>}
22
- function={Rebase.run}
26
+ function={() => Rebase.run(props)}
23
27
  />
24
28
  );
25
29
  }
26
30
 
27
- Rebase.run = async function run() {
31
+ Rebase.run = async function run(props: Props) {
28
32
  const state = Store.getState();
29
33
  const actions = state.actions;
30
34
  const branch_name = state.branch_name;
@@ -145,9 +149,12 @@ Rebase.run = async function run() {
145
149
  state.commit_range = next_commit_range;
146
150
  });
147
151
 
148
- actions.output(<Status />);
149
-
150
- actions.exit(0);
152
+ if (props.onComplete) {
153
+ props.onComplete();
154
+ } else {
155
+ actions.output(<Status />);
156
+ actions.exit(0);
157
+ }
151
158
 
152
159
  // cleanup git operations if cancelled during manual rebase
153
160
  function restore_git() {