@better-seo/core 0.0.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/README.md +81 -0
- package/dist/index.cjs +652 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +322 -0
- package/dist/index.d.ts +322 -0
- package/dist/index.js +620 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# `@better-seo/core`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@better-seo/core)
|
|
4
|
+
[](../../LICENSE)
|
|
5
|
+
[](https://github.com/0xMilord/better-seo-js/actions/workflows/ci.yml)
|
|
6
|
+
|
|
7
|
+
Framework-agnostic SEO **document model** for JavaScript and TypeScript: merge partial inputs into a canonical **`SEO`**, serialize HTML-safe **JSON-LD**, validate in development, render vanilla **tag descriptors**, and register framework adapters. **Zero runtime npm dependencies** so Node, Edge, and browser bundles stay light.
|
|
8
|
+
|
|
9
|
+
**Docs:** [Monorepo README](../../README.md) · [Usage & errors](../../internal-docs/USAGE.md) · [Architecture](../../internal-docs/ARCHITECTURE.md) · [FEATURES — C\* IDs](../../internal-docs/FEATURES.md)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @better-seo/core
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use with **`@better-seo/next`** or your own adapter; OG/icon generation stays in **`@better-seo/assets`** / **`@better-seo/cli`**.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What you get
|
|
24
|
+
|
|
25
|
+
| Area | Exports (high level) |
|
|
26
|
+
| ------------------- | --------------------------------------------------------------------------- |
|
|
27
|
+
| **Model** | `createSEO`, `mergeSEO`, `withSEO`, types `SEO`, `SEOInput`, `SEOConfig`, … |
|
|
28
|
+
| **JSON-LD** | `serializeJSONLD`, schema helpers (`webPage`, `article`, `organization`, …) |
|
|
29
|
+
| **Head (vanilla)** | `renderTags` |
|
|
30
|
+
| **Quality** | `validateSEO`, `ValidationIssueCode`, … |
|
|
31
|
+
| **Extensibility** | `defineSEOPlugin`, `registerAdapter`, `getAdapter`, `applyRules`, … |
|
|
32
|
+
| **Context** | `createSEOContext` (preferred for Edge / multi-tenant) |
|
|
33
|
+
| **Global (legacy)** | `initSEO`, `getGlobalSEOConfig` — see USAGE warnings |
|
|
34
|
+
| **Orchestration** | `seoForFramework`, `useSEO` (stub until **`@better-seo/react`**) |
|
|
35
|
+
| **Errors** | `SEOError`, `isSEOError` |
|
|
36
|
+
|
|
37
|
+
Full API surface is **`src/index.ts`** (published as **`dist/index.*`**).
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Scripts (monorepo)
|
|
42
|
+
|
|
43
|
+
From **`packages/core`**:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm run build # tsup → dist/
|
|
47
|
+
npm run test # vitest run
|
|
48
|
+
npm run test:coverage # vitest + coverage thresholds (CI gate)
|
|
49
|
+
npm run lint
|
|
50
|
+
npm run typecheck
|
|
51
|
+
npm run size # size-limit on dist/index.js
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
From repository root, core is built as part of **`npm run build`** / **`npm run check`**.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Coverage
|
|
59
|
+
|
|
60
|
+
[`vitest.config.ts`](./vitest.config.ts) enforces **V8** coverage on `src/**/*.ts` (excluding tests, `index.ts`, `types.ts`).
|
|
61
|
+
|
|
62
|
+
| Metric | Minimum |
|
|
63
|
+
| -------------- | ------- |
|
|
64
|
+
| **Lines** | 90% |
|
|
65
|
+
| **Statements** | 90% |
|
|
66
|
+
| **Functions** | 88% |
|
|
67
|
+
| **Branches** | 80% |
|
|
68
|
+
|
|
69
|
+
CI runs **`npm run test:coverage`** via the root **`check`** script. LCov output: **`coverage/lcov.info`** (also uploaded from GitHub Actions for **`@better-seo/core`**).
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Size budget
|
|
74
|
+
|
|
75
|
+
Configured in **`package.json`** → **`size-limit`** (tracked in **`npm run ci`** at monorepo root).
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
MIT — see [**LICENSE**](../../LICENSE).
|