@geenius/seo 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/.changeset/config.json +11 -0
- package/.github/CODEOWNERS +1 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +16 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +11 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +10 -0
- package/.github/dependabot.yml +11 -0
- package/.github/workflows/ci.yml +23 -0
- package/.github/workflows/release.yml +29 -0
- package/.nvmrc +1 -0
- package/.project/ACCOUNT.yaml +4 -0
- package/.project/IDEAS.yaml +7 -0
- package/.project/PROJECT.yaml +11 -0
- package/.project/ROADMAP.yaml +15 -0
- package/CHANGELOG.md +8 -0
- package/CODE_OF_CONDUCT.md +16 -0
- package/CONTRIBUTING.md +26 -0
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/SECURITY.md +15 -0
- package/SUPPORT.md +8 -0
- package/package.json +75 -0
- package/packages/convex/package.json +42 -0
- package/packages/convex/src/functions.ts +5 -0
- package/packages/convex/src/mutations.ts +83 -0
- package/packages/convex/src/queries.ts +57 -0
- package/packages/convex/src/schema.ts +23 -0
- package/packages/convex/tsconfig.json +19 -0
- package/packages/convex/tsup.config.ts +18 -0
- package/packages/react/README.md +1 -0
- package/packages/react/package.json +49 -0
- package/packages/react/src/components/ArticleJsonLd.tsx +42 -0
- package/packages/react/src/components/BreadcrumbsJsonLd.tsx +24 -0
- package/packages/react/src/components/MetaEditor.tsx +147 -0
- package/packages/react/src/components/SEOHead.tsx +107 -0
- package/packages/react/src/components/SEOPreview.tsx +42 -0
- package/packages/react/src/components/SEOScoreCard.tsx +51 -0
- package/packages/react/src/components/SitemapViewer.tsx +36 -0
- package/packages/react/src/components/index.ts +7 -0
- package/packages/react/src/hooks/index.ts +4 -0
- package/packages/react/src/hooks/useSEO.ts +27 -0
- package/packages/react/src/hooks/useSEOAdmin.ts +42 -0
- package/packages/react/src/hooks/useSEOScore.ts +7 -0
- package/packages/react/src/hooks/useSitemap.ts +8 -0
- package/packages/react/src/index.ts +51 -0
- package/packages/react/src/index.tsx +11 -0
- package/packages/react/src/pages/SEOAdminPage.tsx +101 -0
- package/packages/react/src/pages/SEOAnalyticsPage.tsx +96 -0
- package/packages/react/src/pages/index.ts +2 -0
- package/packages/react/tsconfig.json +19 -0
- package/packages/react/tsup.config.ts +12 -0
- package/packages/react-css/README.md +1 -0
- package/packages/react-css/package.json +36 -0
- package/packages/react-css/src/components/ArticleJsonLd.tsx +42 -0
- package/packages/react-css/src/components/BreadcrumbsJsonLd.tsx +24 -0
- package/packages/react-css/src/components/MetaEditor.tsx +147 -0
- package/packages/react-css/src/components/SEOHead.tsx +95 -0
- package/packages/react-css/src/components/SEOPreview.tsx +42 -0
- package/packages/react-css/src/components/SEOScoreCard.tsx +42 -0
- package/packages/react-css/src/components/SitemapViewer.tsx +36 -0
- package/packages/react-css/src/components/index.ts +7 -0
- package/packages/react-css/src/index.ts +9 -0
- package/packages/react-css/src/pages/SEOAdminPage.tsx +88 -0
- package/packages/react-css/src/pages/SEOAnalyticsPage.tsx +82 -0
- package/packages/react-css/src/pages/index.ts +2 -0
- package/packages/react-css/src/seo.css +650 -0
- package/packages/react-css/tsup.config.ts +2 -0
- package/packages/shared/README.md +1 -0
- package/packages/shared/package.json +42 -0
- package/packages/shared/src/__tests__/seo.test.ts +70 -0
- package/packages/shared/src/config.ts +297 -0
- package/packages/shared/src/index.ts +207 -0
- package/packages/shared/tsconfig.json +18 -0
- package/packages/shared/tsup.config.ts +11 -0
- package/packages/shared/vitest.config.ts +4 -0
- package/packages/solidjs/README.md +1 -0
- package/packages/solidjs/package.json +45 -0
- package/packages/solidjs/src/components/ArticleJsonLd.tsx +35 -0
- package/packages/solidjs/src/components/BreadcrumbsJsonLd.tsx +24 -0
- package/packages/solidjs/src/components/MetaEditor.tsx +155 -0
- package/packages/solidjs/src/components/SEOHead.tsx +109 -0
- package/packages/solidjs/src/components/SEOPreview.tsx +42 -0
- package/packages/solidjs/src/components/SEOScoreCard.tsx +57 -0
- package/packages/solidjs/src/components/SitemapViewer.tsx +44 -0
- package/packages/solidjs/src/components/index.ts +7 -0
- package/packages/solidjs/src/index.ts +11 -0
- package/packages/solidjs/src/pages/SEOAdminPage.tsx +104 -0
- package/packages/solidjs/src/pages/SEOAnalyticsPage.tsx +102 -0
- package/packages/solidjs/src/pages/index.ts +2 -0
- package/packages/solidjs/src/primitives/index.ts +4 -0
- package/packages/solidjs/src/primitives/useSEO.ts +27 -0
- package/packages/solidjs/src/primitives/useSEOAdmin.ts +42 -0
- package/packages/solidjs/src/primitives/useSEOScore.ts +7 -0
- package/packages/solidjs/src/primitives/useSitemap.ts +8 -0
- package/packages/solidjs/tsconfig.json +20 -0
- package/packages/solidjs/tsup.config.ts +12 -0
- package/packages/solidjs-css/README.md +1 -0
- package/packages/solidjs-css/package.json +35 -0
- package/packages/solidjs-css/src/index.ts +5 -0
- package/packages/solidjs-css/src/primitives/index.ts +1 -0
- package/packages/solidjs-css/src/seo.css +650 -0
- package/packages/solidjs-css/tsup.config.ts +2 -0
- package/pnpm-workspace.yaml +2 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "public",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @mxn2020
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches: [main]
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
check:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: pnpm/action-setup@v4
|
|
14
|
+
with:
|
|
15
|
+
version: 10
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version-file: '.nvmrc'
|
|
19
|
+
cache: 'pnpm'
|
|
20
|
+
- run: pnpm install --frozen-lockfile
|
|
21
|
+
- run: pnpm build
|
|
22
|
+
- run: pnpm lint
|
|
23
|
+
- run: pnpm test
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
|
|
6
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: pnpm/action-setup@v4
|
|
14
|
+
with:
|
|
15
|
+
version: 10
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version-file: '.nvmrc'
|
|
19
|
+
cache: 'pnpm'
|
|
20
|
+
registry-url: 'https://registry.npmjs.org'
|
|
21
|
+
- run: pnpm install --frozen-lockfile
|
|
22
|
+
- run: pnpm build
|
|
23
|
+
- uses: changesets/action@v1
|
|
24
|
+
with:
|
|
25
|
+
publish: pnpm changeset publish
|
|
26
|
+
version: pnpm changeset version
|
|
27
|
+
env:
|
|
28
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
version: "0.1"
|
|
2
|
+
milestones:
|
|
3
|
+
- name: "v0.1.0 — Initial Release"
|
|
4
|
+
status: in-progress
|
|
5
|
+
items:
|
|
6
|
+
- "Core shared types and logic"
|
|
7
|
+
- "React hooks and components"
|
|
8
|
+
- "SolidJS primitives"
|
|
9
|
+
- "npm publishing via Changesets"
|
|
10
|
+
- name: "v0.2.0 — Stability"
|
|
11
|
+
status: planned
|
|
12
|
+
items:
|
|
13
|
+
- "Test coverage ≥ 50%"
|
|
14
|
+
- "API documentation"
|
|
15
|
+
- "Convex adapter"
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our
|
|
6
|
+
community a harassment-free experience for everyone, regardless of age, body
|
|
7
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
8
|
+
education, socio-economic status, nationality, personal appearance, race,
|
|
9
|
+
religion, or sexual identity and orientation.
|
|
10
|
+
|
|
11
|
+
## Enforcement
|
|
12
|
+
|
|
13
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
14
|
+
reported to the project team at conduct@geenius.app.
|
|
15
|
+
|
|
16
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Contributing to @geenius-seo
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing!
|
|
4
|
+
|
|
5
|
+
## Development Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
git clone https://github.com/mxn2020/geenius-seo.git
|
|
9
|
+
cd geenius-seo
|
|
10
|
+
pnpm install
|
|
11
|
+
pnpm build
|
|
12
|
+
pnpm test
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Pull Request Process
|
|
16
|
+
|
|
17
|
+
1. Fork the repo and create a feature branch from `main`
|
|
18
|
+
2. Add or update tests as appropriate
|
|
19
|
+
3. Run `pnpm changeset` to describe your changes for the changelog
|
|
20
|
+
4. Open a PR against `main`
|
|
21
|
+
|
|
22
|
+
## Code Style
|
|
23
|
+
|
|
24
|
+
- TypeScript strict mode
|
|
25
|
+
- ESLint + Prettier formatting
|
|
26
|
+
- Conventional commits preferred
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Mehdi Nabhani
|
|
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
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# ✦ geenius-seo\n\n> Geenius Seo — SEO utilities for SaaS apps (React + SolidJS)\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add geenius-seo\n```\n\n## Usage\n\n```typescript\nimport { init } from 'geenius-seo';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
| Version | Supported |
|
|
6
|
+
| ------- | --------- |
|
|
7
|
+
| 0.x.x | ✅ |
|
|
8
|
+
|
|
9
|
+
## Reporting a Vulnerability
|
|
10
|
+
|
|
11
|
+
Please report security vulnerabilities by emailing **security@geenius.app**.
|
|
12
|
+
|
|
13
|
+
Do **not** open a public GitHub issue for security vulnerabilities.
|
|
14
|
+
|
|
15
|
+
We will acknowledge receipt within 48 hours and provide a detailed response within 5 business days.
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Support
|
|
2
|
+
|
|
3
|
+
## Getting Help
|
|
4
|
+
|
|
5
|
+
- 📖 [Documentation](https://docs.geenius.app)
|
|
6
|
+
- 🐛 [Bug Reports](https://github.com/mxn2020/geenius-seo/issues/new?template=bug_report.md)
|
|
7
|
+
- 💡 [Feature Requests](https://github.com/mxn2020/geenius-seo/issues/new?template=feature_request.md)
|
|
8
|
+
- 📧 Email: support@geenius.app
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geenius/seo",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Geenius Seo — SEO utilities for SaaS apps (React + SolidJS)",
|
|
6
|
+
"author": "Antigravity HQ",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/mxn2020/geenius-seo.git"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"seo",
|
|
14
|
+
"meta-tags",
|
|
15
|
+
"og-image",
|
|
16
|
+
"sitemap",
|
|
17
|
+
"structured-data",
|
|
18
|
+
"react",
|
|
19
|
+
"solidjs",
|
|
20
|
+
"geenius"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "pnpm -r --parallel type-check",
|
|
24
|
+
"build": "pnpm -r build",
|
|
25
|
+
"clean": "pnpm -r clean",
|
|
26
|
+
"lint": "pnpm -r --parallel type-check",
|
|
27
|
+
"test": "echo \"No tests configured yet\" && exit 0",
|
|
28
|
+
"type-check": "pnpm -r type-check",
|
|
29
|
+
"format": "prettier --write \"packages/*/src/**/*.{ts,tsx}\"",
|
|
30
|
+
"version:patch": "pnpm -r exec -- npm version patch --no-git-tag-version && npm version patch -m 'v%s'",
|
|
31
|
+
"version:minor": "pnpm -r exec -- npm version minor --no-git-tag-version && npm version minor -m 'v%s'",
|
|
32
|
+
"version:major": "pnpm -r exec -- npm version major --no-git-tag-version && npm version major -m 'v%s'",
|
|
33
|
+
"release": "git push && git push --tags",
|
|
34
|
+
"publish:all": "pnpm -r publish --access public"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"prettier": "^3.8.1",
|
|
38
|
+
"typescript": "~6.0.2"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20.0.0"
|
|
42
|
+
},
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./packages/shared/dist/index.d.ts",
|
|
46
|
+
"import": "./packages/shared/dist/index.js"
|
|
47
|
+
},
|
|
48
|
+
"./shared": {
|
|
49
|
+
"types": "./packages/shared/dist/index.d.ts",
|
|
50
|
+
"import": "./packages/shared/dist/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./convex": {
|
|
53
|
+
"types": "./packages/convex/dist/index.d.ts",
|
|
54
|
+
"import": "./packages/convex/dist/index.js"
|
|
55
|
+
},
|
|
56
|
+
"./react": {
|
|
57
|
+
"types": "./packages/react/dist/index.d.ts",
|
|
58
|
+
"import": "./packages/react/dist/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./react-css": {
|
|
61
|
+
"types": "./packages/react-css/dist/index.d.ts",
|
|
62
|
+
"import": "./packages/react-css/dist/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./solidjs": {
|
|
65
|
+
"types": "./packages/solidjs/dist/index.d.ts",
|
|
66
|
+
"import": "./packages/solidjs/dist/index.js"
|
|
67
|
+
},
|
|
68
|
+
"./solidjs-css": {
|
|
69
|
+
"types": "./packages/solidjs-css/dist/index.d.ts",
|
|
70
|
+
"import": "./packages/solidjs-css/dist/index.js"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"main": "./packages/shared/dist/index.js",
|
|
74
|
+
"types": "./packages/shared/dist/index.d.ts"
|
|
75
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geenius-seo/convex",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Convex backend functions and schema for the Geenius SEO system",
|
|
7
|
+
"author": "Antigravity HQ",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"type-check": "tsc --noEmit",
|
|
29
|
+
"prepublishOnly": "pnpm clean && pnpm build"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"convex": "^1.34.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"convex": "^1.34.0",
|
|
36
|
+
"tsup": "^8.5.1",
|
|
37
|
+
"typescript": "~6.0.2"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=20.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { mutation } from './_generated/server'
|
|
2
|
+
import { v } from 'convex/values'
|
|
3
|
+
|
|
4
|
+
export const upsertSEOMeta = mutation({
|
|
5
|
+
args: {
|
|
6
|
+
path: v.string(),
|
|
7
|
+
meta: v.any(),
|
|
8
|
+
},
|
|
9
|
+
async handler(ctx, args) {
|
|
10
|
+
const existing = await ctx.db
|
|
11
|
+
.query('seo_pages')
|
|
12
|
+
.withIndex('by_path', (q) => q.eq('path', args.path))
|
|
13
|
+
.first()
|
|
14
|
+
|
|
15
|
+
const now = new Date().toISOString()
|
|
16
|
+
|
|
17
|
+
if (existing) {
|
|
18
|
+
await ctx.db.patch(existing._id, {
|
|
19
|
+
meta: args.meta,
|
|
20
|
+
lastModified: now,
|
|
21
|
+
})
|
|
22
|
+
return existing._id
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return await ctx.db.insert('seo_pages', {
|
|
26
|
+
path: args.path,
|
|
27
|
+
meta: args.meta,
|
|
28
|
+
lastModified: now,
|
|
29
|
+
createdAt: now,
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
export const updateAnalytics = mutation({
|
|
35
|
+
args: {
|
|
36
|
+
path: v.string(),
|
|
37
|
+
views: v.number(),
|
|
38
|
+
avgTime: v.number(),
|
|
39
|
+
bounceRate: v.number(),
|
|
40
|
+
date: v.string(),
|
|
41
|
+
},
|
|
42
|
+
async handler(ctx, args) {
|
|
43
|
+
// Check if entry exists for this path and date
|
|
44
|
+
const existing = await ctx.db
|
|
45
|
+
.query('seo_analytics')
|
|
46
|
+
.withIndex('by_path', (q) => q.eq('path', args.path))
|
|
47
|
+
.filter((q) => q.eq(q.field('date'), args.date))
|
|
48
|
+
.first()
|
|
49
|
+
|
|
50
|
+
if (existing) {
|
|
51
|
+
await ctx.db.patch(existing._id, {
|
|
52
|
+
views: args.views,
|
|
53
|
+
avgTimeOnPage: args.avgTime,
|
|
54
|
+
bounceRate: args.bounceRate,
|
|
55
|
+
})
|
|
56
|
+
return existing._id
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return await ctx.db.insert('seo_analytics', {
|
|
60
|
+
path: args.path,
|
|
61
|
+
views: args.views,
|
|
62
|
+
avgTimeOnPage: args.avgTime,
|
|
63
|
+
bounceRate: args.bounceRate,
|
|
64
|
+
date: args.date,
|
|
65
|
+
})
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
export const deleteSEOMeta = mutation({
|
|
70
|
+
args: { path: v.string() },
|
|
71
|
+
async handler(ctx, args) {
|
|
72
|
+
const entry = await ctx.db
|
|
73
|
+
.query('seo_pages')
|
|
74
|
+
.withIndex('by_path', (q) => q.eq('path', args.path))
|
|
75
|
+
.first()
|
|
76
|
+
|
|
77
|
+
if (entry) {
|
|
78
|
+
await ctx.db.delete(entry._id)
|
|
79
|
+
return true
|
|
80
|
+
}
|
|
81
|
+
return false
|
|
82
|
+
},
|
|
83
|
+
})
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { query } from './_generated/server'
|
|
2
|
+
import { v } from 'convex/values'
|
|
3
|
+
|
|
4
|
+
export const getSEOMeta = query({
|
|
5
|
+
args: { path: v.string() },
|
|
6
|
+
async handler(ctx, args) {
|
|
7
|
+
return await ctx.db
|
|
8
|
+
.query('seo_pages')
|
|
9
|
+
.withIndex('by_path', (q) => q.eq('path', args.path))
|
|
10
|
+
.first()
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export const listPages = query({
|
|
15
|
+
args: { limit: v.optional(v.number()) },
|
|
16
|
+
async handler(ctx, args) {
|
|
17
|
+
return await ctx.db
|
|
18
|
+
.query('seo_pages')
|
|
19
|
+
.order('desc')
|
|
20
|
+
.take(args.limit ?? 100)
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export const getPageAnalytics = query({
|
|
25
|
+
args: { path: v.string(), days: v.optional(v.number()) },
|
|
26
|
+
async handler(ctx, args) {
|
|
27
|
+
const daysAgo = args.days ?? 30
|
|
28
|
+
const cutoffDate = new Date()
|
|
29
|
+
cutoffDate.setDate(cutoffDate.getDate() - daysAgo)
|
|
30
|
+
const cutoffIso = cutoffDate.toISOString().split('T')[0]
|
|
31
|
+
|
|
32
|
+
return await ctx.db
|
|
33
|
+
.query('seo_analytics')
|
|
34
|
+
.withIndex('by_path', (q) => q.eq('path', args.path))
|
|
35
|
+
.filter((q) => q.gte(q.field('date'), cutoffIso))
|
|
36
|
+
.collect()
|
|
37
|
+
},
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
export const getTopPages = query({
|
|
41
|
+
args: { limit: v.optional(v.number()) },
|
|
42
|
+
async handler(ctx, args) {
|
|
43
|
+
const allAnalytics = await ctx.db.query('seo_analytics').collect()
|
|
44
|
+
|
|
45
|
+
// Group by path and sum views
|
|
46
|
+
const grouped: Record<string, number> = {}
|
|
47
|
+
allAnalytics.forEach((entry) => {
|
|
48
|
+
grouped[entry.path] = (grouped[entry.path] ?? 0) + entry.views
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
// Sort and take top N
|
|
52
|
+
return Object.entries(grouped)
|
|
53
|
+
.sort((a, b) => b[1] - a[1])
|
|
54
|
+
.slice(0, args.limit ?? 10)
|
|
55
|
+
.map(([path, views]) => ({ path, views }))
|
|
56
|
+
},
|
|
57
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { defineSchema, defineTable } from 'convex/server'
|
|
2
|
+
import { v } from 'convex/values'
|
|
3
|
+
|
|
4
|
+
export default defineSchema({
|
|
5
|
+
seo_pages: defineTable({
|
|
6
|
+
path: v.string(),
|
|
7
|
+
meta: v.any(),
|
|
8
|
+
lastModified: v.string(),
|
|
9
|
+
createdAt: v.string(),
|
|
10
|
+
})
|
|
11
|
+
.index('by_path', ['path'])
|
|
12
|
+
.index('by_modified', ['lastModified']),
|
|
13
|
+
|
|
14
|
+
seo_analytics: defineTable({
|
|
15
|
+
path: v.string(),
|
|
16
|
+
views: v.number(),
|
|
17
|
+
avgTimeOnPage: v.number(),
|
|
18
|
+
bounceRate: v.number(),
|
|
19
|
+
date: v.string(),
|
|
20
|
+
})
|
|
21
|
+
.index('by_path', ['path'])
|
|
22
|
+
.index('by_date', ['date']),
|
|
23
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"target": "ES2022",
|
|
12
|
+
"module": "ESNext",
|
|
13
|
+
"moduleResolution": "bundler"
|
|
14
|
+
},
|
|
15
|
+
"include": [
|
|
16
|
+
"src"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig } from 'tsup'
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: {
|
|
5
|
+
index: 'src/index.ts',
|
|
6
|
+
},
|
|
7
|
+
format: ['esm'],
|
|
8
|
+
dts: true,
|
|
9
|
+
clean: true,
|
|
10
|
+
sourcemap: true,
|
|
11
|
+
external: [
|
|
12
|
+
'convex',
|
|
13
|
+
'convex/server',
|
|
14
|
+
'convex/values',
|
|
15
|
+
'convex/react',
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# ✦ @geenius-seo/react\n\n> Geenius Seo — React components & hooks\n\n---\n\n## Overview\nBuilt with Steve Jobs-level minimalism and Jony Ive-level craftsmanship, this package is designed to deliver unparalleled developer experience (DX) and rock-solid performance.\n\n## Installation\n\n```bash\npnpm add @geenius-seo/react\n```\n\n## Usage\n\n```typescript\nimport { init } from '@geenius-seo/react';\n\n// Initialize the module with absolute precision\ninit({\n mode: 'premium',\n});\n```\n\n## Architecture\n- **Zero-config**: It just works.\n- **Strictly Typed**: Fully written in TypeScript for flawless IntelliSense.\n- **Framework Agnostic**: seamlessly integrates into the Geenius ecosystem.\n\n---\n\n*Designed by Antigravity HQ*\n
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geenius-seo/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Geenius Seo — React components & hooks",
|
|
7
|
+
"author": "Antigravity HQ",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup",
|
|
27
|
+
"clean": "rm -rf dist",
|
|
28
|
+
"type-check": "tsc --noEmit",
|
|
29
|
+
"prepublishOnly": "pnpm clean && pnpm build"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@geenius-seo/shared": "workspace:*"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/react": "^19.0.0",
|
|
36
|
+
"@types/react-dom": "^19.0.0",
|
|
37
|
+
"react": "^19.2.4",
|
|
38
|
+
"react-dom": "^19.2.4",
|
|
39
|
+
"tsup": "^8.5.1",
|
|
40
|
+
"typescript": "~6.0.2"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
44
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20.0.0"
|
|
48
|
+
}
|
|
49
|
+
}
|