Skip to content

Commit

Permalink
Replace imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Apr 8, 2019
1 parent 88ab1b2 commit b65a591
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions src/command.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const execa = require('execa')
import execa from 'execa'

const { printEcho } = require('./echo')
const { splitInput } = require('./split')
const { getError } = require('./error')
import { printEcho } from './echo.js'
import { splitInput } from './split.js'
import { getError } from './error.js'

// Fire the command with `execa()`
const execCommand = async function(input, opts) {
Expand Down
4 changes: 2 additions & 2 deletions src/echo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fancyLog = require('fancy-log')
const { cyan } = require('chalk')
import fancyLog from 'fancy-log'
import { cyan } from 'chalk'

// If `opts.echo` is `true` echo the command on the terminal
const printEcho = function({ input, opts: { echo } }) {
Expand Down
8 changes: 4 additions & 4 deletions src/error.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const {
import {
constants: { errno },
} = require('os')
} from 'os'

const PluginError = require('plugin-error')
const ms = require('ms')
import PluginError from 'plugin-error'
import ms from 'ms'

// Throw a Gulp error
const getError = function({ error, input, opts }) {
Expand Down
4 changes: 2 additions & 2 deletions src/exec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { parseOpts } = require('./options')
const { execCommand } = require('./command')
import { parseOpts } from './options.js'
import { execCommand } from './command.js'

// Execute a shell command
// To create a Gulp task, one should not use `bind()` as it removes
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
...require('./exec'),
...require('./task'),
...require('./stream'),
...require('./exec.js'),
...require('./task.js'),
...require('./stream.js'),
}
2 changes: 1 addition & 1 deletion src/options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const isCi = require('is-ci')
import isCi from 'is-ci'

// Parse main arguments and options
const parseOpts = function(opts) {
Expand Down
4 changes: 2 additions & 2 deletions src/stream.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const through = require('through2-concurrent')
import through from 'through2-concurrent'

const { exec } = require('./exec')
import { exec } from './exec.js'

// Creates a stream to use in Gulp e.g.
// src(...).pipe(stream(({ path }) => ['command', [path]]))
Expand Down
6 changes: 3 additions & 3 deletions src/task.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { parseOpts } = require('./options')
const { execCommand } = require('./command')
const { splitInput } = require('./split')
import { parseOpts } from './options.js'
import { execCommand } from './command.js'
import { splitInput } from './split.js'

// Create a Gulp task
const createTask = function(input, opts) {
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('ava')
import test from 'ava'

test('Dummy test', t => {
t.pass()
Expand Down

0 comments on commit b65a591

Please sign in to comment.