git-stack-cli 2.8.2 → 2.9.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/src/app/Debug.tsx DELETED
@@ -1,51 +0,0 @@
1
- import * as React from "react";
2
-
3
- import fs from "node:fs/promises";
4
- import path from "node:path";
5
-
6
- import * as Ink from "ink-cjs";
7
-
8
- import { Store } from "~/app/Store";
9
- import { colors } from "~/core/colors";
10
- import * as json from "~/core/json";
11
- import { pretty_json } from "~/core/pretty_json";
12
- import { safe_rm } from "~/core/safe_rm";
13
-
14
- export function Debug() {
15
- const actions = Store.useActions();
16
- const state = Store.useState((state) => state);
17
- const argv = Store.useState((state) => state.argv);
18
- const debug = Store.useState((state) => state.select.debug(state));
19
-
20
- React.useEffect(
21
- function debugMessageOnce() {
22
- if (debug) {
23
- actions.output(<Ink.Text color={colors.yellow}>Debug mode enabled</Ink.Text>);
24
- }
25
- },
26
- [argv],
27
- );
28
-
29
- React.useEffect(
30
- function sync_state_json() {
31
- if (!argv?.["write-state-json"]) {
32
- return;
33
- }
34
-
35
- sync().catch(actions.error);
36
-
37
- async function sync() {
38
- const output_file = path.join(state.cwd, "git-stack-state.json");
39
-
40
- await safe_rm(output_file);
41
-
42
- const serialized = json.serialize(state);
43
- const content = pretty_json(serialized);
44
- await fs.writeFile(output_file, content);
45
- }
46
- },
47
- [argv, state],
48
- );
49
-
50
- return null;
51
- }