Refactor edition detection for [emberjs/rfcs#558](https://github.com/emberjs/rfcs/pull/558).#4
Merged
rwjblue merged 1 commit intoemberjs:masterfrom Dec 11, 2019
Conversation
Adds support for the system laid out in Ember RFC #558, in a backwards compatible way. Summary of changes: * `setEdition` and `clearEdition` are "soft" deprecated * `has` now accepts a `projectRoot` path as a second argument which defaults to the processes current working directory * `has` will check the `projectRoot` for a `package.json`, and if it contains `ember.edition` key that will be returned * `has` continues to fall back to leveraging the preexisting environment variables if `package.json` was not found or if the package.json does not contain an `ember.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 of `setEdition`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
setEditionandclearEditionare "soft" deprecatedhasnow accepts aprojectRootpath as a second argument which defaults to the processes current working directoryhaswill check theprojectRootfor apackage.json, and if it containsember.editionkey that will be returnedhascontinues to fall back to leveraging the preexisting environment variables ifpackage.jsonwas not found or if the package.json does not contain anember.editionproperty.Note: this commit creates a "soft deprecation" so that the ecosystem has a window of time in order to migrate away from
setEditionwithout significant console noise. After a short time period has elapsed with the new mechanism introduced, we will begin issue console warnings for usage ofsetEdition.