Details

    • Similar Issues:
    • Epic Link:

      Description

      • Set up an npm "pre-publish" hook that blocks invocation via "npm publish" - see PoC here: https://gist.github.com/sophistifunk/9ebefcc134f47e310adfd3d077fa8c00
      • Write a publish script in vanilla js (targeted at Node 5, probably) that does something along the lines of:
        1. Make sure on master, with nothing unstaged
        2. Grab latest published version from npm info, increment it and set local version if it's old or has a -foo suffix. (+commit master)
        3. Clean build
        4. Create some tag file in /dist documenting current version and commit hash
        5. Set the magic env var, npm publish
        6. Git tag published version
        7. Increment version in package.json, add -snapshot or -unpublished or something like that, and commit master

        Attachments

          Activity

          Hide
          tfennelly Tom FENNELLY added a comment - - edited

          1. Make sure on master, with nothing unstaged

          So no publishing of --tag releases from a branch?

          7. Increment version in package.json, add -snapshot or -unpublished or something like that, and commit master

          So the published package becomes the "latest" in the NPM registry. I don't think you'd want that for a pre-release, right?

          Show
          tfennelly Tom FENNELLY added a comment - - edited 1. Make sure on master, with nothing unstaged So no publishing of --tag releases from a branch? 7. Increment version in package.json, add -snapshot or -unpublished or something like that, and commit master So the published package becomes the "latest" in the NPM registry. I don't think you'd want that for a pre-release, right?
          Hide
          tfennelly Tom FENNELLY added a comment -

          Btw I think it would be nice to reuse this process on all NPM packages, not just the JDL.

          Show
          tfennelly Tom FENNELLY added a comment - Btw I think it would be nice to reuse this process on all NPM packages, not just the JDL.
          Hide
          sophistifunk Josh McDonald added a comment -

          Michael Neale we definitely need to keep support for publishing non-latest tags up to npm. But we'd have it as a command line switch to the publish script, which would skip the checks to make sure we're on master, and probably add a comment in the "tag" file in /dist, but probably not much else. But that way we'd only put pre-releases in when they're tagged, and only put "latest" things up when they're in a steady-state in master, so that you can easily go from the hash in the published "tag" file to a commit on master.

          Show
          sophistifunk Josh McDonald added a comment - Michael Neale we definitely need to keep support for publishing non-latest tags up to npm. But we'd have it as a command line switch to the publish script, which would skip the checks to make sure we're on master, and probably add a comment in the "tag" file in /dist, but probably not much else. But that way we'd only put pre-releases in when they're tagged, and only put "latest" things up when they're in a steady-state in master, so that you can easily go from the hash in the published "tag" file to a commit on master.
          Hide
          sophistifunk Josh McDonald added a comment -

          Tom FENNELLY agreed. Probably want to flesh it out in JDL, then upgrade it to some sort of tool we (and anybody else who cares) can use as an npm dev-dependency.

          Show
          sophistifunk Josh McDonald added a comment - Tom FENNELLY agreed. Probably want to flesh it out in JDL, then upgrade it to some sort of tool we (and anybody else who cares) can use as an npm dev-dependency.
          Hide
          tscherler Thorsten Scherler added a comment -

          We may want to use https://github.com/mgol/npm-bump as a base line code, seems to do a couple of things of what we want to do.

          Show
          tscherler Thorsten Scherler added a comment - We may want to use https://github.com/mgol/npm-bump as a base line code, seems to do a couple of things of what we want to do.

            People

            • Assignee:
              sophistifunk Josh McDonald
              Reporter:
              sophistifunk Josh McDonald
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: