fix(turborepo-lockfiles): handle missing optional dependencies in Bun lockfiles (#10909)
## What?
Fix the `all_dependencies` method to properly handle optional
dependencies that are not present in the lockfile.
## Why?
Optional dependencies (both in `optional_dependencies` and
`optional_peers`) were being included unconditionally, which caused the
`test_optional_dependencies_not_in_lockfile` test to fail. The test
expects that optional dependencies missing from the lockfile should be
excluded from the transitive dependency closure.
## How?
- Check if a dependency is optional before including it
- For optional dependencies, verify they exist in the lockfile via
`package_entry`
- Skip optional dependencies that are not present
- Regular dependencies continue to be included unconditionally
This maintains the simplified approach for regular dependencies while
correctly handling the edge case of missing optional dependencies.
## Testing
Added unit tests around core issue, based on @leosilberg's privately
shared lockfile.