Update dependency sitemap to v9 #26
Reference in New Issue
Block a user
Delete Branch "renovate/sitemap-9.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^8.0.0->^9.0.0Release Notes
ekalinin/sitemap.js (sitemap)
v9.0.0Compare Source
This major release modernizes the package with ESM-first architecture, drops support for Node.js < 20, and includes comprehensive security and robustness improvements.
[BREAKING CHANGES]
Dropped Node.js < 20 Support
ESM Conversion with Dual Package Support
Package now uses
"type": "module"in package.jsonBuilt as dual ESM/CJS package with conditional exports
Import paths in ESM require
.jsextensions (TypeScript will add these automatically)Both ESM and CommonJS imports continue to work:
CLI remains ESM-only at
dist/esm/cli.jsBuild Output Changes
dist/esm/(wasdist/)dist/cjs/(new)dist/esm/index.d.ts(wasdist/index.d.ts)Node.js Modernization
node:protocol imports (node:stream,node:fs, etc.)pipelinefromnode:stream/promises(instead ofpromisify(pipeline))New Exports
The following validation functions and constants are now part of the public API:
Validation Functions (from
lib/validation.js):validateURL(),validatePath(),validateLimit(),validatePublicBasePath(),validateXSLUrl()isPriceType(),isResolution(),isValidChangeFreq(),isValidYesNo(),isAllowDeny()validators- object containing regex validators for all sitemap fieldsConstants (from
lib/constants.js):LIMITS- security limits object (max URL length, max items per sitemap, video/news/image constraints, etc.)DEFAULT_SITEMAP_ITEM_LIMIT- default items per sitemap file (45,000)New Type Export:
SimpleSitemapAndIndexOptionsinterface now exportedFeatures
Comprehensive Security Validation
Parser Security (#461): Added resource limits and comprehensive validation to sitemap index parser and stream
..sequences)Stream Validation (#456, #455, #454): Added comprehensive validation to all stream classes
>character)XML Generation Security (#457): Comprehensive validation and documentation in sitemap-xml
Robustness Improvements
Fixes
Refactoring
lib/constants.ts- single source of truth for all shared constantslib/validation.ts- centralized all validation logic and type guardsInfrastructure
Build System
tsconfig.json- ESM build (NodeNext module resolution)tsconfig.cjs.json- CJS build (CommonJS module)package.jsonwith"type": "commonjs"todist/cjs/Testing
.mjsformatDependencies
saxfrom ^1.2.4 to ^1.4.1@types/nodefrom ^17.0.5 to ^24.7.2Developer Experience
Upgrade Guide for 9.0.0
1. Update Node.js Version
Ensure you are running Node.js >=20.19.5 and npm >=10.8.2:
2. Update Package
3. Import Syntax (No Changes Required for Most Users)
Both ESM and CommonJS imports continue to work:
Note: If you're importing from the package in an ESM context, the module resolution happens automatically. If you're directly importing library files (not recommended), you'll need
.jsextensions.4. Existing Code Compatibility
ErrorLevel.WARNdefault behavior maintained5. TypeScript Users
tsconfig.jsonif needed to support ES2023dist/esm/index.d.ts(automatically resolved by package.json exports)6. New Optional Features
You can now import validation utilities and constants if needed:
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.