feat: add pbkit for typed PocketBase SDK generation#3
Open
Rook-ai-bot wants to merge 3 commits into
Open
Conversation
Replace pocketbase-typegen with pbkit (@karnak19/pbkit) for schema-driven type generation, SDK functions, and TanStack Query options. Changes: - Add @karnak19/pbkit + @karnak19/pbkit-tanstack as devDependencies - Remove pocketbase-typegen - Add pbkit.config.ts (reads PB_TYPEGEN_URL or POCKETBASE_URL from env) - Update typegen script to use pbkit CLI - Delete old pocketbase-typegen generated types.ts - Add src/shared/db/index.ts barrel export for generated code - Update AuthProvider to use generated UsersRecord type - Update README with pbkit docs, setup step, and usage examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
pocketbase-typegenwith pbkit for schema-driven type generation, SDK functions, and TanStack Query options.Changes
@karnak19/pbkit+@karnak19/pbkit-tanstack, removepocketbase-typegenpbkit.config.ts(readsPB_TYPEGEN_URLorPOCKETBASE_URLfrom env)bun run typegennow runspbkit generateinstead ofpocketbase-typegentypes.ts(generated by pocketbase-typegen, never actually imported)src/shared/db/index.tsbarrel export for generated codeAuthProviderto use generatedUsersRecordtype instead of rawRecordModelGenerated output (
src/shared/db/generated/)types.gen.tsUsersRecord,UsersCreate,UsersUpdate, etc.)client.gen.tssdk.gen.tsgetUser,listUsers,createUser, etc.)tanstack.gen.tsuserOptions,usersOptions, etc.)Setup
After merging, run
bun install && bun run typegenwith PocketBase running to generate the files.