paul-geo-nextjs 0.0.0-stage → 4.14.3

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.
Files changed (70) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +119 -2
  3. package/dist/chunks/analyzer-ImP-Y4kH.mjs +9253 -0
  4. package/dist/chunks/core-D9OdDVSS.mjs +21 -0
  5. package/dist/chunks/labels-NdfRLYOE.mjs +46 -0
  6. package/dist/client.d.mts +1 -0
  7. package/dist/client.mjs +1106 -0
  8. package/dist/index.d.mts +1 -0
  9. package/dist/index.mjs +15 -0
  10. package/dist/server.d.mts +1 -0
  11. package/dist/server.mjs +83 -0
  12. package/dist/types/lib/index.d.ts +30 -0
  13. package/dist/types/packages/nextjs/src/client/cn.d.ts +1 -0
  14. package/dist/types/packages/nextjs/src/client/geo-action.d.ts +7 -0
  15. package/dist/types/packages/nextjs/src/client/geo-category-card.d.ts +8 -0
  16. package/dist/types/packages/nextjs/src/client/geo-crawler-view.d.ts +6 -0
  17. package/dist/types/packages/nextjs/src/client/geo-criterion.d.ts +13 -0
  18. package/dist/types/packages/nextjs/src/client/geo-heading-outline.d.ts +6 -0
  19. package/dist/types/packages/nextjs/src/client/geo-labels.d.ts +45 -0
  20. package/dist/types/packages/nextjs/src/client/geo-panel.d.ts +9 -0
  21. package/dist/types/packages/nextjs/src/client/geo-recommendation-item.d.ts +8 -0
  22. package/dist/types/packages/nextjs/src/client/geo-recommendations.d.ts +6 -0
  23. package/dist/types/packages/nextjs/src/client/geo-score.d.ts +9 -0
  24. package/dist/types/packages/nextjs/src/client/geo-traffic-light.d.ts +6 -0
  25. package/dist/types/packages/nextjs/src/client/index.d.ts +3 -0
  26. package/dist/types/packages/nextjs/src/client/use-geo-analysis.d.ts +49 -0
  27. package/dist/types/packages/nextjs/src/core.d.ts +1 -0
  28. package/dist/types/packages/nextjs/src/index.d.ts +29 -0
  29. package/dist/types/packages/nextjs/src/server/bot-probe.d.ts +16 -0
  30. package/dist/types/packages/nextjs/src/server/index.d.ts +2 -0
  31. package/dist/types/packages/nextjs/src/styles.d.ts +2 -0
  32. package/dist/types/src/analyzers/ai-citation.d.ts +15 -0
  33. package/dist/types/src/analyzers/answerability.d.ts +18 -0
  34. package/dist/types/src/analyzers/base.d.ts +34 -0
  35. package/dist/types/src/analyzers/clarity-evidence.d.ts +18 -0
  36. package/dist/types/src/analyzers/content-clarity.d.ts +12 -0
  37. package/dist/types/src/analyzers/index.d.ts +14 -0
  38. package/dist/types/src/analyzers/machine-readability.d.ts +37 -0
  39. package/dist/types/src/analyzers/on-page-seo.d.ts +18 -0
  40. package/dist/types/src/analyzers/trust-evidence.d.ts +17 -0
  41. package/dist/types/src/analyzers/trust-sources.d.ts +7 -0
  42. package/dist/types/src/config/geo-config.d.ts +229 -0
  43. package/dist/types/src/i18n/report/ai-citation.d.ts +2 -0
  44. package/dist/types/src/i18n/report/answerability.d.ts +2 -0
  45. package/dist/types/src/i18n/report/content-clarity.d.ts +2 -0
  46. package/dist/types/src/i18n/report/machine-readability.d.ts +2 -0
  47. package/dist/types/src/i18n/report/on-page-seo.d.ts +2 -0
  48. package/dist/types/src/i18n/report/trust-sources.d.ts +2 -0
  49. package/dist/types/src/types/analysis.d.ts +302 -0
  50. package/dist/types/src/utils/analysis-mapper.d.ts +7 -0
  51. package/dist/types/src/utils/bot-access.d.ts +10 -0
  52. package/dist/types/src/utils/content-hash.d.ts +1 -0
  53. package/dist/types/src/utils/crawler-view.d.ts +11 -0
  54. package/dist/types/src/utils/dom-helpers.d.ts +86 -0
  55. package/dist/types/src/utils/fix-snippets.d.ts +14 -0
  56. package/dist/types/src/utils/highlight-targets.d.ts +3 -0
  57. package/dist/types/src/utils/highlight.d.ts +5 -0
  58. package/dist/types/src/utils/i18n.d.ts +9 -0
  59. package/dist/types/src/utils/page-type.d.ts +4 -0
  60. package/dist/types/src/utils/readability.d.ts +91 -0
  61. package/dist/types/src/utils/recommendations.d.ts +13 -0
  62. package/dist/types/src/utils/schema-types.d.ts +4 -0
  63. package/dist/types/src/utils/scoring.d.ts +5 -0
  64. package/dist/types/src/utils/selector.d.ts +1 -0
  65. package/dist/types/src/utils/sitemap-check.d.ts +11 -0
  66. package/dist/types/src/utils/source-links.d.ts +15 -0
  67. package/dist/types/src/utils/text-dates.d.ts +17 -0
  68. package/dist/types/src/utils/visible-questions.d.ts +5 -0
  69. package/dist/types/src/utils/x-robots-tag.d.ts +5 -0
  70. package/package.json +66 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Michael Mauch
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,120 @@
1
- # Temporary Holding Version
1
+ # paul-geo-nextjs
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A button for the editor toolbar of a Next.js site that checks how well AI search systems (ChatGPT, Perplexity, Google AI Overviews, Claude) can read and cite the current page. A traffic light on the button shows the result at a glance. A click opens the full analysis: six categories, the criteria behind each score, recommendations, and markers on the page itself.
4
+
5
+ The rules are the same as in the [Paul AI GEO Analyzer](https://geo.mauch.rocks) browser extension, and the package carries the extension's version number. A rule update is a package update.
6
+
7
+ - No Tailwind or other CSS setup needed: the styles are prebuilt, scoped and prefixed with `geo:`.
8
+ - No external service: the analysis runs in the browser on the rendered page. Apart from the page itself, it only requests files of your own site (`robots.txt`, sitemap, `llms.txt`) and, if you set it up, your own bot probe route.
9
+ - Texts in German, French, Italian and English.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install paul-geo-nextjs
15
+ ```
16
+
17
+ Requires Next.js 15 or later and React 19.
18
+
19
+ ## Usage
20
+
21
+ ### Add the button
22
+
23
+ `GeoAction` is a client component. Render it wherever your editors see their tools, and only for signed-in editors:
24
+
25
+ ```tsx
26
+ // components/editor-toolbar.tsx
27
+ import { GeoAction } from 'paul-geo-nextjs/client';
28
+
29
+ export function EditorToolbar({ locale, changed, published }) {
30
+ return (
31
+ <div className="toolbar">
32
+ {/* … your other editor tools … */}
33
+ <GeoAction
34
+ editorLocale={locale} // de | fr | it | en
35
+ contentVersion={changed} // analyze again after a save
36
+ published={published} // false: skip checks that need the public page
37
+ />
38
+ </div>
39
+ );
40
+ }
41
+ ```
42
+
43
+ ### With NodeHive Smart Actions
44
+
45
+ For the NodeHive editor toolbar, `geoSmartAction()` returns the button as a smart action. It is safe to call in a server component:
46
+
47
+ ```tsx
48
+ // smart-actions.tsx (server component)
49
+ import { insertAfter, SmartActionsButton } from '@nodehive/nextjs/smart-actions/server';
50
+ import { geoSmartAction } from 'paul-geo-nextjs';
51
+
52
+ <SmartActionsButton
53
+ actions={(defaults) =>
54
+ insertAfter(
55
+ defaults,
56
+ 'backend-edit',
57
+ geoSmartAction({
58
+ editorLocale,
59
+ contentVersion: entity?.data?.changed,
60
+ published: entity?.data?.status !== false,
61
+ })
62
+ )
63
+ }
64
+ />
65
+ ```
66
+
67
+ The package does not depend on NodeHive. `geoSmartAction()` only builds an object of the shape `{ id, label, Component, props }`, so it fits any toolbar that takes actions in that form.
68
+
69
+ ### Bot probe (optional)
70
+
71
+ The bot probe checks whether your firewall or CDN lets AI crawlers through. A browser cannot send a crawler user agent, so a route on your server does it:
72
+
73
+ ```ts
74
+ // app/api/geo/bot-probe/route.ts
75
+ import { createBotProbeHandler } from 'paul-geo-nextjs/server';
76
+ import { getUser } from '@/lib/auth';
77
+
78
+ export const dynamic = 'force-dynamic';
79
+
80
+ export const GET = createBotProbeHandler({
81
+ origin: () => process.env.NEXT_PUBLIC_SITE_URL,
82
+ isAuthorized: async () => Boolean(await getUser()),
83
+ });
84
+ ```
85
+
86
+ The route only fetches paths of your own site and only for authorized users. The four crawler requests run in parallel with a 10 s timeout. A result is reused for 60 s per path; "Analyze again" bypasses this cache.
87
+
88
+ Without the route, set `probeEndpoint={null}` and the firewall check is left out.
89
+
90
+ ## Options
91
+
92
+ | Option | Default | |
93
+ | --- | --- | --- |
94
+ | `editorLocale` | – | Language of the texts: `de`, `fr`, `it`, `en`; anything else falls back to `de` |
95
+ | `contentVersion` | – | When the value changes, the page is analyzed again (e.g. the last-changed date) |
96
+ | `published` | `true` | `false` skips the crawler view, bot probe, sitemap and indexing checks |
97
+ | `probeEndpoint` | `/api/geo/bot-probe` | Route of the bot probe; `null` turns it off |
98
+ | `signedInView` | `true` | Read the robots directives from an anonymous request, because editors often see a `noindex` view |
99
+ | `ignoreSelector` | – | CSS selector for more of your own UI that is not page content |
100
+ | `id`, `label` | `geo-analysis`, localized title | `geoSmartAction()` only |
101
+
102
+ `createBotProbeHandler()` also takes `timeoutMs` (default 10 000) and `cacheTtlMs` (default 60 000).
103
+
104
+ ## Versioning
105
+
106
+ The package version is the extension's version. Scores can change between versions when a rule is added or corrected, so pin the version if you compare results over time.
107
+
108
+ ## Release
109
+
110
+ From the root of the extension repository:
111
+
112
+ ```bash
113
+ npm version <patch|minor|major> # extension version = package version
114
+ cd packages/nextjs
115
+ npm publish # type-checks, tests, builds and publishes
116
+ ```
117
+
118
+ ## License
119
+
120
+ MIT