Commit Graph

6239 Commits

Author SHA1 Message Date
Jesse Rosenberger
6a0767bbac Don't reassign, just Profile the *Atomically functions directly. 2017-04-05 19:04:22 +03:00
Jesse Rosenberger
5bbdcc9baa Change order that functions are defined so move is wrapped correctly. 2017-04-05 18:56:05 +03:00
Jesse Rosenberger
27819a164b Update installNpmModule to properly capture newer npm error formats. (#8564)
Previously, we captured and displayed shorter error messages for the
more complicated and unnecessarily verbose messages which npm produced.

While updating npm to 4.4.4, I observed the changelog for 4.4.0
indicated it would now produce less verbose messages.  In searching for
possible Meteor conflicts with this, I discovered that
`installNpmModule` had already regressed on providing pretty messages.

This fixes those messages to be parsed properly and adds tests which
ensure if npm changes again that we can capture them.

Follows-up on: https://github.com/meteor/meteor/pull/8562
2017-04-05 11:46:29 -04:00
Jesse Rosenberger
74cb8ebdc2 Improve fs-extras move calls for Windows platform. (#8560)
* Improve `fs-extra.move` calls for Windows platform.

This is a follow-up to meteor/meteor#8491 which worked properly on Unix
platforms, but failed in a variety of ways on Windows due to its lack
of Fiber-awareness and desire to create symlinks as unprivileged users
(something not always possible on Windows).

The Fiber issue was observed when trying to remove "src" directories
within the `move` function (which tries a variety of OS/OS/arch-specific
techniques to accomplish its goal) after they had been copied to "dest".
On Windows, this resulted in `EDIRNOTEMPTY` errors since Windows appears
to temporarily cache the file-handle or doesn't release the file-handle
until the next tick.

The symlink issue will hopefully improve in an upcoming release of
Windows (Creator Edition) when Microsoft makes it possible to create
symlinks as an unprivileged user, however it will still require enabling
"Developer" mode in Windows settings.  This implements the same catch
which was already in place for `fs.rename` on the `fs.move` provided by
`fs-extra`.

Performance gains were the same in tests comparing before and after
these changes.

Relates to:
https://github.com/meteor/meteor/issues/8558#issuecomment-291194385

* A few code-cleanups to my original commit.
2017-04-05 12:58:32 +03:00
Jesse Rosenberger
cba8c63340 Update node-gyp and node-pre-gyp packages.
* `node-gyp` - Adds support for Visual Studio 2017.
  - https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md#v360-2017-03-16
* `node-pre-gyp` - Nothing notable.
  - https://github.com/mapbox/node-pre-gyp/blob/master/CHANGELOG.md#0634
2017-04-04 19:42:03 +03:00
Jesse Rosenberger
8bdd0142cd Disable display of update msg about npm itself, since it's bundled.
As of npm 4.4.0 this is necessary as it will now self-check once per day
for updates.  Meteor pre-bundles the version of npm though so this
message will be confusing to users of the `meteor` tool.

https://github.com/npm/npm/releases/tag/v4.4.0
2017-04-04 19:37:20 +03:00
Ben Newman
87d0a33067 Get Cordova plugin test to pass by adding time. 2017-04-03 18:43:54 -04:00
Ben Newman
954efa7f5a Support Google Sign-In in google-oauth package. (#8549)
* Support Google Sign-In in google-oauth package.

Addresses #8253.

* Use Meteor.startup instead of listening for deviceready event.

* Fix mobile-config.js typo.

* Bump accounts-google and google-oauth package versions.

I'm only bumping the patch versions, even though the recent changes to
these packages may seem significant, for two reasons:

1. Bumping the minor versions would force Meteor 1.4.3 developers to
   upgrade to Meteor 1.4.4 if they wanted to use these changes.

2. The accounts-google and google-oauth packages without these changes
   will stop working completely in two weeks, which is much worse than the
   risks of upgrading.
2017-04-03 17:07:55 -04:00
Jesse Rosenberger
d24cd94f20 Merge branch 'release-1.4.3.x' of https://github.com/meteor/meteor into release-1.4.3.x 2017-03-30 02:15:20 +03:00
Ben Newman
fcbd398ab7 Appending module identifier extensions should not match directories.
This logic needed to change not only in meteor/tools/isobuild/resolver.js
but also in the runtime module system:
cfcc422725

Fixes #8539.
2017-03-29 18:50:41 -04:00
Jesse Rosenberger
3257bafc84 Change wrapFsFunc for "move" to acknowledge _both_ arguments as paths.
The `wrapFsFunc` function accepts an array of indexes indicating which
arguments are paths.  This is particularly important on Windows, due to
the path-conversation which takes place on those strings.

The docs say:
> Indices of arguments that have paths, these arguments will be
> converted to the correct OS slashes

This follows up on the change made from meteor/meteor#8491 which failed
in our release pipeline when publishing for the Windows architecture
for `1.4.4-rc.3`.
2017-03-30 01:46:42 +03:00
Jeremy Shimko
d49f3e2704 Use fs.move() from fs-extra to fix EXDEV cross device error in docker builds. (#8491)
Use fs.move to fix EXDEV cross device error in docker builds.

Fixes #7852.
2017-03-28 15:53:22 +03:00
Ben Newman
10127cea1f Fix modules test app now that exports.__esModule is non-enumerable.
3973bbad7f
2017-03-25 12:00:18 -04:00
Ben Newman
0eb52a1fd8 Upgrade meteor-babel to v0.19.1 and reify to v0.6.6. 2017-03-25 11:12:52 -04:00
Jesse Rosenberger
6bbd432081 Be more understanding of Windows' filesystem limitations.
Presently, the renaming of directories that are in-use will fail on
Windows.  This is already compensated for when `process.platform` is
set to `win32`.  However, within BashOnWindows/WSL (Windows Subsystem
for Linux), `process.platform` is equal to `linux`, though the
underlying filesystem is still the same.

Microsoft has stated that it is unlikely that they will remove
`Microsoft` from the `os.release()` value so we check for that.
2017-03-22 20:35:43 +02:00
Jesse Rosenberger
41cef97664 Automatically trim DEPLOY_HOSTNAME of leading/trailing spaces. (#8508)
This simple fix prevents the disappointment of trying to deploy your app
but failing because there's a space on the end of the `DEPLOY_HOSTNAME`
environment variable.

`process.env` always contains string values and assigning a property on
`process.env` implicitly converts the value to a string so it should not
be necessary to check if `typeof` is a `string`.

Fixes Dev Experience.
2017-03-22 12:50:28 -04:00
Ben Newman
d0f179b2f5 Merge pull request #8502 from hwillson/issue-6945
Updated the builder whitelist to allow "@" in filenames.
2017-03-22 12:50:28 -04:00
Jesse Rosenberger
17a786eb36 Ensure that .bin files maintain executable bits in Windows bundles.
Windows has no concept of the executable bit so it is not applied by the
`fstream` `Reader` when building the tarball which is used in both
`meteor build` and `meteor deploy`.  For Windows users, this causes
important scripts (such as `node-pre-gyp`) to not be executable when
the bundles are deployed to Unix platforms (such as Galaxy).

To avoid giving every file executable bits, this applies an executable
bit to the file only if it has read permission (something Windows _is_
aware of) and if it is in a location that Node bin links are typically
placed, the `/node_modules/.bin/` directories.
2017-03-21 12:19:08 -04:00
Ben Newman
da57ab69a8 Remove version constraints from modules test app.
This would have prevented this Circle CI self-test failure:
https://circleci.com/gh/meteor/meteor/3595#tests/containers/3
2017-03-16 13:08:06 -04:00
Ben Newman
89e1814f2e Merge branch 'devel' into use-babili-instead-of-uglify 2017-03-15 11:52:50 -04:00
Jesse Rosenberger
2f4e0124b0 Merge branch '20170303-dev-bundle-upgrades' into release-1.4.3.x 2017-03-09 17:33:28 +02:00
Jesse Rosenberger
511d43fe52 Upgrade versions of node-pre-gyp and node-gyp in the built bundle.
As a finishing move for ba06bf6eed, this
updates the versions of `node-pre-gyp` and `node-gyp` included in the
`meteor-dev-bundle`.
2017-03-09 17:19:04 +02:00
Jesse Rosenberger
c2c92b9b01 Allow malformed package.json when determining binary dependencies. (#8468)
We now check `package.json` in order to help make an educated decision
as to whether or not a package has binary dependencies which need to be
rebuilt.  In some cases, such as the `npmconf` npm which is included
as a dependency of `flow-router, the `package.json` is invalid (i.e.
empty), and we should silently permit this.

Fixes meteor/meteor#8427
2017-03-08 15:12:58 -05:00
Jesse Rosenberger
2d0fa6483e [dx] Provide warning when METEOR_SETTINGS are used in development. (#8458)
This is a developer experience (DX) change.

In production, the `METEOR_SETTINGS` environment variable is used to
pass parameters which will be available in the `Meteor.settings` within
the app.  However, `METEOR_SETTINGS` is ignored when using the
`meteor-tool` itself as in development, environment variables are
often less desirable.  Additionally, there would be no reactivity when
changing settings was necessary, instead requiring that the `meteor`
tool be restarted entirely.

On more than one occasion, developers have been confused as to why the
`METEOR_SETTINGS` are not respected in development.  To make it more
clear when this is attempted (and clarify that they will _not_ be used),
provide the a clear warning before ignoring the `METEOR_SETTINGS`
variable.

Aims to avoid meteor/meteor#8455.
2017-03-08 11:57:01 -05:00
Ben Newman
05f6705d15 Merge pull request #8431 from hwillson/issue-8154
Added CLI help text for meteor update --all-packages.
2017-03-08 11:40:17 -05:00
Ben Newman
b18b1e2755 Force garbage collection more aggressively during package DB sync.
This is an effort to keep the `meteor --get-ready` command from running
out of memory during Circle CI tests, as mentioned in this comment:
https://github.com/meteor/meteor/pull/8327#issuecomment-284431618
2017-03-06 20:34:56 -05:00
Ben Newman
ab0f9ba290 Force garbage collection more aggressively during meteor --get-ready.
This is an effort to keep the `meteor --get-ready` command from running
out of memory during Circle CI tests, as mentioned in this comment:
https://github.com/meteor/meteor/pull/8327#issuecomment-284431618
2017-03-06 20:34:56 -05:00
Jesse Rosenberger
513c270013 Add quotes around "meteor update" command. 2017-03-03 16:46:13 +02:00
Jesse Rosenberger
ad11a741bd Add brackets around package name.
To indicate that it's a variable, in the same way that `<target-version>` is notated (as well as other places in the `help.txt`).
2017-03-01 19:40:00 +02:00
Hugh Willson
8b431c6f80 Removed additional "newer versions" message reference; not needed. 2017-03-01 12:03:59 -05:00
Hugh Willson
148aeef2c9 Added paragraph explaining how to get extra information about packages that can't be updated. 2017-03-01 10:59:46 -05:00
Seth Murphy
be88d7772a Rebased off meteor/devel 2017-02-28 16:12:21 -05:00
David Glasser
adc468f670 Remove meteor npm install instruction (#8433)
As of #8108, `meteor create` runs `meteor npm install`, so it doesn't need to tell you do to do so.
2017-02-28 09:14:53 +02:00
Hugh Willson
3802addaae Added CLI help text for meteor update --all-packages. 2017-02-27 10:30:28 -05:00
Maciej Trębacz
e9c65b5608 Remove jQuery from default dependencies.
This commit removes jQuery package from default project skeletons.
2017-02-23 12:55:07 +02:00
dr.dimitru
dd548d998d Use process.version for generated README (#8379)
* Update generated README

 - Update node version in generated README file by bundler, according
to version from `.node_version.txt` file

* Use `process.version`

 - Minor file linting, one missed semicolon, one unnecessary semicolon
2017-02-23 12:08:09 +02:00
tcastelli
907e1d9183 Update help text to clarify the use of external npm commands (#8355)
* Update help text to clarify the use of external npm commands

First attempt to improve the help text regarding the external npm commands that can be run directly with 'meteor'.
#8277
Further enhancements could include listing also the "current" available external commands by parsing a ls/dir command or 'meteor npm list -g -depth 0'. If they command is uninstalled between the call of 'meteor help' and 'meteor <external command>' we are not the ones to be blamed but the user instead :)

* Update 'external command' to 'npm command'

* Joining new suggestions and cleaning some redundancy

Included @abernix suggestions (with some variations) to include references to npm and node. Also clarified how to install a npm package and run it afterwards

* Typo

Changed to global context

* Reword description of "other" npm commands

These commands are similar to `node` and `npm`, but we didn't want
them to be confused with `npm command` commands.

* Avoid repetition of `meteor npm install --global`
2017-02-15 15:46:53 -05:00
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