taddis Is "packages" your workbench folder ?
You commands are basically it. You clone core, you install it like any development extension via a composer workbench directory.
Then you work in the js/src folder, and use the npm commands to compile the files again. Core has an extend directive to register its own resources, like extensions do. The code from the dist files of core and of all extensions are bundled into the final Flarum js file every time the cache is cleared, or on every request if debug mode is enabled.
When you commit and submit your changes to code, don't include the recompiled dist files, a continuous integration job will take care of it automatically once the PR is merged.