샘플
@types/fs-extra 9.0.13
검증된 샘플 — npm @types/fs-extra 9.0.13. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: package manifest specifies index.d.ts type declarations and…
sha256:e8fca7d6273fac5a1ecae24d471ec4d2c2f91755eeb421678f00a11e864ccfa0
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
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-23 |
케이스
HOW- 목표
- verify pkg:npm/%40types/fs-extra@9.0.13
- 생성일
- 2026-08-23T13:53:19Z
컨트랙트
- package manifest specifies index.d.ts type declarations and TypeScript version 3.9
- declares copy, move, and remove helper functions with Promise and callback signatures
- declares outputFile, outputJson, writeJson, and readJson helper functions with sync and async overloads
- declares ensureDir, ensureFile, ensureLink, ensureSymlink, and emptyDir directory utility functions
- declares CopyOptions, MoveOptions, EnsureOptions, ReadOptions, and WriteOptions type definitions
- re-exports all standard fs module members and extends Node file system method declarations
파일
- 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/fs-extra@9.0.13
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40types/fs-extra@9.0.13
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:c1be42e09292131d9c0bd55ebeffd20abcea4ba4d9ab732e8dd7933f1d94596a","contract":["package manifest specifies index.d.ts type declarations and TypeScript version 3.9","declares copy, move, and remove helper functions with Promise and callback signatures","declares outputFile, outputJson, writeJson, and readJson helper functions with sync and async overloads","declares ensureDir, ensureFile, ensureLink, ensureSymlink, and emptyDir directory utility functions","declares CopyOptions, MoveOptions, EnsureOptions, ReadOptions, and WriteOptions type definitions","re-exports all standard fs module members and extends Node file system method declarations"],"goal":"verify pkg:npm/%40types/fs-extra@9.0.13","kind":"HOW","packages":["pkg:npm/%40types/fs-extra@9.0.13"],"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/%40types/fs-extra@9.0.13"],"schemaVersion":1,"subject":"pkg:npm/%40types/fs-extra@9.0.13","verifierAdapter":"node-typescript@1"}
{
"name": "sample-types-fs-extra",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-types-fs-extra",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@types/fs-extra": "9.0.13"
}
},
"node_modules/@types/fs-extra": {
"version": "9.0.13",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz",
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",
"license": "MIT",
"dependencies": {
"@types/node": "*"
}
},
"node_modules/@types/node": {
"version": "26.2.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.2.0.tgz",
"integrity": "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg==",
"license": "MIT",
"dependencies": {
"undici-types": "~8.3.0"
}
},
"node_modules/undici-types": {
"version": "8.3.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
"license": "MIT"
}
}
}
{
"name": "sample-types-fs-extra",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"@types/fs-extra": "9.0.13"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40types/fs-extra@9.0.13",
"kind": "HOW",
"packages": [
"pkg:npm/%40types/fs-extra@9.0.13"
]
}
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/fs-extra package manifest and verify type declaration entry points
const pkgPath = require.resolve('@types/fs-extra/package.json');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, '@types/fs-extra', 'Package name must be @types/fs-extra');
assert.equal(pkg.version, '9.0.13', 'Package version must be 9.0.13');
assert.equal(pkg.types, 'index.d.ts', 'Package types entry must point to index.d.ts');
assert.equal(pkg.typeScriptVersion, '3.9', 'TypeScript version must be 3.9');
const typesDir = path.dirname(pkgPath);
const dtsContent = fs.readFileSync(path.join(typesDir, 'index.d.ts'), 'utf8');
// 2. Verify declarations for copy, move, and remove helper functions
assert.ok(
dtsContent.includes('export function copy(src: string, dest: string, options?: CopyOptions): Promise<void>;') &&
dtsContent.includes('export function copySync(src: string, dest: string, options?: CopyOptionsSync): void;'),
'copy and copySync function overloads must be declared'
);
assert.ok(
dtsContent.includes('export function move(src: string, dest: string, options?: MoveOptions): Promise<void>;') &&
dtsContent.includes('export function moveSync(src: string, dest: string, options?: MoveOptions): void;'),
'move and moveSync function overloads must be declared'
);
assert.ok(
dtsContent.includes('export function remove(dir: string, callback?: (err: Error) => void): Promise<void>;') &&
dtsContent.includes('export function removeSync(dir: string): void;'),
'remove and removeSync function overloads must be declared'
);
// 3. Verify declarations for outputFile, outputJson, writeJson, and readJson helpers
assert.ok(
dtsContent.includes('export function outputFile(') &&
dtsContent.includes('export function outputFileSync(file: string, data: any, options?: WriteFileOptions | BufferEncoding | string): void;'),
'outputFile and outputFileSync functions must be declared'
);
assert.ok(
dtsContent.includes('export function outputJson(') &&
dtsContent.includes('export function outputJsonSync(file: string, data: any, options?: WriteOptions | BufferEncoding | string): void;') &&
dtsContent.includes('export function outputJSON('),
'outputJson and outputJSON functions must be declared'
);
assert.ok(
dtsContent.includes('export function writeJson(') &&
dtsContent.includes('export function writeJsonSync(file: string, object: any, options?: WriteOptions | BufferEncoding | string): void;') &&
dtsContent.includes('export function writeJSON('),
'writeJson and writeJSON functions must be declared'
);
assert.ok(
dtsContent.includes('export function readJson(file: string, options?: ReadOptions | BufferEncoding | string): Promise<any>;') &&
dtsContent.includes('export function readJsonSync(file: string, options?: ReadOptions | BufferEncoding | string): any;') &&
dtsContent.includes('export function readJSON('),
'readJson and readJSON functions must be declared'
);
// 4. Verify directory and file utilities: ensureDir, ensureFile, ensureLink, ensureSymlink, emptyDir, pathExists
assert.ok(
dtsContent.includes('export function ensureDir(path: string, options?: EnsureOptions | number): Promise<void>;') &&
dtsContent.includes('export function ensureDirSync(path: string, options?: EnsureOptions | number): void;') &&
dtsContent.includes('export function mkdirp(') &&
dtsContent.includes('export function mkdirs('),
'ensureDir, mkdirp, and mkdirs functions must be declared'
);
assert.ok(
dtsContent.includes('export function ensureFile(path: string): Promise<void>;') &&
dtsContent.includes('export function ensureFileSync(path: string): void;') &&
dtsContent.includes('export function createFile('),
'ensureFile and createFile functions must be declared'
);
assert.ok(
dtsContent.includes('export function ensureLink(src: string, dest: string): Promise<void>;') &&
dtsContent.includes('export function ensureLinkSync(src: string, dest: string): void;') &&
dtsContent.includes('export function ensureSymlink(src: string, dest: string, type?: SymlinkType): Promise<void>;') &&
dtsContent.includes('export function ensureSymlinkSync(src: string, dest: string, type?: SymlinkType): void;'),
'ensureLink and ensureSymlink functions must be declared'
);
assert.ok(
dtsContent.includes('export function emptyDir(path: string): Promise<void>;') &&
dtsContent.includes('export function emptyDirSync(path: string): void;') &&
dtsContent.includes('export const emptydir: typeof emptyDir;') &&
dtsContent.includes('export function pathExists(path: string): Promise<boolean>;') &&
dtsContent.includes('export function pathExistsSync(path: string): boolean;'),
'emptyDir and pathExists functions must be declared'
);
// 5. Verify option interfaces and types: CopyOptions, MoveOptions, EnsureOptions, ReadOptions, WriteOptions
assert.ok(
dtsContent.includes('export interface CopyOptions {') &&
dtsContent.includes('dereference?: boolean | undefined;') &&
dtsContent.includes('overwrite?: boolean | undefined;') &&
dtsContent.includes('preserveTimestamps?: boolean | undefined;') &&
dtsContent.includes('export interface CopyOptionsSync extends CopyOptions {'),
'CopyOptions and CopyOptionsSync interfaces must be declared'
);
assert.ok(
dtsContent.includes('export interface MoveOptions {') &&
dtsContent.includes('export interface EnsureOptions {') &&
dtsContent.includes('export interface ReadOptions {') &&
dtsContent.includes('export interface WriteFileOptions {') &&
dtsContent.includes('export interface WriteOptions extends WriteFileOptions {') &&
dtsContent.includes('export interface WritevResult {') &&
dtsContent.includes('export type SymlinkType = \'dir\' | \'file\' | \'junction\';'),
'MoveOptions, EnsureOptions, ReadOptions, WriteOptions, and SymlinkType types must be declared'
);
// 6. Verify standard fs re-exports and extended async signatures
assert.ok(
dtsContent.includes('export * from \'fs\';'),
'Must re-export all standard fs module declarations'
);
assert.ok(
dtsContent.includes('export function readFile(file: PathLike | number): Promise<Buffer>;') &&
dtsContent.includes('export function writeFile(') &&
dtsContent.includes('export function readdir(') &&
dtsContent.includes('export function stat(path: PathLike): Promise<Stats>;'),
'Extended async signatures returning Promise must be declared'
);
console.log('Contract tests passed successfully.');
오리진 시더
익명