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

padua

v4.0.1

Published

Setup, configure, build and publish npm plugins.

Downloads

224

Readme

padua

Tool to configure, setup, build and publish npm plugins.

Installation

First setup a new project with npm init or by manually creating a package.json and then add this tool to the project.

npm i --save-dev padua

Alternatively, you can start with various templates:

npm init now padua ./my-plugin [template]

Replace [template] with one of the following available templates: default, node, react, typescript, react-typescript, test or cli.

Usage

Upon installation a start and test script along with the necessary configuration have already been added to your package.json unless they already existed.

npm start

Builds the plugin in watch mode. Full command npx padua watch [--clean].

npm test

Run tests if there are any.

npx padua build

Builds the plugin minified for distribution including types.

npx padua lint

Lints the code and prints errors.

npx padua release

📦 Much simpler: Check out release-npm-action to automate releasing to npm.

  • Build if necessary
  • Checks if owner logged in
  • Automatically detects first release
  • Bumps version otherwise
  • Creates a release tag and changelog
  • Pushes tag to git
  • Runs npm publish
  • Released as version in package.json if yet unreleased

npx padua update

Checks if there are updates to any dependencies and automatically updates them.

Features

The goal of this package is to allow you to create npm plugins just having to focus on writing the actual features.

  • TypeScript / JavaScript
  • React
  • Jest
  • ESLint & Prettier Configuration and Integration
  • Standard-Versioning
  • Polyfills
  • Automatic Updates
  • Builds with esbuild and tsc

Configuration

Everything is zero-configuration but the configurations can easily be extended. To do that add a padua property to your package.json with the following options available:

{
  "name": "my-plugin",
  "padua": {
    // No build step, directly publish source files, default false.
    "source": true,
    // Output directory for build files, default 'dist'.
    "output": "public",
    // Is project written in TypeScript, automatically detected from extension (ts).
    "typescript": true,
    // Does the project include React, automatically detected from extension (jsx, tsx).
    "react": true,
    // Are there any tests, default false.
    "test": true,
    // Name of the entry files, automatically adds [src/]?index.[jt]sx? files if available.
    "entry": "another.tsx",
    "entry": ["another.js", "several.jsx"],
    "entry": "theme/*.ts",
    // package.json properties to be left untouched during configuration.
    "ignorePkgProperties": ["engines", "eslintConfig.rules"],
    // Additional tsconfig properties that will be added to the extended tsconfig.json.
    "tsconfig": {
      "compilerOptions": {
        "types": [
          "@types/jest"
        ]
      }
    },
    // Additional configuration passed to esbuild.
    "esbuild": {
      "external": [
        "naven"
      ]
    },
    // Add stylelint configuration, default false.
    // true if @emotion/react, styled-components or jss installed.
    "stylelint": true,
    // Folders to ignore by lint and/or test tools, "output" folder always ignored.
    // String => ignore for lint & test, disable either with `test: false` or `lint: false`.
    "ignore": ['demo', { name: 'index.d.ts', test: false }, { name: 'test/fixture', lint: false }]
  },
  "eslintConfig": {
    // Added automatically upon installation.
    "extends": "./node_modules/padua/configuration/eslint.cjs"
    // Override ESLint default here.
    "rules": {
      "no-console": 0
    }
  },
}