Initial boiler plate project
This commit is contained in:
12
node_modules/next/dist/server/og/image-response.d.ts
generated
vendored
Normal file
12
node_modules/next/dist/server/og/image-response.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
type OgModule = typeof import('next/dist/compiled/@vercel/og');
|
||||
/**
|
||||
* The ImageResponse class allows you to generate dynamic images using JSX and CSS.
|
||||
* This is useful for generating social media images such as Open Graph images, Twitter cards, and more.
|
||||
*
|
||||
* Read more: [Next.js Docs: `ImageResponse`](https://nextjs.org/docs/app/api-reference/functions/image-response)
|
||||
*/
|
||||
export declare class ImageResponse extends Response {
|
||||
static displayName: string;
|
||||
constructor(...args: ConstructorParameters<OgModule['ImageResponse']>);
|
||||
}
|
||||
export {};
|
||||
49
node_modules/next/dist/server/og/image-response.js
generated
vendored
Normal file
49
node_modules/next/dist/server/og/image-response.js
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "ImageResponse", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return ImageResponse;
|
||||
}
|
||||
});
|
||||
function importModule() {
|
||||
return import(process.env.NEXT_RUNTIME === "edge" ? "next/dist/compiled/@vercel/og/index.edge.js" : "next/dist/compiled/@vercel/og/index.node.js");
|
||||
}
|
||||
class ImageResponse extends Response {
|
||||
static #_ = this.displayName = "ImageResponse";
|
||||
constructor(...args){
|
||||
const readable = new ReadableStream({
|
||||
async start (controller) {
|
||||
const OGImageResponse = // So far we have to manually determine which build to use,
|
||||
// as the auto resolving is not working
|
||||
(await importModule()).ImageResponse;
|
||||
const imageResponse = new OGImageResponse(...args);
|
||||
if (!imageResponse.body) {
|
||||
return controller.close();
|
||||
}
|
||||
const reader = imageResponse.body.getReader();
|
||||
while(true){
|
||||
const { done, value } = await reader.read();
|
||||
if (done) {
|
||||
return controller.close();
|
||||
}
|
||||
controller.enqueue(value);
|
||||
}
|
||||
}
|
||||
});
|
||||
const options = args[1] || {};
|
||||
super(readable, {
|
||||
headers: {
|
||||
"content-type": "image/png",
|
||||
"cache-control": process.env.NODE_ENV === "development" ? "no-cache, no-store" : "public, immutable, no-transform, max-age=31536000",
|
||||
...options.headers
|
||||
},
|
||||
status: options.status,
|
||||
statusText: options.statusText
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//# sourceMappingURL=image-response.js.map
|
||||
1
node_modules/next/dist/server/og/image-response.js.map
generated
vendored
Normal file
1
node_modules/next/dist/server/og/image-response.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/server/og/image-response.ts"],"names":["ImageResponse","importModule","process","env","NEXT_RUNTIME","Response","displayName","constructor","args","readable","ReadableStream","start","controller","OGImageResponse","imageResponse","body","close","reader","getReader","done","value","read","enqueue","options","headers","NODE_ENV","status","statusText"],"mappings":";;;;+BAkBaA;;;eAAAA;;;AAhBb,SAASC;IAGP,OAAO,MAAM,CACXC,QAAQC,GAAG,CAACC,YAAY,KAAK,SACzB,gDACA;AAER;AAQO,MAAMJ,sBAAsBK;qBACnBC,cAAc;IAC5BC,YAAY,GAAGC,IAAsD,CAAE;QACrE,MAAMC,WAAW,IAAIC,eAAe;YAClC,MAAMC,OAAMC,UAAU;gBACpB,MAAMC,kBAGJ,AAFA,2DAA2D;gBAC3D,uCAAuC;gBACtC,CAAA,MAAMZ,cAAa,EAAGD,aAAa;gBACtC,MAAMc,gBAAgB,IAAID,mBAAmBL;gBAE7C,IAAI,CAACM,cAAcC,IAAI,EAAE;oBACvB,OAAOH,WAAWI,KAAK;gBACzB;gBAEA,MAAMC,SAASH,cAAcC,IAAI,CAAEG,SAAS;gBAC5C,MAAO,KAAM;oBACX,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAG,MAAMH,OAAOI,IAAI;oBACzC,IAAIF,MAAM;wBACR,OAAOP,WAAWI,KAAK;oBACzB;oBACAJ,WAAWU,OAAO,CAACF;gBACrB;YACF;QACF;QAEA,MAAMG,UAAUf,IAAI,CAAC,EAAE,IAAI,CAAC;QAE5B,KAAK,CAACC,UAAU;YACde,SAAS;gBACP,gBAAgB;gBAChB,iBACEtB,QAAQC,GAAG,CAACsB,QAAQ,KAAK,gBACrB,uBACA;gBACN,GAAGF,QAAQC,OAAO;YACpB;YACAE,QAAQH,QAAQG,MAAM;YACtBC,YAAYJ,QAAQI,UAAU;QAChC;IACF;AACF"}
|
||||
Reference in New Issue
Block a user