From 78257cf15108bb56e32eef858ebb2931d991d6c2 Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 13 Sep 2026 02:44:12 +0200 Subject: [PATCH] Compile the toolkit after installing it, because npm does not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It declares the hook npm is supposed to run after a git install, and this npm does not run it — so the package arrives as sources with every entry point pointing at a compiled directory that is not there. --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index dcccc01..a883368 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,6 +28,16 @@ COPY package.json package-lock.json ./ # builds itself on install, which is what lets it be named by a git URL rather than fetched from a # package registry this mesh does not yet run. RUN npm install --no-audit --no-fund +# **And then compile the toolkit, because npm did not.** It declares a `prepare` script, which is +# the hook npm is supposed to run after installing a package from git — and this npm does not run +# it, so the package arrives as sources with every one of its entry points pointing at a compiled +# directory that is not there. The compile is therefore done here, explicitly: install the toolkit's +# own build dependencies inside it, build it, then drop them again so they do not travel into the +# image. Doing it by hand rather than relying on the hook is also the honest arrangement — a build +# that silently depended on a hook firing would break the day it stopped, in the same invisible way. +RUN npm --prefix node_modules/@novox/mesh-sdk install --no-audit --no-fund \ + && npm --prefix node_modules/@novox/mesh-sdk run build \ + && npm --prefix node_modules/@novox/mesh-sdk prune --omit=dev COPY tsconfig.json ./ COPY src ./src RUN npm run build