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

Support multiple configuration files. #67

Merged
merged 1 commit into from
Jul 25, 2016
Merged

Support multiple configuration files. #67

merged 1 commit into from
Jul 25, 2016

Conversation

sttk
Copy link
Contributor

@sttk sttk commented Mar 23, 2016

This is the PR about #8.
Please review.

@phated
Copy link
Member

phated commented Mar 23, 2016

Thanks @sttk - I am currently wrapping up some contract work and should have time to review this soon

var fs = require('fs');

var homedir;
if (os.homedir) {
Copy link
Member

Choose a reason for hiding this comment

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

@phated
Copy link
Member

phated commented Mar 29, 2016

@sttk this PR looks really cool but there's a ton of code in here. I made some cursory comments on ways to reduce the code and allow me to focus on the logic. I think another thing that would help would be to have tests written out instead of generated from the fixture you created.

@@ -2,7 +2,8 @@ language: node_js
node_js:
- "0.10"
- "0.12"
- "iojs"
- "4"
- "stable"
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, I would rather see 5 here.

Copy link
Member

@phated phated Mar 29, 2016

Choose a reason for hiding this comment

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

I like to keep this as stable (I wish we could reference LTS instead of 4 also). This is the pattern used in all the gulpjs repos

@sttk
Copy link
Contributor Author

sttk commented Mar 29, 2016

@phated @jonschlinkert @tusbar Thank you all for reviewing and advising. I'll modify all of what you pointed out.

@jonschlinkert I will use parse-filepath, is-absolute!

@phated I welcome the further pointed out. And I expect a better way of testing. Thanks.

@phated
Copy link
Member

phated commented Mar 29, 2016

@sttk awesome, thanks. Let me know when the updates are done.

@sttk
Copy link
Contributor Author

sttk commented Apr 3, 2016

I've finished modifying the codes.

I stopped using glob and fs.existsSync is used simply. So case sensitivity of file paths is platform-dependent. (I may tackle this later.)

var isAbsolutePath = require('is-absolute');
var parsePath = require('parse-filepath');

function isWindows() {
Copy link
Member

Choose a reason for hiding this comment

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

this can't change, so it should probably just be a variable defined here var isWindows = process.platform === 'win32'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've modified it.

@sttk
Copy link
Contributor Author

sttk commented Jun 19, 2016

I've finished modifying!

this.emit('requireFail', attempt.moduleName, attempt.error);
} else {
this.emit('require', attempt.moduleName, attempt.module);
registerLoader(this.extensions, configPath, cwd, this);
Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend moving the this from the last argument to the first. Maybe this function signature is getting too complex and should be changed to an object with each argument as a property. @tkellen thoughts?

@phated
Copy link
Member

phated commented Jun 21, 2016

@sttk except for my few notes and questions, this looks great!

@sttk
Copy link
Contributor Author

sttk commented Jun 24, 2016

@phated Thank you for pointing out. I rebased and reflected changes of master. In addition, I modified something that you pointed out above and I could do immediately.

@phated
Copy link
Member

phated commented Jul 11, 2016

@sttk sorry for the delayed review. This looks amazing. Can you believe that you reduced the PR to 300 lines of code (most of it being tests)? I'd love to get @tkellen and/or @jonschlinkert to review before I click the merge button.

};
};

// use rechoir to autoload any required modules
function registerLoader(eventEmitter, extensions, configPath, cwd) {
Copy link

Choose a reason for hiding this comment

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

this should be in lib/register_loader.js. ideally it'd be unit tested, too!

@tkellen
Copy link

tkellen commented Jul 12, 2016

Incredible work @sttk. If you have the appetite to address my final concern in this PR, awesome. If you'd rather do that as a separate PR after this is landed and published, I'm down with that too.

@tkellen
Copy link

tkellen commented Jul 12, 2016

PS: Thank you!!

@sttk
Copy link
Contributor Author

sttk commented Jul 12, 2016

@tkellen Thank you for reviewing. I'll address what you pointed out in this PR.

@sttk
Copy link
Contributor Author

sttk commented Jul 16, 2016

I've separated registerLoader and unit tested it.

@jonschlinkert jonschlinkert mentioned this pull request Jul 18, 2016
@phated
Copy link
Member

phated commented Jul 18, 2016

@sttk this looks great! Can you rebase one last time? I merged an update to the findup-sync module and it conflicts with some of your changes. Once you rebase, I'll merge this in the next couple of days (I'd like to make sure the findup-sync change isn't causing problems before bumping again).

@sttk
Copy link
Contributor Author

sttk commented Jul 20, 2016

@phated I've rebased.

@phated
Copy link
Member

phated commented Jul 25, 2016

@tkellen I'm looking to ship this today, you good with me doing that?

@tkellen
Copy link

tkellen commented Jul 25, 2016

:shipit:

@phated phated merged commit 61efcae into gulpjs:master Jul 25, 2016
@phated
Copy link
Member

phated commented Jul 25, 2016

@sttk thank you so much for your hard work on this! I'm going to be adding docs and then publishing this feature.

@sttk
Copy link
Contributor Author

sttk commented Jul 25, 2016

Thank you very much!!

@phated
Copy link
Member

phated commented Jul 27, 2016

This was just published as 2.3.0. Once again, amazing work.

@sttk sttk deleted the support_multiple_config_files branch July 28, 2016 14:27
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