DEV Community

Michael Z
Michael Z

Posted on

6

CI/CD Workflows for open source NPM packages

My Workflow

I've created two workflows to manage an open source NPM package of mine.

CI

This workflow runs tests and creates a test coverage report when pushing code or creating/updating pull requests.

CD

This workflow publishes a package to NPM for you. The cool thing is that all you have to do is create a release on GitHub.

It updates the version in package.json for you automatically. The workflow also let's you publish multiple versions (Say your project is on version 2 but you still want the possibility to publish patches to version 1).

Submission Category:

DIY Deployments

Yaml File or Link to Code

GitHub logo MZanggl / flooent

Fluent interface to provide an expressive syntax for common manipulations.

flooent

npm bundle size latest version Coverage Status

Fluent interface to provide an expressive syntax for common manipulations Rather than enforcing a different paradigm, flooent builds upon and extends the native capabilities of various JavaScript objects.

Given you have logical, procedural, "hard to visualize" code like this:

// given we have const path = 'App/Controllers/user.js'
const filename = path.substring(path.lastIndexOf('/') + 1)
let name = filename.substring(0, filename.lastIndexOf('.'))
if (!name.endsWith('Controller')) name+= 'Controller'
return name.substring(0, 1).toUpperCase() + name.substring(1)
Enter fullscreen mode Exit fullscreen mode

refactor it into plain English

// given we have const path = 'App/Controllers/user.js'
given.string(path)
  .afterLast('/')
  .beforeLast('.')
  .endWith('Controller')
  .capitalize(
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

I've posted three articles describing the set up and what I learned along the way:

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up