Commit Graph

43 Commits

Author SHA1 Message Date
Paulo Mogollón
2ae2690f3a Convert tools/utils/archinfo.js to TypeScript. (#10624)
* Updated code to use modern JS
* Added types
* Stopped using 2 underscore functions (1 remaining)
2019-07-21 12:01:24 -04:00
Ben Newman
5ed64fb1db Remove explicit .js extension from tools/fs/files imports. 2019-07-04 10:32:09 -04:00
Ben Newman
c96278700d Fix compiler plugins self-tests by waiting for lazy compilation to finish. 2018-10-31 10:41:31 -04:00
Ben Newman
9f7ef9cdb1 Fix compiler plugins caching self-test for the stylus plugin. 2018-06-26 13:09:37 -04:00
Ben Newman
f7f3d34181 Mark non-isRoot files lazy in MultiFileCachingCompiler.
The concept of a "root" file is specific to MultiFileCachingCompiler, so
we need to normalize it into a representation that makes sense to the rest
of the compiler plugin system.

Should help with #10014.
2018-06-26 13:09:14 -04:00
Ben Newman
74a55ff107 Fix addAsset tests now that /__browser.legacy/ prefix no longer used. 2018-04-27 12:47:35 -04:00
Ben Newman
29e48758df Merge branch 'devel' into release-1.6.2 2018-01-31 18:26:12 -05:00
Hugh Willson
540dc00230 Add a self-test skip option (#9579)
* Add a self-test skip option

Meteor's CI infrastructure is configured to exclude certain
`self-test`'s on each run. These excludes are specified in
each CI environment's config file, and included when running
`meteor self-test`. Developers running `meteor self-test`
locally however are not using these excludes by default,
so developer's have to manually look up the current exclude
list from one of the CI configs, then add these excludes to
their own `meteor self-test` call manually.

This commit adds a new `skip` option to Meteor's `self-test`
system, that can be used to skip adding/running a defined
`self-test` (similar in concept to Mocha's `skip` feature).
This provides a way to skip the running of older
`self-test`'s that are no longer needed, but allows them to
be preserved in the `self-test` suite, for future reference.
With this functionality in place, and the older test suites
updated to use it, Meteor's base CI excludes no longer need
to be maintained in their respective config files. The
excludes are all managed at the source (the test definition),
and can be leveraged by anyone/anything calling
`meteor self-test`.

* Log message describing skipped test

* Add manually-ignored count to self-test summary

* Small comment correction

* History.md entry with PR link
2018-01-29 14:25:09 +02:00
Ben Newman
8ccbe3baa0 Avoid breaking backwards compatibility for asset URLs. 2018-01-22 18:07:55 -05:00
Ben Newman
c300f65859 Fix "compiler plugins caching" self-tests for web.browser.legacy. 2018-01-22 18:07:38 -05:00
Ben Newman
05ef0a6602 Fix compiler plugins self-tests for web.browser.legacy. 2018-01-22 17:56:54 -05:00
Ben Newman
697a918dc3 Fix tests for now-deprecated stylus package.
The last version of stylus published did not contain a version of the
caching-compiler package that these tests now depend on, so I've removed
the extra architecture matching for the stylus package (not for less).
2018-01-14 16:09:54 -05:00
Ben Newman
5d22e1d25f Fix/strengthen "compiler plugins caching" self-tests.
To fix #9528, we included more information (the target architecture) in
cache keys for files compiled by CachedCoffeeScriptCompiler. Although this
change was right and necessary, it altered the caching behavior tested by
this self-test. Specifically, .coffee files must now be recompiled for the
os.* architecture, whereas previously code compiled for web.browser could
be accidentally reused on the server.
2018-01-14 16:09:49 -05:00
Hugh Willson
8da6c84eac Update the default CSS parsing/combining/minifying tools (#9263)
* Update the default CSS parsing/combining/minifying tools

The `minifier-css` package is currently using outdated
(and abandoned) npm packages (`css-parse` and `css-stringify`),
as part of its parsing/minification process. This commit
replaces those packages with the robust, modern and maintained
`postcss` package.

* Adjust CSS source file fallback value

* Self test adjustments and cleanup

* Disable sourcesContent generation by postcss

The `standard-minifier-css` package is already associating
source content with the source map, so we don't need to
do this twice.

* Add History.md entry covering backwards compatibility details

* Bump major version due to backwards compatibility breaking changes

* Bump minor versions

* Code review changes (boolean formatting, concat to spread)
2017-11-22 11:13:54 -05:00
Ben Newman
3a5a52e869 Merge branch 'devel' into release-1.6 2017-09-20 16:36:41 -04:00
Ben Newman
069d3dffe7 Additional timeout for duplicate extension compiler plugins test. 2017-09-20 16:33:52 -04:00
Ben Newman
0b9ea6e2c5 Merge branch 'release-1.5.2' into release-1.6 2017-08-11 15:52:26 -04:00
Ben Newman
56aea02723 Stop setting METEOR_WATCH_PRIORITIZE_CHANGED=false in self-tests.
Assuming #9007 fixes the file watcher timing problems, it should no longer
be necessary to disable the optimizations of #8866.
2017-08-11 15:21:50 -04:00
Ben Newman
4f90c54d1a Merge branch 'release-1.5.2' into release-1.6 2017-07-28 16:44:24 -04:00
Simon Fridlund
a1c2eefb1e Add mongo-dev-server package (#8853)
* Add mongo-dev-server package

Only start the MongoDB server if this package
is present in the project.

* Small layout/formatting adjustments; updated README.

* Allow tests using fake-mongod to start (fake) Mongo.

* Adjust test stdout matching to be less sensitive to ordering.

* Add `mongo-dev-server` History.md entry.

* Remove mongo start check since the tested for error prevents mongo startup.

* Remove README traling whitespace.

* Bump mongo package version.
2017-07-26 20:08:12 +03:00
Simon Fridlund
4d37a05fb3 Add mongo-dev-server package (#8853)
* Add mongo-dev-server package

Only start the MongoDB server if this package
is present in the project.

* Small layout/formatting adjustments; updated README.

* Allow tests using fake-mongod to start (fake) Mongo.

* Adjust test stdout matching to be less sensitive to ordering.

* Add `mongo-dev-server` History.md entry.

* Remove mongo start check since the tested for error prevents mongo startup.

* Remove README traling whitespace.

* Bump mongo package version.
2017-07-26 18:08:00 +03:00
Ben Newman
5146864012 Merge branch 'release-1.5.1' into release-1.6 2017-07-10 13:22:45 -04:00
Ben Newman
86eedd4bc6 Make METEOR_WATCH_PRIORITIZE_CHANGED opt-out instead of opt-in.
This restores the behavior of 8c70716954 by
default, with the option of disabling the prioritized file watching system
by setting METEOR_WATCH_PRIORITIZE_CHANGED explicitly to "false".

The self-tests where the environment variable is explicitly set form a
nice to-do list of tests that should be improved to be more robust to cope
with differences in file watcher timing.

Helps with #8648 and similar issues.
2017-07-10 12:31:11 -04:00
Ben Newman
355558d28a Additional timeout for compiler plugin caching tests. 2017-06-27 19:22:04 -04:00
Ben Newman
d8c0739a13 Make some matches in compiler-plugins.js test order-insensitive.
Also increased various timeouts to make tests more reliable.
2016-11-01 19:38:08 -04:00
Ben Newman
dfd477568f Fix test failure by tolerating different line/column numbers. 2016-10-07 18:56:13 -04:00
Ben Newman
18df026cad Fix less caching self-test (#6982). 2016-05-06 12:07:25 -04:00
Sashko Stubailo
dd2f166fe9 Don't throw an error when using deprecated package asset API
Fixes #5458
2015-10-21 14:34:20 -07:00
Sashko Stubailo
0bb7c7c0b2 New addAssets package.js API; same file can be source and asset
1. Add `addAssets` API to `package.js`
2. Rename `getSourcesFunc` to `getFiles` in internal code
3. Changed `PackageAPI#sources` to `PackageAPI#files` with a new structure that
   has separate objects for assets and sources
4. Added some tests for different error conditions
5. The same file can now be a source and an asset
2015-09-02 13:14:02 -07:00
Slava Kim
39d8aef3d9 move files into console/ tool-testing/ 2015-08-06 16:39:00 -07:00
Slava Kim
6b1bb038d8 Move files into tools/fs 2015-08-03 22:09:28 -07:00
Slava Kim
8a8db83d29 Move files into tools/utils 2015-08-03 20:32:38 -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
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
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
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
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
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
03881da858 rename test file 2015-07-10 09:33:48 -07:00