Skip to content

Commit 5498b15

Browse files
committed
fix: use sed to patch Meshery UI tsconfig (handles JSONC format)
Signed-off-by: Yi Nuo <218099172+yi-nuo426@users.noreply.github.com>
1 parent 8e3149e commit 5498b15

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,9 @@ jobs:
6565
- name: Patch Meshery UI tsconfig for TypeScript 6.x compatibility
6666
working-directory: meshery/ui
6767
run: |
68-
if [ -f tsconfig.json ] && grep -q '"baseUrl"' tsconfig.json; then
69-
node -e "
70-
const fs = require('fs');
71-
const tsconfig = JSON.parse(fs.readFileSync('tsconfig.json', 'utf8'));
72-
if (tsconfig.compilerOptions && !tsconfig.compilerOptions.ignoreDeprecations) {
73-
tsconfig.compilerOptions.ignoreDeprecations = '6.0';
74-
fs.writeFileSync('tsconfig.json', JSON.stringify(tsconfig, null, 2));
75-
console.log('Patched tsconfig.json to add ignoreDeprecations: 6.0');
76-
}
77-
"
68+
if [ -f tsconfig.json ] && grep -q '"baseUrl"' tsconfig.json && ! grep -q '"ignoreDeprecations"' tsconfig.json; then
69+
sed -i 's/"compilerOptions"\s*:\s*{/"compilerOptions": {\n "ignoreDeprecations": "6.0",/' tsconfig.json
70+
echo "Patched tsconfig.json to add ignoreDeprecations: 6.0"
7871
fi
7972
8073
- name: Build Meshery UI

0 commit comments

Comments
 (0)