@orion-studios/payload-seo-audit 1.1.5-beta.0 → 1.2.0-beta.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/README.md +18 -111
- package/bin/init.js +10 -116
- package/dist/api/index.d.mts +86 -0
- package/dist/api/index.d.ts +86 -10
- package/dist/api/index.js +2474 -20
- package/dist/api/index.mjs +2365 -0
- package/dist/chunk-I5I2III2.mjs +135 -0
- package/dist/chunk-SOV7O2DU.mjs +26 -0
- package/dist/components.js +1758 -0
- package/dist/components.mjs +1753 -0
- package/dist/{config.d.ts → index.d.mts} +12 -4
- package/dist/index.d.ts +47 -6
- package/dist/index.js +1029 -35
- package/dist/index.mjs +890 -0
- package/dist/studio/index.d.mts +16 -0
- package/dist/studio/index.d.ts +16 -0
- package/dist/studio/index.js +50 -0
- package/dist/studio/index.mjs +6 -0
- package/dist/styles.css +2 -0
- package/package.json +48 -15
- package/dist/api/backlinks-import.d.ts +0 -4
- package/dist/api/backlinks-import.d.ts.map +0 -1
- package/dist/api/backlinks-import.js +0 -182
- package/dist/api/cron.d.ts +0 -4
- package/dist/api/cron.d.ts.map +0 -1
- package/dist/api/cron.js +0 -69
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/page-result.d.ts +0 -4
- package/dist/api/page-result.d.ts.map +0 -1
- package/dist/api/page-result.js +0 -93
- package/dist/api/page-results.d.ts +0 -4
- package/dist/api/page-results.d.ts.map +0 -1
- package/dist/api/page-results.js +0 -83
- package/dist/api/run-stream.d.ts +0 -4
- package/dist/api/run-stream.d.ts.map +0 -1
- package/dist/api/run-stream.js +0 -77
- package/dist/api/run.d.ts +0 -4
- package/dist/api/run.d.ts.map +0 -1
- package/dist/api/run.js +0 -81
- package/dist/api/snapshot-report.d.ts +0 -4
- package/dist/api/snapshot-report.d.ts.map +0 -1
- package/dist/api/snapshot-report.js +0 -130
- package/dist/api/snapshots.d.ts +0 -4
- package/dist/api/snapshots.d.ts.map +0 -1
- package/dist/api/snapshots.js +0 -138
- package/dist/api/trend.d.ts +0 -4
- package/dist/api/trend.d.ts.map +0 -1
- package/dist/api/trend.js +0 -71
- package/dist/collections/SeoAuthoritySnapshots.d.ts +0 -3
- package/dist/collections/SeoAuthoritySnapshots.d.ts.map +0 -1
- package/dist/collections/SeoAuthoritySnapshots.js +0 -83
- package/dist/collections/SeoDashboardViewCompat.d.ts +0 -3
- package/dist/collections/SeoDashboardViewCompat.d.ts.map +0 -1
- package/dist/collections/SeoDashboardViewCompat.js +0 -22
- package/dist/collections/SeoKeywordVisibility.d.ts +0 -3
- package/dist/collections/SeoKeywordVisibility.d.ts.map +0 -1
- package/dist/collections/SeoKeywordVisibility.js +0 -65
- package/dist/collections/SeoPageResults.d.ts +0 -3
- package/dist/collections/SeoPageResults.d.ts.map +0 -1
- package/dist/collections/SeoPageResults.js +0 -170
- package/dist/collections/SeoSnapshots.d.ts +0 -3
- package/dist/collections/SeoSnapshots.d.ts.map +0 -1
- package/dist/collections/SeoSnapshots.js +0 -157
- package/dist/components/hooks/useSeoApi.d.ts +0 -7
- package/dist/components/hooks/useSeoApi.d.ts.map +0 -1
- package/dist/components/hooks/useSeoApi.js +0 -31
- package/dist/components/hooks/useSeoPageResults.d.ts +0 -19
- package/dist/components/hooks/useSeoPageResults.d.ts.map +0 -1
- package/dist/components/hooks/useSeoPageResults.js +0 -62
- package/dist/components/hooks/useSeoSnapshot.d.ts +0 -8
- package/dist/components/hooks/useSeoSnapshot.d.ts.map +0 -1
- package/dist/components/hooks/useSeoSnapshot.js +0 -39
- package/dist/components/hooks/useSeoTrend.d.ts +0 -8
- package/dist/components/hooks/useSeoTrend.d.ts.map +0 -1
- package/dist/components/hooks/useSeoTrend.js +0 -38
- package/dist/components/layout/SeoReportHeader.d.ts +0 -10
- package/dist/components/layout/SeoReportHeader.d.ts.map +0 -1
- package/dist/components/layout/SeoReportHeader.js +0 -18
- package/dist/components/layout/SeoReportShell.d.ts +0 -9
- package/dist/components/layout/SeoReportShell.d.ts.map +0 -1
- package/dist/components/layout/SeoReportShell.js +0 -17
- package/dist/components/pdf/PdfDownloadButton.d.ts +0 -9
- package/dist/components/pdf/PdfDownloadButton.d.ts.map +0 -1
- package/dist/components/pdf/PdfDownloadButton.js +0 -80
- package/dist/components/tables/IssueTable.d.ts +0 -11
- package/dist/components/tables/IssueTable.d.ts.map +0 -1
- package/dist/components/tables/IssueTable.js +0 -121
- package/dist/components/tables/PageResultsTable.d.ts +0 -18
- package/dist/components/tables/PageResultsTable.d.ts.map +0 -1
- package/dist/components/tables/PageResultsTable.js +0 -96
- package/dist/components/types.d.ts +0 -117
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -22
- package/dist/components/utils/formatters.d.ts +0 -15
- package/dist/components/utils/formatters.d.ts.map +0 -1
- package/dist/components/utils/formatters.js +0 -98
- package/dist/components/utils/scoreHelpers.d.ts +0 -17
- package/dist/components/utils/scoreHelpers.d.ts.map +0 -1
- package/dist/components/utils/scoreHelpers.js +0 -139
- package/dist/components/views/SeoDashboard.d.ts +0 -3
- package/dist/components/views/SeoDashboard.d.ts.map +0 -1
- package/dist/components/views/SeoDashboard.js +0 -283
- package/dist/components/views/SeoPageReport.d.ts +0 -3
- package/dist/components/views/SeoPageReport.d.ts.map +0 -1
- package/dist/components/views/SeoPageReport.js +0 -245
- package/dist/components/views/SeoSnapshotReport.d.ts +0 -3
- package/dist/components/views/SeoSnapshotReport.d.ts.map +0 -1
- package/dist/components/views/SeoSnapshotReport.js +0 -235
- package/dist/components/visualization/CategoryScoreCard.d.ts +0 -11
- package/dist/components/visualization/CategoryScoreCard.d.ts.map +0 -1
- package/dist/components/visualization/CategoryScoreCard.js +0 -17
- package/dist/components/visualization/CategoryScoreGrid.d.ts +0 -9
- package/dist/components/visualization/CategoryScoreGrid.d.ts.map +0 -1
- package/dist/components/visualization/CategoryScoreGrid.js +0 -32
- package/dist/components/visualization/IssueCategoryChart.d.ts +0 -8
- package/dist/components/visualization/IssueCategoryChart.d.ts.map +0 -1
- package/dist/components/visualization/IssueCategoryChart.js +0 -47
- package/dist/components/visualization/MetricCard.d.ts +0 -11
- package/dist/components/visualization/MetricCard.d.ts.map +0 -1
- package/dist/components/visualization/MetricCard.js +0 -17
- package/dist/components/visualization/MetricCardRow.d.ts +0 -7
- package/dist/components/visualization/MetricCardRow.d.ts.map +0 -1
- package/dist/components/visualization/MetricCardRow.js +0 -12
- package/dist/components/visualization/ScoreBar.d.ts +0 -11
- package/dist/components/visualization/ScoreBar.d.ts.map +0 -1
- package/dist/components/visualization/ScoreBar.js +0 -34
- package/dist/components/visualization/ScoreGauge.d.ts +0 -11
- package/dist/components/visualization/ScoreGauge.d.ts.map +0 -1
- package/dist/components/visualization/ScoreGauge.js +0 -28
- package/dist/components/visualization/ScoreTrendChart.d.ts +0 -9
- package/dist/components/visualization/ScoreTrendChart.d.ts.map +0 -1
- package/dist/components/visualization/ScoreTrendChart.js +0 -43
- package/dist/components/visualization/SeverityBadge.d.ts +0 -8
- package/dist/components/visualization/SeverityBadge.d.ts.map +0 -1
- package/dist/components/visualization/SeverityBadge.js +0 -14
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -37
- package/dist/exports/components.d.ts +0 -4
- package/dist/exports/components.d.ts.map +0 -1
- package/dist/exports/components.js +0 -9
- package/dist/globals/SeoDashboard.d.ts +0 -3
- package/dist/globals/SeoDashboard.d.ts.map +0 -1
- package/dist/globals/SeoDashboard.js +0 -25
- package/dist/globals/SeoIntegrations.d.ts +0 -3
- package/dist/globals/SeoIntegrations.d.ts.map +0 -1
- package/dist/globals/SeoIntegrations.js +0 -305
- package/dist/index.d.ts.map +0 -1
- package/dist/utilities/access.d.ts +0 -8
- package/dist/utilities/access.d.ts.map +0 -1
- package/dist/utilities/access.js +0 -11
- package/dist/utilities/auth.d.ts +0 -7
- package/dist/utilities/auth.d.ts.map +0 -1
- package/dist/utilities/auth.js +0 -28
- package/dist/utilities/checks.d.ts +0 -3
- package/dist/utilities/checks.d.ts.map +0 -1
- package/dist/utilities/checks.js +0 -255
- package/dist/utilities/crawler.d.ts +0 -14
- package/dist/utilities/crawler.d.ts.map +0 -1
- package/dist/utilities/crawler.js +0 -152
- package/dist/utilities/crux.d.ts +0 -6
- package/dist/utilities/crux.d.ts.map +0 -1
- package/dist/utilities/crux.js +0 -244
- package/dist/utilities/dataforseo.d.ts +0 -12
- package/dist/utilities/dataforseo.d.ts.map +0 -1
- package/dist/utilities/dataforseo.js +0 -169
- package/dist/utilities/gsc.d.ts +0 -8
- package/dist/utilities/gsc.d.ts.map +0 -1
- package/dist/utilities/gsc.js +0 -105
- package/dist/utilities/helpers.d.ts +0 -7
- package/dist/utilities/helpers.d.ts.map +0 -1
- package/dist/utilities/helpers.js +0 -44
- package/dist/utilities/integrationSettings.d.ts +0 -10
- package/dist/utilities/integrationSettings.d.ts.map +0 -1
- package/dist/utilities/integrationSettings.js +0 -198
- package/dist/utilities/opsWebhook.d.ts +0 -15
- package/dist/utilities/opsWebhook.d.ts.map +0 -1
- package/dist/utilities/opsWebhook.js +0 -130
- package/dist/utilities/pagespeed.d.ts +0 -3
- package/dist/utilities/pagespeed.d.ts.map +0 -1
- package/dist/utilities/pagespeed.js +0 -55
- package/dist/utilities/providers.d.ts +0 -3
- package/dist/utilities/providers.d.ts.map +0 -1
- package/dist/utilities/providers.js +0 -23
- package/dist/utilities/runAudit.d.ts +0 -17
- package/dist/utilities/runAudit.d.ts.map +0 -1
- package/dist/utilities/runAudit.js +0 -325
- package/dist/utilities/scoring.d.ts +0 -3
- package/dist/utilities/scoring.d.ts.map +0 -1
- package/dist/utilities/scoring.js +0 -45
- package/dist/utilities/secrets.d.ts +0 -23
- package/dist/utilities/secrets.d.ts.map +0 -1
- package/dist/utilities/secrets.js +0 -108
- package/dist/utilities/triggers.d.ts +0 -3
- package/dist/utilities/triggers.d.ts.map +0 -1
- package/dist/utilities/triggers.js +0 -39
- package/dist/utilities/types.d.ts +0 -172
- package/dist/utilities/types.d.ts.map +0 -1
- package/dist/utilities/types.js +0 -2
package/README.md
CHANGED
|
@@ -1,130 +1,37 @@
|
|
|
1
1
|
# @orion-studios/payload-seo-audit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`payload-seo-audit` is the optional SEO add-on for Orion's studio-first website stack.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Start Here
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- 📊 **Visual Dashboard** - Admin UI with scores, trends, issues, and CrUX metrics
|
|
9
|
-
- 🎯 **Category Scoring** - Metadata, indexability, structure, links, media, structured data, performance
|
|
10
|
-
- 📈 **Trend Tracking** - Monitor SEO performance over time
|
|
11
|
-
- ⚡ **Performance Integrations** - Google PageSpeed + Chrome UX Report (CrUX)
|
|
12
|
-
- 🔎 **Search Visibility Sync** - Google Search Console keyword visibility imports
|
|
13
|
-
- 🔗 **Authority Snapshots** - DataForSEO authority/backlink snapshots with run policy controls
|
|
14
|
-
- 🔄 **Auto-Trigger** - Optionally run audits when content is published
|
|
15
|
-
- 🔐 **Encrypted Integration Settings** - Credentials managed in Payload admin (with env fallback)
|
|
16
|
-
- 📄 **PDF Export** - Download snapshot reports
|
|
7
|
+
Build the base site first:
|
|
17
8
|
|
|
18
|
-
|
|
9
|
+
- [Studio Website Setup Guide](../payload-studio/docs/studio-website-setup-guide.md)
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
Then layer SEO:
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
npm install @orion-studios/payload-seo-audit
|
|
24
|
-
```
|
|
13
|
+
- [SEO Studio Add-on Guide](./INTEGRATION.md)
|
|
25
14
|
|
|
26
|
-
|
|
15
|
+
## Install
|
|
27
16
|
|
|
28
17
|
```bash
|
|
29
|
-
|
|
30
|
-
npx payload-seo-audit init
|
|
31
|
-
|
|
32
|
-
# 2. Configure required environment variables (.env.local)
|
|
33
|
-
SEO_AUDIT_SECRET=<random-secret-key>
|
|
34
|
-
NEXT_PUBLIC_SERVER_URL=https://your-site.com
|
|
35
|
-
|
|
36
|
-
# 3. Add plugin to payload.config.ts (see below)
|
|
37
|
-
|
|
38
|
-
# 4. Generate types and start dev server
|
|
39
|
-
npx payload generate:types
|
|
40
|
-
npm run dev
|
|
18
|
+
npm install @orion-studios/payload-seo-audit
|
|
41
19
|
```
|
|
42
20
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Add to your `payload.config.ts`:
|
|
21
|
+
## Studio Integration
|
|
46
22
|
|
|
47
|
-
|
|
48
|
-
import { seoAuditPlugin } from '@orion-studios/payload-seo-audit'
|
|
23
|
+
Prefer the dedicated studio subpath:
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
seoAuditPlugin({
|
|
53
|
-
site: {
|
|
54
|
-
name: 'Your Site Name',
|
|
55
|
-
domain: 'www.yoursite.com',
|
|
56
|
-
canonicalHost: 'https://www.yoursite.com',
|
|
57
|
-
sitemapURL: 'https://www.yoursite.com/sitemap.xml',
|
|
58
|
-
keyURLs: ['https://www.yoursite.com', 'https://www.yoursite.com/about'],
|
|
59
|
-
},
|
|
60
|
-
crawl: {
|
|
61
|
-
maxPages: 120,
|
|
62
|
-
maxDepth: 2,
|
|
63
|
-
excludePatterns: ['/admin', '/api', '?preview='],
|
|
64
|
-
},
|
|
65
|
-
triggers: {
|
|
66
|
-
collections: ['posts', 'pages'],
|
|
67
|
-
globals: ['home'],
|
|
68
|
-
},
|
|
69
|
-
access: (user) => user?.role === 'admin',
|
|
70
|
-
integrations: {
|
|
71
|
-
enablePageSpeed: true,
|
|
72
|
-
enableSearchConsole: false,
|
|
73
|
-
enableCrUX: false,
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
],
|
|
77
|
-
})
|
|
25
|
+
```ts
|
|
26
|
+
import { createSeoStudioExtension } from '@orion-studios/payload-seo-audit/studio'
|
|
78
27
|
```
|
|
79
28
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
After startup, open:
|
|
83
|
-
|
|
84
|
-
- `/admin/globals/seo-integrations`
|
|
85
|
-
|
|
86
|
-
From there you can securely configure:
|
|
29
|
+
## Styling Contract
|
|
87
30
|
|
|
88
|
-
|
|
89
|
-
- PageSpeed API key
|
|
90
|
-
- CrUX API key and query scope
|
|
91
|
-
- DataForSEO credentials + run policy
|
|
92
|
-
- Private operator webhook settings
|
|
31
|
+
Import the package CSS once in your admin-facing layout or bundle entry:
|
|
93
32
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
1. Visit `/admin/globals/seo-dashboard`
|
|
99
|
-
2. Click **Run Audit Now**
|
|
100
|
-
3. Review scores, issues, trends, and CrUX field data
|
|
101
|
-
4. Open snapshots for detailed reports and exports
|
|
102
|
-
|
|
103
|
-
## Environment Variable Fallbacks
|
|
104
|
-
|
|
105
|
-
If `seo-integrations` is not configured yet, these env vars are used as fallback:
|
|
106
|
-
|
|
107
|
-
- `SEO_GSC_CLIENT_ID`
|
|
108
|
-
- `SEO_GSC_CLIENT_SECRET`
|
|
109
|
-
- `SEO_GSC_REDIRECT_URI`
|
|
110
|
-
- `SEO_GSC_REFRESH_TOKEN`
|
|
111
|
-
- `GOOGLE_SERVICE_ACCOUNT_EMAIL`
|
|
112
|
-
- `GOOGLE_SERVICE_ACCOUNT_PRIVATE_KEY`
|
|
113
|
-
- `SEO_PAGESPEED_API_KEY`
|
|
114
|
-
- `SEO_CRUX_API_KEY`
|
|
115
|
-
- `SEO_DATAFORSEO_LOGIN`
|
|
116
|
-
- `SEO_DATAFORSEO_PASSWORD`
|
|
117
|
-
- `SEO_DATAFORSEO_BASE_URL`
|
|
118
|
-
|
|
119
|
-
## Documentation
|
|
120
|
-
|
|
121
|
-
- **[Integration Guide](./INTEGRATION.md)** - Full setup and troubleshooting
|
|
122
|
-
- **[Troubleshooting](./INTEGRATION.md#troubleshooting)** - Common issues and fixes
|
|
123
|
-
|
|
124
|
-
## License
|
|
125
|
-
|
|
126
|
-
MIT License
|
|
127
|
-
|
|
128
|
-
## Author
|
|
33
|
+
```ts
|
|
34
|
+
import '@orion-studios/payload-seo-audit/styles.css'
|
|
35
|
+
```
|
|
129
36
|
|
|
130
|
-
|
|
37
|
+
This package now ships its own compiled styles and no longer requires consumer Tailwind scanning or `tailwind.config` edits.
|
package/bin/init.js
CHANGED
|
@@ -15,8 +15,6 @@ const ROUTES = [
|
|
|
15
15
|
{ path: 'backlinks/import/route.ts', method: 'POST', handler: 'handleSeoBacklinksImport' },
|
|
16
16
|
]
|
|
17
17
|
|
|
18
|
-
const PLUGIN_PATH = './node_modules/@orion-studios/payload-seo-audit/dist/**/*.js'
|
|
19
|
-
|
|
20
18
|
console.log('🔧 SEO Audit Plugin Setup\n')
|
|
21
19
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n')
|
|
22
20
|
|
|
@@ -39,103 +37,14 @@ function findApiDirectory() {
|
|
|
39
37
|
return path.join(cwd, 'src/app/api')
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
// Find Tailwind config file
|
|
43
|
-
function findTailwindConfig() {
|
|
44
|
-
const cwd = process.cwd()
|
|
45
|
-
const possibleConfigs = [
|
|
46
|
-
path.join(cwd, 'tailwind.config.ts'),
|
|
47
|
-
path.join(cwd, 'tailwind.config.js'),
|
|
48
|
-
path.join(cwd, 'tailwind.config.mjs'),
|
|
49
|
-
]
|
|
50
|
-
|
|
51
|
-
for (const configPath of possibleConfigs) {
|
|
52
|
-
if (fs.existsSync(configPath)) {
|
|
53
|
-
return configPath
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return null
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Update Tailwind config to include plugin path
|
|
61
|
-
function updateTailwindConfig(configPath) {
|
|
62
|
-
try {
|
|
63
|
-
let content = fs.readFileSync(configPath, 'utf-8')
|
|
64
|
-
let updated = false
|
|
65
|
-
|
|
66
|
-
// Check if plugin path already exists
|
|
67
|
-
if (content.includes(PLUGIN_PATH)) {
|
|
68
|
-
console.log('✓ Tailwind config already includes plugin path')
|
|
69
|
-
} else {
|
|
70
|
-
// Find the content array and add the plugin path
|
|
71
|
-
const contentArrayRegex = /content\s*:\s*\[([^\]]*)\]/s
|
|
72
|
-
const match = content.match(contentArrayRegex)
|
|
73
|
-
|
|
74
|
-
if (!match) {
|
|
75
|
-
console.log('⚠️ Could not find content array in Tailwind config')
|
|
76
|
-
console.log(' Please manually add to tailwind.config.ts:')
|
|
77
|
-
console.log(` content: [..., '${PLUGIN_PATH}']`)
|
|
78
|
-
return false
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Extract existing content array items
|
|
82
|
-
const existingContent = match[1].trim()
|
|
83
|
-
|
|
84
|
-
// Add plugin path to the end
|
|
85
|
-
const newContent = existingContent
|
|
86
|
-
? `${existingContent},\n '${PLUGIN_PATH}',`
|
|
87
|
-
: `'${PLUGIN_PATH}',`
|
|
88
|
-
|
|
89
|
-
// Replace the content array
|
|
90
|
-
content = content.replace(
|
|
91
|
-
contentArrayRegex,
|
|
92
|
-
`content: [\n ${newContent}\n ]`
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
updated = true
|
|
96
|
-
console.log('✓ Updated Tailwind config with plugin path')
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Check darkMode configuration
|
|
100
|
-
const hasDarkModeConfig = content.match(/darkMode\s*:\s*\[['"]selector['"]\s*,\s*['"]\[data-theme="dark"\]['"]\]/)
|
|
101
|
-
|
|
102
|
-
if (!hasDarkModeConfig) {
|
|
103
|
-
console.log('⚠️ Dark mode configuration may be incorrect')
|
|
104
|
-
console.log(' For proper dark mode support, your tailwind.config should have:')
|
|
105
|
-
console.log(` darkMode: ['selector', '[data-theme="dark"]'],`)
|
|
106
|
-
console.log('')
|
|
107
|
-
console.log(' This ensures compatibility with both your frontend and Payload admin.')
|
|
108
|
-
console.log(' See INTEGRATION.md for more details.')
|
|
109
|
-
updated = true // Flag that manual review is needed
|
|
110
|
-
} else {
|
|
111
|
-
console.log('✓ Dark mode configuration is correct')
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Write back to file if updated
|
|
115
|
-
if (updated && content !== fs.readFileSync(configPath, 'utf-8')) {
|
|
116
|
-
fs.writeFileSync(configPath, content)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return true
|
|
120
|
-
|
|
121
|
-
} catch (error) {
|
|
122
|
-
console.log('⚠️ Error updating Tailwind config:', error.message)
|
|
123
|
-
console.log(' Please manually add to tailwind.config.ts:')
|
|
124
|
-
console.log(` content: [..., '${PLUGIN_PATH}']`)
|
|
125
|
-
console.log(` darkMode: ['selector', '[data-theme="dark"]'],`)
|
|
126
|
-
return false
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
40
|
// Generate route template
|
|
131
41
|
function generateRouteTemplate(route) {
|
|
132
42
|
return `import { NextRequest } from 'next/server'
|
|
133
|
-
import {
|
|
43
|
+
import { getPayloadClient } from '@/lib/payload'
|
|
134
44
|
import { ${route.handler} } from '@orion-studios/payload-seo-audit/api'
|
|
135
45
|
|
|
136
46
|
export async function ${route.method}(request: NextRequest) {
|
|
137
|
-
const payload = await
|
|
138
|
-
// @ts-expect-error - Peer dependency type mismatch between plugin and parent payload
|
|
47
|
+
const payload = await getPayloadClient()
|
|
139
48
|
return ${route.handler}(payload, request)
|
|
140
49
|
}
|
|
141
50
|
`
|
|
@@ -197,26 +106,8 @@ try {
|
|
|
197
106
|
console.log(` ℹ Skipped ${skippedCount} existing route${skippedCount !== 1 ? 's' : ''}`)
|
|
198
107
|
}
|
|
199
108
|
|
|
200
|
-
// Step 2:
|
|
201
|
-
console.log('\nStep 2:
|
|
202
|
-
|
|
203
|
-
const tailwindConfigPath = findTailwindConfig()
|
|
204
|
-
|
|
205
|
-
if (tailwindConfigPath) {
|
|
206
|
-
console.log(` 📄 Found: ${path.basename(tailwindConfigPath)}`)
|
|
207
|
-
const updated = updateTailwindConfig(tailwindConfigPath)
|
|
208
|
-
|
|
209
|
-
if (!updated) {
|
|
210
|
-
console.log('\n ⚠️ IMPORTANT: Dark mode styles will NOT work without this!')
|
|
211
|
-
}
|
|
212
|
-
} else {
|
|
213
|
-
console.log(' ⚠️ No Tailwind config found')
|
|
214
|
-
console.log(' If using Tailwind, manually add:')
|
|
215
|
-
console.log(` content: [..., '${PLUGIN_PATH}']`)
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Step 3: Check environment setup
|
|
219
|
-
console.log('\nStep 3: Environment variable check\n')
|
|
109
|
+
// Step 2: Check environment setup
|
|
110
|
+
console.log('\nStep 2: Environment variable check\n')
|
|
220
111
|
|
|
221
112
|
const { hasSecret, hasServerUrl } = checkEnvironmentSetup()
|
|
222
113
|
|
|
@@ -252,9 +143,12 @@ try {
|
|
|
252
143
|
}
|
|
253
144
|
|
|
254
145
|
console.log(` ${!hasSecret || !hasServerUrl ? '2' : '1'}. Configure the plugin in payload.config.ts`)
|
|
255
|
-
console.log(` ${!hasSecret || !hasServerUrl ? '3' : '2'}.
|
|
256
|
-
console.log(` ${!hasSecret || !hasServerUrl ? '4' : '3'}.
|
|
257
|
-
console.log(` ${!hasSecret || !hasServerUrl ? '5' : '4'}.
|
|
146
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '3' : '2'}. Register createSeoStudioExtension() from @orion-studios/payload-seo-audit/studio if you use the custom Studio nav`)
|
|
147
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '4' : '3'}. Import @orion-studios/payload-seo-audit/styles.css in your admin-facing layout`)
|
|
148
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '5' : '4'}. Ensure src/lib/payload.ts exports getPayloadClient()`)
|
|
149
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '6' : '5'}. Run: npx payload generate:types`)
|
|
150
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '7' : '6'}. Start dev server: npm run dev`)
|
|
151
|
+
console.log(` ${!hasSecret || !hasServerUrl ? '8' : '7'}. Visit: /admin/globals/seo-dashboard`)
|
|
258
152
|
|
|
259
153
|
console.log('\n💡 Documentation: See INTEGRATION.md for detailed setup guide')
|
|
260
154
|
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n')
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Payload } from 'payload';
|
|
2
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
3
|
+
|
|
4
|
+
declare function handleSeoRun(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
5
|
+
|
|
6
|
+
declare function handleSeoRunStream(payload: Payload, request: NextRequest): Promise<Response>;
|
|
7
|
+
|
|
8
|
+
declare function handleSeoSnapshots(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
9
|
+
|
|
10
|
+
declare function handleSeoSnapshotReport(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
11
|
+
|
|
12
|
+
declare function handleSeoPageResults(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
13
|
+
|
|
14
|
+
declare function handleSeoPageResult(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
15
|
+
|
|
16
|
+
declare function handleSeoTrend(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
17
|
+
|
|
18
|
+
declare function handleSeoCron(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
19
|
+
|
|
20
|
+
declare function handleSeoBacklinksImport(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
21
|
+
|
|
22
|
+
type SEOIssueSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
23
|
+
type SEOPageScore = {
|
|
24
|
+
metadata: number;
|
|
25
|
+
indexability: number;
|
|
26
|
+
structure: number;
|
|
27
|
+
links: number;
|
|
28
|
+
media: number;
|
|
29
|
+
structuredData: number;
|
|
30
|
+
performance: number;
|
|
31
|
+
overall: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type SeoApiErrorResponse = {
|
|
35
|
+
error: string;
|
|
36
|
+
};
|
|
37
|
+
type SeoRunResponse = {
|
|
38
|
+
completedAt: string;
|
|
39
|
+
issueCounts: Record<SEOIssueSeverity, number>;
|
|
40
|
+
overallScore: number;
|
|
41
|
+
pagesChecked: number;
|
|
42
|
+
snapshotID: number | string;
|
|
43
|
+
status: 'completed';
|
|
44
|
+
success: true;
|
|
45
|
+
};
|
|
46
|
+
type SeoSnapshotsResponse = {
|
|
47
|
+
latestIssues: Array<{
|
|
48
|
+
message?: string;
|
|
49
|
+
recommendation?: string;
|
|
50
|
+
severity?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
}>;
|
|
53
|
+
snapshots: Array<Record<string, unknown>>;
|
|
54
|
+
};
|
|
55
|
+
type SeoTrendResponse = {
|
|
56
|
+
points: Array<{
|
|
57
|
+
issueCounts: Record<string, unknown>;
|
|
58
|
+
metrics: Record<string, unknown>;
|
|
59
|
+
runLabel: string;
|
|
60
|
+
scores: Partial<SEOPageScore>;
|
|
61
|
+
snapshotId: number | string;
|
|
62
|
+
startedAt: string;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
type SeoPageResultsResponse = {
|
|
66
|
+
docs: Array<Record<string, unknown>>;
|
|
67
|
+
hasNextPage?: boolean;
|
|
68
|
+
hasPrevPage?: boolean;
|
|
69
|
+
limit?: number;
|
|
70
|
+
nextPage?: number | null;
|
|
71
|
+
page?: number;
|
|
72
|
+
prevPage?: number | null;
|
|
73
|
+
totalDocs?: number;
|
|
74
|
+
totalPages?: number;
|
|
75
|
+
};
|
|
76
|
+
type SeoPageResultResponse = Record<string, unknown>;
|
|
77
|
+
type SeoSnapshotReportResponse = Record<string, unknown>;
|
|
78
|
+
type SeoCronResponse = {
|
|
79
|
+
runType: string;
|
|
80
|
+
success: true;
|
|
81
|
+
} & Record<string, unknown>;
|
|
82
|
+
type SeoBacklinksImportResponse = {
|
|
83
|
+
success: true;
|
|
84
|
+
} & Record<string, unknown>;
|
|
85
|
+
|
|
86
|
+
export { type SeoApiErrorResponse, type SeoBacklinksImportResponse, type SeoCronResponse, type SeoPageResultResponse, type SeoPageResultsResponse, type SeoRunResponse, type SeoSnapshotReportResponse, type SeoSnapshotsResponse, type SeoTrendResponse, handleSeoBacklinksImport, handleSeoCron, handleSeoPageResult, handleSeoPageResults, handleSeoRun, handleSeoRunStream, handleSeoSnapshotReport, handleSeoSnapshots, handleSeoTrend };
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,10 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Payload } from 'payload';
|
|
2
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
3
|
+
|
|
4
|
+
declare function handleSeoRun(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
5
|
+
|
|
6
|
+
declare function handleSeoRunStream(payload: Payload, request: NextRequest): Promise<Response>;
|
|
7
|
+
|
|
8
|
+
declare function handleSeoSnapshots(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
9
|
+
|
|
10
|
+
declare function handleSeoSnapshotReport(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
11
|
+
|
|
12
|
+
declare function handleSeoPageResults(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
13
|
+
|
|
14
|
+
declare function handleSeoPageResult(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
15
|
+
|
|
16
|
+
declare function handleSeoTrend(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
17
|
+
|
|
18
|
+
declare function handleSeoCron(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
19
|
+
|
|
20
|
+
declare function handleSeoBacklinksImport(payload: Payload, request: NextRequest): Promise<NextResponse>;
|
|
21
|
+
|
|
22
|
+
type SEOIssueSeverity = 'critical' | 'high' | 'medium' | 'low' | 'info';
|
|
23
|
+
type SEOPageScore = {
|
|
24
|
+
metadata: number;
|
|
25
|
+
indexability: number;
|
|
26
|
+
structure: number;
|
|
27
|
+
links: number;
|
|
28
|
+
media: number;
|
|
29
|
+
structuredData: number;
|
|
30
|
+
performance: number;
|
|
31
|
+
overall: number;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type SeoApiErrorResponse = {
|
|
35
|
+
error: string;
|
|
36
|
+
};
|
|
37
|
+
type SeoRunResponse = {
|
|
38
|
+
completedAt: string;
|
|
39
|
+
issueCounts: Record<SEOIssueSeverity, number>;
|
|
40
|
+
overallScore: number;
|
|
41
|
+
pagesChecked: number;
|
|
42
|
+
snapshotID: number | string;
|
|
43
|
+
status: 'completed';
|
|
44
|
+
success: true;
|
|
45
|
+
};
|
|
46
|
+
type SeoSnapshotsResponse = {
|
|
47
|
+
latestIssues: Array<{
|
|
48
|
+
message?: string;
|
|
49
|
+
recommendation?: string;
|
|
50
|
+
severity?: string;
|
|
51
|
+
url?: string;
|
|
52
|
+
}>;
|
|
53
|
+
snapshots: Array<Record<string, unknown>>;
|
|
54
|
+
};
|
|
55
|
+
type SeoTrendResponse = {
|
|
56
|
+
points: Array<{
|
|
57
|
+
issueCounts: Record<string, unknown>;
|
|
58
|
+
metrics: Record<string, unknown>;
|
|
59
|
+
runLabel: string;
|
|
60
|
+
scores: Partial<SEOPageScore>;
|
|
61
|
+
snapshotId: number | string;
|
|
62
|
+
startedAt: string;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
type SeoPageResultsResponse = {
|
|
66
|
+
docs: Array<Record<string, unknown>>;
|
|
67
|
+
hasNextPage?: boolean;
|
|
68
|
+
hasPrevPage?: boolean;
|
|
69
|
+
limit?: number;
|
|
70
|
+
nextPage?: number | null;
|
|
71
|
+
page?: number;
|
|
72
|
+
prevPage?: number | null;
|
|
73
|
+
totalDocs?: number;
|
|
74
|
+
totalPages?: number;
|
|
75
|
+
};
|
|
76
|
+
type SeoPageResultResponse = Record<string, unknown>;
|
|
77
|
+
type SeoSnapshotReportResponse = Record<string, unknown>;
|
|
78
|
+
type SeoCronResponse = {
|
|
79
|
+
runType: string;
|
|
80
|
+
success: true;
|
|
81
|
+
} & Record<string, unknown>;
|
|
82
|
+
type SeoBacklinksImportResponse = {
|
|
83
|
+
success: true;
|
|
84
|
+
} & Record<string, unknown>;
|
|
85
|
+
|
|
86
|
+
export { type SeoApiErrorResponse, type SeoBacklinksImportResponse, type SeoCronResponse, type SeoPageResultResponse, type SeoPageResultsResponse, type SeoRunResponse, type SeoSnapshotReportResponse, type SeoSnapshotsResponse, type SeoTrendResponse, handleSeoBacklinksImport, handleSeoCron, handleSeoPageResult, handleSeoPageResults, handleSeoRun, handleSeoRunStream, handleSeoSnapshotReport, handleSeoSnapshots, handleSeoTrend };
|