@@ -226,26 +226,28 @@ transitively, a matching `@midnight-ntwrk/compact-runtime`). To let one toolkit
226226different ` compactc ` versions, each supported version has its own sibling workspace that pins that line:
227227
228228```
229- compact-0.29/ → @midnight-ntwrk/compact-js* 2.4.3
230- compact-0.30/ → @midnight-ntwrk/compact-js* 2.5.0
231- compact-0.31/ → @midnight-ntwrk/compact-js* 2.5.1
229+ compact-0.29.0 / → @midnight-ntwrk/compact-js* 2.4.3
230+ compact-0.30.0 / → @midnight-ntwrk/compact-js* 2.5.0
231+ compact-0.31.0 / → @midnight-ntwrk/compact-js* 2.5.1
232232```
233233
234- The root package depends on every variant (` @midnight-ntwrk/node-toolkit-compact-<major>.<minor> ` ). At runtime,
235- ` src/compactc-resolver.ts ` reads ` COMPACTC_VERSION ` , picks the matching variant, and installs a module-resolution
236- hook that redirects ** every** ` @midnight-ntwrk/compact-js* ` / ` @midnight-ntwrk/compact-runtime ` import — including
237- the transitive ones reached while a ` contract.config.ts ` is loaded — to that variant's pinned copy. ` src/bin.ts `
238- (the CLI) and ` test/setup-compactc-resolver.ts ` (the tests) both use this single resolver, so tests exercise the
239- same dispatch as production.
234+ The root package depends on every variant (` @midnight-ntwrk/node-toolkit-compact-<major>.<minor>.<patch> ` ). At
235+ runtime, ` src/compactc-resolver.ts ` reads ` COMPACTC_VERSION ` , picks the matching variant, and installs a
236+ module-resolution hook that redirects ** every** ` @midnight-ntwrk/compact-js* ` / ` @midnight-ntwrk/compact-runtime `
237+ import — including the transitive ones reached while a ` contract.config.ts ` is loaded — to that variant's pinned
238+ copy. ` src/bin.ts ` (the CLI) and ` test/setup-compactc-resolver.ts ` (the tests) both use this single resolver, so
239+ tests exercise the same dispatch as production.
240240
241- ` COMPACTC_VERSION ` accepts either ` <major>.<minor> ` or the full ` <major>.<minor>.<patch> ` form; dispatch is on
242- ` <major>.<minor> ` only, since ` compact-js ` is patch-stable within a minor line.
241+ Dispatch is on the full ` <major>.<minor>.<patch> ` version, since a ` compactc ` patch can ship a contract format
242+ that expects a different ` @midnight-ntwrk/compact-js ` patch. ` COMPACTC_VERSION ` may also carry a trailing
243+ build/tree-hash suffix (e.g. ` 0.31.0-6587676a9bb2 ` , the form stored in the root ` COMPACTC_VERSION ` file); only the
244+ leading ` <major>.<minor>.<patch> ` is matched.
243245
244246### Adding support for a new ` compactc ` version
245247
246- 1 . ** Create the variant workspace.** Copy an existing one, e.g. ` cp -r compact-0.31 compact-<major>.<minor> ` .
248+ 1 . ** Create the variant workspace.** Copy an existing one, e.g. ` cp -r compact-0.31.0 compact-<major>.<minor>.<patch > ` .
247249 In its ` package.json ` :
248- - set ` "name" ` to ` @midnight-ntwrk/node-toolkit-compact-<major>.<minor> ` ;
250+ - set ` "name" ` to ` @midnight-ntwrk/node-toolkit-compact-<major>.<minor>.<patch> ` ;
249251 - pin ` @midnight-ntwrk/compact-js ` , ` @midnight-ntwrk/compact-js-command ` , and ` @midnight-ntwrk/compact-js-node `
250252 to the line that targets the new ` compactc ` ;
251253 - align the ` @effect/* ` versions (` @effect/cli ` , ` @effect/platform-node ` ) with what that ` compact-js ` line
@@ -259,8 +261,8 @@ same dispatch as production.
259261 default baked into the resolver.
260262
2612633 . ** Depend on the variant** from the root ` package.json ` ` dependencies `
262- (` "@midnight-ntwrk/node-toolkit-compact-<major>.<minor>": "^0.1.0" ` ). The ` compact-* ` workspaces glob picks it
263- up automatically.
264+ (` "@midnight-ntwrk/node-toolkit-compact-<major>.<minor>.<patch> ": "^0.1.0" ` ). The ` compact-* ` workspaces glob
265+ picks it up automatically.
264266
2652674 . ** Add the concrete patch version** to ` DEFAULT_VERSIONS ` in ` scripts/test-all-compactc.sh ` .
266268
@@ -272,7 +274,7 @@ same dispatch as production.
272274 ```
273275
274276To drop an old version, reverse these steps: remove it from ` SUPPORTED_COMPACTC_VERSIONS ` , the root dependency,
275- and the test script, then delete the ` compact-<major>.<minor>/ ` workspace.
277+ and the test script, then delete the ` compact-<major>.<minor>.<patch> / ` workspace.
276278
277279> [ !IMPORTANT]
278280> The CLI option surface can change between ` compactc ` /` compact-js-command ` versions. For example, the global
0 commit comments