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

generator-tsmod

v2.0.0

Published

<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

Downloads

23

Readme

generator-tsmod

Installation

npm install -g yo
npm install -g generator-tsmod

Synopsis

  • Generate project scaffold. Also executes npm init if no package.json found.
yo tsmod
  • Generate project scaffold with additional options.
yo tsmod --vuepress --typedoc --license MIT --no-coverage --no-import-helpers --no-typedoc --no-not-sync
  • Remove generated but unmodified files safely. --no-install prevents running npm install command.
yo tsmod:uninstall --no-install --force
  • Update already generated project using auto created yo:update script from package.json.
npm run yo:update

Features Overview

This is a yeoman generator which is used to create TypeScript project. It features:

Details

Notes

  • Add NPM_TOKEN via GitHub > Settings > Secrets. (GitHub Actions workflow use it in Semantic Release step to publish your package to npm)

Scripts from package.json

For Projects

| Script | Description | | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | release | See below Update README, add changed files to git and push. Github Actions releases your code. | | yo:update | Uninstall and re-generate project safely. | | execute | Run given source file. | | watch | Run given source file and watch for changes to re-run. | | lint | Lint and format source code. | | format | Format all supported files (source code, css, graphql etc.). | | test | Test project. Use -- --no-coverage --watch for watching. | | readme | Update README.md file using readmeasy. | | build | Build project using TypeScript. -- --watch for watching. | | docs:build | Build VuePress for production. Can be used by netlify for building. | | docs:dev | Starts VuePress development web site. (TypeDoc should be updated manually during development.) | | typedoc:html | Generate TypeDoc HTML documentation web site into api-docs-html directory. | | typedoc:md | Generate VuePress compatible Markdown from TypeDoc comments into api-docs-md directory. (Renames all index.md files (i.e. for Index class) as index2.md, because VuePress throws error for index.md files) | | typedoc:single-md | Generates Markdown files from TypeDoc and concatenates them into api.md file. |

For Internal Use

| Script | Description | | --------------------- | ------------------------------------------------------------- | | update-packages | Update dependencies in all package.json files in templates. | | postinstall | Install husky. |

TODO

| Script | Command | Description | | ------------ | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | | postreadme | oclif-dev readme | Inserts oclif documenatition into README.md after README.md is generated by readmeasy. |

Features

Uninstall

yo tsmod:uninstall --force --no-install

Above command removes non-user modifiable files and other files not modified by user from project. Also removes added configurations if they are not modified by user. To track modifications, this module uses Yeoman config file .yo-rc.json. --no-install prevents npm install usually not mandatory after dependencies are removed, to speed up uninstall.

Semantic Release

Fully automated version management and package publishing. semantic-release automates the whole package release workflow including: determining the next version number, generating the release notes and publishing the package. This removes the immediate connection between human emotions and version numbers, strictly following the Semantic Versioning specification.

Used in .github/workflows/main.yml release step.

Commitizen

Packages: commitizen, cz-conventional-changelog

When you commit with Commitizen, you'll be prompted to fill out any required commit fields at commit time.

Commit Lint & Standard Version

Packages: @commitlint/cli & @commitlint/config-conventional, standard-version,

commitlint checks if your commit messages meet the conventional commit format.

Standard Version: Automate versioning and CHANGELOG generation, with semver.org and conventionalcommits.org

Commitlint: Checks if your commit messages meet the conventional commit format.

First Release

standard-version --first-release will tag a release without bumping the version

standard-version will tag a release and bump the version

Husky

Packages: husky

Git hooks made easy. Husky can prevent bad git commit, git push and more. It is used here to execute

  • lint-staged at precommit,
  • commitlint at commit-msg,
  • commitizen at prepare-commit-msg (currently disabled, see this issue)

Lint Staged

Packages: lint-staged

Run linters against staged git files, so non-changed files are excluded from linters.

| File Type | What | | ------------------------ | -------------------- | | js, ts | Lint, test, coverage | | json, md, css etc. | Format | | rc, json | Lint |

Documentation

TypeDoc

TypeDoc TypeDoc converts comments in TypeScript source code into rendered HTML documentation. Also it is possible to create multiple Markdown files using typedoc-plugin-markdown plugin. Using concat-md it is possible to create single Markdown file.

VuePress

VuePress is used to create documentation web sites. vuepress-bar is used to generate VuePress menu. Also TypeDoc HTML and typedoc-plugin-markdown generated API docs is included in VuePress site.

Netlify may be used to publish documentation.

Additional Notes

.npmignore (or lack of)

.npmignore is not used, because this file overrides .gitignore and may results unpredictable behavior. Instead of using a blacklist for node modules, it is safer to write whitelisted files to be published in files key in package.json.