Skip to content

Commit

Permalink
feat(libnpmexec)!: no longer accept output function
Browse files Browse the repository at this point in the history
BREAKING CHANGE: libnpmexec now emits an output event on process
instead of invoking the output function passed in
  • Loading branch information
lukekarrys committed Apr 12, 2024
1 parent e5baf4a commit 62a1a77
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion workspaces/libnpmexec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ await libexec({
- `localBin`: Location to the `node_modules/.bin` folder of the local project to start scanning for bin files **String**, defaults to `./node_modules/.bin`. **libexec** will walk up the directory structure looking for `node_modules/.bin` folders in parent folders that might satisfy the current `arg` and will use that bin if found.
- `locationMsg`: Overrides "at location" message when entering interactive mode **String**
- `globalBin`: Location to the global space bin folder, same as: `$(npm bin -g)` **String**, defaults to empty string.
- `output`: A function to print output to **Function**
- `packages`: A list of packages to be used (possibly fetch from the registry) **Array<String>**, defaults to `[]`
- `path`: Location to where to read local project info (`package.json`) **String**, defaults to `.`
- `runPath`: Location to where to execute the script **String**, defaults to `.`
Expand Down
2 changes: 0 additions & 2 deletions workspaces/libnpmexec/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const exec = async (opts) => {
locationMsg = undefined,
globalBin = '',
globalPath,
output,
// dereference values because we manipulate it later
packages: [...packages] = [],
path = '.',
Expand All @@ -98,7 +97,6 @@ const exec = async (opts) => {
call,
flatOptions,
locationMsg,
output,
path,
binPaths,
runPath,
Expand Down
5 changes: 2 additions & 3 deletions workspaces/libnpmexec/lib/run-script.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const ciInfo = require('ci-info')
const runScript = require('@npmcli/run-script')
const readPackageJson = require('read-package-json-fast')
const { log } = require('proc-log')
const { log, output } = require('proc-log')
const noTTY = require('./no-tty.js')

const run = async ({
args,
call,
flatOptions,
locationMsg,
output = () => {},
path,
binPaths,
runPath,
Expand Down Expand Up @@ -37,7 +36,7 @@ const run = async ({

const { chalk } = flatOptions

output(`${
output.standard(`${
chalk.reset('\nEntering npm script environment')
}${
chalk.reset(locationMsg || ` at location:\n${chalk.dim(runPath)}`)
Expand Down

0 comments on commit 62a1a77

Please sign in to comment.