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

@genesisx/scripts

v0.0.1-beta.4

Published

A custom scripts package for GenesisX packages

Downloads

3

Readme

Scripts

GenesisX Scripts to be used in other GenesisX app generators. This package is a utility package that provides simple interface to serve other GenesisX packages.

Aim

If you have used tools like create-react-app or create-next-app to create your react or nextjs apps, then you must have seen dependencies like react-scripts or next getting used in package.json file.

Eg.

### in react apps
scripts: {
  build: react-scripts build,
  dev: react-scripts dev
}

### in nextjs apps
scripts: {
  build: next build,
  dev: next dev,
  lint: next lint
}

Similarly, this package is aimed at providing a simplified interface to run certain scripts which could/would be too tedious for end users to replicate.

Where is it used?

Currently, this package contains the scripts used in the design-system template generated by @genesisx/design-system.

| Script | Package | Description | | ------------ | -------------------------------------------------- | ----------------------------------------------------------------------------------------------- | | ds-build | @genesisx/design-system | Builds 1 or more ui components from the root of the project | | ds-publish | @genesisx/design-system | Publishes 1 or more ui components from the root of the project | | genesisx | @genesisx/design-system, @genesisx/react-archetype | Executes the passed command present inside any package from the root (works for workspaces too) |

Sample Usage

Generic (genesisx)

It is a versatile executor designed to run scripts specified in package.json files within a valid workspace. It acts as a generic tool, capable of executing any script mentioned in the configuration of a project, providing flexibility and adaptability across various packages.

Lets say that you have a monorepo workspace with apps/sample_app and packages/ui directories. And both sample_app and ui have build scripts in their respective package.json.

# apps/sample_app/package.json
"scripts": {
  "build": "yarn dev",
  # ...
}
# apps/ui/package.json
"scripts": {
  "build": "tsup",
  # ...
}

If you are not using NX, Turbo, Lerna or other monorepo managers, building individual packages from the root of the repo is tedious and time consuming.

You can simply add the following in your root package.json to simplify the above process:

# package.json
"scripts": {
  "build:app1": "genesisx build my_app",
  "build:ui": "genesisx build ui",
  # ...
}

Now, the user can simply run, npm run build:app1 or npm run build:ui from the root. You can replicate the same process for other commands/scripts.

Design System (ds-build, ds-publish)

The generated boilerplate from @genesisx/design-system will contain a build and publish script that will be added in the root package.json file.

# package.json
"scripts": {
  "build:ui": "genesisx ds-build",
  "publish:ui": "genesisx ds-publish"
  # ...
}

NOTE: Here, genesisx is the executor name and ds-build or ds-publish is the script name.

The user can build all their components as follows:

npm run build:ui

or if they want to build only their Button and Dropdown components, they can run:

npm run build:ui Button Dropdown