Temporary working plan for the current refactor pass.
- Skip example apps unless a touched change forces a follow-up.
- Use
bunonly. - Use
tsgo/repo checks where relevant. - Do not run lint during the refactor passes.
- Keep changes local to the current large item.
- Create one local commit per large item after checks pass.
Fast path for this repo, assuming one applied branch/stack:
- Inspect current state:
but statusbut diff
- Do a large, coherent batch of work.
- Commit the whole batch to the active stack:
but commit -m "<message>"
Useful commands:
but status— workspace + applied stack overviewbut diff— inspect current uncommitted diffbut branch list— see applied/unapplied branchesbut branch new <name>— create a new stack if we need onebut commit -m "<message>"— commit all current changes to the active stackbut commit <branch> -m "<message>"— commit to a specific stack when multiple are appliedbut stage <file-or-hunk> <branch>— only when we need to split changes across stacksbut undo— revert the last GitButler operation quickly
Recommended workflow here:
- Prefer large-item commits, not tiny churn commits.
- Prefer
but commit -m ...over fine-grained staging unless a change truly belongs on another stack. - Check
but status+but diffright before each commit.
Goal:
- Extract duplicated browser/Tauri auth action flow from the Svelte and Solid clients into shared helpers built on
createAuthClient.
Scope:
packages/gau/src/client/vanilla/index.tspackages/gau/src/client/svelte/index.svelte.tspackages/gau/src/client/solid/index.tsxpackages/gau/src/runtimes/tauri/index.ts
Expected outcomes:
- One source of truth for sign-in/link defaults, redirect callback handling, and Tauri bridge startup.
- Fix obvious bugs/regressions in the current client flow.
- Remove framework-specific duplicate fallback code where safe.
Follow-through:
- Add focused tests for shared client behavior.
Goal:
- Deduplicate auth instance resolution, server-session lookup, null-session fallback, provider list generation, and locals caching.
Scope:
packages/gau/src/sveltekit/index.tspackages/gau/src/solidstart/index.ts- small shared helper(s) under
packages/gau/src/coreor a nearby shared integration module
Goal:
- Split callback parsing, hook execution, user/account resolution, persistence, and response building into smaller internal helpers.
Scope:
packages/gau/src/core/handlers/callback.ts- nearby handler helpers if needed
Goal:
- Reduce copy-paste across providers and make params/refresh behavior more consistent.
Scope:
packages/gau/src/oauth/providers/*packages/gau/src/oauth/index.ts- shared oauth helper(s)
Goal:
- Extract common adapter logic while keeping dialect-specific DB calls small and obvious.
Scope:
packages/gau/src/adapters/drizzle/sqlite.tspackages/gau/src/adapters/drizzle/pg.ts- shared drizzle helper(s)
Goal:
- Improve test coverage and test structure in the touched areas.
- Try to add client-facing tests where practical, even if framework-specific test setup is awkward.
Notes:
- Client tests are currently the hardest part.
- Prefer extracting logic into plain TS helpers so more of it can be tested without full Svelte/Solid component harnesses.
- Also take small local structure wins when they directly support the refactors above.
- Create this plan.
- Implement item 1.
- Run focused checks/tests.
- Review diff and do one obvious follow-up if justified.
- Commit item 1 locally with GitButler.
- Move to item 2.