Package detail

install-deps-postmerge

camacho4.4kMIT2.0.1

Install package.json dependencies whenever needed after a git merge

git, hook, post, merge

readme

install-deps-postmerge

Script for installing dependencies using npm or yarn as a postmerge git-hook.

Install

yarn add -D install-deps-postmerge

What does this module do?

This script will git a list of files by running:

git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD

It will take the results and check if package.json, package-lock.json, or yarn.lock is listed.

If any of those files is found, the script will intelligently pick the correct client (based on which lockfile changed and falling back to yarn-or-npm) to install the dependencies.

How do I use it in my project?

It can be used as part of a postmerge npm script alongside 'husky' for githook integrations:

{
  ...
  "husky": {
    "hooks": {
      "post-merge": "install-deps-postmerge"
    }
  },
  "devDependencies": {
    "husky": "latest",
    "install-deps-postmerge": "latest"
  }
}

Alternatively, if you do not want to use 'husky', the script can be added as a command in the .git/hooks/post-merge file:

# abbreviated command "idpm"
npm run -s idpm
# or
yarn -s idpm

Requirements

  • node: >=10

changelog

Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

2.0.1 (2020-09-05)

Bug Fixes

  • bin: fix issue where bin file could not be executed (811c941)

2.0.0 (2020-08-23)

Bug Fixes

  • diff check: fixed improper check for npm lockfile changes (04e3586), closes #9

Build System

  • node: bump node version to 10 (f43afa8)

Features

  • repo: moved to typescript and added additional semantic publishing (33d26a5)

BREAKING CHANGES

  • node: support for older versions of node has been dropped

1.1.0 (2019-09-25)

Features

  • repo: moved to typescript and added additional semantic publishing (33d26a5)

1.0.5 (2019-06-23)

Bug Fixes

  • bin: Change path for import support with yarn (0561bfa), closes #1
  • bin: fix wrong file reference in bin property (5acccda)
  • deps: update dependencies and tooling (d6ff72b)