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

wofo

v1.7.1

Published

Development workflow assistant

Downloads

9

Readme

Wofo: task development wofkflow assistant

Usage

start new task:

wofo start TASK-1234

this will:

  1. update local repository:

    • if it's not cloned yet:

      • clone repo into ...tasks/.origin dir (or into config.rootDir/config.originDir)
    • if already cloned:

      • pull latest changes into .origin dir
    • run shell commands from config.hooks.originUpdated (e.g [npm install] to install deps)

  2. copy the .origin to ~/tasks/TASK-1234 subdir

    • (this step will be skipped for config.copyOriginToTask: false)
  3. create new branch, named TASK-1234

    • or task-1234 if the lowecase is specified in config.branches.inLowerCase:true
  4. run config.hooks.taskCopyReady hook, (optional, see config) e.g.:

    • [ npm install ] to install deps

    • [ npm install, code .] install deps and open VSCode with newly created task dir

start new task derived from specific branch: (temporarily disabled)

wofo start TASK-1234 some-remote-branch

this will do all the same but tas branch will be derived from some-remote-branch instead of config.branches.baseBranch

make commit

wofo commit some commit message

will make commit with the message:

TASK-1234 | some commit message

if config.commits.firstWordAsCommitType and config.commits.headerSeparator are specified:

TASK-1234 | some | commit message

if no config.commits.headerSeparator in config:

TASK-1234 some commit message

if no config.commits.taskId in config:

some commit message

rebase on base branch

wofo rebase

will rebase current branch onto origin/<config.branches.baseBranch> (fetching it before)

wofo rebase another-branch

will rebase current branch onto another-branch

wofo rebase tries to detect all commits related to the current task by filtering the ones which commit message starts from TASK-XXXX (or whatever config.commits.taskId.extractRegex is specified in config to get task id from current branch name)

squash tasks commits

wofo squash

will squash all last commits prefixed with current task id (TASK-XXXX) into one commit. The commit message will be the message of the first task commit message

wofo squash fix some message

will squash task commits into one with message:

TASK-1234 | fix | some message

get info

show current config

wofo show config
 > Workspace config:

 {
  repo: '[email protected]:off-border/workflow-assist.git',
  rootDir: '~/tasks',
  originDir: '.origin',
...

show current task

wofo show task
> Current task: TASK-1234

Getting commands help

    wofo help

will display the usage info

wofo help <command>

will show detailed help for selected command

Installation

  1. npm i -g wofo
  2. create your workflow directory (e.g. ~/tasks)
  3. create .workflow.config.js in the workflow dir
  4. copy the following code to the config file and change the settings as you wish
module.exports = {
    // your project repo
    repo: '[email protected]:off-border/workflow-assist.git',

    // where you want your working copies to be put
    rootDir: '~/tasks',

    // where to keep the main repo copy. this will be a subdir in your rootDir
    originDir: '.origin',

    tasks: {
        // prefix to append to generated task dir (e.g. fe-TASK-1234)
        directoryPrefix: 'fe-'
    }

    // configure a new task branches creation and rebasing
    branches: {
        // the branch which task branches will be created from and rebased on
        baseBranch: 'master',
        // always convert task-id to lowercase (TASK-1234 -> task-1234)
        inLowerCase: true,
        // max length of the task branch name
        maxLength: 50,
    },

    // to switch whether it should create a new folder for task or use the current one
    copyOriginToTaskDir: true,

    // hooks
    hooks: {
        // commands to run after copying .origin to a TASK-1234 dir
        taskCopyReady: [
            // install deps
            'yarn',
            'echo DEPS INSTALLED',
            // launch VSCode (for linux)
            'code $TASK_DIR &',
        ],
    },

    // commits config
    commits: {
        // how to format task-id in the commit message
        taskId: {
            // regEx to extract task id from current branch name
            // e.g. here will be extracted:
            //    TASK-1234 from TASK-1234-some-text
            //    !1234 from !1234-some-text
            extractRegex: /(!\d+|TASK-\d+)/i,

            // convert task id to upper case (task-1234 -> TASK-1234)
            upperCase: true,
        },

        // header fields separator (e.g. "TASK-1234 | type | message")
        headerSeparator: ' | ',

        // use the first word of the message as a commit type
        // (e.g. "wofo commit 'some commit message'" -> "TASK-1234 | some | commit message)
        firstWordAsCommitType: true,
    },
};

Known issues

no global .wofkflow.config.js yet

for now wofo command looks for config starting from current dir and goes up until it finds .wofkflow.config.js in some of the parent dirs. That means the command should be run in the directory where the correct config file exists is located in one of the parent dirs.

js/cjs config wrong format

for now only .js config files supported (no .ts/.json)

Config export format (commonjs/esnext) depends on the package.json "type" section value. (e.g. "type": "module") (for JS/TS based projects)

If wofo command says that no config file found - check if its export type corresponds to your project package.json -> type setting