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

standard-tools

v1.1.0

Published

Predefined standards to use across all new project repositories

Downloads

1

Readme

Lazy init

Predefined standards to use across all new project repositories

Tools

  • .gitignore
  • package.json
  • Prettier
  • ESLint
  • Hooks
  • Typescript
  • commitlint
  • lint-staged
  • Renovate*
  • CI (
    • prepare
    • linting
    • test
    • build
    • deploy
    • synchronize )
  • Readme
  • Jest*

Commands

  • git init

  • curl -L "https://gitlab.goodgamestudios.com/lazy-init/-/blob/master/.gitignore" > ".gitignore"

  • npm init -y

  • mkdir src

  • npm i @goodgamestudios/standard-tools -D

Prettier

  • npm i prettier -D
  • echo "@goodgamestudios/standard-tools/prettier" > .prettierrc.json
  • curl -L "https://gitlab.goodgamestudios.com/lazy-init/-/blob/master/.prettierignore" > .prettierignore

Eslint

  • npm i eslint -D (Not sure if this is needed when using npm link) To be able to extend eslint rules, we need to create an package called "@scope/eslint-config*", it's a naming convention from eslint that need to be followed

  • npm link @goodgamestudios/eslint-config Does it create the eslintrc.json? if not

  • curl -L "https://gitlab.goodgamestudios.com/lazy-init/-/blob/master/.eslintrc.json" > .eslintrc.json

Default npm scripts:

"scripts": {
  "--------------- Generic scripts ---------------": "----------------------------------------------------------",
  "clean": "rimraf dist/",
  "build": "TODO...",
  "deploy": "standard-version --prerelease $ENV && TODO...",
  "test": "jest --coverage",
  "--------------- build & deploy scripts ---------------": "---------------------------------------------------",
  "serve": "npm run clean && cross-env NODE_ENV=dev TODO...",
  "build:dev": "cross-env-shell ENV=dev NODE_ENV=dev \"npm run clean && npm run build\" ",
  "deploy:dev": "cross-env ENV=dev npm run deploy",
  "build:staging": "cross-env-shell ENV=staging NODE_ENV=staging \"npm run clean && npm run build\" ",
  "deploy:staging": "cross-env ENV=staging npm run deploy",
  "build:production": "cross-env-shell ENV=production NODE_ENV=production \"npm run clean && npm run build\" ",
  "deploy:production": "standard-version && TODO...",
  "--------------- ci deployment ---------------": "------------------------------------------------------------",
  "ci:deploy:dev": "npm run build:dev && npm run deploy:dev",
  "ci:deploy:staging": "npm run build:staging && npm run deploy:staging",
  "ci:deploy:production": "npm run build:production && npm run deploy:production",
  "--------------- formatting ---------------": "---------------------------------------------------------------",
  "lint": "eslint \"**/*.{ts,tsx}\"",
  "lint:fix": "npm run lint -- --fix",
  "prettier": "prettier --check .",
  "prettier:fix": "npm run prettier -- --write"
}
npm pkg set "scripts"='{ "--------------- Generic scripts ---------------": "----------------------------------------------------------", "clean": "rimraf dist/", "build": "TODO...", "deploy": "standard-version --prerelease $ENV && TODO...", "test": "jest --coverage", "--------------- build & deploy scripts ---------------": "---------------------------------------------------", "serve": "npm run clean && cross-env NODE_ENV=dev TODO...", "build:dev": "cross-env-shell ENV=dev NODE_ENV=dev \"npm run clean && npm run build\" ", "deploy:dev": "cross-env ENV=dev npm run deploy", "build:staging": "cross-env-shell ENV=staging NODE_ENV=staging \"npm run clean && npm run build\" ", "deploy:staging": "cross-env ENV=staging npm run deploy", "build:production": "cross-env-shell ENV=production NODE_ENV=production \"npm run clean && npm run build\" ", "deploy:production": "standard-version && TODO...", "--------------- ci deployment ---------------": "------------------------------------------------------------", "ci:deploy:dev": "npm run build:dev && npm run deploy:dev", "ci:deploy:staging": "npm run build:staging && npm run deploy:staging", "ci:deploy:production": "npm run build:production && npm run deploy:production", "--------------- formatting ---------------": "---------------------------------------------------------------", "lint": "eslint \"**/*.{ts,tsx}\"", "lint:fix": "npm run lint -- --fix", "prettier": "prettier --check .", "prettier:fix": "npm run prettier -- --write" }' --json

Add dev packages

  • npm i -D
    • rimraf
    • cross-env
    • standard-version (or semantic-release?)
    • jest
    • ts-jest
    • simple-git-hooks
    • lint-staged
    • @commitlint/cli
    • typescript
    • ts-node
    • @types/jest
    • @types/node
  npm i -D rimraf cross-env standard-version jest simple-git-hooks lint-staged @commitlint/cli typescript

Hooks

"simple-git-hooks": {
  "pre-commit": "npx lint-staged",
  "commit-msg": "npx commitlint --edit ",
  "pre-push": "npm test"
}
  npm pkg set "simple-git-hooks"='{ "pre-commit": "npx lint-staged", "commit-msg": "npx commitlint --edit ", "pre-push": "npm test" }' --json
  git config core.hooksPath .git/hooks/
  rm -rf .git/hooks
  npx simple-git-hooks

Commitlint

"commitlint": {
  "extends": [
    "@goodgamestudios/standard-tools/commitlint"
  ]
}
  npm pkg set "commitlint"='{ "extends": [ "@goodgamestudios/standard-tools/commitlint" ] }' --json

Lint staged

"lint-staged": {
  "*.ts": [
    "npm run prettier:fix",
    "npm run lint:fix"
  ],
  "*.md": [
    "npm run prettier:fix"
  ]
}
npm pkg set "lint-staged"='{ "*.ts": [ "npm run prettier:fix", "npm run lint:fix" ], "*.md": [ "npm run prettier:fix" ] }' --json

typescript

  echo '{ "extends": "@goodgamestudios/standard-tools/tsconfig" }' > tsconfig.json