mkit-bundle-npm-package
v1.0.1
Published
Micro npm package project bundle
Downloads
1
Maintainers
Readme
:blue_book: mkit-bundle-npm-package
Micro npm package project bundle
Slightly opinionated npm
package starter template supporting various best practices.
Ever wanted to create and publish your own npm
package? And you still want to use all the latest JS features, (es)lint, prettify, tests... Say No More!
Bug reports and PRs are more than welcome!
Motivation
This project strives to deliver clean folder structure and satisfying development experience. Easy.
Zero boilerplate configuration. As simple as npm install
and you're all set to start writing your own code!
Without having X folders with Y configuration files that you're never supposed to modify.
There are several boilerplates out there, but we felt they all miss a thing or two. Nowadays, tools as linting, code formatting and tests are must-haves and should be part of every modern JS project. So why bother setting them all again and again?
Features
- [x] :100: Latest JS Support
- [x] :top: Latest Babel 7
- [x] :zap: ESlint, Prettier, EditorConfig
- [x] :open_file_folder: Clean folder Structure
- [x] :white_check_mark: Tests with Jest
- [x] :chart_with_upwards_trend: Test Coverage Report
- [x] :rocket: Production Build
- [x] :tada: Publishing Process
- [x] :construction_worker:
npm run
all the things - [x] :vertical_traffic_light: Pre-commit hooks
- [x] :blue_book: Examples
Getting Started
Automagically...
This whole project can be installed automagically using our smart tool.
Visit
mkit-bundler
That's pretty much it... :boom: :boom: :boom:
Don't worry, these instructions will be present there too!
or Manually
These simple steps will get you a copy of the project, make it your own and let you start hacking right away!
- Clone the repository
git clone https://github.com/mkitio/mkit-bundle-npm-package.git <your-project-name>
- Make it your own
cd <your-project-name> && rm -rf .git && git init
- Install the dependencies
npm install
- Test your installation
npm run test
- Start hacking!
# code and have fun
npm run test:examples
You would want to test your code while developing. The /examples
folder can serve you good or you can always run scripts like npm run <your-script>
.
Folder Structure
.
├── __tests__ # Test files
├── examples # Examples and demo code (for ref., can be out of version control)
├── lib # Build destination (autogenerated, out of version control)
├── src # Source files
├── LICENSE
├── README.md
├── ...
└── package.json
Available Scripts
In the project directory, you can run:
# Clean the build folder `/lib`
$ npm run clean
# Run all Tests
$ npm run test
# Run all Tests in continuous `--watch` mode
$ npm run test:watch
# Run all Tests and generate Coverage Report
$ npm run test:coverage
# Run all `/examples`
$ npm run test:examples
# Run all Tests against Production environment
$ npm run test:prod
# Lint all `/src` files
$ npm run lint
# Build against Production environment
$ npm run build
# Release and publish
$ npm run release
Tests
This project uses Jest as its test runner.
Jest will look for test files in the /__tests__
folder and its contents. We recommend naming your test files with .test.js
suffix. However, Jest will automatically search for any files with {.js, .test.js, .spec.js}
extensions.
Coverage Report collects information from all .js
files in the /src
folder.
If you want to tweak Jest, you can do it in package.json
or follow the official configuration docs.
Publishing
When you are ready to publish your package there is a handful command to help you - release
.
$ npm run release
release
executes multiple script commands in the following order:
npm test
- Run all tests and reportnpm run build
- Build the/src
code using Babelnpm release-it
- Automated commit,semver
, tagging, publishing tonpm
, and more
Authors
Stoyan Merdzhanov - Initial work - MK IT
See also the list of contributors who participated in this project.
License
The MIT License (MIT)
Copyright (c) 2018-present MK IT Ltd. <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.