cherrypick-interactive 1.14.1 → 1.14.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cherrypick-interactive",
3
- "version": "1.14.1",
3
+ "version": "1.14.3",
4
4
  "description": "Interactively cherry-pick commits that are in dev but not in main, using subject-based comparison.",
5
5
  "main": "cli.js",
6
6
  "bin": "cli.js",
@@ -1,4 +1,4 @@
1
- import { Box } from 'ink';
1
+ import { Box, Text } from 'ink';
2
2
  import { html } from './html.js';
3
3
  import { CommitRow } from './CommitRow.js';
4
4
 
@@ -22,7 +22,7 @@ export function CommitList({ commits, selected, cursorIndex }) {
22
22
  `,
23
23
  )}
24
24
  ${commits.length > maxVisible
25
- ? html`<${Box}><${'Text'} color="dim"> ... ${commits.length - maxVisible} more (scroll with ↑↓)</${'Text'}></${Box}>`
25
+ ? html`<${Box}><${Text} color="dim"> ... ${commits.length - maxVisible} more (scroll with ↑↓)</${Text}></${Box}>`
26
26
  : null}
27
27
  </${Box}>
28
28
  `;
package/src/tui/index.js CHANGED
@@ -11,6 +11,14 @@ import { App } from './App.js';
11
11
  */
12
12
  export function renderCommitSelector(commits, gitRawFn, { devBranch, mainBranch, since }) {
13
13
  return new Promise((resolve) => {
14
+ let resolved = false;
15
+ const settle = (val) => {
16
+ if (!resolved) {
17
+ resolved = true;
18
+ resolve(val);
19
+ }
20
+ };
21
+
14
22
  const { unmount, waitUntilExit } = render(
15
23
  createElement(App, {
16
24
  commits,
@@ -19,16 +27,25 @@ export function renderCommitSelector(commits, gitRawFn, { devBranch, mainBranch,
19
27
  mainBranch,
20
28
  since,
21
29
  onDone: (selectedHashes) => {
22
- resolve(selectedHashes);
30
+ settle(selectedHashes);
23
31
  },
24
32
  }),
25
33
  );
26
34
 
27
35
  waitUntilExit().then(() => {
36
+ // Restore stdin so subsequent prompts (inquirer) work correctly.
37
+ // Ink pauses stdin on unmount which causes inquirer to immediately
38
+ // throw ExitPromptError ("Aborted by user").
39
+ if (process.stdin.isPaused()) {
40
+ process.stdin.resume();
41
+ }
28
42
  // Fallback: if exited without calling onDone, resolve with empty
29
- resolve([]);
43
+ settle([]);
30
44
  }).catch(() => {
31
- resolve([]);
45
+ if (process.stdin.isPaused()) {
46
+ process.stdin.resume();
47
+ }
48
+ settle([]);
32
49
  });
33
50
  });
34
51
  }