From 151a6d502d4a858dd201c6fb599942b64d7773a0 Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Sun, 9 Jun 2019 22:19:34 +0500 Subject: [PATCH 1/2] Convert the package to .mjs --- index.js | 4 ---- index.mjs | 4 ++++ lib/{HistoryController.js => HistoryController.mjs} | 0 lib/{LocalEchoController.js => LocalEchoController.mjs} | 4 ++-- lib/{Utils.js => Utils.mjs} | 3 ++- package.json | 3 ++- 6 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 index.js create mode 100644 index.mjs rename lib/{HistoryController.js => HistoryController.mjs} (100%) rename lib/{LocalEchoController.js => LocalEchoController.mjs} (99%) rename lib/{Utils.js => Utils.mjs} (98%) diff --git a/index.js b/index.js deleted file mode 100644 index 7b9be4a..0000000 --- a/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import LocalEchoController from "./lib/LocalEchoController"; -export { HistoryController } from './lib/HistoryController'; - -export default LocalEchoController; diff --git a/index.mjs b/index.mjs new file mode 100644 index 0000000..2d230d3 --- /dev/null +++ b/index.mjs @@ -0,0 +1,4 @@ +import LocalEchoController from "./lib/LocalEchoController.mjs"; +export { HistoryController } from './lib/HistoryController.mjs'; + +export default LocalEchoController; diff --git a/lib/HistoryController.js b/lib/HistoryController.mjs similarity index 100% rename from lib/HistoryController.js rename to lib/HistoryController.mjs diff --git a/lib/LocalEchoController.js b/lib/LocalEchoController.mjs similarity index 99% rename from lib/LocalEchoController.js rename to lib/LocalEchoController.mjs index 2df7963..4fcd036 100644 --- a/lib/LocalEchoController.js +++ b/lib/LocalEchoController.mjs @@ -1,4 +1,4 @@ -import { HistoryController } from "./HistoryController"; +import { HistoryController } from "./HistoryController.mjs"; import { closestLeftBoundary, closestRightBoundary, @@ -8,7 +8,7 @@ import { hasTailingWhitespace, isIncompleteInput, offsetToColRow -} from "./Utils"; +} from "./Utils.mjs"; /** * A local terminal controller is responsible for displaying messages diff --git a/lib/Utils.js b/lib/Utils.mjs similarity index 98% rename from lib/Utils.js rename to lib/Utils.mjs index 0eb8517..c484a13 100644 --- a/lib/Utils.js +++ b/lib/Utils.mjs @@ -1,4 +1,5 @@ -import { parse } from "shell-quote"; +import ShellQuote from "shell-quote"; +const { parse } = ShellQuote; /** * Detects all the word boundaries on the given input diff --git a/package.json b/package.json index 1cd9331..2c30225 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "local-echo", "version": "0.2.0", "description": "A local echo controller for xterm.js", - "main": "index.js", + "type": "module", + "main": "./index.mjs", "scripts": { "test": "jest", "build": "webpack" From 69a3920b2280396dc01edc6de8fd723b25fbbecb Mon Sep 17 00:00:00 2001 From: ilyaigpetrov Date: Mon, 10 Jun 2019 12:10:08 +0500 Subject: [PATCH 2/2] Make rollup happy --- lib/Utils.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Utils.mjs b/lib/Utils.mjs index c484a13..21665ef 100644 --- a/lib/Utils.mjs +++ b/lib/Utils.mjs @@ -1,4 +1,4 @@ -import ShellQuote from "shell-quote"; +import * as ShellQuote from "shell-quote"; const { parse } = ShellQuote; /**