gitforest 1.1.1 → 1.1.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
|
@@ -23,11 +23,11 @@ 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
|
-
const [shouldExit, setShouldExit] = useState(false);
|
|
31
31
|
const [directories, setDirectories] = useState<DirectoryConfig[]>([]);
|
|
32
32
|
const [githubAuth, setGithubAuth] = useState<GitHubAuthState>({
|
|
33
33
|
authenticated: false,
|
|
@@ -69,8 +69,10 @@ export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps
|
|
|
69
69
|
setIsCreatingConfig(false);
|
|
70
70
|
// Auto-complete after showing success, then exit
|
|
71
71
|
setTimeout(() => {
|
|
72
|
+
// Call onComplete first to ensure config is passed to parent
|
|
72
73
|
onComplete(config);
|
|
73
|
-
|
|
74
|
+
// Then unmount the component
|
|
75
|
+
onUnmount?.();
|
|
74
76
|
}, 2000);
|
|
75
77
|
} catch (error) {
|
|
76
78
|
setConfigError(error instanceof Error ? error.message : "Failed to create config");
|
|
@@ -98,11 +100,6 @@ export function OnboardingWizard({ onComplete, onCancel }: OnboardingWizardProps
|
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
102
|
|
|
101
|
-
// Exit the wizard when shouldExit is true
|
|
102
|
-
if (shouldExit) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
103
|
return (
|
|
107
104
|
<Box flexDirection="column">
|
|
108
105
|
{currentStep === "welcome" && (
|
package/src/index.tsx
CHANGED
|
@@ -254,15 +254,16 @@ async function runOnboardingWizard(): Promise<void> {
|
|
|
254
254
|
};
|
|
255
255
|
|
|
256
256
|
// Render onboarding wizard
|
|
257
|
-
const
|
|
257
|
+
const instance = render(
|
|
258
258
|
<OnboardingWizard
|
|
259
259
|
onComplete={handleComplete}
|
|
260
260
|
onCancel={handleCancel}
|
|
261
|
+
onUnmount={() => instance.unmount()}
|
|
261
262
|
/>
|
|
262
263
|
);
|
|
263
264
|
|
|
264
265
|
// Wait for completion or cancellation
|
|
265
|
-
await waitUntilExit();
|
|
266
|
+
await instance.waitUntilExit();
|
|
266
267
|
|
|
267
268
|
if (cancelled) {
|
|
268
269
|
console.log("\nOnboarding cancelled. Run 'gitforest --init' to create a default config.");
|