Skip to content

Commit c9f57c5

Browse files
committed
feature: client: modules: edit-file-vim: migrate to ESM
1 parent 327ac9d commit c9f57c5

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

.webpack/js.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export default {
121121
'cloudcmd': `${dir}/cloudcmd.mjs`,
122122
[`${modules}/edit`]: `${dirModules}/edit.mjs`,
123123
[`${modules}/edit-file`]: `${dirModules}/edit-file.js`,
124-
[`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.js`,
124+
[`${modules}/edit-file-vim`]: `${dirModules}/edit-file-vim.mjs`,
125125
[`${modules}/edit-names`]: `${dirModules}/edit-names.js`,
126126
[`${modules}/edit-names-vim`]: `${dirModules}/edit-names-vim.mjs`,
127127
[`${modules}/menu`]: `${dirModules}/menu/index.mjs`,
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
'use strict';
1+
import * as Events from '#dom/events';
22

3-
/* global CloudCmd */
4-
CloudCmd.EditFileVim = exports;
3+
const {CloudCmd} = globalThis;
54

6-
const Events = require('#dom/events');
5+
CloudCmd.EditFileVim = {
6+
init,
7+
show,
8+
hide,
9+
};
710

811
const {Key} = CloudCmd;
912

@@ -15,23 +18,21 @@ const ConfigView = {
1518
},
1619
};
1720

18-
module.exports.init = async () => {
21+
export async function init() {
1922
await CloudCmd.EditFile();
20-
};
23+
}
2124

22-
module.exports.show = async () => {
25+
export async function show() {
2326
Events.addKey(listener);
2427

2528
const editFile = await CloudCmd.EditFile.show(ConfigView);
2629

2730
editFile
2831
.getEditor()
2932
.setKeyMap('vim');
30-
};
31-
32-
module.exports.hide = hide;
33+
}
3334

34-
function hide() {
35+
export function hide() {
3536
CloudCmd.Edit.hide();
3637
}
3738

0 commit comments

Comments
 (0)