@vestify/dev-kit
Common tools and configuration for developing @vestify modules
Last updated a month ago by jack-barry .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @vestify/dev-kit 
SYNC missed versions from official npm registry.

Vestify Dev Kit

Build Status Coverage Status Depfu Maintainability

What Is It?

@vestify/dev-kit is a set of common configurations and tools for the @vestify suite of projects. It abstracts away some of these common configurations and tools so that projects are cleaner and more focused while ensuring consistency in style across all projects housed under the @vestify scope.

Feel free to use @vestify/dev-kit outside of the @vestify scope if you would just like to focus on writing a TypeScript project with some sane defaults baked in and want to write minimal boilerplate/scaffolding/configuration.

You can also roll your own dev kit using some of the tools @vestify/dev-kit makes available as a module. The exported module provides some utilities that make setting up your own dev kit nearly effortless. Just write your bin files using the provided functions and point them to your own configuration specifics. (To see some examples on how to write your bin files, check out src/bin.)

Usage

Since @vestify/dev-kit has a few peerDependencies, you may want to run the install script with the -s flag as shown below in order to avoid getting bombarded with NPM warning messages.

For a brand-spanking-new project, create a folder then navigate into it using your shell of choice and initiate it using the following commands:

MacOS and Linux

git init
npm init -y && npm i -D -s @vestify/dev-kit && npx vestify-use-dev-kit

PowerShell

git init
npm init -y; npm i -D -s @vestify/dev-kit; npx vestify-use-dev-kit

vestify-use-dev-kit will perform the following (with your permission of course ????):

  1. ???? Ensure that your license is set to MIT
  2. Ensure that you have build ????, publish ???? and test ???? scripts which use the @vestify standard configuration
  3. ⚙️ Ensure that you have all the config files you need, and that they are pointed to the @vestify/dev-kit defaults if they can extend an existing configuration
  4. ???? Set up your husky Git hooks
  5. ???? Set up your prettier configuration for easy code formatting
  6. ???? Alphabetize your scripts section so they are easier to sift through
  7. ???? Ensure you have a src directory to write your code in, and add index.ts, index.spec.ts, and testDrive.ts files if not already there
  8. ???? Install any peerDependencies of @vestify/dev-kit

Note that once Git hooks are in place, you will only be allowed to attempt to push to the master, development and releases branches if no remote repository is found. If a remote repository is found, you will not be able to make commits to the master, development or releases branches, so make sure to create a feature/FEATURE_NAME or hotfix/FIX_NAME branch before making your commits. To learn more about the branching strategy @vestify projects follow, read this article.

Some Things You Get for "Free"

Some packages will be installed as dependencies of @vestify/dev-kit so you do not need to install them directly into your project to use them as devDependencies. (Note that if you wish to use them as dependencies of code shipped from your project, you will need to add them as such.) Check the package.json of @vestify/dev-kit to see a full list of which dependencies are included, but at a glance here are a few that are useful in almost any project:

  • glob is great for finding files that match glob patterns
  • chai is the preferred assertions library of the Vestify team for JavaScript testing
  • chalk makes writing colorful and expressive console output a breeze
  • cross-env is handy for writing cross-platform scripts that require environment variables
  • lodash takes care of a lot of low-level JavaScript object handling
  • mocha is the preferred JavaScript test runner of the Vestify team
  • shx allows you to write Unix-y scripts that will run cross-platform

You also get some commonly used type definitions, such as:

  • @types/chai
  • @types/glob
  • @types/lodash
  • @types/mocha
  • @types/node

Updates

Whenever you update @vestify/dev-kit, you will need to run npx vestify-use-dev-kit again. At that point, you will be notified if any of your configuration settings do not match the updated defaults. You can choose which settings/files to opt in or out of.

Customization

@vestify/dev-kit provides you with some configuration files which you can extend to meet your specific project's needs. You can also always update your NPM scripts in package.json if you need more control.

The following files in your root directory can be modified as needed:

  • .eslintrc.json
  • .gitignore
  • .npmignore
  • README.md
  • tsconfig.build.json (Used for compilation so that you can omit .spec. and other files from your published module)
  • tsconfig.json (Used for dev so that you can have aliases in .spec. files)

Note that if @vestify/dev-kit detects that your local configuration does not match its defaults, it will notify you when running vestify-use-dev-kit but you can select n or just hit enter when prompted since by default it will not overwrite your settings.

Mocha Config

If you'd like to use your own Mocha configuration file, point your test scripts at it:

{
  "scripts": {
    "dev:test": "vestify-dev-test --mocha-config my.mocharc.js",
    "test": "vestify-test --mocha-config my.mocharc.js"
  }
}

Note that if you'd like to extend the default config, you can import it from the templates folder of this library and merge it with your own.

Istanbul Config

If you'd like to use your own Istanbul/NYC configuration file, point your coverage script and pre-push hook at it:

{
  "scripts": {
    "cover": "vestify-cover --nyc-config my.nyc.config.js"
  },
  "husky": {
    "hooks": {
      "pre-push": "cross-env FORCE_COLOR=1 vestify-git-push --nyc-config my.nyc.config.js"
    }
  }
}

Note that if you'd like to extend the default config, you can import it from the templates folder of this library and merge it with your own.

Current Tags

  • 1.0.19                                ...           latest (a month ago)

20 Versions

  • 1.0.19                                ...           a month ago
  • 1.0.18                                ...           a month ago
  • 1.0.17                                ...           a month ago
  • 1.0.16                                ...           a month ago
  • 1.0.15                                ...           a month ago
  • 1.0.14                                ...           2 months ago
  • 1.0.13                                ...           3 months ago
  • 1.0.12                                ...           3 months ago
  • 1.0.11                                ...           3 months ago
  • 1.0.10                                ...           3 months ago
  • 1.0.9                                ...           3 months ago
  • 1.0.8                                ...           3 months ago
  • 1.0.7                                ...           3 months ago
  • 1.0.6                                ...           3 months ago
  • 1.0.5                                ...           3 months ago
  • 1.0.4                                ...           3 months ago
  • 1.0.3                                ...           3 months ago
  • 1.0.2                                ...           4 months ago
  • 1.0.1                                ...           4 months ago
  • 1.0.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 38
Dependencies (32)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |