@netlify/run-utils 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -2
  2. package/src/main.js +4 -12
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@netlify/run-utils",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Utility for running commands inside Netlify Build",
5
- "main": "src/main.js",
5
+ "type": "module",
6
+ "exports": "./src/main.js",
7
+ "main": "./src/main.js",
6
8
  "files": [
7
9
  "src/**/*.js"
8
10
  ],
package/src/main.js CHANGED
@@ -1,11 +1,9 @@
1
- 'use strict'
1
+ import process from 'process'
2
2
 
3
- const process = require('process')
4
-
5
- const execa = require('execa')
3
+ import execa from 'execa'
6
4
 
7
5
  // Run a command, with arguments being an array
8
- const run = function (file, args, options) {
6
+ export const run = function (file, args, options) {
9
7
  const [argsA, optionsA] = parseArgs(args, options)
10
8
  const optionsB = { ...DEFAULT_OPTIONS, ...optionsA }
11
9
  const childProcess = execa(file, argsA, optionsB)
@@ -14,7 +12,7 @@ const run = function (file, args, options) {
14
12
  }
15
13
 
16
14
  // Run a command, with file + arguments being a single string
17
- const runCommand = function (command, options) {
15
+ export const runCommand = function (command, options) {
18
16
  const optionsA = { ...DEFAULT_OPTIONS, ...options }
19
17
  const childProcess = execa.command(command, optionsA)
20
18
  redirectOutput(childProcess, optionsA)
@@ -46,9 +44,3 @@ const redirectOutput = function (childProcess, { stdio, stdout, stderr }) {
46
44
  childProcess.stdout.pipe(process.stdout)
47
45
  childProcess.stderr.pipe(process.stderr)
48
46
  }
49
-
50
- // Needed to add a property to the function
51
- // eslint-disable-next-line fp/no-mutation
52
- run.command = runCommand
53
-
54
- module.exports = run