next 15.4.2-canary.22 → 15.4.2-canary.23

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.
Files changed (59) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/generated-native.d.ts +0 -33
  4. package/dist/build/swc/index.js +1 -11
  5. package/dist/build/swc/index.js.map +1 -1
  6. package/dist/build/swc/types.d.ts +1 -7
  7. package/dist/build/webpack-config.js +2 -2
  8. package/dist/client/app-bootstrap.js +1 -1
  9. package/dist/client/index.js +1 -1
  10. package/dist/compiled/@vercel/og/emoji/index.d.ts +15 -0
  11. package/dist/compiled/@vercel/og/figma/index.d.ts +7 -0
  12. package/dist/compiled/@vercel/og/index.edge.d.ts +5 -9
  13. package/dist/compiled/@vercel/og/index.edge.js +2587 -3024
  14. package/dist/compiled/@vercel/og/index.node.d.ts +7 -10
  15. package/dist/compiled/@vercel/og/index.node.js +2585 -3022
  16. package/dist/compiled/@vercel/og/language/index.d.ts +28 -0
  17. package/dist/compiled/@vercel/og/og.d.ts +1 -0
  18. package/dist/compiled/@vercel/og/package.json +1 -1
  19. package/dist/compiled/@vercel/og/satori/index.d.ts +4 -1
  20. package/dist/compiled/@vercel/og/types.d.ts +118 -0
  21. package/dist/compiled/@vercel/og/yoga.wasm +0 -0
  22. package/dist/esm/build/index.js +2 -2
  23. package/dist/esm/build/swc/generated-native.d.ts +0 -33
  24. package/dist/esm/build/swc/index.js +1 -11
  25. package/dist/esm/build/swc/index.js.map +1 -1
  26. package/dist/esm/build/swc/types.js.map +1 -1
  27. package/dist/esm/build/webpack-config.js +2 -2
  28. package/dist/esm/client/app-bootstrap.js +1 -1
  29. package/dist/esm/client/index.js +1 -1
  30. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  31. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  32. package/dist/esm/server/lib/app-info-log.js +1 -1
  33. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +3 -84
  34. package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  35. package/dist/esm/server/lib/start-server.js +1 -1
  36. package/dist/esm/shared/lib/canary-only.js +1 -1
  37. package/dist/esm/shared/lib/turbopack/utils.js +28 -32
  38. package/dist/esm/shared/lib/turbopack/utils.js.map +1 -1
  39. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  40. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  41. package/dist/server/lib/app-info-log.js +1 -1
  42. package/dist/server/lib/router-utils/setup-dev-bundler.js +3 -84
  43. package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
  44. package/dist/server/lib/start-server.js +1 -1
  45. package/dist/shared/lib/canary-only.js +1 -1
  46. package/dist/shared/lib/turbopack/utils.d.ts +1 -2
  47. package/dist/shared/lib/turbopack/utils.js +28 -36
  48. package/dist/shared/lib/turbopack/utils.js.map +1 -1
  49. package/dist/telemetry/anonymous-meta.js +1 -1
  50. package/dist/telemetry/events/session-stopped.js +2 -2
  51. package/dist/telemetry/events/version.js +2 -2
  52. package/package.json +15 -20
  53. package/server.d.ts +1 -1
  54. package/dist/compiled/@vercel/og/types-d38469ff.d.ts +0 -74
  55. package/dist/esm/server/lib/router-utils/mcp.js +0 -471
  56. package/dist/esm/server/lib/router-utils/mcp.js.map +0 -1
  57. package/dist/server/lib/router-utils/mcp.d.ts +0 -4
  58. package/dist/server/lib/router-utils/mcp.js +0 -534
  59. package/dist/server/lib/router-utils/mcp.js.map +0 -1
