astro-loader-pocketbase 2.10.1 → 2.10.2-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-loader-pocketbase",
3
- "version": "2.10.1",
3
+ "version": "2.10.2-next.1",
4
4
  "description": "A content loader for Astro that uses the PocketBase API",
5
5
  "keywords": [
6
6
  "astro",
@@ -13,22 +13,26 @@
13
13
  "bugs": {
14
14
  "url": "https://github.com/pawcoding/astro-loader-pocketbase/issues"
15
15
  },
16
+ "license": "MIT",
17
+ "author": "Luis Wolf <development@pawcode.de> (https://pawcode.de)",
16
18
  "repository": {
17
19
  "type": "git",
18
20
  "url": "git+https://github.com/pawcoding/astro-loader-pocketbase.git"
19
21
  },
20
- "license": "MIT",
21
- "author": "Luis Wolf <development@pawcode.de> (https://pawcode.de)",
22
+ "files": [
23
+ "src"
24
+ ],
22
25
  "type": "module",
23
26
  "exports": {
24
27
  ".": "./src/index.ts"
25
28
  },
26
- "files": [
27
- "src"
28
- ],
29
+ "publishConfig": {
30
+ "access": "public",
31
+ "provenance": true
32
+ },
29
33
  "scripts": {
30
- "format": "npx prettier . --write --cache --cache-location=./.prettier-cache --experimental-cli",
31
- "format:check": "npx prettier . --check --cache --cache-location=./.prettier-cache --experimental-cli",
34
+ "format": "oxfmt",
35
+ "format:check": "oxfmt --check",
32
36
  "lint": "oxlint --type-aware",
33
37
  "lint:fix": "oxlint --type-aware --fix",
34
38
  "prepare": "husky",
@@ -43,28 +47,22 @@
43
47
  "typecheck": "npx tsc --noEmit"
44
48
  },
45
49
  "devDependencies": {
46
- "@commitlint/cli": "20.2.0",
47
- "@commitlint/config-conventional": "20.2.0",
50
+ "@commitlint/cli": "20.4.2",
51
+ "@commitlint/config-conventional": "20.4.2",
48
52
  "@types/node": "24.10.1",
49
- "@vitest/coverage-v8": "4.0.15",
50
- "astro": "5.16.5",
51
- "globals": "16.5.0",
53
+ "@vitest/coverage-v8": "4.0.18",
54
+ "astro": "5.18.0",
55
+ "globals": "17.3.0",
52
56
  "husky": "9.1.7",
53
- "lint-staged": "16.2.7",
54
- "oxlint": "1.32.0",
55
- "oxlint-tsgolint": "0.8.6",
56
- "prettier": "3.7.4",
57
- "prettier-plugin-organize-imports": "4.3.0",
58
- "prettier-plugin-packagejson": "2.5.20",
57
+ "lint-staged": "16.3.0",
58
+ "oxfmt": "0.35.0",
59
+ "oxlint": "1.50.0",
60
+ "oxlint-tsgolint": "0.15.0",
59
61
  "typescript": "5.9.3",
60
- "vitest": "4.0.15"
62
+ "vitest": "4.0.18"
61
63
  },
62
64
  "peerDependencies": {
63
65
  "astro": "^5.10.0"
64
66
  },
65
- "packageManager": "npm@11.7.0",
66
- "publishConfig": {
67
- "access": "public",
68
- "provenance": true
69
- }
67
+ "packageManager": "npm@11.11.0"
70
68
  }
@@ -182,11 +182,7 @@ function checkUpdatedField(
182
182
  const updatedField = collection.fields.find(
183
183
  (field) => field.name === options.updatedField
184
184
  );
185
- if (
186
- !updatedField ||
187
- updatedField.type !== "autodate" ||
188
- !updatedField.onUpdate
189
- ) {
185
+ if (updatedField?.type !== "autodate" || !updatedField.onUpdate) {
190
186
  console.warn(
191
187
  `The field "${options.updatedField}" is not of type "autodate" with the value "Update" or "Create/Update".\nMake sure that the field is automatically updated when the entry is updated!`
192
188
  );
@@ -94,7 +94,7 @@ export function parseSchema(
94
94
  fieldType = parseSingleOrMultipleValues(field, z.string());
95
95
  break;
96
96
  case "json":
97
- if (customSchemas && customSchemas[field.name]) {
97
+ if (customSchemas?.[field.name]) {
98
98
  // Use the user defined custom schema for the field
99
99
  fieldType = customSchemas[field.name];
100
100
  } else {
@@ -63,5 +63,5 @@ export function transformFileUrl(
63
63
  entryId: string,
64
64
  file: string
65
65
  ): string {
66
- return `${base}/api/files/${collectionName}/${entryId}/${file}`;
66
+ return new URL(`api/files/${collectionName}/${entryId}/${file}`, base).href;
67
67
  }
@@ -13,7 +13,7 @@ export class PocketBaseAuthenticationError extends LiveCollectionError {
13
13
  // This is similar to the original implementation in Astro itself.
14
14
  return (
15
15
  // oxlint-disable-next-line no-unsafe-type-assertion
16
- !!error && (error as Error)?.name === "PocketBaseAuthenticationError"
16
+ !!error && (error as Error).name === "PocketBaseAuthenticationError"
17
17
  );
18
18
  }
19
19
  }
@@ -51,7 +51,9 @@ export async function getSuperuserToken(
51
51
  // Random wait between 3 (default rate limit interval) and 8 seconds
52
52
  const retryAfter = Math.random() * 5 + 3;
53
53
  // oxlint-disable-next-line promise/avoid-new
54
- await new Promise((resolve) => setTimeout(resolve, retryAfter * 1000));
54
+ await new Promise((resolve) => {
55
+ setTimeout(resolve, retryAfter * 1000);
56
+ });
55
57
 
56
58
  return getSuperuserToken(url, superuserCredentials, logger);
57
59
  }
@@ -9,7 +9,7 @@ export function shouldRefresh(
9
9
  ): "refresh" | "skip" | "force" {
10
10
  // Check if the refresh was triggered by the `astro-integration-pocketbase`
11
11
  // and the correct metadata is provided.
12
- if (!context || context.source !== "astro-integration-pocketbase") {
12
+ if (context?.source !== "astro-integration-pocketbase") {
13
13
  return "refresh";
14
14
  }
15
15