npm_and_yarn/helpers/README.md
This directory contains helper functions for npm, yarn, and pnpm, written in TypeScript, so that we can utilize the package managers' internal APIs and other native tooling for these ecosystems.
These helpers are called from the Ruby code via run.ts, they are passed
arguments via stdin and return JSON data to stdout.
Install dependencies:
npm install
The helpers are compiled from TypeScript to JavaScript before being used at runtime. To build:
npm run build
The compiled output goes to dist/.
Run the TypeScript compiler in check-only mode (no output):
npm run typecheck
ESLint is used for code quality checks:
npm run lint
Prettier is used for code formatting. To check for formatting issues:
npm run format
To auto-fix formatting:
npm run format:fix
When working on these helpers, it's convenient to write some high level tests in TypeScript to make it easier to debug the code.
Run the tests from this directory:
npm test
In order to run an interactive debugger:
node --inspect-brk node_modules/.bin/jest --runInBand path/to/test/test.jschrome://inspectOpen dedicated DevTools for Node