@@ -0,0 +1,28 @@
1
+ export declare class FontDetector {
2
+ private rangesByLang;
3
+ detect(text: string, fonts: string[]): Promise<{
4
+ [lang: string]: string;
5
+ }>;
6
+ private detectSegment;
7
+ private load;
8
+ private addDetectors;
9
+ }
10
+ export declare const languageFontMap: {
11
+ 'ja-JP': string;
12
+ 'ko-KR': string;
13
+ 'zh-CN': string;
14
+ 'zh-TW': string;
15
+ 'zh-HK': string;
16
+ 'th-TH': string;
17
+ 'bn-IN': string;
18
+ 'ar-AR': string;
19
+ 'ta-IN': string;
20
+ 'ml-IN': string;
21
+ 'he-IL': string;
22
+ 'te-IN': string;
23
+ devanagari: string;
24
+ kannada: string;
25
+ symbol: string[];
26
+ math: string;
27
+ unknown: string;
28
+ };
@@ -0,0 +1 @@
1
+ export default function render(satori: any, resvg: any, opts: any, defaultFonts: any, element: any): Promise<Uint8Array>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/og",
3
- "version": "0.8.5",
3
+ "version": "0.7.2",
4
4
  "license": "MPL-2.0",
5
5
  "type": "module",
6
6
  "main": "./index.node.js",
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ type Yoga = any;
2
3
 
