build: add Cloudflare static export and deploy config

This commit is contained in:
2026-10-13 12:54:06 +03:00
parent b9eddc33ee
commit 4a5c54e922
11 changed files with 369 additions and 4 deletions

View File

@@ -195,7 +195,13 @@ describe('content schemas', () => {
})).toThrow(/unrecognized/i);
});
it('accepts only the fixed preview canonical URL and no production hostname', () => {
it('accepts only the fixed preview canonical URL and approved production hostname', () => {
expect(parseSiteConfig({
environment: 'production', canonicalUrl: 'https://lucapislaru.ro/', buildId: 'production-1',
}).canonicalUrl).toBe('https://lucapislaru.ro/');
for (const canonicalUrl of ['http://lucapislaru.ro/', 'https://www.lucapislaru.ro/', 'https://lucapîslaru.ro/', 'https://lucapislaru.ro/path', 'https://lucapislaru.ro/?', 'https://lucapislaru.ro.evil.test/']) {
expect(() => parseSiteConfig({ environment: 'production', canonicalUrl, buildId: 'production-1' })).toThrow();
}
expect(() => parseSiteConfig({
environment: 'preview', canonicalUrl: 'https://portfolio.example.test/', buildId: 'preview-1',
})).toThrow(/portfolio\.localhost/i);