Skip to content
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

Adds nested directory output using option --inputContext #31

Closed
wants to merge 1 commit into from

Conversation

vbalcom
Copy link

@vbalcom vbalcom commented Jun 24, 2016

--inputContext: Optional declaration of parent folder for input when --dir is used and an input glob may return nested directories. When applied, --input glob will be relative to --inputContext and folder structure inside --inputContext will be mimicked in --dir

@pekim
Copy link

pekim commented Aug 6, 2016

If input is **/*.css, this works nicely. However if it is something like src/window/**/*.css (which should match multiple files) there seems to be a problem with the resulting value of input.

      inputPath = input.replace( argv.inputContext, '' );
                       ^

TypeError: Cannot read property 'replace' of undefined
    at compile (/home/mike/projects/mixlac2/node_modules/postcss-cli/index.js:183:24)
    at arrayEach (/home/mike/projects/mixlac2/node_modules/neo-async/lib/async.js:3468:9)
    at Object.each (/home/mike/projects/mixlac2/node_modules/neo-async/lib/async.js:4178:9)
    at Object.<anonymous> (/home/mike/projects/mixlac2/node_modules/postcss-cli/index.js:147:7)

@pekim
Copy link

pekim commented Aug 6, 2016

Sorry, ignore that. I wasn't understanding the meaning of context.

test-replace \
test-local-plugins
# $(patsubst %,test/build/%.css,$(TESTS)) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vbalcom Why is this commented out?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had commented the line out because it was failing (and failing fast), therefore not reaching my new test task. This shouldn't have made it into the commit. I'll un-comment the line and update my pull request. Thanks for catching it!

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2016

@vbalcom There is a typo in the commit message for 5fc007e6d6bab:

output dir will represent nested folder structures found from a blobbed input.

Perhaps this should be squashed into one or two commits.

@vbalcom
Copy link
Author

vbalcom commented Aug 18, 2016

@RyanZim Agreed, I'll spruce this up and re-submit a pull request this evening.

@RyanZim
Copy link
Collaborator

RyanZim commented Aug 18, 2016

If you can figure out what's causing the tests to fail, that would be great.

… output dir will represent nested folder structures found from a blobbed input.
@Hirse
Copy link

Hirse commented Jan 23, 2017

This looks like the missing feature I was looking for in the CLI.
Is there any chance that this could be merged soon?
@RyanZim It looks like the test run through now.

@RyanZim
Copy link
Collaborator

RyanZim commented Jan 23, 2017

@Hirse We are currently in the middle of a full rewrite of the codebase for v3. This feature will have to be totally reimplemented for the v3 codebase. I haven't closed this PR as a reminder to consider porting this to v3+

@Hirse
Copy link

Hirse commented Jan 23, 2017

Do you have an estimated release date for v3?
If it will still take a while, it would be great to merge this for v2 anyway.

I would really love to have this feature, as my decision to use postcss for an Angular 2 project (which has distributed CSS in the folder hierarchy) depends on it.

@RyanZim
Copy link
Collaborator

RyanZim commented Jan 23, 2017

@Hirse I hate to set a date for it, but you can track progress here: https://github.com/postcss/postcss-cli/projects/1 & https://github.com/postcss/postcss-cli/milestone/1. Probably early February, though.

@mstoltenburg
Copy link

Any news on this? I would really love to use this feature.

@RyanZim
Copy link
Collaborator

RyanZim commented Mar 27, 2017

@mstoltenburg We need to add this ability, and --inputContext is the best proposal I've seen so far. PR welcome to reimplement this for the v3 codebase.

@RyanZim
Copy link
Collaborator

RyanZim commented Apr 19, 2017

Superseded by #121

@RyanZim RyanZim closed this Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants