Sample
enhanced-resolve 5.24.5: create
Verified sample for npm enhanced-resolve 5.24.5: create. The contract ran on node 22 · linux debian/x64 · docker and passed: enhanced-resolve.create is…
sha256:30b7429b7a2a0c5259449b22f8a4bcd96ac9301e4f5788dbb1a251587092bef2
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 npm
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| 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-10-09 |
Case
HOW- Goal
- verify enhanced-resolve.create in pkg:npm/enhanced-resolve@5.24.5
- Packages
- Symbols
-
- enhanced-resolve.create
- Created
- 2026-10-09T22:08:05Z
Contract
- enhanced-resolve.create is exported as a function with sync and promise properties
- enhanced-resolve.create returns an async resolver function that resolves module paths with callback
- enhanced-resolve.create.sync returns a synchronous resolver function that returns resolved path
- enhanced-resolve.create.promise returns a promise-based resolver function that resolves to file path
- enhanced-resolve.create custom options support extension resolution and alias mapping
- enhanced-resolve.create throws or reports error when target cannot be resolved
Files
- PROMPT.md
- csx.json
- index.mjs
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Source
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 enhanced-resolve.create in pkg:npm/enhanced-resolve@5.24.5
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/enhanced-resolve@5.24.5
Demonstrate these symbols/APIs:
- enhanced-resolve.create
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:d753cc9616565d21b9c2ba9dcfa06fc750f7e3f6d0d4bc5227877dd190525a51","contract":["enhanced-resolve.create is exported as a function with sync and promise properties","enhanced-resolve.create returns an async resolver function that resolves module paths with callback","enhanced-resolve.create.sync returns a synchronous resolver function that returns resolved path","enhanced-resolve.create.promise returns a promise-based resolver function that resolves to file path","enhanced-resolve.create custom options support extension resolution and alias mapping","enhanced-resolve.create throws or reports error when target cannot be resolved"],"goal":"verify enhanced-resolve.create in pkg:npm/enhanced-resolve@5.24.5","kind":"HOW","packages":["pkg:npm/enhanced-resolve@5.24.5"],"schemaVersion":1,"symbols":["enhanced-resolve.create"]},"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/enhanced-resolve@5.24.5"],"schemaVersion":1,"subject":"pkg:npm/enhanced-resolve@5.24.5","symbols":["enhanced-resolve.create"],"verifierAdapter":"node-typescript@1"}
import resolve from 'enhanced-resolve';
/**
* Creates an asynchronous resolver function with custom resolution options.
*
* @param {object} options - Resolver configuration options.
* @returns {Function} Asynchronous resolver function.
*/
export function createResolver(options) {
return resolve.create(options);
}
/**
* Creates a synchronous resolver function with custom resolution options.
*
* @param {object} options - Resolver configuration options.
* @returns {Function} Synchronous resolver function.
*/
export function createSyncResolver(options) {
return resolve.create.sync(options);
}
/**
* Creates a promise-based resolver function with custom resolution options.
*
* @param {object} options - Resolver configuration options.
* @returns {Function} Promise-based resolver function.
*/
export function createPromiseResolver(options) {
return resolve.create.promise(options);
}
export const create = resolve.create;
export default resolve;
{
"name": "sample-enhanced-resolve-create",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-enhanced-resolve-create",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"enhanced-resolve": "5.24.5"
}
},
"node_modules/enhanced-resolve": {
"version": "5.24.5",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.24.5.tgz",
"integrity": "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A==",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.4",
"tapable": "^2.3.3"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"license": "ISC"
},
"node_modules/tapable": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz",
"integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==",
"license": "MIT",
"engines": {
"node": ">=6"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
}
}
}
}
{
"name": "sample-enhanced-resolve-create",
"version": "1.0.0",
"type": "module",
"main": "index.mjs",
"license": "MIT-0",
"scripts": {
"test": "node test/contract.mjs"
},
"dependencies": {
"enhanced-resolve": "5.24.5"
}
}
{
"schemaVersion": 1,
"goal": "verify enhanced-resolve.create in pkg:npm/enhanced-resolve@5.24.5",
"kind": "HOW",
"packages": [
"pkg:npm/enhanced-resolve@5.24.5"
],
"symbols": [
"enhanced-resolve.create"
]
}
import assert from 'node:assert/strict';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import resolve from 'enhanced-resolve';
import {
create,
createResolver,
createSyncResolver,
createPromiseResolver,
} from '../index.mjs';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
// 1. enhanced-resolve.create is exported as a function with sync and promise properties
assert.strictEqual(typeof resolve.create, 'function', 'enhanced-resolve.create should be a function');
assert.strictEqual(typeof resolve.create.sync, 'function', 'enhanced-resolve.create.sync should be a function');
assert.strictEqual(typeof resolve.create.promise, 'function', 'enhanced-resolve.create.promise should be a function');
assert.strictEqual(create, resolve.create, 'named create export should match resolve.create');
// 2. enhanced-resolve.create returns an async resolver function that resolves module paths with callback
const asyncResolver = createResolver({
extensions: ['.js', '.json', '.mjs'],
});
assert.strictEqual(typeof asyncResolver, 'function', 'create() should return a resolver function');
await new Promise((res, rej) => {
asyncResolver(__dirname, '../package', (err, result) => {
if (err) return rej(err);
try {
assert.strictEqual(result, path.resolve(__dirname, '../package.json'));
res();
} catch (assertionErr) {
rej(assertionErr);
}
});
});
// 3. enhanced-resolve.create.sync returns a synchronous resolver function that returns resolved path
const syncResolver = createSyncResolver({
extensions: ['.js', '.json', '.mjs'],
});
assert.strictEqual(typeof syncResolver, 'function', 'create.sync() should return a resolver function');
const syncResolved = syncResolver(__dirname, '../package');
assert.strictEqual(syncResolved, path.resolve(__dirname, '../package.json'));
// 4. enhanced-resolve.create.promise returns a promise-based resolver function that resolves to file path
const promiseResolver = createPromiseResolver({
extensions: ['.js', '.json', '.mjs'],
});
assert.strictEqual(typeof promiseResolver, 'function', 'create.promise() should return a resolver function');
const promiseResolved = await promiseResolver(__dirname, '../package');
assert.strictEqual(promiseResolved, path.resolve(__dirname, '../package.json'));
// 5. enhanced-resolve.create custom options support extension resolution and alias mapping
const aliasResolver = createSyncResolver({
alias: {
'@sample-pkg': path.resolve(__dirname, '../package.json'),
},
});
const aliasResolved = aliasResolver(__dirname, '@sample-pkg');
assert.strictEqual(aliasResolved, path.resolve(__dirname, '../package.json'));
// 6. enhanced-resolve.create throws or reports error when target cannot be resolved
assert.throws(
() => {
syncResolver(__dirname, './nonexistent-target-file');
},
(err) => {
return typeof err.message === 'string' && /Can't resolve/.test(err.message);
},
'syncResolver should throw error for non-existent target'
);
console.log('All enhanced-resolve.create contract assertions passed.');
Origin Seeder
anonymous