Bun / Show Outdated Dependencies Workspace
Show Outdated Dependencies Workspace
Show outdated dependencies specifically for a workspace based on pattern.
bun outdated -F "<workspace_pattern>" bun outdated -F "<workspace_pattern>" #!/bin/bash
# Show Outdated Dependencies Workspace
bun outdated {{[-F|--filter]}} "{{workspace_pattern}}" import subprocess
# Show Outdated Dependencies Workspace
# Make sure to replace <placeholders> with actual values
def run_command():
cmd = [
"bun",
"outdated",
"-F",
"\"<workspace_pattern>\""
]
try:
print(f"Executing: {' '.join(cmd)}")
subprocess.run(cmd, check=True)
except subprocess.CalledProcessError as e:
print(f"Error: {e}")
except FileNotFoundError:
print("Error: bun not found. Please install it first.")
if __name__ == "__main__":
run_command() When To Use
When managing multi-package repositories and needing to assess specific workspaces.
Pro Tip
Leverage the `--ignore-lockfile` for situations where the workspace needs unblocked updates.
Command Builder
Tune the command before you copy it
bun outdated -F "<workspace_pattern>" Terminal Output
Expected runtime feedback
┌─────────┬───────────┬─────────┐
│ Package │ Current │ Latest │
├─────────┼───────────┼─────────┤
│ react │ 17.0.2 │ 18.0.0 │
│ cors │ 2.8.5 │ 2.9.0 │
└─────────┴───────────┴─────────┘
2 outdated dependencies found in workspace. Anatomy of Output
Understanding the result
Checking outdated packages in workspaces: workspace/* Workspace Check Indicates the basename of the workspaces being scanned.
Outdated dependencies found: 2. Result Count Indicates the total number of outdated packages across specified workspaces.
Details: Package: react, Current: 17.0.0, Latest: 17.0.2 Detailed Output Displays information on the outdated package found.
Power User Variants
Optimized versions
bun outdated -F 'workspace/*' Forces updates even amidst conflicts.
bun outdated --json 'workspace/*' Output results in JSON format for automation.
bun outdated 'packages/react' Check a specific package within the workspace.
Troubleshooting
Common pitfalls
Error: No directories match the workspace pattern
Solution: Double-check the workspace pattern for correctness.
Error: Permission denied to access workspace
Solution: Ensure your user has adequate permissions to the workspace directories.
Error: Multiple versions of dependency found
Solution: Run 'bun bun install' to clean up and resolve versioning issues.
Command Breakdown
What each part is doing
-
bun - Base Command
- The executable that performs this operation. Here it runs Bun before the shell applies any redirect operators.
-
-F - F| filter
- The value supplied for F| filter.
-
<workspace_pattern> - workspace pattern
- The value supplied for workspace pattern.
-
-F - Command Option
- Tool-specific option used by this command invocation.
How To Run
Execution path
- Step 1
Run the command: bun outdated --filter "my-workspace"
- Step 2
Check the output for outdated dependencies listed along with their versions.
Alternative Approaches
Comparable commands in other tools
Alternative package management tools for the same job.