Skip to content

Commit 48d1509

Browse files
authored
fix(examples): install the antelope build the library resolves (#10)
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.
1 parent a1f6ffe commit 48d1509

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎.github/workflows/ci.yml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ jobs:
4444
- name: Browser bundle
4545
run: node scripts/browser-bundle.test.js
4646

47+
# The demo specs import the library from ../../dist and Antelope from
48+
# their own tree. A root dependency bump can therefore split the two
49+
# builds apart, and no other step here would notice.
50+
- name: Examples types
51+
run: |
52+
yarn --cwd examples install --frozen-lockfile
53+
yarn --cwd examples run typecheck
54+
4755
# The examples compile contracts with blanc++, which is not available here,
4856
# so CI runs the VM suite only.
4957
- name: Test

‎examples/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
"test:timer": "mocha ./timer/timer.spec.ts -r ts-node/register",
1616
"test:fixtures": "mocha ./fixtures/fixtures.spec.ts -r ts-node/register",
1717
"test:rsa": "mocha ./rsa/rsa.spec.ts -r ts-node/register",
18-
"test": "run-p test:*"
18+
"test": "run-p test:*",
19+
"typecheck": "tsc --noEmit"
1920
},
2021
"author": "Jeeyong Um <conr2d@gmail.com>",
2122
"license": "MIT",
2223
"devDependencies": {
2324
"@atomichub/vert": "file:..",
25+
"@wharfkit/antelope": "1.1.1",
2426
"chai": "^4.5.0",
2527
"crypto": "^1.0.1",
2628
"mocha": "^10.8.2",

‎examples/yarn.lock‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@
117117
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
118118
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
119119

120+
"@wharfkit/antelope@1.1.1":
121+
version "1.1.1"
122+
resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.1.1.tgz#f54c4ed7ddd758f4a8aa643a81dc3e4575058d45"
123+
integrity sha512-zOetZJG0T4/WRCIC8Ui2DGv+RxrSkdXOq/q8sUqUcuKei+aJo4/9Xk37VULPt2qe0NpTm93ajYV9cYdD9m5Fgg==
124+
dependencies:
125+
bn.js "^4.11.9"
126+
brorand "^1.1.0"
127+
elliptic "^6.5.4"
128+
hash.js "^1.0.0"
129+
pako "^2.1.0"
130+
tslib "^2.0.3"
131+
120132
"@wharfkit/antelope@^1.1.1":
121133
version "1.2.0"
122134
resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.2.0.tgz#8949a9ebe4396c0f22f2d69148f0ea8d32ed80dc"

0 commit comments

Comments
 (0)