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

enhance(publish): track templateVersion on initialization #3036

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kevinslin
Copy link
Member

@kevinslin kevinslin commented Jun 3, 2022

enhance(publish): track templateVersion on initialization

Currently, dendron publish will always try to fetch the latest version of the template from git.
This isn't great as the latest version can have breaking changes.

This commit is the first in a series that adds versioning to the publishing templates to make upgrades and deployment less brittle.

  • introduce templateVersion config variable that tracks version of template being published
  • dendron publish init
    • no longer upgrades the template
    • writes templateVersion on initialization

The model we are moving to:

The NextJS Template is tightly couplped to deployments of the dendron mono repo.
Because it is not published to NPM but via github, versioning is maintained via git tags. 

Releases will be published under a git tag `v{VERSION}` where `VERSION` corresponds to the version of the dendron. 

Next:

  • introduce dendron publish upgrade which
    • if tempalte is out of date, will upgrade and update templateVersion command
      • NOTE: because template version is tied to CLI version, we cannot update a template ahead of the CLI version
    • if template is newer then CLI, will prompt to upgrade the CLI
  • clean up github actions template and tutorials to use dendron publish upgrade with tracked versions (vs deploying from the latest version)

@kevinslin kevinslin changed the title enhance/publish upgrade enhance(publish): track templateVersion on initialization Jun 3, 2022
@kevinslin kevinslin marked this pull request as ready for review June 3, 2022 03:31
@auto-assign auto-assign bot requested a review from bpathakota June 3, 2022 03:31
await this._cloneTemplate(opts);
const templateVersion =
NextjsExportPodUtils.templateVersion(config) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if config version exceeds engine Version? Shouldn't we do Math.min(configVersion?, engineVersion) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to do a min in this case because configVersion is source of truth. if the engineVersion is lower, we need to ask the user to update the engine because they've published using a higher version. i've done a writeup of this here, will also share as an async > https://docs.google.com/document/d/1dZ3X039TqQyUMaRYx9KJSFVpJMEHgtjRbqdAdFDGWX8/edit

packages/pods-core/src/builtin/NextjsExportPod.ts Outdated Show resolved Hide resolved
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.

None yet

3 participants