From a8b7d16b97973e8dfc822e14a727cc63468f1d43 Mon Sep 17 00:00:00 2001 From: Kurdistan Tech Ministry Date: Sat, 14 Feb 2026 04:33:32 +0300 Subject: [PATCH] Patch api-augment exports map instead of filesystem shim Node.js checks package.json exports before filesystem, so the mkdir+echo shim didn't work. Now patches the exports map with node -e to add ./substrate pointing to pezkuwi augmentation. --- docker/Dockerfile.node | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile.node b/docker/Dockerfile.node index bc116f1..a2df3d1 100644 --- a/docker/Dockerfile.node +++ b/docker/Dockerfile.node @@ -28,9 +28,17 @@ RUN npm init -y && \ @polkadot/wasm-crypto-init@npm:@pezkuwi/wasm-crypto-init@^7.5.17 # @subql/node requires '@polkadot/api-augment/substrate' but @pezkuwi uses -# chain-specific paths (./pezkuwi, ./bizinikiwi). Create a substrate shim -# that re-exports the pezkuwi augmentation. -RUN mkdir -p /app/node_modules/@polkadot/api-augment/substrate && \ - echo "require('../cjs/pezkuwi/index.js');" > /app/node_modules/@polkadot/api-augment/substrate/index.js +# chain-specific paths (./pezkuwi, ./bizinikiwi). Patch the exports map in +# package.json to add ./substrate pointing to pezkuwi augmentation. +RUN node -e " \ + const fs = require('fs'); \ + const p = '/app/node_modules/@polkadot/api-augment/package.json'; \ + const pkg = JSON.parse(fs.readFileSync(p, 'utf8')); \ + pkg.exports['./substrate'] = { \ + require: './cjs/pezkuwi/index.js', \ + default: './pezkuwi/index.js' \ + }; \ + fs.writeFileSync(p, JSON.stringify(pkg, null, 2)); \ +" ENTRYPOINT ["/app/node_modules/.bin/subql-node"]