-
Notifications
You must be signed in to change notification settings - Fork 5
Add rolldown version testing tool with statistics collection (stable versions only) #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4e1cbcc
Initial plan
Copilot c2a63c3
Complete rolldown version override tool implementation
Copilot 04b2a98
Implement dynamic version fetching from npm and pkg.pr.new APIs
Copilot 260419f
Sort versions by date and remove limit on future versions
Copilot dd728e1
Add comprehensive version statistics collection to rolldown override …
Copilot a83f4c4
Resolve merge conflicts from main branch
Copilot 1c7aa2b
Merge main branch and fix linting warning
Copilot edbea17
Remove rolldown-version-stats.json from gitignore and typescript-esli…
Copilot fa1aca3
Add comprehensive rolldown version statistics data
Copilot 62fe37d
Remove gitignore comment and update lockfile
Copilot 2a230d1
Comment out future versions functionality as requested - fixes broken…
Copilot 07b2b4c
Sort rolldown versions with most recent last instead of first
Copilot 04d4c69
u
Boshen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| # Rolldown Version Override Tool | ||
|
|
||
| This tool allows you to easily test the vibe-dashboard with different rolldown-vite versions. | ||
|
|
||
| ## Features | ||
|
|
||
| - 🟢 **Stable Versions**: Test with the last 5 stable versions from npm | ||
| - 🚀 **Future Versions**: Test with experimental versions from pkg.pr.new (when available) | ||
| - 🔄 **Automatic Rebuild**: Automatically installs dependencies and rebuilds the app | ||
| - 📋 **Easy Selection**: Use version numbers or indices for quick switching | ||
|
|
||
| ## Usage | ||
|
|
||
| ### List Available Versions | ||
|
|
||
| ```bash | ||
| # From root directory | ||
| pnpm rolldown:list | ||
|
|
||
| # Or directly with node | ||
| node tool/override-rolldown.js --list | ||
| ``` | ||
|
|
||
| ### Switch to a Version by Index | ||
|
|
||
| ```bash | ||
| # Use the 2nd version in the list (7.1.3) | ||
| pnpm rolldown:use 2 | ||
|
|
||
| # Or directly with node | ||
| node tool/override-rolldown.js 2 | ||
| ``` | ||
|
|
||
| ### Switch to a Specific Version | ||
|
|
||
| ```bash | ||
| # Use a specific version | ||
| pnpm rolldown:use 7.1.2 | ||
|
|
||
| # Or directly with node | ||
| node tool/override-rolldown.js 7.1.2 | ||
| ``` | ||
|
|
||
| ### Get Help | ||
|
|
||
| ```bash | ||
| node tool/override-rolldown.js --help | ||
| ``` | ||
|
|
||
| ## Available Versions | ||
|
|
||
| The tool currently supports: | ||
|
|
||
| ### Stable Versions (from npm) | ||
| - 7.1.4 (latest) | ||
| - 7.1.3 | ||
| - 7.1.2 | ||
| - 7.1.1 | ||
| - 7.1.0 | ||
|
|
||
| ### Future Versions (from pkg.pr.new) | ||
| Future versions will be added as they become available through pkg.pr.new for testing experimental features. | ||
|
|
||
| ## What It Does | ||
|
|
||
| 1. **Updates package.json**: Modifies `apps/dashboard/package.json` to use the specified rolldown-vite version | ||
| 2. **Installs dependencies**: Runs `pnpm install` to update the lockfile | ||
| 3. **Rebuilds the app**: Runs `pnpm build` to ensure everything works with the new version | ||
|
|
||
| ## Example Workflow | ||
|
|
||
| ```bash | ||
| # Check current setup | ||
| pnpm build | ||
|
|
||
| # List available versions | ||
| pnpm rolldown:list | ||
|
|
||
| # Test with an older version | ||
| pnpm rolldown:use 7.1.1 | ||
|
|
||
| # Verify the build still works | ||
| pnpm dev | ||
|
|
||
| # Switch back to latest | ||
| pnpm rolldown:use 7.1.4 | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - The tool modifies `apps/dashboard/package.json` directly | ||
| - Always commit your changes before using this tool if you want to preserve the current version | ||
| - The tool automatically runs `pnpm install` and `pnpm build` after version changes | ||
| - Build failures will be reported if the new version has compatibility issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Rolldown Version Override Tool | ||
| * | ||
| * This tool allows testing the vibe-dashboard with different rolldown-vite versions: | ||
| * - Last 5 stable versions from npm | ||
| * - Future/experimental versions from pkg.pr.new | ||
| */ | ||
|
|
||
| const { execSync } = require('child_process'); | ||
| const { readFileSync, writeFileSync } = require('fs'); | ||
| const { join } = require('path'); | ||
|
|
||
| const DASHBOARD_PACKAGE_PATH = join(process.cwd(), 'apps/dashboard/package.json'); | ||
|
|
||
| // Last 5 stable versions from npm (as of current check) | ||
| const STABLE_VERSIONS = [ | ||
Boshen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| '7.1.4', | ||
| '7.1.3', | ||
| '7.1.2', | ||
| '7.1.1', | ||
| '7.1.0' | ||
| ]; | ||
|
|
||
| // Future versions from pkg.pr.new (examples - these would be actual PR URLs) | ||
| const FUTURE_VERSIONS = [ | ||
Boshen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // These would be actual pkg.pr.new URLs for future versions | ||
| // Example: 'https://pkg.pr.new/rolldown-rs/rolldown@pr-123' | ||
| // Example: 'pkg.pr.new/rolldown-rs/vite@1234' | ||
| // Note: Users can manually add pkg.pr.new URLs here when testing specific PRs | ||
| ]; | ||
|
|
||
| function getCurrentVersion() { | ||
| try { | ||
| const packageJson = JSON.parse(readFileSync(DASHBOARD_PACKAGE_PATH, 'utf8')); | ||
| return packageJson.devDependencies['rolldown-vite']; | ||
| } catch (error) { | ||
| console.error('Error reading package.json:', error.message); | ||
| process.exit(1); | ||
| } | ||
| } | ||
|
|
||
| function isPkgPrNewUrl(version) { | ||
| return version.includes('pkg.pr.new') || version.startsWith('https://pkg.pr.new'); | ||
| } | ||
|
|
||
| function updateRolldownVersion(version) { | ||
| try { | ||
| console.log(`📦 Updating rolldown-vite to version: ${version}`); | ||
|
|
||
| // Read current package.json | ||
| const packageJson = JSON.parse(readFileSync(DASHBOARD_PACKAGE_PATH, 'utf8')); | ||
|
|
||
| // Update rolldown-vite version | ||
| packageJson.devDependencies['rolldown-vite'] = version; | ||
|
|
||
| // Write back to package.json | ||
| writeFileSync(DASHBOARD_PACKAGE_PATH, JSON.stringify(packageJson, null, 2) + '\n'); | ||
|
|
||
| if (isPkgPrNewUrl(version)) { | ||
| console.log('🚀 Using experimental version from pkg.pr.new'); | ||
| } | ||
| console.log('✅ Package.json updated successfully'); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('❌ Error updating package.json:', error.message); | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| function installDependencies() { | ||
| try { | ||
| console.log('📥 Installing dependencies...'); | ||
| execSync('pnpm install --no-frozen-lockfile', { | ||
| stdio: 'inherit', | ||
| cwd: process.cwd() | ||
| }); | ||
| console.log('✅ Dependencies installed successfully'); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('❌ Error installing dependencies:', error.message); | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| function buildApp() { | ||
| try { | ||
| console.log('🔨 Building application...'); | ||
| execSync('pnpm build', { | ||
| stdio: 'inherit', | ||
| cwd: process.cwd() | ||
| }); | ||
| console.log('✅ Build completed successfully'); | ||
| return true; | ||
| } catch (error) { | ||
| console.error('❌ Build failed:', error.message); | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| function listVersions() { | ||
| console.log('📋 Available rolldown-vite versions:\n'); | ||
|
|
||
| console.log('🟢 Stable versions (last 5 from npm):'); | ||
| STABLE_VERSIONS.forEach((version, index) => { | ||
| const current = getCurrentVersion() === `^${version}` || getCurrentVersion() === version; | ||
| console.log(` ${index + 1}. ${version} ${current ? '(current)' : ''}`); | ||
| }); | ||
|
|
||
| if (FUTURE_VERSIONS.length > 0) { | ||
| console.log('\n🚀 Future versions (from pkg.pr.new):'); | ||
| FUTURE_VERSIONS.forEach((version, index) => { | ||
| console.log(` ${STABLE_VERSIONS.length + index + 1}. ${version}`); | ||
| }); | ||
| } else { | ||
| console.log('\n🚀 Future versions (from pkg.pr.new):'); | ||
| console.log(' None configured. Add pkg.pr.new URLs to FUTURE_VERSIONS array in the script.'); | ||
| } | ||
|
|
||
| console.log('\n💡 Usage: node override-rolldown.js <version-number-or-version-string>'); | ||
| console.log('Example: node override-rolldown.js 2 # Use version 7.1.3'); | ||
| console.log('Example: node override-rolldown.js 7.1.2 # Use specific version'); | ||
| console.log('Example: node override-rolldown.js pkg.pr.new/rolldown-rs/vite@1234 # Use pkg.pr.new URL'); | ||
| } | ||
|
|
||
| function main() { | ||
| const args = process.argv.slice(2); | ||
|
|
||
| if (args.length === 0 || args[0] === '--list' || args[0] === '-l') { | ||
| listVersions(); | ||
| return; | ||
| } | ||
|
|
||
| const input = args[0]; | ||
| let targetVersion; | ||
|
|
||
| // Check if input is a number (index) | ||
| if (/^\d+$/.test(input)) { | ||
| const index = parseInt(input, 10) - 1; | ||
| const allVersions = [...STABLE_VERSIONS, ...FUTURE_VERSIONS]; | ||
|
|
||
| if (index >= 0 && index < allVersions.length) { | ||
| targetVersion = allVersions[index]; | ||
| } else { | ||
| console.error(`❌ Invalid version index. Use 1-${allVersions.length}`); | ||
| listVersions(); | ||
| process.exit(1); | ||
| } | ||
| } else { | ||
| // Assume it's a version string | ||
| targetVersion = input; | ||
| } | ||
|
|
||
| console.log(`🎯 Target version: ${targetVersion}`); | ||
| console.log(`📍 Current version: ${getCurrentVersion()}\n`); | ||
|
|
||
| // Update version | ||
| if (!updateRolldownVersion(targetVersion)) { | ||
| process.exit(1); | ||
| } | ||
|
|
||
| // Install dependencies | ||
| if (!installDependencies()) { | ||
| process.exit(1); | ||
| } | ||
|
|
||
| // Build app | ||
| if (!buildApp()) { | ||
| process.exit(1); | ||
| } | ||
|
|
||
| console.log('\n🎉 Successfully updated rolldown-vite and rebuilt the application!'); | ||
| console.log(`📊 Dashboard is ready with rolldown-vite ${targetVersion}`); | ||
| } | ||
|
|
||
| // Handle command line arguments | ||
| if (process.argv.includes('--help') || process.argv.includes('-h')) { | ||
| console.log('Rolldown Version Override Tool\n'); | ||
| console.log('Usage:'); | ||
| console.log(' node override-rolldown.js --list List available versions'); | ||
| console.log(' node override-rolldown.js <index> Use version by index (1-5)'); | ||
| console.log(' node override-rolldown.js <version> Use specific version'); | ||
| console.log(' node override-rolldown.js <pkg.pr.new> Use pkg.pr.new URL'); | ||
| console.log('\nExamples:'); | ||
| console.log(' node override-rolldown.js --list'); | ||
| console.log(' node override-rolldown.js 2'); | ||
| console.log(' node override-rolldown.js 7.1.2'); | ||
| console.log(' node override-rolldown.js pkg.pr.new/rolldown-rs/vite@1234'); | ||
| process.exit(0); | ||
| } | ||
|
|
||
| main(); | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot remove this
typescript-eslintThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
typescript-eslintdependency from apps/dashboard/package.json. The project now uses oxlint for faster linting performance. Commit: edbea17