From d8d2746f16d1bdcb71e1409a90871b65117d026c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 1 Aug 2026 10:44:20 -0700 Subject: Actually ship the NWC feature, and guard against the drift that hid it build.js swaps src/features/index.js for a generated module listing only the features in its own ALL_FEATURES registry, so registering nwc in index.js alone was not enough: its i18n strings shipped (they live elsewhere) but its code never entered the bundle, and the settings card silently never rendered. - add nwc to build.js ALL_FEATURES, after ark since it drives ark's headless pay/balance seam - tools/feature-registry-check.js asserts the two lists agree on membership AND on construction order, since hook precedence depends on the order Co-Authored-By: Claude Fable 5 --- build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'build.js') diff --git a/build.js b/build.js index 438f8bc..db07ed2 100644 --- a/build.js +++ b/build.js @@ -144,11 +144,13 @@ export async function buildSpWorker({ minify = true } = {}) { } // Optional-feature selection: HAL_FEATURES is a comma list of enabled -// features (gifts,swaps,ark,zaps,sp). Unset means all; "none"/"" means a minimal +// features (gifts,swaps,ark,zaps,sp,nwc). Unset means all; "none"/"" means a minimal // on-chain-only wallet. A build plugin swaps src/features/index.js for a // generated module that only imports the enabled features, so a disabled // feature's code (and its network endpoints) never enters the bundle. -const ALL_FEATURES = { gifts: 'giftsFeature', swaps: 'swapsFeature', ark: 'arkFeature', zaps: 'zapsFeature', sp: 'spFeature', sync: 'syncFeature' }; +// NB order matters and must match src/features/index.js — nwc sits after ark +// because it drives ark's headless pay/balance seam. +const ALL_FEATURES = { gifts: 'giftsFeature', swaps: 'swapsFeature', ark: 'arkFeature', zaps: 'zapsFeature', sp: 'spFeature', nwc: 'nwcFeature', sync: 'syncFeature' }; export function enabledFeatures(spec = process.env.HAL_FEATURES) { if (spec == null) return Object.keys(ALL_FEATURES); -- cgit v1.2.3