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

[Breaking] Read Version in Build #104

Merged
merged 4 commits into from Dec 15, 2021

Conversation

jrjohnson
Copy link
Contributor

The move to service based version detection didn't include the automatic ways a version was currently being detected. I've done a few things here:

  1. Clarify the documentation for what is configured in config/environment.js and what can be passed to the component.
  2. [breaking] if no currentVersion is detected read it from ember-cli-app-version, if ember-cli-app-version is not installed then read the version in package.json. This behavior used to be opt-in, but I think the combination of allowing the value to be set manually and having opted into installing that addon is sufficient, easy to change back though if I'm wrong.
  3. [breaking] automatically create VERSION.txt. This used to be opt-in, however the easiest way to opt out now is just to manually create a public/VERSION.txt in the app. Since currentVersion has to be manually set this seems like a good default.

I also moved all of the configuration default setup into the config hook so it wasn't duplicated in the service.

Most of this is personal preference around what I think good defaults are. Since the config is now read in one place and defaults are applied in the build it's trivial to add back in the original opt-in behavior if I'm wrong about good options here. Just let me know.

Fixes #103

Add default options and detect currentVersion during the build step.
The way to opt out of this behavior is to include a VERSION.txt in the
app, otherwise the file will be created automatically. When a
VERSION.txt file exists the treeForPublic build step won't overwrite it.
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
Co-authored-by: Ilya Radchenko <knownasilya@gmail.com>
@knownasilya knownasilya merged commit 8866360 into sethwebster:master Dec 15, 2021
@jrjohnson jrjohnson deleted the read-version-in-service branch December 15, 2021 16:42
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.

No automatic version in v3 with ember-cli-app-version?
2 participants