gitforest 1.1.0 → 1.1.2

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": "gitforest",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "TUI for managing multiple Git repositories and GitHub integration",
5
5
  "module": "src/index.tsx",
6
6
  "type": "module",
@@ -6,7 +6,7 @@ import { DirectoriesStep } from "./DirectoriesStep.tsx";
6
6
  import { GitHubAuthStep } from "./GitHubAuthStep.tsx";
7
7
  import { CompleteStep } from "./CompleteStep.tsx";
8
8
 
9
- type Step = "welcome" | "directories" | "github" | "complete";
9
+ type Step = "welcome" | "directories" | "github" | "complete" | "done";
10
10
 
11
11
  interface DirectoryConfig {
12
12
  path: string;
@@ -23,9 +23,10 @@ interface GitHubAuthState {
23
23
  export interface OnboardingWizardProps {
24
24
  onComplete: (config: GitforestConfig) => void;
25
25
  onCancel: () => void;
26
+ onUnmount?: () => void;
26
27
  }
27
28
 
28
- export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps) {
29
+ export function OnboardingWizard({ onComplete, onCancel, onUnmount }: OnboardingWizardProps) {
29
30
  const [currentStep, setCurrentStep] = useState<Step>("welcome");
30
31
  const [directories, setDirectories] = useState<DirectoryConfig[]>([]);
31
32
  const [githubAuth, setGithubAuth] = useState<GitHubAuthState>({
@@ -66,9 +67,12 @@ export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps
66
67
  // Config created successfully, show complete step
67
68
  setCurrentStep("complete");
68
69
  setIsCreatingConfig(false);
69
- // Auto-complete after showing success
70
+ // Auto-complete after showing success, then exit
70
71
  setTimeout(() => {
72
+ // Call onComplete first to ensure config is passed to parent
71
73
  onComplete(config);
74
+ // Then unmount the component
75
+ onUnmount?.();
72
76
  }, 2000);
73
77
  } catch (error) {
74
78
  setConfigError(error instanceof Error ? error.message : "Failed to create config");
package/src/index.tsx CHANGED
@@ -254,13 +254,15 @@ async function runOnboardingWizard(): Promise<void> {
254
254
  };
255
255
 
256
256
  // Render onboarding wizard
257
- const { waitUntilExit } = render(
257
+ const { waitUntilExit, unmount } = render(
258
258
  <OnboardingWizard
259
259
  onComplete={handleComplete}
260
260
  onCancel={handleCancel}
261
+ onUnmount={unmount}
261
262
  />
262
263
  );
263
264
 
265
+ // Wait for completion or cancellation
264
266
  await waitUntilExit();
265
267
 
266
268
  if (cancelled) {