[ci] format

This commit is contained in:
lilnasy 2023-08-11 14:11:56 +00:00 committed by astrobot-houston
parent f974c95a27
commit 6fafb3d15d
3 changed files with 15 additions and 11 deletions

View file

@ -1,9 +1,9 @@
interface NetlifyLocals {
runtime: {
/**
* On-demand Builders support an optional time to live (TTL) pattern that allows you to set a fixed duration of time after which a cached builder response is invalidated. This allows you to force a refresh of a builder-generated response without a new deploy.
* @param ttl time to live, in seconds
*/
setBuildersTtl(ttl: number): void
}
}
runtime: {
/**
* On-demand Builders support an optional time to live (TTL) pattern that allows you to set a fixed duration of time after which a cached builder response is invalidated. This allows you to force a refresh of a builder-generated response without a new deploy.
* @param ttl time to live, in seconds
*/
setBuildersTtl(ttl: number): void;
};
}

View file

@ -87,8 +87,12 @@ export const createExports = (manifest: SSRManifest, args: Args) => {
let responseTtl = undefined;
locals.runtime = builders
? { setBuildersTtl(ttl: number) { responseTtl = ttl } }
: {}
? {
setBuildersTtl(ttl: number) {
responseTtl = ttl;
},
}
: {};
const response: Response = await app.render(request, routeData, locals);
const responseHeaders = Object.fromEntries(response.headers.entries());

View file

@ -12,7 +12,7 @@ describe('Builders', () => {
output: 'server',
adapter: netlifyAdapter({
dist: new URL('./fixtures/builders/dist/', import.meta.url),
builders: true
builders: true,
}),
site: `http://example.com`,
integrations: [testIntegration()],