샘플
@types/markdown-it 14.2.0
검증된 샘플 — npm @types/markdown-it 14.2.0. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: package manifest specifies index.d.ts type declarations…
sha256:807dac4223fe8eccf05f9da10537ff92b9444547201ecf8beee0ba20705bf9ab
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-15 |
케이스
HOW- 목표
- verify pkg:npm/%40types/markdown-it@14.2.0
- 환경
- node 22.23.2
- 생성일
- 2026-09-15T04:19:33Z
컨트랙트
- package manifest specifies index.d.ts type declarations and TypeScript version 5.6
- exports ESM module declarations with MarkdownIt, Options, and Parser type definitions
- exports CommonJS declarations with MarkdownIt constructor supporting presets and options
- declares MarkdownIt interface with parser, renderer, linkify, and rule configuration methods
- declares Token class with tag, nesting, content, and attribute manipulation methods
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- 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 pkg:npm/%40types/markdown-it@14.2.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/markdown-it@14.2.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.
{"case":{"caseId":"case:sha256:61191f7dea4332e738a5284cb5046009d7b0ab9ebd1851e543ba8132457f83f8","contract":["package manifest specifies index.d.ts type declarations and TypeScript version 5.6","exports ESM module declarations with MarkdownIt, Options, and Parser type definitions","exports CommonJS declarations with MarkdownIt constructor supporting presets and options","declares MarkdownIt interface with parser, renderer, linkify, and rule configuration methods","declares Token class with tag, nesting, content, and attribute manipulation methods"],"goal":"verify pkg:npm/%40types/markdown-it@14.2.0","kind":"HOW","packages":["pkg:npm/%40types/markdown-it@14.2.0"],"schemaVersion":1},"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/markdown-it@14.2.0"],"schemaVersion":1,"subject":"pkg:npm/%40types/markdown-it@14.2.0","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-markdown-it",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-markdown-it",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/markdown-it": "14.2.0"
}
},
"node_modules/@types/linkify-it": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz",
"integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==",
"license": "MIT"
},
"node_modules/@types/markdown-it": {
"version": "14.2.0",
"resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.2.0.tgz",
"integrity": "sha512-NoQ2yGlLWj4wpxMs+TYmRKk3thDrQ97agr7sFqfLsAlvoS8SNQuTrlObhFqG9iugdTtgOE9jpJ6FNM4ZGsa5xQ==",
"license": "MIT",
"dependencies": {
"@types/linkify-it": "^5",
"@types/mdurl": "^2"
}
},
"node_modules/@types/mdurl": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz",
"integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==",
"license": "MIT"
}
}
}
{
"name": "sample-types-markdown-it",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/markdown-it": "14.2.0"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/markdown-it@14.2.0",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/markdown-it@14.2.0"
]
}
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 @types/markdown-it package manifest and verify package metadata and exports
const pkgPath = require.resolve('@types/markdown-it/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/markdown-it', 'Package name must be @types/markdown-it');
assert.equal(pkg.version, '14.2.0', 'Package version must be 14.2.0');
assert.equal(pkg.types, 'index.d.ts', 'Package types entry must point to index.d.ts');
assert.equal(pkg.typeScriptVersion, '5.6', 'TypeScript version must be 5.6');
assert.ok(pkg.exports && pkg.exports['.'], 'Package must define root exports map');
assert.equal(pkg.exports['.'].import, './index.d.mts', 'Root ESM export must point to ./index.d.mts');
assert.equal(pkg.exports['.'].require, './dist/index.cjs.d.ts', 'Root CJS export must point to ./dist/index.cjs.d.ts');
assert.ok(pkg.dependencies && pkg.dependencies['@types/linkify-it'], 'Package must depend on @types/linkify-it');
assert.ok(pkg.dependencies && pkg.dependencies['@types/mdurl'], 'Package must depend on @types/mdurl');
const typesDir = path.dirname(pkgPath);
// 2. Verify ESM type declarations in index.d.mts
const esmDts = fs.readFileSync(path.join(typesDir, 'index.d.mts'), 'utf8');
assert.ok(
esmDts.includes('default') &&
esmDts.includes('type default as MarkdownIt') &&
esmDts.includes('Options') &&
esmDts.includes('PresetName'),
'index.d.mts must re-export default MarkdownIt, Options, and PresetName'
);
assert.ok(
esmDts.includes('export type { default as ParserBlock } from "./lib/parser_block.mts";') &&
esmDts.includes('export type { default as ParserCore } from "./lib/parser_core.mts";') &&
esmDts.includes('export type { default as ParserInline } from "./lib/parser_inline.mts";') &&
esmDts.includes('export type { default as Renderer, RenderRule as RendererRule } from "./lib/renderer.mts";') &&
esmDts.includes('export type { default as Token } from "./lib/token.mts";'),
'index.d.mts must export parser, renderer, and token types'
);
// 3. Verify CommonJS entry in index.d.ts and dist/index.cjs.d.ts
const cjsDts = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
assert.ok(
cjsDts.includes('import MarkdownIt = require("./dist/index.cjs.js");') &&
cjsDts.includes('export = MarkdownIt;'),
'index.d.ts must export MarkdownIt via CommonJS export assignment'
);
const distCjsDts = fs.readFileSync(path.join(typesDir, 'dist/index.cjs.d.ts'), 'utf8');
assert.ok(
distCjsDts.includes('declare const MarkdownIt: MarkdownItConstructor;') &&
distCjsDts.includes('export = MarkdownIt;'),
'dist/index.cjs.d.ts must declare MarkdownIt constructor and export = MarkdownIt'
);
assert.ok(
distCjsDts.includes('type PresetName = "default" | "zero" | "commonmark";'),
'dist/index.cjs.d.ts must define PresetName type'
);
// 4. Verify MarkdownIt interface methods and options
assert.ok(
distCjsDts.includes('interface Options {') &&
distCjsDts.includes('html?: boolean | undefined;') &&
distCjsDts.includes('linkify?: boolean | undefined;') &&
distCjsDts.includes('typographer?: boolean | undefined;') &&
distCjsDts.includes('highlight?: ((str: string, lang: string, attrs: string) => string) | null | undefined;'),
'Options interface must declare markdown configuration fields'
);
assert.ok(
distCjsDts.includes('interface MarkdownIt {') &&
distCjsDts.includes('render(src: string, env?: any): string;') &&
distCjsDts.includes('renderInline(src: string, env?: any): string;') &&
distCjsDts.includes('parse(src: string, env: any): Token[];') &&
distCjsDts.includes('parseInline(src: string, env: any): Token[];') &&
distCjsDts.includes('use(plugin: MarkdownIt.PluginSimple): this;') &&
distCjsDts.includes('enable(list: string | string[], ignoreInvalid?: boolean): this;') &&
distCjsDts.includes('disable(list: string | string[], ignoreInvalid?: boolean): this;'),
'MarkdownIt interface must declare core render, parse, and configuration methods'
);
// 5. Verify Token class and attribute manipulation declarations
assert.ok(
distCjsDts.includes('declare class Token {') &&
distCjsDts.includes('type: string;') &&
distCjsDts.includes('tag: string;') &&
distCjsDts.includes('attrs: Array<[string, string]> | null;') &&
distCjsDts.includes('nesting: MarkdownIt.Token.Nesting;') &&
distCjsDts.includes('level: number;') &&
distCjsDts.includes('children: Token[] | null;') &&
distCjsDts.includes('content: string;') &&
distCjsDts.includes('attrIndex(name: string): number;') &&
distCjsDts.includes('attrPush(attrData: [string, string]): void;') &&
distCjsDts.includes('attrSet(name: string, value: string): void;') &&
distCjsDts.includes('attrGet(name: string): string | null;') &&
distCjsDts.includes('attrJoin(name: string, value: string): void;'),
'Token class must declare token structure and attribute manipulation methods'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명