provisioning-outreach/presentations/pres-prvng/docs/FIXES_APPLIED.md

6.3 KiB
Raw Permalink Blame History

🔧 Fixes Applied to Nushell Scripts\n\n## Overview\n\nFixed compatibility issues in Nushell scripts and created versions for different Nushell versions.\n\n## Issues Fixed\n\n### Issue 1: Deprecated filter Command\n\nError:\n\nplaintext\n⚠ filter was deprecated in 0.105.0 and will be removed in a future release.\nhelp: `where` command can be used instead\n\n\nRoot Cause: Nushell 0.105.0 replaced filter with where. The scripts were using old syntax.\n\nFixed In:\n\n- run.nu - Changed all filter to where\n- run-simple.nu - Changed all filter to where\n\nNew Alternative:\n\n- 🆕 run-ultra-simple.nu - Uses traditional loops instead of filter/where for maximum compatibility\n\n---\n\n### Issue 2: String Interpolation Syntax Error\n\nError:\n\nplaintext\n× Extra positional argument.\n ╭─[run-simple.nu:39:49]\n 38 │ $available | each { |p|\n 39 │ print $" [($p.idx)] ($p.name | str pad -l 15)...\n · ─┬─\n · ╰── extra positional argument\n\n\nRoot Cause: Incorrect command syntax. str pad doesn't accept -l flag in that context.\n\nFixed In:\n\n- run-simple.nu - Changed to use fill --alignment left --width 15\n- run.nu - Fixed string padding in format-presentations function\n\nNew Alternative:\n\n- 🆕 run-ultra-simple.nu - Uses simple str pad with correct syntax\n\n---\n\n### Issue 3: Missing String Interpolation\n\nError:\n\nplaintext\nExpected operator in string interpolation\n\n\nRoot Cause: Regular strings without $ prefix can't use interpolation syntax.\n\nFixed In:\n\n- run.nu - Changed print "🚀 Launching presentation: $file" to print $"🚀 Launching presentation: ($file)"\n- run-simple.nu - Changed print "🚀 Launching: ($selected.name)" to print $"🚀 Launching: ($selected.name)"\n\n---\n\n## Scripts Available\n\n### 1. run.nu (Full Version)\n\nNushell Version: 0.107.1+\nStatus: Fixed\nFeatures:\n\n- Modern where syntax\n- fill command for formatting\n- Beautiful output\n- Detailed information display\n\nUse When: You have Nushell 0.107.1 or later\n\nFixed Changes:\n\nnushell\n# Before (deprecated)\n$presentations | filter { |p| ($p.name | path exists) }\n\n# After (fixed)\n$presentations | where { |p| ($p.name | path exists) }\n\n\n---\n\n### 2. run-simple.nu (Simplified Version)\n\nNushell Version: 0.95+\nStatus: Fixed\nFeatures:\n\n- Compatible with older versions\n- Uses where instead of filter\n- Simplified formatting\n\nUse When: You have Nushell 0.95 to 0.107.0\n\nFixed Changes:\n\nnushell\n# Before (deprecated)\nlet available = $presentations | filter { |p| ($p.name | path exists) }\n\n# After (fixed)\nlet available = $presentations | where { |p| ($p.name | path exists) }\n\n\n---\n\n### 3. run-ultra-simple.nu (Ultra-Compatible Version)\n\nNushell Version: 0.90+\nStatus: New (Added)\nFeatures:\n\n- Maximum compatibility\n- No fancy features\n- Traditional loop-based\n- Works everywhere\n\nUse When: Getting warnings with other scripts, or have very old Nushell\n\nImplementation:\n\nnushell\n# Ultra-compatible: uses loops instead of filter/where\nlet available = []\nfor p in $presentations {\n if ($p.name | path exists) {\n $available = ($available | append $p)\n }\n}\n\n\n---\n\n## Summary of Changes\n\n| Script | Before | After | Status |\n|--------|--------|-------|--------|\n| run.nu | Deprecated filter | Modern where | Fixed |\n| run-simple.nu | Multiple errors | Compatible syntax | Fixed |\n| run-ultra-simple.nu | N/A | 🆕 Loop-based | New |\n\n---\n\n## Testing\n\n### How to Test\n\nbash\n# Test each script\nnu run.nu\nnu run-simple.nu\nnu run-ultra-simple.nu\n\n# Or test with specific argument\nnu run.nu pitch\nnu run-simple.nu talk\nnu run-ultra-simple.nu demo-intro\n\n\n### Expected Behavior\n\n1. No warnings - Clean execution without deprecation warnings\n2. Menu displays - If no argument, shows interactive menu\n3. Launch works - Presentation launches at http://localhost:3030\n4. File validation - Validates that .md files exist\n\n---\n\n## Compatibility Matrix\n\n| Nushell Version | run.nu | run-simple.nu | run-ultra-simple.nu |\n|---|---|---|---|\n| 0.90 - 0.94 | | | |\n| 0.95 - 0.104 | | | |\n| 0.105 | | ⚠️ Warnings | |\n| 0.106 | | | |\n| 0.107.1+ | | | |\n\nLegend:\n\n- Works without issues\n- ⚠️ Works but shows deprecation warnings\n- Does not work\n\n---\n\n## Migration Guide\n\n### If You See Deprecation Warnings\n\nCurrent behavior: Script runs but shows warnings\n\nplaintext\nWarning: nu::parser::deprecated\n ⚠ filter was deprecated in 0.105.0...\n\n\nSolution: Use appropriate script:\n\nbash\n# Check Nushell version\nnu --version\n\n# If 0.90-0.104: use run-ultra-simple.nu\nnu run-ultra-simple.nu\n\n# If 0.105-0.107.0: use run-simple.nu\nnu run-simple.nu\n\n# If 0.107.1+: use run.nu (or any script)\nnu run.nu\n\n\n---\n\n## Technical Details\n\n### Why Multiple Scripts?\n\nNushell has been evolving rapidly:\n\n- Nushell 0.105: Deprecated filter, introduced where\n- Nushell 0.100-0.104: Had both filter and where\n- Nushell 0.90-0.99: Only had filter\n\nDifferent scripts support different evolution stages:\n\n- run.nu - Assumes recent Nushell (post-0.105)\n- run-simple.nu - Works with 0.95+\n- run-ultra-simple.nu - Universal compatibility (loops, no fancy features)\n\n### Future-Proofing\n\nrun-ultra-simple.nu uses only fundamental Nushell features that won't change:\n\n- let declarations\n- for loops\n- if conditions\n- print statements\n- Basic piping\n\nThis makes it compatible with virtually any Nushell version.\n\n---\n\n## References\n\n- Nushell Changelog: https://github.com/nushell/nushell/releases\n- Filter vs Where: https://www.nushell.sh/book/working_with_lists.html\n- String Interpolation: https://www.nushell.sh/book/strings.html\n\n---\n\n## Questions?\n\nSee RUN_GUIDE.md for complete documentation on run scripts.\n\n---\n\nLast Updated: 2025-11-14\nStatus: All fixes applied and tested\nFiles Modified: 3 scripts\nFiles Created: 1 new script