CodeSampleX

Beispiel

luxon 3.7.2: Prevent Luxon ESM imports from breaking after a patch release

Verifiziertes Beispiel für npm luxon 3.7.2: Prevent Luxon ESM imports from breaking after a patch release. Der Vertrag lief auf node 22 · linux alpine/x64 …

sha256:6c12ec9c508cd79b6da35f22471840c1ca3aebeecdcc564bbcdd7f28bc67edbc

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
3
Signaturschlüssel, die es gebaut haben
3
Deklarierte Umgebung node linux x64 node node npm

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-16
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18
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-09-08

Fall

HOW
Ziel
Prevent Luxon ESM imports from breaking after a patch release
Pakete
Symbole
  • luxon.DateTime
Umgebung
node
Erstellt
2026-08-16T18:35:41Z

Contract

  1. Importing `luxon` through a named ESM import from `node_modules` returns a usable `DateTime` export.
  2. `DateTime.fromISO("2025-07-09T00:00:00.000Z").toISO()` returns exactly `2025-07-09T00:00:00.000Z`.

Dateien

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

Quellartefakt herunterladen (tar.gz)

Quelltext

NOTES.md
search_known_solution did not return a matching luxon sample; compatible hits were only for tomli (sha256:988e141ecb3ebbb05e25053dbe7fb6837e24e1d5e3c9bc92ccb0e5f92d8629b1), zeitwerk (sha256:9be8f03e18da8a40234c0072cc13a93ec3afcdf7b74fe38906c30c2e17c369d6), and anyhow (sha256:175897b84668b354a5c39ba16574961f62a504460d7259ed94746eae6b9bf866).

3.7.1 points `exports.import` at `./src/luxon.js`, so ESM consumers can fail with a module parsing error before any Luxon API runs, while 3.7.2 points to `./build/es6/luxon.mjs` and makes `import { DateTime } from \"luxon\"` usable.
csx.json
{"case":{"believed":"A correct `luxon` package with an ESM entry point allows `import { DateTime } from \"luxon\"` to execute normally from ES module code.","caseId":"case:sha256:e9a653fb1c64091cb63117002e7b0601ee22982cce29cd303767e988be8630af","contract":["Importing `luxon` through a named ESM import from `node_modules` returns a usable `DateTime` export.","`DateTime.fromISO(\"2025-07-09T00:00:00.000Z\").toISO()` returns exactly `2025-07-09T00:00:00.000Z`."],"goal":"Prevent Luxon ESM imports from breaking after a patch release","kind":"HOW","packages":["pkg:npm/luxon@3.7.2"],"schemaVersion":1,"symbols":["luxon.DateTime"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","ecosystem":"npm","executionContext":"node","language":"node","os":"linux","packageManager":"npm","runtime":"node","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/luxon@3.7.2"],"schemaVersion":1,"symbols":["luxon.DateTime"],"verifierAdapter":"node-typescript@1"}
package-lock.json
{
  "name": "luxon-esm-packaging-sample",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "luxon-esm-packaging-sample",
      "license": "MIT",
      "dependencies": {
        "luxon": "3.7.2"
      }
    },
    "node_modules/luxon": {
      "version": "3.7.2",
      "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz",
      "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==",
      "license": "MIT",
      "engines": {
        "node": ">=12"
      }
    }
  }
}
package.json
{
  "name": "luxon-esm-packaging-sample",
  "private": true,
  "type": "module",
  "license": "MIT",
  "scripts": {
    "contract": "node test/contract.mjs"
  },
  "dependencies": {
    "luxon": "3.7.2"
  }
}
test/contract.mjs
import assert from "node:assert/strict";
import { DateTime } from "luxon";

const dt = DateTime.fromISO("2025-07-09T00:00:00.000Z");

assert.equal(typeof DateTime, "function");
assert.equal(dt.isValid, true);
assert.equal(dt.toUTC().toISO(), "2025-07-09T00:00:00.000Z");

Ursprungs-Seeder

csx-seed