Commit Graph

6954 Commits

Author SHA1 Message Date
Ben Newman
38f570abc0 Ensure npm scripts find correct meteor executable. (#9941)
In my local development environment, the `meteor` command resolves to my
Meteor checkout, and I use `~/.meteor/meteor` explicitly when I want to run
a released version of Meteor.

If I run

  ~/.meteor/meteor npm test

and the `package.json` file defines an npm `test` script that refers to
`meteor`, in my environment this `meteor` won't be the same as the one I
used to run `~/.meteor/meteor npm test`, which can introduce weirdness
such as pinning the versions of packages in `meteor/packages/non-core`,
and all the usual Meteor version inconsistency risks.

This commit fixes that problem by prepending the directory that contains
the `meteor` (or `meteor.bat`) executable to the `PATH` before running
`meteor npm ...` commands.
2018-06-05 13:06:51 -04:00
Ben Newman
6b7df3fb0d When checking for existing builds, tolerate web.browser.legacy better.
This is a follow-up to b4a68e99c1, which
allowed obtaining a simplified list of build architectures (without
web.browser.legacy) by calling isopack.buildArchitectures(true), which was
helpful for matching existing builds of packages that were published
before the web.browser.legacy architecture was introduced in Meteor 1.7.

Now that some packages have been published with the web.browser.legacy
architecture as part of the Meteor 1.7 release, it's important to try
matching the full unsimplified list of architectures, while still falling
back to the simplified list for other packages.
2018-05-29 18:13:19 -04:00
Ben Newman
7f9706d0f2 Revert "Stop scanning node_modules directories in PackageSource#_findSources. (#9825)"
This reverts commit c5302bb2ba.

Based on conversation with @KoenLav, it seems this optimization was more
of a breaking change than anticipated, and the workaround of creating a
symbolic link to induce compilation is not just annoying on Windows but
also does not satisfy the goal of being able to import from node_modules
(as before) rather than importing via the symbolic link.

We will need to revisit this pitfall in Meteor 1.7.1, but it's important
to unbreak it ASAP in Meteor 1.7.0.1 (since 1.7 is unfortunately final).

https://github.com/meteor/meteor/pull/9826#issuecomment-392596129
https://github.com/mozfet/meteor-autoform-materialize/issues/43

For apps that are accidentally compiling too many LESS or SCSS files, the
recommended workaround (for now) is to add the offending directories
and/or files to a .meteorignore file.
2018-05-29 16:20:30 -04:00
Ben Newman
0fcf29eaee Update modules test app to Meteor 1.7. 2018-05-27 20:38:01 -04:00
Ben Newman
ad4f30c684 Lift process.env access to module scope.
https://github.com/meteor/meteor/pull/9911#pullrequestreview-123587003
2018-05-27 11:13:47 -04:00
Christian Klaussner
797f9ce78e Allow METEOR_FILE_WATCH_COALESCE to override file watcher delay (#9911) 2018-05-27 11:11:36 -04:00
Ben Newman
6407e4dafb Update meteor-babel to version 7.0.0-beta.49-1.
Also switching from babelOptions.sourceMap to babelOptions.sourceMaps,
finally: https://babeljs.io/docs/usage/api/#options
2018-05-25 18:43:13 -04:00
Ben Newman
5ac27341f7 Update @babel/runtime for new app skeletons to 7.0.0-beta.48. 2018-05-24 23:04:42 -04:00
Ben Newman
e3bac92c82 Strip //# sourceMappingURL comments for files without source maps.
https://github.com/meteor/meteor/issues/9894#issuecomment-391101074

Fixes #9894.
2018-05-23 19:19:05 -04:00
Ben Newman
d64e87b852 Bump LINKER_CACHE_SALT and compiler.BUILT_BY for good measure. 2018-05-16 20:43:26 -04:00
Ben Newman
a76e6da686 Update help text about minimal starter app to deemphasize emptiness. 2018-05-16 17:47:19 -04:00
Ben Newman
af9a0e183f Include "Learn Meteor!" links in minimial starter app HTML. 2018-05-16 17:31:59 -04:00
Ben Newman
10e69ee84d Include actual CSS in default starter app. 2018-05-16 17:31:37 -04:00
Ben Newman
c88b888275 Demonstrate basic server-side rendering in minimal starter app.
Now that the meteor/server-render package is lazy on the client, it adds
no weight to the client JavaScript bundle unless imported.
2018-05-16 17:22:12 -04:00
Ben Newman
c29b191a42 Make the minimal starter application follow best practices. 2018-05-16 15:20:38 -04:00
Ben Newman
b830665a1f Expose App.settings in mobile-config.js rather than Settings.
Follow-up to #9873.
2018-05-16 12:45:07 -04:00
Jan Owsiany
b35aab6c55 Expose Meteor settings inside mobile-config.js (#9873) 2018-05-16 12:22:38 -04:00
Ben Newman
124e334a95 Update meteor-babel and @babel/runtime to version 7.0.0-beta.47. 2018-05-16 12:16:28 -04:00
Ben Newman
8273eb84e3 Avoid calling files.readlink if target not a symbolic link. 2018-05-14 14:17:46 -04:00
zodern
903cd3c8b9 Fix creating symlinks on Windows April 2018 Update (#9887) 2018-05-14 11:20:56 -04:00
Ben Newman
5aab6d2a12 Avoid caching Resolver on PackageSourceBatch, but cache node_modules paths.
Now that getResolver takes options, it seems inappropriate to cache only
the first resolver created, since multiple resolvers might be created with
different options.

Fortunately, caching Resolver objects is not strictly necessary (even for
performance), since Resolver.getOrCreate already caches based on the
options it receives.

The only other meaningful work PackageSourceBatch#getResolver was doing
was computing the nodeModulesPaths option, so I've cached that.
2018-05-12 13:29:09 -04:00
Ben Newman
dbdadc1b11 Avoid using "browser" field of package.json for inputFile.resolve.
Fixes #9870.
2018-05-12 12:43:54 -04:00
Ben Newman
1b17025cd4 Tolerate missing files in Builder#_ensureDirectory.
Fixes #9882.
2018-05-12 11:40:01 -04:00
Ben Newman
1892633dba Avoid unnecessary files.{rm_recursive,symlink} in symlinkWithOverwrite.
When we copy node_modules directories during rebuilds, we try to create
symlinks instead of doing a full recursive copy. Very often, however, the
symlinks already exist, and they point to the right location already, so
we can avoid recreating them for even better performance.

Another optimization identified by using the qualia:profile package
created by @veered: https://atmospherejs.com/qualia/profile
2018-05-10 14:27:44 -04:00
Ben Newman
b7579ad100 Update modules test app to Meteor 1.7-rc.5. 2018-05-09 19:12:13 -04:00
Ben Newman
a8b6accb11 Set .babel-cache directory correctly for command-line tool.
This depends on new functionality in meteor-babel@7.0.0-beta.46-3:
d5d2bbf81e
dea6465daf
2018-05-09 16:16:05 -04:00
Ben Newman
81248867aa Update meteor-node-stubs to version 0.4.1.
This only affects newly created applications for now, but developers can
update to the latest meteor-node-stubs by running

  meteor npm install meteor-node-stubs@latest

https://github.com/meteor/node-stubs/issues/15
2018-05-08 12:56:03 -04:00
Ben Newman
7baaf19020 Report an error when meteor.mainModule cannot be resolved.
https://github.com/meteor/meteor/pull/9826#issuecomment-387172568
2018-05-07 18:48:38 -04:00
Ben Newman
a0842f70f6 Expose Cordova assets with and without /__cordova URL prefix.
Related to #9776.
Fixes #9782.
2018-05-03 19:12:01 -04:00
Ben Newman
0d6fbba203 Make sure minimal apps depend directly on meteor package.
All Meteor packages implicitly depend on the meteor package, and the
meteor-base package implies the meteor package for most Meteor apps, but
the new minimal skeleton does not use meteor-base, so minimal Meteor apps
were not directly depending on the meteor package.

The only reason this mattered was that the meteor package registers a
default compiler plugin for CSS files, and compiler plugins only apply if
an app or package directly depends on them (or depends on a package that
implies them, such as meteor-base).

In other words, this change reenables support for raw CSS files for
minimal apps.
2018-05-01 15:15:00 -04:00
Ben Newman
d6c8a96bda Refine URL prefix logic to exclude just web.browser[.legacy].
This still leaves web.cordova as the only architecture whose URLs get
prefixed (with /__cordova/), but the implementation better reflects the
special status of web.browser and web.browser.legacy as architectures that
the webapp and dynamic-import packages understand how to disambiguate
using the isModern test from the modern-browsers package.
2018-04-29 10:06:08 -04:00
Ben Newman
7e5e5b9fa1 Restrict URL prefixing to web.cordova URLs.
Now that webapp can differentiate between modern and legacy browsers when
serving static files, without relying on URL prefixes, in principle we
shouldn't have to use prefixes for any URLs except Cordova ones.
2018-04-29 09:58:08 -04:00
Ben Newman
229fc24aad Go back to prefixing asset URLs with /__{browser.legacy,cordova,...}.
https://github.com/meteor/meteor/pull/9776#issuecomment-385180806
2018-04-28 11:20:25 -04:00
Ben Newman
74a55ff107 Fix addAsset tests now that /__browser.legacy/ prefix no longer used. 2018-04-27 12:47:35 -04:00
Kevin Newman
06f9f78277 Avoid the need to rewrite URLs in appcache, by avoiding adding the prefix at build time for assets 2018-04-27 09:47:21 -04:00
Jesse Rosenberger
2248019824 Merge branch 'devel' into release-1.7 2018-04-26 11:45:58 +03:00
Cyrille Colin
498f5d32dd [cordova] add resource-file to mobile-config (#9748)
* add resource-file to mobile-config

* Fix typo in addResourceFile documentation header

* get filename with path.parse instead of split

* Code formatting adjustments
2018-04-26 11:26:18 +03:00
Ben Newman
dcd01aceba Merge branch 'devel' into release-1.7 2018-04-25 18:22:00 -04:00
Ben Newman
986b47d1c4 Update meteor-babel to version 7.0.0-beta.46. (#9840) 2018-04-25 18:15:29 -04:00
Ben Newman
6be0514eaf Add modern-browsers to self-test sandbox root packages list. 2018-04-25 11:39:30 -04:00
Ben Newman
76e03f51f3 Update remaining mentions of Meteor 1.6.2 to 1.7. 2018-04-25 10:09:51 -04:00
Ben Newman
e2f7754b9b Disable SQLite journal_mode=TRUNCATE to fix #9703.
https://github.com/meteor/meteor/issues/9703#issuecomment-383620007

We will reconsider this change in Meteor 1.7.1, but in the meantime the
METEOR_SQLITE_JOURNAL_MODE environment variable can be used to override
the default journal mode (WAL).

cc @brucejo75
2018-04-24 12:35:26 -04:00
Ben Newman
e1e2c2b490 Terminate SQLite database connection before springboarding.
https://github.com/meteor/meteor/issues/9703#issuecomment-383620007
2018-04-24 11:37:33 -04:00
Ben Newman
6bcf2fbee9 Default buildMode to development for meteor run command.
Another attempt to fix {debug,prod}Only package self-test failures:
https://circleci.com/gh/meteor/meteor/19960
2018-04-24 11:11:37 -04:00
Ben Newman
8b8f93fe03 Make {debug,prod}Only packages self-test more verbose. 2018-04-24 11:11:36 -04:00
Ben Newman
c032b9c271 Disable longjohn, since Node 8 now supports async stack traces. 2018-04-18 18:36:44 -04:00
Ben Newman
c8fc62f37e Add a package.json file to tools/tests/apps/package-tests. 2018-04-18 18:36:42 -04:00
Ben Newman
0d5de21001 Increase timeouts to fix {debug,prod}Only package self-tests. 2018-04-18 16:59:05 -04:00
Ben Newman
105bdd8fd7 Start marking some optimistic functions as disposable. 2018-04-18 16:32:01 -04:00
Ben Newman
c5302bb2ba Stop scanning node_modules directories in PackageSource#_findSources. (#9825)
This functionality was originally intended to allow importing
compiled-to-JS modules from `node_modules`, by precompiling any modules
found in top-level npm packages, as long as a Meteor compiler plugin was
registered for the module's file extension.

As discussed in #9800, this extra compilation burden can be non-trivial,
especially if you happen to install an npm package such as `less`, which
contains hundreds of `.less` files in the `node_modules/less/test/`
directory.

More generally, this functionality was an early attempt to enable
selective compilation of `node_modules` directories, but it was not a good
solution to that problem, because in almost all cases the extra
compilation was unwanted.

Meteor 1.7 (formerly known as 1.6.2) will give full control over selective
compilation of `node_modules` back to the application developer (#9771),
which should afford a much better solution to this problem. If you've
installed some `.less` or `.scss` or `.ts` files from npm into your
`node_modules` directory, just create a symlink to the package directory
within your application, and those modules will be compiled and become
importable by other JS modules, as if they were part of the application.
2018-04-18 16:19:55 -04:00