Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-5789

Provide a script for publishing dev version to NPM

    XMLWordPrintable

Details

    Description

      For publishing Infusion as an NPM module, it would be useful to provide a script for automating the task. Publishing a release to npm should be as easy as running npm publish, however publishing a dev build will take some more work, which is why the script is needed.

      The script should be able to do the following:

      1) Update the package.json to have the correct version number
      2) publish to NPM
      3) add the "dev" dist-tag
      4) clean up package.json (reset to head).

      Unfortunately NPM doesn't respect semver's notion of build releases (+buildID). To work around this we will publish dev builds using the following version format.

      major.minor.patch-dev.yyyymmddThhmmssZ.shortCommitHash

      e.g. 2.0.0-dev.20151007T134312Z.8c33cd4

      The date portion is to ensure that the builds are ordered correctly as the commit hash is random. The date format use the ISO8601 format at yyyymmddThhmmssZ where time is in UTC.

      Notes:
      To get the shorthand of the commit hash use
      git rev-parse --verify --short HEAD

      To get the UNIX timestamp
      git show -s --format=%ct <mytagname>^

      {commit}

      To convert the timestamp use the javascript Date object but multiply the timestamp by 1000 first. Then you'd need to construct the ISO8601 formatted string from this.

      Attachments

        Activity

          People

            jobara Justin Obara
            jobara Justin Obara
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: