Skip to content

Commit 9d4b8f7

Browse files
committed
Update Sentry Wizard installation docs to v5.1.0 for all platforms
1 parent 2ba7c4f commit 9d4b8f7

File tree

4 files changed

+114
-12
lines changed

4 files changed

+114
-12
lines changed

SENTRY_WIZARD_DYNAMIC_VERSION.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Dynamic Sentry Wizard Version Implementation
2+
3+
## Current State
4+
The Flutter and Android documentation now includes comprehensive installation options for sentry-wizard, but the version is currently hardcoded to v5.1.0 (updated from the previous v4.0.1).
5+
6+
## Problem Solved
7+
- ✅ Added comprehensive platform support (Windows, macOS Intel/ARM, Linux x64/ARM)
8+
- ✅ Updated to latest version (v5.1.0 from v4.0.1)
9+
- ✅ Windows users no longer forced to use `brew`
10+
- ✅ Flutter developers can avoid JavaScript tooling (`npx`) if preferred
11+
- ✅ Consistent with Android documentation approach
12+
13+
## Future Enhancement: Dynamic Version Fetching
14+
15+
### Approach 1: Build-time Version Fetching (Recommended)
16+
Create a build script that fetches the latest version during the build process:
17+
18+
```javascript
19+
// scripts/fetch-sentry-wizard-version.js
20+
const fs = require('fs');
21+
const path = require('path');
22+
23+
async function fetchLatestVersion() {
24+
try {
25+
const response = await fetch('https://api.github.com/repos/getsentry/sentry-wizard/releases/latest');
26+
const data = await response.json();
27+
const version = data.tag_name.startsWith('v') ? data.tag_name : `v${data.tag_name}`;
28+
29+
// Save to a JSON file that can be imported
30+
const versionData = { sentryWizardVersion: version };
31+
fs.writeFileSync(
32+
path.join(__dirname, '../src/data/versions.json'),
33+
JSON.stringify(versionData, null, 2)
34+
);
35+
36+
console.log(`Fetched sentry-wizard version: ${version}`);
37+
} catch (error) {
38+
console.warn('Failed to fetch latest version, keeping existing version');
39+
}
40+
}
41+
42+
fetchLatestVersion();
43+
```
44+
45+
### Approach 2: Runtime Component
46+
Create a React component that fetches the version dynamically:
47+
48+
```typescript
49+
// src/components/SentryWizardInstall.tsx
50+
import { useEffect, useState } from 'react';
51+
52+
export function SentryWizardInstall({ platform }: { platform: string }) {
53+
const [version, setVersion] = useState('v5.1.0'); // fallback
54+
55+
useEffect(() => {
56+
fetch('/api/sentry-wizard-version')
57+
.then(res => res.json())
58+
.then(data => setVersion(data.version))
59+
.catch(() => console.warn('Failed to fetch version'));
60+
}, []);
61+
62+
// Render installation commands with dynamic version
63+
return (
64+
// ... code blocks with ${version} interpolation
65+
);
66+
}
67+
```
68+
69+
### Approach 3: MDX Variable Replacement
70+
Use MDX processing to replace version placeholders:
71+
72+
```javascript
73+
// In MDX processing pipeline
74+
const sentryWizardVersion = await fetchLatestVersion();
75+
const processedContent = content.replace(
76+
/\{\{SENTRY_WIZARD_VERSION\}\}/g,
77+
sentryWizardVersion
78+
);
79+
```
80+
81+
### Integration Points
82+
1. **Build process**: Add version fetching to the build pipeline
83+
2. **CI/CD**: Cache GitHub API responses to avoid rate limits
84+
3. **Fallback**: Always have a recent known version as fallback
85+
4. **Consistency**: Apply to all platforms (Flutter, Android, React Native, etc.)
86+
87+
### Implementation Priority
88+
1. **Phase 1**: ✅ Update hardcoded versions to latest (COMPLETED)
89+
2. **Phase 2**: Implement build-time version fetching
90+
3. **Phase 3**: Add runtime version checking for validation
91+
4. **Phase 4**: Automate version updates across all platforms
92+
93+
## Files Updated
94+
- `docs/platforms/dart/guides/flutter/index.mdx` - Updated to v5.1.0
95+
- `docs/platforms/android/index.mdx` - Updated to v5.1.0
96+
97+
## Benefits Achieved
98+
- **Better Windows support**: No more forcing Windows users to use `brew`
99+
- **Ecosystem alignment**: Flutter developers can avoid JavaScript tooling
100+
- **Platform consistency**: All major OS/architecture combinations supported
101+
- **Up-to-date tooling**: Using latest version instead of outdated v4.0.1
102+
- **Maintainability**: When dynamic fetching is implemented, versions will stay current automatically

