Compare commits

2 Commits

Author SHA1 Message Date
f483caad06 update README.md 2025-10-14 14:01:51 +02:00
7b7a4e5709 fix 2025-10-14 13:45:37 +02:00
5 changed files with 33 additions and 9 deletions

View File

@@ -2,15 +2,39 @@
This is an [Astro integration](https://docs.astro.build/en/guides/integrations-guide/) that ease the use of PocketBase in your Astro projects This is an [Astro integration](https://docs.astro.build/en/guides/integrations-guide/) that ease the use of PocketBase in your Astro projects
## Usage This repository is a continuation of [Gregory Bouteiller's astro-pocketbase](https://github.com/gbouteiller/astro-pocketbase), as the original repository was outdated for 10 months.
To see how to get started, check out the [docs](https://astro-pocketbase-five.vercel.app) ## Documentation
## Licensing [Old documentation is compatible with the current version](https://astro-pocketbase-five.vercel.app)
[MIT Licensed](https://github.com/gbouteiller/astro-pocketbase/blob/main/LICENSE). Made with ❤️ by [Gregory Bouteiller](https://github.com/gbouteiller). ## Compatibility
- **PocketBase**: v0.30.0
- **PocketBase JS SDK**: v0.26.2
- **Astro**: v5.14.4
## Changes from Original
### Project Structure
- Removed `doc/`, `playground/` and monorepo configuration.
- Replaced `pnpm` and `node` in favor of `bun`.
- Switched `.github/` to `.gitea/` and `gh` to `tea`.
### Dependencies & Code
- Migrated from `tsup` to `tsdown`.
- Replaced original `zod-pocketbase` in favor of my own `forked version` - **zod-pocketbase-continue**.
- Updated all npm dependencies (except `zod`, which was only updated to the latest 3 version).
- Fixed `auth` const assignment in `loader.ts` to match the latest PocketBase version.
- Fixed typescript error in generated `loader.ts` with `auth` const.
## License
[MIT License](./LICENSE)
## Acknowledgements ## Acknowledgements
- [`astro-pocketbase`](https://github.com/gbouteiller/astro-pocketbase) by Gregory Bouteiller
- [`zod-pocketbase`](https://github.com/gbouteiller/zod-pocketbase) by Gregory Bouteiller
- [`astro-integration-kit`](https://github.com/florian-lefebvre/astro-integration-kit) by Florian Lefebvre - [`astro-integration-kit`](https://github.com/florian-lefebvre/astro-integration-kit) by Florian Lefebvre
- [`pocketbase`](https://github.com/pocketbase/js-sdk) by Gani Georgiev - [`pocketbase`](https://github.com/pocketbase/js-sdk) by Gani Georgiev

View File

@@ -3,10 +3,11 @@
import type { Collection, TypedPocketbase } from "./schemas"; import type { Collection, TypedPocketbase } from "./schemas";
import type { LoaderContext } from "astro/loaders"; import type { LoaderContext } from "astro/loaders";
import Pocketbase from "pocketbase"; import Pocketbase from "pocketbase";
import type AdminAuthResponse from "pocketbase"; import Client from "pocketbase";
import type { RecordAuthResponse, } from "pocketbase";
let pocketbase: TypedPocketbase; let pocketbase: TypedPocketbase;
let auth: Promise<AdminAuthResponse>; let auth: Promise<RecordAuthResponse<Client>>;
let isAuthenticating = false; let isAuthenticating = false;
export function pocketbaseLoader({ collection }: PocketbaseLoaderOptions) { export function pocketbaseLoader({ collection }: PocketbaseLoaderOptions) {

View File

@@ -2,7 +2,7 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"workspaces": { "workspaces": {
"": { "": {
"name": "astro-pocketbase-continued", "name": "astro-pocketbase-continue",
"dependencies": { "dependencies": {
"astro-integration-kit": "^0.19.0", "astro-integration-kit": "^0.19.0",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",

View File

@@ -1,5 +1,5 @@
{ {
"name": "astro-pocketbase-continued", "name": "astro-pocketbase-continue",
"version": "0.12.0", "version": "0.12.0",
"description": "Astro integration to ease the use of PocketBase in your Astro projects", "description": "Astro integration to ease the use of PocketBase in your Astro projects",
"author": { "author": {

View File

@@ -62,7 +62,6 @@ export const integration = defineIntegration({
injectTypes({ filename: "env.d.ts", content }); injectTypes({ filename: "env.d.ts", content });
}, },
//@ts-expect-error
"astro:server:setup": ({ refreshContent, toolbar }) => { "astro:server:setup": ({ refreshContent, toolbar }) => {
toolbar.on("astro-pocketbase-continue:refresh", async () => { toolbar.on("astro-pocketbase-continue:refresh", async () => {
if (!refreshContent) console.warn("Content can only be refreshed in Astro v5.0.0 or higher"); if (!refreshContent) console.warn("Content can only be refreshed in Astro v5.0.0 or higher");