Skip to content

Commit 527e14d

Browse files
authored
Merge pull request #66 from pawcoding/next
🚀 Release
2 parents 7e727ea + 47025d5 commit 527e14d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1107
-1473
lines changed

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
# Setup Node
3030
- name: 📦 Setup Node.js
31-
uses: actions/setup-node@v5
31+
uses: actions/setup-node@v6
3232
with:
3333
node-version-file: .nvmrc
3434

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727

2828
# Setup Node
2929
- name: 📦 Setup Node.js
30-
uses: actions/setup-node@v5
30+
uses: actions/setup-node@v6
3131
with:
3232
node-version-file: .nvmrc
3333

@@ -80,9 +80,10 @@ jobs:
8080
if: github.repository == 'pawcoding/astro-loader-pocketbase'
8181
id: release
8282
uses: cycjimmy/semantic-release-action@v5
83+
with:
84+
semantic_version: 25
8385
env:
8486
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
85-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8687

8788
# Update project on website
8889
- name: 🖥️ Update website

.github/workflows/test.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: 🧪 Test code
2-
# Run this on every push except master and next
2+
33
on:
4+
# Run this on every push except master and next
45
push:
56
branches:
67
- "**"
78
- "!master"
89
- "!next"
10+
# Run this every week to make sure the latest PocketBase version still works
11+
schedule:
12+
- cron: "0 4 * * 6"
913

1014
env:
1115
HUSKY: 0
@@ -28,7 +32,7 @@ jobs:
2832

2933
# Setup Node
3034
- name: 📦 Setup Node.js
31-
uses: actions/setup-node@v5
35+
uses: actions/setup-node@v6
3236
with:
3337
node-version-file: .nvmrc
3438

.github/workflows/trigger-pawcode-update.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
echo "release_url=${{ github.event.release.html_url }}" >> $GITHUB_OUTPUT
1818
1919
- name: 🚀 Trigger pawcode-astro update
20-
uses: peter-evans/repository-dispatch@v3
20+
uses: peter-evans/repository-dispatch@v4
2121
with:
2222
token: ${{ secrets.PAWCODE_ASTRO_TOKEN }}
2323
repository: pawcoding/pawcode-astro

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

.oxlintrc.json

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
},
1616
"rules": {
1717
// Correctness (in addition to the default rules)
18+
"typescript/no-base-to-string": "off",
19+
"typescript/restrict-template-expressions": "off",
20+
"typescript/unbound-method": "off",
1821
"promise/no-new-statics": "error",
1922
"promise/valid-params": "error",
2023
// Perf
@@ -32,8 +35,8 @@
3235
"eslint/no-empty-function": "warn",
3336
"eslint/no-eq-null": "error",
3437
"eslint/no-iterator": "error",
38+
"eslint/no-param-reassign": "warn",
3539
"eslint/no-proto": "error",
36-
"eslint/no-unused-expressions": "warn",
3740
"eslint/no-var": "error",
3841
"import/no-commonjs": "error",
3942
"import/no-cycle": "error",
@@ -115,8 +118,8 @@
115118
"eslint/no-redeclare": "error",
116119
"eslint/no-self-compare": "error",
117120
"eslint/no-throw-literal": "error",
118-
"eslint/require-await": "warn",
119121
"eslint/symbol-description": "error",
122+
"typescript/ban-ts-comment": "warn",
120123
"typescript/no-unsafe-argument": "error",
121124
"typescript/no-unsafe-assignment": "error",
122125
"typescript/no-unsafe-call": "error",
@@ -131,6 +134,7 @@
131134
"unicorn/consistent-empty-array-spread": "warn",
132135
"unicorn/explicit-length-check": "warn",
133136
"unicorn/new-for-builtins": "warn",
137+
"unicorn/no-array-callback-reference": "error",
134138
"unicorn/no-instanceof-array": "error",
135139
"unicorn/no-negation-in-equality-check": "warn",
136140
"unicorn/no-static-only-class": "error",
@@ -141,12 +145,14 @@
141145
"unicorn/no-useless-switch-case": "warn",
142146
"unicorn/prefer-array-flat": "error",
143147
"unicorn/prefer-array-some": "warn",
148+
"unicorn/prefer-at": "warn",
144149
"unicorn/prefer-date-now": "warn",
145150
"unicorn/prefer-math-min-max": "warn",
146151
"unicorn/prefer-math-trunc": "error",
147152
"unicorn/prefer-string-replace-all": "warn",
148153
"unicorn/prefer-string-slice": "warn",
149154
"unicorn/prefer-type-error": "warn",
155+
"unicorn/require-module-specifiers": "error",
150156
// Style
151157
"eslint/arrow-body-style": "warn",
152158
"eslint/curly": "error",
@@ -216,6 +222,13 @@
216222
"eslint/max-lines": "off",
217223
"eslint/max-lines-per-function": "off",
218224
"eslint/max-nested-callbacks": "off",
225+
"typescript/no-unsafe-argument": "off",
226+
"typescript/no-unsafe-assignment": "off",
227+
"typescript/no-unsafe-call": "off",
228+
"typescript/no-unsafe-return": "off",
229+
"typescript/no-unsafe-member-access": "off",
230+
"typescript/no-unsafe-type-assertion": "off",
231+
"typescript/no-explicit-any": "off",
219232
// Vitest specific rules
220233
"vitest/no-import-node-test": "warn",
221234
"vitest/prefer-to-be-falsy": "warn",

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"oxc.oxc-vscode",
4+
"esbenp.prettier-vscode",
5+
"vitest.explorer"
6+
]
7+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"oxc.typeAware": true,
3+
"oxc.unusedDisableDirectives": "warn",
4+
"oxc.lint.run": "onType"
5+
}

