@rsc-kit/core 0.34.0 → 0.36.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/dist/conformance.d.ts +1 -0
- package/dist/conformance.js +7 -0
- package/dist/conformance.js.map +1 -1
- package/dist/filesManifest.d.ts +54 -0
- package/dist/filesManifest.js +165 -0
- package/dist/filesManifest.js.map +1 -0
- package/dist/hostCalls.d.ts +5 -0
- package/dist/hostCalls.js +11 -0
- package/dist/hostCalls.js.map +1 -1
- package/dist/routes.d.ts +4 -2
- package/dist/routes.js +5 -2
- package/dist/routes.js.map +1 -1
- package/dist/vite.js +115 -10
- package/dist/vite.js.map +1 -1
- package/package.json +1 -1
package/dist/conformance.d.ts
CHANGED
|
@@ -68,6 +68,7 @@ export declare const CASES: {
|
|
|
68
68
|
readonly 'Conformance.authorization': "Return the request's Authorization header, as the renderer forwarded it.";
|
|
69
69
|
readonly 'Conformance.cookie': "Return the request's Cookie header, as the renderer forwarded it.";
|
|
70
70
|
readonly 'Conformance.ip': string;
|
|
71
|
+
readonly 'Conformance.userAgent': string;
|
|
71
72
|
readonly 'Conformance.login': 'Set a cookie named "conformance_login" on the response, the way a login sets its session cookie, and return "ok".';
|
|
72
73
|
readonly 'Conformance.flash': 'Leave the one-time message "Saved." of kind "success" for the next page - the adapter\'s flash, which @rsc-kit/core/useFlash shows - and return "ok".';
|
|
73
74
|
readonly 'Conformance.double': 'Take one integer and return it doubled. Arguments that do not fit - a string, none - fail it: a 500, not a refusal.';
|
package/dist/conformance.js
CHANGED
|
@@ -75,6 +75,8 @@ export const CASES = {
|
|
|
75
75
|
'Conformance.cookie': "Return the request's Cookie header, as the renderer forwarded it.",
|
|
76
76
|
'Conformance.ip': "Return the visitor's address the way the app reads it - Laravel's $request->ip(), Go's rsckit.ClientIP(ctx) - " +
|
|
77
77
|
'which is the X-RSC-Client-IP the renderer sent, not the address of the renderer calling.',
|
|
78
|
+
'Conformance.userAgent': "Return the visitor's User-Agent the way the app reads it - Laravel's $request->userAgent(), Go's rsckit.ClientUserAgent(ctx) - " +
|
|
79
|
+
'which is the X-RSC-Client-User-Agent the renderer sent, not the User-Agent of the renderer calling.',
|
|
78
80
|
'Conformance.login': 'Set a cookie named "conformance_login" on the response, the way a login sets its session cookie, and return "ok".',
|
|
79
81
|
'Conformance.flash': 'Leave the one-time message "Saved." of kind "success" for the next page - the adapter\'s flash, which @rsc-kit/core/useFlash shows - and return "ok".',
|
|
80
82
|
'Conformance.double': 'Take one integer and return it doubled. Arguments that do not fit - a string, none - fail it: a 500, not a refusal.',
|
|
@@ -290,6 +292,11 @@ export async function conformance(call, options) {
|
|
|
290
292
|
const value = await withRequest(arrived, () => call('Conformance.ip'));
|
|
291
293
|
expect(value === '203.0.113.7', 'got ' + JSON.stringify(value));
|
|
292
294
|
});
|
|
295
|
+
await check('the visitor\'s User-Agent is their browser\'s, not the renderer\'s', async () => {
|
|
296
|
+
const agent = 'Mozilla/5.0 (Conformance) rsc-kit/test';
|
|
297
|
+
const value = await withRequest(new Request('https://app.test/', { headers: { 'user-agent': agent } }), () => call('Conformance.userAgent'));
|
|
298
|
+
expect(value === agent, 'got ' + JSON.stringify(value));
|
|
299
|
+
});
|
|
293
300
|
await check('a cookie set during a call - a login - reaches the page\'s response', async () => {
|
|
294
301
|
const cookies = await withRequest(new Request('https://app.test/'), () => withResponseDraft(async ({ taken }) => {
|
|
295
302
|
const value = await call('Conformance.login');
|
package/dist/conformance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":";AACA,+EAA+E;AAC/E,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,2CAA2C;AAC3C,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,6CAA6C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QACvG,IAAI,CAAC,CAAC,CAAC,CAAA;IACT,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["#!/usr/bin/env node\n// The contract every backend adapter keeps, as a suite it runs against itself.\n//\n// A backend answers rpc(), actions and guards over one endpoint, and every\n// difference between how it and the engine read that wire is a bug in an\n// app that nobody wrote: a nil slice arriving as null where the type said a\n// list, a timestamp the type called unknown, a refusal that did not come out\n// as the error a page checks for. Each was found by an app, one at a time.\n// This finds them before an adapter ships.\n//\n// The adapter registers the Conformance.* functions described in CASES, in\n// its own language, the way an app would write them; this calls them through\n// the real client and checks what arrives. Where the adapter's manifest types\n// a function, every value it sends is checked against that type too.\n//\n// RSC_PURGE_URL=http://127.0.0.1:8790/ \\\n// RSC_HOST_CALL_SECRET_PREVIOUS=old-secret <start the adapter>\n// rsc-kit-conformance --endpoint http://127.0.0.1:8080/__rsc/host-call \\\n// --secret test-secret --previous-secret old-secret \\\n// --manifest rsc-host.json --purge-port 8790\n//\n// --previous-secret is the secret a rotation is moving away from: an adapter\n// answers it as well while RSC_HOST_CALL_SECRET_PREVIOUS is set, so the\n// renderer's calls keep working while it rolls to the new one.\n//\n// --debug says the adapter was started with its debug on (Laravel:\n// APP_DEBUG=true; Go: RSC_DEBUG=1), and checks that a failure then carries\n// the backend's type and frames - what the development overlay shows.\n//\n// --purge-port is where the suite listens for the adapter's purges: a change\n// a backend makes never passes through the engine, so the backend tells a\n// CDN keeping its pages itself. Start the adapter with RSC_PURGE_URL\n// pointing at that port.\n//\n// The test host's hostReply passes the same suite (conformance.test.ts), so\n// a page test faking the backend fakes what a real adapter does.\n\nimport { readFileSync } from 'node:fs'\nimport { argv, exit, stderr, stdout } from 'node:process'\nimport { pathToFileURL } from 'node:url'\nimport { httpHostCalls } from './hostCalls.js'\nimport { formInputs } from './hostInputs.js'\nimport { isNotFoundSignal } from './notFound.js'\nimport { isActionRefusal } from './action.js'\nimport { withRedirect } from './redirect.js'\nimport { withRequest, withResponseDraft } from './request.js'\nimport { FLASH_COOKIE, readFlash } from './flashCookie.js'\nimport { ServerAuthenticationError, ServerAuthorizationError } from './js/errors.js'\n\ntype Schema = Record<string, unknown>\n\n/** A host-call client: the real one in a run, the test host's in core's own test. */\nexport type ConformanceCall = (name: string, ...args: unknown[]) => Promise<unknown>\n\nexport interface ConformanceOptions {\n /** The adapter's host-call endpoint, e.g. http://127.0.0.1:8080/__rsc/host-call. */\n endpoint: string\n /** The secret the adapter checks. */\n secret: string\n /** The adapter was started with RSC_HOST_CALL_SECRET_PREVIOUS set to this, and answers it too. */\n previousSecret?: string\n /** The adapter's rsc-host.json, parsed or as a path: its types are checked against what arrives. */\n manifest?:\n | string\n | { actions?: unknown; functions?: string[]; types?: Record<string, { params?: Schema[]; result?: Schema }>; defs?: Record<string, Schema> }\n /** For a test: the fetch the client uses. */\n fetch?: typeof fetch\n /** The port to hear the adapter's purges on: it was started with RSC_PURGE_URL=http://127.0.0.1:<port>/. */\n purgePort?: number\n /** The adapter was started with its debug on (Laravel: APP_DEBUG=true; Go: RSC_DEBUG=1). */\n debug?: boolean\n}\n\n/** A purge as it arrived: what an adapter posted to RSC_PURGE_URL. */\nexport interface ArrivedPurge {\n method: string\n contentType: string | null\n body: string\n}\n\n/**\n * Where the suite hears purges. The suite hands it a handler, called for every\n * purge before it is answered - so the suite can look at the versions while the\n * adapter is still waiting, and see whether the purge followed the change.\n */\nexport type PurgeInbox = (handler: (purge: ArrivedPurge) => Promise<void>) => void\n\nexport interface ConformanceResult {\n case: string\n ok: boolean\n /** What went wrong, when it did. */\n detail?: string\n}\n\n/**\n * What the adapter registers, and what each must do. Names are fixed; how\n * they are written is the adapter's - the point is that they are written the\n * way an app's would be, with the adapter's ordinary API.\n */\nexport const CASES = {\n 'Conformance.echo': 'Return its one argument unchanged: any JSON value, nested.',\n 'Conformance.emptyList': 'Return an empty list of objects, the way the language makes \"no rows\" (Go: a nil slice).',\n 'Conformance.time': \"Return the instant 2026-01-02T03:04:05Z as the language's own time value.\",\n 'Conformance.noTime': \"Return an absent time: a nil pointer, a null Carbon, typed as a time or nothing.\",\n 'Conformance.unauthenticated': 'Refuse as not signed in, the way the framework does.',\n 'Conformance.unauthorized': 'Refuse as signed in but not allowed.',\n 'Conformance.notFound': \"Refuse as not found (404), the way the framework does: Go's Refuse(404), Laravel's abort(404).\",\n 'Conformance.refuse': 'Refuse with status 429 and the message \"Slow down.\"',\n 'Conformance.refuseWithData':\n 'Refuse with status 409, the message \"Still in use\", and the data { blockers: [{ id: 7, href: \"/orders/7\" }] } - ' +\n \"the adapter's own refuse, carrying data for the page to act on.\",\n 'Conformance.invalid': 'Refuse the input: a validation error on the field \"name\".',\n 'Conformance.form':\n 'Take one object, described the way an app describes a form (a FormRequest, a struct with validate tags), of these ' +\n 'fields in this order: name, required, at least 2 characters; email, required, an email address; topic, required, ' +\n 'one of sales or support; company, required only when topic is support (required_if), and so optional otherwise. Refuse the email taken@example.com on the field \"email\", and otherwise return its name.',\n 'Conformance.update':\n \"Take the same object as Conformance.form, then a record's key as a string - an admin panel's update(values, id). \" +\n 'The email taken@example.com belongs to record \"7\": refuse it on the field \"email\" for any other key, and keep it ' +\n 'for \"7\", as a unique rule ignoring the record being edited does. Otherwise return the key, a colon, and the name.',\n 'Conformance.redirect': 'Send the visitor to /login.',\n 'Conformance.revalidate': 'Mark the region \"orders\" stale, and return \"ok\".',\n 'Conformance.fail': 'Fail unexpectedly: an ordinary error, not a refusal.',\n 'Conformance.authorization': \"Return the request's Authorization header, as the renderer forwarded it.\",\n 'Conformance.cookie': \"Return the request's Cookie header, as the renderer forwarded it.\",\n 'Conformance.ip':\n \"Return the visitor's address the way the app reads it - Laravel's $request->ip(), Go's rsckit.ClientIP(ctx) - \" +\n 'which is the X-RSC-Client-IP the renderer sent, not the address of the renderer calling.',\n 'Conformance.login': 'Set a cookie named \"conformance_login\" on the response, the way a login sets its session cookie, and return \"ok\".',\n 'Conformance.flash':\n 'Leave the one-time message \"Saved.\" of kind \"success\" for the next page - the adapter\\'s flash, which @rsc-kit/core/useFlash shows - and return \"ok\".',\n 'Conformance.double': 'Take one integer and return it doubled. Arguments that do not fit - a string, none - fail it: a 500, not a refusal.',\n 'Conformance.invalidNested': 'Refuse the input with errors on the nested field \"address.city\" and on the form itself, under \"\".',\n '__rsc.middleware':\n 'Guards, run in the order named, stopping at the first that does not pass - none at all passes: \"conformance-allow\" passes; ' +\n '\"conformance-deny\" refuses; \"conformance-redirect\" sends the visitor to /conformance-login; a name with no guard refuses; ' +\n '\"conformance-page\" passes only for the page /conformance/orders/{order} with order 7, read from the second argument ' +\n '{ url, params } the way a guard reads its page (Laravel: the request and its route; Go: rsckit.PageFrom(ctx)).',\n 'Conformance.change': 'Say the name \"conformance:changed\" changed, the way the adapter does from a webhook, and return \"ok\".',\n '__rsc.changed':\n 'Given { since: { name: version }, wait }: answer { versions } with every name whose version differs from since now, ' +\n 'and no other. A name never changed is at 0. A change moves a version to the larger of one past it and the time in ' +\n 'ms - never + 1 alone. May hold the call up to wait ms for one to differ; may answer at once.',\n} as const\n\nconst INSTANT = Date.parse('2026-01-02T03:04:05Z')\n\n/** Two JSON values alike, whatever order an object's keys were written in. */\nfunction sameValue(a: unknown, b: unknown): boolean {\n if (Array.isArray(a) || Array.isArray(b)) {\n return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => sameValue(item, b[i]))\n }\n\n if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n const keys = Object.keys(a)\n\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => sameValue((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]))\n )\n }\n\n return a === b\n}\n\nconst ECHOES: unknown[] = [null, 0, -1.5, 'héllo ✓ \"quoted\"', [1, 'a', null], { a: { b: [true, false] }, c: '' }]\n\n/**\n * Run the suite against a client. Every case runs; none stops another.\n *\n * `revalidated` is where the client records what each call marked stale -\n * its onRevalidate - so the revalidation case can read it.\n */\nexport async function conformance(\n call: ConformanceCall,\n options: {\n revalidated: string[][]\n manifest?: ConformanceOptions['manifest']\n wrongSecret?: ConformanceCall\n /**\n * A client sending the secret a rotation is moving away from. Null when\n * the run was not told one, which fails the case: every adapter rotates.\n */\n previousSecret?: ConformanceCall | null\n /**\n * A POST straight to the endpoint, for what the client never sends:\n * malformed bodies, an oversized batch, no secret at all. `secret: false`\n * leaves the header off.\n */\n raw?: (body: string, options?: { secret?: boolean }) => Promise<Response>\n /** Where the adapter's purges arrive. Without one, the purge cases fail: every adapter purges. */\n purges?: PurgeInbox\n /** The adapter was started with its debug on, so a failure carries where it happened. */\n debug?: boolean\n },\n): Promise<ConformanceResult[]> {\n const { revalidated, manifest, wrongSecret, previousSecret, raw, purges, debug } = options\n const results: ConformanceResult[] = []\n const types = typeof manifest === 'string' ? JSON.parse(readFileSync(manifest, 'utf-8')) : manifest\n\n const check = async (name: string, run: () => Promise<void>) => {\n try {\n await run()\n results.push({ case: name, ok: true })\n } catch (error) {\n results.push({ case: name, ok: false, detail: error instanceof Error ? error.message : String(error) })\n }\n }\n\n const expect = (ok: boolean, detail: string) => {\n if (!ok) throw new Error(detail)\n }\n\n const rejection = async (run: () => Promise<unknown>): Promise<unknown> => {\n try {\n const value = await run()\n\n throw new Error('answered ' + JSON.stringify(value) + ' instead of refusing')\n } catch (error) {\n return error\n }\n }\n\n /** The value against the type the adapter's manifest declares, when it declares one. */\n const typed = (name: string, value: unknown) => {\n const schema = types?.types?.[name]?.result\n\n if (!schema) return\n\n const problem = conformsTo(value, schema, types?.defs ?? {}, 'result')\n\n expect(problem === null, `the manifest types ${name}'s result, and what arrived does not fit it: ${problem}`)\n }\n\n await check('the manifest lists every Conformance function', async () => {\n if (!types) return\n\n const missing = Object.keys(CASES).filter((n) => !n.startsWith('__') && !types.functions?.includes(n))\n\n expect(missing.length === 0, 'not in functions: ' + missing.join(', '))\n })\n\n await check('the manifest\\'s actions is an object, even with none', async () => {\n if (!types) return\n\n expect(\n typeof types.actions === 'object' && types.actions !== null && !Array.isArray(types.actions),\n 'actions is ' + JSON.stringify(types.actions),\n )\n })\n\n await check('a value of any JSON shape comes back unchanged', async () => {\n for (const value of ECHOES) {\n const back = await call('Conformance.echo', value)\n\n expect(JSON.stringify(back) === JSON.stringify(value), `sent ${JSON.stringify(value)}, got ${JSON.stringify(back)}`)\n }\n })\n\n await check('\"no rows\" is an empty list, never null', async () => {\n const value = await call('Conformance.emptyList')\n\n expect(Array.isArray(value) && value.length === 0, 'got ' + JSON.stringify(value))\n typed('Conformance.emptyList', value)\n })\n\n await check('a time is an ISO 8601 string of the same instant', async () => {\n const value = await call('Conformance.time')\n\n expect(typeof value === 'string' && Date.parse(value) === INSTANT, 'got ' + JSON.stringify(value))\n typed('Conformance.time', value)\n })\n\n await check('an absent time is null', async () => {\n const value = await call('Conformance.noTime')\n\n expect(value === null, 'got ' + JSON.stringify(value))\n typed('Conformance.noTime', value)\n })\n\n await check('not signed in is the engine\\'s ServerAuthenticationError', async () => {\n const error = await rejection(() => call('Conformance.unauthenticated'))\n\n expect(error instanceof ServerAuthenticationError, 'got ' + String(error))\n })\n\n await check('not allowed is the engine\\'s ServerAuthorizationError', async () => {\n const error = await rejection(() => call('Conformance.unauthorized'))\n\n expect(error instanceof ServerAuthorizationError, 'got ' + String(error))\n })\n\n await check('not found is the engine\\'s notFound()', async () => {\n const error = await rejection(() => call('Conformance.notFound'))\n\n expect(isNotFoundSignal(error), 'got ' + String(error))\n })\n\n await check('a refusal keeps its status and its message', async () => {\n const error = (await rejection(() => call('Conformance.refuse'))) as Error & { refusalStatus?: number }\n\n // A refusal, not a failure: an action shows its message rather than\n // onError's, data or no data.\n expect(isActionRefusal(error), 'raised as ' + String(error) + ', not as a refusal - is refusalStatus in the reply?')\n expect(error.refusalStatus === 429, 'status ' + String(error.refusalStatus))\n expect(String(error.message).includes('Slow down.'), 'message ' + JSON.stringify(error.message))\n })\n\n await check('a refusal carries its data, its message and its status', async () => {\n const error = (await rejection(() => call('Conformance.refuseWithData'))) as Error & {\n refusalStatus?: number\n data?: unknown\n }\n\n expect(isActionRefusal(error), 'raised as ' + String(error) + ', not as a refusal - is refusalData in the reply?')\n expect(error.message === 'Still in use', 'message ' + JSON.stringify(error.message))\n expect(error.refusalStatus === 409, 'status ' + String(error.refusalStatus))\n // Compared as values, not as text: an object's keys have no order, and\n // Go writes a map's sorted.\n expect(\n sameValue(error.data, { blockers: [{ id: 7, href: '/orders/7' }] }),\n 'data ' + JSON.stringify(error.data),\n )\n })\n\n await check('refused input names its field', async () => {\n const error = (await rejection(() => call('Conformance.invalid'))) as { errors?: Record<string, string[]> }\n\n expect(Array.isArray(error.errors?.name) && error.errors.name.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('a form function arrives as one object, and a refusal lands on its field', async () => {\n const values = { name: 'Ada', email: 'ada@example.com', topic: 'sales' }\n\n expect((await call('Conformance.form', values)) === 'Ada', 'the values did not arrive as one object')\n\n const error = (await rejection(() => call('Conformance.form', { ...values, email: 'taken@example.com' }))) as {\n errors?: Record<string, string[]>\n }\n\n expect(Array.isArray(error.errors?.email) && error.errors.email.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('an update is told which record, after its values, and its rules can read it', async () => {\n const values = { name: 'Ada', email: 'ada@example.com', topic: 'sales' }\n\n expect((await call('Conformance.update', values, '3')) === '3:Ada', 'the key did not arrive after the values')\n expect(\n (await call('Conformance.update', { ...values, email: 'taken@example.com' }, '7')) === '7:Ada',\n 'record 7 could not keep its own email: the rules did not see the key',\n )\n\n const error = (await rejection(() => call('Conformance.update', { ...values, email: 'taken@example.com' }, '3'))) as {\n errors?: Record<string, string[]>\n }\n\n expect(Array.isArray(error.errors?.email) && error.errors.email.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n // Through what the build uses, so a form draws what this passed.\n await check('the manifest describes a form function so a form can be drawn from it', async () => {\n if (!types) return\n\n const signatures = Object.fromEntries(Object.entries((types.types ?? {}) as Record<string, { params?: Schema[] }>).map(([name, sig]) => [name, { params: sig.params ?? [] }]))\n const input = formInputs(signatures, (types.defs ?? {}) as Record<string, Schema>)['Conformance.form']\n\n expect(input !== undefined, 'Conformance.form is not typed as one object with named fields')\n\n const fields = input!.properties as Record<string, Schema>\n const named = Object.keys(fields).join(', ')\n\n // A language whose schemas are maps writes them sorted: x-order says the order.\n expect(named === 'name, email, topic, company', 'the fields are in the order ' + named)\n expect(fields.name?.minLength === 2, 'name has no minLength of 2: ' + JSON.stringify(fields.name))\n expect(fields.email?.format === 'email', 'email has no format: ' + JSON.stringify(fields.email))\n expect(\n JSON.stringify(fields.topic?.enum) === '[\"sales\",\"support\"]',\n 'topic has no enum of sales and support: ' + JSON.stringify(fields.topic),\n )\n expect(\n ['email', 'name', 'topic'].every((field) => (input!.required as string[] | undefined)?.includes(field)),\n 'required is ' + JSON.stringify(input!.required),\n )\n expect(!(input!.required as string[] | undefined)?.includes('company'), 'company is always required, and it is asked only of support')\n\n // A rule requiring a field when another has a value is a form showing it then.\n const visible = fields.company?.['x-visible'] as { when?: unknown; is?: unknown; required?: unknown } | undefined\n\n expect(\n visible?.when === 'topic' && JSON.stringify(visible.is) === '[\"support\"]' && visible.required === true,\n 'company has no x-visible of { when: topic, is: [support], required: true }: ' + JSON.stringify(fields.company),\n )\n\n // A panel draws its edit form from the update, and calls it with the key.\n const update = formInputs(signatures, (types.defs ?? {}) as Record<string, Schema>)['Conformance.update']\n\n expect(update !== undefined, 'Conformance.update is not typed as one object with named fields, then a key')\n expect(update?.['x-key'] === true, 'Conformance.update is not typed with a string key after its object')\n })\n\n await check('a redirect is the engine\\'s redirect, to where it said', async () => {\n const taken = await withRedirect(async (seen) => {\n await rejection(() => call('Conformance.redirect'))\n\n return seen()\n })\n\n expect(taken?.location === '/login', 'redirect ' + JSON.stringify(taken))\n expect(taken!.status >= 300 && taken!.status < 400, 'status ' + taken?.status)\n })\n\n await check('in a batch, a revalidation stays with its own call', async () => {\n const before = revalidated.length\n\n await Promise.all([call('Conformance.revalidate'), call('Conformance.echo', 1), call('Conformance.echo', 2)])\n\n expect(revalidated.length - before === 1, 'revalidated ' + JSON.stringify(revalidated.slice(before)))\n })\n\n await check('a revalidation rides with the result', async () => {\n const value = await call('Conformance.revalidate')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n expect(revalidated.some((r) => r.includes('orders')), 'revalidated ' + JSON.stringify(revalidated))\n })\n\n await check('an unexpected failure is an error, not a refusal', async () => {\n const error = (await rejection(() => call('Conformance.fail'))) as Error & { refusalStatus?: number }\n\n expect(\n error instanceof Error && !(error instanceof ServerAuthenticationError) && !(error instanceof ServerAuthorizationError) && !error.refusalStatus && !isNotFoundSignal(error),\n 'got ' + String(error),\n )\n })\n\n // Only when the run says debug is on: an adapter sends where a failure\n // happened only then (Laravel's app.debug, Go's Debug), and never to a\n // production renderer. What the development overlay shows for a failed\n // action, and what the terminal prints under a failed rpc().\n if (debug) {\n await check('with debug on, an unexpected failure carries the backend\\'s type and frames', async () => {\n const problem = backendTraceProblem(await rejection(() => call('Conformance.fail')))\n\n expect(problem === null, problem ?? '')\n })\n }\n\n await check('the visitor\\'s Authorization header is forwarded', async () => {\n const value = await withRequest(new Request('https://app.test/', { headers: { authorization: 'Bearer conformance' } }), () =>\n call('Conformance.authorization'),\n )\n\n expect(value === 'Bearer conformance', 'got ' + JSON.stringify(value))\n })\n\n await check('the visitor\\'s Cookie header is forwarded', async () => {\n const value = await withRequest(new Request('https://app.test/', { headers: { cookie: 'conformance=1; other=2' } }), () =>\n call('Conformance.cookie'),\n )\n\n expect(typeof value === 'string' && value.includes('conformance=1') && value.includes('other=2'), 'got ' + JSON.stringify(value))\n })\n\n await check('the visitor\\'s address is the one the server saw, not the renderer\\'s', async () => {\n const arrived = new Request('https://app.test/')\n\n Object.defineProperty(arrived, 'ip', { value: '203.0.113.7' })\n\n const value = await withRequest(arrived, () => call('Conformance.ip'))\n\n expect(value === '203.0.113.7', 'got ' + JSON.stringify(value))\n })\n\n await check('a cookie set during a call - a login - reaches the page\\'s response', async () => {\n const cookies = await withRequest(new Request('https://app.test/'), () =>\n withResponseDraft(async ({ taken }) => {\n const value = await call('Conformance.login')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n return taken().getSetCookie()\n }),\n )\n\n expect(cookies.some((c) => c.startsWith('conformance_login=')), 'Set-Cookie ' + JSON.stringify(cookies))\n })\n\n await check('a flash is a cookie the browser reads, kept after one the visitor still carries', async () => {\n // A message from the page before, not yet shown, is in the visitor's\n // cookie; the new one goes after it rather than over it.\n const carried = encodeURIComponent(JSON.stringify([{ message: 'Earlier.', kind: 'info' }]))\n const cookies = await withRequest(new Request('https://app.test/', { headers: { Cookie: `${FLASH_COOKIE}=${carried}` } }), () =>\n withResponseDraft(async ({ taken }) => {\n const value = await call('Conformance.flash')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n return taken().getSetCookie()\n }),\n )\n const cookie = cookies.find((c) => c.startsWith(`${FLASH_COOKIE}=`))\n\n expect(cookie !== undefined, 'Set-Cookie ' + JSON.stringify(cookies))\n // useFlash reads it with document.cookie: an HttpOnly cookie is never seen.\n expect(!/;\\s*httponly/i.test(cookie!), 'HttpOnly, so useFlash cannot read it: ' + cookie)\n\n // Read as useFlash reads it. An encrypted value is not JSON, and reads as nothing.\n let raw: string | undefined\n\n try {\n raw = decodeURIComponent(cookie!.slice(FLASH_COOKIE.length + 1).split(';')[0]!)\n } catch {}\n\n const messages = readFlash(raw)\n\n expect(\n sameValue(messages, [\n { message: 'Earlier.', kind: 'info' },\n { message: 'Saved.', kind: 'success' },\n ]),\n 'read as ' + JSON.stringify(messages) + ' from ' + cookie,\n )\n })\n\n await check('arguments are decoded to their types', async () => {\n const value = await call('Conformance.double', 21)\n\n expect(value === 42, 'got ' + JSON.stringify(value))\n })\n\n await check('arguments that do not fit fail the call, not refuse it', async () => {\n for (const args of [['twenty-one'], []]) {\n const error: unknown = await rejection(() => call('Conformance.double', ...args))\n const fields = error as { refusalStatus?: number; errors?: unknown }\n\n expect(\n error instanceof Error && !(error instanceof ServerAuthenticationError) && !(error instanceof ServerAuthorizationError) &&\n !fields.refusalStatus && fields.errors === undefined && !isNotFoundSignal(error),\n `with ${JSON.stringify(args)}: got ` + String(error),\n )\n }\n })\n\n await check('refused input names nested fields with dots, and the form under \"\"', async () => {\n const error = (await rejection(() => call('Conformance.invalidNested'))) as { errors?: Record<string, string[]> }\n\n expect(Array.isArray(error.errors?.['address.city']) && error.errors['address.city'].length > 0, 'errors ' + JSON.stringify(error.errors))\n expect(Array.isArray(error.errors?.['']) && error.errors[''].length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('calls in one batch are each answered, a refusal only its own', async () => {\n const [a, b, c] = await Promise.allSettled([\n call('Conformance.echo', 1),\n call('Conformance.unauthenticated'),\n call('Conformance.echo', 2),\n ])\n\n expect(a.status === 'fulfilled' && a.value === 1, 'first ' + JSON.stringify(a))\n expect(b.status === 'rejected' && b.reason instanceof ServerAuthenticationError, 'second ' + String((b as PromiseRejectedResult).reason))\n expect(c.status === 'fulfilled' && c.value === 2, 'third ' + JSON.stringify(c))\n })\n\n await check('no guards at all passes: what a health check asks', async () => {\n // The renderer's /_rsc/health asks with an empty list: it runs no app\n // code, and still proves the address, the secret and the adapter.\n const value = await call('__rsc.middleware', [])\n\n expect(value === true, 'got ' + JSON.stringify(value))\n })\n\n await check('a guard that passes answers true', async () => {\n const value = await call('__rsc.middleware', ['conformance-allow'])\n\n expect(value === true, 'got ' + JSON.stringify(value))\n })\n\n await check('a guard that refuses refuses', async () => {\n const value = await call('__rsc.middleware', ['conformance-deny']).catch((e: unknown) => e)\n\n expect(value !== true, 'it answered true')\n })\n\n await check('a guard can send the visitor somewhere else', async () => {\n const taken = await withRedirect(async (seen) => {\n await call('__rsc.middleware', ['conformance-redirect']).catch(() => {})\n\n return seen()\n })\n\n expect(taken?.location === '/conformance-login', 'redirect ' + JSON.stringify(taken))\n })\n\n await check('guards run in order and stop at the first that does not pass', async () => {\n const after = await call('__rsc.middleware', ['conformance-allow', 'conformance-deny']).catch((e: unknown) => e)\n\n expect(after !== true, 'allow then deny answered true')\n\n // Deny first: the redirect after it must never be asked.\n const taken = await withRedirect(async (seen) => {\n const value = await call('__rsc.middleware', ['conformance-deny', 'conformance-redirect']).catch((e: unknown) => e)\n\n expect(value !== true, 'deny then redirect answered true')\n\n return seen()\n })\n\n expect(taken === null, 'the guard after a refusal ran: redirected to ' + JSON.stringify(taken))\n })\n\n await check('a guard reads the page it is asked about, not the call', async () => {\n const page = { url: 'https://app.test/conformance/orders/7?tab=items', params: { order: '7' } }\n const value = await call('__rsc.middleware', ['conformance-page'], page)\n\n expect(value === true, 'the page it guards was refused: ' + String(value))\n\n const other = await call('__rsc.middleware', ['conformance-page'], { url: 'https://app.test/conformance/orders/8', params: { order: '8' } }).catch(\n (e: unknown) => e,\n )\n\n expect(other !== true, 'another order answered true')\n\n // An engine before the page was sent: nothing to judge, so no.\n const none = await call('__rsc.middleware', ['conformance-page']).catch((e: unknown) => e)\n\n expect(none !== true, 'no page answered true')\n })\n\n await check('a guard nobody registered refuses: fail closed', async () => {\n const value = await call('__rsc.middleware', ['conformance-nobody-registered-this']).catch((e: unknown) => e)\n\n expect(value !== true, 'it answered true')\n })\n\n const versionsOf = async (query: { since: Record<string, number>; wait?: number }) => {\n const answer = (await call('__rsc.changed', query)) as { versions?: Record<string, number> } | null\n\n expect(typeof answer?.versions === 'object' && answer.versions !== null, 'got ' + JSON.stringify(answer))\n\n return answer!.versions!\n }\n\n await check('a name nobody changed is at version 0, and unchanged from 0', async () => {\n const all = await versionsOf({ since: { 'conformance:never': -1 } })\n\n expect(all['conformance:never'] === 0, 'from -1: ' + JSON.stringify(all))\n\n const none = await versionsOf({ since: { 'conformance:never': 0 } })\n\n expect(Object.keys(none).length === 0, 'from 0: ' + JSON.stringify(none))\n })\n\n await check('saying a name changed moves its version', async () => {\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const value = await call('Conformance.change')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n const moved = await versionsOf({ since: { 'conformance:changed': before } })\n\n expect(typeof moved['conformance:changed'] === 'number' && moved['conformance:changed'] !== before, 'from ' + before + ': ' + JSON.stringify(moved))\n })\n\n await check('a version is the time of the change, and never comes round again', async () => {\n // The larger of one past the old version and the time in ms: a counter\n // repeats once a pruned name starts again from 0, and a tab holding the\n // old value misses the next change. A minute's leeway for clock skew.\n const started = Date.now()\n\n await call('Conformance.change')\n\n const first = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(first >= started - 60_000, `a change at ${started} moved the version to ${first}: not a time in ms`)\n\n await call('Conformance.change')\n\n const second = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(second > first, `a second change moved ${first} to ${second}`)\n })\n\n // A purge, and the version of conformance:changed the moment it arrived.\n const arrived: { purge: ArrivedPurge; version: number | null }[] = []\n\n purges?.(async (purge) => {\n const version = await versionsOf({ since: { 'conformance:changed': -1 } })\n .then((v) => v['conformance:changed'] ?? 0)\n .catch(() => null)\n\n arrived.push({ purge, version })\n })\n\n await check('a change is purged: its name is posted to RSC_PURGE_URL as a tag', async () => {\n expect(\n purges !== undefined,\n 'no purge was heard: start the adapter with RSC_PURGE_URL=http://127.0.0.1:<port>/ and run the suite with --purge-port <port>',\n )\n\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const from = arrived.length\n\n await call('Conformance.change')\n\n // After the answer is allowed: a purge may wait until the call has\n // answered, as the engine's own does. So the last case's purge may land\n // here too, and it says nothing about this change: what passes is any\n // purge heard once the version moved, and what fails is hearing none.\n const naming = () => arrived.slice(from).filter(({ purge }) => tagsOf(purge).includes('conformance:changed'))\n const moved = ({ version }: (typeof arrived)[number]) => version !== null && version !== before\n const deadline = Date.now() + 5_000\n let mine: (typeof arrived)[number] | undefined\n\n while (!mine && Date.now() < deadline) {\n mine = naming().find(moved)\n\n if (!mine) await new Promise((resolve) => setTimeout(resolve, 25))\n }\n\n // After the version moved: a purge that arrives first lets a CDN fetch the\n // page again from a backend still answering the old data, and keep it.\n expect(\n mine !== undefined || naming().length === 0,\n `the purge arrived before the change was made: conformance:changed was still ${before}`,\n )\n expect(mine !== undefined, `nothing was posted naming conformance:changed within 5s (got ${JSON.stringify(arrived.slice(from).map(({ purge }) => purge.body))})`)\n\n const { purge } = mine!\n\n expect(purge.method === 'POST', 'sent with ' + purge.method)\n expect((purge.contentType ?? '').startsWith('application/json'), 'Content-Type ' + purge.contentType)\n })\n\n await check('a purge is { tags: [...] } and nothing a CDN would refuse', async () => {\n const mine = arrived.find(({ purge }) => tagsOf(purge).includes('conformance:changed'))\n\n expect(mine !== undefined, 'no purge arrived to check')\n\n const body = JSON.parse(mine!.purge.body) as Record<string, unknown>\n const unknown = Object.keys(body).filter((key) => !['tags', 'paths', 'all'].includes(key))\n\n expect(unknown.length === 0, 'unknown keys: ' + unknown.join(', '))\n expect(Array.isArray(body.tags) && body.tags.every((t) => typeof t === 'string'), 'tags is ' + JSON.stringify(body.tags))\n expect((body.tags as string[]).length <= 100, 'more than 100 tags in one call')\n })\n\n await check('only the names that differ are answered', async () => {\n const current = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const answer = await versionsOf({ since: { 'conformance:changed': current, 'conformance:never': 5 } })\n\n expect(JSON.stringify(answer) === JSON.stringify({ 'conformance:never': 0 }), 'got ' + JSON.stringify(answer))\n })\n\n await check('waiting for a name to change is bounded by wait', async () => {\n const started = Date.now()\n const none = await versionsOf({ since: { 'conformance:never': 0 }, wait: 300 })\n const took = Date.now() - started\n\n expect(Object.keys(none).length === 0, 'got ' + JSON.stringify(none))\n expect(took < 3_000, 'took ' + took + 'ms')\n })\n\n if (raw) {\n const statusOf = async (body: string, secret = true) => (await raw(body, { secret })).status\n\n await check('a call with no secret at all is refused, 403', async () => {\n const status = await statusOf(JSON.stringify({ function: 'Conformance.echo', args: [1] }), false)\n\n expect(status === 403, 'answered ' + status)\n })\n\n await check('a function nobody registered is a 404', async () => {\n const status = await statusOf(JSON.stringify({ function: 'Conformance.nobodyRegisteredThis', args: [] }))\n\n expect(status === 404, 'answered ' + status)\n })\n\n await check('a malformed call is a 400: not JSON, no function, args not a list', async () => {\n for (const body of ['not json', JSON.stringify({ args: [] }), JSON.stringify({ function: 'Conformance.echo', args: 'x' })]) {\n const status = await statusOf(body)\n\n expect(status === 400, `${body} answered ${status}`)\n }\n })\n\n await check('a batch of more than 50 is refused, 413, before any call runs', async () => {\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const calls = Array.from({ length: 51 }, () => ({ function: 'Conformance.change', args: [] }))\n const status = await statusOf(JSON.stringify({ calls }))\n const after = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(status === 413, 'answered ' + status)\n expect(after === before, 'calls ran: conformance:changed moved from ' + before + ' to ' + after)\n })\n }\n\n if (wrongSecret) {\n await check('a call with the wrong secret is refused', async () => {\n const value = await wrongSecret('Conformance.echo', 'should not run').catch((e: unknown) => e)\n\n expect(value !== 'should not run', 'it ran')\n })\n }\n\n if (previousSecret !== undefined) {\n await check('a call with the previous secret is answered, while RSC_HOST_CALL_SECRET_PREVIOUS names it', async () => {\n expect(\n previousSecret !== null,\n 'no previous secret: start the adapter with RSC_HOST_CALL_SECRET_PREVIOUS=<old> and run the suite with --previous-secret <old>',\n )\n\n const value = await previousSecret!('Conformance.echo', 'rotated').catch((e: unknown) => e)\n\n expect(value === 'rotated', `the previous secret was refused: ${value instanceof Error ? value.message : String(value)}`)\n })\n }\n\n return results\n}\n\n/** The tags a purge names; none when its body is not one. */\nfunction tagsOf(purge: ArrivedPurge): string[] {\n try {\n const tags = (JSON.parse(purge.body) as { tags?: unknown }).tags\n\n return Array.isArray(tags) ? tags.filter((t): t is string => typeof t === 'string') : []\n } catch {\n return []\n }\n}\n\n/** Hear purges on 127.0.0.1:port, answering each 202 once the suite has looked. */\nasync function listenForPurges(port: number): Promise<{ inbox: PurgeInbox; close: () => Promise<void> }> {\n const { createServer } = await import('node:http')\n let handler: ((purge: ArrivedPurge) => Promise<void>) | undefined\n\n const server = createServer((request, response) => {\n let body = ''\n\n request.setEncoding('utf8')\n request.on('data', (chunk: string) => (body += chunk))\n request.on('end', () => {\n const purge = { method: request.method ?? '', contentType: request.headers['content-type'] ?? null, body }\n\n void (handler ? handler(purge) : Promise.resolve()).finally(() => {\n response.writeHead(202).end()\n })\n })\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, '127.0.0.1', resolve)\n })\n\n return {\n inbox: (next) => {\n handler = next\n },\n close: () => new Promise((resolve) => server.close(() => resolve())),\n }\n}\n\n/**\n * What is wrong with the backend's part of a failure the client threw, or\n * null: the reply's `debug` - { type, message, trace } - becomes the error's\n * cause, an Error named \"Backend <type>\" whose stack is the trace.\n */\nexport function backendTraceProblem(error: unknown): string | null {\n const cause = (error as { cause?: unknown } | null)?.cause\n\n if (!(cause instanceof Error) || !cause.name.startsWith('Backend ')) {\n return 'no backend trace: the reply had no debug { type, message, trace } - is the adapter\\'s debug on (Laravel: APP_DEBUG=true; Go: RSC_DEBUG=1)?'\n }\n\n if (cause.name === 'Backend ' || cause.name === 'Backend Error') return 'debug has no type: the exception\\'s class, e.g. ' + 'RuntimeException'\n if (!cause.message) return 'debug has no message'\n if (!(cause.stack ?? '').split('\\n').some((line) => line.startsWith(' at '))) return 'debug has no trace: a list of frames, where it failed'\n\n return null\n}\n\n/** Run the suite against an adapter's endpoint. */\nexport async function runConformance(options: ConformanceOptions): Promise<ConformanceResult[]> {\n const revalidated: string[][] = []\n const client = (secret: string) =>\n httpHostCalls({\n endpoint: options.endpoint,\n secret,\n fetch: options.fetch,\n onRevalidate: (targets) => revalidated.push(targets),\n })\n\n const doFetch = options.fetch ?? globalThis.fetch\n const listening = options.purgePort ? await listenForPurges(options.purgePort) : null\n\n try {\n return await suite()\n } finally {\n await listening?.close()\n }\n\n async function suite() {\n return await conformance(client(options.secret), {\n purges: listening?.inbox,\n revalidated,\n manifest: options.manifest,\n wrongSecret: client(options.secret + '-wrong'),\n previousSecret: options.previousSecret ? client(options.previousSecret) : null,\n debug: options.debug,\n raw: (body, { secret = true } = {}) =>\n doFetch(options.endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json', ...(secret ? { 'x-rsc-host-secret': options.secret } : {}) },\n body,\n }),\n })\n }\n}\n\n/**\n * Whether a value fits the JSON Schema subset the manifest uses. Null when it\n * does; otherwise where and why it does not.\n */\nexport function conformsTo(value: unknown, schema: Schema, defs: Record<string, Schema>, at: string): string | null {\n if (!schema || Object.keys(schema).length === 0) return null\n\n const ref = schema.$ref\n\n if (typeof ref === 'string' && ref.startsWith('#/defs/')) {\n const target = defs[ref.slice(7)]\n\n return target ? conformsTo(value, target, defs, at) : `${at}: ${ref} is not in defs`\n }\n\n if (Array.isArray(schema.anyOf)) {\n const fits = (schema.anyOf as Schema[]).some((s) => conformsTo(value, s, defs, at) === null)\n\n return fits ? null : `${at}: ${JSON.stringify(value)} is none of ${JSON.stringify(schema.anyOf)}`\n }\n\n if (Array.isArray(schema.enum)) {\n return (schema.enum as unknown[]).includes(value) ? null : `${at}: ${JSON.stringify(value)} is not one of ${JSON.stringify(schema.enum)}`\n }\n\n const kind = Array.isArray(value) ? 'array' : value === null ? 'null' : typeof value\n\n switch (schema.type) {\n case 'string':\n if (kind !== 'string') return `${at}: expected a string, got ${JSON.stringify(value)}`\n if (schema.format === 'date-time' && Number.isNaN(Date.parse(value as string))) return `${at}: ${JSON.stringify(value)} is not a date-time`\n return null\n case 'integer':\n return Number.isInteger(value) ? null : `${at}: expected an integer, got ${JSON.stringify(value)}`\n case 'number':\n return kind === 'number' ? null : `${at}: expected a number, got ${JSON.stringify(value)}`\n case 'boolean':\n return kind === 'boolean' ? null : `${at}: expected a boolean, got ${JSON.stringify(value)}`\n case 'null':\n return value === null ? null : `${at}: expected null, got ${JSON.stringify(value)}`\n case 'array': {\n if (kind !== 'array') return `${at}: expected an array, got ${JSON.stringify(value)}`\n for (const [i, item] of (value as unknown[]).entries()) {\n const problem = conformsTo(item, schema.items as Schema, defs, `${at}[${i}]`)\n if (problem) return problem\n }\n return null\n }\n case 'object': {\n if (kind !== 'object') return `${at}: expected an object, got ${JSON.stringify(value)}`\n const object = value as Record<string, unknown>\n const properties = (schema.properties ?? {}) as Record<string, Schema>\n for (const name of (schema.required as string[] | undefined) ?? []) {\n if (!(name in object)) return `${at}.${name}: required, and missing`\n }\n for (const [name, s] of Object.entries(properties)) {\n if (name in object) {\n const problem = conformsTo(object[name], s, defs, `${at}.${name}`)\n if (problem) return problem\n }\n }\n const extra = schema.additionalProperties as Schema | undefined\n if (extra && !schema.properties) {\n for (const [name, item] of Object.entries(object)) {\n const problem = conformsTo(item, extra, defs, `${at}.${name}`)\n if (problem) return problem\n }\n }\n return null\n }\n default:\n return null\n }\n}\n\n/** Print a result table, and say whether the adapter conforms. */\nexport function report(results: ConformanceResult[]): boolean {\n for (const r of results) {\n stdout.write(` ${r.ok ? '✓' : '✗'} ${r.case}${r.ok ? '' : '\\n ' + r.detail}\\n`)\n }\n\n const failed = results.filter((r) => !r.ok).length\n\n stdout.write(failed === 0 ? `\\n conforms: ${results.length} cases\\n` : `\\n ${failed} of ${results.length} cases failed\\n`)\n\n return failed === 0\n}\n\n// Run as a command, not when imported.\nif (import.meta.url === pathToFileURL(argv[1] ?? '').href || argv[1]?.endsWith('rsc-kit-conformance')) {\n const flag = (name: string) => {\n const at = argv.indexOf('--' + name)\n\n return at === -1 ? undefined : argv[at + 1]\n }\n\n const endpoint = flag('endpoint')\n const secret = flag('secret')\n\n if (!endpoint || !secret) {\n stderr.write('usage: rsc-kit-conformance --endpoint <url> --secret <secret> --previous-secret <old> --purge-port <port> [--manifest rsc-host.json] [--debug]\\n')\n exit(2)\n }\n\n const purgePort = flag('purge-port')\n\n runConformance({ endpoint, secret, previousSecret: flag('previous-secret'), manifest: flag('manifest'), purgePort: purgePort ? Number(purgePort) : undefined, debug: argv.includes('--debug') })\n .then((results) => exit(report(results) ? 0 : 1))\n .catch((error: unknown) => {\n stderr.write('rsc-kit-conformance: ' + (error instanceof Error ? error.message : String(error)) + '\\n')\n exit(1)\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":";AACA,+EAA+E;AAC/E,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,2CAA2C;AAC3C,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,6CAA6C;AAC7C,mEAAmE;AACnE,6EAA6E;AAC7E,4DAA4D;AAC5D,mDAAmD;AACnD,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,+DAA+D;AAC/D,EAAE;AACF,mEAAmE;AACnE,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,6EAA6E;AAC7E,0EAA0E;AAC1E,qEAAqE;AACrE,yBAAyB;AACzB,EAAE;AACF,4EAA4E;AAC5E,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,iBAAiB,E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UAAU,CAAC,CAAA;IACjC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;IAE7B,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,CAAC,KAAK,CAAC,kJAAkJ,CAAC,CAAA;QAChK,IAAI,CAAC,CAAC,CAAC,CAAA;IACT,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,CAAA;IAEpC,cAAc,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;SAC7L,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAChD,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACxB,MAAM,CAAC,KAAK,CAAC,uBAAuB,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;QACvG,IAAI,CAAC,CAAC,CAAC,CAAA;IACT,CAAC,CAAC,CAAA;AACN,CAAC","sourcesContent":["#!/usr/bin/env node\n// The contract every backend adapter keeps, as a suite it runs against itself.\n//\n// A backend answers rpc(), actions and guards over one endpoint, and every\n// difference between how it and the engine read that wire is a bug in an\n// app that nobody wrote: a nil slice arriving as null where the type said a\n// list, a timestamp the type called unknown, a refusal that did not come out\n// as the error a page checks for. Each was found by an app, one at a time.\n// This finds them before an adapter ships.\n//\n// The adapter registers the Conformance.* functions described in CASES, in\n// its own language, the way an app would write them; this calls them through\n// the real client and checks what arrives. Where the adapter's manifest types\n// a function, every value it sends is checked against that type too.\n//\n// RSC_PURGE_URL=http://127.0.0.1:8790/ \\\n// RSC_HOST_CALL_SECRET_PREVIOUS=old-secret <start the adapter>\n// rsc-kit-conformance --endpoint http://127.0.0.1:8080/__rsc/host-call \\\n// --secret test-secret --previous-secret old-secret \\\n// --manifest rsc-host.json --purge-port 8790\n//\n// --previous-secret is the secret a rotation is moving away from: an adapter\n// answers it as well while RSC_HOST_CALL_SECRET_PREVIOUS is set, so the\n// renderer's calls keep working while it rolls to the new one.\n//\n// --debug says the adapter was started with its debug on (Laravel:\n// APP_DEBUG=true; Go: RSC_DEBUG=1), and checks that a failure then carries\n// the backend's type and frames - what the development overlay shows.\n//\n// --purge-port is where the suite listens for the adapter's purges: a change\n// a backend makes never passes through the engine, so the backend tells a\n// CDN keeping its pages itself. Start the adapter with RSC_PURGE_URL\n// pointing at that port.\n//\n// The test host's hostReply passes the same suite (conformance.test.ts), so\n// a page test faking the backend fakes what a real adapter does.\n\nimport { readFileSync } from 'node:fs'\nimport { argv, exit, stderr, stdout } from 'node:process'\nimport { pathToFileURL } from 'node:url'\nimport { httpHostCalls } from './hostCalls.js'\nimport { formInputs } from './hostInputs.js'\nimport { isNotFoundSignal } from './notFound.js'\nimport { isActionRefusal } from './action.js'\nimport { withRedirect } from './redirect.js'\nimport { withRequest, withResponseDraft } from './request.js'\nimport { FLASH_COOKIE, readFlash } from './flashCookie.js'\nimport { ServerAuthenticationError, ServerAuthorizationError } from './js/errors.js'\n\ntype Schema = Record<string, unknown>\n\n/** A host-call client: the real one in a run, the test host's in core's own test. */\nexport type ConformanceCall = (name: string, ...args: unknown[]) => Promise<unknown>\n\nexport interface ConformanceOptions {\n /** The adapter's host-call endpoint, e.g. http://127.0.0.1:8080/__rsc/host-call. */\n endpoint: string\n /** The secret the adapter checks. */\n secret: string\n /** The adapter was started with RSC_HOST_CALL_SECRET_PREVIOUS set to this, and answers it too. */\n previousSecret?: string\n /** The adapter's rsc-host.json, parsed or as a path: its types are checked against what arrives. */\n manifest?:\n | string\n | { actions?: unknown; functions?: string[]; types?: Record<string, { params?: Schema[]; result?: Schema }>; defs?: Record<string, Schema> }\n /** For a test: the fetch the client uses. */\n fetch?: typeof fetch\n /** The port to hear the adapter's purges on: it was started with RSC_PURGE_URL=http://127.0.0.1:<port>/. */\n purgePort?: number\n /** The adapter was started with its debug on (Laravel: APP_DEBUG=true; Go: RSC_DEBUG=1). */\n debug?: boolean\n}\n\n/** A purge as it arrived: what an adapter posted to RSC_PURGE_URL. */\nexport interface ArrivedPurge {\n method: string\n contentType: string | null\n body: string\n}\n\n/**\n * Where the suite hears purges. The suite hands it a handler, called for every\n * purge before it is answered - so the suite can look at the versions while the\n * adapter is still waiting, and see whether the purge followed the change.\n */\nexport type PurgeInbox = (handler: (purge: ArrivedPurge) => Promise<void>) => void\n\nexport interface ConformanceResult {\n case: string\n ok: boolean\n /** What went wrong, when it did. */\n detail?: string\n}\n\n/**\n * What the adapter registers, and what each must do. Names are fixed; how\n * they are written is the adapter's - the point is that they are written the\n * way an app's would be, with the adapter's ordinary API.\n */\nexport const CASES = {\n 'Conformance.echo': 'Return its one argument unchanged: any JSON value, nested.',\n 'Conformance.emptyList': 'Return an empty list of objects, the way the language makes \"no rows\" (Go: a nil slice).',\n 'Conformance.time': \"Return the instant 2026-01-02T03:04:05Z as the language's own time value.\",\n 'Conformance.noTime': \"Return an absent time: a nil pointer, a null Carbon, typed as a time or nothing.\",\n 'Conformance.unauthenticated': 'Refuse as not signed in, the way the framework does.',\n 'Conformance.unauthorized': 'Refuse as signed in but not allowed.',\n 'Conformance.notFound': \"Refuse as not found (404), the way the framework does: Go's Refuse(404), Laravel's abort(404).\",\n 'Conformance.refuse': 'Refuse with status 429 and the message \"Slow down.\"',\n 'Conformance.refuseWithData':\n 'Refuse with status 409, the message \"Still in use\", and the data { blockers: [{ id: 7, href: \"/orders/7\" }] } - ' +\n \"the adapter's own refuse, carrying data for the page to act on.\",\n 'Conformance.invalid': 'Refuse the input: a validation error on the field \"name\".',\n 'Conformance.form':\n 'Take one object, described the way an app describes a form (a FormRequest, a struct with validate tags), of these ' +\n 'fields in this order: name, required, at least 2 characters; email, required, an email address; topic, required, ' +\n 'one of sales or support; company, required only when topic is support (required_if), and so optional otherwise. Refuse the email taken@example.com on the field \"email\", and otherwise return its name.',\n 'Conformance.update':\n \"Take the same object as Conformance.form, then a record's key as a string - an admin panel's update(values, id). \" +\n 'The email taken@example.com belongs to record \"7\": refuse it on the field \"email\" for any other key, and keep it ' +\n 'for \"7\", as a unique rule ignoring the record being edited does. Otherwise return the key, a colon, and the name.',\n 'Conformance.redirect': 'Send the visitor to /login.',\n 'Conformance.revalidate': 'Mark the region \"orders\" stale, and return \"ok\".',\n 'Conformance.fail': 'Fail unexpectedly: an ordinary error, not a refusal.',\n 'Conformance.authorization': \"Return the request's Authorization header, as the renderer forwarded it.\",\n 'Conformance.cookie': \"Return the request's Cookie header, as the renderer forwarded it.\",\n 'Conformance.ip':\n \"Return the visitor's address the way the app reads it - Laravel's $request->ip(), Go's rsckit.ClientIP(ctx) - \" +\n 'which is the X-RSC-Client-IP the renderer sent, not the address of the renderer calling.',\n 'Conformance.userAgent':\n \"Return the visitor's User-Agent the way the app reads it - Laravel's $request->userAgent(), Go's rsckit.ClientUserAgent(ctx) - \" +\n 'which is the X-RSC-Client-User-Agent the renderer sent, not the User-Agent of the renderer calling.',\n 'Conformance.login': 'Set a cookie named \"conformance_login\" on the response, the way a login sets its session cookie, and return \"ok\".',\n 'Conformance.flash':\n 'Leave the one-time message \"Saved.\" of kind \"success\" for the next page - the adapter\\'s flash, which @rsc-kit/core/useFlash shows - and return \"ok\".',\n 'Conformance.double': 'Take one integer and return it doubled. Arguments that do not fit - a string, none - fail it: a 500, not a refusal.',\n 'Conformance.invalidNested': 'Refuse the input with errors on the nested field \"address.city\" and on the form itself, under \"\".',\n '__rsc.middleware':\n 'Guards, run in the order named, stopping at the first that does not pass - none at all passes: \"conformance-allow\" passes; ' +\n '\"conformance-deny\" refuses; \"conformance-redirect\" sends the visitor to /conformance-login; a name with no guard refuses; ' +\n '\"conformance-page\" passes only for the page /conformance/orders/{order} with order 7, read from the second argument ' +\n '{ url, params } the way a guard reads its page (Laravel: the request and its route; Go: rsckit.PageFrom(ctx)).',\n 'Conformance.change': 'Say the name \"conformance:changed\" changed, the way the adapter does from a webhook, and return \"ok\".',\n '__rsc.changed':\n 'Given { since: { name: version }, wait }: answer { versions } with every name whose version differs from since now, ' +\n 'and no other. A name never changed is at 0. A change moves a version to the larger of one past it and the time in ' +\n 'ms - never + 1 alone. May hold the call up to wait ms for one to differ; may answer at once.',\n} as const\n\nconst INSTANT = Date.parse('2026-01-02T03:04:05Z')\n\n/** Two JSON values alike, whatever order an object's keys were written in. */\nfunction sameValue(a: unknown, b: unknown): boolean {\n if (Array.isArray(a) || Array.isArray(b)) {\n return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((item, i) => sameValue(item, b[i]))\n }\n\n if (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n const keys = Object.keys(a)\n\n return (\n keys.length === Object.keys(b).length &&\n keys.every((key) => sameValue((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key]))\n )\n }\n\n return a === b\n}\n\nconst ECHOES: unknown[] = [null, 0, -1.5, 'héllo ✓ \"quoted\"', [1, 'a', null], { a: { b: [true, false] }, c: '' }]\n\n/**\n * Run the suite against a client. Every case runs; none stops another.\n *\n * `revalidated` is where the client records what each call marked stale -\n * its onRevalidate - so the revalidation case can read it.\n */\nexport async function conformance(\n call: ConformanceCall,\n options: {\n revalidated: string[][]\n manifest?: ConformanceOptions['manifest']\n wrongSecret?: ConformanceCall\n /**\n * A client sending the secret a rotation is moving away from. Null when\n * the run was not told one, which fails the case: every adapter rotates.\n */\n previousSecret?: ConformanceCall | null\n /**\n * A POST straight to the endpoint, for what the client never sends:\n * malformed bodies, an oversized batch, no secret at all. `secret: false`\n * leaves the header off.\n */\n raw?: (body: string, options?: { secret?: boolean }) => Promise<Response>\n /** Where the adapter's purges arrive. Without one, the purge cases fail: every adapter purges. */\n purges?: PurgeInbox\n /** The adapter was started with its debug on, so a failure carries where it happened. */\n debug?: boolean\n },\n): Promise<ConformanceResult[]> {\n const { revalidated, manifest, wrongSecret, previousSecret, raw, purges, debug } = options\n const results: ConformanceResult[] = []\n const types = typeof manifest === 'string' ? JSON.parse(readFileSync(manifest, 'utf-8')) : manifest\n\n const check = async (name: string, run: () => Promise<void>) => {\n try {\n await run()\n results.push({ case: name, ok: true })\n } catch (error) {\n results.push({ case: name, ok: false, detail: error instanceof Error ? error.message : String(error) })\n }\n }\n\n const expect = (ok: boolean, detail: string) => {\n if (!ok) throw new Error(detail)\n }\n\n const rejection = async (run: () => Promise<unknown>): Promise<unknown> => {\n try {\n const value = await run()\n\n throw new Error('answered ' + JSON.stringify(value) + ' instead of refusing')\n } catch (error) {\n return error\n }\n }\n\n /** The value against the type the adapter's manifest declares, when it declares one. */\n const typed = (name: string, value: unknown) => {\n const schema = types?.types?.[name]?.result\n\n if (!schema) return\n\n const problem = conformsTo(value, schema, types?.defs ?? {}, 'result')\n\n expect(problem === null, `the manifest types ${name}'s result, and what arrived does not fit it: ${problem}`)\n }\n\n await check('the manifest lists every Conformance function', async () => {\n if (!types) return\n\n const missing = Object.keys(CASES).filter((n) => !n.startsWith('__') && !types.functions?.includes(n))\n\n expect(missing.length === 0, 'not in functions: ' + missing.join(', '))\n })\n\n await check('the manifest\\'s actions is an object, even with none', async () => {\n if (!types) return\n\n expect(\n typeof types.actions === 'object' && types.actions !== null && !Array.isArray(types.actions),\n 'actions is ' + JSON.stringify(types.actions),\n )\n })\n\n await check('a value of any JSON shape comes back unchanged', async () => {\n for (const value of ECHOES) {\n const back = await call('Conformance.echo', value)\n\n expect(JSON.stringify(back) === JSON.stringify(value), `sent ${JSON.stringify(value)}, got ${JSON.stringify(back)}`)\n }\n })\n\n await check('\"no rows\" is an empty list, never null', async () => {\n const value = await call('Conformance.emptyList')\n\n expect(Array.isArray(value) && value.length === 0, 'got ' + JSON.stringify(value))\n typed('Conformance.emptyList', value)\n })\n\n await check('a time is an ISO 8601 string of the same instant', async () => {\n const value = await call('Conformance.time')\n\n expect(typeof value === 'string' && Date.parse(value) === INSTANT, 'got ' + JSON.stringify(value))\n typed('Conformance.time', value)\n })\n\n await check('an absent time is null', async () => {\n const value = await call('Conformance.noTime')\n\n expect(value === null, 'got ' + JSON.stringify(value))\n typed('Conformance.noTime', value)\n })\n\n await check('not signed in is the engine\\'s ServerAuthenticationError', async () => {\n const error = await rejection(() => call('Conformance.unauthenticated'))\n\n expect(error instanceof ServerAuthenticationError, 'got ' + String(error))\n })\n\n await check('not allowed is the engine\\'s ServerAuthorizationError', async () => {\n const error = await rejection(() => call('Conformance.unauthorized'))\n\n expect(error instanceof ServerAuthorizationError, 'got ' + String(error))\n })\n\n await check('not found is the engine\\'s notFound()', async () => {\n const error = await rejection(() => call('Conformance.notFound'))\n\n expect(isNotFoundSignal(error), 'got ' + String(error))\n })\n\n await check('a refusal keeps its status and its message', async () => {\n const error = (await rejection(() => call('Conformance.refuse'))) as Error & { refusalStatus?: number }\n\n // A refusal, not a failure: an action shows its message rather than\n // onError's, data or no data.\n expect(isActionRefusal(error), 'raised as ' + String(error) + ', not as a refusal - is refusalStatus in the reply?')\n expect(error.refusalStatus === 429, 'status ' + String(error.refusalStatus))\n expect(String(error.message).includes('Slow down.'), 'message ' + JSON.stringify(error.message))\n })\n\n await check('a refusal carries its data, its message and its status', async () => {\n const error = (await rejection(() => call('Conformance.refuseWithData'))) as Error & {\n refusalStatus?: number\n data?: unknown\n }\n\n expect(isActionRefusal(error), 'raised as ' + String(error) + ', not as a refusal - is refusalData in the reply?')\n expect(error.message === 'Still in use', 'message ' + JSON.stringify(error.message))\n expect(error.refusalStatus === 409, 'status ' + String(error.refusalStatus))\n // Compared as values, not as text: an object's keys have no order, and\n // Go writes a map's sorted.\n expect(\n sameValue(error.data, { blockers: [{ id: 7, href: '/orders/7' }] }),\n 'data ' + JSON.stringify(error.data),\n )\n })\n\n await check('refused input names its field', async () => {\n const error = (await rejection(() => call('Conformance.invalid'))) as { errors?: Record<string, string[]> }\n\n expect(Array.isArray(error.errors?.name) && error.errors.name.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('a form function arrives as one object, and a refusal lands on its field', async () => {\n const values = { name: 'Ada', email: 'ada@example.com', topic: 'sales' }\n\n expect((await call('Conformance.form', values)) === 'Ada', 'the values did not arrive as one object')\n\n const error = (await rejection(() => call('Conformance.form', { ...values, email: 'taken@example.com' }))) as {\n errors?: Record<string, string[]>\n }\n\n expect(Array.isArray(error.errors?.email) && error.errors.email.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('an update is told which record, after its values, and its rules can read it', async () => {\n const values = { name: 'Ada', email: 'ada@example.com', topic: 'sales' }\n\n expect((await call('Conformance.update', values, '3')) === '3:Ada', 'the key did not arrive after the values')\n expect(\n (await call('Conformance.update', { ...values, email: 'taken@example.com' }, '7')) === '7:Ada',\n 'record 7 could not keep its own email: the rules did not see the key',\n )\n\n const error = (await rejection(() => call('Conformance.update', { ...values, email: 'taken@example.com' }, '3'))) as {\n errors?: Record<string, string[]>\n }\n\n expect(Array.isArray(error.errors?.email) && error.errors.email.length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n // Through what the build uses, so a form draws what this passed.\n await check('the manifest describes a form function so a form can be drawn from it', async () => {\n if (!types) return\n\n const signatures = Object.fromEntries(Object.entries((types.types ?? {}) as Record<string, { params?: Schema[] }>).map(([name, sig]) => [name, { params: sig.params ?? [] }]))\n const input = formInputs(signatures, (types.defs ?? {}) as Record<string, Schema>)['Conformance.form']\n\n expect(input !== undefined, 'Conformance.form is not typed as one object with named fields')\n\n const fields = input!.properties as Record<string, Schema>\n const named = Object.keys(fields).join(', ')\n\n // A language whose schemas are maps writes them sorted: x-order says the order.\n expect(named === 'name, email, topic, company', 'the fields are in the order ' + named)\n expect(fields.name?.minLength === 2, 'name has no minLength of 2: ' + JSON.stringify(fields.name))\n expect(fields.email?.format === 'email', 'email has no format: ' + JSON.stringify(fields.email))\n expect(\n JSON.stringify(fields.topic?.enum) === '[\"sales\",\"support\"]',\n 'topic has no enum of sales and support: ' + JSON.stringify(fields.topic),\n )\n expect(\n ['email', 'name', 'topic'].every((field) => (input!.required as string[] | undefined)?.includes(field)),\n 'required is ' + JSON.stringify(input!.required),\n )\n expect(!(input!.required as string[] | undefined)?.includes('company'), 'company is always required, and it is asked only of support')\n\n // A rule requiring a field when another has a value is a form showing it then.\n const visible = fields.company?.['x-visible'] as { when?: unknown; is?: unknown; required?: unknown } | undefined\n\n expect(\n visible?.when === 'topic' && JSON.stringify(visible.is) === '[\"support\"]' && visible.required === true,\n 'company has no x-visible of { when: topic, is: [support], required: true }: ' + JSON.stringify(fields.company),\n )\n\n // A panel draws its edit form from the update, and calls it with the key.\n const update = formInputs(signatures, (types.defs ?? {}) as Record<string, Schema>)['Conformance.update']\n\n expect(update !== undefined, 'Conformance.update is not typed as one object with named fields, then a key')\n expect(update?.['x-key'] === true, 'Conformance.update is not typed with a string key after its object')\n })\n\n await check('a redirect is the engine\\'s redirect, to where it said', async () => {\n const taken = await withRedirect(async (seen) => {\n await rejection(() => call('Conformance.redirect'))\n\n return seen()\n })\n\n expect(taken?.location === '/login', 'redirect ' + JSON.stringify(taken))\n expect(taken!.status >= 300 && taken!.status < 400, 'status ' + taken?.status)\n })\n\n await check('in a batch, a revalidation stays with its own call', async () => {\n const before = revalidated.length\n\n await Promise.all([call('Conformance.revalidate'), call('Conformance.echo', 1), call('Conformance.echo', 2)])\n\n expect(revalidated.length - before === 1, 'revalidated ' + JSON.stringify(revalidated.slice(before)))\n })\n\n await check('a revalidation rides with the result', async () => {\n const value = await call('Conformance.revalidate')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n expect(revalidated.some((r) => r.includes('orders')), 'revalidated ' + JSON.stringify(revalidated))\n })\n\n await check('an unexpected failure is an error, not a refusal', async () => {\n const error = (await rejection(() => call('Conformance.fail'))) as Error & { refusalStatus?: number }\n\n expect(\n error instanceof Error && !(error instanceof ServerAuthenticationError) && !(error instanceof ServerAuthorizationError) && !error.refusalStatus && !isNotFoundSignal(error),\n 'got ' + String(error),\n )\n })\n\n // Only when the run says debug is on: an adapter sends where a failure\n // happened only then (Laravel's app.debug, Go's Debug), and never to a\n // production renderer. What the development overlay shows for a failed\n // action, and what the terminal prints under a failed rpc().\n if (debug) {\n await check('with debug on, an unexpected failure carries the backend\\'s type and frames', async () => {\n const problem = backendTraceProblem(await rejection(() => call('Conformance.fail')))\n\n expect(problem === null, problem ?? '')\n })\n }\n\n await check('the visitor\\'s Authorization header is forwarded', async () => {\n const value = await withRequest(new Request('https://app.test/', { headers: { authorization: 'Bearer conformance' } }), () =>\n call('Conformance.authorization'),\n )\n\n expect(value === 'Bearer conformance', 'got ' + JSON.stringify(value))\n })\n\n await check('the visitor\\'s Cookie header is forwarded', async () => {\n const value = await withRequest(new Request('https://app.test/', { headers: { cookie: 'conformance=1; other=2' } }), () =>\n call('Conformance.cookie'),\n )\n\n expect(typeof value === 'string' && value.includes('conformance=1') && value.includes('other=2'), 'got ' + JSON.stringify(value))\n })\n\n await check('the visitor\\'s address is the one the server saw, not the renderer\\'s', async () => {\n const arrived = new Request('https://app.test/')\n\n Object.defineProperty(arrived, 'ip', { value: '203.0.113.7' })\n\n const value = await withRequest(arrived, () => call('Conformance.ip'))\n\n expect(value === '203.0.113.7', 'got ' + JSON.stringify(value))\n })\n\n await check('the visitor\\'s User-Agent is their browser\\'s, not the renderer\\'s', async () => {\n const agent = 'Mozilla/5.0 (Conformance) rsc-kit/test'\n const value = await withRequest(new Request('https://app.test/', { headers: { 'user-agent': agent } }), () => call('Conformance.userAgent'))\n\n expect(value === agent, 'got ' + JSON.stringify(value))\n })\n\n await check('a cookie set during a call - a login - reaches the page\\'s response', async () => {\n const cookies = await withRequest(new Request('https://app.test/'), () =>\n withResponseDraft(async ({ taken }) => {\n const value = await call('Conformance.login')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n return taken().getSetCookie()\n }),\n )\n\n expect(cookies.some((c) => c.startsWith('conformance_login=')), 'Set-Cookie ' + JSON.stringify(cookies))\n })\n\n await check('a flash is a cookie the browser reads, kept after one the visitor still carries', async () => {\n // A message from the page before, not yet shown, is in the visitor's\n // cookie; the new one goes after it rather than over it.\n const carried = encodeURIComponent(JSON.stringify([{ message: 'Earlier.', kind: 'info' }]))\n const cookies = await withRequest(new Request('https://app.test/', { headers: { Cookie: `${FLASH_COOKIE}=${carried}` } }), () =>\n withResponseDraft(async ({ taken }) => {\n const value = await call('Conformance.flash')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n return taken().getSetCookie()\n }),\n )\n const cookie = cookies.find((c) => c.startsWith(`${FLASH_COOKIE}=`))\n\n expect(cookie !== undefined, 'Set-Cookie ' + JSON.stringify(cookies))\n // useFlash reads it with document.cookie: an HttpOnly cookie is never seen.\n expect(!/;\\s*httponly/i.test(cookie!), 'HttpOnly, so useFlash cannot read it: ' + cookie)\n\n // Read as useFlash reads it. An encrypted value is not JSON, and reads as nothing.\n let raw: string | undefined\n\n try {\n raw = decodeURIComponent(cookie!.slice(FLASH_COOKIE.length + 1).split(';')[0]!)\n } catch {}\n\n const messages = readFlash(raw)\n\n expect(\n sameValue(messages, [\n { message: 'Earlier.', kind: 'info' },\n { message: 'Saved.', kind: 'success' },\n ]),\n 'read as ' + JSON.stringify(messages) + ' from ' + cookie,\n )\n })\n\n await check('arguments are decoded to their types', async () => {\n const value = await call('Conformance.double', 21)\n\n expect(value === 42, 'got ' + JSON.stringify(value))\n })\n\n await check('arguments that do not fit fail the call, not refuse it', async () => {\n for (const args of [['twenty-one'], []]) {\n const error: unknown = await rejection(() => call('Conformance.double', ...args))\n const fields = error as { refusalStatus?: number; errors?: unknown }\n\n expect(\n error instanceof Error && !(error instanceof ServerAuthenticationError) && !(error instanceof ServerAuthorizationError) &&\n !fields.refusalStatus && fields.errors === undefined && !isNotFoundSignal(error),\n `with ${JSON.stringify(args)}: got ` + String(error),\n )\n }\n })\n\n await check('refused input names nested fields with dots, and the form under \"\"', async () => {\n const error = (await rejection(() => call('Conformance.invalidNested'))) as { errors?: Record<string, string[]> }\n\n expect(Array.isArray(error.errors?.['address.city']) && error.errors['address.city'].length > 0, 'errors ' + JSON.stringify(error.errors))\n expect(Array.isArray(error.errors?.['']) && error.errors[''].length > 0, 'errors ' + JSON.stringify(error.errors))\n })\n\n await check('calls in one batch are each answered, a refusal only its own', async () => {\n const [a, b, c] = await Promise.allSettled([\n call('Conformance.echo', 1),\n call('Conformance.unauthenticated'),\n call('Conformance.echo', 2),\n ])\n\n expect(a.status === 'fulfilled' && a.value === 1, 'first ' + JSON.stringify(a))\n expect(b.status === 'rejected' && b.reason instanceof ServerAuthenticationError, 'second ' + String((b as PromiseRejectedResult).reason))\n expect(c.status === 'fulfilled' && c.value === 2, 'third ' + JSON.stringify(c))\n })\n\n await check('no guards at all passes: what a health check asks', async () => {\n // The renderer's /_rsc/health asks with an empty list: it runs no app\n // code, and still proves the address, the secret and the adapter.\n const value = await call('__rsc.middleware', [])\n\n expect(value === true, 'got ' + JSON.stringify(value))\n })\n\n await check('a guard that passes answers true', async () => {\n const value = await call('__rsc.middleware', ['conformance-allow'])\n\n expect(value === true, 'got ' + JSON.stringify(value))\n })\n\n await check('a guard that refuses refuses', async () => {\n const value = await call('__rsc.middleware', ['conformance-deny']).catch((e: unknown) => e)\n\n expect(value !== true, 'it answered true')\n })\n\n await check('a guard can send the visitor somewhere else', async () => {\n const taken = await withRedirect(async (seen) => {\n await call('__rsc.middleware', ['conformance-redirect']).catch(() => {})\n\n return seen()\n })\n\n expect(taken?.location === '/conformance-login', 'redirect ' + JSON.stringify(taken))\n })\n\n await check('guards run in order and stop at the first that does not pass', async () => {\n const after = await call('__rsc.middleware', ['conformance-allow', 'conformance-deny']).catch((e: unknown) => e)\n\n expect(after !== true, 'allow then deny answered true')\n\n // Deny first: the redirect after it must never be asked.\n const taken = await withRedirect(async (seen) => {\n const value = await call('__rsc.middleware', ['conformance-deny', 'conformance-redirect']).catch((e: unknown) => e)\n\n expect(value !== true, 'deny then redirect answered true')\n\n return seen()\n })\n\n expect(taken === null, 'the guard after a refusal ran: redirected to ' + JSON.stringify(taken))\n })\n\n await check('a guard reads the page it is asked about, not the call', async () => {\n const page = { url: 'https://app.test/conformance/orders/7?tab=items', params: { order: '7' } }\n const value = await call('__rsc.middleware', ['conformance-page'], page)\n\n expect(value === true, 'the page it guards was refused: ' + String(value))\n\n const other = await call('__rsc.middleware', ['conformance-page'], { url: 'https://app.test/conformance/orders/8', params: { order: '8' } }).catch(\n (e: unknown) => e,\n )\n\n expect(other !== true, 'another order answered true')\n\n // An engine before the page was sent: nothing to judge, so no.\n const none = await call('__rsc.middleware', ['conformance-page']).catch((e: unknown) => e)\n\n expect(none !== true, 'no page answered true')\n })\n\n await check('a guard nobody registered refuses: fail closed', async () => {\n const value = await call('__rsc.middleware', ['conformance-nobody-registered-this']).catch((e: unknown) => e)\n\n expect(value !== true, 'it answered true')\n })\n\n const versionsOf = async (query: { since: Record<string, number>; wait?: number }) => {\n const answer = (await call('__rsc.changed', query)) as { versions?: Record<string, number> } | null\n\n expect(typeof answer?.versions === 'object' && answer.versions !== null, 'got ' + JSON.stringify(answer))\n\n return answer!.versions!\n }\n\n await check('a name nobody changed is at version 0, and unchanged from 0', async () => {\n const all = await versionsOf({ since: { 'conformance:never': -1 } })\n\n expect(all['conformance:never'] === 0, 'from -1: ' + JSON.stringify(all))\n\n const none = await versionsOf({ since: { 'conformance:never': 0 } })\n\n expect(Object.keys(none).length === 0, 'from 0: ' + JSON.stringify(none))\n })\n\n await check('saying a name changed moves its version', async () => {\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const value = await call('Conformance.change')\n\n expect(value === 'ok', 'got ' + JSON.stringify(value))\n\n const moved = await versionsOf({ since: { 'conformance:changed': before } })\n\n expect(typeof moved['conformance:changed'] === 'number' && moved['conformance:changed'] !== before, 'from ' + before + ': ' + JSON.stringify(moved))\n })\n\n await check('a version is the time of the change, and never comes round again', async () => {\n // The larger of one past the old version and the time in ms: a counter\n // repeats once a pruned name starts again from 0, and a tab holding the\n // old value misses the next change. A minute's leeway for clock skew.\n const started = Date.now()\n\n await call('Conformance.change')\n\n const first = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(first >= started - 60_000, `a change at ${started} moved the version to ${first}: not a time in ms`)\n\n await call('Conformance.change')\n\n const second = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(second > first, `a second change moved ${first} to ${second}`)\n })\n\n // A purge, and the version of conformance:changed the moment it arrived.\n const arrived: { purge: ArrivedPurge; version: number | null }[] = []\n\n purges?.(async (purge) => {\n const version = await versionsOf({ since: { 'conformance:changed': -1 } })\n .then((v) => v['conformance:changed'] ?? 0)\n .catch(() => null)\n\n arrived.push({ purge, version })\n })\n\n await check('a change is purged: its name is posted to RSC_PURGE_URL as a tag', async () => {\n expect(\n purges !== undefined,\n 'no purge was heard: start the adapter with RSC_PURGE_URL=http://127.0.0.1:<port>/ and run the suite with --purge-port <port>',\n )\n\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const from = arrived.length\n\n await call('Conformance.change')\n\n // After the answer is allowed: a purge may wait until the call has\n // answered, as the engine's own does. So the last case's purge may land\n // here too, and it says nothing about this change: what passes is any\n // purge heard once the version moved, and what fails is hearing none.\n const naming = () => arrived.slice(from).filter(({ purge }) => tagsOf(purge).includes('conformance:changed'))\n const moved = ({ version }: (typeof arrived)[number]) => version !== null && version !== before\n const deadline = Date.now() + 5_000\n let mine: (typeof arrived)[number] | undefined\n\n while (!mine && Date.now() < deadline) {\n mine = naming().find(moved)\n\n if (!mine) await new Promise((resolve) => setTimeout(resolve, 25))\n }\n\n // After the version moved: a purge that arrives first lets a CDN fetch the\n // page again from a backend still answering the old data, and keep it.\n expect(\n mine !== undefined || naming().length === 0,\n `the purge arrived before the change was made: conformance:changed was still ${before}`,\n )\n expect(mine !== undefined, `nothing was posted naming conformance:changed within 5s (got ${JSON.stringify(arrived.slice(from).map(({ purge }) => purge.body))})`)\n\n const { purge } = mine!\n\n expect(purge.method === 'POST', 'sent with ' + purge.method)\n expect((purge.contentType ?? '').startsWith('application/json'), 'Content-Type ' + purge.contentType)\n })\n\n await check('a purge is { tags: [...] } and nothing a CDN would refuse', async () => {\n const mine = arrived.find(({ purge }) => tagsOf(purge).includes('conformance:changed'))\n\n expect(mine !== undefined, 'no purge arrived to check')\n\n const body = JSON.parse(mine!.purge.body) as Record<string, unknown>\n const unknown = Object.keys(body).filter((key) => !['tags', 'paths', 'all'].includes(key))\n\n expect(unknown.length === 0, 'unknown keys: ' + unknown.join(', '))\n expect(Array.isArray(body.tags) && body.tags.every((t) => typeof t === 'string'), 'tags is ' + JSON.stringify(body.tags))\n expect((body.tags as string[]).length <= 100, 'more than 100 tags in one call')\n })\n\n await check('only the names that differ are answered', async () => {\n const current = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const answer = await versionsOf({ since: { 'conformance:changed': current, 'conformance:never': 5 } })\n\n expect(JSON.stringify(answer) === JSON.stringify({ 'conformance:never': 0 }), 'got ' + JSON.stringify(answer))\n })\n\n await check('waiting for a name to change is bounded by wait', async () => {\n const started = Date.now()\n const none = await versionsOf({ since: { 'conformance:never': 0 }, wait: 300 })\n const took = Date.now() - started\n\n expect(Object.keys(none).length === 0, 'got ' + JSON.stringify(none))\n expect(took < 3_000, 'took ' + took + 'ms')\n })\n\n if (raw) {\n const statusOf = async (body: string, secret = true) => (await raw(body, { secret })).status\n\n await check('a call with no secret at all is refused, 403', async () => {\n const status = await statusOf(JSON.stringify({ function: 'Conformance.echo', args: [1] }), false)\n\n expect(status === 403, 'answered ' + status)\n })\n\n await check('a function nobody registered is a 404', async () => {\n const status = await statusOf(JSON.stringify({ function: 'Conformance.nobodyRegisteredThis', args: [] }))\n\n expect(status === 404, 'answered ' + status)\n })\n\n await check('a malformed call is a 400: not JSON, no function, args not a list', async () => {\n for (const body of ['not json', JSON.stringify({ args: [] }), JSON.stringify({ function: 'Conformance.echo', args: 'x' })]) {\n const status = await statusOf(body)\n\n expect(status === 400, `${body} answered ${status}`)\n }\n })\n\n await check('a batch of more than 50 is refused, 413, before any call runs', async () => {\n const before = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n const calls = Array.from({ length: 51 }, () => ({ function: 'Conformance.change', args: [] }))\n const status = await statusOf(JSON.stringify({ calls }))\n const after = (await versionsOf({ since: { 'conformance:changed': -1 } }))['conformance:changed'] ?? 0\n\n expect(status === 413, 'answered ' + status)\n expect(after === before, 'calls ran: conformance:changed moved from ' + before + ' to ' + after)\n })\n }\n\n if (wrongSecret) {\n await check('a call with the wrong secret is refused', async () => {\n const value = await wrongSecret('Conformance.echo', 'should not run').catch((e: unknown) => e)\n\n expect(value !== 'should not run', 'it ran')\n })\n }\n\n if (previousSecret !== undefined) {\n await check('a call with the previous secret is answered, while RSC_HOST_CALL_SECRET_PREVIOUS names it', async () => {\n expect(\n previousSecret !== null,\n 'no previous secret: start the adapter with RSC_HOST_CALL_SECRET_PREVIOUS=<old> and run the suite with --previous-secret <old>',\n )\n\n const value = await previousSecret!('Conformance.echo', 'rotated').catch((e: unknown) => e)\n\n expect(value === 'rotated', `the previous secret was refused: ${value instanceof Error ? value.message : String(value)}`)\n })\n }\n\n return results\n}\n\n/** The tags a purge names; none when its body is not one. */\nfunction tagsOf(purge: ArrivedPurge): string[] {\n try {\n const tags = (JSON.parse(purge.body) as { tags?: unknown }).tags\n\n return Array.isArray(tags) ? tags.filter((t): t is string => typeof t === 'string') : []\n } catch {\n return []\n }\n}\n\n/** Hear purges on 127.0.0.1:port, answering each 202 once the suite has looked. */\nasync function listenForPurges(port: number): Promise<{ inbox: PurgeInbox; close: () => Promise<void> }> {\n const { createServer } = await import('node:http')\n let handler: ((purge: ArrivedPurge) => Promise<void>) | undefined\n\n const server = createServer((request, response) => {\n let body = ''\n\n request.setEncoding('utf8')\n request.on('data', (chunk: string) => (body += chunk))\n request.on('end', () => {\n const purge = { method: request.method ?? '', contentType: request.headers['content-type'] ?? null, body }\n\n void (handler ? handler(purge) : Promise.resolve()).finally(() => {\n response.writeHead(202).end()\n })\n })\n })\n\n await new Promise<void>((resolve, reject) => {\n server.once('error', reject)\n server.listen(port, '127.0.0.1', resolve)\n })\n\n return {\n inbox: (next) => {\n handler = next\n },\n close: () => new Promise((resolve) => server.close(() => resolve())),\n }\n}\n\n/**\n * What is wrong with the backend's part of a failure the client threw, or\n * null: the reply's `debug` - { type, message, trace } - becomes the error's\n * cause, an Error named \"Backend <type>\" whose stack is the trace.\n */\nexport function backendTraceProblem(error: unknown): string | null {\n const cause = (error as { cause?: unknown } | null)?.cause\n\n if (!(cause instanceof Error) || !cause.name.startsWith('Backend ')) {\n return 'no backend trace: the reply had no debug { type, message, trace } - is the adapter\\'s debug on (Laravel: APP_DEBUG=true; Go: RSC_DEBUG=1)?'\n }\n\n if (cause.name === 'Backend ' || cause.name === 'Backend Error') return 'debug has no type: the exception\\'s class, e.g. ' + 'RuntimeException'\n if (!cause.message) return 'debug has no message'\n if (!(cause.stack ?? '').split('\\n').some((line) => line.startsWith(' at '))) return 'debug has no trace: a list of frames, where it failed'\n\n return null\n}\n\n/** Run the suite against an adapter's endpoint. */\nexport async function runConformance(options: ConformanceOptions): Promise<ConformanceResult[]> {\n const revalidated: string[][] = []\n const client = (secret: string) =>\n httpHostCalls({\n endpoint: options.endpoint,\n secret,\n fetch: options.fetch,\n onRevalidate: (targets) => revalidated.push(targets),\n })\n\n const doFetch = options.fetch ?? globalThis.fetch\n const listening = options.purgePort ? await listenForPurges(options.purgePort) : null\n\n try {\n return await suite()\n } finally {\n await listening?.close()\n }\n\n async function suite() {\n return await conformance(client(options.secret), {\n purges: listening?.inbox,\n revalidated,\n manifest: options.manifest,\n wrongSecret: client(options.secret + '-wrong'),\n previousSecret: options.previousSecret ? client(options.previousSecret) : null,\n debug: options.debug,\n raw: (body, { secret = true } = {}) =>\n doFetch(options.endpoint, {\n method: 'POST',\n headers: { 'content-type': 'application/json', ...(secret ? { 'x-rsc-host-secret': options.secret } : {}) },\n body,\n }),\n })\n }\n}\n\n/**\n * Whether a value fits the JSON Schema subset the manifest uses. Null when it\n * does; otherwise where and why it does not.\n */\nexport function conformsTo(value: unknown, schema: Schema, defs: Record<string, Schema>, at: string): string | null {\n if (!schema || Object.keys(schema).length === 0) return null\n\n const ref = schema.$ref\n\n if (typeof ref === 'string' && ref.startsWith('#/defs/')) {\n const target = defs[ref.slice(7)]\n\n return target ? conformsTo(value, target, defs, at) : `${at}: ${ref} is not in defs`\n }\n\n if (Array.isArray(schema.anyOf)) {\n const fits = (schema.anyOf as Schema[]).some((s) => conformsTo(value, s, defs, at) === null)\n\n return fits ? null : `${at}: ${JSON.stringify(value)} is none of ${JSON.stringify(schema.anyOf)}`\n }\n\n if (Array.isArray(schema.enum)) {\n return (schema.enum as unknown[]).includes(value) ? null : `${at}: ${JSON.stringify(value)} is not one of ${JSON.stringify(schema.enum)}`\n }\n\n const kind = Array.isArray(value) ? 'array' : value === null ? 'null' : typeof value\n\n switch (schema.type) {\n case 'string':\n if (kind !== 'string') return `${at}: expected a string, got ${JSON.stringify(value)}`\n if (schema.format === 'date-time' && Number.isNaN(Date.parse(value as string))) return `${at}: ${JSON.stringify(value)} is not a date-time`\n return null\n case 'integer':\n return Number.isInteger(value) ? null : `${at}: expected an integer, got ${JSON.stringify(value)}`\n case 'number':\n return kind === 'number' ? null : `${at}: expected a number, got ${JSON.stringify(value)}`\n case 'boolean':\n return kind === 'boolean' ? null : `${at}: expected a boolean, got ${JSON.stringify(value)}`\n case 'null':\n return value === null ? null : `${at}: expected null, got ${JSON.stringify(value)}`\n case 'array': {\n if (kind !== 'array') return `${at}: expected an array, got ${JSON.stringify(value)}`\n for (const [i, item] of (value as unknown[]).entries()) {\n const problem = conformsTo(item, schema.items as Schema, defs, `${at}[${i}]`)\n if (problem) return problem\n }\n return null\n }\n case 'object': {\n if (kind !== 'object') return `${at}: expected an object, got ${JSON.stringify(value)}`\n const object = value as Record<string, unknown>\n const properties = (schema.properties ?? {}) as Record<string, Schema>\n for (const name of (schema.required as string[] | undefined) ?? []) {\n if (!(name in object)) return `${at}.${name}: required, and missing`\n }\n for (const [name, s] of Object.entries(properties)) {\n if (name in object) {\n const problem = conformsTo(object[name], s, defs, `${at}.${name}`)\n if (problem) return problem\n }\n }\n const extra = schema.additionalProperties as Schema | undefined\n if (extra && !schema.properties) {\n for (const [name, item] of Object.entries(object)) {\n const problem = conformsTo(item, extra, defs, `${at}.${name}`)\n if (problem) return problem\n }\n }\n return null\n }\n default:\n return null\n }\n}\n\n/** Print a result table, and say whether the adapter conforms. */\nexport function report(results: ConformanceResult[]): boolean {\n for (const r of results) {\n stdout.write(` ${r.ok ? '✓' : '✗'} ${r.case}${r.ok ? '' : '\\n ' + r.detail}\\n`)\n }\n\n const failed = results.filter((r) => !r.ok).length\n\n stdout.write(failed === 0 ? `\\n conforms: ${results.length} cases\\n` : `\\n ${failed} of ${results.length} cases failed\\n`)\n\n return failed === 0\n}\n\n// Run as a command, not when imported.\nif (import.meta.url === pathToFileURL(argv[1] ?? '').href || argv[1]?.endsWith('rsc-kit-conformance')) {\n const flag = (name: string) => {\n const at = argv.indexOf('--' + name)\n\n return at === -1 ? undefined : argv[at + 1]\n }\n\n const endpoint = flag('endpoint')\n const secret = flag('secret')\n\n if (!endpoint || !secret) {\n stderr.write('usage: rsc-kit-conformance --endpoint <url> --secret <secret> --previous-secret <old> --purge-port <port> [--manifest rsc-host.json] [--debug]\\n')\n exit(2)\n }\n\n const purgePort = flag('purge-port')\n\n runConformance({ endpoint, secret, previousSecret: flag('previous-secret'), manifest: flag('manifest'), purgePort: purgePort ? Number(purgePort) : undefined, debug: argv.includes('--debug') })\n .then((results) => exit(report(results) ? 0 : 1))\n .catch((error: unknown) => {\n stderr.write('rsc-kit-conformance: ' + (error instanceof Error ? error.message : String(error)) + '\\n')\n exit(1)\n })\n}\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface FilesManifest {
|
|
2
|
+
v: 1;
|
|
3
|
+
/** The directory the files are in, relative to the manifest. */
|
|
4
|
+
root: string;
|
|
5
|
+
/**
|
|
6
|
+
* Every file a request may be answered with, by url path, sorted. A path
|
|
7
|
+
* is the file's name as it is on disk, not percent-encoded: a request's
|
|
8
|
+
* path is decoded before it is looked up.
|
|
9
|
+
*/
|
|
10
|
+
files: string[];
|
|
11
|
+
/**
|
|
12
|
+
* The encodings some files also exist in, as a sibling with the suffix
|
|
13
|
+
* (`/sw.js.br` is `/sw.js` in br). Served with `Content-Encoding` and
|
|
14
|
+
* `Vary: Accept-Encoding` when the request accepts it.
|
|
15
|
+
*/
|
|
16
|
+
precompressed: string[];
|
|
17
|
+
/**
|
|
18
|
+
* The headers a file goes out with beyond its Content-Type, each applying
|
|
19
|
+
* to an exact path or, ending in `/**`, to every path under it. Every entry
|
|
20
|
+
* that matches applies, in order; a later one replaces an earlier one's
|
|
21
|
+
* header of the same name. A file matched by none gets none.
|
|
22
|
+
*/
|
|
23
|
+
headers: {
|
|
24
|
+
match: string;
|
|
25
|
+
headers: Record<string, string>;
|
|
26
|
+
}[];
|
|
27
|
+
/** Whether anything of the app's runs for a file: never. */
|
|
28
|
+
middleware: false;
|
|
29
|
+
}
|
|
30
|
+
/** The route rules Nitro resolves for a url path, as its matcher merges them. */
|
|
31
|
+
export type ResolveRouteRules = (path: string) => Record<string, unknown>;
|
|
32
|
+
/** Whether a route rule's key matches a path: exact, or `/x/**` for everything under /x. */
|
|
33
|
+
export declare function ruleMatches(rule: string, path: string): boolean;
|
|
34
|
+
export declare function filesManifest(publicDir: string, routeRules: Record<string, unknown> | undefined, options?: {
|
|
35
|
+
root?: string;
|
|
36
|
+
exclude?: string[];
|
|
37
|
+
/** The app's base url; the files are under it. */
|
|
38
|
+
baseURL?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Nitro's own resolution of a path's rules. Without it a file is checked
|
|
41
|
+
* against the rules by their keys, and one under a pattern the manifest
|
|
42
|
+
* cannot state is left out by the pattern's literal prefix.
|
|
43
|
+
*/
|
|
44
|
+
resolve?: ResolveRouteRules | null;
|
|
45
|
+
/** Told about each file left to the app, and why. */
|
|
46
|
+
onLeftOut?: (path: string, why: string) => void;
|
|
47
|
+
}): FilesManifest;
|
|
48
|
+
/**
|
|
49
|
+
* The route rules Nitro resolves for a path, by the matcher it compiles them
|
|
50
|
+
* with - h3's, loaded from the app's own Nitro so the answer is that
|
|
51
|
+
* version's. Null when it cannot be loaded or refuses the rules: files.json
|
|
52
|
+
* then falls back to the rules' keys, leaving out more rather than less.
|
|
53
|
+
*/
|
|
54
|
+
export declare function nitroRouteRules(root: string, routeRules: Record<string, unknown> | undefined, baseURL: string): Promise<ResolveRouteRules | null>;
|