Commit Graph

819 Commits

Author SHA1 Message Date
David Glasser
d9fff9b981 Clean up a test so the next test doesn't fail
For some reason I decided that tests should, on cleanup, stop their
runs *and not wait for the stop to take effect* before running the next
test. Maybe this could be reconsidered but for now, explicitly stop this
run (and wait) so the next test (npm: npm) doesn't fail.
2015-07-16 14:27:48 -07:00
David Glasser
9bda5a5bb1 remove unnecessary metadata files 2015-07-16 14:24:44 -07:00
David Glasser
c8d4d0c722 Use our babel configuration in old tests
Now old tests pass again :)
2015-07-16 14:22:10 -07:00
Slava Kim
dcf0a3a9f2 Add a test of custom minifiers 2015-07-16 14:03:19 -07:00
David Glasser
cf737183ca Change import subdirectory name to 'imports'
@dgreensp:

    The more I think about it, the more I don't like naming a directory
    after a singular noun like `import`.  We have `packages/` already,
    and I want to put my modules in a directory called `modules/`, not
    `module/`, just like I don't want to put my assets in `asset/`, or
    my stylesheets in `stylesheet/`, etc.  It's ok to have a singular
    suffix and a plural directory name: to have `.import` files go in
    `imports` or `.template` files go in `templates`.  Directory names
    like `doc` and `lib` follow an old Unix convention of three-letter
    names.  And if the `import` directory name is actually a verb, not a
    noun, that is confusing because putting files in the `import`
    directory does not import them.  It just causes them to be
    considered imports (noun).
2015-07-16 12:48:53 -07:00
Slava Kim
c1e7f76d38 Fix the CSS splitting test 2015-07-16 11:12:24 -07:00
David Glasser
f9ac25dd6b use new names in stylus test 2015-07-16 00:45:05 -07:00
David Glasser
bdf1968ceb Change less heuristic back to default-process
In addition to the old `*.lessimport` and `*.import.less` mechanisms for
telling the `less` package that a file isn't a root, you can also put it
in an `import` subdirectory or pass `{isImport: true}` to
`api.addFiles`. We no longer will need to rename every less file when we
upgrade.

Next commit will revert the changes to examples and docs.
2015-07-16 00:29:19 -07:00
Slava Kim
c0cf8b078b A WIP test to check CSS splitting in minifier working 2015-07-15 19:15:33 -07:00
David Glasser
67091efe7c Remove js-analyze special case
js-analyze is a tiny wrapper around esprima and escope. We don't use it
anywhere but in the tool. We even already use esprima in the tool
elsewhere.

It creates a fair amount of additional complexity. None of the other
isopackets are used as part of the isopack-building process, so it has a
bunch of random special case code for it.
2015-07-15 14:17:53 -07:00
David Glasser
53038bf544 test getExtension() === null 2015-07-15 00:30:29 -07:00
David Glasser
bb0880c381 Fix and test registerCompiler addAsset 2015-07-14 23:55:49 -07:00
David Glasser
95b4b8f0b0 clean up error handling around linters
There were a few problems here:

- compiler.lint actually did things that could seriously fail (eg loading
  plugins) but used its buildmessage context to return *linter
  warnings*. So actual errors got lumped in with warnings and didn't
  prevent builds.  Fixed this by changing compiler.lint to return linter
  warnings as a return value and use its implicit buildmessage context
  only for build errors

- We weren't checking for errors after compiler.getMinifiers even though
  that loaded plugins and could fail

- We were using _.isEmpty(app.sourceProcessors.linter) to decide in
  lintBundle if we should say "no linter warnings" or "no linters were
  run", but this is a SourceProcessorSet now, not a dictionary, so we
  should have used the isEmpty method instead (so we were getting
  unnecessary "No linting errors" messages when there were no linters)

- compiler.compile still tried to run getSourcesFunc even if
  initializing the SourceProcessorSets failed

- Printing linter warnings in the runner looked different depending on
  whether it was right after doing a client refresh or not

- We were doing a temporary log of "Linting your app" and immediately
  logging "Linted your app". The point of temporary logs is to display
  while long processes run, but since linting is integrated, this didn't
  really make sense.  (Really we need to better integrate the progress
  bar and runlog, since progress fulfills most of the needs formerly
  done by the runlog.)
2015-07-14 23:28:23 -07:00
David Glasser
0629678414 Use registerCompiler via isobuild:compiler-plugin
Previously, registerCompiler was enabled by the *real* package
`compiler-plugin`, which arranged to only be available in versions of
the tool that support registerCompiler via... well, mostly via wishful
thinking.

Now this is implemented via a fake package called
isobuild:compiler-plugin. "isobuild" is a real Atmosphere organization
that will never publish any packages. The tool pretends that packages
isobuild:compiler-plugin@1.0.0, isobuild:linter-plugin@1.0.0, and
isobuild:minifier-plugin@1.0.0 exist, and carefully arranges for them to
be avoided in the actual process of building and app; they just are
referenced in Version Solver.

When we add future features like this, users of this version of Meteor
who try to depend on packages that need the feature will get a nice
error message pointing to
https://github.com/meteor/meteor/wiki/Isobuild-Feature-Packages

