@power-seo/sitemap 1.0.11 → 1.0.12

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 (2) hide show
  1. package/README.md +28 -29
  2. package/package.json +9 -3
package/README.md CHANGED
@@ -1,18 +1,17 @@
1
1
  # @power-seo/sitemap
2
2
 
3
- ![sitemap banner](../../image/sitemap/banner.svg)
3
+ ![sitemap banner](https://raw.githubusercontent.com/CyberCraftBD/power-seo/main/image/sitemap/banner.svg)
4
4
 
5
5
  XML sitemap generation for TypeScript — streaming output, automatic index splitting, image/video/news extensions, and URL validation — works in Next.js, Remix, Express, and edge runtimes with zero runtime dependencies.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@power-seo/sitemap)](https://www.npmjs.com/package/@power-seo/sitemap)
8
8
  [![npm downloads](https://img.shields.io/npm/dm/@power-seo/sitemap)](https://www.npmjs.com/package/@power-seo/sitemap)
9
9
  [![Socket](https://socket.dev/api/badge/npm/package/@power-seo/sitemap)](https://socket.dev/npm/package/@power-seo/sitemap)
10
- [![npm provenance](https://img.shields.io/badge/npm-provenance-enabled-blue)](https://github.com/CyberCraftBD/power-seo/actions)
11
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
12
11
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue)](https://www.typescriptlang.org/)
13
12
  [![tree-shakeable](https://img.shields.io/badge/tree--shakeable-yes-brightgreen)](https://bundlephobia.com/package/@power-seo/sitemap)
14
13
 
15
- `@power-seo/sitemap` produces standards-compliant `<urlset>` and `<sitemapindex>` XML from typed URL arrays. Provide a hostname and URL list — get back a valid XML string ready to serve as `Content-Type: application/xml`. For large catalogs, stream chunks with constant memory usage or auto-split at the 50,000-URL spec limit with a generated index file. All five functions are independently importable and tree-shakeable.
14
+ `@power-seo/sitemap` produces standards-compliant `<urlset>` and `<sitemapindex>` XML from typed URL arrays. Provide a hostname and URL list — get back a valid XML string ready to serve as `Content-Type: application/xml`. For large catalogs, stream chunks with constant memory usage or auto-split at the 50,000-URL spec limit with a generated index file. All six functions are independently importable and tree-shakeable.
16
15
 
17
16
  > **Zero runtime dependencies** — only `@power-seo/core` as a peer.
18
17
 
@@ -31,7 +30,13 @@ XML sitemap generation for TypeScript — streaming output, automatic index spli
31
30
  | Hostname handling | ❌ Hardcode absolute URLs everywhere | ✅ Pass `hostname` once; use relative `loc` paths |
32
31
  | Validation | ❌ Silent bad data reaches Google | ✅ `validateSitemapUrl()` returns errors + warnings |
33
32
 
34
- ![Sitemap Generator Comparison](../../image/sitemap/comparison.svg)
33
+ ![Sitemap Generator Comparison](https://raw.githubusercontent.com/CyberCraftBD/power-seo/main/image/sitemap/comparison.svg)
34
+
35
+ <p align="left">
36
+ <a href="https://www.buymeacoffee.com/ccbd.dev" target="_blank">
37
+ <img src="https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee&emoji=&slug=ccbd.dev&button_colour=FFDD00&font_colour=000000&font_family=Cookie&outline_colour=000000&coffee_colour=ffffff" />
38
+ </a>
39
+ </p>
35
40
 
36
41
  ---
37
42
 
@@ -45,15 +50,16 @@ XML sitemap generation for TypeScript — streaming output, automatic index spli
45
50
  - **Streaming generation** — `streamSitemap()` is a synchronous generator yielding XML string chunks; no memory spike on large lists
46
51
  - **Automatic index splitting** — `splitSitemap()` chunks at `MAX_URLS_PER_SITEMAP` (50,000) and returns both sitemaps and the index XML
47
52
  - **Sitemap index generation** — `generateSitemapIndex()` creates a `<sitemapindex>` pointing to child sitemaps
53
+ - **Smart namespace detection** — `generateSitemap()` only declares XML namespaces for extensions (image, video, news) that are actually used
48
54
  - **URL validation** — `validateSitemapUrl()` returns `{ valid, errors, warnings }` without throwing
49
- - **Next.js App Router adapter** — `toNextSitemap()` (from `@power-seo/sitemap/next`) converts `SitemapURL[]` to the `MetadataRoute.Sitemap[]` format for `app/sitemap.ts`
55
+ - **Next.js App Router adapter** — `toNextSitemap()` converts `SitemapURL[]` to the `MetadataRoute.Sitemap[]` format for `app/sitemap.ts`
50
56
  - **Constants exported** — `MAX_URLS_PER_SITEMAP` (50,000) and `MAX_SITEMAP_SIZE_BYTES` (52,428,800)
51
57
  - **Framework-agnostic** — works in Next.js API routes, Remix loaders, Express, Fastify, and edge runtimes
52
58
  - **Full TypeScript support** — typed `SitemapURL`, `SitemapImage`, `SitemapVideo`, `SitemapNews`, `SitemapConfig`
53
59
  - **Zero runtime dependencies** — pure TypeScript, no external XML libraries
54
60
  - **Tree-shakeable** — import only the functions you use
55
61
 
56
- ![Google Search Console Sitemap UI](../../image/sitemap/gsc-ui.svg)
62
+ ![Google Search Console Sitemap UI](https://raw.githubusercontent.com/CyberCraftBD/power-seo/main/image/sitemap/gsc-ui.svg)
57
63
 
58
64
  ---
59
65
 
@@ -74,7 +80,7 @@ XML sitemap generation for TypeScript — streaming output, automatic index spli
74
80
  | Tree-shakeable | ✅ | ❌ | ❌ | ❌ |
75
81
  | Next.js `app/sitemap.ts` adapter | ✅ | ✅ | ❌ | ❌ |
76
82
 
77
- ![Sitemap Extensions Accuracy](../../image/sitemap/extensions-accuracy.svg)
83
+ ![Sitemap Extensions Accuracy](https://raw.githubusercontent.com/CyberCraftBD/power-seo/main/image/sitemap/extensions-accuracy.svg)
78
84
 
79
85
  ---
80
86
 
@@ -116,7 +122,7 @@ const xml = generateSitemap({
116
122
 
117
123
  `hostname` is required — it is prepended to any `loc` value that is a relative path. Absolute `loc` values (starting with `http`) are used as-is.
118
124
 
119
- ![Sitemap Streaming Benefit](../../image/sitemap/streaming-benefit.svg)
125
+ ![Sitemap Streaming Benefit](https://raw.githubusercontent.com/CyberCraftBD/power-seo/main/image/sitemap/streaming-benefit.svg)
120
126
 
121
127
  ---
122
128
 
@@ -254,11 +260,11 @@ const result = validateSitemapUrl({
254
260
 
255
261
  ### Next.js App Router — `app/sitemap.ts` Convention
256
262
 
257
- Next.js App Router has a built-in `app/sitemap.ts` file convention that returns an array of URL objects (not XML). Use `toNextSitemap()` from the `/next` subpath to convert `SitemapURL[]` to the required format:
263
+ Next.js App Router has a built-in `app/sitemap.ts` file convention that returns an array of URL objects (not XML). Use `toNextSitemap()` to convert `SitemapURL[]` to the required format:
258
264
 
259
265
  ```ts
260
266
  // app/sitemap.ts
261
- import { toNextSitemap } from '@power-seo/sitemap/next';
267
+ import { toNextSitemap } from '@power-seo/sitemap';
262
268
 
263
269
  export default async function sitemap() {
264
270
  const urls = await fetchUrlsFromCms();
@@ -268,7 +274,7 @@ export default async function sitemap() {
268
274
  }
269
275
  ```
270
276
 
271
- `toNextSitemap()` filters out invalid URLs, converts `lastmod` strings to `Date` objects, and maps `changefreq` to `changeFrequency` as required by Next.js.
277
+ `toNextSitemap()` filters out invalid URLs and maps `changefreq` to `changeFrequency` as required by Next.js. The `lastmod` field is passed through as-is (string or Date).
272
278
 
273
279
  ### Next.js App Router — Route Handler (XML)
274
280
 
@@ -387,22 +393,22 @@ function validateSitemapUrl(url: SitemapURL): SitemapValidationResult;
387
393
 
388
394
  Returns `{ valid: boolean; errors: string[]; warnings: string[] }`. Never throws.
389
395
 
390
- ### `toNextSitemap(urls)` — from `@power-seo/sitemap/next`
396
+ ### `toNextSitemap(urls)`
391
397
 
392
398
  ```ts
393
- import { toNextSitemap } from '@power-seo/sitemap/next';
399
+ import { toNextSitemap } from '@power-seo/sitemap';
394
400
 
395
401
  function toNextSitemap(urls: SitemapURL[]): NextSitemapEntry[];
396
402
  ```
397
403
 
398
- Converts a `SitemapURL[]` to the array format expected by Next.js App Router's `app/sitemap.ts` file convention. Invalid URLs (per `validateSitemapUrl`) are filtered out automatically. `lastmod` strings are converted to `Date` objects; `changefreq` is mapped to `changeFrequency`.
404
+ Converts a `SitemapURL[]` to the array format expected by Next.js App Router's `app/sitemap.ts` file convention. Invalid URLs (per `validateSitemapUrl`) are filtered out automatically. `changefreq` is mapped to `changeFrequency`.
399
405
 
400
- | Field | Type | Description |
401
- | ----------------- | ---------------- | ------------------------------------ |
402
- | `url` | `string` | Absolute URL (`loc`) |
403
- | `lastModified` | `Date \| string` | From `lastmod` (converted to `Date`) |
404
- | `changeFrequency` | `string` | From `changefreq` |
405
- | `priority` | `number` | From `priority` |
406
+ | Field | Type | Description |
407
+ | ----------------- | ---------------- | ------------------------------------- |
408
+ | `url` | `string` | Absolute URL (`loc`) |
409
+ | `lastModified` | `Date \| string` | From `lastmod` (passed through as-is) |
410
+ | `changeFrequency` | `string` | From `changefreq` |
411
+ | `priority` | `number` | From `priority` |
406
412
 
407
413
  ---
408
414
 
@@ -461,7 +467,7 @@ Converts a `SitemapURL[]` to the array format expected by Next.js App Router's `
461
467
  - **SSR compatible** — safe to run in Next.js Server Components, Remix loaders, or Express handlers
462
468
  - **Edge runtime safe** — no `fs`, no `path`, no Node.js-specific APIs; runs in Cloudflare Workers, Vercel Edge, Deno
463
469
  - **Synchronous generator streaming** — `streamSitemap()` uses `function*` — no async overhead, no backpressure complexity
464
- - **Auto namespace detection** — `generateSitemap()` only adds `xmlns:image`, `xmlns:video`, `xmlns:news` declarations when the URL set actually uses those extensions
470
+ - **Smart namespace detection** — `generateSitemap()` only declares image/video/news namespaces when actually used; `streamSitemap()` always includes all namespaces for simplicity
465
471
  - **Tree-shakeable** — `"sideEffects": false` with named exports per function
466
472
  - **Dual ESM + CJS** — ships both formats via tsup for any bundler or `require()` usage
467
473
 
@@ -472,7 +478,6 @@ Converts a `SitemapURL[]` to the array format expected by Next.js App Router's `
472
478
  - No install scripts (`postinstall`, `preinstall`)
473
479
  - No runtime network access
474
480
  - No `eval` or dynamic code execution
475
- - npm provenance enabled — every release is signed via Sigstore through GitHub Actions
476
481
  - CI-signed builds — all releases published via verified `github.com/CyberCraftBD/power-seo` workflow
477
482
  - Safe for SSR, Edge, and server environments
478
483
 
@@ -487,7 +492,7 @@ All 17 packages are independently installable — use only what you need.
487
492
  | [`@power-seo/core`](https://www.npmjs.com/package/@power-seo/core) | `npm i @power-seo/core` | Framework-agnostic utilities, types, validators, and constants |
488
493
  | [`@power-seo/react`](https://www.npmjs.com/package/@power-seo/react) | `npm i @power-seo/react` | React SEO components — meta, Open Graph, Twitter Card, breadcrumbs |
489
494
  | [`@power-seo/meta`](https://www.npmjs.com/package/@power-seo/meta) | `npm i @power-seo/meta` | SSR meta helpers for Next.js App Router, Remix v2, and generic SSR |
490
- | [`@power-seo/schema`](https://www.npmjs.com/package/@power-seo/schema) | `npm i @power-seo/schema` | Type-safe JSON-LD structured data — 23 builders + 21 React components |
495
+ | [`@power-seo/schema`](https://www.npmjs.com/package/@power-seo/schema) | `npm i @power-seo/schema` | Type-safe JSON-LD structured data — 23 builders + 22 React components |
491
496
  | [`@power-seo/content-analysis`](https://www.npmjs.com/package/@power-seo/content-analysis) | `npm i @power-seo/content-analysis` | Yoast-style SEO content scoring engine with React components |
492
497
  | [`@power-seo/readability`](https://www.npmjs.com/package/@power-seo/readability) | `npm i @power-seo/readability` | Readability scoring — Flesch-Kincaid, Gunning Fog, Coleman-Liau, ARI |
493
498
  | [`@power-seo/preview`](https://www.npmjs.com/package/@power-seo/preview) | `npm i @power-seo/preview` | SERP, Open Graph, and Twitter/X Card preview generators |
@@ -504,12 +509,6 @@ All 17 packages are independently installable — use only what you need.
504
509
 
505
510
  ---
506
511
 
507
- ## Keywords
508
-
509
- seo · sitemap · xml · xml sitemap · sitemap generator · sitemap index · nextjs sitemap · streaming sitemap · image sitemap · video sitemap · news sitemap · split sitemap · sitemap validation · edge runtime · remix · crawl budget · google sitemap · url priority · typescript · zero dependency
510
-
511
- ---
512
-
513
512
  ## About [CyberCraft Bangladesh](https://ccbd.dev)
514
513
 
515
514
  **[CyberCraft Bangladesh](https://ccbd.dev)** is a Bangladesh-based enterprise-grade software development and Full Stack SEO service provider company specializing in ERP system development, AI-powered SaaS and business applications, full-stack SEO services, custom website development, and scalable eCommerce platforms. We design and develop intelligent, automation-driven SaaS and enterprise solutions that help startups, SMEs, NGOs, educational institutes, and large organizations streamline operations, enhance digital visibility, and accelerate growth through modern cloud-native technologies.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@power-seo/sitemap",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "XML sitemap generation, streaming, and validation with image, video, and news support",
5
5
  "keywords": [
6
6
  "seo",
@@ -37,10 +37,16 @@
37
37
  "module": "./dist/index.js",
38
38
  "types": "./dist/index.d.ts",
39
39
  "files": [
40
- "dist"
40
+ "dist",
41
+ "LICENSE"
41
42
  ],
43
+ "engines": {
44
+ "node": ">=18.0.0",
45
+ "npm": ">=9.0.0",
46
+ "pnpm": ">=8.0.0"
47
+ },
42
48
  "dependencies": {
43
- "@power-seo/core": "1.0.11"
49
+ "@power-seo/core": "1.0.12"
44
50
  },
45
51
  "devDependencies": {
46
52
  "rimraf": "^6.1.3",