Socket
Socket
Sign inDemoInstall

generator-tsmod

Package Overview
Dependencies
22
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-tsmod

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


Version published
Weekly downloads
712
increased by15.96%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

ScriptDescription
releaseSee below Update README, add changed files to git and push. Github Actions releases your code.
yo:updateUninstall and re-generate project safely.
executeRun given source file.
watchRun given source file and watch for changes to re-run.
lintLint and format source code.
formatFormat all supported files (source code, css, graphql etc.).
testTest project. Use -- --no-coverage --watch for watching.
readmeUpdate README.md file using readmeasy.
buildBuild project using TypeScript. -- --watch for watching.
docs:buildBuild VuePress for production. Can be used by netlify for building.
docs:devStarts VuePress development web site. (TypeDoc should be updated manually during development.)
typedoc:htmlGenerate TypeDoc HTML documentation web site into api-docs-html directory.
typedoc:mdGenerate 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-mdGenerates Markdown files from TypeDoc and concatenates them into api.md file.

For Internal Use

ScriptDescription
update-packagesUpdate dependencies in all package.json files in templates.
postinstallInstall husky.

TODO

ScriptCommandDescription
postreadmeoclif-dev readmeInserts 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 TypeWhat
js, tsLint, test, coverage
json, md, css etc.Format
rc, jsonLint

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.

Keywords

FAQs

Last updated on 31 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc