Commit Graph

31 Commits

Author SHA1 Message Date
Slava Kim
0ad58dec92 Stylus imports lookup should respect sources-stack 2015-07-24 12:05:23 -07:00
Slava Kim
7e8de86bba In Stylus resolve relative paths with path.join 2015-07-24 11:34:08 -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
Slava Kim
b4e90047f5 fix a misuse of getPackageName in stylus 2015-07-21 17:29:57 -07:00
Slava Kim
a41dcbbd66 Add some Windows-specific paths hacks to less/stylus 2015-07-21 17:15:44 -07:00
Slava Kim
f8beb3c5ed Disable caching in stylus npm module
We do caching ourselves and the caching in stylus is broken in regards to sourcemaps: https://github.com/stylus/stylus/issues/1953
2015-07-21 10:19:27 -07:00
David Glasser
05f92dd504 Port Stylus to MultiFileCachingCompiler
Now it has a disk cache too!
2015-07-21 03:53:13 -07:00
Slava Kim
053dfaf4c5 Fix a caching bug in stylus 2015-07-19 22:48:40 -07:00
Slava Kim
d9e047994f Fix bugs in stylus importer
Such as failing to import libs like 'nib'
2015-07-19 22:37:42 -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
David Glasser
68b8455345 fix archMatching typo 2015-07-16 00:45:26 -07:00
David Glasser
3a678154d9 Change stylus too 2015-07-16 00:34:50 -07:00
Slava Kim
b470105b5f Invalidate stylus cache based on the contents
because it breaks our sourcemaps paths
2015-07-15 18:56:02 -07:00
David Glasser
5a17a2064b Mostly tweak comments
Replace "XXX BBP" with more specific #BBPFoo
2015-07-15 13:33:51 -07:00
David Greenspan
a10513eec5 Treat main.styl files like *.main.styl files
Same idea as previous commit about LESS

Tried it and it works.
2015-07-07 14:40:04 -07:00
Slava Kim
9d610e8d26 Prefer source-maps in memory in a parsed JSON form 2015-07-06 15:25:11 -07:00
David Glasser
2bcabf8fcd add missing var 2015-06-29 21:13:53 -07:00
Slava Kim
8281b32465 Implement lru in-memory caching for stylus 2015-06-29 15:23:51 -07:00
David Glasser
638a42ddaa escape { in regexp
It appears to work without the escape, but it's not valid according to
ES5 or ES6 (`{` is not a PatternCharacter).
2015-06-26 21:59:42 -07:00
Slava Kim
584e8b59cf Fix sourcemaps for Stylus 2015-06-25 12:15:46 -07:00
Slava Kim
1a016e2f00 Use a const symbol 2015-06-24 18:38:47 -07:00
Slava Kim
b73c94c82b Implement relative imports in stylus 2015-06-24 15:23:35 -07:00
Slava Kim
d786da29c9 WIP stylus package 2015-06-23 18:35:40 -07:00
David Glasser
d7be19b356 comments about other registerSourceHandler calls 2015-06-09 00:04:08 -07:00
David Glasser
ddc3657e4f Watch files which fail before emitting a resource
Regression introduced by the CSS watching code (specifically, f230eba62)
by the sourceIsWatched check. We need to be able to tell the difference
between "source handler didn't do anything because there was an error"
and "source handler didn't do anything because it's web-specific and
this is an os arch".

A simple fix would have been to interpret compileStep.error as
"sourceIsWatched = true", but I didn't think of that until after doing
it the slightly more complicated but more precise way :)

Also, ensure that if the runner rebuilds the client and there's an
error, it properly kills the app process (and the watchers and the
keepalive interval, etc).
2014-08-04 21:32:22 -07:00
Matthew Arbesfeld
8bcbd65344 Separate "browser" target into web.browser/cordova
Cordova projects often have a different set of files than web targets,
so we would like to be able to target different client architectures in
our bundles. Ideally, we allow the user to use arbitrary client
architectures - but this patch is a step in the right direction by
abstracting out more of the hard coded "browser"/"os" lines.

We accomplish this separation in a backwards compatible way by allowing
api.___ commands to target a "client" architecture. For example,
api.addFiles('a.js', 'client') adds 'a.js' to both the 'client.browser'
and 'client.cordova' targets.

Effects on 0.9 packaging stuff: packages don't have to change, but the
"data.json" file in ".meteor0" has "browser" in some places. We think we
have to fix the troposphere code where this data.json is created.

Some plugins will also be backwards-incompatible with this change, since
many have a "clientArch.matches("browser")" line in the plugin
code. Ideally, we fix plugins so that this stops being an issue, but for
now package authors can just patch that line.

At the compiled (unipackage) level the new names are 'web.browser' and
'web.cordova', replacing 'browser'. In package.js, the new names are
'client.browser' and 'client.cordova', serving as an adjunct to 'client'.
2014-07-31 14:12:15 -07:00
Maxime Quandalle
cf11139f6c Add a .import.styl handler to prevent Meteor processing a stylus file Fix #462 2014-02-03 21:58:29 -08:00
David Glasser
c3d1f7bbd2 Don't fail if stylus or less files are in a non-client-specific place.
Make the plugin's arch check less sketchy.

Improve less and stylus error handling.
2013-08-02 15:16:53 -07:00
Geoff Schmidt
dae3ddf50b Port 'stylus' package to new plugin api 2013-05-13 11:52:43 -07:00