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

@websublime/workspace-tools

v1.0.2

Published

Bindings for node from crate workspace-node-tools

Downloads

16

Readme

@websublime/workspace-tools

https://github.com/websublime/workspace-node-binding-tools/actions

Tools to use on github actions for bumping version, changelogs on a monorepo.

Install this package

pnpm add @websublime/workspace-tools

Usage

This package offer a set of functions to retrieve information about the monorepo and the packages that contain. It support all package managers including Bun (WIP).

API

| Function | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | getProjectRootPath(root?: string): string or undefined | Get the root path of the project. | | getDefinedPackageManager(root?: string): string or undefined | Get the package manager defined in the project. | | detectPackageManager(root: string): PackageManager or undefined | Detect the package manager defined in the project. | | getPackages(cwd?: string): Array<PackageInfo> | Get the list of packages in the monorepo. | | getPackageInfo(package_name: string, cwd?: string): PackageInfo | Get PackageInfo for a package. | | getChangedPackages(sha?: string, cwd: string): Array<PackageInfo> | Get the list of packages that have changed since the given sha ('main'). | | git_add(file: string, cwd?: string): boolean | Stage a file. | | git_add_all(cwd?: string): boolean | Stage all files. | | git_config(name: string, email: string, cwd?: string): boolean | Git config user name and email. | | gitFetchAll(cwd?: string, fetch_tags?: boolean): boolean | Execute a fetch command to get the latest changes from the remote repository. You can also retrieve tags | | gitCommit(message: string, body?: string, footer?: string cwd?: string): boolean | Commit the changes. | | gitTag(tag: string, message?: string, cwd?: string): boolean | Tag the repository with the given tag. | | gitPush(cwd?: string, follow_tags?: boolean): boolean | Push the changes to the remote repository, including optional tags. | | gitCurrentBranch(cwd?: string): string or undefined | Get the current branch name. | | gitCurrentSha(cwd?: string): string | Get's the current commit id. | | gitPreviousSha(cwd?: string): string or undefined | Get's the previous commit id. | | gitFirstSha(cwd?: string, branch?: string): string or undefined | Get's the first commit id in a branch. Compare is done between branch..Head, and it should be used as main..HEAD | | isWorkdirUnclean(cwd?: string): boolean | Check if the workdir is unclean (uncommited changes). | | gitCommitBranchName(sha: string, cwd?: string): string or undefined | Get the branch name for the commit id. | | gitAllFilesChangedSinceSha(sha: string, cwd?: string): Array<String> | Get all files changed sinc branch, commit id etc. | | getDivergedCommit(sha: string, cwd?: string): string or undefined | Get the diverged commit from the given sha (main). | | getCommitsSince(cwd?: string, since?: string, relative?: string): Array<Commit> | Get the commits since the given sha (main) for a particular package. | | getAllFilesChangedSinceBranch(package_info: Array<PackageInfo>, branch: string, cwd?: string): Array<String> | Get all the files changed for a branch (main). | | getLastKnownPublishTagInfoForPackage(package_info: PackageInfo, cwd?: string): Array<PublishTagInfo> | Get the last known publish tag info for a particular package. | | getLastKnownPublishTagInfoForAllPackages(package_info: Array<PackageInfo>, cwd?: string): Array<PublishTagInfo> | Get the last known publish tag info for all packages. | | getRemoteOrLocalTags(cwd?: string, local?: boolean): Array<RemoteTags> | Get all the tags in the remote or local repository. | | getConventionalForPackage(package_info: PackageInfo, no_fetch_all?: boolean cwd?: string, conventional_options?: ConventionalPackageOptions): ConventionalPackage | Get the conventional commits for a particular package, changelog output and package info. | | getBumps(options: BumpOptions): Array<BumpPackage> | Output bumps version for packages and it's dependencies | | initChanges(cwd?: string, change_options?: ChangesOptions): ChangesFileData | Creat changes file or retrieve is data if already exist | | addChange(change: Change, cwd?: string): boolean | Adds a new change to the change file | | removeChange(branch_name: String, cwd?: string): boolean | Removes the change from the changes files. | | changeExist(branch_name: string, packages_name: Array<string>, cwd?: string): boolean | Check if change already exist. | | getChange(branch_name: string, cwd?: string): Array<Change> | Get the list of changes for the branch. | | getChanges(cwd?: string): Changes | Get all changes. | | getPackageChange(package_name: string, branch: string, cwd?: string): Changes | Get a change by package name. | | changesFileExist(cwd?: string): boolean | Check if .changes.json file exist |

Develop requirements

  • Install the latest Rust
  • Install Node.js@16+ which fully supported Node-API
  • Run corepack enable

Test in local

  • pnpm
  • pnpm build
  • pnpm test

And you will see:

$ ava --verbose

  ✔ get defined package manager
  ─

  2 tests passed
✨  Done in 1.12s.

Release package

Ensure you have set your NPM_TOKEN in the GitHub project setting.

In Settings -> Secrets, add NPM_TOKEN into it.

When you want to release the package:

npm run build
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]

git push

GitHub actions will do the rest job for you.