fix(builders): skip articles without URLs when importing into sitemap builders
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"@git.zone/cli": {
|
||||||
|
"projectType": "npm",
|
||||||
|
"module": {
|
||||||
|
"githost": "code.foss.global",
|
||||||
|
"gitscope": "push.rocks",
|
||||||
|
"gitrepo": "smartsitemap",
|
||||||
|
"description": "A comprehensive TypeScript sitemap library with builder API, supporting standard, news, image, video, and hreflang sitemaps with auto-splitting, streaming, validation, and RSS feed integration.",
|
||||||
|
"npmPackagename": "@push.rocks/smartsitemap",
|
||||||
|
"license": "MIT",
|
||||||
|
"projectDomain": "push.rocks",
|
||||||
|
"keywords": [
|
||||||
|
"sitemap",
|
||||||
|
"sitemap generator",
|
||||||
|
"sitemap index",
|
||||||
|
"XML sitemap",
|
||||||
|
"news sitemap",
|
||||||
|
"image sitemap",
|
||||||
|
"video sitemap",
|
||||||
|
"hreflang",
|
||||||
|
"RSS feeds",
|
||||||
|
"SEO",
|
||||||
|
"search engine optimization",
|
||||||
|
"builder API",
|
||||||
|
"streaming",
|
||||||
|
"validation",
|
||||||
|
"TypeScript",
|
||||||
|
"node.js"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"release": {
|
||||||
|
"registries": [
|
||||||
|
"https://verdaccio.lossless.digital",
|
||||||
|
"https://registry.npmjs.org"
|
||||||
|
],
|
||||||
|
"accessLevel": "public"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@git.zone/tsdoc": {
|
||||||
|
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
|
||||||
|
},
|
||||||
|
"@ship.zone/szci": {
|
||||||
|
"npmGlobalTools": []
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-04-30 - 4.0.2 - fix(builders)
|
||||||
|
skip articles without URLs when importing into sitemap builders
|
||||||
|
|
||||||
|
- Prevent invalid sitemap entries from being created in both URL set and news sitemap article imports.
|
||||||
|
- Tighten TypeScript and test tooling configuration while updating related development dependencies.
|
||||||
|
|
||||||
## 2026-03-20 - 4.0.1 - fix(readme)
|
## 2026-03-20 - 4.0.1 - fix(readme)
|
||||||
format features list as markdown bullets for proper rendering
|
format features list as markdown bullets for proper rendering
|
||||||
|
|
||||||
|
|||||||
+9
-13
@@ -10,24 +10,21 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --verbose)",
|
"test": "(tstest test/ --verbose)",
|
||||||
"build": "(tsbuild --allowimplicitany)",
|
"build": "(tsbuild)",
|
||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^4.3.0",
|
"@git.zone/tsbuild": "^4.4.0",
|
||||||
"@git.zone/tsbundle": "^2.9.1",
|
"@git.zone/tsrun": "^2.0.2",
|
||||||
"@git.zone/tsrun": "^2.0.1",
|
"@git.zone/tstest": "^3.6.3",
|
||||||
"@git.zone/tstest": "^3.5.0",
|
"@types/node": "^25.6.0"
|
||||||
"@push.rocks/smartenv": "^6.0.0",
|
|
||||||
"@push.rocks/tapbundle": "^6.0.3",
|
|
||||||
"@types/node": "^22.0.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@push.rocks/smartfeed": "^1.0.11",
|
"@push.rocks/smartfeed": "^1.0.11",
|
||||||
"@push.rocks/smartxml": "^2.0.0",
|
"@push.rocks/smartxml": "^2.0.0",
|
||||||
"@push.rocks/smartyaml": "^3.0.4",
|
"@push.rocks/smartyaml": "^3.0.4",
|
||||||
"@push.rocks/webrequest": "^4.0.5",
|
"@push.rocks/webrequest": "^4.0.5",
|
||||||
"@tsclass/tsclass": "^9.5.0"
|
"@tsclass/tsclass": "^9.5.1"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"last 1 chrome versions"
|
"last 1 chrome versions"
|
||||||
@@ -41,6 +38,8 @@
|
|||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
|
".smartconfig.json",
|
||||||
|
"license",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
],
|
],
|
||||||
@@ -67,11 +66,8 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.foss.global/push.rocks/smartsitemap.git"
|
"url": "https://code.foss.global/push.rocks/smartsitemap.git"
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.18.1+sha512.77a884a165cbba2d8d1c19e3b4880eee6d2fcabd0d879121e282196b80042351d5eb3ca0935fa599da1dc51265cc68816ad2bddd2a2de5ea9fdf92adbec7cd34",
|
"packageManager": "pnpm@10.28.2",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://code.foss.global/push.rocks/smartsitemap/issues"
|
"url": "https://code.foss.global/push.rocks/smartsitemap/issues"
|
||||||
},
|
|
||||||
"pnpm": {
|
|
||||||
"overrides": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+527
-2641
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { expect, tap } from '@push.rocks/tapbundle';
|
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||||
import * as smartsitemap from '../ts/index.js';
|
import * as smartsitemap from '../ts/index.js';
|
||||||
|
|
||||||
// ──────────────────────────────────────────────
|
// ──────────────────────────────────────────────
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartsitemap',
|
name: '@push.rocks/smartsitemap',
|
||||||
version: '4.0.1',
|
version: '4.0.2',
|
||||||
description: 'A comprehensive TypeScript sitemap library with builder API, supporting standard, news, image, video, and hreflang sitemaps with auto-splitting, streaming, validation, and RSS feed integration.'
|
description: 'A comprehensive TypeScript sitemap library with builder API, supporting standard, news, image, video, and hreflang sitemaps with auto-splitting, streaming, validation, and RSS feed integration.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ export class NewsSitemapBuilder extends UrlsetBuilder {
|
|||||||
*/
|
*/
|
||||||
importFromArticles(articles: plugins.tsclass.content.IArticle[]): this {
|
importFromArticles(articles: plugins.tsclass.content.IArticle[]): this {
|
||||||
for (const article of articles) {
|
for (const article of articles) {
|
||||||
|
if (!article.url) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
this.add({
|
this.add({
|
||||||
loc: article.url,
|
loc: article.url,
|
||||||
lastmod: article.timestamp ? new Date(article.timestamp) : undefined,
|
lastmod: article.timestamp ? new Date(article.timestamp) : undefined,
|
||||||
|
|||||||
@@ -149,6 +149,9 @@ export class UrlsetBuilder {
|
|||||||
/** Import from @tsclass/tsclass IArticle array */
|
/** Import from @tsclass/tsclass IArticle array */
|
||||||
importFromArticles(articles: plugins.tsclass.content.IArticle[]): this {
|
importFromArticles(articles: plugins.tsclass.content.IArticle[]): this {
|
||||||
for (const article of articles) {
|
for (const article of articles) {
|
||||||
|
if (!article.url) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const url: interfaces.ISitemapUrl = {
|
const url: interfaces.ISitemapUrl = {
|
||||||
loc: article.url,
|
loc: article.url,
|
||||||
lastmod: article.timestamp ? new Date(article.timestamp) : undefined,
|
lastmod: article.timestamp ? new Date(article.timestamp) : undefined,
|
||||||
|
|||||||
+2
-2
@@ -3,10 +3,10 @@
|
|||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
|
"noImplicitAny": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
"baseUrl": ".",
|
"types": ["node"]
|
||||||
"paths": {}
|
|
||||||
},
|
},
|
||||||
"exclude": ["dist_*/**/*.d.ts"]
|
"exclude": ["dist_*/**/*.d.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user