parameters:
  path:
    type: string
    default: .
  before-install:
    type: steps
    default: []
  after-install:
    type: steps
    default: []

steps:
  - checkout
  - steps: << parameters.before-install >>
  - npm-authenticate
  - run:
      name: Install dependencies
      command: yarn --cwd << parameters.path >> --prefer-offline --pure-lockfile
  - steps: << parameters.after-install >>