Users of current versions of Meteor who try to depend on packages that
require isobuild:compiler-plugin will get a slightly confusing message
about isobuild:compiler-plugin not existing.  Users of current versions
of Meteor who try to depend on packages only some of whose versions
require isobuild:compiler-plugin will get a version that doesn't require
it.
2015-07-14 10:30:42 -07:00
David Glasser
66e8b7bcfc fix run --once test 2015-07-13 16:14:59 -07:00
Slava Kim
8900a8abfd WIP fixing minifiers 2015-07-13 15:59:13 -07:00
David Glasser
4163ceb544 Remove 'claim' tests
claim is a command related to the transition of 'meteor deploy' from
passwords to Meteor Accounts in Feb 2014. I already removed the real
tests of claim 8 months ago in 27d67fe because they were too slow. The
remaining tests test error cases and tend to fail due to Meteor
Developer Accounts being slow. Might as well remove; they don't test
anything we really care about.
2015-07-13 15:10:18 -07:00
David Glasser
0d1e51bf6f Fix bundler-options old test 2015-07-13 14:30:31 -07:00
David Glasser
830a5cb86a fix bundler-assets test 2015-07-13 13:56:59 -07:00
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
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
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
David Glasser
03881da858 rename test file 2015-07-10 09:33:48 -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
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
51296bbd39 add test app missing from 70cc03cfbf 2015-07-06 19:36:47 -07:00
David Glasser
70cc03cfbf catch errors running registerCompiler callback
also, add XXX comments about the (very old) issue that source map
filenames are wrong for plugin files
2015-06-30 02:23:44 -07:00
David Glasser
ef04a21dfd better error if published source has no handler 2015-06-30 01:38:37 -07:00
David Glasser
05366ab5c2 fix duplicate compiler extension errors
There are a few different times when we detect duplicate compiler
extensions.
(a) We detect them in Plugin.registerCompiler if a single
    isopack itself registers duplicate extensions.
(b) When compiling a unibuild in compiler.compile, we check to see if a unibuild's
    plugin-providing dependencies overlap.
(c) When preparing a unibuild for bundle-time source processing, we
    check the same condition.

(Why do we need to re-check in (c)? If a unibuild was published and
passed (b) at publish time but is being bundled with different versions
of dependencies, it might fail (c).)

There were a few fixes here:

- In compiler.js (b), if we detected a duplicate extension, the code to get
  the name of the conflict package was wrong and could throw.
- In compiler-plugin (c), we just weren't using buildmessage.

With just those fixes, we would actually see *both* kind of errors show
up if the error was in the app rather than a package, because
bundler.bundle didn't actually bail out on error after compiler.compile!
So we added that fix too, with a relatively conservative WatchSet.
2015-06-30 01:18:05 -07:00
David Glasser
fc87db45ac test disk cache 2015-06-30 00:21:11 -07:00
David Glasser
dd548edd72 less: better error for unknown @import
also, fix coffee/less self-test
2015-06-30 00:09:42 -07:00
Slava Kim
8281b32465 Implement lru in-memory caching for stylus 2015-06-29 15:23:51 -07:00
David Glasser
61d4be9940 fix source map test for better world
"app/" in stack traces was an artifact of how we lay out files in the
built server, not how the source files are laid out, and isn't actually
as good as just using the source file name.  Slava improved this on this
branch by just using the real file name. So the test (newly merged from
devel) needs to be improved to match.

While we're at it, let's test for filenames in a package.
2015-06-27 00:00:24 -07:00
David Glasser
919be97b6f Merge branch 'devel' into batch-plugins
Resolves these conflicts:
	meteor
	scripts/dev-bundle-server-package.js
	scripts/dev-bundle-tool-package.js
	tools/files.js

This requires building a new dev bundle, and moving the wrapCallSite
thing to source-map-retriever-stack.js.
2015-06-26 23:24:56 -07:00
Sashko Stubailo
adaa64efd0 Remove unnecessary comment 2015-06-26 19:43:58 -07:00
David Glasser
f59380a6cf Include package naming path in plugin errors
This accidentally got lost along with other improvements in b556e62.
Fortunately Sashko's tests for the ES6-tool work caught it!
2015-06-25 16:08:22 -07:00
David Glasser
55c06e584d Fix missing var 2015-06-25 15:03:23 -07:00
Slava Kim
a2a8013032 A self-test for testing stylus 2015-06-24 20:27:57 -07:00
Sashko Stubailo
86e616e593 Add app that I forgot to add in the last commit 2015-06-23 21:32:13 -07:00
Sashko Stubailo
1d0a429afc Add test for source map of build plugin 2015-06-23 21:16:13 -07:00
Sashko Stubailo
312663db67 Transpile the Meteor command line tool with Babel
- Uses Ben's meteor-babel npm package that has a default config
- From a checkout, uses the meteor-babel/register module and compiles at runtime
- When meteor-tool is published, precompiles the files
- Adds tests to make sure source maps work everywhere
2015-06-23 14:32:49 -04:00
Slava Kim
3c7a86fc3c Tests for minifiers errors 2015-06-16 11:57:29 -07:00
David Glasser
c7f7dcb4fb comment tweaks 2015-06-15 17:12:19 -07:00
David Glasser
6470edf82a Fix tests broken by b6348d49
Since we no longer statically analyze app code, a syntax error in app JS
is now a run-time error, not a build-time error, which broke those
tests.  We still do some parsing on CSS as part of mergeCss, so bad CSS
will serve the same purpose.
2015-06-12 17:07:15 -07:00
David Glasser
02b3263961 implement (bad) cache for less too
but the magic of plugin-provided caching is that making the cache better
doesn't involve touching tools!
2015-06-09 12:40:35 -07:00
David Glasser
44c815a955 coffee uses on-disk cache
Also combine the two coffee registerCompiler calls into one

it's a bad on-disk cache that should be improved to not write out all
the unchanged files every time too.  but the tests do show that it skips
the unnecessary recompile

less doesn't use an on-disk cache yet
2015-06-09 12:33:46 -07:00