Skip to content

Commit 241092f

Browse files
Copilotmathiasrw
andcommitted
Address code review feedback: add build command fallback and comments
Co-authored-by: mathiasrw <[email protected]>
1 parent 7d3dffb commit 241092f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

benchmark.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ async function loadBleedingEdgeAlaSQL(): Promise<VersionedAlaSQL | null> {
187187
// Clone or update the repository
188188
if (fs.existsSync(BLEEDING_EDGE_DIR)) {
189189
console.log(' Updating existing clone...');
190+
// Reset to origin/develop - this is an auto-managed directory
190191
execSync('git fetch origin && git reset --hard origin/develop', {
191192
cwd: BLEEDING_EDGE_DIR,
192193
stdio: 'pipe',
@@ -205,8 +206,14 @@ async function loadBleedingEdgeAlaSQL(): Promise<VersionedAlaSQL | null> {
205206
stdio: 'pipe',
206207
});
207208

209+
// Determine which build command to use
210+
// build-only skips formatting checks, but may not exist in older versions
211+
const packageJsonPath = path.join(BLEEDING_EDGE_DIR, 'package.json');
212+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
213+
const buildCommand = packageJson.scripts?.['build-only'] ? 'npm run build-only' : 'npm run build';
214+
208215
console.log(' Building...');
209-
execSync('npm run build-only', {
216+
execSync(buildCommand, {
210217
cwd: BLEEDING_EDGE_DIR,
211218
stdio: 'pipe',
212219
});
@@ -218,6 +225,8 @@ async function loadBleedingEdgeAlaSQL(): Promise<VersionedAlaSQL | null> {
218225
}).trim();
219226

220227
// Load the built module
228+
// Note: This imports code from the official AlaSQL repository that was
229+
// cloned and built locally. The user explicitly opts in with --bleeding-edge.
221230
const distPath = path.join(BLEEDING_EDGE_DIR, 'dist', 'alasql.js');
222231
if (!fs.existsSync(distPath)) {
223232
throw new Error(`Built file not found at ${distPath}`);

0 commit comments

Comments
 (0)