-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Default to ./
when no <src>
and support -
as stdin
#348
Conversation
./
when no <src>
and support -
as stdin
./
when no <src>
and support -
as stdin
1b30a9a
to
9948a05
Compare
9948a05
to
ac4de8b
Compare
I'm highly concerned about such a change: 1 2 Default API, aka On the other end the 3 4 Possible solution |
I totally agree with you @pascalduez. After some time away from this issue, I have a new idea on how to integrate this to the CLI without messing with the streaming API (I should really have thought of this earlier). In the CLI: let filter = handler(env);
filter.promise.then(cb);
pipe(
sources,
recurse(),
exclude(env.exclude || []),
converter({ from: 'sass', to: 'scss' }),
filter
).resume(); This way, there's no change to be done in the streaming API, and I'm also okay with just having a special case where one single |
pipe(
sources,
recurse(),
exclude(env.exclude || []),
converter({ from: 'sass', to: 'scss' }),
filter
).resume(); Looks great ! |
I think I was also a bit stubborn with my idea and didn't accorded enough attention to your suggestions. :/ Anyway, it's all much clear after leaving the issue for a night and coming with a fresh mind again! |
src
#347Usage:
This implies streamlining the behavior of
sassdoc(src)
and.pipe(sassdoc())
, especially supportingrecurse
,exclude
andconverter
in the streaming version.While I think it's good to have the same behavior in both usages, it's maybe harmful for plugins usage?
Anyway, we're about to release 2.0 and this feature have not been heavily tested, so it's not a good idea to merge it right away.
Though, we need to be concerned about not breaking the API, that is, if we plan to have this default
./
and-
support in 2.0, we need to at least add the default directory and drop thestdin
support before releasing 2.0.But I'm afraid the behavior streamlining between
sassdoc(src)
and.pipe(sassdoc())
can be considered as a breaking change too, and if we want this, we might not be able to use it until 3.0.Note: according to #347, this PR is missing a default exclude pattern when using the CWD (to not documentize
node_modules
and other vendor directories, and I'd also avoid documenting the destination directory if it's contained in CWD, even if it's not supposed to contain Sass files).Opinions?