Compare commits
2 Commits
2e1157616f
...
f483caad06
| Author | SHA1 | Date | |
|---|---|---|---|
| f483caad06 | |||
| 7b7a4e5709 |
32
README.md
32
README.md
@@ -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
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
2
bun.lock
2
bun.lock
@@ -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",
|
||||||
|
|||||||
@@ -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": {
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
Reference in New Issue
Block a user