@rsc-kit/core 0.8.0 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsc-kit/core",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "React Server Components on any JavaScript server: a Vite plugin that discovers the route tree, and a host adapter that serves it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,6 +25,10 @@
25
25
  "types": "./dist/runtime.d.ts",
26
26
  "default": "./dist/runtime.js"
27
27
  },
28
+ "./metadata": {
29
+ "types": "./dist/metadata.d.ts",
30
+ "default": "./dist/metadata.js"
31
+ },
28
32
  "./query": {
29
33
  "types": "./dist/query.d.ts",
30
34
  "default": "./dist/query.js"
@@ -69,10 +73,6 @@
69
73
  "types": "./dist/js/createViteRscApp.d.ts",
70
74
  "default": "./dist/js/createViteRscApp.js"
71
75
  },
72
- "./types": {
73
- "types": "./dist/types.d.ts",
74
- "default": "./dist/types.d.ts"
75
- },
76
76
  "./useOnline": {
77
77
  "types": "./dist/js/useOnline.d.ts",
78
78
  "default": "./dist/js/useOnline.js"
@@ -196,7 +196,7 @@
196
196
  "scripts": {
197
197
  "test": "bun test tests/js",
198
198
  "typecheck": "tsc --noEmit && tsc --noEmit -p tests/js/routeTypes.tsconfig.json",
199
- "build": "rm -rf dist && tsc -p tsconfig.build.json && cp src/types.d.ts dist/types.d.ts",
199
+ "build": "rm -rf dist && tsc -p tsconfig.build.json",
200
200
  "prepack": "bun run build"
201
201
  },
202
202
  "repository": {
package/dist/types.d.ts DELETED
@@ -1,82 +0,0 @@
1
- // Ambient types for an RSC app. Copied into the project's source directory by
2
- // the host's build, so a page can annotate its metadata without importing
3
- // anything.
4
- //
5
- // The host global (rpc) is NOT declared here: its name is configurable, so the
6
- // host generates that declaration with the name it actually installed. Two
7
- // ambient declarations of the same function would conflict.
8
-
9
- /**
10
- * Page metadata for RSC pages.
11
- *
12
- * @example
13
- * ```tsx
14
- * export const metadata: Metadata = {
15
- * title: 'My Page',
16
- * description: 'Page description',
17
- * keywords: ['react', 'laravel'],
18
- * };
19
- * ```
20
- */
21
- interface IconDescriptor {
22
- url: string | URL;
23
- type?: string;
24
- sizes?: string;
25
- color?: string;
26
- rel?: string;
27
- media?: string;
28
- fetchPriority?: 'high' | 'low' | 'auto';
29
- }
30
-
31
- type IconURL = string | URL;
32
-
33
- interface Icons {
34
- icon?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
35
- apple?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
36
- shortcut?: IconURL | IconDescriptor | (IconURL | IconDescriptor)[];
37
- other?: IconDescriptor | IconDescriptor[];
38
- }
39
-
40
- /** A layout's title, wrapping the titles of the pages beneath it. */
41
- interface TitleTemplate {
42
- /** `%s` stands in for the page's own title. */
43
- template?: string;
44
- /** Used by a page that exports no title of its own. */
45
- default?: string;
46
- }
47
-
48
- interface Metadata {
49
- /** A string on a page; a template on a layout, applied to the pages below it. */
50
- title?: string | TitleTemplate;
51
- description?: string;
52
- keywords?: string | string[];
53
- author?: string;
54
- robots?: string;
55
- icons?: IconURL | (IconURL | IconDescriptor)[] | Icons | null;
56
- 'og:title'?: string;
57
- 'og:description'?: string;
58
- 'og:image'?: string;
59
- 'og:url'?: string;
60
- 'og:type'?: string;
61
- 'og:site_name'?: string;
62
- 'twitter:card'?: string;
63
- 'twitter:title'?: string;
64
- 'twitter:description'?: string;
65
- 'twitter:image'?: string;
66
- 'twitter:site'?: string;
67
- [key: string]: string | string[] | TitleTemplate | Icons | IconURL | (IconURL | IconDescriptor)[] | null | undefined;
68
- }
69
-
70
- /**
71
- * Metadata that depends on the request.
72
- *
73
- * Receives the same awaitables a page does, so one shape is learned rather
74
- * than two:
75
- *
76
- * export const generateMetadata: GenerateMetadata<{ slug: string }> =
77
- * async ({ params }) => ({ title: (await params).slug })
78
- */
79
- type GenerateMetadata<P = Record<string, string>> = (args: {
80
- params: Promise<P>;
81
- searchParams: Promise<URLSearchParams>;
82
- }) => Metadata | Promise<Metadata>;