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

Implement 'publishVersionIntent' #35

Merged
merged 4 commits into from
Apr 26, 2019
Merged

Implement 'publishVersionIntent' #35

merged 4 commits into from
Apr 26, 2019

Conversation

izqui
Copy link
Contributor

@izqui izqui commented Apr 3, 2019

Implements a new publishVersionIntent function that returns an aragon.js intent object that can be used to publish a new version using transaction pathing.

publishIntent now uses publishVersionIntent and still generates the direct transaction to publish a version, making the change fully backwards compatible.

Closes #13

src/index.js Outdated Show resolved Hide resolved
Co-Authored-By: sohkai <qisheng.brett.sun@gmail.com>
src/index.js Outdated Show resolved Hide resolved
src/index.js Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
src/index.js Outdated Show resolved Hide resolved
* Publishes a new version (`version`) of `appId` using storage provider `provider`.
*
* If the destination repository does not exist, the intent will be for creating a new
* repository with an initial version.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a lot easier for the CLI to use a single function to do both version publishes as well as repo creations?

Really seems like there's two concerns mixed here (you can immedately tell by the manager being the first argument, but it not being used at all on the "normal" path).

Choose a reason for hiding this comment

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

Not necessarily, I think having something like:

if ( apm.getRepo() ) {
  apm.publishVersion()
} else {
  apm.publishInitialVersion()
}

is not more difficult, but actually more expressive 👍 (you don't have to guess the magic publishVersion does).

That being said, refactoring this might take some time without adding a lot of value (especially if we want to keep backwards compatibility), so I will open an issue for it.

sohkai and others added 2 commits April 26, 2019 10:42
Co-Authored-By: 0x6431346e <hello@danielconstantin.net>
@sohkai sohkai merged commit 5554256 into master Apr 26, 2019
@sohkai sohkai deleted the publish-pathing branch April 26, 2019 10:10
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.

Add aragon.js transaction pathing for 'publish'
3 participants