Push command should respect dependency order between components
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3563780. -->
Reported by: [hooroomoo](https://www.drupal.org/user/3688872)
Related to !867
>>>
<h3>Overview</h3>
<p>When a component is pushed via the CLI tool and created as a <code>JavaScriptComponent</code> config entity in the backend, <code>JavaScriptComponent::addJavaScriptComponentsDependencies()</code> throws an error if an imported JavaScript dependency does not yet exist.</p>
<p>For example, consider pushing multiple components such as <code>AppleCard</code> and <code>FooButton</code>, where <code>AppleCard</code> imports <code>FooButton</code>. If <code>AppleCard</code> is pushed before <code>FooButton</code>, the backend will throw the following error:</p>
<pre><pre>[importedJsComponents.0] The JavaScript component with the machine name 'foo_button' does not exist.</pre></pre><p>That is because <code>FooButton</code> hasn't been created yet in Canvas.</p>
<h3>Proposed resolution</h3>
<p>The CLI <code>push</code> command need to sort the push order so that dependencies get uploaded first.</p>
> Related issue: [Issue #3559684](https://www.drupal.org/node/3559684)
issue