docs/platforms/android/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,35 +59,35 @@ npx @sentry/wizard@latest -i android
5959
```
6060

6161
```bash {tabTitle:macOS (Intel/x64)}
62-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-darwin-x64"
62+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-x64"
6363
curl -L $downloadUrl -o sentry-wizard
6464
chmod +x sentry-wizard
6565
./sentry-wizard -i android
6666
```
6767

6868
```bash {tabTitle:macOS (Apple Silicon/arm64)}
69-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-darwin-arm64"
69+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-arm64"
7070
curl -L $downloadUrl -o sentry-wizard
7171
chmod +x sentry-wizard
7272
./sentry-wizard -i android
7373
```
7474

7575
```bash {tabTitle:Linux (x64)}
76-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-linux-x64"
76+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-x64"
7777
curl -L $downloadUrl -o sentry-wizard
7878
chmod +x sentry-wizard
7979
./sentry-wizard -i android
8080
```
8181

8282
```bash {tabTitle:Linux (arm64)}
83-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-linux-arm64"
83+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-arm64"
8484
curl -L $downloadUrl -o sentry-wizard
8585
chmod +x sentry-wizard
8686
./sentry-wizard -i android
8787
```
8888

8989
```powershell {tabTitle:Windows}
90-
$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-win-x64.exe"
90+
$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-win-x64.exe"
9191
Invoke-WebRequest $downloadUrl -OutFile sentry-wizard.exe
9292
./sentry-wizard.exe -i android
9393
```

docs/platforms/dart/guides/flutter/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,35 +49,35 @@ npx @sentry/wizard@latest -i flutter
4949
```
5050

5151
```bash {tabTitle:macOS (Intel/x64)}
52-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-darwin-x64"
52+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-x64"
5353
curl -L $downloadUrl -o sentry-wizard
5454
chmod +x sentry-wizard
5555
./sentry-wizard -i flutter
5656
```
5757

5858
```bash {tabTitle:macOS (Apple Silicon/arm64)}
59-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-darwin-arm64"
59+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-darwin-arm64"
6060
curl -L $downloadUrl -o sentry-wizard
6161
chmod +x sentry-wizard
6262
./sentry-wizard -i flutter
6363
```
6464

6565
```bash {tabTitle:Linux (x64)}
66-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-linux-x64"
66+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-x64"
6767
curl -L $downloadUrl -o sentry-wizard
6868
chmod +x sentry-wizard
6969
./sentry-wizard -i flutter
7070
```
7171

7272
```bash {tabTitle:Linux (arm64)}
73-
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-linux-arm64"
73+
downloadUrl="https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-linux-arm64"
7474
curl -L $downloadUrl -o sentry-wizard
7575
chmod +x sentry-wizard
7676
./sentry-wizard -i flutter
7777
```
7878

7979
```powershell {tabTitle:Windows}
80-
$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v4.0.1/sentry-wizard-win-x64.exe"
80+
$downloadUrl = "https://github.com/getsentry/sentry-wizard/releases/download/v5.1.0/sentry-wizard-win-x64.exe"
8181
Invoke-WebRequest $downloadUrl -OutFile sentry-wizard.exe
8282
./sentry-wizard.exe -i flutter
8383
```

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,5 +118,5 @@ export function debounce<T extends unknown[]>(func: (...args: T) => void, delay:
118118
return function (...args: T) {
119119
clearTimeout(timer);
120120
timer = setTimeout(() => func.apply(this, args), delay);
121-
};
122-
}
121+
};
122+
}

0 commit comments

Comments
 (0)