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

@grnx/sx

v0.1.0

Published

[![npm](https://img.shields.io/npm/v/@grnx/sx)](https://www.npmjs.com/package/@grnx/sx) [![License](https://img.shields.io/github/license/gearonix/sorry-nx)](https://github.com/gearonix/sorry-nx) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-br

Downloads

4

Readme

Sorry-Nx

npm License PRs Welcome

Sorry-Nx is a tiny alternative to the Nx Runner CLI, providing comprehensive task running capabilities.

It supports 4 package managers, dependency graphs, custom schemas, multitasking, and more.

The library seamlessly integrates with package.json scripts, making it a flexible choice for your project needs.

Quick Features

  • 🧨 Comprehensive TypeScript support
  • 🤯 Faster task executions
  • 🔢 Out-of-the-box support for npm, yarn, pnpm, and bun
  • 💣 Custom configuration
  • 🗿 Nx-like schemas (project.json)
  • 🔥 Interactive mode
  • 👍 Schema generation

Table of Contents

Installation

You can install sorry-nx via your preferred package manager:

# using pnpm
$ pnpm add -g @grnx/sx

# using yarn
$ bun install -g @grnx/sx

# using npm
$ npm install -g @grnx/sx

Usage

sx - Run Target

Execute a command defined in project targets or package.json scripts.

It automatically detects your package manager and is built on the workspaces pattern.

sx serve frontend

# npm run serve --workspace=frontend --silent
# yarn --silent workspace frontend run serve
# pnpm --filter=frontend run serve --silent
# cd ~/my-prj/frontend && bun run frontend --silent

For the root workspace:

sx serve

# with extra options
sx serve --parallel --envFile .env.development
sx serve --cwd ~/dsk/backend

Interactive Mode

Running the command without arguments initiates the interactive mode, allowing you to select projects and commands to run.

sx # without arguments

sx run-many - Run Multiple Commands

Run multiple targets and multiple projects. (similar to nx/run-many).

sx run-many --parallel=3 projects=frontend,backend
sx run-many --parallel=10 exclude=backend
sx run-many --all

targets.json - Schemas

Define custom configurations for each script, similar to Nx project.json.

Create a targets.json file in the root of each workspace.

.
+-- targets.json
`-- packages
   +-- frontend
   |   `-- targets.json
   `-- backend
       `-- targets.json

Example of targets.json

{
  "build": "vite build",
  "preview": {
    "description": "Add description here",
    "commands": ["vite preview", "rimraf tmp/logs"],
    "args": "--host 127.0.0.1",
    "cwd": "packages/frontend",
    "parallel": true,
    "envFile": ".env.production"
  },
  "dev": {
    "command": "vite dev",
    "env": {
      "VITE_PORT": 3000
    }
  }
}

sx migrate - Migrate from package.json Scripts

Generate a targets.json file from package.json scripts for the project. Works for all nested projects with the all flag.

sx migrate frontend
sx migrate --all # deep migration to targets.json

sx show - Show Workspace Projects

Display the dependency graph, structured on workspaces using any package manager.

sx show
sx show --json # json format
# output
@nx/react-native - /home/grnx/hub/nx/packages/react-native
@nx/remix - /home/grnx/hub/nx/packages/remix
@nx/rollup - /home/grnx/hub/nx/packages/rollup
@nx/storybook - /home/grnx/hub/nx/packages/storybook

Configuration

; .sxrc

preferredResolvingOrder[] = package-scripts
preferredResolvingOrder[] = targets

; default = targets.json
commandsFile = commands.json

Set a custom configuration file path:

# ~/.bashrc

export SX_CONFIG_FILE="$HOME/.sxrc"

For Windows:

# Set a custom configuration file path in PowerShell accessible within the `$profile` path
$Env:SX_CONFIG_FILE = 'C:\to\your\config\location'

Contribution: If you encounter any bugs, please submit an issue.