[build] Move optional dependencies to the `default` group (#11255)