샘플
browserslist 4.28.7: clearCaches
검증된 샘플 — npm browserslist 4.28.7: clearCaches. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: When .browserslistrc is modified on disk during a…
sha256:1f2efe57b9eabb8ba2c5b441fb464d65e5a5cf42d10472c6b20f2a03e8267ba7
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node linux 24 · ubuntu · glibc 2.39 x64 node node npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-17 |
케이스
HOW- 목표
- verify browserslist.clearCaches in pkg:npm/browserslist@4.28.7
- 심벌
-
- browserslist.clearCaches
- 환경
- node
- 생성일
- 2026-09-17T00:19:21Z
컨트랙트
- When .browserslistrc is modified on disk during a process lifetime, browserslist continues to return stale cached configurations until browserslist.clearCaches() is explicitly invoked.
- assert modifying .browserslistrc on disk without clearing caches produces results from stale cached configuration
- assert browserslist.clearCaches() evicts memoized config files and forces browserslist to re-read updated target definitions
파일
- NOTES.md
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
# Target Configuration Caching in browserslist
## search_known_solution Result
`search_known_solution` returned existing sample `sha256:5230d1d8374292e6b338e3af9d42b2f705868895b5c720d33aec72599fd6f335` for `@babel/preset-env` with `browserslist@4.28.8`. This sample verifies `browserslist.clearCaches` directly in `pkg:npm/browserslist@4.28.7`.
## What a Model or Developer Would Have Written
A developer assumes that modifying `.browserslistrc` on disk will cause `browserslist` queries to immediately reflect updated target configurations during the lifetime of a long-running Node process.
## How the Wrong Version Fails
`browserslist` memoizes configuration lookups and parsed config files in memory (`configPathCache`, `parseConfigCache`). Modifying `.browserslistrc` without invoking `browserslist.clearCaches()` silently continues returning results resolved against the stale cached configuration.
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 browserslist.clearCaches in pkg:npm/browserslist@4.28.7
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/browserslist@4.28.7
Demonstrate these symbols/APIs:
- browserslist.clearCaches
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":{"believed":"Modifying .browserslistrc on disk causes browserslist to automatically pick up the updated target configuration on subsequent queries in a long-running process.","caseId":"case:sha256:cd37cd04ab858b9120acd52e2b90b9ae28d6eb3c42db51aac8e16e978416a026","contract":["When .browserslistrc is modified on disk during a process lifetime, browserslist continues to return stale cached configurations until browserslist.clearCaches() is explicitly invoked.","assert modifying .browserslistrc on disk without clearing caches produces results from stale cached configuration","assert browserslist.clearCaches() evicts memoized config files and forces browserslist to re-read updated target definitions"],"goal":"verify browserslist.clearCaches in pkg:npm/browserslist@4.28.7","kind":"HOW","packages":["pkg:npm/browserslist@4.28.7"],"schemaVersion":1,"symbols":["browserslist.clearCaches"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"node","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","runtime":"node","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/browserslist@4.28.7"],"schemaVersion":1,"subject":"pkg:npm/browserslist@4.28.7","symbols":["browserslist.clearCaches"],"verifierAdapter":"node-typescript@1"}
{
"name": "npm-browserslist-clearcaches",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "npm-browserslist-clearcaches",
"version": "1.0.0",
"dependencies": {
"browserslist": "4.28.7"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.24",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.24.tgz",
"integrity": "sha512-hYrgxie335U08WqICoGqKRzV1HFXv6zdxwJE4ekCb80CM9a0SVVsN4QPwT67RraRo+9h8IATk6uxHJw7QSkdOg==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/browserslist": {
"version": "4.28.7",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.7.tgz",
"integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"baseline-browser-mapping": "^2.10.44",
"caniuse-lite": "^1.0.30001806",
"electron-to-chromium": "^1.5.393",
"node-releases": "^2.0.51",
"update-browserslist-db": "^1.2.3"
},
"bin": {
"browserslist": "cli.js"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
}
},
"node_modules/caniuse-lite": {
"version": "1.0.30001810",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz",
"integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "CC-BY-4.0"
},
"node_modules/electron-to-chromium": {
"version": "1.5.430",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.430.tgz",
"integrity": "sha512-e1QEj72Y4zd8RlNZVmoTg+iCOSVwpk05IOiiQwdrkwCSVlZfPthevErhE+nckGd2YbsXfp1SkisznhGVIXP2NQ==",
"license": "ISC"
},
"node_modules/escalade": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
"license": "MIT",
"engines": {
"node": ">=6"
}
},
"node_modules/node-releases": {
"version": "2.0.55",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz",
"integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/picocolors": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
"license": "ISC"
},
"node_modules/update-browserslist-db": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz",
"integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"escalade": "^3.2.0",
"picocolors": "^1.1.1"
},
"bin": {
"update-browserslist-db": "cli.js"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
}
}
}
}
{
"name": "npm-browserslist-clearcaches",
"version": "1.0.0",
"type": "module",
"dependencies": {
"browserslist": "4.28.7"
}
}
{
"schemaVersion": 1,
"goal": "verify browserslist.clearCaches in pkg:npm/browserslist@4.28.7",
"kind": "HOW",
"packages": [
"pkg:npm/browserslist@4.28.7"
],
"symbols": [
"browserslist.clearCaches"
]
}
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import browserslist from 'browserslist';
const fixtureDir = path.join('test', 'fixtures');
const rcPath = path.join(fixtureDir, '.browserslistrc');
try {
fs.mkdirSync(fixtureDir, { recursive: true });
// 1. Initial configuration targeting legacy browser
fs.writeFileSync(rcPath, 'ie 11\n', 'utf8');
const initialResults = browserslist(null, { path: fixtureDir });
assert.deepEqual(initialResults, ['ie 11'], 'Initial query should load configuration from .browserslistrc');
// 2. Modify configuration on disk to a modern browser
fs.writeFileSync(rcPath, 'firefox 120\n', 'utf8');
// browserslist memoizes configuration files; without clearCaches, stale configuration is returned
const staleResults = browserslist(null, { path: fixtureDir });
assert.deepEqual(staleResults, ['ie 11'], 'Subsequent queries should return memoized configuration before cache invalidation');
// 3. Clear in-memory caches
browserslist.clearCaches();
// After cache eviction, browserslist reads updated configuration from disk
const freshResults = browserslist(null, { path: fixtureDir });
assert.deepEqual(freshResults, ['firefox 120'], 'Query after clearCaches should reflect updated on-disk configuration');
} finally {
if (fs.existsSync(rcPath)) {
fs.unlinkSync(rcPath);
}
if (fs.existsSync(fixtureDir)) {
fs.rmdirSync(fixtureDir);
}
browserslist.clearCaches();
}
console.log('Contract passed: verified browserslist.clearCaches evicts memoized config caches.');
오리진 시더
익명