.zed/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Folder-specific settings
2+
//
3+
// For a full list of overridable settings, and general information on folder-specific settings,
4+
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
5+
{
6+
"lsp": {
7+
"oxc": {
8+
"initialization_options": {
9+
"options": {
10+
"run": "onType",
11+
"configPath": null,
12+
"tsConfigPath": null,
13+
"unusedDisableDirectives": "warn",
14+
"typeAware": true,
15+
"flags": {}
16+
}
17+
}
18+
}
19+
}
20+
}

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ const blog = defineCollection({
172172
});
173173
```
174174

175-
_It's recommended to use an [impersonate token (API token)](https://pocketbase.io/docs/authentication/#api-keys) instead of the email and password, as this is more secure and can be easily revoked._
175+
> [!TIP]
176+
> It's recommended to use an [impersonate token (API token)](https://pocketbase.io/docs/authentication/#api-keys) instead of the email and password, as this is more secure and can be easily revoked.
177+
> This also prevents the loader from hitting some rate limits with PocketBase, since the default is 2 authentication requests per 3 second interval.
176178
177179
Under the hood, the loader will use the [PocketBase API](https://pocketbase.io/docs/api-collections/#view-collection) to fetch the schema of your collection and generate types with Zod based on that schema.
178180

@@ -307,6 +309,17 @@ const blogLive = defineLiveCollection({
307309
});
308310
```
309311

312+
### Error handling
313+
314+
The live content loader follows Astro's standard error handling conventions for live collections. For more information on how to handle errors in your components, see the [Astro documentation on error handling](https://docs.astro.build/en/reference/experimental-flags/live-content-collections/#error-handling).
315+
316+
| Error | When it's returned |
317+
| ------------------------------- | ------------------------------------------------------------------------------------------------------------- |
318+
| `PocketBaseAuthenticationError` | Authentication or authorization fails (missing credentials or invalid token) |
319+
| `LiveEntryNotFoundError` | The requested entry doesn't exist or doesn't match the applied filters |
320+
| `LiveCollectionValidationError` | The data returned by PocketBase doesn't match the Zod schema or the `updatedField` doesn't contain valid data |
321+
| `LiveCollectionError` | Any other error occurs (network errors, invalid filter syntax, PocketBase server errors, etc.) |
322+
310323
### Caveats
311324

312325
Live content loaders do not (yet 🤞🏼) support zod schemas and thus schema generation and entry transformation.

0 commit comments

Comments
 (0)