-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add locking feature to prevent stale code #25
Conversation
bea91e8
to
964ae7d
Compare
4f111ea
to
9f83a8d
Compare
$ npm install --save-dev ember-cli-rails-addon@#{ADDON_VERSION}` | ||
|
||
in you Ember application root: #{app_path} | ||
MSG |
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.
These heredocs are great!
LGTM |
def check_addon! | ||
dependencies = package_json.fetch("devDependencies", {}) | ||
|
||
unless dependencies["ember-cli-rails-addon"] == ADDON_VERSION |
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.
We also need to check for EmberCLI version. It must be greater than 1.3.0 in order to have the preBuild hook that the addon needs.
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 am unsure that you should care too much about this here. You can make the addon check the required version var version = this.project.emberCLIVersion();
and it can be kept with a nice message. Then here (in ember-cli-rails) you just don't have to care about it.
Add locking feature to prevent stale code
WOOT, awesome job y'all! |
Adds locking feature that works with ember-cli-rails-addon (the companion addon in node land)
The
ember-cli-rails-addon
uses thepreBuild
hook to write a file calledpreBuild.lock
to the output and thepostBuild
hook to delete that file and writepostBuild.lock
The middleware we are now injecting blocks until the
preBuild
file is not found and thepostBuild
is found before continuing the request. This results in a block until ember-cli has fully built the output.Cheers 🍺