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

sparkee

v1.4.0

Published

A publish tool for monorepo,just like lerna but support pnpm.

Downloads

67

Readme

sparkee

Sparkee is a publish tool for monorepo,just like lerna but support pnpm, also support singleRepo.

About

What can Sparkee do?

There are six commands in sparkee:

init will initialize sparkee workspace. init-cliff will initialize git-cliff config file. run will run the script of package. info will show package's info of workspace. log will only generate changelog.md. publish will publish any updated packages and generate changelog automatically.

What diffrences with lerna?

  • Sparkee can publish Single package or customize multiple packages.
  • Support workspace protocol in package.json.
  • Use pnpm <--filter> publish so you can keep the workspace keyword of dependencies.
  • More friendly output of CLI.
  • CLI commands are very very simple!

Getting Started

Project structure

Sparkee needs a file structure like this(the same as the lerna project):

your-repo/
  package.json
  packages/
    package-1/
      src/
      package.json
    package-2/
      src/
      package.json

It will track file changes inside the packages src folders and package.json files.

Installation

# simple install or install it globally with -g
npm install sparkee --save-dev

# if you install globally, use it `sparkee <command>`
sparkee init
sparkee version
sparkee publish

# OR use npx in root of project
npx sparkee init
npx sparkee publish
npx sparkee version

Usage

init

$ sparkee init

Initialize sparkee workspace. There will create a spark.json, you can make sparkee manage all of packages or customized packages.

Sparkee assumes the repo has already been initialized with git init.

Example output on a new git repo:

Example-1. All packages:

$ sparkee init
? Do you need sparkee to manage all projects of packages folder? yes
✔ Sparkee init successful.

Example-2. Custom packages:

$ sparkee init
? Do you need sparkee to manage all projects of packages folder? No
? What packages do you want to manage? @geocld/pkg1
✔ Sparkee init successful.

Example-3. single repo:

$ sparkee init
? Please select repo type: singleRepo
✔ Sparkee init as singleRepo successful.

In singleRepo mode, spark.json will be:

{
  "singleRepo": true,
  "moduleManager": "npm"
}

singleRepo : Must be true in single repo. moduleManager: Can be npm or yarn or pnpm.

run(supported in v1.1.0)

$ sparkee run

Run the scripts of packages.json:

Example:

$ sparkee run
? Please select script: (Use arrow keys)
❯ dev -> rimraf dist && tsc -w
  build -> rimraf dist && tsc

info

$ sparkee info <--tree>

Print local information of packages.

Example:

$ sparkee info
> Current monorepo packages:
  · @geocld/pkg1: v1.0.0
  · @geocld/pkg2: v1.0.0

Or Print detail dependencies tree of packages:

$ sparkee info --tree

@geocld/[email protected]
╰── @geocld/[email protected]

----------

@geocld/[email protected]

log(supported in v1.3.0)

$ sparkee log

If you only want to generate a changelog, you can execute the above command.

publish

$ sparkee publish

publish is the core of sparkee. When runing, this command does the following things:

  • Find updated packages since the last release(must with git tag, otherwise compare with first commit).
  • Select what packages that you want to publish.
  • Update version of package.json automatically.
  • Generate CHANGELOG.md automatically in selected packages.
  • Run git Commit, git tag and git push automatically.
  • Run pnpm publish

sparkee will never publish packages which do not exits in spark.json.

The workflow of sparkee is as follows:

workflow

publish --force

Sparkee will not publish unmodified packages, if you want to publish unmodified packages, use --force:

sparkee publish --force

publish --noPublish

If yout want sparkee just genetate changelog and create tag, publish command run in other place(such as pipeline), use --noPublish or --np:

sparkee publish --noPublish

or

sparkee publish --np

publish --noCommitCheck

If you want to skip commit check before publish or generate changelog, you can use --noCommitCheck or --ncm:

sparkee publish --noCommitCheck

or

sparkee publish --ncm

publish --package --ver

If you dont want to use prompt when publish(such as in CI/CD autodeploy case), you can use --package and --ver to specify the name and version of package.For example:

sparkee publish --package @geocld/sparkee --ver 1.2.0

Custom changelLog

sparkee use git-cliff internally to generate CHANGELOG.md, If you want to use custom changelog, you can run sparkee init-cliff to generate a cliff config file, refer to the configuration items in detail.

JSON $schema

Since version 1.3.0, a JSON schema file for the spark.json is published.

You can specify a relative path to the schema of the Sparkee npm package if Sparkee is installed in the node_modules folder:

{
  "$schema": "./node_modules/sparkee/template/schema.json",
  "moduleManager": "pnpm",
  "packages": [
    "@example/docs",
    "@example/cli",
  ]
}

License

MIT © Geocld