npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-deploy-versioning

v0.1.5

Published

The default blueprint for ember-cli addons.

Downloads

12

Readme

ember-cli-deploy-versioning

This ember-cli-deploy plugin versions each deployment with a commit + annotated tag.
The affect of this plugin is that all deploys are tied to a specific version and a .zip file is optionaly included in the distFiles to be uploaded (when used with ember-cli-deploy-s3).

Configuration Options

Supply configuration options in config/deploy.js under the ENV.versioning hash.

// config/deploy.js

// ENV.versioning
versioning: {
  level: 'patch'  
  // The level to increment this particular deploy. Is used by the incrementer. 
  // Currently only supports semver levels:
  // major, premajor, minor, preminor, patch, prepatch, prerelease

  versionFiles: ['package.json']  
  // Where to read and write the new version to. If multiple files are supplied
  // then the old version is read from the first, and new one is written to all.

  bundle: false
  // Whether or not to include a `.zip` of the repo with the distFiles

  gitAdd: ['package.json']
  // Which files to add to the version commit

  gitRemote: 'origin'
  // Which remote to use. Be sure your entire team has their remote branches
  // configured to the same name.

  gitBranch: ''
  // When left blank it defaults to the current branch.

  gitTagMessage: 'Releasing %FV'
  // The message to annotate the tag with. %FV is replaced with formatted version
  // and %V is replaced with raw version.

  gitCommitMessage: '%FV [ci skip]'
  // The commit message to use when committing the versioned files.

  versioner: 'json' 
  //  The default fn is a json versioner that reads/writes a top level "version" key.
  //
  //  You can provide your own versioner function.
  //
  //  It must return an Object or Function with a `read` and `write` method.
  //  E.g.:
  //
  //  versioner: function(context, { readConfig }) {
  //    const level = readConfig('versionFiles');
  //
  //    return {
  //      read(fileName) {
  //        // returns or resolves to version
  //      },
  //  
  //      write(fileName, version) {
  //        // returns or resolves promise
  //      }
  //    }
  //  };

  incrementer: 'semver' 
  //  The default function is a semver incrementer that uses `level` 
  //  configuration property to determine how much to increment by.
  //
  //  You can provide your own incrementer function.
  //  
  //  The main function must return an Object or Function with an `increment` 
  //  method. `version` and `level` are passed in as parameters.
  //  E.g.:
  //  
  //  incrementer: function(context, { readConfig }) {
  //    const level = readConfig('level');
  //  
  //    return {
  //      increment(version, level) {
  //        // returns or resolve to next version
  //      }
  //    }
  //  };


  formatter: null 
  //  The default fn prefixes the version with "v".
  //
  //  You can provide your own formatter function
  //
  //  The main function must return an Function that accepts `version` parameter.
  //  It is only invoked when creating the commit message and tag name.
  //  E.g.:
  //
  //  formatter: function(context, { readConfig }) {
  //    const incrementer = readConfig('incrementer');
  //
  //    // function is bound with the context of the plugin.
  //    return function(version) {
  //      if (incrementer === 'semver') {
  //        return `v${version}`;
  //      }
  //    }
  //  };

}

Usage

If you want to skip versioning just supply a --skip-versioning flag with your deploy command:

ember deploy development --skip-versioning

Deployment context

This plugin creates the following object on the deployment context:

versioning: {
  previous: '1.0.0',
  current: '1.1.0',
  tagName: 'v1.1.0',
  bundlePath: 'tmp/deploy-dist/v1.1.0.zip',
  bundlePathRelative: 'v1.1.0.zip'
}

Required deployment context key/values:

{
  distDir,  // Only required if building a .zip bundle (bundle === true).
  distFiles // (supplied from ember-cli-deploy-build)
}