@aboe026/update-dependencies v1.1.0
node-update-dependencies
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-devIf your project uses Yarn as a package manager, install with
yarn add @aboe026/update-dependencies --devUsage
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 npmor
yarn dlx update-dependencies yarnCommand 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
To enable Editor SDK, run
yarn dlx @yarnpkg/sdks vscodeThen in TypeScript file, simultaneously press
ctrl+shift+pand choose option
Select TypeScript Versionthen select value
Use Workspace Version
Install Dependencies
To install dependencies, run
yarn installStart
To run code from non-built source code, run
yarn startBuild
To build the source code into transpiled javascript, run
yarn buildWatch
To automatically rebuild on file changes, run
yarn watchClean
To remove any previously built code, run
yarn cleanRun
To run transpiled javascript bundles, run:
yarn run-builtor directly with
node executable.jsOr through the bin command with
update-dependenciesLint
to check code for programmatic or stylistic problems, run
yarn lintTo automatically fix lint problems, run
yarn lint-fixTest
To test the project for regressions, run
npm testThis will lint the project, then run unit and e2e tests.
Test execution can be configured with the following environment variables:
| Name | Required | Default | Description | Example(s) |
|---|---|---|---|---|
| TEST_RESULT_NAME | No | If 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-unitNote: 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:e2eNote: 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-ciThere 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-viewUpgrade Yarn
To upgrade the version of yarn used in the project, run
yarn set version latestthen install to have the change picked up.