-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 yam & config file #563
Conversation
great name 👍 |
before we merge, some examples + ecli should utilize the config file. That way we know if this path is correct |
@stefanpenner this a pre-PR for bringing analytics prompts back. I haven't really thought what we should put in |
@twokul Sure, but this doesn't do that yet, c/d? Meaning, lets see this thing work and have some tests to ensure the prompting + saving work in the context of ember-cli, then we can ... |
It sets up the config file and reads/writes to it. |
I can base prompt PR on this one. |
this.message = message; | ||
this.stack = (new Error()).stack; | ||
this.stack = (new Error()).stack; | ||
} | ||
|
||
ProjectNotFoundError.constructor = ProjectNotFoundError; | ||
ProjectNotFoundError.prototype = new Error(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use Object.create(Error.prototype)
there.
new Error()
runs the constructor and I think we don't really want that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated ARCHITECTURE.md to reflect that
https://github.com/stefanpenner/ember-cli/blob/master/ARCHITECTURE.md#custom-errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a subject for a separate PR
@twokul i would like to see proxy options and ci or silence in |
@fsmanuel that's the plan |
@twokul 👍 |
can you add support for the config file to have:
|
@@ -3,6 +3,7 @@ | |||
var nopt = require('nopt'); | |||
var chalk = require('chalk'); | |||
var path = require('path'); | |||
var merge = require('lodash-node').merge; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you require the explicit module that contains merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lodash/objects/merge
or something
LGTM |
} | ||
}; | ||
|
||
var getUserHome = function getUserHome() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var is not needed, the named function statement is sufficient.
left some small comments, also this needs a rebase |
Looks like this needs another rebase. @stefanpenner - Anything else needed on this (other than the rebase)? |
'live-reload': true | ||
}); | ||
|
||
touch(homePath, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im abit concerned that this actually mutates my global config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paging @twokul
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local settings in the project take precedence over your global settings. if local .ember-cli
doesn't exists, your global settings will take over. does that answer your concern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twokul - The issue is that this test will modify the actual files in my home directory when running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if you look a few lines below, it will delete the file too. This means that I cannot have a ~/.ember-cli
file while developing on the ember-cli project itself, but will have to manually recreate when I want to work on actual ember-cli applications (aka client projects).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rjackson @stefanpenner sorry for confusion, I pushed the fix.
this would be lovely to get in, it has been pending for a month. Can you please address the test concern? |
@twokul - This is causing the fingerprinting smoke test to fail. Not sure yet exactly why, could you look into it? |
@rjackson looking into it |
Anything new here? Would love to have this in master so I can use a couple of the things :) |
'live-reload': true | ||
}); | ||
|
||
homeSettings = touchIfExists(homePath, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not actually touch (or rely) peoples home dir during the tests? Simply configuration Yam with a path for home, via ./fixtures/home/.
and ./fixtures/project/.
would be best.
@rjackson @twokul so the smoke test is failing because the test is calling |
The command line provided environment should win (meaning regardless of what was set in Generally, I see the order of precedence (last wins):
This is essentially least specific to most specific. |
@rjackson yeah, the command line actually does win if you do a manual |
Actually, the command line does not win. That is the issue (I had forgotten to |
…take precedence over config
Looks like this has been updated to handle the various concerns that @stefanpenner and I pointed out. Probably ready for another review. |
Yay passing tests! Is this okay to be merged into master? |
host: '0.0.0.0' | ||
}); | ||
|
||
settings = new Yam('ember-cli').getAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we modify to use the (recent) ability to mock the homePath with Yam? And just use a fixture in tests/fixtures to load the home settings (from above).
@@ -0,0 +1,41 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the recent changes (to mock yam) caused this to be an unneeded change.
Can you move this back to tests/helpers/file-utils.js
(with the original contents)?
👍 |
BOOM |
👍 I'm stoked for this! |
Closes #440
Adds support for
.ember-cli
settings file which looks like this:By default,
ember-cli
is going to look for.ember-cli
file in two places: the current directory and your home directory. You can put your personal settings in your home.ember-cli
file, team shared settings should stay in project.ember-cli
.