CodeSampleX

샘플

@oxc-project/types 0.142.0

검증된 샘플 — npm @oxc-project/types 0.142.0. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: package manifest specifies types.d.ts type declarations…

sha256:58c2dbbca1d14d2175b19488cd4a78efd6a8ce95f7219d1a416822c32a5e0485

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. MIT-0

실행 증거

선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.

증거 기준
서명된 컨트랙트 통과
검증 영수증
1
빌드한 서명 키
1
선언된 환경 linux 24 · ubuntu · glibc 2.39 x64 npm

검증 실행 환경

환경 컨트랙트 단계 실행일
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-27

케이스

HOW
목표
verify pkg:npm/%40oxc-project/types@0.142.0
패키지
생성일
2026-08-27T23:43:39Z

컨트랙트

  1. package manifest specifies types.d.ts type declarations entry and ES module type
  2. declares Span base interface, Node union type, and Program root AST interface
  3. declares AST Expression and Literal interfaces including IdentifierReference, NumericLiteral, StringLiteral, BinaryExpression, and CallExpression
  4. declares AST Statement and Declaration interfaces including VariableDeclaration, VariableDeclarator, Function, and Class
  5. declares Module AST interfaces including ImportDeclaration, ImportSpecifier, ExportNamedDeclaration, and ExportDefaultDeclaration
  6. declares TypeScript AST interfaces including TSTypeAnnotation, TSInterfaceDeclaration, TSTypeAliasDeclaration, and TSEnumDeclaration
  7. declares JSX AST interfaces including JSXElement, JSXOpeningElement, JSXAttribute, and JSXIdentifier

파일

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

소스 아티팩트 내려받기 (tar.gz)

소스

PROMPT.md
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 pkg:npm/%40oxc-project/types@0.142.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40oxc-project/types@0.142.0

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.
csx.json
{"case":{"caseId":"case:sha256:881f10868638e138f66009c94f1457f61f2ef3c354f3d1949fd6f9cb4fdb9ca3","contract":["package manifest specifies types.d.ts type declarations entry and ES module type","declares Span base interface, Node union type, and Program root AST interface","declares AST Expression and Literal interfaces including IdentifierReference, NumericLiteral, StringLiteral, BinaryExpression, and CallExpression","declares AST Statement and Declaration interfaces including VariableDeclaration, VariableDeclarator, Function, and Class","declares Module AST interfaces including ImportDeclaration, ImportSpecifier, ExportNamedDeclaration, and ExportDefaultDeclaration","declares TypeScript AST interfaces including TSTypeAnnotation, TSInterfaceDeclaration, TSTypeAliasDeclaration, and TSEnumDeclaration","declares JSX AST interfaces including JSXElement, JSXOpeningElement, JSXAttribute, and JSXIdentifier"],"goal":"verify pkg:npm/%40oxc-project/types@0.142.0","kind":"HOW","packages":["pkg:npm/%40oxc-project/types@0.142.0"],"schemaVersion":1},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40oxc-project/types@0.142.0"],"schemaVersion":1,"subject":"pkg:npm/%40oxc-project/types@0.142.0","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-oxc-project-types",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-oxc-project-types",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@oxc-project/types": "0.142.0"
      }
    },
    "node_modules/@oxc-project/types": {
      "version": "0.142.0",
      "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.142.0.tgz",
      "integrity": "sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ==",
      "license": "MIT",
      "funding": {
        "url": "https://github.com/sponsors/Boshen"
      }
    }
  }
}
package.json
{
  "name": "sample-oxc-project-types",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "@oxc-project/types": "0.142.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40oxc-project/types@0.142.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40oxc-project/types@0.142.0"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import fs from 'node:fs';
import path from 'node:path';

const require = createRequire(import.meta.url);

// 1. Resolve @oxc-project/types package manifest and verify type declaration entry points
const pkgPath = require.resolve('@oxc-project/types/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));

assert.equal(pkg.name, '@oxc-project/types', 'Package name must be @oxc-project/types');
assert.equal(pkg.version, '0.142.0', 'Package version must be 0.142.0');
assert.equal(pkg.types, 'types.d.ts', 'Package types entry must point to types.d.ts');
assert.equal(pkg.type, 'module', 'Package type must be module');

const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'types.d.ts'), 'utf8');

// 2. Verify Span base interface, Node union type, and Program root AST interface
assert.ok(
  dtsContent.includes('export interface Span {') &&
  dtsContent.includes('start: number;') &&
  dtsContent.includes('end: number;'),
  'Span interface with start and end offsets must be declared'
);
assert.ok(
  dtsContent.includes('export type Node =') &&
  dtsContent.includes('| Program') &&
  dtsContent.includes('| IdentifierReference') &&
  dtsContent.includes('| BinaryExpression'),
  'Node union type encompassing AST node variants must be declared'
);
assert.ok(
  dtsContent.includes('export interface Program extends Span {') &&
  dtsContent.includes('type: "Program";') &&
  dtsContent.includes('body: Array<Directive | Statement>;') &&
  dtsContent.includes('sourceType: ModuleKind;'),
  'Program root AST interface must be declared'
);

// 3. Verify AST Expression and Literal interfaces including IdentifierReference, NumericLiteral, StringLiteral, BinaryExpression, and CallExpression
assert.ok(
  dtsContent.includes('export interface IdentifierReference extends Span {') &&
  dtsContent.includes('type: "Identifier";') &&
  dtsContent.includes('name: string;'),
  'IdentifierReference interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface NumericLiteral extends Span {') &&
  dtsContent.includes('type: "Literal";') &&
  dtsContent.includes('value: number;'),
  'NumericLiteral interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface StringLiteral extends Span {') &&
  dtsContent.includes('type: "Literal";') &&
  dtsContent.includes('value: string;'),
  'StringLiteral interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface BinaryExpression extends Span {') &&
  dtsContent.includes('type: "BinaryExpression";') &&
  dtsContent.includes('left: Expression;') &&
  dtsContent.includes('operator: BinaryOperator;') &&
  dtsContent.includes('right: Expression;'),
  'BinaryExpression interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface CallExpression extends Span {') &&
  dtsContent.includes('type: "CallExpression";') &&
  dtsContent.includes('callee: Expression;') &&
  dtsContent.includes('arguments: Array<Argument>;'),
  'CallExpression interface must be declared'
);

// 4. Verify AST Statement and Declaration interfaces including VariableDeclaration, VariableDeclarator, Function, and Class
assert.ok(
  dtsContent.includes('export interface VariableDeclaration extends Span {') &&
  dtsContent.includes('type: "VariableDeclaration";') &&
  dtsContent.includes('kind: VariableDeclarationKind;') &&
  dtsContent.includes('declarations: Array<VariableDeclarator>;'),
  'VariableDeclaration interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface VariableDeclarator extends Span {') &&
  dtsContent.includes('type: "VariableDeclarator";') &&
  dtsContent.includes('id: BindingPattern;'),
  'VariableDeclarator interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface Function extends Span {') &&
  dtsContent.includes('type: FunctionType;') &&
  dtsContent.includes('id: BindingIdentifier | null;') &&
  dtsContent.includes('generator: boolean;') &&
  dtsContent.includes('async: boolean;') &&
  dtsContent.includes('params: ParamPattern[];'),
  'Function interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface Class extends Span {') &&
  dtsContent.includes('type: ClassType;') &&
  dtsContent.includes('superClass: Expression | null;') &&
  dtsContent.includes('body: ClassBody;'),
  'Class interface must be declared'
);

// 5. Verify Module AST interfaces including ImportDeclaration, ImportSpecifier, ExportNamedDeclaration, and ExportDefaultDeclaration
assert.ok(
  dtsContent.includes('export interface ImportDeclaration extends Span {') &&
  dtsContent.includes('type: "ImportDeclaration";') &&
  dtsContent.includes('specifiers: Array<ImportDeclarationSpecifier>;') &&
  dtsContent.includes('source: StringLiteral;'),
  'ImportDeclaration interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface ImportSpecifier extends Span {') &&
  dtsContent.includes('type: "ImportSpecifier";') &&
  dtsContent.includes('imported: ModuleExportName;') &&
  dtsContent.includes('local: BindingIdentifier;'),
  'ImportSpecifier interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface ExportNamedDeclaration extends Span {') &&
  dtsContent.includes('type: "ExportNamedDeclaration";') &&
  dtsContent.includes('declaration: Declaration | null;'),
  'ExportNamedDeclaration interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface ExportDefaultDeclaration extends Span {') &&
  dtsContent.includes('type: "ExportDefaultDeclaration";') &&
  dtsContent.includes('declaration: ExportDefaultDeclarationKind;'),
  'ExportDefaultDeclaration interface must be declared'
);

// 6. Verify TypeScript AST interfaces including TSTypeAnnotation, TSInterfaceDeclaration, TSTypeAliasDeclaration, and TSEnumDeclaration
assert.ok(
  dtsContent.includes('export interface TSTypeAnnotation extends Span {') &&
  dtsContent.includes('type: "TSTypeAnnotation";') &&
  dtsContent.includes('typeAnnotation: TSType;'),
  'TSTypeAnnotation interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface TSInterfaceDeclaration extends Span {') &&
  dtsContent.includes('type: "TSInterfaceDeclaration";') &&
  dtsContent.includes('id: BindingIdentifier;') &&
  dtsContent.includes('body: TSInterfaceBody;'),
  'TSInterfaceDeclaration interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface TSTypeAliasDeclaration extends Span {') &&
  dtsContent.includes('type: "TSTypeAliasDeclaration";') &&
  dtsContent.includes('id: BindingIdentifier;') &&
  dtsContent.includes('typeAnnotation: TSType;'),
  'TSTypeAliasDeclaration interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface TSEnumDeclaration extends Span {') &&
  dtsContent.includes('type: "TSEnumDeclaration";') &&
  dtsContent.includes('id: BindingIdentifier;') &&
  dtsContent.includes('body: TSEnumBody;'),
  'TSEnumDeclaration interface must be declared'
);

// 7. Verify JSX AST interfaces including JSXElement, JSXOpeningElement, JSXAttribute, and JSXIdentifier
assert.ok(
  dtsContent.includes('export interface JSXElement extends Span {') &&
  dtsContent.includes('type: "JSXElement";') &&
  dtsContent.includes('openingElement: JSXOpeningElement;') &&
  dtsContent.includes('children: Array<JSXChild>;') &&
  dtsContent.includes('closingElement: JSXClosingElement | null;'),
  'JSXElement interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface JSXOpeningElement extends Span {') &&
  dtsContent.includes('type: "JSXOpeningElement";') &&
  dtsContent.includes('name: JSXElementName;') &&
  dtsContent.includes('attributes: Array<JSXAttributeItem>;'),
  'JSXOpeningElement interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface JSXAttribute extends Span {') &&
  dtsContent.includes('type: "JSXAttribute";') &&
  dtsContent.includes('name: JSXAttributeName;'),
  'JSXAttribute interface must be declared'
);
assert.ok(
  dtsContent.includes('export interface JSXIdentifier extends Span {') &&
  dtsContent.includes('type: "JSXIdentifier";') &&
  dtsContent.includes('name: string;'),
  'JSXIdentifier interface must be declared'
);

console.log('Contract tests passed successfully.');

오리진 시더

익명