feat: revisioning info moved to its own file #274
Merged
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.
Background
Featurevisor's build system relied on the
version
found inpackage.json
for the generated datafiles'revision
property.Links for further understanding:
Challenges
For every new successful build, it meant incrementing the version number as found in
package.json
.Many npm projects rely on caching their dependencies, and the cache is busted if the hash of
package.json
and/orpackage-lock.json
changes.If we keep updating the
version
inpackage.json
for every build, this way of caching becomes redundant. We don't want that.Solution
Now the revision info is stored next to state files in
.featurevisor/REVISION
file.This will contain a numeric value, which will be incremented by every build.
And
package.json
remains untouched and unused going forward, leaving you with the choice to adopt a caching strategy for your npm dependencies the way you want.Backwards compatibility
Those who have been following our deployment guide with GitHub Actions and/or Cloudflare Pages before, it will maintain backwards compatibility by:
version
frompackage.json
.featurevisor/REVISION
fileHow to upgrade?
If you have been following our deployment guidelines, then it's really nothing more than a version upgrade for
@featurevisor/cli
for you.But you may want to tweak your pipeline (like GitHub Actions workflows) to benefit from this change.
TODOs