Commit Graph

142 Commits

Author SHA1 Message Date
Martijn Walraven
a5b49b8aa4 Exit when running platforms are removed or plugins changed 2015-08-26 19:26:54 +02:00
Sashko Stubailo
ab4edb1cbf Add package to make test pass 2015-08-06 17:09:26 -07:00
David Greenspan
2c36e9efb0 Oops, commit missing files from self-test app 2015-08-06 16:49:27 -07:00
David Greenspan
a63dc1f5c2 Support prodOnly in addition to debugOnly
It's very useful to be able to include code only in production.  It's
useful for React integration, but presumably also for many apps.

* Add prodOnly boolean flag alongside debugOnly in Package.describe

* Packages the set prodOnly to true auto-depend on isobuild:prod-only
  (making them error in the old tool where prodOnly isn't supported)

* The `includeDebug` boolean build option is replaced by a string
  named buildMode, which can be 'development' or 'production', just
  like minifyMode.

Tested by self-test.
2015-08-06 16:49:26 -07:00
Sashko Stubailo
a315eca4d7 Fix test and parse stack 2015-08-06 16:41:19 -07:00
Sashko Stubailo
ff79737c81 Add DDP dep to package 2015-08-06 16:41:19 -07:00
Sashko Stubailo
0c2e76d780 Add package dep to linting app 2015-08-06 16:41:19 -07:00
Sashko Stubailo
90f36cc3eb Fix the hot code push tests by adding packages 2015-08-06 16:20:08 -07:00
Sashko Stubailo
3403b4c77f Fix test that used session 2015-08-06 16:20:08 -07:00
Slava Kim
a1f54a54ae Fix tests missing the blaze packages 2015-08-06 14:11:12 -07:00
Sashko Stubailo
e237c9890c Remove versions file 2015-08-05 15:17:18 -07:00
Sashko Stubailo
a50095b2a6 Remove lots of mentions of meteor-platform in tests 2015-08-05 15:15:13 -07:00
Slava Kim
35aef2b296 Create 'static-assets' folder in tools
To keep files that are not run by tool itself, but are used by generated code.
2015-07-31 17:12:38 -07:00
Sashko Stubailo
ec33215a7f Static HTML package and templating refactor
1. Make a package called `static-html` that just compiles `<head>` and `<body>` tags inside `.html` files. Much like templating but without the templates.
2. Refactor `templating` to avoid duplicating code.

Split out code that would be shared between `templating` and `static-html` into a new `templating-tools` package. These tools could also be used to simplify implementation of other build plugins, like `simple:markdown-templating`.

This also has the added benefit of moving as much code as humanly possible out of the `templating` package, so that it can be reused in other packages.

1. `templating-tools` package and its README
2. `static-html` package and its README
3. `caching-html-compiler` is not new code; it is just code factored out of the batch plugin version of `templating`, but the README and some comments are new.

1. `tools/tests/static-html.js` tests static html and error handling
2. `templating-tools/html-scanner-tests.js` tests `scanHtmlForTags` and `compileTagsWithSpacebars` together.

All unit tests pass on this branch.
2015-07-31 10:40:23 -07:00
David Glasser
a850cd82f0 Revert test file removed in 9bda5a5bb
This was needed for 'run: update package during run'
2015-07-24 16:19:22 -07:00
Slava Kim
95ae655c4e Expose wrapped fs functions for plugins
Unlike the wrapped files.* functions, files.fsFixPath is closer to fs.*
in API or async/sync and callbacks.
2015-07-23 18:10:27 -07:00
Slava Kim
173bfb7c03 Expose and use wrapped fs/path moduldes in Plugins 2015-07-23 13:10:26 -07:00
David Glasser
6789daf571 Fix stylus bugs and test it
It now runs basically the same caching test as 'less'.

The implementation has been made to be a bit more like 'less'; eg, using
empty string instead of `__app__` to mean the app, and consistently
making pathInPackage not start with a slash.
2015-07-21 18:59:15 -07:00
David Glasser
3e70c7319b Separate coffee and less self-tests 2015-07-21 17:29:22 -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
b5b91562ca meteor publish lints the package and its deps
with tests
2015-07-16 17:50:09 -07:00
David Glasser
9bda5a5bb1 remove unnecessary metadata files 2015-07-16 14:24:44 -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
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
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
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
Slava Kim
d6ae4b8a1f Tests for linting 2015-07-10 20:37:07 -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
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
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
cef1a77691 test caching for local plugins 2015-06-09 00:02:34 -07:00
David Glasser
774b9754ec Test less caching, and improve client refresh
Specifically, ensure that we don't even include client-specific files in
the server WatchSet by making sure we pass a precise set of extensions
to initFromAppDir.  We still also rule out wrong-arch files at a later
stage too (because sourceExtensions only affects initFromAppDir).

Without the change to compiler.js, the final test (adding
yet-another-root.main.less) restarts the server rather than printing
"Client modified -- refreshing".
2015-06-08 22:41:55 -07:00