astro-loader-pocketbase 3.0.0-next.1 → 3.0.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": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A content loader for Astro that uses the PocketBase API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -44,26 +44,26 @@
|
|
|
44
44
|
"test:unit": "vitest run $(find test -name '*.spec.ts')",
|
|
45
45
|
"test:unit:watch": "vitest watch $(find test -name '*.spec.ts')",
|
|
46
46
|
"test:watch": "vitest watch",
|
|
47
|
-
"typecheck": "npx @typescript/native-preview --noEmit"
|
|
47
|
+
"typecheck": "npx @typescript/native-preview --noEmit -p src/tsconfig.json && npx @typescript/native-preview --noEmit -p test/tsconfig.json"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@commitlint/cli": "20.
|
|
51
|
-
"@commitlint/config-conventional": "20.
|
|
50
|
+
"@commitlint/cli": "20.5.0",
|
|
51
|
+
"@commitlint/config-conventional": "20.5.0",
|
|
52
52
|
"@types/node": "24.10.1",
|
|
53
|
-
"@vitest/coverage-v8": "4.1.
|
|
54
|
-
"astro": "6.
|
|
53
|
+
"@vitest/coverage-v8": "4.1.3",
|
|
54
|
+
"astro": "6.1.5",
|
|
55
55
|
"globals": "17.4.0",
|
|
56
56
|
"husky": "9.1.7",
|
|
57
|
-
"lint-staged": "16.
|
|
58
|
-
"oxfmt": "0.
|
|
59
|
-
"oxlint": "1.
|
|
60
|
-
"oxlint-tsgolint": "0.
|
|
61
|
-
"vitest": "4.1.
|
|
57
|
+
"lint-staged": "16.4.0",
|
|
58
|
+
"oxfmt": "0.44.0",
|
|
59
|
+
"oxlint": "1.59.0",
|
|
60
|
+
"oxlint-tsgolint": "0.20.0",
|
|
61
|
+
"vitest": "4.1.3",
|
|
62
62
|
"zod-to-ts": "2.0.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"astro": "^6.0.0",
|
|
66
66
|
"zod-to-ts": "^2.0.0"
|
|
67
67
|
},
|
|
68
|
-
"packageManager": "npm@11.
|
|
68
|
+
"packageManager": "npm@11.12.1"
|
|
69
69
|
}
|
package/src/pocketbase-loader.ts
CHANGED
|
@@ -43,7 +43,6 @@ export function pocketbaseLoader(options: PocketBaseLoaderOptions) {
|
|
|
43
43
|
// Load the entries from the collection
|
|
44
44
|
await loader(context, options, token);
|
|
45
45
|
},
|
|
46
|
-
// oxlint-disable-next-line explicit-module-boundary-types
|
|
47
46
|
createSchema: async () => {
|
|
48
47
|
const token = await tokenPromise;
|
|
49
48
|
|
|
@@ -93,13 +93,8 @@ export function parseSchema(
|
|
|
93
93
|
fieldType = parseSingleOrMultipleValues(field, z.string());
|
|
94
94
|
break;
|
|
95
95
|
case "json":
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
fieldType = customSchemas[field.name];
|
|
99
|
-
} else {
|
|
100
|
-
// Parse the field as unknown JSON
|
|
101
|
-
fieldType = z.unknown();
|
|
102
|
-
}
|
|
96
|
+
// Use the user defined custom schema for the field or fallback to unknown
|
|
97
|
+
fieldType = customSchemas?.[field.name] ?? z.unknown();
|
|
103
98
|
break;
|
|
104
99
|
default:
|
|
105
100
|
// Default to a string
|
|
@@ -49,7 +49,10 @@ function splitFieldsString(fieldsString: string): Array<string> {
|
|
|
49
49
|
|
|
50
50
|
const fields: Array<string> = [];
|
|
51
51
|
for (let i = 0; i < initialSplit.length; i++) {
|
|
52
|
-
const part = initialSplit
|
|
52
|
+
const part = initialSplit.at(i);
|
|
53
|
+
if (!part) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
53
56
|
|
|
54
57
|
if (part.includes("(") && !part.includes(")")) {
|
|
55
58
|
fields.push(`${part},${initialSplit[++i]}`);
|