Commit Graph

6202 Commits

Author SHA1 Message Date
Ben Newman
c2e4b77636 Protect against edge case when resolved is a string.
In particular, if the "main" field of the package.json file cannot be
resolved, then the `resolved` variable will be "missing", which is a
truthy value that silently rejects property assignments. Ugh!
2017-02-15 14:09:36 -05:00
Eric Dobbertin
005c521f54 Fix comment about unordered imports (#8362) 2017-02-14 09:03:25 -08:00
Ben Newman
e43a5d07f0 Update the modules test app to Meteor 1.4.3.1. 2017-02-14 09:55:38 -05:00
Ben Newman
434116aa84 Fix installing from shrinkwrap.
Although we thought the upgrade from `npm` 3.10.9 to 4.1.2 was worthwhile
and safe, this breaking change proved problematic:
https://github.com/npm/npm/blob/latest/CHANGELOG.md#no-more-partial-shrinkwraps-breaking

Specifically, if a Meteor package calls `Npm.depends` in a way that
disagrees with the contents of `.npm/package/npm-shrinkwrap.json` file,
Meteor will create a partial shrinkwrap file in order to install the
correct top-level npm dependencies, but transitive dependencies of the
package will no longer be installed.

This was fixed in Meteor 1.4.2.7 by reverting the upgrade of npm, but
Meteor 1.4.3.1 will keep npm@4.1.2 and fix the consequences.
2017-02-13 18:11:11 -05:00
Jesse Rosenberger
f4d677fbc8 Add an upgrader which modifies accounts-* packages automatically.
The transformations to be made here are:
   * Existence of `accounts-<service>` **adds** `<service>-config-ui`
   * Existence of `<service>` **changes to** `<service>-oauth`
 https://github.com/meteor/meteor/issues/7715#issuecomment-276529351

 Relates to:

  * facebook: https://github.com/meteor/meteor/pull/7728
  * github: https://github.com/meteor/meteor/pull/8303
  * google: https://github.com/meteor/meteor/pull/8275
  * meetup: https://github.com/meteor/meteor/pull/8231
  * meteor-developer: https://github.com/meteor/meteor/pull/8305
  * twitter: https://github.com/meteor/meteor/pull/8283
  * weibo: https://github.com/meteor/meteor/pull/8302
2017-02-10 17:34:28 +02:00
Ben Newman
bcffe53d14 Consider npm packages with {,pre,post}install scripts non-portable.
Inspired by analysis from @danstiner:
https://github.com/meteor/meteor/issues/8225#issuecomment-275044900

Fixes #8225, as well as the tests I added in 672c4f338a.

I changed the name of the .meteor-portable file to .meteor-portable-1.json
in order to invalidate previous .meteor-portable files. This naming scheme
will be more sustainable, because we can keep incrementing the version
number whenever we change this logic.
2017-02-09 16:04:23 -05:00
Ben Newman
672c4f338a Add the modules test app to the self-test suite.
I've been running these tests manually ever since Meteor 1.3, but they
really should run every time.
2017-02-09 12:09:48 -05:00
Ben Newman
fabad4cc8d Overwrite implicit modules only if they are package.json files.
Implicit empty stub CSS modules added in addStylesheet in
compiler-plugin.js were being overwritten with actual CSS module code,
thanks to logic intended to support replacing package.json stubs with
their actual contents.

The meaning of "implicit" is somewhat overloaded: for package.json
modules, it means the module is a minimal stub (just the "name",
"version", and "main"/"browser" fields) that should be replaced if ever
explicitly imported. For empty stub CSS modules, it means the module
should yield to any actual modules added via addJavaScript.
2017-02-09 12:09:34 -05:00
Ben Newman
365ceb6386 Tolerate ENOENT exceptions from files.realpath in isWithinProdPackage. 2017-02-08 17:18:30 -05:00
Ben Newman
2010e9d11a Merge branch 'devel' into release-1.4.3 2017-02-08 14:47:03 -05:00
Ben Newman
858dc64db4 Merge branch 'master' into devel 2017-02-08 14:43:26 -05:00
Ben Newman
cafe4cc084 Fix bad npm package stripping logic introduced to fix #8136.
When `start + maxPartCount > parts.length`, this code was comparing
array holes to strings, leading to unpredictable results.

Blame: 2613582311
2017-02-08 11:04:20 -05:00
Ben Newman
868a52829f Register package@version constraints for current release.
Package version unpinning (#7084) removed all exact package@=version
constraints derived from the current release.

As we discovered with Meteor 1.4.2.4 (#8306), this meant releases no
longer had any power to enforce package upgrades, which is why the
follow-up Meteor 1.4.2.5 release (#8311) was necessary.

This commit has the same effect as putting package@version in your
.meteor/packages file for every local/core package that your app uses.
2017-02-07 14:52:49 -05:00
Ben Newman
59124681bc Preserve true "main" and "browser" fields of package.json modules.
This reverts commit 32140c8707, restoring
commit 6c643a4763.
2017-02-07 10:43:20 -05:00
Ben Newman
29b88d29d4 Merge branch 'devel' into release-1.4.3 2017-02-07 10:37:54 -05:00
Ben Newman
3801349437 Merge branch 'master' into devel 2017-02-07 10:36:49 -05:00
Jesse Rosenberger
32140c8707 Revert "Preserve true "main" and "browser" fields of package.json modules."
This reverts commit 6c643a4763.
2017-02-02 20:26:54 -08:00
Ben Newman
a00b19d1fb Merge branch 'devel' into release-1.4.3 2017-02-02 16:07:50 -05:00
Hugh Willson
f57d4d157d Added extra colon-converter calls to the bundler and linker. (#8293)
* Added extra colon-converter calls to the bundler and linker.
* Rewording of convert to convertColons for clarity.
2017-02-02 15:54:59 -05:00
Ben Newman
a3e8cf6763 Update modules test app to Meteor 1.4.2.4. 2017-02-02 15:46:59 -05:00
Ben Newman
cc8734ddca Merge branch 'master' into devel 2017-02-02 15:18:48 -05:00
Ben Newman
1f60258821 Merge pull request #8142 from abernix/feature/fix-7849-stale-cordova-build
Cordova project preparation must occur before copying to the build
2017-02-01 12:40:06 -05:00
Ben Newman
bf9338b367 Support ./meteor publish-release --skip-tree-hashing ... flag. 2017-02-01 12:24:06 -05:00
Ben Newman
c683a79595 Unify file.emptyStub and file.imported === "implicit" as file.implicit.
Note that there was a typo in ResourceSlot#addStylesheet, so
file.emptyStub was never === true before.
2017-02-01 10:35:31 -05:00
Ben Newman
6c643a4763 Preserve true "main" and "browser" fields of package.json modules.
Previously, when building a JavaScript bundle for the client, if a
package.json file had a string-valued "browser" field, we would replace
the value of the "main" field of the bundled package.json module with the
value of the "browser" field. This trick was important because it allowed
an npm package to have a different entry point on the client than it had
on the server.

However, that approach became inconsistent if the package.json file was
also explicitly imported as a module, because the package.json stub used
for module resolution prevented the real contents of package.json from
getting bundled, and disagreed with the original package.json module about
the value of the "main" field.

To resolve that inconsistency, it seems better to avoid modifying the
"main" field of package.json modules, and instead rely on the runtime
module system to make sense of the "browser" field, regardless of whether
the package.json module is a stub used only for module resolution or
contains the full contents of the original package.json file.

The ability to understand "browser" fields of package.json modules was
introduced in install@0.8.3:
377d1a3b51

This is potentially a backwards-incompatible change for developers using
this version of `ImportScanner` and `Resolver` who have not yet upgraded
their `modules-runtime` package to at least version 0.7.8. The solution is
to upgrade `modules-runtime`, though it would be nice to enforce that
better somehow.
2017-02-01 10:34:52 -05:00
Ben Newman
2613582311 Always copy node_modules/.bin into bundle/programs/server/npm.
Fixes #8136.
2017-02-01 09:58:10 -05:00
Jesse Rosenberger
3b8c886f6f Merge branch 'devel' into release-1.4.3 2017-01-26 15:39:21 -08:00
Ben Newman
355cde306a Merge pull request #8239 from wojtkowiak/cordova-6.4.0
Update to Cordova 6.4.0
2017-01-25 16:39:13 -05:00
Ben Newman
0734a70299 Merge branch 'devel' into release-1.4.3 2017-01-19 11:55:29 -05:00
Hugh Willson
524e34bce2 Slight wording changes. 2017-01-15 10:37:52 -05:00
Hugh Willson
7064a029ef Updated to include note about matching architecture versions for packages. 2017-01-13 10:48:04 -05:00
Hugh Willson
24e64f483e Updated meteor build CLI help to include os.windows.x86_32 --architecture option. 2017-01-12 11:05:22 -05:00
Bartosz Wojtkowiak
9347cdff3d Update Cordova pinned plugin versions and dependencies to latest verions 2017-01-11 22:13:29 +01:00
Bartosz Wojtkowiak
503c0472d4 Update cordova-ios and cordova-android to latest versions 2017-01-11 21:55:07 +01:00
Ben Newman
fd9bda20df Merge pull request #8170 from abernix/feature/fix-7859-messaging
Improve helpfulness of error message when combining different files.
2017-01-10 18:48:01 -05:00
Ben Newman
d3bed96215 Merge branch 'devel' into release-1.4.3 2017-01-10 12:55:23 -05:00
David Glasser
b7286fc90d Make deploy errors easier to identify 2017-01-05 13:11:01 -08:00
Ben Newman
13eee64d95 Style tweak to reduce indentation in ImportScanner#_addPkgJsonToOutput. 2017-01-04 13:13:45 -05:00
Ben Newman
4fb26259b8 Unify file.emptyStub and file.imported === "implicit" as file.implicit.
Note that there was a typo in ResourceSlot#addStylesheet, so
file.emptyStub was never === true before.
2017-01-04 13:00:24 -05:00
Ben Newman
2eab0b2bf4 Preserve true "main" and "browser" fields of package.json modules.
Previously, when building a JavaScript bundle for the client, if a
package.json file had a string-valued "browser" field, we would replace
the value of the "main" field of the bundled package.json module with the
value of the "browser" field. This trick was important because it allowed
an npm package to have a different entry point on the client than it had
on the server.

However, that approach became inconsistent if the package.json file was
also explicitly imported as a module, because the package.json stub used
for module resolution prevented the real contents of package.json from
getting bundled, and disagreed with the original package.json module about
the value of the "main" field.

To resolve that inconsistency, it seems better to avoid modifying the
"main" field of package.json modules, and instead rely on the runtime
module system to make sense of the "browser" field, regardless of whether
the package.json module is a stub used only for module resolution or
contains the full contents of the original package.json file.

The ability to understand "browser" fields of package.json modules was
introduced in install@0.8.3:
377d1a3b51

This is potentially a backwards-incompatible change for developers using
this version of `ImportScanner` and `Resolver` who have not yet upgraded
their `modules-runtime` package to at least version 0.7.8. The solution is
to upgrade `modules-runtime`, though it would be nice to enforce that
better somehow.
2017-01-04 11:54:17 -05:00
Jesse Rosenberger
d15e1f9172 Ensure babel-runtime is included in skelton variations & bump versions
Also updated the `meteor-node-stubs` to the latest published release.

Closes meteor/meteor#8202
2017-01-04 01:44:05 +02:00
Ben Newman
1ee3774bdb Merge pull request #8183 from cwohlman/remove-insecure-packages-from-bare-skeleton
Remove autopublish and insecure from the bare skeleton app
2017-01-03 18:43:36 -05:00
Oleksandr Chekhovskyi
3d3c81830a Update node-mongodb driver to 2.2.16
This fixes an issue where the driver fails to recover from unresponsive
primary in a replica set.
2016-12-29 20:06:56 +01:00
Joshua Ohlman
0a87fa5df6 Remove autopublish and insecure from the bare skeleton app
Fixes #8145
2016-12-22 07:54:21 -06:00
Jesse Rosenberger
ec69e6d999 Improve helpfulness of error message when combining different files
Make the error message displayed to the developer more helpful in a situation like meteor/meteor#7859 where the `package.js` inadvertently referred to an imProPeRly-CaSeD version of the file it was importing.

No functionality change, just developer experience.

Fixes #7859
2016-12-19 19:36:48 +02:00
Ben Newman
83b05896c3 Merge pull request #8142 from abernix/feature/fix-7849-stale-cordova-build
Cordova project preparation must occur before copying to the build
2016-12-13 19:01:49 -05:00
Ben Newman
31077c8381 Merge pull request #8151 from abernix/feature/fix-4054-console-corruption
Fix console glitch when using some admin package functions
2016-12-13 18:55:13 -05:00
Jesse Rosenberger
4a16e649cc Fix console glitch when using some admin package functions
Tiny fix for an old issue where the console output would get corrupted when running `meteor admin set-unmigrated` or `meteor admin change-homepage` due to missing newline on `rawInfo` command.

Fixes meteor/meteor#4054
2016-12-13 15:54:10 +02:00
Jesse Rosenberger
1fda39b3a0 Cordova project preparation must occur before copying to the build
This fixes a regression caused by 88d43a0f16 which is demonstrated in meteor/meteor#7849.

Essentially, with the current implementation some Cordova build elements are "stale" when the build is copied.  For example, if you execute a `meteor run ios` and then `meteor build . --server=http://example.com/` (note: `example.com`) the `config.xml` (`<access origin />`), the boilerplate HTML (`__meteor_runtime_config__`) and other elements of the bundle (`Info.plist` on iOS) will still contain the previously used `http://<local_ip>:3000` address instead of `http://example.com` as they should.

Additionally, it would appear that it's impossible to actually checkout a project and immediately run `meteor build` without running `meteor run (android|ios)` first.

Various work-arounds for this seem to exist, such as running `meteor build` twice, or running `meteor run --server=http://production.com` first.

Ultimately, this is occurring because the bundle is being copied before the Cordova `prepareForPlatform` occurs which I believe was not intended.

There is already a test in place which fails without this fix, but marked as `slow` and therefore not executed on CircleCI.  Specifically, `cordova builds with server options` would have caught this.  Forcibly running this test locally now passes with this change.

Fixes meteor/meteor#7849
Fixes meteor/meteor#7291
Fixes meteor/meteor#6756
2016-12-12 17:11:55 +02:00
Jesse Rosenberger
23c52ff002 meteor shell should pass its TTY width to the server on connect
Previously, the width (or "columns") for the readline shell was being obtained on the server.  This causes problems for clients which are connecting to the server which are sized differently.

The client will still have problems if they resize AFTER they are connected to the REPL, but at least they have the option of being a different size.

A more complete solution would be to have the client listen on process.stdout "resize" and pass that to the server when it occurs, but I'm not sure of an easy way to do that with the current communication (perhaps pause-reconfigure-unpause?).

Fixes meteor/meteor#5346
2016-12-12 12:57:16 +02:00