1.0.9 • Published 12 months ago

@jdietrichdev/simple-package v1.0.9

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

simple-package

Template repsitory for creating a deployable NPM package

Getting Started

Guide for getting this template repository set up for usage with your own NPM package

Repo Setup

  1. Use this template repository to create a new repository
  2. Clone the new repository to your machine
  3. Update the name of the package in package.json to reflect the name you would like for your library
  4. Run npm install in the terminal, this will:
    • Install all necessary dependencies
    • Set up Husky hooks to validate commit messages

Additional Configuration Updates (optional)

  1. Build configuration using the tsconfig.*.json files
    • tsconfig.base.json - General build configuration (rules, files, etc)
    • tsconfig.cjs.json - Configuration for building package for CommonJS modules
    • tsconfig.esm.json - Configuration for building package for ECMAScript modules
  2. ESLint configuration using the .eslintrc and .prettierrc files
  3. Unit test configuration
    • Update .mocharc.json to update configuration for Mocha
    • Remove .mochrc.json and configure another testing framework
  4. Release configuration using release.config.js
  5. Commitlint configuration (used for validating commit messages) using commitlint.config.js
  6. Husky configuration

Create NPM Token

In order for the release step to run successfully, you must create a token in NPM that will allow you to publish the package as part of your release pipeline.

  1. If you haven't already, create an NPM account
  2. Ensure that 2FA is only required for authentication
  3. Create a new Automation access token and copy the value of the token
  4. Create a new Actions secret in your repo named NPM_TOKEN that contains the token you copied from NPM

Once this has been completed, you should be able to run the release workflow and deploy your package to NPM successfully

Commit Message Formatting

semantic-release uses commit messages to determine if a release is necessary when the pipeline is run. Therefore, the commit messages need to have a specific structure so that the release process can determine if a new release is required.

The formatting of the commit must follow:

<type>(optional scope): summary

Type

Used to determine if a release is necessary, must be one of the following values:

TypeDescriptionRelease
buildChanges that affect the build system or external dependenciesNo Release
choreAutomated changes to projectNo Release
ciChanges to CI configuration files and scriptsNo Release
docsChanges to documentationNo Release
featImplementation of a new featureMinor/Feature Release
fixChanges that fix bugsPatch/Fix Release
perfChanges to improve performanceMajor/Breaking Release
refactorCode change that does not fix a bug or add a featureNo Release
testAdding or updating testsNo Release

Updates can be made to what types trigger releases in release.config.js

Scope (optional)

Name of the component affected

Summary

Brief description of the update made

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago