Commit Graph

4709 Commits

Author SHA1 Message Date
Ben Newman
5bbcaedc01 Allow source processors to be registered for .js files.
We now fall back to hardcoded JS support only when no source processor is
registered, instead of simply ignoring .js source processors.
2015-07-16 18:02:07 -04:00
Ben Newman
181f7c1c93 Use the ecmascript package for all new packages. 2015-07-16 18:02:07 -04:00
Ben Newman
9088eb2b4d Install the ecmascript package by default for all new apps.
It's tempting to rewrite the skeletal .js file using ES2015+ syntax, but
that would effectively prevent the ecmascript package from being removed.
2015-07-16 18:02:07 -04:00
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
dfd287b0a3 Merge branch 'devel' into batch-plugins
Fix conflicts and continue elimination of startsWith/endsWith
2015-07-16 12:52:21 -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
Ben Newman
0679da7cf4 Use String#{starts,ends}With instead of ad-hoc utility functions. 2015-07-16 13:54:12 -04:00
Ben Newman
01526d30ab Install ES2015 String polyfills in tool code, too. 2015-07-16 13:37:42 -04:00
David Glasser
2e34ec1933 Merge branch 'devel' into batch-plugins 2015-07-16 00:47:15 -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
David Glasser
92bd8f98d2 Check for empty SourceProcessorSet correctly
Similar to a fix in 95b4b8f0b. "Linted your app. No linting errors." was
being incorrectly printed in cases with no linters.
2015-07-15 23:24:44 -07:00
David Glasser
1ce0b009bd Fix Plugin.registerSourceHandler('x', null) crash
This is bad use of the API, but mquandalle:bower does it, and since
we're deprecating this API anyway, no reason to arbitrarily break that package.
2015-07-15 23:22:01 -07:00
David Glasser
ced06d50f5 A missed spot to parse sourceMaps
Follow-up to 9d610e8d

Without this, a read/write JsImage (eg plugin) roundtrip would end up
writing escaped JSON to the map file!
2015-07-15 23:00:43 -07:00
Slava Kim
c0cf8b078b A WIP test to check CSS splitting in minifier working 2015-07-15 19:15:33 -07:00
Ben Newman
1702e8a164 Globally polyfill ES2015-compliant Map and Set constructors for tool code.
Using these collections with for-of loops also requires a global Symbol
polyfill.
2015-07-15 18:57:20 -04: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
5a17a2064b Mostly tweak comments
Replace "XXX BBP" with more specific #BBPFoo
2015-07-15 13:33:51 -07:00
David Glasser
53038bf544 test getExtension() === null 2015-07-15 00:30:29 -07:00
David Glasser
19177cd778 mostly comments 2015-07-15 00:20:17 -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
1a71752f8b Don't allow slashes in extensions/filenames
These go to watch's addDirectory which considers trailing slashes to
mean directories, but plugins can't process directories
2015-07-14 23:18:54 -07:00
David Glasser
5dab967dab missing default argument 2015-07-14 21:54:30 -07:00
David Glasser
772034d176 Change linter API name to processFilesForPackage
Linters run on one package at a time rather than one target at a
time. This is mostly because they need to run outside the context of
apps in various places (eg when you publish the package, though that's
currently unimplemented).
2015-07-14 21:46:21 -07:00
David Glasser
4c2359feff Explain why minifiers is client-only
And drop an ignored `minifyMode: 'development'`
2015-07-14 21:26:00 -07:00
David Glasser
7d53e53a4a Add a comment about isopack.isobuildFeatures 2015-07-14 20:30:56 -07:00
David Glasser
7a219989cc Clean up classifyFilename
- Make the return value be an object with class (and more error
  checking)

- Rename legacyHandler type to legacy-handler (to match wrong-arch)

- Fix `isTempate` typo which probably broke loadOrderSort for legacy
  handlers
2015-07-14 20:25:25 -07:00
David Glasser
ed55018477 Fix crash on Windows in meteor mongo
Fixes #4711.
2015-07-14 16:02:28 -07:00
Slava Kim
325e97cd5d Clean up 4b9dde2d23 2015-07-14 15:57:51 -07:00
Spacemixup
4b9dde2d23 Add version constraint info to "meteor add" in tools/help.txt 2015-07-14 15:50:42 -07:00
David Glasser
0ee631b070 Avoid null sourceMapRoot in program.json
tropohouse._extractAndConvert assumes that any sourceMapRoot here is a
string or is missing. We started making it null recently on devel but
that means if it gets published this way, existing Windows tools will
crash on colon conversion.
2015-07-14 15:29:58 -07:00
Slava Kim
0f8bf23c92 trailing whitespace 2015-07-14 14:00:54 -07:00
David Glasser
5659b111b2 Merge branch 'devel' into batch-plugins 2015-07-14 11:21:20 -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
David Glasser
f331295316 remove debug line 2015-07-13 16:14:45 -07:00
David Glasser
7c469f4858 Document isAsset option to api.addFiles
... now that it's required to add assets in packages.
2015-07-13 16:00:05 -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
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