@umituz/web-seo 2.5.0 → 2.6.0
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.
|
@@ -6,7 +6,10 @@ const saasDisallow = ["/api/", "/auth/"];
|
|
|
6
6
|
const withRoutes = (routes) => ["/", ...(routes ?? [])];
|
|
7
7
|
export const saasSEOOptions = (siteUrl, opts = {}) => ({
|
|
8
8
|
siteUrl,
|
|
9
|
-
routes: [
|
|
9
|
+
routes: [
|
|
10
|
+
"/",
|
|
11
|
+
...(opts.landing ?? Object.keys(opts.prerender ?? { "/": {} }).filter((r) => r !== "/")),
|
|
12
|
+
],
|
|
10
13
|
sitemap: { filename: "sitemap.xml" },
|
|
11
14
|
robotsTxt: {
|
|
12
15
|
filename: "robots.txt",
|
|
@@ -34,4 +34,21 @@ describe('saasSEOOptions', () => {
|
|
|
34
34
|
const options = saasSEOOptions('https://demo.test.dev', { prerender: {} });
|
|
35
35
|
expect(options.prerender?.fallbackMeta).toEqual({});
|
|
36
36
|
});
|
|
37
|
+
it('derives sitemap routes from the prerender map when landing is absent', () => {
|
|
38
|
+
const options = saasSEOOptions('https://demo.test.dev', {
|
|
39
|
+
prerender: {
|
|
40
|
+
'/': { title: 'Home' },
|
|
41
|
+
'/features': { title: 'Features' },
|
|
42
|
+
'/about': { title: 'About' },
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
expect(options.routes).toEqual(['/', '/features', '/about']);
|
|
46
|
+
});
|
|
47
|
+
it('prefers explicit landing routes over the prerender map', () => {
|
|
48
|
+
const options = saasSEOOptions('https://demo.test.dev', {
|
|
49
|
+
landing: ['/pricing'],
|
|
50
|
+
prerender: { '/': {}, '/features': {} },
|
|
51
|
+
});
|
|
52
|
+
expect(options.routes).toEqual(['/', '/pricing']);
|
|
53
|
+
});
|
|
37
54
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-seo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Comprehensive SEO solution for React Vite applications with structured data, performance hints, and build-time optimization",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|