client: modules: command-line: migrate to ESM

This commit is contained in:
coderiaser 2026-02-01 23:30:49 +02:00
parent dae57c3d20
commit 0d7b037ac2
5 changed files with 15 additions and 15 deletions

View file

@ -138,7 +138,7 @@ export default {
[`${modules}/cloud`]: `${dirModules}/cloud.mjs`,
[`${modules}/user-menu`]: `${dirModules}/user-menu/index.mjs`,
[`${modules}/polyfill`]: `${dirModules}/polyfill.js`,
[`${modules}/command-line`]: `${dirModules}/command-line.js`,
[`${modules}/command-line`]: `${dirModules}/command-line.mjs`,
},
output: {
filename: '[name].js',

View file

@ -705,7 +705,10 @@ export function getPackerExt(type) {
export async function goToDirectory(overrides = {}) {
const {Dialog} = DOM;
const {prompt = Dialog.prompt, changeDir = CloudCmd.changeDir} = overrides;
const {
prompt = Dialog.prompt,
changeDir = CloudCmd.changeDir,
} = overrides;
const msg = 'Go to directory:';
const {dirPath} = CurrentInfo;

View file

@ -84,4 +84,3 @@ const stubCurrentFile = (fns = {}) => {
setCurrentName,
};
};

View file

@ -1,18 +1,15 @@
'use strict';
/* global CloudCmd */
CloudCmd.CommandLine = exports;
import * as Dialog from '#dom/dialog';
const Dialog = require('#dom/dialog');
export const init = () => {};
const noop = () => {};
CloudCmd.CommandLine = {
init,
show,
hide,
};
module.exports.init = noop;
module.exports.show = show;
module.exports.hide = hide;
async function show() {
export async function show() {
const [, cmd] = await Dialog.prompt('Command Line', '');
const TERMINAL = '^(t|terminal)';
@ -32,4 +29,4 @@ async function show() {
}
}
function hide() {}
export function hide() {}

View file

@ -6,6 +6,7 @@ const autoGlobals = require('auto-globals');
const {stub} = require('@cloudcmd/stub');
const {test: tape} = require('supertape');
const test = autoGlobals(tape);
const {
_initConfig,
_viewHtml,