astro-integration-pocketbase 3.0.0 → 3.0.3-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 +8 -8
- package/src/core/refresh-collections-realtime.ts +1 -1
- package/src/core/refresh-collections.ts +1 -1
- package/src/toolbar/dom/create-entity.ts +4 -6
- package/src/toolbar/dom/create-header.ts +6 -10
- package/src/toolbar/init-toolbar.ts +3 -5
- package/src/tsconfig.json +7 -0
- package/src/utils/map-collections-to-watch.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-integration-pocketbase",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3-next.1",
|
|
4
4
|
"description": "An Astro integration to support developers working with astro-loader-pocketbase.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -40,24 +40,24 @@
|
|
|
40
40
|
"lint": "oxlint --type-aware --type-check",
|
|
41
41
|
"lint:fix": "oxlint --type-aware --type-check --fix",
|
|
42
42
|
"prepare": "husky",
|
|
43
|
-
"typecheck": "npx @typescript/native-preview --noEmit"
|
|
43
|
+
"typecheck": "npx @typescript/native-preview --noEmit -p src/tsconfig.json"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@commitlint/cli": "20.5.0",
|
|
47
47
|
"@commitlint/config-conventional": "20.5.0",
|
|
48
48
|
"@types/node": "24.12.0",
|
|
49
|
-
"astro": "6.
|
|
49
|
+
"astro": "6.1.5",
|
|
50
50
|
"eventsource": "4.1.0",
|
|
51
|
-
"globals": "17.
|
|
51
|
+
"globals": "17.5.0",
|
|
52
52
|
"husky": "9.1.7",
|
|
53
53
|
"lint-staged": "16.4.0",
|
|
54
|
-
"oxfmt": "0.
|
|
55
|
-
"oxlint": "1.
|
|
56
|
-
"oxlint-tsgolint": "0.
|
|
54
|
+
"oxfmt": "0.44.0",
|
|
55
|
+
"oxlint": "1.59.0",
|
|
56
|
+
"oxlint-tsgolint": "0.20.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"astro": "^6.0.0",
|
|
60
60
|
"eventsource": "^4.0.0"
|
|
61
61
|
},
|
|
62
|
-
"packageManager": "npm@11.12.
|
|
62
|
+
"packageManager": "npm@11.12.1"
|
|
63
63
|
}
|
|
@@ -35,20 +35,18 @@ function createEntity(data: Entity, baseUrl: string): string {
|
|
|
35
35
|
<div class="entity">
|
|
36
36
|
<pre>${JSON.stringify(data, undefined, 2).replaceAll("<", "<")}</pre>
|
|
37
37
|
|
|
38
|
-
${
|
|
39
|
-
|
|
40
|
-
? /* HTML */ `
|
|
38
|
+
${baseUrl
|
|
39
|
+
? /* HTML */ `
|
|
41
40
|
<astro-dev-toolbar-button
|
|
42
41
|
size="small"
|
|
43
42
|
button-style="purple"
|
|
44
43
|
title="View in PocketBase"
|
|
45
|
-
onclick="window.open('${baseUrl}/_/#/collections?collection=${data.collectionId}&recordId=${data.id}', '_blank')"
|
|
44
|
+
onclick="window.open('${baseUrl}/_/#/collections?collection=${data.collectionId}&recordId=${data.id}&record=${data.id}', '_blank')"
|
|
46
45
|
>
|
|
47
46
|
View in PocketBase
|
|
48
47
|
</astro-dev-toolbar-button>
|
|
49
48
|
`
|
|
50
|
-
|
|
51
|
-
}
|
|
49
|
+
: ""}
|
|
52
50
|
</div>
|
|
53
51
|
</astro-dev-toolbar-card>
|
|
54
52
|
`;
|
|
@@ -59,9 +59,8 @@ export function createHeader(
|
|
|
59
59
|
</astro-dev-toolbar-badge>
|
|
60
60
|
|
|
61
61
|
<div class="actions">
|
|
62
|
-
${
|
|
63
|
-
|
|
64
|
-
? /* HTML */ `
|
|
62
|
+
${realtime
|
|
63
|
+
? /* HTML */ `
|
|
65
64
|
<div class="toggle-container">
|
|
66
65
|
<label
|
|
67
66
|
for="real-time"
|
|
@@ -72,11 +71,9 @@ export function createHeader(
|
|
|
72
71
|
<!-- real-time-toggle -->
|
|
73
72
|
</div>
|
|
74
73
|
`
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
hasContentLoader
|
|
79
|
-
? /* HTML */ `
|
|
74
|
+
: ""}
|
|
75
|
+
${hasContentLoader
|
|
76
|
+
? /* HTML */ `
|
|
80
77
|
<astro-dev-toolbar-button
|
|
81
78
|
id="refresh-content"
|
|
82
79
|
size="small"
|
|
@@ -86,8 +83,7 @@ export function createHeader(
|
|
|
86
83
|
Refresh content
|
|
87
84
|
</astro-dev-toolbar-button>
|
|
88
85
|
`
|
|
89
|
-
|
|
90
|
-
}
|
|
86
|
+
: ""}
|
|
91
87
|
</div>
|
|
92
88
|
`;
|
|
93
89
|
|
|
@@ -75,11 +75,9 @@ export function initToolbar(
|
|
|
75
75
|
<hr />
|
|
76
76
|
|
|
77
77
|
<main>
|
|
78
|
-
${
|
|
79
|
-
entities.
|
|
80
|
-
|
|
81
|
-
: createPlaceholder()
|
|
82
|
-
}
|
|
78
|
+
${entities.length > 0
|
|
79
|
+
? createEntities(entities, options.baseUrl)
|
|
80
|
+
: createPlaceholder()}
|
|
83
81
|
</main>
|
|
84
82
|
`);
|
|
85
83
|
|
|
@@ -36,6 +36,9 @@ export function mapCollectionsToWatch(
|
|
|
36
36
|
const collectionsMap = new Map<string, Array<string>>();
|
|
37
37
|
for (const localCollection in collectionsToWatch) {
|
|
38
38
|
const watch = collectionsToWatch[localCollection];
|
|
39
|
+
if (!watch) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
39
42
|
|
|
40
43
|
// Check if collection should be watched by itself
|
|
41
44
|
if (watch === true) {
|