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

plant-cli

v1.36.0

Published

cli for quick, opinionated creation of typescript projects

Downloads

15

Readme

logo

Plant

CLI for quick, opinionated creation of typescript projects.

After finding myself going through the same process of creating and modifying boilerplates over and over again, I have reached a conclusion that I'm wasting too much of my time on bootstrapping projects, rather than working on them: Whether it's because of tools which require too much configuration (such as babel or webpack) or tools which "opinions" differ from mine (such as create-react-app) which I then have to hack upon.

That's where plant comes into play - this is a tool that's like a macro runner more than anything else: it has a very clear and extensible DSL that handles everything from basic i/o operations to domain-specific actions, such as npm install.

Feel free to contribute by either PRing, forking, altering and adding different macros and recipes.

Install

Install globally using npm:

$ npm install -g plant-cli

Usage

Create an empty project directory, and within it run the following command:

$ plant [recipe]

Where [recipe] is the name of the foundation from which you want to create your project. This is an optional parameter, and if omitted, defaults to vanilla - which is the most basic project.

Available Recipes

The following recipes are built in and ready to use out of the box:

  • vanilla: Basic zero-conf typescript project, which initializes a git repo and uses jest for testing

    Typescript, Jest, TSLint
  • electron: Electron application with react, typescript, jest and sass modules, powered by the parcel bundler

    Typescript, Jest, TSLint, React, Parcel, SASS, Electron, Electron-Builder
  • express: Express-only application which utilizes json as body parser

    Express, Typescript, Jest
  • react-component: React component library that is not a standalone project

    React, Parcel, Jest, Typescript, TSLint
  • react-express: Fullstack React & Express application with typescript, jest and sass modules

    React, Create-React-App, SASS, Express, TSLint
  • react-native: React Native application with typescript, sass and jest

    React Native, SASS, Typescript, TSLint
  • react-nodegui: React-NodeGUI application with typescript, jest and sass, powered by the parcel bundler (experimental)

    Typescript, Jest, TSLint, React, Parcel, NodeGUI, SASS
  • react-parcel: React application with typescript, jest and sass modules, powered by the parcel bundler

    Typescript, Jest, TSLint, React, Parcel, SASS
  • react: React application with typescript, jest and sass modules

    React, Create-React-App, SASS

Extending plant

plant DSL is composed of the following groups of entities:

  • utils: basic, un-opinionated operations (e.g: readFile)
  • actions: domain-specific atomic operations (e.g npmInstall)
  • fragments: composition of actions that serve a specific purpose (e.g add express to project)
  • recipes: composition of fragments which produce a working boilerplate project

Adding utils and actions

Adding a util, an action or a fragment is straight forward - just look at the existing code and add your own in the same flavour.

Adding Fragments

Fragments work very much like utils and actions, with a small addition: a fragment can export a tags variable, which holds an array of string tags representing the components of this fragment. For example, the add-react-with-parcel fragment exports react, parcel and sass, as those three components are added by this fragment.

Fragment tags are then collected and displayed in the README, under the recipes which use said fragments.

Adding recipes

plant recognizes everything in the recipes directory as a recipe, its name being its filename. As it addresses recipes by name, recipe files should maintain the RecipeType interface (found in recipe.ts) where they export two functions:

  1. recipe(): Promise<void> - the recipe routine that is called by the recipes runner and either resolves or aborts using the terminate() util.

  2. description(): string - a description of the recipe, used to compose this README file.

Adding Fragments

Adding a util, an action or a fragment is straight forward - just look at the existing code and add your own in the same flavour.

Refer to one of the existing recipes for examples.

Contribution

Contributions are welcome! If you want to submit a pull request, please do.

icon designed by good-ware from flaticon.com