Skip to content

Commit 0758827

Browse files
authored
fix: npx hindsight-control-plane fails (#408)
1 parent ea8163c commit 0758827

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,14 @@ jobs:
268268
- name: Build
269269
run: npm run build --workspace=hindsight-control-plane
270270

271+
- name: Verify standalone build
272+
run: test -f hindsight-control-plane/standalone/server.js || (echo 'standalone/server.js missing - build failed' && exit 1)
273+
271274
- name: Publish to npm
272275
working-directory: ./hindsight-control-plane
273276
run: |
274277
set +e
275-
OUTPUT=$(npm publish --access public 2>&1)
278+
OUTPUT=$(npm publish --access public --ignore-scripts 2>&1)
276279
EXIT_CODE=$?
277280
echo "$OUTPUT"
278281
if [ $EXIT_CODE -ne 0 ]; then

hindsight-control-plane/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"scripts": {
1414
"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()})\")",
1515
"build": "next build && npm run build:standalone",
16-
"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",
16+
"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)",
1717
"start": "next start",
1818
"lint": "next lint",
1919
"prepublishOnly": "npm run build"

0 commit comments

Comments
 (0)