Skip to content
Source
Sign inSign up
TanStack/cli

feat(create): add React PocketBase add-on #572

Openakanyane(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/572/headopened

Showing 11 changed files with 188 additions and 0 deletions (loading 8).

x
0 of 11 viewed, 11 left
5 additions and 0 deletions.changeset/pocketbase-addon.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/create': minor
+---
+​
+Add a React PocketBase add-on. `--add-ons pocketbase` wires the PocketBase JS SDK into a TanStack Start app, with a migration for an owner-scoped `todos` collection and a `/demo/pocketbase` route with email and password sign-in and a private realtime todo list.
143 additions and 0 deletionspackages/cli/tests-e2e/pocketbase-smoke.spec.tsAdded
View file
@@ -0,0 +1,143 @@
+import { createServer } from 'node:http'
+import { writeFile } from 'node:fs/promises'
+import { join } from 'node:path'
+import { expect, test } from '@playwright/test'
+import { attachRuntimeGuards, createReactAppFixture } from './helpers'
+​
+function createPocketBaseFixture() {
+ const requests: Array<string> = []
+ const server = createServer((request, response) => {
+ requests.push(request.url ?? '')
+ response.writeHead(request.method === 'OPTIONS' ? 204 : 200, {
+ 'access-control-allow-origin': '*',
+ 'access-control-allow-headers': '*',
+ 'content-type': 'application/json',
+ })
+ response.end(
+ request.method === 'OPTIONS'