@vestify/dev-kit v1.1.1
Vestify Dev Kit
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
๐):
- ๐ Ensure that your
license
is set toMIT
- Ensure that you have build ๐งฑ, publish ๐ and test ๐งช scripts which use the
@vestify
standard configuration - โ๏ธ 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 - ๐ Set up your
husky
Git hooks - ๐ Set up your
prettier
configuration for easy code formatting - ๐ Alphabetize your scripts section so they are easier to sift through
- ๐ Ensure you have a
src
directory to write your code in, and addindex.ts
,index.spec.ts
, andtestDrive.ts
files if not already there - ๐ซ 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
andreleases
branches if no remote repository is found. If a remote repository is found, you will not be able to make commits to themaster
,development
orreleases
branches, so make sure to create afeature/FEATURE_NAME
orhotfix/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 patternschai
is the preferred assertions library of the Vestify team for JavaScript testingchalk
makes writing colorful and expressive console output a breezecross-env
is handy for writing cross-platform scripts that require environment variableslodash
takes care of a lot of low-level JavaScript object handlingmocha
is the preferred JavaScript test runner of the Vestify teamshx
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.
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago