Skip to content

Commit 72ba897

Browse files
committed
parser workflow fix
1 parent bc68c53 commit 72ba897

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ jobs:
159159
- name: Install Dependencies 🧶
160160
run: pnpm install
161161

162+
- name: Install Parser Dependencies 📦
163+
run: pnpm install
164+
working-directory: parser
165+
162166
- name: Download v15 WASM Artifacts 📥
163167
uses: actions/download-artifact@v4
164168
with:
@@ -226,6 +230,10 @@ jobs:
226230
- name: Install Dependencies 🧶
227231
run: pnpm install
228232

233+
- name: Install Parser Dependencies 📦
234+
run: pnpm install
235+
working-directory: parser
236+
229237
- name: Download v15 WASM Artifacts 📥
230238
uses: actions/download-artifact@v4
231239
with:

parser/scripts/build.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,22 @@ const { execSync } = require('child_process');
44

55
// Run TypeScript compilation
66
console.log('Compiling TypeScript...');
7-
const tscPath = path.join(__dirname, '../node_modules/.bin/tsc');
8-
execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
9-
execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
7+
8+
// Try to find tsc in different locations
9+
let tscPath = path.join(__dirname, '../node_modules/.bin/tsc');
10+
if (!fs.existsSync(tscPath)) {
11+
// Try workspace root
12+
tscPath = path.join(__dirname, '../../../node_modules/.bin/tsc');
13+
}
14+
if (!fs.existsSync(tscPath)) {
15+
// Try using npx as fallback
16+
console.log('Using npx to run TypeScript compiler...');
17+
execSync('npx tsc', { stdio: 'inherit', cwd: path.join(__dirname, '..') });
18+
execSync('npx tsc -p tsconfig.esm.json', { stdio: 'inherit', cwd: path.join(__dirname, '..') });
19+
} else {
20+
execSync(`${tscPath}`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
21+
execSync(`${tscPath} -p tsconfig.esm.json`, { stdio: 'inherit', cwd: path.join(__dirname, '..') });
22+
}
1023

1124
// Rename files to have correct extensions
1225
const wasmDir = path.join(__dirname, '../wasm');

0 commit comments

Comments
 (0)