diff --git a/audio.js b/audio.js index 7f5936d..1460f0f 100644 --- a/audio.js +++ b/audio.js @@ -1,6 +1,6 @@ import pMap from 'p-map'; import { join, basename, resolve } from 'path'; -import execa from 'execa'; +import { execa } from 'execa'; import flatMap from 'lodash-es/flatMap.js'; import { getFfmpegCommonArgs, getCutFromArgs } from './ffmpeg.js'; diff --git a/examples/customCanvas.js b/examples/customCanvas.js index e0e7158..2df986f 100644 --- a/examples/customCanvas.js +++ b/examples/customCanvas.js @@ -1,4 +1,4 @@ -const editly = require('..'); +import editly from '..'; async function func({ canvas }) { async function onRender(progress) { diff --git a/examples/customFabric.js b/examples/customFabric.js index 07a53b6..6e092a3 100644 --- a/examples/customFabric.js +++ b/examples/customFabric.js @@ -1,4 +1,4 @@ -const editly = require('..'); +import editly from '..'; /* eslint-disable spaced-comment,no-param-reassign */ diff --git a/ffmpeg.js b/ffmpeg.js index ee5d67b..f4fdd8e 100644 --- a/ffmpeg.js +++ b/ffmpeg.js @@ -1,5 +1,5 @@ import fsExtra from 'fs-extra'; -import execa from 'execa'; +import { execa } from 'execa'; import assert from 'assert'; import compareVersions from 'compare-versions'; diff --git a/glTransitions.js b/glTransitions.js index fe29c2e..1a6b0c8 100644 --- a/glTransitions.js +++ b/glTransitions.js @@ -2,9 +2,11 @@ import GL from 'gl'; import ndarray from 'ndarray'; import createBuffer from 'gl-buffer'; import glTransitions from 'gl-transitions'; -import createTransition from 'gl-transition'; +import glTransition from 'gl-transition'; import createTexture from 'gl-texture2d'; +const { default: createTransition } = glTransition; + export default ({ width, height, channels }) => { const gl = GL(width, height); diff --git a/index.js b/index.js index 2cec797..bbd77d1 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -import execa from 'execa'; +import { execa } from 'execa'; import assert from 'assert'; import { join, dirname } from 'path'; import JSON5 from 'json5'; diff --git a/sources/videoFrameSource.js b/sources/videoFrameSource.js index 919d827..692f65b 100644 --- a/sources/videoFrameSource.js +++ b/sources/videoFrameSource.js @@ -1,4 +1,4 @@ -import execa from 'execa'; +import { execa } from 'execa'; import assert from 'assert'; import { getFfmpegCommonArgs } from '../ffmpeg.js'; diff --git a/test.js b/test.js index b6aea0d..80f68ac 100644 --- a/test.js +++ b/test.js @@ -1,21 +1,13 @@ -const execa = require('execa'); +import { execa } from 'execa'; // todo use jest - -(async () => { - try { - await execa('node', [ - 'cli.js', - '--allow-remote-requests', - "title:'My video'", - 'https://raw.githubusercontent.com/mifi/editly-assets/main/overlay.svg', - "title:'THE END'", - '--fast', - '--audio-file-path', - 'https://github.com/mifi/editly-assets/raw/main/winxp.mp3', - ], { stdout: process.stdout, stderr: process.stderr }); - } catch (err) { - console.error(err); - process.exitCode = 1; - } -})(); +await execa('node', [ + 'cli.js', + '--allow-remote-requests', + "title:'My video'", + 'https://raw.githubusercontent.com/mifi/editly-assets/main/overlay.svg', + "title:'THE END'", + '--fast', + '--audio-file-path', + 'https://github.com/mifi/editly-assets/raw/main/winxp.mp3', +], { stdout: process.stdout, stderr: process.stderr }); diff --git a/util.js b/util.js index c9fb4c9..775c194 100644 --- a/util.js +++ b/util.js @@ -1,4 +1,4 @@ -import execa from 'execa'; +import { execa } from 'execa'; import assert from 'assert'; import sortBy from 'lodash-es/sortBy.js'; import fsExtra from 'fs-extra';