[6.x] Update npm packages and release workflow #12808
Closed
+455
−262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is fixing two similar issues:
Missing dependencies
Currently we are instructing developers who want to use the JS packages to use a
filelink in theirpackage.json. The problem is that this method doesn't install the dependencies.This snuck though as seemingly working for the most part because it would use node_modules from the linked directory - or node_modules from the parents. So if we had
npm installed in the packages or cms itself, it seemed like it worked. But if you used it straight from a clean composer install (like on a deployment) it would be missing dependencies.This is fixed by pointing at tarballs created via
npm link, which will make it behave more like a real published npm package.Package coupling
Some bits in the
uipackage were still using code that only exists in the Statamic app, like utility functions, and some components.This is for standalone usage. You don't need to do this in an addon.
Developer usage changes
The path will need to change to the tarball.
"dependencies": { - "@statamic/cms": "file:./vendor/statamic/cms/resources/dist-package" + "@statamic/cms": "file:./vendor/statamic/cms/packages/cms.tgz" - "@statamic/ui": "file:./vendor/statamic/cms/resources/dist-ui" + "@statamic/ui": "file:./vendor/statamic/cms/packages/ui.tgz" }After each composer update, the user will also need to run
npm update @statamic/cms.Todo: