Refactor edition detection for [emberjs/rfcs#558](https://github.com/emberjs/rfcs/pull/558). #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for the system laid out in emberjs/rfc#558, in a backwards compatible way.
Summary of changes:
setEdition
andclearEdition
are "soft" deprecatedhas
now accepts aprojectRoot
path as a second argument which defaults to the processes current working directoryhas
will check theprojectRoot
for apackage.json
, and if it containsember.edition
key that will be returnedhas
continues to fall back to leveraging the preexisting environment variables ifpackage.json
was not found or if the package.json does not contain anember.edition
property.Note: this commit creates a "soft deprecation" so that the ecosystem has a window of time in order to migrate away from
setEdition
without significant console noise. After a short time period has elapsed with the new mechanism introduced, we will begin issue console warnings for usage ofsetEdition
.