@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-kitPowerShell
git init
npm init -y; npm i -D -s @vestify/dev-kit; npx vestify-use-dev-kitvestify-use-dev-kit will perform the following (with your permission of course
๐):
- ๐ Ensure that your
licenseis set toMIT - Ensure that you have build ๐งฑ, publish ๐ and test ๐งช scripts which use the
@vestifystandard configuration - โ๏ธ Ensure that you have all the config files you need, and that they are
pointed to the
@vestify/dev-kitdefaults if they can extend an existing configuration - ๐ Set up your
huskyGit hooks - ๐ Set up your
prettierconfiguration for easy code formatting - ๐ Alphabetize your scripts section so they are easier to sift through
- ๐ Ensure you have a
srcdirectory to write your code in, and addindex.ts,index.spec.ts, andtestDrive.tsfiles if not already there - ๐ซ Install any
peerDependenciesof@vestify/dev-kit
Note that once Git hooks are in place, you will only be allowed to attempt to push to the
master,developmentandreleasesbranches if no remote repository is found. If a remote repository is found, you will not be able to make commits to themaster,developmentorreleasesbranches, so make sure to create afeature/FEATURE_NAMEorhotfix/FIX_NAMEbranch before making your commits. To learn more about the branching strategy@vestifyprojects 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:
globis great for finding files that match glob patternschaiis the preferred assertions library of the Vestify team for JavaScript testingchalkmakes writing colorful and expressive console output a breezecross-envis handy for writing cross-platform scripts that require environment variableslodashtakes care of a lot of low-level JavaScript object handlingmochais the preferred JavaScript test runner of the Vestify teamshxallows 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.npmignoreREADME.mdtsconfig.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.
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago