1.1.0 • Published 10 months ago

@aboe026/update-dependencies v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

node-update-dependencies

build coverage

A tool to update/upgrade dependencies managed by either NPM or Yarn.

Install

If your project uses NPM as a package manager, install with

npm install @aboe026/update-dependencies --save-dev

If your project uses Yarn as a package manager, install with

yarn add @aboe026/update-dependencies --dev

Usage

Add the following to the script section of your package.json

"update": "update-dependencies npm"

for NPM projects or

"update": "update-dependencies yarn"

for Yarn projects.

It can also be called directly through command line with either

npx update-dependencies npm

or

yarn dlx update-dependencies yarn

Command Line Interface

update-dependencies [command]

Commands:
  update-dependencies npm   Update packages for a project with NPM as the
                            package manager
  update-dependencies yarn  Update packages for a project with Yarn as the
                            package manager

Globals:
  -i, --install  Whether or not package updates should be installed
                                                       [boolean] [default: true]

Options:
      --help     Show help                                             [boolean]
      --version  Show version number                                   [boolean]

Development

Prerequisites

  • NodeJS
  • Yarn
  • VSCode

    • To enable Editor SDK, run

      yarn dlx @yarnpkg/sdks vscode

      Then in TypeScript file, simultaneously press

      ctrl + shift + p

      and choose option

      Select TypeScript Version

      then select value

      Use Workspace Version

Install Dependencies

To install dependencies, run

yarn install

Start

To run code from non-built source code, run

yarn start

Build

To build the source code into transpiled javascript, run

yarn build

Watch

To automatically rebuild on file changes, run

yarn watch

Clean

To remove any previously built code, run

yarn clean

Run

To run transpiled javascript bundles, run:

yarn run-built

or directly with

node executable.js

Or through the bin command with

update-dependencies

Lint

to check code for programmatic or stylistic problems, run

yarn lint

To automatically fix lint problems, run

yarn lint-fix

Test

To test the project for regressions, run

npm test

This will lint the project, then run unit and e2e tests.

Test execution can be configured with the following environment variables:

NameRequiredDefaultDescriptionExample(s)
TEST_RESULT_NAMENoIf specified, will record test results to the given file name and collect coverage.unit

Unit Tests

Unit tests are for stateless logic tests on small, contained parts of the code base (ideally not reliant on/mock anything outside their scope), and can be run with

yarn test-unit

Note: To run a specific test, execute

yarn test-unit -t 'test name'

With spaces separating describe blocks and test names

End to End Tests

End to End (E2E) Tests run against the final, distributable executable and are meant to test overarching scenarios of the tool to simulate as close as possible the real interactions and use/edge cases.

They required code to be built, and can be run with

yarn test:e2e

Note: To run a specific test, execute

yarn test-e2e -t 'test name'

With spaces separating describe blocks and test names

The E2E tests spin up a private NPM registry in memory using verdaccio.

Code Coverage

Code coverage can be generated by running

yarn test-unit-ci

There is no code coverage for e2e tests as those do not run against source code, but transpiled binaries.

To view code coverage in the browser, run

yarn coverage-view

Upgrade Yarn

To upgrade the version of yarn used in the project, run

yarn set version latest

then install to have the change picked up.

1.1.1

10 months ago

1.1.0

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago