From 98895430be3d899ed69ae480d8f2300f9b734fc4 Mon Sep 17 00:00:00 2001 From: Rob Konsdorf Date: Fri, 21 Aug 2026 13:26:21 -0400 Subject: [PATCH] fix(examples): install the antelope build the library resolves The demo specs fail before any test runs. ts-node type-checks by default, so twelve diagnostics throw a TSError while the first spec loads, which leaves the examples unrunnable even where blanc++ is present and the wasm fixtures are built; the absent fixtures hid an earlier blocker. Those diagnostics report a real defect rather than a compiler artifact. A spec imports Blockchain from ../../dist, which loads @wharfkit/antelope out of the root tree, and imports Name from @wharfkit/antelope, which resolves to the examples tree. Both sides declare the same caret range, but the two lockfiles resolved it years apart, so the root tree holds 1.1.1 while the examples tree held 1.2.0. Values built by two different releases of the same class crossed the API on every call, and the private field each release declares is what the compiler refused. Declaring the version the library itself resolves gives both sides one build and clears all twelve. Nothing enforced that alignment, so CI installs the demo and type-checks it from here on. A later move in the root lockfile would otherwise split the two builds apart again with every check still green, and the diagnostics would come back only for whoever ran the demo. The first spec now fails on its absent wasm fixture, which is the real blocker outside a blanc++ toolchain and the one this repository cannot remove. --- .github/workflows/ci.yml | 8 ++++++++ examples/package.json | 4 +++- examples/yarn.lock | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c59e2ab..59c3944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,14 @@ jobs: - name: Browser bundle run: node scripts/browser-bundle.test.js + # The demo specs import the library from ../../dist and Antelope from + # their own tree. A root dependency bump can therefore split the two + # builds apart, and no other step here would notice. + - name: Examples types + run: | + yarn --cwd examples install --frozen-lockfile + yarn --cwd examples run typecheck + # The examples compile contracts with blanc++, which is not available here, # so CI runs the VM suite only. - name: Test diff --git a/examples/package.json b/examples/package.json index ba1cbd0..6a7870f 100644 --- a/examples/package.json +++ b/examples/package.json @@ -15,12 +15,14 @@ "test:timer": "mocha ./timer/timer.spec.ts -r ts-node/register", "test:fixtures": "mocha ./fixtures/fixtures.spec.ts -r ts-node/register", "test:rsa": "mocha ./rsa/rsa.spec.ts -r ts-node/register", - "test": "run-p test:*" + "test": "run-p test:*", + "typecheck": "tsc --noEmit" }, "author": "Jeeyong Um ", "license": "MIT", "devDependencies": { "@atomichub/vert": "file:..", + "@wharfkit/antelope": "1.1.1", "chai": "^4.5.0", "crypto": "^1.0.1", "mocha": "^10.8.2", diff --git a/examples/yarn.lock b/examples/yarn.lock index 84dd9b8..623eddd 100644 --- a/examples/yarn.lock +++ b/examples/yarn.lock @@ -117,6 +117,18 @@ resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== +"@wharfkit/antelope@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.1.1.tgz#f54c4ed7ddd758f4a8aa643a81dc3e4575058d45" + integrity sha512-zOetZJG0T4/WRCIC8Ui2DGv+RxrSkdXOq/q8sUqUcuKei+aJo4/9Xk37VULPt2qe0NpTm93ajYV9cYdD9m5Fgg== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + elliptic "^6.5.4" + hash.js "^1.0.0" + pako "^2.1.0" + tslib "^2.0.3" + "@wharfkit/antelope@^1.1.1": version "1.2.0" resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.2.0.tgz#8949a9ebe4396c0f22f2d69148f0ea8d32ed80dc"