@actuate-media/cms-core 0.28.1 → 0.29.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.
- package/dist/__tests__/media/seo.test.d.ts +2 -0
- package/dist/__tests__/media/seo.test.d.ts.map +1 -0
- package/dist/__tests__/media/seo.test.js +186 -0
- package/dist/__tests__/media/seo.test.js.map +1 -0
- package/dist/__tests__/redirects/graph.test.d.ts +2 -0
- package/dist/__tests__/redirects/graph.test.d.ts.map +1 -0
- package/dist/__tests__/redirects/graph.test.js +104 -0
- package/dist/__tests__/redirects/graph.test.js.map +1 -0
- package/dist/__tests__/redirects/suggest.test.d.ts +2 -0
- package/dist/__tests__/redirects/suggest.test.d.ts.map +1 -0
- package/dist/__tests__/redirects/suggest.test.js +28 -0
- package/dist/__tests__/redirects/suggest.test.js.map +1 -0
- package/dist/__tests__/seo/audit-engine.test.d.ts +2 -0
- package/dist/__tests__/seo/audit-engine.test.d.ts.map +1 -0
- package/dist/__tests__/seo/audit-engine.test.js +152 -0
- package/dist/__tests__/seo/audit-engine.test.js.map +1 -0
- package/dist/__tests__/seo/config-store.test.js +24 -160
- package/dist/__tests__/seo/config-store.test.js.map +1 -1
- package/dist/__tests__/seo/score.test.d.ts +2 -0
- package/dist/__tests__/seo/score.test.d.ts.map +1 -0
- package/dist/__tests__/seo/score.test.js +152 -0
- package/dist/__tests__/seo/score.test.js.map +1 -0
- package/dist/__tests__/setup/index.test.d.ts +2 -0
- package/dist/__tests__/setup/index.test.d.ts.map +1 -0
- package/dist/__tests__/setup/index.test.js +82 -0
- package/dist/__tests__/setup/index.test.js.map +1 -0
- package/dist/api/handlers.d.ts.map +1 -1
- package/dist/api/handlers.js +2095 -228
- package/dist/api/handlers.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/media/index.d.ts +2 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -0
- package/dist/media/index.js.map +1 -1
- package/dist/media/seo.d.ts +88 -0
- package/dist/media/seo.d.ts.map +1 -0
- package/dist/media/seo.js +215 -0
- package/dist/media/seo.js.map +1 -0
- package/dist/redirects/graph.d.ts +68 -0
- package/dist/redirects/graph.d.ts.map +1 -0
- package/dist/redirects/graph.js +136 -0
- package/dist/redirects/graph.js.map +1 -0
- package/dist/redirects/index.d.ts +5 -0
- package/dist/redirects/index.d.ts.map +1 -0
- package/dist/redirects/index.js +3 -0
- package/dist/redirects/index.js.map +1 -0
- package/dist/redirects/suggest.d.ts +21 -0
- package/dist/redirects/suggest.d.ts.map +1 -0
- package/dist/redirects/suggest.js +55 -0
- package/dist/redirects/suggest.js.map +1 -0
- package/dist/seo/audit-engine.d.ts +119 -0
- package/dist/seo/audit-engine.d.ts.map +1 -0
- package/dist/seo/audit-engine.js +402 -0
- package/dist/seo/audit-engine.js.map +1 -0
- package/dist/seo/audit-runner.d.ts +41 -0
- package/dist/seo/audit-runner.d.ts.map +1 -0
- package/dist/seo/audit-runner.js +223 -0
- package/dist/seo/audit-runner.js.map +1 -0
- package/dist/seo/config-store.d.ts +28 -0
- package/dist/seo/config-store.d.ts.map +1 -1
- package/dist/seo/config-store.js +22 -0
- package/dist/seo/config-store.js.map +1 -1
- package/dist/seo/index.d.ts +7 -2
- package/dist/seo/index.d.ts.map +1 -1
- package/dist/seo/index.js +4 -1
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/score.d.ts +128 -0
- package/dist/seo/score.d.ts.map +1 -0
- package/dist/seo/score.js +213 -0
- package/dist/seo/score.js.map +1 -0
- package/dist/setup/index.d.ts +16 -1
- package/dist/setup/index.d.ts.map +1 -1
- package/dist/setup/index.js +52 -2
- package/dist/setup/index.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/0008_media_center/migration.sql +47 -0
- package/prisma/migrations/0009_seo/migration.sql +143 -0
- package/prisma/schema.prisma +183 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/media/seo.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { calculateMediaSeoScore, gradeForScore, isGenericFilename, mediaKind, MEDIA_SEO_WEIGHTS, } from '../../media/seo.js';
|
|
3
|
+
describe('media SEO weights', () => {
|
|
4
|
+
it('sum to 100', () => {
|
|
5
|
+
const total = Object.values(MEDIA_SEO_WEIGHTS).reduce((a, b) => a + b, 0);
|
|
6
|
+
expect(total).toBe(100);
|
|
7
|
+
});
|
|
8
|
+
});
|
|
9
|
+
describe('mediaKind', () => {
|
|
10
|
+
it.each([
|
|
11
|
+
['image/jpeg', 'image'],
|
|
12
|
+
['image/png', 'image'],
|
|
13
|
+
['image/webp', 'image'],
|
|
14
|
+
['image/svg+xml', 'svg'],
|
|
15
|
+
['video/mp4', 'video'],
|
|
16
|
+
['audio/mpeg', 'audio'],
|
|
17
|
+
['application/pdf', 'pdf'],
|
|
18
|
+
['application/zip', 'other'],
|
|
19
|
+
['', 'other'],
|
|
20
|
+
])('maps %s -> %s', (mime, expected) => {
|
|
21
|
+
expect(mediaKind(mime)).toBe(expected);
|
|
22
|
+
});
|
|
23
|
+
it('treats undefined as other', () => {
|
|
24
|
+
expect(mediaKind(undefined)).toBe('other');
|
|
25
|
+
expect(mediaKind(null)).toBe('other');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe('isGenericFilename', () => {
|
|
29
|
+
it.each([
|
|
30
|
+
'IMG_4892.jpg',
|
|
31
|
+
'img4892.png',
|
|
32
|
+
'DSC_0001.jpg',
|
|
33
|
+
'DSCF1234.jpg',
|
|
34
|
+
'P1010101.jpg',
|
|
35
|
+
'image.png',
|
|
36
|
+
'image1.png',
|
|
37
|
+
'photo-2.jpg',
|
|
38
|
+
'Untitled.png',
|
|
39
|
+
'Screen Shot 2024-01-01 at 10.00.00.png',
|
|
40
|
+
'screenshot.png',
|
|
41
|
+
'download.pdf',
|
|
42
|
+
'12345.jpg',
|
|
43
|
+
'a1b2c3d4e5f6.jpg',
|
|
44
|
+
'',
|
|
45
|
+
' ',
|
|
46
|
+
])('flags %s as generic', (name) => {
|
|
47
|
+
expect(isGenericFilename(name)).toBe(true);
|
|
48
|
+
});
|
|
49
|
+
it.each([
|
|
50
|
+
'hero-banner.jpg',
|
|
51
|
+
'team-photo.png',
|
|
52
|
+
'product-screenshot.webp',
|
|
53
|
+
'logo-dark.svg',
|
|
54
|
+
'annual-report-2025.pdf',
|
|
55
|
+
'case-study-fintech.pdf',
|
|
56
|
+
])('accepts %s as descriptive', (name) => {
|
|
57
|
+
expect(isGenericFilename(name)).toBe(false);
|
|
58
|
+
});
|
|
59
|
+
it('treats null/undefined as generic', () => {
|
|
60
|
+
expect(isGenericFilename(null)).toBe(true);
|
|
61
|
+
expect(isGenericFilename(undefined)).toBe(true);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
describe('gradeForScore', () => {
|
|
65
|
+
it.each([
|
|
66
|
+
[100, 'good'],
|
|
67
|
+
[80, 'good'],
|
|
68
|
+
[79, 'needs-work'],
|
|
69
|
+
[60, 'needs-work'],
|
|
70
|
+
[59, 'poor'],
|
|
71
|
+
[1, 'poor'],
|
|
72
|
+
[0, 'critical'],
|
|
73
|
+
])('score %d -> %s', (score, grade) => {
|
|
74
|
+
expect(gradeForScore(score)).toBe(grade);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
describe('calculateMediaSeoScore', () => {
|
|
78
|
+
it('awards a perfect 100 when every field is set and the name is descriptive', () => {
|
|
79
|
+
const input = {
|
|
80
|
+
fileName: 'product-screenshot.webp',
|
|
81
|
+
mimeType: 'image/webp',
|
|
82
|
+
altText: 'A product dashboard screenshot',
|
|
83
|
+
title: 'Product Dashboard',
|
|
84
|
+
caption: 'The analytics view',
|
|
85
|
+
description: 'A detailed look at the analytics dashboard',
|
|
86
|
+
focusKeyword: 'product dashboard',
|
|
87
|
+
};
|
|
88
|
+
const result = calculateMediaSeoScore(input);
|
|
89
|
+
expect(result.score).toBe(100);
|
|
90
|
+
expect(result.grade).toBe('good');
|
|
91
|
+
expect(result.issues).toHaveLength(0);
|
|
92
|
+
});
|
|
93
|
+
it('scores hero-banner.jpg at 80 (alt+title+caption+filename+focus, no description)', () => {
|
|
94
|
+
const result = calculateMediaSeoScore({
|
|
95
|
+
fileName: 'hero-banner.jpg',
|
|
96
|
+
mimeType: 'image/jpeg',
|
|
97
|
+
altText: 'Actuate Media team collaborating in a modern open office space',
|
|
98
|
+
title: 'Actuate Media Hero Banner',
|
|
99
|
+
caption: 'Our talented team at work',
|
|
100
|
+
description: '',
|
|
101
|
+
focusKeyword: 'actuate media',
|
|
102
|
+
});
|
|
103
|
+
expect(result.score).toBe(MEDIA_SEO_WEIGHTS.altText +
|
|
104
|
+
MEDIA_SEO_WEIGHTS.title +
|
|
105
|
+
MEDIA_SEO_WEIGHTS.caption +
|
|
106
|
+
MEDIA_SEO_WEIGHTS.descriptiveFileName +
|
|
107
|
+
MEDIA_SEO_WEIGHTS.focusKeyword);
|
|
108
|
+
expect(result.score).toBe(80);
|
|
109
|
+
expect(result.grade).toBe('good');
|
|
110
|
+
expect(result.issues.map((i) => i.type)).toContain('missing-description');
|
|
111
|
+
expect(result.issues.map((i) => i.type)).not.toContain('missing-alt');
|
|
112
|
+
});
|
|
113
|
+
it('scores a bare generic image at 0 / critical with the expected issues', () => {
|
|
114
|
+
const result = calculateMediaSeoScore({
|
|
115
|
+
fileName: 'IMG_4892.jpg',
|
|
116
|
+
mimeType: 'image/jpeg',
|
|
117
|
+
});
|
|
118
|
+
expect(result.score).toBe(0);
|
|
119
|
+
expect(result.grade).toBe('critical');
|
|
120
|
+
const types = result.issues.map((i) => i.type);
|
|
121
|
+
expect(types).toContain('missing-alt');
|
|
122
|
+
expect(types).toContain('missing-title');
|
|
123
|
+
expect(types).toContain('missing-description');
|
|
124
|
+
expect(types).toContain('generic-filename');
|
|
125
|
+
expect(types).toContain('critical-score');
|
|
126
|
+
});
|
|
127
|
+
it('does not raise missing-alt for non-visual assets like PDFs', () => {
|
|
128
|
+
const result = calculateMediaSeoScore({
|
|
129
|
+
fileName: 'annual-report-2025.pdf',
|
|
130
|
+
mimeType: 'application/pdf',
|
|
131
|
+
title: 'Annual Report 2025',
|
|
132
|
+
description: 'Our full-year results',
|
|
133
|
+
});
|
|
134
|
+
const types = result.issues.map((i) => i.type);
|
|
135
|
+
expect(types).not.toContain('missing-alt');
|
|
136
|
+
});
|
|
137
|
+
it('flags oversized images above the configured threshold', () => {
|
|
138
|
+
const result = calculateMediaSeoScore({
|
|
139
|
+
fileName: 'team-photo.png',
|
|
140
|
+
mimeType: 'image/png',
|
|
141
|
+
sizeBytes: 4 * 1024 * 1024,
|
|
142
|
+
}, { maxImageBytes: 2 * 1024 * 1024 });
|
|
143
|
+
expect(result.issues.map((i) => i.type)).toContain('oversized-image');
|
|
144
|
+
});
|
|
145
|
+
it('does not flag oversized for a small image', () => {
|
|
146
|
+
const result = calculateMediaSeoScore({
|
|
147
|
+
fileName: 'bg-gradient.png',
|
|
148
|
+
mimeType: 'image/png',
|
|
149
|
+
sizeBytes: 45 * 1024,
|
|
150
|
+
});
|
|
151
|
+
expect(result.issues.map((i) => i.type)).not.toContain('oversized-image');
|
|
152
|
+
});
|
|
153
|
+
it('flags missing video caption', () => {
|
|
154
|
+
const result = calculateMediaSeoScore({
|
|
155
|
+
fileName: 'product-demo.mp4',
|
|
156
|
+
mimeType: 'video/mp4',
|
|
157
|
+
title: 'Product Demo',
|
|
158
|
+
});
|
|
159
|
+
expect(result.issues.map((i) => i.type)).toContain('missing-video-caption');
|
|
160
|
+
});
|
|
161
|
+
it('clamps and rounds the score into 0..100', () => {
|
|
162
|
+
const result = calculateMediaSeoScore({
|
|
163
|
+
fileName: 'x.jpg',
|
|
164
|
+
mimeType: 'image/jpeg',
|
|
165
|
+
altText: 'a',
|
|
166
|
+
title: 't',
|
|
167
|
+
description: 'd',
|
|
168
|
+
caption: 'c',
|
|
169
|
+
focusKeyword: 'k',
|
|
170
|
+
});
|
|
171
|
+
expect(result.score).toBeGreaterThanOrEqual(0);
|
|
172
|
+
expect(result.score).toBeLessThanOrEqual(100);
|
|
173
|
+
expect(Number.isInteger(result.score)).toBe(true);
|
|
174
|
+
});
|
|
175
|
+
it('treats whitespace-only metadata as missing', () => {
|
|
176
|
+
const result = calculateMediaSeoScore({
|
|
177
|
+
fileName: 'hero-banner.jpg',
|
|
178
|
+
mimeType: 'image/jpeg',
|
|
179
|
+
altText: ' ',
|
|
180
|
+
title: '\n\t',
|
|
181
|
+
});
|
|
182
|
+
expect(result.issues.map((i) => i.type)).toContain('missing-alt');
|
|
183
|
+
expect(result.issues.map((i) => i.type)).toContain('missing-title');
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
//# sourceMappingURL=seo.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.test.js","sourceRoot":"","sources":["../../../src/__tests__/media/seo.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,iBAAiB,GAElB,MAAM,oBAAoB,CAAA;AAE3B,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;QACpB,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;QACzE,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzB,CAAC,CAAC,CAAA;AACJ,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,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/redirects/graph.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { normalizeRedirectPath, isExternal, resolveChain, buildEdgeMap, detectChainsAndLoops, wouldCreateLoop, isRedirectStale, } from '../../redirects/graph.js';
|
|
3
|
+
describe('normalizeRedirectPath', () => {
|
|
4
|
+
it('ensures a leading slash and strips trailing slash', () => {
|
|
5
|
+
expect(normalizeRedirectPath('about')).toBe('/about');
|
|
6
|
+
expect(normalizeRedirectPath('/about/')).toBe('/about');
|
|
7
|
+
expect(normalizeRedirectPath('/')).toBe('/');
|
|
8
|
+
});
|
|
9
|
+
it('strips query and hash and lowercases', () => {
|
|
10
|
+
expect(normalizeRedirectPath('/About?x=1#h')).toBe('/about');
|
|
11
|
+
});
|
|
12
|
+
it('leaves external URLs intact (lowercased)', () => {
|
|
13
|
+
expect(normalizeRedirectPath('https://Example.com/Path')).toBe('https://example.com/path');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe('isExternal', () => {
|
|
17
|
+
it('detects absolute URLs', () => {
|
|
18
|
+
expect(isExternal('https://x.com')).toBe(true);
|
|
19
|
+
expect(isExternal('/internal')).toBe(false);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
describe('resolveChain', () => {
|
|
23
|
+
const rules = [
|
|
24
|
+
{ id: '1', from: '/a', to: '/b' },
|
|
25
|
+
{ id: '2', from: '/b', to: '/c' },
|
|
26
|
+
{ id: '3', from: '/c', to: '/d' },
|
|
27
|
+
];
|
|
28
|
+
it('follows the chain to the terminal', () => {
|
|
29
|
+
const map = buildEdgeMap(rules);
|
|
30
|
+
const res = resolveChain(map, '/a');
|
|
31
|
+
expect(res.loop).toBe(false);
|
|
32
|
+
expect(res.terminal).toBe('/d');
|
|
33
|
+
expect(res.hops).toEqual(['/a', '/b', '/c', '/d']);
|
|
34
|
+
});
|
|
35
|
+
it('detects loops', () => {
|
|
36
|
+
const map = buildEdgeMap([
|
|
37
|
+
{ id: '1', from: '/a', to: '/b' },
|
|
38
|
+
{ id: '2', from: '/b', to: '/a' },
|
|
39
|
+
]);
|
|
40
|
+
const res = resolveChain(map, '/a');
|
|
41
|
+
expect(res.loop).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
describe('detectChainsAndLoops', () => {
|
|
45
|
+
it('detects a multi-hop chain', () => {
|
|
46
|
+
const chains = detectChainsAndLoops([
|
|
47
|
+
{ id: '1', from: '/a', to: '/b' },
|
|
48
|
+
{ id: '2', from: '/b', to: '/c' },
|
|
49
|
+
]);
|
|
50
|
+
const chain = chains.find((c) => c.kind === 'chain');
|
|
51
|
+
expect(chain).toBeTruthy();
|
|
52
|
+
expect(chain.suggestedFrom).toBe('/a');
|
|
53
|
+
expect(chain.suggestedTo).toBe('/c');
|
|
54
|
+
});
|
|
55
|
+
it('detects a loop', () => {
|
|
56
|
+
const chains = detectChainsAndLoops([
|
|
57
|
+
{ id: '1', from: '/a', to: '/b' },
|
|
58
|
+
{ id: '2', from: '/b', to: '/a' },
|
|
59
|
+
]);
|
|
60
|
+
expect(chains.some((c) => c.kind === 'loop')).toBe(true);
|
|
61
|
+
});
|
|
62
|
+
it('ignores a single-hop redirect', () => {
|
|
63
|
+
const chains = detectChainsAndLoops([{ id: '1', from: '/a', to: '/b' }]);
|
|
64
|
+
expect(chains).toHaveLength(0);
|
|
65
|
+
});
|
|
66
|
+
it('ignores disabled rules', () => {
|
|
67
|
+
const chains = detectChainsAndLoops([
|
|
68
|
+
{ id: '1', from: '/a', to: '/b' },
|
|
69
|
+
{ id: '2', from: '/b', to: '/c', enabled: false },
|
|
70
|
+
]);
|
|
71
|
+
expect(chains).toHaveLength(0);
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
describe('wouldCreateLoop', () => {
|
|
75
|
+
const rules = [{ id: '1', from: '/b', to: '/a' }];
|
|
76
|
+
it('flags a direct loop', () => {
|
|
77
|
+
expect(wouldCreateLoop(rules, '/a', '/b')).toBe(true);
|
|
78
|
+
});
|
|
79
|
+
it('flags a self-redirect', () => {
|
|
80
|
+
expect(wouldCreateLoop(rules, '/x', '/x')).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
it('allows a safe redirect', () => {
|
|
83
|
+
expect(wouldCreateLoop(rules, '/a', '/c')).toBe(false);
|
|
84
|
+
});
|
|
85
|
+
it('allows external targets', () => {
|
|
86
|
+
expect(wouldCreateLoop(rules, '/a', 'https://x.com')).toBe(false);
|
|
87
|
+
});
|
|
88
|
+
it('ignores the rule being edited', () => {
|
|
89
|
+
expect(wouldCreateLoop(rules, '/b', '/a', '1')).toBe(false);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe('isRedirectStale', () => {
|
|
93
|
+
it('treats never-hit as stale', () => {
|
|
94
|
+
expect(isRedirectStale(null)).toBe(true);
|
|
95
|
+
});
|
|
96
|
+
it('treats a recent hit as not stale', () => {
|
|
97
|
+
expect(isRedirectStale(new Date())).toBe(false);
|
|
98
|
+
});
|
|
99
|
+
it('treats an old hit as stale', () => {
|
|
100
|
+
const old = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000);
|
|
101
|
+
expect(isRedirectStale(old)).toBe(true);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
//# sourceMappingURL=graph.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graph.test.js","sourceRoot":"","sources":["../../../src/__tests__/redirects/graph.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EACL,qB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,EAAE,GAAG,EAAE;QACjC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACnE,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,CAAC,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;IACF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;QAC3D,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/redirects/suggest.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { suggestRedirectTarget } from '../../redirects/suggest.js';
|
|
3
|
+
describe('suggestRedirectTarget', () => {
|
|
4
|
+
const candidates = [
|
|
5
|
+
{ url: '/services/enterprise-plans', title: 'Enterprise Plans' },
|
|
6
|
+
{ url: '/about', title: 'About Us' },
|
|
7
|
+
{ url: '/blog/launch', title: 'Launch announcement' },
|
|
8
|
+
];
|
|
9
|
+
it('matches a dead path to the most similar live URL', () => {
|
|
10
|
+
const result = suggestRedirectTarget('/services/enterprise', candidates);
|
|
11
|
+
expect(result).not.toBeNull();
|
|
12
|
+
expect(result.toPath).toBe('/services/enterprise-plans');
|
|
13
|
+
expect(result.confidence).toBeGreaterThan(30);
|
|
14
|
+
});
|
|
15
|
+
it('returns null when nothing clears the threshold', () => {
|
|
16
|
+
const result = suggestRedirectTarget('/zzz-nothing-related', candidates, 40);
|
|
17
|
+
expect(result).toBeNull();
|
|
18
|
+
});
|
|
19
|
+
it('returns null with no candidates', () => {
|
|
20
|
+
expect(suggestRedirectTarget('/x', [])).toBeNull();
|
|
21
|
+
});
|
|
22
|
+
it('uses title similarity when path tokens are weak', () => {
|
|
23
|
+
const result = suggestRedirectTarget('/launch-announcement', candidates);
|
|
24
|
+
expect(result).not.toBeNull();
|
|
25
|
+
expect(result.toPath).toBe('/blog/launch');
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=suggest.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.test.js","sourceRoot":"","sources":["../../../src/__tests__/redirects/suggest.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAElE,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,MAAM,UAAU,GAAG;QACjB,EAAE,GAAG,EAAE,4BAA4B,EAAE,KAAK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
1
|
+
{"version":3,"file":"audit-engine.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/seo/audit-engine.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { runSeoAuditAnalysis, buildQuickWins, issueKeyFor, } from '../../seo/audit-engine.js';
|
|
3
|
+
const goodPage = {
|
|
4
|
+
entityType: 'page',
|
|
5
|
+
entityId: 'p1',
|
|
6
|
+
title: 'Home',
|
|
7
|
+
url: '/',
|
|
8
|
+
content: '<h1>Home</h1>' + 'word '.repeat(400),
|
|
9
|
+
metaTitle: 'Home — Acme, the modern CMS for teams',
|
|
10
|
+
metaDescription: 'Acme is the modern content platform that helps marketing and engineering teams ship reliable, fast, search-optimised websites together without friction every week.',
|
|
11
|
+
focusKeyword: 'modern cms',
|
|
12
|
+
canonicalUrl: 'https://acme.com/',
|
|
13
|
+
ogTitle: 'Home',
|
|
14
|
+
ogDescription: 'Welcome',
|
|
15
|
+
ogImage: 'https://acme.com/og.png',
|
|
16
|
+
structuredDataType: 'WebPage',
|
|
17
|
+
noindex: false,
|
|
18
|
+
};
|
|
19
|
+
function findIssues(issues, type) {
|
|
20
|
+
return issues.filter((i) => i.type === type);
|
|
21
|
+
}
|
|
22
|
+
describe('runSeoAuditAnalysis', () => {
|
|
23
|
+
it('produces no content issues for a fully-optimised page', () => {
|
|
24
|
+
const result = runSeoAuditAnalysis([goodPage]);
|
|
25
|
+
expect(result.pages).toHaveLength(1);
|
|
26
|
+
expect(result.pages[0].score).toBeGreaterThanOrEqual(95);
|
|
27
|
+
expect(result.counts.total).toBe(0);
|
|
28
|
+
});
|
|
29
|
+
it('detects missing meta description', () => {
|
|
30
|
+
const result = runSeoAuditAnalysis([{ ...goodPage, metaDescription: '' }]);
|
|
31
|
+
const found = findIssues(result.issues, 'missing-meta-description');
|
|
32
|
+
expect(found).toHaveLength(1);
|
|
33
|
+
expect(found[0].severity).toBe('warning');
|
|
34
|
+
expect(found[0].fixActionType).toBe('edit-metadata');
|
|
35
|
+
});
|
|
36
|
+
it('detects duplicate meta titles across pages', () => {
|
|
37
|
+
const a = { ...goodPage, entityId: 'a', url: '/about', metaTitle: 'Same Title Here For Both' };
|
|
38
|
+
const b = {
|
|
39
|
+
...goodPage,
|
|
40
|
+
entityId: 'b',
|
|
41
|
+
url: '/services',
|
|
42
|
+
metaTitle: 'Same Title Here For Both',
|
|
43
|
+
};
|
|
44
|
+
const result = runSeoAuditAnalysis([a, b]);
|
|
45
|
+
const dup = findIssues(result.issues, 'duplicate-meta-title');
|
|
46
|
+
expect(dup).toHaveLength(1);
|
|
47
|
+
expect(dup[0].severity).toBe('critical');
|
|
48
|
+
expect(dup[0].relatedEntityIds.sort()).toEqual(['a', 'b']);
|
|
49
|
+
});
|
|
50
|
+
it('does not flag duplicate when titles differ', () => {
|
|
51
|
+
const a = { ...goodPage, entityId: 'a', metaTitle: 'Title A unique enough here' };
|
|
52
|
+
const b = { ...goodPage, entityId: 'b', metaTitle: 'Title B unique enough here' };
|
|
53
|
+
const result = runSeoAuditAnalysis([a, b]);
|
|
54
|
+
expect(findIssues(result.issues, 'duplicate-meta-title')).toHaveLength(0);
|
|
55
|
+
});
|
|
56
|
+
it('detects broken internal links from signals', () => {
|
|
57
|
+
const result = runSeoAuditAnalysis([goodPage], {
|
|
58
|
+
brokenLinks: [
|
|
59
|
+
{ url: '/services/enterprise', fromEntityId: 'p1', fromTitle: 'Home', fromUrl: '/' },
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
const broken = findIssues(result.issues, 'broken-internal-link');
|
|
63
|
+
expect(broken).toHaveLength(1);
|
|
64
|
+
expect(broken[0].severity).toBe('critical');
|
|
65
|
+
expect(broken[0].category).toBe('technical');
|
|
66
|
+
});
|
|
67
|
+
it('detects missing H1 only in non-empty content', () => {
|
|
68
|
+
const noH1 = { ...goodPage, content: '<p>no heading here</p>' };
|
|
69
|
+
const result = runSeoAuditAnalysis([noH1]);
|
|
70
|
+
expect(findIssues(result.issues, 'missing-h1')).toHaveLength(1);
|
|
71
|
+
});
|
|
72
|
+
it('detects thin content', () => {
|
|
73
|
+
const thin = { ...goodPage, content: '<h1>x</h1> short body', wordCount: 20 };
|
|
74
|
+
const result = runSeoAuditAnalysis([thin]);
|
|
75
|
+
expect(findIssues(result.issues, 'thin-content')).toHaveLength(1);
|
|
76
|
+
});
|
|
77
|
+
it('detects missing alt text on images', () => {
|
|
78
|
+
const withImg = { ...goodPage, content: '<h1>x</h1>' + 'w '.repeat(400) + '<img src="a.png">' };
|
|
79
|
+
const result = runSeoAuditAnalysis([withImg]);
|
|
80
|
+
expect(findIssues(result.issues, 'missing-alt-text')).toHaveLength(1);
|
|
81
|
+
});
|
|
82
|
+
it('counts issues by severity', () => {
|
|
83
|
+
const bad = {
|
|
84
|
+
entityType: 'page',
|
|
85
|
+
entityId: 'bad',
|
|
86
|
+
title: 'Bad',
|
|
87
|
+
url: '/bad',
|
|
88
|
+
content: '<p>thin</p>',
|
|
89
|
+
metaTitle: '',
|
|
90
|
+
metaDescription: '',
|
|
91
|
+
};
|
|
92
|
+
const result = runSeoAuditAnalysis([bad]);
|
|
93
|
+
expect(result.counts.total).toBeGreaterThan(0);
|
|
94
|
+
expect(result.counts.warning).toBeGreaterThanOrEqual(2); // missing title + desc
|
|
95
|
+
});
|
|
96
|
+
it('computes a site score that drops with missing metadata', () => {
|
|
97
|
+
const great = runSeoAuditAnalysis([goodPage]).siteScore.score;
|
|
98
|
+
const poor = runSeoAuditAnalysis([
|
|
99
|
+
{
|
|
100
|
+
...goodPage,
|
|
101
|
+
metaTitle: '',
|
|
102
|
+
metaDescription: '',
|
|
103
|
+
structuredDataType: '',
|
|
104
|
+
ogImage: '',
|
|
105
|
+
canonicalUrl: '',
|
|
106
|
+
},
|
|
107
|
+
]).siteScore.score;
|
|
108
|
+
expect(great).toBeGreaterThan(poor);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe('issueKeyFor', () => {
|
|
112
|
+
it('builds a stable key', () => {
|
|
113
|
+
expect(issueKeyFor('missing-meta-title', 'p1')).toBe('missing-meta-title:p1');
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
describe('buildQuickWins', () => {
|
|
117
|
+
const mk = (type, impact, id) => ({
|
|
118
|
+
issueKey: `${type}:${id}`,
|
|
119
|
+
entityType: 'page',
|
|
120
|
+
entityId: id,
|
|
121
|
+
entityTitle: id,
|
|
122
|
+
url: `/${id}`,
|
|
123
|
+
severity: 'warning',
|
|
124
|
+
category: 'content',
|
|
125
|
+
type,
|
|
126
|
+
title: type,
|
|
127
|
+
description: '',
|
|
128
|
+
impact,
|
|
129
|
+
recommendation: '',
|
|
130
|
+
fixable: true,
|
|
131
|
+
fixActionType: 'edit-metadata',
|
|
132
|
+
relatedEntityIds: [],
|
|
133
|
+
});
|
|
134
|
+
it('ranks higher-impact wins first', () => {
|
|
135
|
+
const wins = buildQuickWins([
|
|
136
|
+
mk('missing-canonical', 'Low', '1'),
|
|
137
|
+
mk('missing-meta-description', 'High', '2'),
|
|
138
|
+
mk('missing-meta-description', 'High', '3'),
|
|
139
|
+
]);
|
|
140
|
+
expect(wins[0].issueType).toBe('missing-meta-description');
|
|
141
|
+
expect(wins[0].count).toBe(2);
|
|
142
|
+
});
|
|
143
|
+
it('excludes non-fixable issues', () => {
|
|
144
|
+
const issue = { ...mk('thin-content', 'Low', '1'), fixable: false };
|
|
145
|
+
expect(buildQuickWins([issue])).toHaveLength(0);
|
|
146
|
+
});
|
|
147
|
+
it('caps at 5 wins', () => {
|
|
148
|
+
const issues = Array.from({ length: 10 }, (_, i) => mk(`type-${i}`, 'Medium', String(i)));
|
|
149
|
+
expect(buildQuickWins(issues).length).toBeLessThanOrEqual(5);
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=audit-engine.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-engine.test.js","source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