@pagebridge/sanity 0.0.2 → 0.1.0
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/.turbo/turbo-build.log +1 -1
- package/README.md +72 -58
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +2 -2
- package/package.json +15 -1
- package/src/index.ts +3 -3
- package/src/plugin.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[?9001h[?1004h[?25l[2J[m[2;1H> @pagebridge/sanity@0.0
|
|
1
|
+
[?9001h[?1004h[?25l[2J[m[2;1H> @pagebridge/sanity@0.1.0 build F:\Code\pagebridge\oss\packages\sanity-plugin
|
|
2
2
|
> pnpm exec tsc[5;1H]0;C:\WINDOWS\system32\cmd.exe[?25h[?9001l[?1004l
|
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# @pagebridge/sanity
|
|
1
|
+
# @pagebridge/sanity
|
|
2
2
|
|
|
3
3
|
Sanity Studio v3 plugin for PageBridge. Provides document schemas, UI components, and tools for viewing search performance data and managing content refresh tasks.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm add @pagebridge/sanity
|
|
8
|
+
pnpm add @pagebridge/sanity
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
@@ -15,14 +15,14 @@ pnpm add @pagebridge/sanity-plugin
|
|
|
15
15
|
In your `sanity.config.ts`:
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import { defineConfig } from
|
|
19
|
-
import {
|
|
18
|
+
import { defineConfig } from "sanity";
|
|
19
|
+
import { pageBridgePlugin } from "@pagebridge/sanity";
|
|
20
20
|
|
|
21
21
|
export default defineConfig({
|
|
22
22
|
// ... other config
|
|
23
23
|
plugins: [
|
|
24
|
-
|
|
25
|
-
contentTypes: [
|
|
24
|
+
pageBridgePlugin({
|
|
25
|
+
contentTypes: ["post", "page"], // Document types to track
|
|
26
26
|
}),
|
|
27
27
|
],
|
|
28
28
|
});
|
|
@@ -33,20 +33,23 @@ export default defineConfig({
|
|
|
33
33
|
To display the Performance pane on your content documents:
|
|
34
34
|
|
|
35
35
|
```typescript
|
|
36
|
-
import { defineConfig } from
|
|
37
|
-
import { structureTool } from
|
|
38
|
-
import {
|
|
36
|
+
import { defineConfig } from "sanity";
|
|
37
|
+
import { structureTool } from "sanity/structure";
|
|
38
|
+
import {
|
|
39
|
+
pageBridgePlugin,
|
|
40
|
+
createPageBridgeStructureResolver,
|
|
41
|
+
} from "@pagebridge/sanity";
|
|
39
42
|
|
|
40
43
|
export default defineConfig({
|
|
41
44
|
// ... other config
|
|
42
45
|
plugins: [
|
|
43
46
|
structureTool({
|
|
44
|
-
structure:
|
|
45
|
-
contentTypes: [
|
|
47
|
+
structure: createPageBridgeStructureResolver({
|
|
48
|
+
contentTypes: ["post", "page"],
|
|
46
49
|
}),
|
|
47
50
|
}),
|
|
48
|
-
|
|
49
|
-
contentTypes: [
|
|
51
|
+
pageBridgePlugin({
|
|
52
|
+
contentTypes: ["post", "page"],
|
|
50
53
|
}),
|
|
51
54
|
],
|
|
52
55
|
});
|
|
@@ -60,49 +63,49 @@ The plugin registers three document types:
|
|
|
60
63
|
|
|
61
64
|
Represents a Google Search Console property.
|
|
62
65
|
|
|
63
|
-
| Field
|
|
64
|
-
|
|
65
|
-
| siteUrl
|
|
66
|
-
| slug
|
|
67
|
-
| defaultLocale | string
|
|
68
|
-
| pathPrefix
|
|
69
|
-
| lastSyncedAt
|
|
66
|
+
| Field | Type | Description |
|
|
67
|
+
| ------------- | -------- | -------------------------------------------- |
|
|
68
|
+
| siteUrl | string | GSC site URL (e.g., `sc-domain:example.com`) |
|
|
69
|
+
| slug | slug | URL-friendly identifier |
|
|
70
|
+
| defaultLocale | string | Default locale (default: "en") |
|
|
71
|
+
| pathPrefix | string | Path prefix for URL matching (e.g., `/blog`) |
|
|
72
|
+
| lastSyncedAt | datetime | Last sync timestamp (read-only) |
|
|
70
73
|
|
|
71
74
|
### gscSnapshot
|
|
72
75
|
|
|
73
76
|
Performance metrics snapshot linked to content documents.
|
|
74
77
|
|
|
75
|
-
| Field
|
|
76
|
-
|
|
77
|
-
| site
|
|
78
|
-
| page
|
|
79
|
-
| linkedDocument | reference | Matched content document
|
|
80
|
-
| period
|
|
81
|
-
| clicks
|
|
82
|
-
| impressions
|
|
83
|
-
| ctr
|
|
84
|
-
| position
|
|
85
|
-
| topQueries
|
|
86
|
-
| fetchedAt
|
|
87
|
-
| indexStatus
|
|
78
|
+
| Field | Type | Description |
|
|
79
|
+
| -------------- | --------- | ------------------------------- |
|
|
80
|
+
| site | reference | Reference to gscSite |
|
|
81
|
+
| page | string | Page URL |
|
|
82
|
+
| linkedDocument | reference | Matched content document |
|
|
83
|
+
| period | string | `last7`, `last28`, or `last90` |
|
|
84
|
+
| clicks | number | Total clicks |
|
|
85
|
+
| impressions | number | Total impressions |
|
|
86
|
+
| ctr | number | Click-through rate |
|
|
87
|
+
| position | number | Average position |
|
|
88
|
+
| topQueries | array | Top search queries with metrics |
|
|
89
|
+
| fetchedAt | datetime | When data was fetched |
|
|
90
|
+
| indexStatus | object | Google index status details |
|
|
88
91
|
|
|
89
92
|
### gscRefreshTask
|
|
90
93
|
|
|
91
94
|
Content refresh task with decay signal information.
|
|
92
95
|
|
|
93
|
-
| Field
|
|
94
|
-
|
|
95
|
-
| site
|
|
96
|
-
| linkedDocument | reference | Content document needing refresh
|
|
97
|
-
| reason
|
|
98
|
-
| severity
|
|
99
|
-
| status
|
|
100
|
-
| snoozedUntil
|
|
101
|
-
| metrics
|
|
102
|
-
| queryContext
|
|
103
|
-
| notes
|
|
104
|
-
| createdAt
|
|
105
|
-
| resolvedAt
|
|
96
|
+
| Field | Type | Description |
|
|
97
|
+
| -------------- | --------- | --------------------------------------------------------- |
|
|
98
|
+
| site | reference | Reference to gscSite |
|
|
99
|
+
| linkedDocument | reference | Content document needing refresh |
|
|
100
|
+
| reason | string | `position_decay`, `low_ctr`, `impressions_drop`, `manual` |
|
|
101
|
+
| severity | string | `low`, `medium`, `high` |
|
|
102
|
+
| status | string | `open`, `snoozed`, `in_progress`, `done`, `dismissed` |
|
|
103
|
+
| snoozedUntil | datetime | When to resurface (if snoozed) |
|
|
104
|
+
| metrics | object | Position, CTR, impressions data |
|
|
105
|
+
| queryContext | array | Top 5 queries with stats |
|
|
106
|
+
| notes | text | Resolution notes |
|
|
107
|
+
| createdAt | datetime | Task creation time |
|
|
108
|
+
| resolvedAt | datetime | Task resolution time |
|
|
106
109
|
|
|
107
110
|
## Components
|
|
108
111
|
|
|
@@ -111,13 +114,14 @@ Content refresh task with decay signal information.
|
|
|
111
114
|
Document view pane showing performance metrics for a content document.
|
|
112
115
|
|
|
113
116
|
```typescript
|
|
114
|
-
import { SearchPerformancePane } from
|
|
117
|
+
import { SearchPerformancePane } from "@pagebridge/sanity";
|
|
115
118
|
|
|
116
119
|
// Used automatically when you configure the structure resolver
|
|
117
120
|
// Can also be used directly in custom document views
|
|
118
121
|
```
|
|
119
122
|
|
|
120
123
|
The pane displays:
|
|
124
|
+
|
|
121
125
|
- Clicks, impressions, CTR, and position metrics
|
|
122
126
|
- Top search queries driving traffic
|
|
123
127
|
- Google index status
|
|
@@ -128,6 +132,7 @@ The pane displays:
|
|
|
128
132
|
Sanity tool for managing content refresh tasks. Accessible from the Studio sidebar.
|
|
129
133
|
|
|
130
134
|
Features:
|
|
135
|
+
|
|
131
136
|
- Filter tasks by status (open, in progress, snoozed, done, dismissed)
|
|
132
137
|
- Sort by severity or creation date
|
|
133
138
|
- View decay signal details
|
|
@@ -136,16 +141,16 @@ Features:
|
|
|
136
141
|
|
|
137
142
|
## Configuration Options
|
|
138
143
|
|
|
139
|
-
###
|
|
144
|
+
### pageBridgePlugin
|
|
140
145
|
|
|
141
146
|
```typescript
|
|
142
|
-
interface
|
|
147
|
+
interface PageBridgePluginConfig {
|
|
143
148
|
// Document types that can be linked to snapshots and tasks
|
|
144
149
|
contentTypes: string[];
|
|
145
150
|
}
|
|
146
151
|
```
|
|
147
152
|
|
|
148
|
-
###
|
|
153
|
+
### createPageBridgeStructureResolver
|
|
149
154
|
|
|
150
155
|
```typescript
|
|
151
156
|
interface StructureResolverConfig {
|
|
@@ -163,16 +168,16 @@ import {
|
|
|
163
168
|
gscSite,
|
|
164
169
|
createGscSnapshot,
|
|
165
170
|
createGscRefreshTask,
|
|
166
|
-
} from
|
|
171
|
+
} from "@pagebridge/sanity/schemas";
|
|
167
172
|
|
|
168
173
|
// Create snapshot schema with custom content types
|
|
169
174
|
const customSnapshot = createGscSnapshot({
|
|
170
|
-
contentTypes: [
|
|
175
|
+
contentTypes: ["article", "guide"],
|
|
171
176
|
});
|
|
172
177
|
|
|
173
178
|
// Create task schema with custom content types
|
|
174
179
|
const customTask = createGscRefreshTask({
|
|
175
|
-
contentTypes: [
|
|
180
|
+
contentTypes: ["article", "guide"],
|
|
176
181
|
});
|
|
177
182
|
```
|
|
178
183
|
|
|
@@ -192,11 +197,17 @@ The components use Sanity UI and follow the Studio's theme. No additional CSS is
|
|
|
192
197
|
|
|
193
198
|
```typescript
|
|
194
199
|
// Plugin
|
|
195
|
-
export {
|
|
196
|
-
|
|
200
|
+
export {
|
|
201
|
+
pageBridgePlugin,
|
|
202
|
+
createPageBridgeStructureResolver,
|
|
203
|
+
} from "@pagebridge/sanity";
|
|
204
|
+
export type { PageBridgePluginConfig } from "@pagebridge/sanity";
|
|
197
205
|
|
|
198
206
|
// Components
|
|
199
|
-
export {
|
|
207
|
+
export {
|
|
208
|
+
SearchPerformancePane,
|
|
209
|
+
RefreshQueueTool,
|
|
210
|
+
} from "@pagebridge/sanity";
|
|
200
211
|
|
|
201
212
|
// Schemas
|
|
202
213
|
export {
|
|
@@ -205,8 +216,11 @@ export {
|
|
|
205
216
|
gscRefreshTask,
|
|
206
217
|
createGscSnapshot,
|
|
207
218
|
createGscRefreshTask,
|
|
208
|
-
} from
|
|
209
|
-
export type {
|
|
219
|
+
} from "@pagebridge/sanity/schemas";
|
|
220
|
+
export type {
|
|
221
|
+
GscSnapshotOptions,
|
|
222
|
+
GscRefreshTaskOptions,
|
|
223
|
+
} from "@pagebridge/sanity/schemas";
|
|
210
224
|
```
|
|
211
225
|
|
|
212
226
|
## License
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { pageBridgePlugin, createPageBridgeStructureResolver, createPageBridgeStructure, PAGEBRIDGE_TYPES, type PageBridgePluginConfig, } from "./plugin";
|
|
2
2
|
export { gscSite, gscSnapshot, gscRefreshTask, createGscSnapshot, createGscRefreshTask, type GscSnapshotOptions, type GscRefreshTaskOptions, } from "./schemas";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,iCAAiC,EACjC,yBAAyB,EACzB,gBAAgB,EAChB,KAAK,sBAAsB,GAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,OAAO,EACP,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,GAC3B,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Note: React components are not exported here to avoid loading them during schema extraction
|
|
2
2
|
// They are lazy-loaded within the plugin when needed
|
|
3
|
-
export {
|
|
3
|
+
export { pageBridgePlugin, createPageBridgeStructureResolver, createPageBridgeStructure, PAGEBRIDGE_TYPES, } from "./plugin";
|
|
4
4
|
export { gscSite, gscSnapshot, gscRefreshTask, createGscSnapshot, createGscRefreshTask, } from "./schemas";
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DefaultDocumentNodeResolver, StructureBuilder } from "sanity/structure";
|
|
2
|
-
export interface
|
|
2
|
+
export interface PageBridgePluginConfig {
|
|
3
3
|
/**
|
|
4
4
|
* Array of Sanity document type names that represent your content.
|
|
5
5
|
* These will be available for linking in gscSnapshot and gscRefreshTask schemas.
|
|
@@ -35,6 +35,6 @@ export declare const createPageBridgeStructure: (S: StructureBuilder) => import(
|
|
|
35
35
|
* Creates a structure resolver that adds the Performance view to content types
|
|
36
36
|
* Use this with structureTool's defaultDocumentNode option
|
|
37
37
|
*/
|
|
38
|
-
export declare const
|
|
39
|
-
export declare const
|
|
38
|
+
export declare const createPageBridgeStructureResolver: (contentTypes?: string[]) => DefaultDocumentNodeResolver;
|
|
39
|
+
export declare const pageBridgePlugin: import("sanity").Plugin<void | PageBridgePluginConfig>;
|
|
40
40
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,2BAA2B,EAC3B,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAO1B,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,8DAA8D;AAC9D,eAAO,MAAM,gBAAgB,uDAInB,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,GAAI,GAAG,gBAAgB,+CAqBxD,CAAC;AAEN;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAC5C,eAAc,MAAM,EAAO,KAC1B,2BAiBF,CAAC;AAEF,eAAO,MAAM,gBAAgB,wDAuB3B,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -53,7 +53,7 @@ export const createPageBridgeStructure = (S) => S.listItem()
|
|
|
53
53
|
* Creates a structure resolver that adds the Performance view to content types
|
|
54
54
|
* Use this with structureTool's defaultDocumentNode option
|
|
55
55
|
*/
|
|
56
|
-
export const
|
|
56
|
+
export const createPageBridgeStructureResolver = (contentTypes = []) => {
|
|
57
57
|
return (S, { schemaType }) => {
|
|
58
58
|
if (contentTypes.includes(schemaType)) {
|
|
59
59
|
// Lazy import to avoid loading React component during schema extraction
|
|
@@ -69,7 +69,7 @@ export const createGscStructureResolver = (contentTypes = []) => {
|
|
|
69
69
|
return S.document().views([S.view.form()]);
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
|
-
export const
|
|
72
|
+
export const pageBridgePlugin = definePlugin((config) => {
|
|
73
73
|
const contentTypes = config?.contentTypes ?? [];
|
|
74
74
|
const gscSnapshot = createGscSnapshot({ contentTypes });
|
|
75
75
|
const gscRefreshTask = createGscRefreshTask({ contentTypes });
|
package/package.json
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagebridge/sanity",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Sanity Studio plugin for PageBridge — performance pane, decay alerts, and refresh queue powered by Google Search Console data",
|
|
4
5
|
"license": "MIT",
|
|
5
6
|
"private": false,
|
|
6
7
|
"type": "module",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"pagebridge",
|
|
10
|
+
"sanity",
|
|
11
|
+
"sanity-plugin",
|
|
12
|
+
"sanity-studio",
|
|
13
|
+
"google-search-console",
|
|
14
|
+
"gsc",
|
|
15
|
+
"seo",
|
|
16
|
+
"content-decay",
|
|
17
|
+
"search-performance",
|
|
18
|
+
"cms",
|
|
19
|
+
"content-refresh"
|
|
20
|
+
],
|
|
7
21
|
"exports": {
|
|
8
22
|
".": {
|
|
9
23
|
"types": "./dist/index.d.ts",
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Note: React components are not exported here to avoid loading them during schema extraction
|
|
2
2
|
// They are lazy-loaded within the plugin when needed
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
pageBridgePlugin,
|
|
5
|
+
createPageBridgeStructureResolver,
|
|
6
6
|
createPageBridgeStructure,
|
|
7
7
|
PAGEBRIDGE_TYPES,
|
|
8
|
-
type
|
|
8
|
+
type PageBridgePluginConfig,
|
|
9
9
|
} from "./plugin";
|
|
10
10
|
export {
|
|
11
11
|
gscSite,
|
package/src/plugin.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { createGscSnapshot } from "./schemas/gscSnapshot";
|
|
|
9
9
|
import { createGscRefreshTask } from "./schemas/gscRefreshTask";
|
|
10
10
|
import type { ComponentType } from "react";
|
|
11
11
|
|
|
12
|
-
export interface
|
|
12
|
+
export interface PageBridgePluginConfig {
|
|
13
13
|
/**
|
|
14
14
|
* Array of Sanity document type names that represent your content.
|
|
15
15
|
* These will be available for linking in gscSnapshot and gscRefreshTask schemas.
|
|
@@ -73,7 +73,7 @@ export const createPageBridgeStructure = (S: StructureBuilder) =>
|
|
|
73
73
|
* Creates a structure resolver that adds the Performance view to content types
|
|
74
74
|
* Use this with structureTool's defaultDocumentNode option
|
|
75
75
|
*/
|
|
76
|
-
export const
|
|
76
|
+
export const createPageBridgeStructureResolver = (
|
|
77
77
|
contentTypes: string[] = [],
|
|
78
78
|
): DefaultDocumentNodeResolver => {
|
|
79
79
|
return (S, { schemaType }) => {
|
|
@@ -94,7 +94,7 @@ export const createGscStructureResolver = (
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
export const
|
|
97
|
+
export const pageBridgePlugin = definePlugin<PageBridgePluginConfig | void>((config) => {
|
|
98
98
|
const contentTypes = config?.contentTypes ?? [];
|
|
99
99
|
|
|
100
100
|
const gscSnapshot = createGscSnapshot({ contentTypes });
|