twolfson / foundry

Release manager for npm, bower, component, PyPI, git tags, and any command you want
The Unlicense
41 stars 8 forks source link

Grand vision placeholder #14

Closed twolfson closed 9 years ago

twolfson commented 10 years ago

We are about to make the README useful. This means relocating the grand vision. However, for quick reference I am opening this issue.

https://github.com/twolfson/foundry/tree/0.16.0


Grand vision:

// TODO: Initial release could forego increasing of versions and go with a set-only approach.

// TODO: Consider safeguards (e.g. don't release unless on master, probably inside of hooks)

release command will need to accept major, minor, patch, pre-release <name>, <semver> (e.g. 0.1.0).

There will be the option to add metadata via --metadata <metadata>.

The commands above were provided by http://semver.org/

// TODO: $EDITOR opening should be another node module Optionally, a message can be provided via -m, --message. If not provided, a prompt will open in $EDITOR (config can override this).

Each release script must have the following export functions

// TODO: We are worrying about other formats beyond semver but we don't know what they look like. It is silly to try to future proof for something we cannot predit. Consider it YAGNI.

exports.getVersion = function (options, cb) {
  // Working directory will be process.cwd();
  // options.cwd = process.cwd();
};
exports.setVersion = function (version, options, cb) {
  // semver = 0.1.0-pre-release+metadata
  // TODO: Thoughts on semver.major, semver.minor, semver.patch as properties?
};
// Optional function to register if the package is brand new
// TODO: This should be a prompt (e.g. "This looks like an initial release. Should we register to the appropriate registries? [Y/n]
exports.register = function (options, cb) {
  // Register to PyPI
  // Maybe bower too?
};
exports.publish = function (options, cb) {
  // Publish to npm, git tag, zip + tarball to PyPI
};

// Optional setting for semver types
exports.accepts = {
  major: true,
  minor: true,
  patch: true,
  'pre-release': false,
  metadata: false
};

config will accept a mustache template for formatting

{
  // versionFormat: 'v{{major}}.{{minor}}.{{patch}}{{#pre-release}}-{{.}}{{/pre-release}}{{#metadata}}+{{.}}{{/metadata}}',
  versionFormat: '{{major}}.{{minor}}.{{patch}}{{#pre-release}}-{{.}}{{/pre-release}}{{#metadata}}+{{.}}{{/metadata}}',
  defaults: {
    // TODO: Users will prob want a hook for injecting metadata, figure that out.
    // TODO: Maybe `~/.foundry/hooks/metadata.js`?
    message: 'Release {{version}}',
    version: '0.1.0'
  }
}

We might want standalone functions for register and publish

foundry register
foundry publish

Maybe even register/publish with callouts to specific releasers

foundry register git-tag
foundry publish git-tag

This leads to the question of get-version and such as well

foundry get-version # 1.33.7
foundry set-version 42.0.0

foundry get-version bower # 1270.0.1
foundry set-version npm 192168.1.1
twolfson commented 9 years ago

I think it's safe to say that a lot of this vision has changed. It's more CLI oriented now and I believe that breaking things down too much would be unnecessary.

We should still build things like:

However for the rest, I am going to mark this as closed.