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

@botonic/dx

v0.30.0

Published

Continuous integration for botonic packages

Downloads

1,028

Readme

Botonic CI (continuous integration)

What Does This Package Do?

This package simplifies the configuration of all CI tasks for projects which use botonic.

Features

  • eslint
  • typescript type checking

Setup

  • Install this package
npm install -D @botonic/dx
  • Copy the contents of the sample-config folder to the root of your project (Merge this package.json's scripts into your project ones)
  • The files at sample-config just import the configuration maintained within this project. To adapt them to your project needs, you just need to patch the specific options after importing the baseline. See instructions on each of these files.

package.json

Instructions here because it cannot contain comments

  • Even if you don't plan to publish your package, it's important to correctly configure the "files" field. Otherwise, you may get the node/no-unpublished-import eslint error when importing a dev dependency from a test or a configuration file (remove --cache from eslint command after updating your package.json).

Usage

eslint

For a project to use our proposed eslint configuration, you'll need to:

  • Add the scripts starting with lint from sample-config/package.json to your package.json.
  • npm run lint will now perform a quick check which will also fix some of the detected issues.
  • npm run lint-ci will perform a slower check which detects more issues. It will not fix any issue, since it's designed to be integrated into your CI pipeline.

Due to an eslint_d issue, --fix --quiet does not autofix issues.

Please check the eslint user guide for adapting this configuration to your needs.

Typescript

In case your project uses typescript (or contains .d.ts files), add the scripts starting with build from sample-config/package.json to your package.json

  • npm run build will transpile into JS.
  • npm run build-ci will validate your project source code and tests using your tsconfig.test.json configuration

Implementation details

Depends on @botonic/eslint-config. As per the official documentation, the eslint plugins are configured there as peer dependencies. This is why they appear here again as dependencies, but with free version (*), to avoid duplicating the version specification.

Dependencies

@types/node must be a direct dependency. If only defined in a parent package.json, we get TSC errors for symbols from these libs: "ES2016.Array.Include", "ES2017.object"

Version

Due to a npm bug, npm version interaction with git (check clean stage, commit and create tag) is broken. Hence, sample-config manually checks that there are no modifications in git files.

npm

This package must be published with npm 7. With v6, there's no way to install hidden files (required for sample-config files) However, looks like "engines" restriction does not work. Also, npm 7 still has issues with our monorepo (hangs and spurious errors).

How to deploy with npm7

So, so far it's recommended to:

  • Leave npm 6 globally installed
  • Install npm 7 locally in an empty project (cd <project_with_npm7> && npm init && npm i npm)
  • cd botonic/packages/botonic-dx && <project_with_npm7>/node_modules/.bin/npm publish

Future work

.js files not yet processed with eslint because some rules require the typescript parser, which runs only on .ts files. It will be fixed by applying these rules only to .ts files.