mkit-bundle-npm-package

1.0.1 • Public • Published

📘 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] 💯 Latest JS Support
  • [x] 🔝 Latest Babel 7
  • [x] ESlint, Prettier, EditorConfig
  • [x] 📂 Clean folder Structure
  • [x] Tests with Jest
  • [x] 📈 Test Coverage Report
  • [x] 🚀 Production Build
  • [x] 🎉 Publishing Process
  • [x] 👷 npm run all the things
  • [x] 🚦 Pre-commit hooks
  • [x] 📘 Examples

Getting Started

Automagically...

This whole project can be installed automagically using our smart tool.

  1. Visit mkit-bundler

  2. That's pretty much it... 💥 💥 💥

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!

  1. Clone the repository
git clone https://github.com/mkitio/mkit-bundle-npm-package.git <your-project-name>
  1. Make it your own
cd <your-project-name> && rm -rf .git && git init
  1. Install the dependencies
npm install
  1. Test your installation
npm run test
  1. 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:

  1. npm test - Run all tests and report
  2. npm run build - Build the /src code using Babel
  3. npm release-it - Automated commit, semver, tagging, publishing to npm, 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. <hi@mkit.io>

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.

Package Sidebar

Install

npm i mkit-bundle-npm-package

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

8.38 kB

Total Files

4

Last publish

Collaborators

  • smerdzhanov