Commit Graph

4736 Commits

Author SHA1 Message Date
David Glasser
3e70c7319b Separate coffee and less self-tests 2015-07-21 17:29:22 -07:00
Martijn Walraven
a862d84142 Fix process.env modify in place bug and extract currentEnvWithPathsAdded and getCurrentNodeBinDir 2015-07-21 17:23:09 -07:00
David Glasser
b28e8d452b proxy: on error, only send 503 if headers not sent
Otherwise there's an ugly "Can't render headers after they are sent to
the client" crash.

Fixes #4253. Fixes #4750.
2015-07-21 13:52:18 -07:00
David Glasser
efbe277309 Factor cache logic out of less
And improve the cache (now in MultiFileCachingCompiler) to not rewrite
the whole cache on every operation
2015-07-21 02:49:20 -07:00
David Glasser
1c6acba777 build plugin doc comment tweaks 2015-07-20 23:46:22 -07:00
Ben Newman
3b99659986 Upgrade dev bundle meteor-{promise,babel} to latest versions.
The breaking change in the latest version is that the Fiber constructor is
no longer included as a meteor-promise dependency, but must be supplied by
assigning to Promise.Fiber.
2015-07-20 22:47:34 -04:00
Slava Kim
a359c72509 Public docs comments for register{Compiler,Minifier,Linter} 2015-07-20 19:44:35 -07:00
Slava Kim
685c1cc510 Add a doc comment for getExtension 2015-07-20 19:26:55 -07:00
David Glasser
f7ee0ba385 new caching-compiler package
Implements caching for single-file compilers (those that don't implement
'import' directives) as a superclass, CachingCompiler.

Used in coffeescript and templating.
2015-07-20 15:29:37 -07:00
Martijn Walraven
67c1a3a525 Temporary fix until Cordova respects program.json 2015-07-20 11:41:54 -07:00
David Glasser
0c383d124d fix meteor update --packages-only in checkout
If you're running from a checkout but your project has a non-none
release file, the release file should always be ignored. But this one
bit of code (basing the package update code on the post-update release)
paid attention to it anyway.  This tended to lead to a lot of errors
like:

  No version of webapp satisfies all constraints: @=1.2.1, @=1.2.0
2015-07-17 15:00:49 -07:00
Slava Kim
65a04ede0f Rename Minifier interface -> processFilesForBundle
processFilesForTarget -> processFilesForBundle

Since the minifiers work on the output of compilers and linkers, there
is no a good definition of a "target" there. "Bundle" is a general term
that we use to describe the whole compiled app with all the packages.
2015-07-17 14:57:34 -07:00
Slava Kim
b5229354cb Internal comment doc for registerMinifier 2015-07-17 14:39:18 -07:00
Slava Kim
fffe709d0c More internal docs comments for registerCompiler/registerLinter 2015-07-17 14:18:07 -07:00
Joseph Orbegoso Pea
6247309daa Document debugOnly option for Package.describe. 2015-07-17 13:29:25 -07:00
David Glasser
1bd6c5839e Port coffeescript compiler to ES2015
Next step is factoring out the cache logic into its own package, which
might be done as an ES2015 superclass (though maybe not).
2015-07-17 01:23:52 -07:00
David Glasser
a35fcf4705 Improve coffeescript on-disk cache
Minimize unnecessary reads and writes
2015-07-17 00:45:48 -07:00
David Glasser
f59cf85740 Prepare to build Node 0.10.40 2015-07-16 21:58:14 -07:00
David Glasser
5e0fefa912 Better linker error detection/caching
Fixes 3 issues:

- The error detection code in linker.fullLink was buggy.The goal of this
  code was to convert an error from findAssignedGlobals into empty
  linked output. But buildmessage.jobHasMessages() wasn't precise
  enough; if a much larger job had any errors, linker.fullLink would
  incorrectly return empty linked output here. (Worse, it got cached in
  memory, so the incorrect result would recur on future links!) The fix
  is to make the scope of the error detection more targeted.

- OK, now it's OK to cache error outputs from linker.fullLink, because
  they're at least only occuring on real errors, right?  Wrong... we
  shouldn't cache the error return value without also caching the *error
  itself*. In this case, we just change the cache to not cache erroneous
  outputs at all (though we could have instead saved the error and
  rethrown it if we got it again).

- When mutating the File to pretend it was empty, we should keep the
  sourceHash up to date. (This doesn't seem to be directly causing any
  bugs but can't hurt.)

Fixes #4591.
2015-07-16 21:48:29 -07:00
David Glasser
9030339a1d Use pre-existing build process for publish's lint 2015-07-16 20:55:29 -07:00
David Glasser
9dbad78d45 meteor lint in a package lints only that package
Also, fix the checks around "did we lint anything": checking
isopack.sourceProcessors.linter just checks to see if that package
itself defines any linter, not if any of the packages it uses has
linters.
2015-07-16 20:43:42 -07:00
David Glasser
580841d073 Don't create redundant PackageSource for lint 2015-07-16 20:21:17 -07:00
David Glasser
bdab562b8c Fix old cli tests (converted) 2015-07-16 19:50:05 -07:00
Slava Kim
34eee28f99 Update help text for meteor publish 2015-07-16 17:50:09 -07:00
Slava Kim
b5b91562ca meteor publish lints the package and its deps
with tests
2015-07-16 17:50:09 -07:00
David Glasser
2ccaf6a51e Move some files into isobuild subdirectory
The exact borderline between "Isobuild" and "the tool" is a little hazy,
but the idea is that "Isobuild" is the part that you could imagine being
embedded in a non-command-line build tool. It's not about commands or
UI, but just about building packages and apps.

A next step could be moving things that are strictly "the command-line
tool" into their own subdir, and leaving the top directory mostly just
for shared utilities like buildmessage.  (Which could even go in a utils
subdir?)
2015-07-16 15:12:36 -07:00
Ben Newman
e8a32f48e1 Don't write legacy builds when using new-style compiler plugins.
Also decompose Isopack.prototype._canWriteLegacyBuilds.
2015-07-16 18:02:08 -04:00
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