Commit Graph

4662 Commits

Author SHA1 Message Date
David Glasser
7cbdebf847 Fix minify option in cordova and old bundler tests
Rename 'mode' and 'minify' to 'minifyMode' consistently (including in
minifier plugin API).

Make minifyMode default to 'development' (fixes some other old bundler
tests).

This doesn't make bundler-assets pass but it gets farther along.
2015-07-13 13:45:22 -07:00
David Glasser
9ddaec1162 Fix bad ES2015 rest-args update
Fixes test "releases: download and springboard to pre-0.9.0 release"
2015-07-13 12:31:04 -07:00
David Glasser
d2bcb625f7 tropohouse colon conversion should keep isopack-1
because it's not actually upgrading to isopack-2!

Fixes test "packages with colons is converted on Windows".
2015-07-13 12:07:03 -07:00
David Glasser
6443a693ba Skip tropohouse colon converter on new packages
It's not necessary, and at least a few months ago when we added
isopack-2 I thought it might corrupt things.
2015-07-13 12:07:03 -07:00
Slava Kim
e164d39663 Add standard-minifiers to mocked catalog for tests
fixes a test failure: releases
2015-07-13 12:00:37 -07:00
Slava Kim
43a86ebbee Fix the linting command for a single package
and adjust the test to reflect that we should get an output for Cordova too
2015-07-13 11:41:38 -07:00
David Glasser
e579de45dd Fix legacy handlers. Fixes build-errors test
Note that this test started as a test of parseStack when a filename
contained a colon, and it no longer tests that since around 1.1 we
started trying to avoid putting colons in generated filenames for
Windows compatibility. But it still caught this legacy handler bug!
2015-07-11 18:04:20 -07:00
David Glasser
d28bb9750e fix autoupdate self-test 2015-07-11 17:56:19 -07:00
David Glasser
0b8b04c516 fix non-runner bundler calls 2015-07-11 16:32:16 -07:00
David Glasser
24909c6e06 fix a linter test 2015-07-11 00:45:12 -07:00
Slava Kim
d6ae4b8a1f Tests for linting 2015-07-10 20:37:07 -07:00
Slava Kim
1dccd48d03 An attempt in extending meteor lint to packages
Doesn't work so far for an unknown reason.
2015-07-10 20:32:34 -07:00
Slava Kim
a7df73c33d New commands option: requiresAppOrPackage 2015-07-10 20:31:58 -07:00
Slava Kim
e18373341e Don't print linting status if no linting is done 2015-07-10 17:56:37 -07:00
Slava Kim
2175d40a04 Use startsWith method from utils 2015-07-10 14:25:57 -07:00
Slava Kim
b8dab44426 Reset builder's buildPath on broken folder 2015-07-10 14:25:57 -07:00
David Glasser
8f45f1a004 Merge branch 'devel' into batch-plugins 2015-07-10 14:19:46 -07:00
David Glasser
6f8abbf068 Return exit code 1 from meteor lint
Exit codes are 0-255 in Unix; there is no -1. Also there's no reason to
use the fancy throw ExitWithCode in the top-level command, which can
just return.
2015-07-10 12:09:52 -07:00
Sashko Stubailo
ca2c88b901 Fix Console import 2015-07-10 11:35:10 -07:00
David Glasser
03881da858 rename test file 2015-07-10 09:33:48 -07:00
Slava Kim
d8dd548b3b Clarify the "fix up" comment for sub-builders 2015-07-09 17:58:46 -07:00
Slava Kim
84439d7eb3 More comments for previousBuilder 2015-07-09 17:42:22 -07:00
Slava Kim
9002bb870e Clean up old files and directories in builder dir
.. after an in-place rebuild
2015-07-09 17:33:22 -07:00
David Glasser
21cdb7f305 Small cleanup in linting 2015-07-09 16:44:55 -07:00
David Glasser
640ab28544 Improve linting of packages
- Only lint packages when we're actually going to use the output
- The linter adds the files it uses to the corresponding unibuild WatchSets
2015-07-09 16:39:57 -07:00
David Glasser
b1183b5059 Assets in packages must be explicitly declared
In the past, `api.addFiles('foo.gif')` would make foo.gif an asset if
there was no extension handler for gif active.  In fact, it would make
it a dual client/server asset even if that was unintentional.

This led to a few problems:
(a) People often left out 'client' and ended up packaging an unnecessary
    second server copy of the asset
(b) The implementation meant that `api.addFiles('foo.css')` would actually
    add foo.css as a static asset on the server (this was already fixed
    on batch-plugins via explicitly looking for wrong-arch
    classifications)
(c) Now that we have linters, if a file is used by a linter but not by a
    compiler (eg linter config files), there was no way to say in a
    package "add this file, but just for linters, don't make it a static
    asset too".

These are only really issues in packages, not apps.  In apps, we avoid
them by only marking things as static assets if they are in public or
private (and not letting those things be considered as other kinds of
sources).

This is a backwards-incompatible change, but it does not affect apps or
published packages, just packages built from source.
2015-07-09 15:17:56 -07:00
David Glasser
8684c2afbe use getActivePluginPackages more 2015-07-09 14:51:14 -07:00
David Glasser
a3dae6110a WIP on pushing watchset into runLinters
and avoiding doing so on other-arch files

but we may end up having to do this another way
2015-07-09 14:22:42 -07:00
David Glasser
396a2038f3 Filenames registered by plugins can start with dot
(Or other things in bundler.ignoreFiles)
2015-07-09 11:48:04 -07:00
David Glasser
0ca6f72be4 WatchSet dirs list filenames that override exclude
This will be used to let extensions register for (eg) `.jshintrc` and
override the default "nothing starting with a dot counts".
2015-07-09 11:27:01 -07:00
David Glasser
9b3254b9f9 _.once is wrong for getSourcesFunc
We added it to make the use of getSourcesFunc by the linter more
efficient, but the linter is actually looking for a different set of
files than the compiler!
2015-07-09 10:56:59 -07:00
David Glasser
1e17c2b17e Fix eslint warnings 2015-07-09 10:49:57 -07:00
David Glasser
b75064f689 Merge branch 'devel' into batch-plugins 2015-07-09 10:48:30 -07:00
Sashko Stubailo
6932f66140 Add require statement for Console to files.js 2015-07-09 10:19:17 -07:00
David Greenspan
c09fea8e48 Grammar fix in skel
should be "minifiers [that are] run for production mode"
2015-07-08 23:51:34 -07:00
David Glasser
ea45e6a9f1 Allow plugins to register specific filenames
This is in addition to registering for extensions. Note that only the
new SourceProcessor APIs allow this, not registerSourceHandler.

The filename in question is the basename of the file.  The file can be
found in any directory in any package.  If you want to be more picky,
you can just ignore other ones in your processFilesForTarget.

This introduces the SourceProcessorSet abstraction, which simplifies a
lot of repeated code around matching filenames with processors and
avoiding duplicates.

Missing tests.

See also #3985.
2015-07-08 17:23:31 -07:00
David Glasser
8ccef83036 rename to APP_PRELINK_CACHE
because it is only for apps
2015-07-07 18:27:01 -07:00
David Glasser
dd35c60d69 use object spread instead of mutating _.extend 2015-07-07 18:26:30 -07:00
David Glasser
51296bbd39 add test app missing from 70cc03cfbf 2015-07-06 19:36:47 -07:00
Slava Kim
9d610e8d26 Prefer source-maps in memory in a parsed JSON form 2015-07-06 15:25:11 -07:00
David Greenspan
ed822326aa Reuse previous Constraint Solver result in tool
If the same ProjectContext calls the PackagesResolver
multiple times and the ConstraintSolver.Input structure
is identical, reuse the same answer.  We still ask the
tool for the catalog data, which currently goes to sqlite
(taking ~70ms in the app tested), but we skip creating a
CS.Solver and a Logic.Solver and running them (~450ms).

Note that if a new ProjectContext is created (not sure when
that happens?), there's no caching across that.
2015-07-06 14:54:08 -07:00
Slava Kim
bb940f3de6 Don't add anti-XSSI header to source-maps in devel
Saves a tiny bit of time rebuilding.

150-300ms on the benchmark.
2015-07-06 02:06:04 -07:00
Slava Kim
65d2a641d0 Add profiling to sha1 2015-07-06 01:13:00 -07:00
Slava Kim
1931a9f169 Add the filtering feature to tool-profiler reports
If the METEOR_PROFILE env variable is set to a number, it would be used
a filter bound for reporting.

Useful to eliminate the noise of small and fast functions.

Ex.: `env METEOR_PROFILE=100 ./meteor` will only print sections that
took more than 100ms to complete.
2015-07-06 01:10:17 -07:00
Slava Kim
318b41f5a9 Add a cache layer for individually prelinked files
This helps especially for app files changes:

- usually a file is changed alone, the imports are not changed
- the changed imports do not affect individually prelinked files (thus "prelink")
- there is no point re-prelinking all files when one is changed

Saves 400ms on an internal benchmark for a mobile edu app
2015-07-05 23:49:30 -07:00
Slava Kim
ec64433df7 Prefer renaming in builder ...
.. rather than unlinking old file and writing over. This way it is atomic.
2015-07-05 21:28:46 -07:00
Slava Kim
edf3be0d21 Remove debug log 2015-07-05 20:35:00 -07:00
Slava Kim
a3841479eb Reuse Builder's from previous iterations
An optimization to avoid writing the same files over and over again.
Tested only on Mac OS X.

There is a potential problem with this approach on Windows, since the
way processes retain open files is different.

On Linux (and I assume, OS X, too), when a process has a file open, it
reads the file from a memory snapshot loaded by OS. The OS also would
increment the reference count for that file, so even if it is unlinked
from the FS, OS would still keep it available as long as the process
keeps it open.

When we want to replace a file under a running Meteor app process, we
first delete the old built file and then write a new file to the same
path. In my understanding, it would force the OS to assign a different
inode for the new file, so the old file and the new file will be
different. Then, we either restart the app process, or signal it to
reload its assets, so it reads the new files, releasing the older ones.

I need to verify this understanding with somebody who actually knows how
OS and FS work.
2015-07-05 13:22:32 -07:00
Ben Newman
e3da8603b5 Make sure runner.extraRunners is an array. 2015-07-05 12:38:33 -04:00
Ben Newman
af5f608a36 Fix some ESLint errors in tools/run-all.js. 2015-07-01 11:32:46 -04:00