Skip to content

Commit f0bc673

Browse files
committed
fix: patch Meshery UI build for Next.js 16 webpack/Turbopack compatibility
Signed-off-by: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com>
1 parent 5498b15 commit f0bc673

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/test-meshery-integration.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,26 @@ jobs:
6262
working-directory: meshery/ui
6363
run: npm install ../../sistent/${{ env.SISTENT_PACKAGE }}
6464

65-
- name: Patch Meshery UI tsconfig for TypeScript 6.x compatibility
65+
- name: Patch Meshery UI for Next.js 16.x compatibility
6666
working-directory: meshery/ui
6767
run: |
68+
# Add ignoreDeprecations for TypeScript 6.x baseUrl deprecation
6869
if [ -f tsconfig.json ] && grep -q '"baseUrl"' tsconfig.json && ! grep -q '"ignoreDeprecations"' tsconfig.json; then
6970
sed -i 's/"compilerOptions"\s*:\s*{/"compilerOptions": {\n "ignoreDeprecations": "6.0",/' tsconfig.json
7071
echo "Patched tsconfig.json to add ignoreDeprecations: 6.0"
7172
fi
73+
# Patch package.json build script to use --webpack for Next.js 16 compatibility
74+
if [ -f package.json ] && grep -q '"build"' package.json && ! grep -q -- '--webpack' package.json; then
75+
node -e "
76+
const fs = require('fs');
77+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
78+
if (pkg.scripts && pkg.scripts.build) {
79+
pkg.scripts.build = pkg.scripts.build.replace('next build', 'next build --webpack');
80+
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2));
81+
console.log('Patched build script to use webpack mode');
82+
}
83+
"
84+
fi
7285
7386
- name: Build Meshery UI
7487
working-directory: meshery/ui

0 commit comments

Comments
 (0)