Skip to content

Adds nested directory output using option --inputContext - #31

Closed
vbalcom wants to merge 1 commit into
postcss:masterfrom
vbalcom:master
Closed

vbalcom wants to merge 1 commit into
postcss:masterfrom
vbalcom:master

Conversation

@vbalcom

@vbalcom vbalcom commented Jun 24, 2016

Copy link
Copy Markdown

--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

pekim commented Aug 6, 2016

Copy link
Copy Markdown

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

pekim commented Aug 6, 2016

Copy link
Copy Markdown

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

Comment thread Makefile Outdated
test-context \
test-replace \
test-local-plugins
# $(patsubst %,test/build/%.css,$(TESTS)) \

Copy link
Copy Markdown
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
Copy Markdown
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

RyanZim commented Aug 18, 2016

Copy link
Copy Markdown
Collaborator

@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

vbalcom commented Aug 18, 2016

Copy link
Copy Markdown
Author

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

@RyanZim

RyanZim commented Aug 18, 2016

Copy link
Copy Markdown
Collaborator

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

Hirse commented Jan 23, 2017

Copy link
Copy Markdown

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

RyanZim commented Jan 23, 2017

Copy link
Copy Markdown
Collaborator

@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

Hirse commented Jan 23, 2017

Copy link
Copy Markdown

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

RyanZim commented Jan 23, 2017

Copy link
Copy Markdown
Collaborator

@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
Copy Markdown

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

@RyanZim

RyanZim commented Mar 27, 2017

Copy link
Copy Markdown
Collaborator

@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

RyanZim commented Apr 19, 2017

Copy link
Copy Markdown
Collaborator

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