CodeSampleX

Ejemplo

@babel/compat-data 7.29.7

Muestra verificada para npm @babel/compat-data 7.29.7. El contrato se ejecutó en node 22 · linux alpine/x64 · docker y pasó: @babel/compat-data/plugins…

sha256:297414c98bbe3e3dfba764fdeac942374d076013bd5ffa54743c321ae65be5bf

Esta red ofrece una sola cosa: una muestra que compila. La ejecutó en un sandbox y guardó el recibo firmado. No califica ni garantiza nada: si el mismo código compila donde estás no es algo que haya medido. Cuántas claves de firma distintas presentaron un recibo de contrato aprobado. Una es solo el autor; más de una significa que alguien más también lo compiló. Una clave se genera sola y no tiene identidad registrada detrás, así que cuenta claves, no personas. MIT-0

Evidencia de ejecución

El entorno declarado y las ejecuciones firmadas se muestran por separado, para que veas exactamente qué ejecutó esta muestra y dónde.

Base de evidencia
Contrato firmado aprobado
Recibos de verificación
2
Claves de firma que lo compilaron
1
Entorno declarado node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm

Entornos de las ejecuciones de verificación

Entorno Contrato Etapas Ejecución
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
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-07

Caso

HOW
Objetivo
verify pkg:npm/%40babel/compat-data@7.29.7
Paquetes
Entorno
node 22.23.2
Creado
2026-08-23T06:20:28Z

Contrato

  1. @babel/compat-data/plugins exports compatibility mapping object containing target environment minimum versions for Babel transform plugins
  2. @babel/compat-data/plugins contains valid target environment versions for standard ECMAScript transforms such as classes, arrow functions, and optional chaining
  3. @babel/compat-data/native-modules exports compatibility requirements for native ES module support
  4. @babel/compat-data/overlapping-plugins maps transform plugins to their corresponding bugfix plugin subsets
  5. @babel/compat-data/plugin-bugfixes exports environment support versions for specific browser engine bug fixes
  6. @babel/compat-data/corejs3-shipped-proposals and corejs2-built-ins export core-js compatibility maps
  7. compat-data exports are accessible and identical via both CommonJS require and ES module import

Archivos

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

Descargar el artefacto de código fuente (tar.gz)

Código fuente

PROMPT.md
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/%40babel/compat-data@7.29.7
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40babel/compat-data@7.29.7

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.
csx.json
{"case":{"caseId":"case:sha256:7dd37b6a1daceea8bb997daa3c6c33e62724f93ee951825ebdcdb982b6e5a6e1","constraints":{"executionContext":"node"},"contract":["@babel/compat-data/plugins exports compatibility mapping object containing target environment minimum versions for Babel transform plugins","@babel/compat-data/plugins contains valid target environment versions for standard ECMAScript transforms such as classes, arrow functions, and optional chaining","@babel/compat-data/native-modules exports compatibility requirements for native ES module support","@babel/compat-data/overlapping-plugins maps transform plugins to their corresponding bugfix plugin subsets","@babel/compat-data/plugin-bugfixes exports environment support versions for specific browser engine bug fixes","@babel/compat-data/corejs3-shipped-proposals and corejs2-built-ins export core-js compatibility maps","compat-data exports are accessible and identical via both CommonJS require and ES module import"],"goal":"verify pkg:npm/%40babel/compat-data@7.29.7","kind":"HOW","packages":["pkg:npm/%40babel/compat-data@7.29.7"],"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","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40babel/compat-data@7.29.7"],"schemaVersion":1,"subject":"pkg:npm/%40babel/compat-data@7.29.7","verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-babel-compat-data",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-babel-compat-data",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "@babel/compat-data": "7.29.7"
      }
    },
    "node_modules/@babel/compat-data": {
      "version": "7.29.7",
      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
      "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
      "license": "MIT",
      "engines": {
        "node": ">=6.9.0"
      }
    }
  }
}
package.json
{
  "name": "sample-babel-compat-data",
  "version": "1.0.0",
  "type": "module",
  "license": "MIT-0",
  "dependencies": {
    "@babel/compat-data": "7.29.7"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40babel/compat-data@7.29.7",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40babel/compat-data@7.29.7"
  ]
}
test/contract.mjs
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
import plugins from '@babel/compat-data/plugins';
import nativeModules from '@babel/compat-data/native-modules';
import overlappingPlugins from '@babel/compat-data/overlapping-plugins';
import pluginBugfixes from '@babel/compat-data/plugin-bugfixes';
import corejs2BuiltIns from '@babel/compat-data/corejs2-built-ins';
import corejs3ShippedProposals from '@babel/compat-data/corejs3-shipped-proposals';

const require = createRequire(import.meta.url);

// 1. @babel/compat-data/plugins exports compatibility mapping object containing target environment minimum versions for Babel transform plugins
assert.equal(typeof plugins, 'object', 'plugins export must be an object');
assert.ok(plugins !== null, 'plugins export must not be null');
assert.ok(Object.keys(plugins).length > 0, 'plugins export must contain transform mappings');

// 2. @babel/compat-data/plugins contains valid target environment versions for standard ECMAScript transforms such as classes, arrow functions, and optional chaining
assert.ok('transform-classes' in plugins, 'plugins must contain transform-classes');
assert.ok('transform-arrow-functions' in plugins, 'plugins must contain transform-arrow-functions');
assert.ok('transform-optional-chaining' in plugins, 'plugins must contain transform-optional-chaining');

const classCompat = plugins['transform-classes'];
assert.equal(typeof classCompat, 'object', 'transform-classes compat data must be an object');
assert.equal(typeof classCompat.chrome, 'string', 'transform-classes chrome version must be a string');
assert.equal(typeof classCompat.node, 'string', 'transform-classes node version must be a string');
assert.equal(typeof classCompat.firefox, 'string', 'transform-classes firefox version must be a string');
assert.equal(typeof classCompat.safari, 'string', 'transform-classes safari version must be a string');

const optionalChainingCompat = plugins['transform-optional-chaining'];
assert.equal(typeof optionalChainingCompat, 'object', 'transform-optional-chaining compat data must be an object');
assert.equal(typeof optionalChainingCompat.chrome, 'string', 'transform-optional-chaining chrome version must be a string');
assert.equal(typeof optionalChainingCompat.node, 'string', 'transform-optional-chaining node version must be a string');

// 3. @babel/compat-data/native-modules exports compatibility requirements for native ES module support
assert.equal(typeof nativeModules, 'object', 'nativeModules export must be an object');
assert.ok('es6.module' in nativeModules, 'nativeModules must include es6.module definition');
const es6Module = nativeModules['es6.module'];
assert.equal(typeof es6Module.chrome, 'string', 'es6.module chrome target must be defined');
assert.equal(typeof es6Module.node, 'string', 'es6.module node target must be defined');
assert.equal(typeof es6Module.safari, 'string', 'es6.module safari target must be defined');

// 4. @babel/compat-data/overlapping-plugins maps transform plugins to their corresponding bugfix plugin subsets
assert.equal(typeof overlappingPlugins, 'object', 'overlappingPlugins export must be an object');
assert.ok('transform-async-to-generator' in overlappingPlugins, 'overlappingPlugins must contain transform-async-to-generator');
assert.ok(Array.isArray(overlappingPlugins['transform-async-to-generator']), 'overlapping mapping must be an array of bugfix plugins');
assert.ok(
  overlappingPlugins['transform-async-to-generator'].includes('bugfix/transform-async-arrows-in-class'),
  'transform-async-to-generator must map to bugfix/transform-async-arrows-in-class'
);

// 5. @babel/compat-data/plugin-bugfixes exports environment support versions for specific browser engine bug fixes
assert.equal(typeof pluginBugfixes, 'object', 'pluginBugfixes export must be an object');
assert.ok('bugfix/transform-async-arrows-in-class' in pluginBugfixes, 'pluginBugfixes must include async arrows bugfix');
const asyncArrowsFix = pluginBugfixes['bugfix/transform-async-arrows-in-class'];
assert.equal(typeof asyncArrowsFix.chrome, 'string', 'bugfix chrome version must be defined');
assert.equal(typeof asyncArrowsFix.node, 'string', 'bugfix node version must be defined');
assert.equal(typeof asyncArrowsFix.safari, 'string', 'bugfix safari version must be defined');

// 6. @babel/compat-data/corejs3-shipped-proposals and corejs2-built-ins export core-js compatibility maps
assert.equal(typeof corejs3ShippedProposals, 'object', 'corejs3-shipped-proposals export must be an object');
assert.equal(typeof corejs2BuiltIns, 'object', 'corejs2-built-ins export must be an object');

// 7. compat-data exports are accessible and identical via both CommonJS require and ES module import
const cjsPlugins = require('@babel/compat-data/plugins');
const cjsNativeModules = require('@babel/compat-data/native-modules');
const cjsOverlappingPlugins = require('@babel/compat-data/overlapping-plugins');
const cjsPluginBugfixes = require('@babel/compat-data/plugin-bugfixes');
const cjsCorejs2BuiltIns = require('@babel/compat-data/corejs2-built-ins');
const cjsCorejs3ShippedProposals = require('@babel/compat-data/corejs3-shipped-proposals');

assert.deepEqual(plugins, cjsPlugins, 'ESM and CJS plugins data must match identically');
assert.deepEqual(nativeModules, cjsNativeModules, 'ESM and CJS nativeModules data must match identically');
assert.deepEqual(overlappingPlugins, cjsOverlappingPlugins, 'ESM and CJS overlappingPlugins data must match identically');
assert.deepEqual(pluginBugfixes, cjsPluginBugfixes, 'ESM and CJS pluginBugfixes data must match identically');
assert.deepEqual(corejs2BuiltIns, cjsCorejs2BuiltIns, 'ESM and CJS corejs2-built-ins data must match identically');
assert.deepEqual(corejs3ShippedProposals, cjsCorejs3ShippedProposals, 'ESM and CJS corejs3-shipped-proposals data must match identically');

console.log('Contract tests passed successfully.');

Seeder de origen

anónimo