diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14ee64c4..1b63b96f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -268,11 +268,14 @@ jobs: - name: Build run: npm run build --workspace=hindsight-control-plane + - name: Verify standalone build + run: test -f hindsight-control-plane/standalone/server.js || (echo 'standalone/server.js missing - build failed' && exit 1) + - name: Publish to npm working-directory: ./hindsight-control-plane run: | set +e - OUTPUT=$(npm publish --access public 2>&1) + OUTPUT=$(npm publish --access public --ignore-scripts 2>&1) EXIT_CODE=$? echo "$OUTPUT" if [ $EXIT_CODE -ne 0 ]; then diff --git a/hindsight-control-plane/package.json b/hindsight-control-plane/package.json index c6385c96..3fd290e2 100644 --- a/hindsight-control-plane/package.json +++ b/hindsight-control-plane/package.json @@ -13,7 +13,7 @@ "scripts": { "dev": "next dev --turbopack -p $(node -e \"const net=require('net');const s=net.createServer();s.listen(0,()=>{console.log(s.address().port);s.close()})\")", "build": "next build && npm run build:standalone", - "build:standalone": "rm -rf standalone && STANDALONE_ROOT=$(find .next/standalone -path '*/node_modules' -prune -o -name 'server.js' -print | head -1 | xargs dirname) && cp -r \"$STANDALONE_ROOT\" standalone && cp -r .next/standalone/node_modules standalone/node_modules && mkdir -p standalone/.next && cp -r .next/static standalone/.next/static && mkdir -p standalone/public && cp -r public/* standalone/public/ 2>/dev/null || true", + "build:standalone": "rm -rf standalone && SERVER_JS=$(find .next/standalone -path '*/node_modules' -prune -o -name 'server.js' -print | head -1) && test -n \"$SERVER_JS\" || (echo 'Error: server.js not found in .next/standalone - standalone build failed' && exit 1) && STANDALONE_ROOT=$(dirname \"$SERVER_JS\") && cp -r \"$STANDALONE_ROOT\" standalone && cp -r .next/standalone/node_modules standalone/node_modules && mkdir -p standalone/.next && cp -r .next/static standalone/.next/static && mkdir -p standalone/public && (cp -r public/* standalone/public/ 2>/dev/null || true)", "start": "next start", "lint": "next lint", "prepublishOnly": "npm run build"