CodeSampleX

Ejemplo

electron-to-chromium 1.5.481: fullVersions

Muestra verificada para npm electron-to-chromium 1.5.481: fullVersions. El contrato se ejecutó en node 22 · linux debian/x64 · docker y pasó.

sha256:2f65b788e06bb260e1e536fb863d634544c638230d98f39f781f450e0105efd9

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
1
Claves de firma que lo compilaron
1
Entorno declarado node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

Entornos de las ejecuciones de verificación

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

Caso

HOW
Objetivo
verify electron-to-chromium.fullVersions in pkg:npm/electron-to-chromium@1.5.481
Paquetes
Símbolos
  • electron-to-chromium.fullVersions
Entorno
node 22.23.2
Creado
2026-11-29T21:48:28Z

Contrato

  1. electron-to-chromium.fullVersions is a non-null plain object identical to require('electron-to-chromium/full-versions')
  2. fullVersions maps legacy Electron versions such as 0.20.0 to 39.0.2171.65 and 1.4.11 to 53.0.2785.143
  3. fullVersions maps Electron 45.3.0 to 156.0.8078.96 and 46.0.0-alpha.9 to 159.0.8153.0
  4. fullVersions returns undefined for unmapped Electron versions and major.minor keys such as 1.4
  5. every own entry in fullVersions has a non-empty string key and a four-part dotted numeric Chromium version string
  6. electronToChromium returns the same value as fullVersions for full Electron version strings

Archivos

  • PROMPT.md
  • csx.json
  • package-lock.json
  • package.json
  • spec.json
  • src/index.js
  • test/contract.js

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 electron-to-chromium.fullVersions in pkg:npm/electron-to-chromium@1.5.481
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/electron-to-chromium@1.5.481
Demonstrate these symbols/APIs:
  - electron-to-chromium.fullVersions
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.
csx.json
{"case":{"caseId":"case:sha256:70d7dd4ebbbdce099e2c34540df4be881d067896572bbf71f23cc8d85669d81e","constraints":{"executionContext":"node"},"contract":["electron-to-chromium.fullVersions is a non-null plain object identical to require('electron-to-chromium/full-versions')","fullVersions maps legacy Electron versions such as 0.20.0 to 39.0.2171.65 and 1.4.11 to 53.0.2785.143","fullVersions maps Electron 45.3.0 to 156.0.8078.96 and 46.0.0-alpha.9 to 159.0.8153.0","fullVersions returns undefined for unmapped Electron versions and major.minor keys such as 1.4","every own entry in fullVersions has a non-empty string key and a four-part dotted numeric Chromium version string","electronToChromium returns the same value as fullVersions for full Electron version strings"],"goal":"verify electron-to-chromium.fullVersions in pkg:npm/electron-to-chromium@1.5.481","kind":"HOW","packages":["pkg:npm/electron-to-chromium@1.5.481"],"schemaVersion":1,"symbols":["electron-to-chromium.fullVersions"]},"contractCommand":["node","test/contract.js"],"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/electron-to-chromium@1.5.481"],"schemaVersion":1,"subject":"pkg:npm/electron-to-chromium@1.5.481","symbols":["electron-to-chromium.fullVersions"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "sample-electron-to-chromium-full-versions",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-electron-to-chromium-full-versions",
      "version": "1.0.0",
      "license": "MIT-0",
      "dependencies": {
        "electron-to-chromium": "1.5.481"
      }
    },
    "node_modules/electron-to-chromium": {
      "version": "1.5.481",
      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.481.tgz",
      "integrity": "sha512-dNUsbAP6E2S1dHIYEuN3cQ0dViThjMtpVRheGdvv5HgHFtzLi4Cu4Mbzms85YggP3Eh2VVZTl5+XxEN8ofCbmQ==",
      "license": "ISC"
    }
  }
}
package.json
{
  "name": "sample-electron-to-chromium-full-versions",
  "version": "1.0.0",
  "private": true,
  "description": "Clean-room verification of electron-to-chromium.fullVersions",
  "license": "MIT-0",
  "scripts": {
    "test": "node test/contract.js"
  },
  "dependencies": {
    "electron-to-chromium": "1.5.481"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify electron-to-chromium.fullVersions in pkg:npm/electron-to-chromium@1.5.481",
  "kind": "HOW",
  "packages": [
    "pkg:npm/electron-to-chromium@1.5.481"
  ],
  "symbols": [
    "electron-to-chromium.fullVersions"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
src/index.js
'use strict';

const { fullVersions } = require('electron-to-chromium');

function lookupChromiumFullVersion(electronVersion) {
  if (typeof electronVersion !== 'string') {
    return undefined;
  }
  return Object.prototype.hasOwnProperty.call(fullVersions, electronVersion)
    ? fullVersions[electronVersion]
    : undefined;
}

module.exports = {
  fullVersions,
  lookupChromiumFullVersion,
};
test/contract.js
'use strict';

const assert = require('node:assert/strict');
const e2c = require('electron-to-chromium');
const directFullVersions = require('electron-to-chromium/full-versions');
const { fullVersions, lookupChromiumFullVersion } = require('../src/index');

// 1. Export identity and shape
assert.equal(typeof e2c.fullVersions, 'object');
assert.notEqual(e2c.fullVersions, null);
assert.equal(Array.isArray(e2c.fullVersions), false);
assert.strictEqual(e2c.fullVersions, directFullVersions);
assert.strictEqual(fullVersions, e2c.fullVersions);

const entries = Object.entries(e2c.fullVersions);
assert.ok(entries.length > 1000, `expected >1000 full version entries, got ${entries.length}`);

// 2. Legacy Electron full version mappings
assert.equal(e2c.fullVersions['0.20.0'], '39.0.2171.65');
assert.equal(e2c.fullVersions['1.4.11'], '53.0.2785.143');
assert.equal(lookupChromiumFullVersion('1.4.11'), '53.0.2785.143');

// 3. Recent Electron 45/46 mappings in electron-to-chromium@1.5.481
assert.equal(e2c.fullVersions['45.3.0'], '156.0.8078.96');
assert.equal(e2c.fullVersions['46.0.0-alpha.9'], '159.0.8153.0');
assert.equal(lookupChromiumFullVersion('46.0.0-alpha.9'), '159.0.8153.0');

// 4. Unmapped full versions and major.minor keys return undefined
assert.equal(e2c.fullVersions['9999.0.0'], undefined);
assert.equal(e2c.fullVersions['1.4'], undefined);
assert.equal(lookupChromiumFullVersion('9999.0.0'), undefined);
assert.equal(lookupChromiumFullVersion('toString'), undefined);

// 5. All entries map non-empty string keys to dotted Chromium full version strings
const chromiumFullVersionPattern = /^\d+\.\d+\.\d+\.\d+$/;
for (const [electronVer, chromiumVer] of entries) {
  assert.equal(typeof electronVer, 'string');
  assert.ok(electronVer.length > 0);
  assert.equal(typeof chromiumVer, 'string');
  assert.match(
    chromiumVer,
    chromiumFullVersionPattern,
    `unexpected Chromium full version for Electron ${electronVer}: ${chromiumVer}`
  );
}

// 6. Consistency with electronToChromium for full version queries
for (const sampleKey of ['0.20.0', '1.4.11', '45.3.0', '46.0.0-alpha.9']) {
  assert.equal(e2c.electronToChromium(sampleKey), e2c.fullVersions[sampleKey]);
}

console.log(`PASS: verified ${entries.length} electron-to-chromium.fullVersions entries`);

Seeder de origen

anónimo