샘플
@types/react-dom 19.2.4: types
검증된 샘플 — npm @types/react-dom 19.2.4: types. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: @types/react-dom package.json defines types field…
sha256:20407b89528e5a49b984b147008a9bfeae4081eb938c5fb3eda01e6945795d14
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 2
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-26 |
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-07 |
케이스
HOW- 목표
- verify @types/react-dom.types in pkg:npm/%40types/react-dom@19.2.4
- 심벌
-
- @types/react-dom.types
- 환경
- node 22.23.2
- 생성일
- 2026-08-26T12:42:09Z
컨트랙트
- @types/react-dom package.json defines types field pointing to index.d.ts and version 19.2.4
- @types/react-dom package exports declare TypeScript definition subpaths for client, server, static, canary, and experimental modules
- index.d.ts declares core DOM functions and hook state types including createPortal, flushSync, useFormStatus, and useFormState
- client.d.ts declares client rendering root functions createRoot and hydrateRoot along with Root and HydrationOptions interfaces
- server.d.ts and static.d.ts declare server streaming and prerendering APIs including renderToPipeableStream, renderToReadableStream, and prerender
- Inspection helpers correctly verify type declaration files existence and symbol content integrity
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.mjs
- test/contract.mjs
소스
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify @types/react-dom.types in pkg:npm/%40types/react-dom@19.2.4
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/react-dom@19.2.4
Demonstrate these symbols/APIs:
- @types/react-dom.types
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:d91e0f278ac4c353c254629ddc469fc77eeb4eae8d2a4f1e8141280169a209fc","constraints":{"executionContext":"node"},"contract":["@types/react-dom package.json defines types field pointing to index.d.ts and version 19.2.4","@types/react-dom package exports declare TypeScript definition subpaths for client, server, static, canary, and experimental modules","index.d.ts declares core DOM functions and hook state types including createPortal, flushSync, useFormStatus, and useFormState","client.d.ts declares client rendering root functions createRoot and hydrateRoot along with Root and HydrationOptions interfaces","server.d.ts and static.d.ts declare server streaming and prerendering APIs including renderToPipeableStream, renderToReadableStream, and prerender","Inspection helpers correctly verify type declaration files existence and symbol content integrity"],"goal":"verify @types/react-dom.types in pkg:npm/%40types/react-dom@19.2.4","kind":"HOW","packages":["pkg:npm/%40types/react-dom@19.2.4"],"schemaVersion":1,"symbols":["@types/react-dom.types"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40types/react-dom@19.2.4"],"schemaVersion":1,"subject":"pkg:npm/%40types/react-dom@19.2.4","symbols":["@types/react-dom.types"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-react-dom-types",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-react-dom-types",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/react-dom": "19.2.4"
}
},
"node_modules/@types/react": {
"version": "19.2.18",
"resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.18.tgz",
"integrity": "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w==",
"license": "MIT",
"peer": true,
"dependencies": {
"csstype": "^3.2.2"
}
},
"node_modules/@types/react-dom": {
"version": "19.2.4",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.2.4.tgz",
"integrity": "sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw==",
"license": "MIT",
"peerDependencies": {
"@types/react": "^19.2.0"
}
},
"node_modules/csstype": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
"license": "MIT",
"peer": true
}
}
}
{
"name": "sample-react-dom-types",
"version": "1.0.0",
"private": true,
"license": "MIT-0",
"dependencies": {
"@types/react-dom": "19.2.4"
}
}
{
"schemaVersion": 1,
"goal": "verify @types/react-dom.types in pkg:npm/%40types/react-dom@19.2.4",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/react-dom@19.2.4"
],
"symbols": [
"@types/react-dom.types"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
import fs from 'node:fs';
import path from 'node:path';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
/**
* Returns the package directory for @types/react-dom.
* @returns {string} Directory path
*/
export function getReactDomTypesDir() {
const pkgPath = require.resolve('@types/react-dom/package.json');
return path.dirname(pkgPath);
}
/**
* Resolves the path to a declaration file in @types/react-dom.
* @param {string} [subPath='index.d.ts'] - Declaration relative file path
* @returns {string} Absolute path to declaration file
*/
export function getDeclarationPath(subPath = 'index.d.ts') {
return path.join(getReactDomTypesDir(), subPath);
}
/**
* Reads the content of a declaration file in @types/react-dom.
* @param {string} [subPath='index.d.ts'] - Declaration relative file path
* @returns {string} File content
*/
export function readDeclarationContent(subPath = 'index.d.ts') {
const declPath = getDeclarationPath(subPath);
return fs.readFileSync(declPath, 'utf8');
}
/**
* Validates package.json type definition metadata for @types/react-dom.
* @returns {object} Manifest types metadata summary
*/
export function inspectPackageTypesMetadata() {
const pkgJson = require('@types/react-dom/package.json');
return {
name: pkgJson.name,
version: pkgJson.version,
types: pkgJson.types,
hasMainTypes: pkgJson.types === 'index.d.ts',
exports: pkgJson.exports,
hasClientExport: Boolean(pkgJson.exports && pkgJson.exports['./client']),
hasServerExport: Boolean(pkgJson.exports && pkgJson.exports['./server']),
hasStaticExport: Boolean(pkgJson.exports && pkgJson.exports['./static']),
hasCanaryExport: Boolean(pkgJson.exports && pkgJson.exports['./canary']),
hasExperimentalExport: Boolean(pkgJson.exports && pkgJson.exports['./experimental']),
hasTestUtilsExport: Boolean(pkgJson.exports && pkgJson.exports['./test-utils'])
};
}
/**
* Inspects all core TypeScript declaration files for expected symbol declarations.
* @returns {object} Declared symbol inspection results
*/
export function inspectDeclaredSymbols() {
const indexContent = readDeclarationContent('index.d.ts');
const clientContent = readDeclarationContent('client.d.ts');
const serverContent = readDeclarationContent('server.d.ts');
const staticContent = readDeclarationContent('static.d.ts');
return {
index: {
hasCreatePortal: indexContent.includes('function createPortal('),
hasFlushSync: indexContent.includes('function flushSync<R>('),
hasUnstableBatchedUpdates: indexContent.includes('function unstable_batchedUpdates<'),
hasUseFormStatus: indexContent.includes('function useFormStatus(): FormStatus;'),
hasUseFormState: indexContent.includes('function useFormState<State>('),
hasPreload: indexContent.includes('function preload('),
hasPreinit: indexContent.includes('function preinit('),
hasVersion: indexContent.includes('const version: string;')
},
client: {
hasCreateRoot: clientContent.includes('function createRoot('),
hasHydrateRoot: clientContent.includes('function hydrateRoot('),
hasRootInterface: clientContent.includes('interface Root {'),
hasRootOptionsInterface: clientContent.includes('interface RootOptions {'),
hasHydrationOptionsInterface: clientContent.includes('interface HydrationOptions {')
},
server: {
hasRenderToString: serverContent.includes('function renderToString('),
hasRenderToStaticMarkup: serverContent.includes('function renderToStaticMarkup('),
hasRenderToPipeableStream: serverContent.includes('function renderToPipeableStream('),
hasRenderToReadableStream: serverContent.includes('function renderToReadableStream(')
},
static: {
hasPrerenderToNodeStream: staticContent.includes('function prerenderToNodeStream('),
hasPrerender: staticContent.includes('function prerender(')
}
};
}
import assert from 'node:assert/strict';
import fs from 'node:fs';
import {
getReactDomTypesDir,
getDeclarationPath,
readDeclarationContent,
inspectPackageTypesMetadata,
inspectDeclaredSymbols
} from '../src/index.mjs';
// Contract 1: @types/react-dom package.json defines types field pointing to index.d.ts and version 19.2.4
{
const metadata = inspectPackageTypesMetadata();
assert.equal(metadata.name, '@types/react-dom');
assert.equal(metadata.version, '19.2.4');
assert.equal(metadata.types, 'index.d.ts');
assert.equal(metadata.hasMainTypes, true);
}
// Contract 2: @types/react-dom package exports declare TypeScript definition subpaths for client, server, static, canary, and experimental modules
{
const metadata = inspectPackageTypesMetadata();
assert.equal(metadata.hasClientExport, true);
assert.equal(metadata.hasServerExport, true);
assert.equal(metadata.hasStaticExport, true);
assert.equal(metadata.hasCanaryExport, true);
assert.equal(metadata.hasExperimentalExport, true);
assert.equal(metadata.hasTestUtilsExport, true);
}
// Contract 3: index.d.ts declares core DOM functions and hook state types including createPortal, flushSync, useFormStatus, and useFormState
{
const indexPath = getDeclarationPath('index.d.ts');
assert.ok(fs.existsSync(indexPath));
const content = readDeclarationContent('index.d.ts');
assert.ok(content.includes('function createPortal('));
assert.ok(content.includes('function flushSync<R>('));
assert.ok(content.includes('function useFormStatus(): FormStatus;'));
assert.ok(content.includes('function useFormState<State>('));
}
// Contract 4: client.d.ts declares client rendering root functions createRoot and hydrateRoot along with Root and HydrationOptions interfaces
{
const clientPath = getDeclarationPath('client.d.ts');
assert.ok(fs.existsSync(clientPath));
const content = readDeclarationContent('client.d.ts');
assert.ok(content.includes('function createRoot('));
assert.ok(content.includes('function hydrateRoot('));
assert.ok(content.includes('interface Root {'));
assert.ok(content.includes('interface RootOptions {'));
assert.ok(content.includes('interface HydrationOptions {'));
}
// Contract 5: server.d.ts and static.d.ts declare server streaming and prerendering APIs including renderToPipeableStream, renderToReadableStream, and prerender
{
const serverPath = getDeclarationPath('server.d.ts');
const staticPath = getDeclarationPath('static.d.ts');
assert.ok(fs.existsSync(serverPath));
assert.ok(fs.existsSync(staticPath));
const serverContent = readDeclarationContent('server.d.ts');
assert.ok(serverContent.includes('function renderToString('));
assert.ok(serverContent.includes('function renderToPipeableStream('));
assert.ok(serverContent.includes('function renderToReadableStream('));
const staticContent = readDeclarationContent('static.d.ts');
assert.ok(staticContent.includes('function prerender('));
assert.ok(staticContent.includes('function prerenderToNodeStream('));
}
// Contract 6: Inspection helpers correctly verify type declaration files existence and symbol content integrity
{
const dir = getReactDomTypesDir();
assert.ok(fs.existsSync(dir));
const symbols = inspectDeclaredSymbols();
assert.equal(symbols.index.hasCreatePortal, true);
assert.equal(symbols.index.hasFlushSync, true);
assert.equal(symbols.index.hasUseFormStatus, true);
assert.equal(symbols.index.hasUseFormState, true);
assert.equal(symbols.client.hasCreateRoot, true);
assert.equal(symbols.client.hasHydrateRoot, true);
assert.equal(symbols.server.hasRenderToPipeableStream, true);
assert.equal(symbols.server.hasRenderToReadableStream, true);
assert.equal(symbols.static.hasPrerender, true);
assert.equal(symbols.static.hasPrerenderToNodeStream, true);
}
console.log('Contract tests passed.');
오리진 시더
익명