fix(build): migrate build tooling to tsbuild v4 and tsbundle config while updating sitemap integration

This commit is contained in:
2026-03-23 11:49:55 +00:00
parent d4c4e0971f
commit 292fb824fd
23 changed files with 3601 additions and 4401 deletions

View File

@@ -17,7 +17,7 @@ export class BuiltInRoutesController {
feedMetadata?: plugins.smartfeed.IFeedOptions;
articleGetterFunction?: () => Promise<plugins.tsclass.content.IArticle[]>;
blockWaybackMachine?: boolean;
getSitemapUrls: () => plugins.smartsitemap.IUrlInfo[];
getSitemapUrls: () => plugins.smartsitemap.ISitemapUrl[];
};
constructor(options: typeof BuiltInRoutesController.prototype.options) {
@@ -64,9 +64,8 @@ export class BuiltInRoutesController {
throw new plugins.smartserve.RouteNotFoundError(ctx.path, ctx.method);
}
const smartsitemap = new plugins.smartsitemap.SmartSitemap();
const urls = this.options.getSitemapUrls();
const sitemapXml = await smartsitemap.createSitemapFromUrlInfoArray(urls);
const sitemapXml = plugins.smartsitemap.SmartSitemap.create().addUrls(urls).toXml();
return new Response(sitemapXml, {
status: 200,
@@ -80,9 +79,8 @@ export class BuiltInRoutesController {
throw new plugins.smartserve.RouteNotFoundError(ctx.path, ctx.method);
}
const smartsitemap = new plugins.smartsitemap.SmartSitemap();
const articles = await this.options.articleGetterFunction();
const sitemapNewsXml = await smartsitemap.createSitemapNewsFromArticleArray(articles);
const sitemapNewsXml = plugins.smartsitemap.SmartSitemap.fromArticles(articles, { publicationName: this.options.domain || 'News' }).toXml();
return new Response(sitemapNewsXml, {
status: 200,
@@ -127,7 +125,7 @@ export class BuiltInRoutesController {
@plugins.smartserve.Get('/sw-dash')
async getSwDash(ctx: plugins.smartserve.IRequestContext): Promise<Response> {
// Import shared HTML from interfaces
const { SW_DASH_HTML } = await import('../../dist_ts_interfaces/serviceworker.js');
const { SW_DASH_HTML } = await import('../../ts_interfaces/serviceworker.js');
return new Response(SW_DASH_HTML, {
status: 200,
headers: { 'Content-Type': 'text/html' },