3
4
  declare const code: {
4
5
  readonly 'ja-JP': RegExp;
@@ -148,6 +149,8 @@ interface SatoriNode {
148
149
  textContent?: string;
149
150
  }
150
151
 
152
+ declare function init(yoga: Yoga): void;
153
+
151
154
  type SatoriOptions = ({
152
155
  width: number;
153
156
  height: number;
@@ -168,4 +171,4 @@ type SatoriOptions = ({
168
171
 
169
172
  declare function satori(element: ReactNode, options: SatoriOptions): Promise<string>;
170
173
 
171
- export { FontOptions as Font, FontStyle, Weight as FontWeight, Locale, SatoriNode, SatoriOptions, satori as default };
174
+ export { FontOptions as Font, FontStyle, Weight as FontWeight, Locale, SatoriNode, SatoriOptions, satori as default, init };
@@ -0,0 +1,118 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="react" />
3
+ /// <reference types="node" />
4
+ /// <reference types="node" />
5
+ import type { SatoriOptions } from "next/dist/compiled/@vercel/og/satori";
6
+ import type { EmojiType } from './emoji';
7
+ import type { OutgoingHttpHeader } from 'http';
8
+ type ImageOptions = {
9
+ /**
10
+ * The width of the image.
11
+ *
12
+ * @type {number}
13
+ * @default 1200
14
+ */
15
+ width?: number;
16
+ /**
17
+ * The height of the image.
18
+ *
19
+ * @type {number}
20
+ * @default 630
21
+ */
22
+ height?: number;
23
+ /**
24
+ * Display debug information on the image.
25
+ *
26
+ * @type {boolean}
27
+ * @default false
28
+ */
29
+ debug?: boolean;
30
+ /**
31
+ * A list of fonts to use.
32
+ *
33
+ * @type {{ data: ArrayBuffer; name: string; weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900; style?: 'normal' | 'italic' }[]}
34
+ * @default Noto Sans Latin Regular.
35
+ */
36
+ fonts?: SatoriOptions['fonts'];
37
+ /**
38
+ * Using a specific Emoji style. Defaults to `twemoji`.
39
+ *
40
+ * @type {EmojiType}
41
+ * @default 'twemoji'
42
+ */
43
+ emoji?: EmojiType;
44
+ };
45
+ export type ImageResponseNodeOptions = ImageOptions & {
46
+ status?: number;
47
+ statusText?: string;
48
+ headers?: OutgoingHttpHeader[];
49
+ };
50
+ export type ImageResponseOptions = ImageOptions & ConstructorParameters<typeof Response>[1];
51
+ export interface FigmaImageResponseProps {
52
+ /**
53
+ * Link to the Figma template frame.
54
+ *
55
+ * You can get the URL in Figma by right-clicking a frame and selecting "Copy link".
56
+ * @example https://www.figma.com/file/QjGNQixWnhu300e1Xzdl2y/OG-Images?type=design&node-id=11356-2443&mode=design&t=yLROd7ro8mP1PxMY-4
57
+ */
58
+ url: string;
59
+ /**
60
+ * A mapping between Figma layer name and the value you want to replace it with.
61
+ *
62
+ * @example Sets Figma text layer named "Title" to "How to create OG Images"
63
+ * ```js
64
+ * { "Title": "How to create OG Images" }
65
+ * ```
66
+ *
67
+ * @example Sets multiple Figma text layers and provides custom styles
68
+ * ```js
69
+ * {
70
+ * "Title": { value: "How to create OG Images", props: { color: "red", centerHorizontally: true } },
71
+ * "Description": { value: "A short story", props: { centerHorizontally: true } },
72
+ * }
73
+ * ```
74
+ *
75
+ * `centerHorizontally` centers text layer horizontally.
76
+ */
77
+ template: Record<string, FigmaComplexTemplate | string>;
78
+ /**
79
+ * The font names must match the font names in Figma.
80
+ */
81
+ fonts?: FontOptions[];
82
+ /**
83
+ * The same as {@link ImageResponseOptions} except `width` and `height`. `width` and `height` are automatically set from the Figma frame's size.
84
+ */
85
+ imageResponseOptions?: Omit<ImageResponseOptions, 'width' | 'height'>;
86
+ }
87
+ export interface FigmaComplexTemplate {
88
+ value: string;
89
+ props?: {
90
+ centerHorizontally?: boolean;
91
+ } & React.CSSProperties;
92
+ }
93
+ type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
94
+ type Style = 'normal' | 'italic';
95
+ interface FontOptions {
96
+ data: Buffer | ArrayBuffer;
97
+ name: string;
98
+ weight?: Weight;
99
+ style?: Style;
100
+ lang?: string;
101
+ }
102
+ declare module 'react' {
103
+ interface HTMLAttributes<T> {
104
+ /**
105
+ * Specify styles using Tailwind CSS classes. This feature is currently experimental.
106
+ * If `style` prop is also specified, styles generated with `tw` prop will be overridden.
107
+ *
108
+ * Example:
109
+ * - `tw='w-full h-full bg-blue-200'`
110
+ * - `tw='text-9xl'`
111
+ * - `tw='text-[80px]'`
112
+ *
113
+ * @type {string}
114
+ */
115
+ tw?: string;
116
+ }
117
+ }
118
+ export {};
@@ -322,7 +322,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
322
322
  const nextBuildSpan = trace('next-build', undefined, {
323
323
  buildMode: experimentalBuildMode,
324
324
  isTurboBuild: String(isTurbopack),
325
- version: "15.4.2-canary.22"
325
+ version: "15.4.2-canary.23"
326
326
  });
327
327
  NextBuildContext.nextBuildSpan = nextBuildSpan;
328
328
  NextBuildContext.dir = dir;
@@ -709,7 +709,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
709
709
  // Files outside of the distDir can be "type": "module"
710
710
  await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
711
711
  // These are written to distDir, so they need to come after creating and cleaning distDr.
712
- await recordFrameworkVersion("15.4.2-canary.22");
712
+ await recordFrameworkVersion("15.4.2-canary.23");
713
713
  await updateBuildDiagnostics({
714
714
  buildStage: 'start'
715
715
  });
@@ -64,15 +64,9 @@ export interface NapiWrittenEndpoint {
64
64
  serverPaths: Array<NapiServerPath>
65
65
  config: NapiEndpointConfig
66
66
  }
67
- export interface NapiModuleGraphSnapshots {
68
- moduleGraphs: Array<NapiModuleGraphSnapshot>
69
- }
70
67
  export declare function endpointWriteToDisk(endpoint: {
71
68
  __napiType: 'Endpoint'
72
69
  }): Promise<TurbopackResult>
73
- export declare function endpointModuleGraphs(endpoint: {
74
- __napiType: 'Endpoint'
75
- }): Promise<TurbopackResult>
76
70
  export declare function endpointServerChangedSubscribe(
77
71
  endpoint: { __napiType: 'Endpoint' },
78
72
  issues: boolean,
@@ -82,27 +76,6 @@ export declare function endpointClientChangedSubscribe(
82
76
  endpoint: { __napiType: 'Endpoint' },
83
77
  func: (...args: any[]) => any
84
78
  ): { __napiType: 'RootTask' }
85
- export interface NapiModuleReference {
86
- /** The index of the referenced/referencing module in the modules list. */
87
- index: number
88
- /** The export used in the module reference. */
89
- export: string
90
- /** The type of chunking for the module reference. */
91
- chunkingType: string
92
- }
93
- export interface NapiModuleInfo {
94
- ident: RcStr
95
- path: RcStr
96
- depth: number
97
- size: number
98
- retainedSize: number
99
- references: Array<NapiModuleReference>
100
- incomingReferences: Array<NapiModuleReference>
101
- }
102
- export interface NapiModuleGraphSnapshot {
103
- modules: Array<NapiModuleInfo>
104
- entries: Array<number>
105
- }
106
79
  export interface NapiEnvVar {
107
80
  name: RcStr
108
81
  value: RcStr
@@ -313,9 +286,6 @@ export declare function projectWriteAllEntrypointsToDisk(
313
286
  project: { __napiType: 'Project' },
314
287
  appDirOnly: boolean
315
288
  ): Promise<TurbopackResult>
316
- export declare function projectEntrypoints(project: {
317
- __napiType: 'Project'
318
- }): Promise<TurbopackResult>
319
289
  export declare function projectEntrypointsSubscribe(
320
290
  project: { __napiType: 'Project' },
321
291
  func: (...args: any[]) => any
@@ -392,9 +362,6 @@ export declare function projectGetSourceMapSync(
392
362
  project: { __napiType: 'Project' },
393
363
  filePath: RcStr
394
364
  ): string | null
395
- export declare function projectModuleGraph(project: {
396
- __napiType: 'Project'
397
- }): Promise<TurbopackResult>
398
365
  /**
399
366
  * A version of [`NapiNextTurbopackCallbacks`] that can accepted as an argument to a napi function.
400
367
  *
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
11
11
  import { getDefineEnv } from '../define-env';
12
12
  import { getReactCompilerLoader } from '../get-babel-loader-config';
13
13
  import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
14
- const nextVersion = "15.4.2-canary.22";
14
+ const nextVersion = "15.4.2-canary.23";
15
15
  const ArchName = arch();
16
16
  const PlatformName = platform();
17
17
  function infoLog(...args) {
@@ -426,10 +426,6 @@ function bindingToApi(binding, _wasm) {
426
426
  const napiEndpoints = await binding.projectWriteAllEntrypointsToDisk(this._nativeProject, appDirOnly);
427
427
  return napiEntrypointsToRawEntrypoints(napiEndpoints);
428
428
  }
429
- async getEntrypoints() {
430
- const napiEndpoints = await binding.projectEntrypoints(this._nativeProject);
431
- return napiEntrypointsToRawEntrypoints(napiEndpoints);
432
- }
433
429
  entrypointsSubscribe() {
434
430
  const subscription = subscribe(false, async (callback)=>binding.projectEntrypointsSubscribe(this._nativeProject, callback));
435
431
  return async function*() {
@@ -464,9 +460,6 @@ function bindingToApi(binding, _wasm) {
464
460
  binding.projectCompilationEventsSubscribe(this._nativeProject, callback, eventTypes);
465
461
  });
466
462
  }
467
- moduleGraph() {
468
- return binding.projectModuleGraph(this._nativeProject);
469
- }
470
463
  invalidatePersistentCache() {
471
464
  return binding.projectInvalidatePersistentCache(this._nativeProject);
472
465
  }
@@ -494,9 +487,6 @@ function bindingToApi(binding, _wasm) {
494
487
  await serverSubscription.next();
495
488
  return serverSubscription;
496
489
  }
497
- async moduleGraphs() {
498
- return binding.endpointModuleGraphs(this._nativeEndpoint);
499
- }
500
490
  }
501
491
  /**
502
492
  * Returns a new copy of next.js config object to avoid mutating the original.