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

pivotal-flow

v2.0.0

Published

๐Ÿ”€ A command-line tool that helps you manage & automate your workflow to use with PivotalTracker.

Downloads

24

Readme

pivotal-flow ๐Ÿ”€

A command-line tool that helps you manage & automate your workflow to use with PivotalTracker.

npm GitHub npm

Install

# install pivotal-flow globally
# you can check if it was installed correctly by running `pivotal-flow --version`
npm install -g pivotal-flow

# initialize pivotal-flow
pivotal-flow init

pivotal-flow is built to work with husky ๐Ÿถ along with the Pivotal GitHub integration.

Commands

Run pivotal-flow --help to see usage & documentation.

you can also use the pf alias for pivotal-flow.

init

A guided questionnaire to set-up pivotal-flow with the basic configuration:

$ pivotal-flow init
# generate a basic configuration file in your home directory.

start

Create a new story or work on an existing story (from the stories in your PivotalTracker project(s)):

$ pivotal-flow start
# start working on a story guided by a questionnaire

git-hooks via husky

pivotal-flow also provides a few git-hooks to automate a few tasks when working with PivotalTracker as your project management tool. You can add the provided hooks using husky.

In order to use the hooks from pivotal-flow, add it as a dependency to your npm project:

$ npm install --save-dev pivotal-flow
# install it as a dev-dependency

Then add the hooks and/or commands to your package.json:

   },
   "scripts": {
     // ...
+     "start:story": "pivotal-flow start"
   },
   "husky": {
     "hooks": {
+      "post-checkout": "pivotal-flow hook check-story-id-in-branch",
+      "prepare-commit-msg": "pivotal-flow hook add-story-id-to-commit",
+      "commit-msg": "pivotal-flow hook check-story-id-in-commit",
     }
   }
 }

Hooks

check-story-id-in-branch

post-checkout - check that all newly created branches have a PivotalTracker story id in the branch name.

Why do we need the ID in the branch?

This allows the GitHub integration to send updates to pivotal to show branch & PR information in a story.

add-story-id-to-commit

add-story-id-to-commit added as a prepare-commit-msg hook will pick up story id from the branch name (if it is present) and append it to each commit message.

Again, this allows the GitHub integration to send updates to PivotalTracker of commit information in a story.

check-story-id-in-commit

check-story-id-in-commit as a commit-msg hook - checks if each new commit message contains the story id as well.

In case you're not using the add-story-id-to-commit hook or don't want to enforce story id being present in every branch name, this hook makes sure the story id is present in the commit message (added by other means by the user).

Configuration

Once the init command is run, it creates a config file in your home directory. This is meant to be a per-user configuration.

You can modify/add the configuration file in multiple levels which are supported via cosmiconfig.

Currently, a configuration file looks like the following:

{
  "projects": [
    {
      "name": "Alpha",
      "id": 1234567
    },
    {
      "name": "Bravo",
      "id": 7654321
    }
  ],
  "pivotalApiToken": "abcde*****************************"
}

NOTE: Since the pivotalApiToken is meant to be private, we discourage adding the pivotal-flow configuration file to source control.

Configuration Options

|Option|Type|Description| |---|---|---| |pivotalApiToken|string|API Token from PivotalTracker.| |projects|project[]|An array of PivotalTracker projects which will be part of your workflow for creating / working on stories.| |projects[i].name|string|The name of the project (or an alias) to be used when picking among projects in the different commands.| |projects[i].id|string|number|Each PivotalTracker project has an id which you can find by referring to your project's URL. For example, if your project's URL is https://www.pivotaltracker.com/n/projects/1234567 then the project id would be 1234567. This is required to query the stories from the project|

Commands in action

Starting a new story

Run pivotal-flow (alias: pf) as a local/global command to start creating stories from the command line:

Pivotal Flow

Work on an existing story

my stories

Fuzzy search

fuzzy search

Other

Using pivotal-flow hooks alongside Pivotal GitHub Integration ensures your updates (commits, pushes, merges etc) on GitHub are posted directly and automatically to your Pivotal stories.

Follow instructions for and the Pivotal GitHub Integration to set-up the entire flow for your repository.

Credits

The concept of adding story ids (picked from the branch-name) to all commits are from the awesome git-tracker project by @stevenharman - ported to husky/node implementation in pivotal-flow's add-story-id-to-commit hook.

References

  1. PivotalTracker
  2. Git Hooks
  3. Husky ๐Ÿถ
  4. git-tracker