Exemple
bare 1.31.2
Échantillon vérifié pour npm bare 1.31.2. Le contrat s'est exécuté sur node 22 · linux alpine/x64 · docker et a réussi : package manifest specifies bare…
sha256:74cae8028e2c3124831b0861bbc90d90bbe37ee09c3f053ea500e039dfbf8f0c
Ce réseau offre une seule chose : un échantillon qui compile. Il l'a exécuté dans un bac à sable et conservé le reçu signé. Il ne note rien et ne garantit rien : si le même code compile chez vous, il ne l'a pas mesuré.
Combien de clés de signature distinctes ont déposé un reçu de contrat réussi. Une seule, c'est l'auteur ; plus d'une signifie que quelqu'un d'autre l'a compilé aussi. Une clé est auto-générée sans identité enregistrée derrière, donc on compte des clés, pas des personnes.
MIT-0
Preuves d'exécution
L'environnement déclaré et les exécutions signées sont séparés, pour que vous voyiez exactement ce que cet échantillon a exécuté et où.
- Base de preuve
- Contrat signé réussi
- Reçus de vérification
- 1
- Clés de signature qui l’ont compilé
- 1
Environnement déclaré
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
Environnements des exécutions de vérification
| Environnement | Contrat | Étapes | Exécution |
|---|---|---|---|
| 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 |
Cas
HOW- Objectif
- verify pkg:npm/bare@1.31.2
- Paquets
- Environnement
- node 22.23.2
- Créé
- 2026-08-27T14:41:02Z
Contrat
- package manifest specifies bare 1.31.2 with Apache-2.0 license, bin launcher, conditional exports, and optional peer dependencies
- provides executable bin launcher forwarding execution to bare-runtime spawn
- exports Bare global across ESM and CommonJS module entrypoints
- declares complete TypeScript definitions for runtime lifecycle, process state, Addon loader, and Thread management in index.d.ts
Fichiers
- NOTES.md
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
Code source
# bare Runtime Package Verification
## Known Solution Search
`search_known_solution` returned `NO_SAFE_MATCH` for `pkg:npm/bare@1.31.2`.
## Package Overview
`bare` is a small and modular JavaScript runtime for desktop and mobile environments.
## Contract Verifications
1. **Package Manifest**: Validates package metadata, conditional exports (`index.d.ts`, `index.cjs`, `index.mjs`), `bin/bare` launcher, and optional peer dependencies.
2. **Binary Launcher**: Confirms `bin/bare` wraps and delegates invocation to `bare-runtime/spawn`.
3. **Module Entrypoints**: Verifies both ESM (`export default Bare`, `export const Addon`, `export const Thread`) and CommonJS (`module.exports = Bare`) entrypoints access the runtime global `Bare`.
4. **TypeScript Definitions**: Validates comprehensive type definitions in `index.d.ts` including `BareEvents`, `Bare` process interface, `Addon` lifecycle and resolver APIs, and `Thread` multithreading management.
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/bare@1.31.2
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/bare@1.31.2
Constraints:
- executionContext: node
Required runtime conditions:
- ecosystem: npm
- language: javascript
- moduleSystem: cjs
- packageManager: npm@10.9.8
- runtime: node@22.23.2
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:37b2dc875761b1b4d5bcdbd3ec0282b25a2574d215c349cebaa009abc17bccef","constraints":{"executionContext":"node"},"contract":["package manifest specifies bare 1.31.2 with Apache-2.0 license, bin launcher, conditional exports, and optional peer dependencies","provides executable bin launcher forwarding execution to bare-runtime spawn","exports Bare global across ESM and CommonJS module entrypoints","declares complete TypeScript definitions for runtime lifecycle, process state, Addon loader, and Thread management in index.d.ts"],"goal":"verify pkg:npm/bare@1.31.2","kind":"HOW","packages":["pkg:npm/bare@1.31.2"],"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/bare@1.31.2"],"schemaVersion":1,"subject":"pkg:npm/bare@1.31.2","verifierAdapter":"node-typescript@1"}
{
"name": "sample-bare",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-bare",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"bare": "1.31.2"
}
},
"node_modules/b4a": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.1.tgz",
"integrity": "sha512-aiqre1Nr0B/6DgE2N5vwTc+2/oQZ4Wh1t4NznYY4E00y8LCt6NqdRv81so00oo27D8MVKTpUa/MwUUtBLXCoDw==",
"license": "Apache-2.0",
"peer": true,
"peerDependencies": {
"react-native-b4a": "*"
},
"peerDependenciesMeta": {
"react-native-b4a": {
"optional": true
}
}
},
"node_modules/bare": {
"version": "1.31.2",
"resolved": "https://registry.npmjs.org/bare/-/bare-1.31.2.tgz",
"integrity": "sha512-GjgiZ7pUM/C6ZEl9pAOeEPBZq2/yruSV8rTTjG+QGUk72k9OmrqFKs0fRiketYZ7Zb6yKP15DfATcJTT+it5eA==",
"license": "Apache-2.0",
"bin": {
"bare": "bin/bare"
},
"peerDependencies": {
"bare-buffer": "*",
"bare-console": "*",
"bare-events": "*",
"bare-queue-microtask": "*",
"bare-runtime": "*",
"bare-structured-clone": "*",
"bare-timers": "*",
"bare-url": "*"
},
"peerDependenciesMeta": {
"bare-buffer": {
"optional": true
},
"bare-console": {
"optional": true
},
"bare-events": {
"optional": true
},
"bare-queue-microtask": {
"optional": true
},
"bare-structured-clone": {
"optional": true
},
"bare-timers": {
"optional": true
},
"bare-url": {
"optional": true
}
}
},
"node_modules/bare-abort": {
"version": "2.0.13",
"resolved": "https://registry.npmjs.org/bare-abort/-/bare-abort-2.0.13.tgz",
"integrity": "sha512-zdc8l88eB11Jsz5rDd6sCAgv2kUFXgdrZWoMlgU6JMkfAi1/uuGFC3IEHswKbIRQTk5H3T5CMuechsXYxiaHlQ==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/bare-buffer": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/bare-buffer/-/bare-buffer-3.7.0.tgz",
"integrity": "sha512-/xRTbBuLis7sE3Izii0A0yOm+WqH1/gh12UVqkpIAOLZ4gWluyK0THbGB+UysKI8ZBjcZ+MaEs9Auxcyiz2yLA==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"bare": ">=1.20.0"
}
},
"node_modules/bare-dns": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/bare-dns/-/bare-dns-2.2.0.tgz",
"integrity": "sha512-iEqjj122eXdbDP5gXwk/NG/XVI5xoGjQA24UlGBPafUeMIGesxUZ5rxDvjNXPBHDyTkO+H3IsV5izZ8T5IGAXA==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"bare": ">=1.7.0"
},
"peerDependencies": {
"bare-buffer": "*"
},
"peerDependenciesMeta": {
"bare-buffer": {
"optional": true
}
}
},
"node_modules/bare-env": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/bare-env/-/bare-env-3.0.1.tgz",
"integrity": "sha512-BdoLvnzaWR0YyyJreEx4zG2Od0AC/s9JSZ+EXyMZKunpn8zEgR/dGv37hdFUaY1bjDkcRKvcKkFyJIwlJ0CaYA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-os": "^3.0.1"
}
},
"node_modules/bare-events": {
"version": "2.9.2",
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.9.2.tgz",
"integrity": "sha512-AIPKioV7/Y/8KfZ3AAhjPJxLLbY49S64Ym5DakZlUg75qQiTgUq9hEJoEwa4eUezPUlXRy/i5NpsKvo9jgKmoA==",
"license": "Apache-2.0",
"peer": true,
"peerDependencies": {
"bare-abort-controller": "*"
},
"peerDependenciesMeta": {
"bare-abort-controller": {
"optional": true
}
}
},
"node_modules/bare-fs": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.8.1.tgz",
"integrity": "sha512-N1nnXdHZAOSstz0XiHikGS4HGMH4CnSwhqWdGQQMqqdvp4Jybm9sE3R1WVnpWVd4SFkc8ryPDBLViNLwiEqECg==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-events": "^2.5.4",
"bare-path": "^3.0.0",
"bare-stream": "^2.6.4",
"bare-url": "^2.2.2",
"fast-fifo": "^1.3.2"
},
"engines": {
"bare": ">=1.28.0"
},
"peerDependencies": {
"bare-buffer": "*"
},
"peerDependenciesMeta": {
"bare-buffer": {
"optional": true
}
}
},
"node_modules/bare-hrtime": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/bare-hrtime/-/bare-hrtime-2.1.1.tgz",
"integrity": "sha512-VMb3tHo05gsnbu3OXTmkDiwTjMlOsbQmKoysKqKEyR09m77TuDrYFbj3Q5GGk10dAKsUHrnXmwCaeJqzVpB5ZA==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/bare-module-resolve": {
"version": "1.12.4",
"resolved": "https://registry.npmjs.org/bare-module-resolve/-/bare-module-resolve-1.12.4.tgz",
"integrity": "sha512-xcfgg2u7HqgJiBmah71O9vvdFAgHCvkqC/WSC2O7Bbgosoc1eC/BWe/6IDJ4OsfKlkxuvC/TDWXC+oH5yeW8mA==",
"license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": {
"bare-semver": "^1.0.0"
},
"peerDependencies": {
"bare-url": "*"
},
"peerDependenciesMeta": {
"bare-url": {
"optional": true
}
}
},
"node_modules/bare-os": {
"version": "3.9.3",
"resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.9.3.tgz",
"integrity": "sha512-fF4Q7QsyKVF5Rj0qvI8BgUNjqzC2JvQlpTaPLjVJVxYVUX5Zr9un+y3w1HmA4nNKdFmRBT8z/WmrjvXzXVerKQ==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"bare": ">=1.14.0"
}
},
"node_modules/bare-path": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.1.1.tgz",
"integrity": "sha512-JprUlveX3QjApC1cTpsUOiscADftCGVWkzitbHsRqv84hzYwYHw2mbluddsq5TvI8mH/8Ov1f4BiMAdcB0oYnQ==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/bare-pipe": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/bare-pipe/-/bare-pipe-4.2.3.tgz",
"integrity": "sha512-MJYji+Vy8cNMAB2fwg1WQAm1hFIOe5ojw5V9EhEa/wEEYpKT8c36WjHBDwgkgAZfUSX6wQcEFX+Q7wN09SgRow==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-events": "^2.0.0",
"bare-stream": "^2.0.0"
},
"engines": {
"bare": ">=1.16.0"
}
},
"node_modules/bare-posix": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/bare-posix/-/bare-posix-1.0.1.tgz",
"integrity": "sha512-b4quA8dyRVvX0aFIAIiev5zFATHwIUGr42Gmt+CqiBNg/bdsNkrj4bbkeotMOMiljJS4DCME5kywJO/TFwKo1A==",
"license": "Apache-2.0",
"peer": true
},
"node_modules/bare-process": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/bare-process/-/bare-process-4.5.1.tgz",
"integrity": "sha512-CaAvy1trputD49mtwfJ6G75vydhnirLrW/F3Sznp4H556e1uZn8YMo9ELicBTrGYy7RBNUgPl9bpB/ERzRCiDw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-abort": "^2.0.13",
"bare-env": "^3.0.0",
"bare-events": "^2.3.1",
"bare-hrtime": "^2.0.0",
"bare-os": "^3.7.1",
"bare-posix": "^1.0.1",
"bare-signals": "^5.0.0",
"bare-stdio": "^1.0.1"
}
},
"node_modules/bare-runtime": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime/-/bare-runtime-1.31.0.tgz",
"integrity": "sha512-Bzx7Z3hcfJ8IqDr8Rzyw07sfANZ3ZyetNYdp+1pO/JacdCi7jGiDVUiO42eygvibAAcQo+lR2P6kgrDqjc8DJQ==",
"license": "Apache-2.0",
"peer": true,
"workspaces": [
"npm/*"
],
"dependencies": {
"bare-fs": "^4.4.4",
"bare-os": "^3.0.1",
"bare-path": "^3.0.0",
"bare-process": "^4.2.1",
"bare-subprocess": "^6.1.0"
},
"bin": {
"bare": "bin/bare"
},
"optionalDependencies": {
"bare-runtime-android-arm": "1.31.0",
"bare-runtime-android-arm64": "1.31.0",
"bare-runtime-android-ia32": "1.31.0",
"bare-runtime-android-x64": "1.31.0",
"bare-runtime-darwin-arm64": "1.31.0",
"bare-runtime-darwin-x64": "1.31.0",
"bare-runtime-ios-arm64": "1.31.0",
"bare-runtime-ios-arm64-simulator": "1.31.0",
"bare-runtime-ios-x64-simulator": "1.31.0",
"bare-runtime-linux-arm64": "1.31.0",
"bare-runtime-linux-x64": "1.31.0",
"bare-runtime-win32-arm64": "1.31.0",
"bare-runtime-win32-x64": "1.31.0"
}
},
"node_modules/bare-runtime-android-arm": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-android-arm/-/bare-runtime-android-arm-1.31.0.tgz",
"integrity": "sha512-rgnRa6eV38wtIQ/CS5Vy845Q9m9DKG4mCOpaEt7Eqee2dpQeg5uuqksqt/aktAiIaxXGYUaGkL+m9l0/tJHiyQ==",
"cpu": [
"arm"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"android"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-android-arm64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-android-arm64/-/bare-runtime-android-arm64-1.31.0.tgz",
"integrity": "sha512-L7oedAx2TsWb1BkZL2i5QtAZnEc0nDeg/myLGhgqhjd5guGEFxhn1blLP/oSS4TggkVDtlnTv/DBhW4KJYevyg==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"android"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-android-ia32": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-android-ia32/-/bare-runtime-android-ia32-1.31.0.tgz",
"integrity": "sha512-GALoMyUtbqUw+KCV0uLV7kEZbGJUkbO2JI+vB0oJw48bZ0QM0YcPA+IV+Atucz63NslS7z0l7zoD8jwzEgihTw==",
"cpu": [
"ia32"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"android"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-android-x64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-android-x64/-/bare-runtime-android-x64-1.31.0.tgz",
"integrity": "sha512-ECLmyx6jiD4P7hXuqWhrZdp5h7BiiuXB7Dtgb1H3S+UZxNqKkMp+rv71x0685ZFK81iqhe0fTjUWrWMgmWO2Tw==",
"cpu": [
"x64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"android"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-darwin-arm64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-darwin-arm64/-/bare-runtime-darwin-arm64-1.31.0.tgz",
"integrity": "sha512-WcDMErk9Z+aXykvWrntKHZd3886w8dSFlBKB7vCRq4fRhVvOOuQA3dAfZOyoyjapLDbAmDuz3z1J3oWi1ejTHg==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-darwin-x64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-darwin-x64/-/bare-runtime-darwin-x64-1.31.0.tgz",
"integrity": "sha512-IHxuWqxis7KIEgxSJN+R14Xy/ixdw+FdOUfeFQlLsNkFMWNVMvi65As3lJKcrNFFQh0OV1Bvj+M4yRsxhGIvxw==",
"cpu": [
"x64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"darwin"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-ios-arm64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-ios-arm64/-/bare-runtime-ios-arm64-1.31.0.tgz",
"integrity": "sha512-n0VVNzhg9C4W9D5B8NB4J6LB9dUTRKShY5Iqp2d/2Ss1hmhyF/rcKLX9ffXqdcVJ0I9Tj1kCRelYLNl5rVeaBg==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"ios"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-ios-arm64-simulator": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-ios-arm64-simulator/-/bare-runtime-ios-arm64-simulator-1.31.0.tgz",
"integrity": "sha512-Q5LbSRQou5Ls0Wn2SN+WsLdwZanlaUB8KPdGvuR/5m13un7iOLL5EO53ZOwaBrtJz+Cru/WVZJefv6LQqTOaZQ==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"ios"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-ios-x64-simulator": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-ios-x64-simulator/-/bare-runtime-ios-x64-simulator-1.31.0.tgz",
"integrity": "sha512-A+EIZwLpzI9V6GdPsrHe5+/v8qtglMoj042fM8XvuCRpe7frc4tPtccwkDmdUkc8LUbKt9w3hN3DF4c4M1Hl8g==",
"cpu": [
"x64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"ios"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-linux-arm64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-linux-arm64/-/bare-runtime-linux-arm64-1.31.0.tgz",
"integrity": "sha512-Kp6CxjcqRpqpUlps6I3oz609vVAzOAiw88skd82eCzLBnfqv1c/ZREF6SnEwyySDZBIMz913RGafEtprbjEbVg==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"linux"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-linux-x64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-linux-x64/-/bare-runtime-linux-x64-1.31.0.tgz",
"integrity": "sha512-nAb6155Du4DAPSoiE+sS8HHmiHRSmI6zEvcCIfQwb677SGIhm4hlKfWfV9vpGKdHrKmlcTdjmxsALihU8KQPdg==",
"cpu": [
"x64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"linux"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare"
}
},
"node_modules/bare-runtime-win32-arm64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-win32-arm64/-/bare-runtime-win32-arm64-1.31.0.tgz",
"integrity": "sha512-eT2kSBXysu8W7WZqgtEsYMT4jibkbTTy/miNUJfePCzWaae74sczP8M35vyLVAWGw7jL38lOvFYZ+FQ6ZL5e/w==",
"cpu": [
"arm64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"win32"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare.exe"
}
},
"node_modules/bare-runtime-win32-x64": {
"version": "1.31.0",
"resolved": "https://registry.npmjs.org/bare-runtime-win32-x64/-/bare-runtime-win32-x64-1.31.0.tgz",
"integrity": "sha512-9XXLtxpp6LXx7PpfCa6DNUepJHBA0rclqPqyAqkDu7ZpVSxF/fZyWw2r9H1JHVGhzNcxs7LJbLIQ4yXzdM2HHA==",
"cpu": [
"x64"
],
"license": "Apache-2.0",
"optional": true,
"os": [
"win32"
],
"peer": true,
"dependencies": {
"require-asset": "^1.0.2"
},
"bin": {
"bare": "bin/bare.exe"
}
},
"node_modules/bare-semver": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.1.0.tgz",
"integrity": "sha512-1Hw5qJ7hXdVt3uPUqjeFTuxyvBUJauvz5A1I2jk8gzjZMHp04n//6nV9MDbG9CMw78JHY2lGV0w6s//LrASm2w==",
"license": "Apache-2.0",
"optional": true,
"peer": true
},
"node_modules/bare-signals": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/bare-signals/-/bare-signals-5.0.0.tgz",
"integrity": "sha512-8Gn8bBFUh2AUCJ9wWWFjSGWIo1HIUSIQnXRJGSm/f7GCDMqsuJhRmR1dT+HtDaDBkeu2l8Koxt2JLurfJ5yHVw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-events": "^2.5.3"
},
"engines": {
"bare": ">=1.7.0"
}
},
"node_modules/bare-stdio": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/bare-stdio/-/bare-stdio-1.0.3.tgz",
"integrity": "sha512-8BRMx7RWMWCbBmKhyHgBco62J+Pgss7+EPI21L3R9+w0UpwDYWUUcbE0YTOesGyt7M6N7VtoshYbzwrP0pI52Q==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-fs": "^4.5.2",
"bare-pipe": "^4.1.5",
"bare-tty": "^5.0.3"
}
},
"node_modules/bare-stream": {
"version": "2.13.4",
"resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.4.tgz",
"integrity": "sha512-PcrQ8lVLbiJscNm1Kez+Yp4Gy4AHGcN1lzwjvf5NybWen7VvEgUfyfnXYJ2zNqWnzOfCb1Abq6lH8ti0syQszA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"b4a": "^1.8.1",
"streamx": "^2.25.0",
"teex": "^1.0.1"
},
"peerDependencies": {
"bare-abort-controller": "*",
"bare-buffer": "*",
"bare-events": "*"
},
"peerDependenciesMeta": {
"bare-abort-controller": {
"optional": true
},
"bare-buffer": {
"optional": true
},
"bare-events": {
"optional": true
}
}
},
"node_modules/bare-structured-clone": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/bare-structured-clone/-/bare-structured-clone-1.6.0.tgz",
"integrity": "sha512-AZjEERyqF7kAuudlmgrweT2KwwWM0LsGG4Gx/bWyFwJrKU7E3wNG8c09z2DIrdw93p3vDtfOX8fyHOcXfy5m+g==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-buffer": "^3.6.0",
"bare-type": "^1.1.0",
"bare-url": "^2.4.0",
"compact-encoding": "^3.0.1"
},
"engines": {
"bare": ">=1.2.0"
}
},
"node_modules/bare-subprocess": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/bare-subprocess/-/bare-subprocess-6.1.0.tgz",
"integrity": "sha512-8L6KtbmreDy4Fc1BdDqaDo9fg0nbedUmTSFQxYPV0uHIM2BBAX8+E0LyMDKgkk0I+mlKto80WYzOnIhT8VDdOg==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-env": "^3.0.0",
"bare-events": "^2.5.4",
"bare-os": "^3.0.1",
"bare-pipe": "^4.2.0",
"bare-structured-clone": "^1.5.2",
"bare-tcp": "^2.4.1",
"bare-url": "^2.2.2"
},
"engines": {
"bare": ">=1.7.0"
},
"peerDependencies": {
"bare-buffer": "*"
},
"peerDependenciesMeta": {
"bare-buffer": {
"optional": true
}
}
},
"node_modules/bare-tcp": {
"version": "2.5.4",
"resolved": "https://registry.npmjs.org/bare-tcp/-/bare-tcp-2.5.4.tgz",
"integrity": "sha512-o3weBBYeN3tgvTJyglSMpZOfHkfz1nG53M913fvhAKF9ubQ4XsljdX6Uq7H0g/CkyGnR4Ii3OdXJHz7PxgDLGA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-dns": "^2.0.4",
"bare-events": "^2.5.4",
"bare-stream": "^2.6.4"
},
"engines": {
"bare": ">=1.16.0"
},
"peerDependencies": {
"bare-pipe": "*"
},
"peerDependenciesMeta": {
"bare-pipe": {
"optional": true
}
}
},
"node_modules/bare-tty": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/bare-tty/-/bare-tty-5.1.2.tgz",
"integrity": "sha512-wDHPU/yVQtrDCUrKVdIVOLmfIw7dFPETz30UayuFlROvgz8Juv2SmISSMhqxYQVO+fVnG/1ZoLcbGh/35eAjDA==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-events": "^2.2.0",
"bare-signals": "^5.0.0",
"bare-stream": "^2.0.0"
},
"engines": {
"bare": ">=1.16.0"
}
},
"node_modules/bare-type": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/bare-type/-/bare-type-1.1.0.tgz",
"integrity": "sha512-LdtnnEEYldOc87Dr4GpsKnStStZk3zfgoEMXy8yvEZkXrcCv9RtYDrUYWFsBQHtaB0s1EUWmcvS6XmEZYIj3Bw==",
"license": "Apache-2.0",
"peer": true,
"engines": {
"bare": ">=1.2.0"
}
},
"node_modules/bare-url": {
"version": "2.5.2",
"resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.5.2.tgz",
"integrity": "sha512-L13PCJzKG8RGvx8V1/DdMi12ERhC3tprr7/8a94BxpmnRsFqxh5XZNdhtMxu5HPkRshYOOWRGY8lDP7ZhpG9Cg==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-path": "^3.0.0"
}
},
"node_modules/compact-encoding": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/compact-encoding/-/compact-encoding-3.3.2.tgz",
"integrity": "sha512-bgZ84oVSzjQmVHXBYWON+wQUkdVflrr8fM5+0X6UwQHZyzolsGIkdsjNK3vLLn22dhdASGFz5mS6Lf7rfrPdlg==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"b4a": "^1.3.0"
}
},
"node_modules/events-universal": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
"integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"bare-events": "^2.7.0"
}
},
"node_modules/fast-fifo": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
"integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
"license": "MIT",
"peer": true
},
"node_modules/require-asset": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/require-asset/-/require-asset-1.2.2.tgz",
"integrity": "sha512-uc8nWKhqAxVD9Z4rST2b4yaemrC9Xb5vA1wlCz5AiCYnBYdwGRWNqFjneA5zRILzlo1MNrB63ry9+pc8wNR26w==",
"license": "Apache-2.0",
"optional": true,
"peer": true,
"dependencies": {
"bare-module-resolve": "^1.6.2"
},
"engines": {
"bare": ">=1.10.0",
"node": ">=18"
}
},
"node_modules/streamx": {
"version": "2.28.1",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.28.1.tgz",
"integrity": "sha512-zEzXb0s5Cds7tqMH6rhZ05lcJydCWiQPEwiNngVqzsxCc962vLY4Uw+mW7od8kDH258k2Uz/JrOkdIAAhSh9VA==",
"license": "MIT",
"peer": true,
"dependencies": {
"events-universal": "^1.0.0",
"fast-fifo": "^1.3.2",
"text-decoder": "^1.1.0"
}
},
"node_modules/teex": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
"integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==",
"license": "MIT",
"peer": true,
"dependencies": {
"streamx": "^2.12.5"
}
},
"node_modules/text-decoder": {
"version": "1.2.7",
"resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
"integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==",
"license": "Apache-2.0",
"peer": true,
"dependencies": {
"b4a": "^1.6.4"
}
}
}
}
{
"name": "sample-bare",
"version": "1.0.0",
"private": true,
"type": "module",
"license": "MIT-0",
"dependencies": {
"bare": "1.31.2"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/bare@1.31.2",
"kind": "HOW",
"packages": [
"pkg:npm/bare@1.31.2"
],
"constraints": {
"executionContext": "node"
},
"runtimeConditions": {
"ecosystem": "npm",
"language": "javascript",
"moduleSystem": "cjs",
"packageManager": "npm@10.9.8",
"runtime": "node@22.23.2"
}
}
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. Package manifest verification
const bareMainPath = require.resolve('bare');
const pkgDir = path.dirname(bareMainPath);
const pkgPath = path.join(pkgDir, 'package.json');
assert.ok(fs.existsSync(pkgPath), 'package.json must exist');
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
assert.equal(pkg.name, 'bare', 'Package name must be bare');
assert.equal(pkg.version, '1.31.2', 'Package version must be 1.31.2');
assert.equal(pkg.description, 'Small and modular JavaScript runtime for desktop and mobile');
assert.equal(pkg.license, 'Apache-2.0', 'Package license must be Apache-2.0');
// Verify exports map
assert.ok(pkg.exports, 'Package exports must be defined');
assert.ok(pkg.exports['.'], 'Root export must be defined');
assert.equal(pkg.exports['.'].types, './index.d.ts', 'Types export must point to ./index.d.ts');
assert.equal(pkg.exports['.'].require, './index.cjs', 'Require export must point to ./index.cjs');
assert.equal(pkg.exports['.'].import, './index.mjs', 'Import export must point to ./index.mjs');
// Verify bin definition
assert.ok(pkg.bin, 'Package bin must be defined');
assert.equal(pkg.bin.bare, 'bin/bare', 'Bin bare must point to bin/bare');
// Verify files list
assert.deepEqual(
pkg.files,
['index.cjs', 'index.mjs', 'index.d.ts', 'bin'],
'Package files array must contain index.cjs, index.mjs, index.d.ts, bin'
);
// Verify peer dependencies
const optionalPeerDeps = [
'bare-buffer',
'bare-console',
'bare-events',
'bare-queue-microtask',
'bare-structured-clone',
'bare-timers',
'bare-url'
];
assert.ok(pkg.peerDependencies['bare-runtime'], 'bare-runtime peer dependency must be declared');
for (const dep of optionalPeerDeps) {
assert.ok(pkg.peerDependencies[dep], `Peer dependency ${dep} must be declared`);
assert.equal(pkg.peerDependenciesMeta[dep]?.optional, true, `Peer dependency ${dep} must be optional`);
}
// 2. Binary launcher verification (bin/bare)
const binBarePath = path.join(pkgDir, 'bin', 'bare');
assert.ok(fs.existsSync(binBarePath), 'bin/bare launcher must exist');
const binBareContent = fs.readFileSync(binBarePath, 'utf8');
assert.ok(binBareContent.startsWith('#!/usr/bin/env node'), 'bin/bare must contain node hashbang');
assert.ok(binBareContent.includes("require('bare-runtime/spawn')"), 'bin/bare must delegate to bare-runtime/spawn');
assert.ok(binBareContent.includes("stdio: 'inherit'"), 'bin/bare must configure stdio: inherit');
assert.ok(binBareContent.includes('suppressSignals: true'), 'bin/bare must configure suppressSignals');
assert.ok(binBareContent.includes('forwardExitCode: true'), 'bin/bare must configure forwardExitCode');
// 3. CJS and ESM entrypoints verification
const indexCjsPath = path.join(pkgDir, 'index.cjs');
assert.ok(fs.existsSync(indexCjsPath), 'index.cjs must exist');
const indexCjsContent = fs.readFileSync(indexCjsPath, 'utf8');
assert.ok(indexCjsContent.includes('module.exports = Bare'), 'index.cjs must export Bare global');
const indexMjsPath = path.join(pkgDir, 'index.mjs');
assert.ok(fs.existsSync(indexMjsPath), 'index.mjs must exist');
const indexMjsContent = fs.readFileSync(indexMjsPath, 'utf8');
assert.ok(indexMjsContent.includes('export default Bare'), 'index.mjs must export Bare as default export');
assert.ok(indexMjsContent.includes('export const Addon = Bare.Addon'), 'index.mjs must export Addon named export');
assert.ok(indexMjsContent.includes('export const Thread = Bare.Thread'), 'index.mjs must export Thread named export');
// Configure global Bare instance for runtime export validation
class MockAddon {
constructor(url) { this.url = url; }
}
class MockThread {
constructor(options) { this.options = options; }
}
globalThis.Bare = {
platform: 'linux',
arch: 'x64',
version: '1.31.2',
pid: process.pid,
argv: ['bare'],
exitCode: 0,
Addon: MockAddon,
Thread: MockThread
};
// Test ESM import behavior
const esmModule = await import('bare');
assert.equal(typeof esmModule, 'object', 'ESM import of bare must resolve to a module namespace');
assert.equal(esmModule.default, globalThis.Bare, 'Default ESM export must resolve to globalThis.Bare');
assert.equal(esmModule.Addon, MockAddon, 'Named Addon export must resolve to Bare.Addon');
assert.equal(esmModule.Thread, MockThread, 'Named Thread export must resolve to Bare.Thread');
// Test CJS require behavior
const cjsBare = require('bare');
assert.equal(cjsBare, globalThis.Bare, 'CJS require(bare) must resolve to global.Bare');
assert.equal(cjsBare.version, '1.31.2', 'Bare version must match 1.31.2');
assert.equal(cjsBare.platform, 'linux', 'Bare platform must match linux');
assert.equal(cjsBare.Addon, MockAddon, 'Bare.Addon must match MockAddon');
assert.equal(cjsBare.Thread, MockThread, 'Bare.Thread must match MockThread');
// 4. TypeScript definition verification (index.d.ts)
const indexDtsPath = path.join(pkgDir, 'index.d.ts');
assert.ok(fs.existsSync(indexDtsPath), 'index.d.ts must exist');
const indexDts = fs.readFileSync(indexDtsPath, 'utf8');
// Subsystem imports and global extensions
assert.ok(indexDts.includes("import EventEmitter, { EventMap } from 'bare-events'"), 'index.d.ts must import bare-events');
assert.ok(indexDts.includes("import Buffer, { BufferEncoding } from 'bare-buffer'"), 'index.d.ts must import bare-buffer');
assert.ok(indexDts.includes("import URL from 'bare-url'"), 'index.d.ts must import bare-url');
assert.ok(indexDts.includes("import 'bare-queue-microtask/global'"), 'index.d.ts must import bare-queue-microtask globals');
assert.ok(indexDts.includes("import 'bare-buffer/global'"), 'index.d.ts must import bare-buffer globals');
assert.ok(indexDts.includes("import 'bare-timers/global'"), 'index.d.ts must import bare-timers globals');
assert.ok(indexDts.includes("import 'bare-structured-clone/global'"), 'index.d.ts must import bare-structured-clone globals');
assert.ok(indexDts.includes("import 'bare-url/global'"), 'index.d.ts must import bare-url globals');
assert.ok(indexDts.includes("import 'bare-console/global'"), 'index.d.ts must import bare-console globals');
// BareEvents interface
assert.ok(indexDts.includes('interface BareEvents extends EventMap'), 'index.d.ts must declare BareEvents extending EventMap');
assert.ok(indexDts.includes('uncaughtException: [err: unknown]'), 'BareEvents must declare uncaughtException');
assert.ok(indexDts.includes('unhandledRejection: [reason: unknown, promise: Promise<unknown>]'), 'BareEvents must declare unhandledRejection');
assert.ok(indexDts.includes('beforeExit: [code: number]'), 'BareEvents must declare beforeExit');
assert.ok(indexDts.includes('exit: [code: number]'), 'BareEvents must declare exit');
assert.ok(indexDts.includes('suspend: [linger: number]'), 'BareEvents must declare suspend');
assert.ok(indexDts.includes('wakeup: [deadline: number]'), 'BareEvents must declare wakeup');
assert.ok(indexDts.includes('idle: []'), 'BareEvents must declare idle');
assert.ok(indexDts.includes('resume: []'), 'BareEvents must declare resume');
// Bare interface and methods
assert.ok(indexDts.includes('interface Bare extends EventEmitter<BareEvents>'), 'Bare interface must extend EventEmitter<BareEvents>');
assert.ok(indexDts.includes("readonly platform: 'android' | 'darwin' | 'ios' | 'linux' | 'win32'"), 'Bare must declare platform union');
assert.ok(indexDts.includes("readonly arch: 'arm' | 'arm64' | 'ia32' | 'x64' | 'mips' | 'mipsel'"), 'Bare must declare arch union');
assert.ok(indexDts.includes('readonly argv: string[]'), 'Bare must declare argv');
assert.ok(indexDts.includes('readonly pid: number'), 'Bare must declare pid');
assert.ok(indexDts.includes('exitCode: number'), 'Bare must declare exitCode');
assert.ok(indexDts.includes('readonly version: string'), 'Bare must declare version');
assert.ok(indexDts.includes('readonly versions: { readonly [library: string]: string }'), 'Bare must declare versions dictionary');
assert.ok(indexDts.includes('exit(code?: number): never'), 'Bare must declare exit() returning never');
assert.ok(indexDts.includes('suspend(linger?: number): void'), 'Bare must declare suspend()');
assert.ok(indexDts.includes('wakeup(deadline?: number): void'), 'Bare must declare wakeup()');
assert.ok(indexDts.includes('idle(): void'), 'Bare must declare idle()');
assert.ok(indexDts.includes('resume(): void'), 'Bare must declare resume()');
// Addon class & namespace
assert.ok(indexDts.includes('interface Addon'), 'index.d.ts must declare Addon interface');
assert.ok(indexDts.includes('declare class Addon'), 'index.d.ts must declare Addon class');
assert.ok(indexDts.includes('declare namespace Addon'), 'index.d.ts must declare Addon namespace');
assert.ok(indexDts.includes('readonly url: URL'), 'Addon must declare url property');
assert.ok(indexDts.includes('readonly exports: unknown'), 'Addon must declare exports property');
assert.ok(indexDts.includes('export const host: string'), 'Addon namespace must declare host');
assert.ok(indexDts.includes('export function load(url: URL): Addon'), 'Addon namespace must declare load');
assert.ok(indexDts.includes('export function resolve(specifier: string, parentURL?: URL): URL'), 'Addon namespace must declare resolve');
// Thread class & namespace
assert.ok(indexDts.includes('interface ThreadOptions'), 'index.d.ts must declare ThreadOptions');
assert.ok(indexDts.includes('interface Thread'), 'index.d.ts must declare Thread interface');
assert.ok(indexDts.includes('declare class Thread'), 'index.d.ts must declare Thread class');
assert.ok(indexDts.includes('declare namespace Thread'), 'index.d.ts must declare Thread namespace');
assert.ok(indexDts.includes('readonly joined: boolean'), 'Thread must declare joined property');
assert.ok(indexDts.includes('join(): void'), 'Thread must declare join()');
assert.ok(indexDts.includes('terminate(): void'), 'Thread must declare terminate()');
assert.ok(indexDts.includes('export const isMainThread: boolean'), 'Thread namespace must declare isMainThread');
assert.ok(indexDts.includes('export const self: ThreadProxy | null'), 'Thread namespace must declare self');
// Global export
assert.ok(indexDts.includes('declare const Bare: Bare'), 'index.d.ts must declare Bare constant');
assert.ok(indexDts.includes('export = Bare'), 'index.d.ts must export = Bare');
console.log('Contract tests passed successfully.');
Seeder d'origine
anonyme