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

@eriicafes/reflow

v1.0.1

Published

An opinionated workflow tool for Typescript projects πŸš€

Downloads

6

Readme

Reflow πŸš€

An opinionated workflow tool for Typescript projects πŸš€

Reflow is aimed at reducing the complexity in setting up a proper dev environment for typescript projects.

Features

Installation

Install locally:

npm install @eriicafes/reflow

And initialise:

npx reflow init

Or install both globally and locally (preferred):

npm install -g @eriicafes/reflow # global

npm install @eriicafes/reflow #local

And initialise:

reflow init

With a global installation you will not be required to use npx. Global installation is preferred as reflow still requires a local installation and will always run the locally installed binary when available.

Usage/Examples

Examples below assume you have both a global installation and a local installation, for local installation only you will have to prefix the command with npx

All commands have a -h or --help flag to display a help message. Nearly all commands have a -d or --dry-run flag useful to see the commands that would run without actually making any changes. Command arguments in square brackets [] are optional while those in angle brackets <> are required.

Initialise reflow workspace

reflow init

Options:
  -n --no-install  turn off automatic package installation
  --lib            initialize as an npm library

Branching

create and checkout new branch

reflow branch [name] [parent]

rename the current branch

reflow branch -r [name]

Checkout

reflow checkout [branch]

checkout with search on branches (this examples searches for all branches beginning with feat)

reflow checkout feat

Merge

merge branch to the main branch (whether on the main branch or on the branch to be merged)

reflow merge

Options:
  --prefer-ff   always perform a fast-foward merge (default: false)

Commit

reflow commit

Options:
  --retry     retry last commit attempt

Push

push branch to remote (prompts to sets upstream if not available)
force push is a bit less dangerous as the following flags are attached -f --force-with-lease --force-if-includes

reflow push

Options:
  -f --force  force push

Release

make a release (bump version, tag commit and push changes)
would usually only be run on a CI/CD pipeline except if -f or --force flag is used

reflow release

Options:
  -f --force      force release when not in a CI environment (default: false)
  -a --as <type>  release with a specific version type
  --no-push       prevent pushing changes and tags to remote

NOTE: For projects that started with a major version at zero (0.y.z) you may need some manual action to bump the major version to 1.0.0. Once the project is ready for the first major release, run the command below from the main branch:

reflow release --as major -f

Prerelease

make a pre-release (eg. v1.0.1-{tag}.0)

reflow prerelease

Options:
  -t --tag <name>  pre-release tag
  --as <type>      release with a specific version type
  --no-push        prevent pushing changes and tags to remote

for example if version is at 0.1.0 and we want to make a prerelease with an alpha tag and release as a a minor version:

reflow prerelease -t alpha --as minor

this will bump the version from 0.1.0 to 0.2.0-alpha.0

Generate Files

type includes configs, actions and hooks, file is the file name, run the command without any arguments to see all possible files to generate

reflow generate [type] [file]

Options:
   -c --common   generate all common template files
   -a --all      generate all template files

Actions (github actions)

When you run reflow init a test.yml workflow will be generated, which will run tests and build using npm test and npm run build respectively. All actions are listed below:

  • test.yml (run tests and build)
  • version.yml (bump version and push new update with tags) requires a VERSION_TOKEN secret containing a Github Personal Access Token with repo permissions
  • release.yml (triggered by version.yml workflow, creates a draft github release)
  • publish.yml (triggered by release.yml workflow, publishes package to NPM) requires an NPM_TOKEN secret containing an NPM Access Token

All actions can be modified as needed

Advanced (configure reflow CLI)

For some use cases you may need to override certain defaults in the reflow config by first generating the config file using reflow generate and selecting config/reflow (which is probably the last item on the list)

Below are the defaults which you may customize as needed:

{
  "mainBranch": "main",
  "remote": "origin",
  "branchDelimeter": "/",
  "allowedBranches": [
    "feature",
    "fix",
    "chore",
    "refactor",
    "build",
    "style",
    "docs",
    "test"
  ],
  "keepMergeCommits": true
}

Contributing

Pull requests are always welcome!

Authors