My attempt at fixing #10195.
@klaussner Feel free to submit your PR if it's ready, or just review this
one if you prefer. It's important to get this right, so it's not a
terrible idea for both of us to attempt it independently.
Follow-up to af51b816, which fixed#8005 by copying symlinks to external
directories as directories rather than trying to preserve the symlinks.
Issue #10177 revealed a flaw in this strategy: the filter function that we
use to strip development npm packages always rejects external paths, even
if the original symlink was found in a valid production npm package, and
thus its contents should be included in the production bundle.
In the process of fixing this problem, I realized that the only important
part of af51b816 was this code:
// Update fileStatus to match the actual file rather than the
// symbolic link, thus forcing the file to be copied below.
fileStatus = optimisticLStatOrNull(externalPath);
and the code for manipulating thisAbsFrom and _currentRealRootDirectory
could be removed.
Fixes several cases causing cordova plugins reinstall on every build:
- proper handling of scoped npm cordova plugins
- proper detection of plugin removal (previously a cordova plugin containing a dependency would make the algorithm think a package was removed from cordova-plugins)
- proper handling of plugins which have plugin.xml id different than the npm package name
Additionally rechecks the build integrity verifying if packages were really installed and perform a retry if needed.
Allows to override a meteor package cordova dependency with scoped package i.e. @scope/cordova-dummy-plugin will now override a cordova-dummy-plugin dependency.
Meteor 1.6.x through 1.7.0.x use the `babel-runtime@1.2.x` packages, and
this change is only intended to affect those versions.
This will no longer be necessary in Meteor 1.7.1, since we account for
the changes to `@babel/runtime` through changes to the `meteor/babel`
package, but this ensures that anyone who updates to `@babel/runtime@7` (the
final, latest release), or anything newer, isn't surprised by their broken
application.
This should make the @babel/runtime dependency that I added to the
compile-coffeescript plugin in a52a2c28f1
actually work as intended.
Specifically, the babel-runtime package that's bundled into the
compile-coffeescript plugin will now be able to import @babel/runtime and
receive the plugin's private version of @babel/runtime, rather than the
one in dev_bundle/lib/node_modules or the application's node_modules.
cc @hwillson @abernix
After publishing coffeescript@2.3.1_1, I noticed that the version of
babel-runtime (1.2.5) that is bundled into the compile-coffeescript plugin
was complaining about the presence of @babel/runtime@7.0.0-rc.1 in the
node_modules directory of Meteor 1.7.1-rc.3 apps, thanks to code added
recently to work around breaking changes in @babel/runtime@7.0.0-beta.56:
4d5fff99eb
The easiest way to fix this problem in the short term is to give the
compile-coffeescript plugin its own reliable copy of the @babel/runtime
npm package, rather than delegating to the version installed in the app.
The ideal long-term way to fix this problem would be to stop precompiling
Meteor compiler plugins before publishing them, and instead treat them
like any other Meteor package, which are compiled after installation.
Another issue that could have been prevented if compiler plugins were
compiled upon installation, like other packages: #10148
cc @hwillson @abernix @GeoffreyBooth