From 26446bb32e769ac70c73e5a2824672619714a4bc Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Sun, 14 Apr 2024 16:46:04 +0200 Subject: [PATCH] refactor: move `repl/*` to `.mts` (#3185) --- packages/client/src/extension.mts | 2 +- packages/client/src/repl/args.test.mts | 2 +- packages/client/src/repl/index.mts | 1 + packages/client/src/repl/index.ts | 9 --------- .../repl/{parseCommandLine.ts => parseCommandLine.mts} | 0 ...arseCommandLine.test.ts => parseCommandLine.test.mts} | 2 +- packages/client/src/repl/repl.mts | 2 +- 7 files changed, 5 insertions(+), 13 deletions(-) create mode 100644 packages/client/src/repl/index.mts delete mode 100644 packages/client/src/repl/index.ts rename packages/client/src/repl/{parseCommandLine.ts => parseCommandLine.mts} (100%) rename packages/client/src/repl/{parseCommandLine.test.ts => parseCommandLine.test.mts} (98%) diff --git a/packages/client/src/extension.mts b/packages/client/src/extension.mts index 9ea60ce64..ffbb8882d 100644 --- a/packages/client/src/extension.mts +++ b/packages/client/src/extension.mts @@ -19,7 +19,7 @@ import * as settingsViewer from './infoViewer/infoView.js'; import { IssueTracker } from './issueTracker.js'; import { activateFileIssuesViewer, activateIssueViewer } from './issueViewer/index.js'; import * as modules from './modules.js'; -import { createTerminal, registerTerminalProfileProvider } from './repl/index.js'; +import { createTerminal, registerTerminalProfileProvider } from './repl/index.mjs'; import type { ConfigTargetLegacy, CSpellSettings } from './settings/index.js'; import * as settings from './settings/index.js'; import { sectionCSpell } from './settings/index.js'; diff --git a/packages/client/src/repl/args.test.mts b/packages/client/src/repl/args.test.mts index 296efb00f..81ca21353 100644 --- a/packages/client/src/repl/args.test.mts +++ b/packages/client/src/repl/args.test.mts @@ -5,7 +5,7 @@ import { parseArgs } from 'node:util'; import { describe, expect, test } from 'vitest'; import { Application, castValueToType, Command, toBoolean } from './args.mjs'; -import { parseCommandLineIntoArgs } from './parseCommandLine.js'; +import { parseCommandLineIntoArgs } from './parseCommandLine.mjs'; import { unindent } from './textUtils.mjs'; const ac = expect.arrayContaining; diff --git a/packages/client/src/repl/index.mts b/packages/client/src/repl/index.mts new file mode 100644 index 000000000..80c1c117d --- /dev/null +++ b/packages/client/src/repl/index.mts @@ -0,0 +1 @@ +export { createTerminal, registerTerminalProfileProvider } from './repl.mjs'; diff --git a/packages/client/src/repl/index.ts b/packages/client/src/repl/index.ts deleted file mode 100644 index 7faa1dd0f..000000000 --- a/packages/client/src/repl/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export async function createTerminal() { - const { createTerminal } = await import('./repl.mjs'); - return createTerminal(); -} - -export async function registerTerminalProfileProvider() { - const { registerTerminalProfileProvider } = await import('./repl.mjs'); - return registerTerminalProfileProvider(); -} diff --git a/packages/client/src/repl/parseCommandLine.ts b/packages/client/src/repl/parseCommandLine.mts similarity index 100% rename from packages/client/src/repl/parseCommandLine.ts rename to packages/client/src/repl/parseCommandLine.mts diff --git a/packages/client/src/repl/parseCommandLine.test.ts b/packages/client/src/repl/parseCommandLine.test.mts similarity index 98% rename from packages/client/src/repl/parseCommandLine.test.ts rename to packages/client/src/repl/parseCommandLine.test.mts index d0e774cd6..405c94327 100644 --- a/packages/client/src/repl/parseCommandLine.test.ts +++ b/packages/client/src/repl/parseCommandLine.test.mts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest'; -import { commandLineBuilder, parseCommandLine, parseCommandLineIntoArgs } from './parseCommandLine.js'; +import { commandLineBuilder, parseCommandLine, parseCommandLineIntoArgs } from './parseCommandLine.mjs'; describe('parseArgs', () => { test.each` diff --git a/packages/client/src/repl/repl.mts b/packages/client/src/repl/repl.mts index 1a78077eb..c77d14b99 100644 --- a/packages/client/src/repl/repl.mts +++ b/packages/client/src/repl/repl.mts @@ -16,7 +16,7 @@ import { emitterToReadStream, emitterToWriteStream } from './emitterToWriteStrea import type { DirEntry } from './fsUtils.mjs'; import { currentDirectory, globSearch, readDir, resolvePath, toRelativeWorkspacePath } from './fsUtils.mjs'; import { globsToGlob } from './globUtils.mjs'; -import { commandLineBuilder, parseCommandLineIntoArgs } from './parseCommandLine.js'; +import { commandLineBuilder, parseCommandLineIntoArgs } from './parseCommandLine.mjs'; const defaultWidth = 80;