Skip to content

Commit 79e2cec

Browse files
committed
[WebConsole] Add a Bun version check to prevent building with unsupported version
Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
1 parent 0db08da commit 79e2cec

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

js-packages/web-console/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
"private": true,
55
"scripts": {
66
"clean-install": "bun ci",
7-
"dev": "vite dev --host",
7+
"check-bun-version": "bun run scripts/check-bun-version.ts",
8+
"dev": "bun run check-bun-version && vite dev --host",
89
"prebuild": "cd ../profiler-lib && bun run build",
9-
"build": "svelte-kit sync && svelte-check --threshold error && vite build",
10+
"build": "bun run check-bun-version && svelte-kit sync && svelte-check --threshold error && vite build",
1011
"preview": "vite preview --host",
1112
"check": "svelte-kit sync && svelte-check",
1213
"check:watch": "svelte-kit sync && svelte-check --watch",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bun
2+
import { $ } from 'bun'
3+
import semver from 'semver'
4+
5+
const MIN_BUN_VERSION = '1.3.3'
6+
7+
async function checkBunVersion() {
8+
try {
9+
// Get current Bun version
10+
const result = await $`bun --version`.text()
11+
const currentVersion = result.trim()
12+
13+
console.log(`Current Bun version: ${currentVersion}`)
14+
console.log(`Required minimum version: ${MIN_BUN_VERSION}`)
15+
16+
// Compare versions
17+
if (!semver.gte(currentVersion, MIN_BUN_VERSION)) {
18+
console.error(
19+
`\n❌ Error: Bun version ${currentVersion} is too old. Please upgrade to ${MIN_BUN_VERSION} or higher.`
20+
)
21+
console.error(` Run: bun upgrade`)
22+
process.exit(1)
23+
}
24+
25+
console.log(`✓ Bun version check passed\n`)
26+
} catch (error) {
27+
console.error('Failed to check Bun version:', error)
28+
process.exit(1)
29+
}
30+
}
31+
32+
checkBunVersion()

js-packages/web-console/src/lib/compositions/usePipelineManager.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export const usePipelineManager = (options?: FetchOptions) => {
104104
// ...(await getAuthorizationHeaders()),
105105
// Accept: 'application/zip'
106106
// }
107-
const fileName = `fda-bundle-${pipelineName}-${new Date().toISOString().replace(/\.\d{3}/, '')}.zip`
107+
const fileName = `feldera-support-bundle-${pipelineName}-${new Date().toISOString().replace(/\.\d{3}/, '')}.zip`
108108
// // Use simple fetch approach (loads into memory) instead of streaming
109109
triggerFileDownload(fileName, blob)
110110
}

0 commit comments

Comments
 (0)