chore(deps): update dependency sitemap to v9#303
Open
renovate[bot] wants to merge 1 commit intodevfrom
Open
Conversation
e454297 to
519159c
Compare
519159c to
54a8333
Compare
54a8333 to
caef425
Compare
caef425 to
f116f7b
Compare
f116f7b to
e2e022f
Compare
e2e022f to
00bb3ff
Compare
5e5ca13 to
6e4f119
Compare
6e4f119 to
2a5d12c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^4.1.1→^9.0.1Release Notes
ekalinin/sitemap.js (sitemap)
v9.0.1Compare Source
xslUrlin stylesheet processing instruction — special characters (&,",<,>) in the XSL URL are now escaped before being interpolated into the<?xml-stylesheet?>processing instructionXMLToSitemapItemStream— the parser now stops emitting items and emits an error when the limit is exceeded, rather than merely logging a warningXMLToSitemapItemStreamnow tracks a separateerrorCountand stops appending to theerrorsarray beyondLIMITS.MAX_PARSER_ERRORSdestinationDirpaths insimpleSitemapAndIndexto prevent arbitrary file writes — passing an absolute path (e.g./tmp/sitemaps) now throws immediately with a descriptive errorparseSitemapIndexnow destroys source and parser streams immediately when themaxEntrieslimit is exceeded, preventing unbounded memory consumption from large sitemap index filesv9.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:
v8.0.3: — Security PatchCompare Source
8.0.3 — Security Patch
xslUrlin stylesheet processing instruction — special characters (&,",<,>) in the XSL URL are now escaped before being interpolated into the<?xml-stylesheet?>processing instructionXMLToSitemapItemStream— the parser now stops emitting items and emits an error when the limit is exceeded, rather than merely logging a warningXMLToSitemapItemStreamnow tracks a separateerrorCountand stops appending to theerrorsarray beyondLIMITS.MAX_PARSER_ERRORSdestinationDirpaths insimpleSitemapAndIndexto prevent arbitrary file writes — passing an absolute path (e.g./tmp/sitemaps) now throws immediately with a descriptive errorparseSitemapIndexnow destroys source and parser streams immediately when themaxEntrieslimit is exceeded, preventing unbounded memory consumption from large sitemap index filesv8.0.2Compare Source
Bug Fixes
xsi:schemaLocationin custom namespaces - thanks @dzakkixsi:schemaLocation) in addition toxmlnsdeclarationsxmlns:prefix="uri"andprefix:attribute="value"patternsExample Usage
The following now works correctly (as documented in README):
Testing
Files Changed
2 files changed: 144 insertions, 5 deletions
v8.0.1Compare Source
SECURITY FIXES - This release backports comprehensive security patches from 9.0.0 to 8.0.x
Security Improvements
>character escaping, attribute name validation..sequences in file pathsInfrastructure
lib/constants.ts- Centralized security limits and constantslib/validation.ts- Comprehensive validation functionsBackward Compatibility
XMLToSitemapItemStream.errorgetter for backward compatibility (returnserrors[0])ErrorLevel.WARNbehavior unchangedDependencies Updated
sax: ^1.2.4 → ^1.4.1 (security updates)Files Changed
17 files changed: 2,122 additions, 245 deletions
Testing
v8.0.0Compare Source
v7.1.3: — Security PatchCompare Source
7.1.3 — Security Patch
xslUrlin stylesheet processing instruction (stylesheetIncludenow escapes&,",<,>)XMLToSitemapItemStream— parser stops emitting items instead of only logging a warningdestinationDirpaths insimpleSitemapAndIndexto prevent arbitrary file writesparseSitemapIndexnow accepts amaxEntrieslimit (default 50,000) and destroys source/parser streams immediately on breachv7.1.2Compare Source
v7.1.1Compare Source
v7.1.0Compare Source
v7.0.0Compare Source
[BREAKING]
getSitemapStreamoption for SitemapAndIndexStream that does not return a write streamnon-breaking
publicBasePath: allows the user to set the location of sitemap files hosted on the site fixes [#359]v6.4.0Compare Source
v6.3.6Compare Source
v6.3.5Compare Source
new XMLToSitemapItemStream({ logger: false })ornew XMLToSitemapItemStream({ level: ErrorLevel.SILENT })ornew XMLToSitemapItemStream({ logger: (level, ...message) => your.custom.logger(...message) })v6.3.4Compare Source
Promise<null>but actually returnedPromise<void>v6.3.3Compare Source
v6.3.2Compare Source
v6.3.1Compare Source
v6.3.0Compare Source
v6.2.0Compare Source
v6.1.7Compare Source
v6.1.6Compare Source
v6.1.5Compare Source
v6.1.4Compare Source
v6.1.3Compare Source
v6.1.2Compare Source
v6.1.1Compare Source
v6.1.0Compare Source
v6.0.0Compare Source
6.0.0 breaking changes
price:typeandprice:resolutionare now more restrictive typesv5.1.0Compare Source
Fix for #255. Baidu does not like timestamp in its sitemap.xml, this adds an option to truncate lastmod
v5.0.1Compare Source
Fix for issue #254.
v5.0.0Compare Source
Streams
This release is heavily focused on converting the core methods of this library to use streams. Why? Overall its made the API ~20% faster and uses only 10% or less of the memory. Some tradeoffs had to be made as in their nature streams are operate on individual segments of data as opposed to the whole. For instance, the streaming interface does not support removal of sitemap items as it does not hold on to a sitemap item after its converted to XML. It should however be possible to create your own transform that filters out entries should you desire it. The existing synchronous interfaces will remain for this release at least. Do not be surprised if they go away in a future breaking release.
Sitemap Index
This library interface has been overhauled to use streams internally. Although it would have been preferable to convert this to a stream as well, I could not think of an interface that wouldn't actually end up more complex or confusing. It may be altered in the near future to accept a stream in addition to a simple list.
Misc
npx sitemap --prepend existingSitemap.xml < listOfNewURLs.json.txt5.0 Breaking Changes
--jsonis now inferred--line-separatedhas been flipped to--single-line-jsonto by default output options immediately compatible with feeding back into sitemapConfiguration
📅 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 was generated by Mend Renovate. View the repository job log.