@inquirer/external-editor 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -10
- package/dist/commonjs/index.d.ts +4 -4
- package/dist/commonjs/index.js +13 -13
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +4 -4
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -5,16 +5,6 @@ A Node.js module to edit a string with the user's preferred text editor using $V
|
|
|
5
5
|
> [!NOTE]
|
|
6
6
|
> This package is a replacement for the unmaintained `external-editor`. It includes security fixes.
|
|
7
7
|
|
|
8
|
-
# Special Thanks
|
|
9
|
-
|
|
10
|
-
<div align="center" markdown="1">
|
|
11
|
-
|
|
12
|
-
[](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)<br>
|
|
13
|
-
|
|
14
|
-
### [Graphite is the AI developer productivity platform helping teams on GitHub ship higher quality software, faster](https://graphite.dev/?utm_source=npmjs&utm_medium=repo&utm_campaign=inquirerjs)
|
|
15
|
-
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
8
|
# Installation
|
|
19
9
|
|
|
20
10
|
<table>
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CreateFileError } from './errors/CreateFileError.
|
|
2
|
-
import { LaunchEditorError } from './errors/LaunchEditorError.
|
|
3
|
-
import { ReadFileError } from './errors/ReadFileError.
|
|
4
|
-
import { RemoveFileError } from './errors/RemoveFileError.
|
|
1
|
+
import { CreateFileError } from './errors/CreateFileError.ts';
|
|
2
|
+
import { LaunchEditorError } from './errors/LaunchEditorError.ts';
|
|
3
|
+
import { ReadFileError } from './errors/ReadFileError.ts';
|
|
4
|
+
import { RemoveFileError } from './errors/RemoveFileError.ts';
|
|
5
5
|
export interface IEditorParams {
|
|
6
6
|
args: string[];
|
|
7
7
|
bin: string;
|
package/dist/commonjs/index.js
CHANGED
|
@@ -13,14 +13,14 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
13
13
|
const node_os_1 = __importDefault(require("node:os"));
|
|
14
14
|
const node_crypto_1 = require("node:crypto");
|
|
15
15
|
const iconv_lite_1 = __importDefault(require("iconv-lite"));
|
|
16
|
-
const
|
|
17
|
-
Object.defineProperty(exports, "CreateFileError", { enumerable: true, get: function () { return
|
|
18
|
-
const
|
|
19
|
-
Object.defineProperty(exports, "LaunchEditorError", { enumerable: true, get: function () { return
|
|
20
|
-
const
|
|
21
|
-
Object.defineProperty(exports, "ReadFileError", { enumerable: true, get: function () { return
|
|
22
|
-
const
|
|
23
|
-
Object.defineProperty(exports, "RemoveFileError", { enumerable: true, get: function () { return
|
|
16
|
+
const CreateFileError_ts_1 = require("./errors/CreateFileError.js");
|
|
17
|
+
Object.defineProperty(exports, "CreateFileError", { enumerable: true, get: function () { return CreateFileError_ts_1.CreateFileError; } });
|
|
18
|
+
const LaunchEditorError_ts_1 = require("./errors/LaunchEditorError.js");
|
|
19
|
+
Object.defineProperty(exports, "LaunchEditorError", { enumerable: true, get: function () { return LaunchEditorError_ts_1.LaunchEditorError; } });
|
|
20
|
+
const ReadFileError_ts_1 = require("./errors/ReadFileError.js");
|
|
21
|
+
Object.defineProperty(exports, "ReadFileError", { enumerable: true, get: function () { return ReadFileError_ts_1.ReadFileError; } });
|
|
22
|
+
const RemoveFileError_ts_1 = require("./errors/RemoveFileError.js");
|
|
23
|
+
Object.defineProperty(exports, "RemoveFileError", { enumerable: true, get: function () { return RemoveFileError_ts_1.RemoveFileError; } });
|
|
24
24
|
function edit(text = '', fileOptions) {
|
|
25
25
|
const editor = new ExternalEditor(text, fileOptions);
|
|
26
26
|
editor.run();
|
|
@@ -148,7 +148,7 @@ class ExternalEditor {
|
|
|
148
148
|
(0, fs_1.writeFileSync)(this.tempFile, this.text, opt);
|
|
149
149
|
}
|
|
150
150
|
catch (createFileError) {
|
|
151
|
-
throw new
|
|
151
|
+
throw new CreateFileError_ts_1.CreateFileError(createFileError);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
readTemporaryFile() {
|
|
@@ -167,7 +167,7 @@ class ExternalEditor {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
catch (readFileError) {
|
|
170
|
-
throw new
|
|
170
|
+
throw new ReadFileError_ts_1.ReadFileError(readFileError);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
removeTemporaryFile() {
|
|
@@ -175,7 +175,7 @@ class ExternalEditor {
|
|
|
175
175
|
(0, fs_1.unlinkSync)(this.tempFile);
|
|
176
176
|
}
|
|
177
177
|
catch (removeFileError) {
|
|
178
|
-
throw new
|
|
178
|
+
throw new RemoveFileError_ts_1.RemoveFileError(removeFileError);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
launchEditor() {
|
|
@@ -184,7 +184,7 @@ class ExternalEditor {
|
|
|
184
184
|
this.lastExitStatus = editorProcess.status ?? 0;
|
|
185
185
|
}
|
|
186
186
|
catch (launchError) {
|
|
187
|
-
throw new
|
|
187
|
+
throw new LaunchEditorError_ts_1.LaunchEditorError(launchError);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
launchEditorAsync(callback) {
|
|
@@ -196,7 +196,7 @@ class ExternalEditor {
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
catch (launchError) {
|
|
199
|
-
throw new
|
|
199
|
+
throw new LaunchEditorError_ts_1.LaunchEditorError(launchError);
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CreateFileError } from './errors/CreateFileError.
|
|
2
|
-
import { LaunchEditorError } from './errors/LaunchEditorError.
|
|
3
|
-
import { ReadFileError } from './errors/ReadFileError.
|
|
4
|
-
import { RemoveFileError } from './errors/RemoveFileError.
|
|
1
|
+
import { CreateFileError } from './errors/CreateFileError.ts';
|
|
2
|
+
import { LaunchEditorError } from './errors/LaunchEditorError.ts';
|
|
3
|
+
import { ReadFileError } from './errors/ReadFileError.ts';
|
|
4
|
+
import { RemoveFileError } from './errors/RemoveFileError.ts';
|
|
5
5
|
export interface IEditorParams {
|
|
6
6
|
args: string[];
|
|
7
7
|
bin: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -5,10 +5,10 @@ import path from 'node:path';
|
|
|
5
5
|
import os from 'node:os';
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
7
7
|
import iconv from 'iconv-lite';
|
|
8
|
-
import { CreateFileError } from
|
|
9
|
-
import { LaunchEditorError } from
|
|
10
|
-
import { ReadFileError } from
|
|
11
|
-
import { RemoveFileError } from
|
|
8
|
+
import { CreateFileError } from "./errors/CreateFileError.js";
|
|
9
|
+
import { LaunchEditorError } from "./errors/LaunchEditorError.js";
|
|
10
|
+
import { ReadFileError } from "./errors/ReadFileError.js";
|
|
11
|
+
import { RemoveFileError } from "./errors/RemoveFileError.js";
|
|
12
12
|
export { CreateFileError, LaunchEditorError, ReadFileError, RemoveFileError };
|
|
13
13
|
export function edit(text = '', fileOptions) {
|
|
14
14
|
const editor = new ExternalEditor(text, fileOptions);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/external-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Edit a string with the users preferred text editor using $VISUAL or $ENVIRONMENT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -81,13 +81,14 @@
|
|
|
81
81
|
"sideEffects": false,
|
|
82
82
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/external-editor/README.md",
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"chardet": "^2.1.
|
|
85
|
-
"iconv-lite": "^0.
|
|
84
|
+
"chardet": "^2.1.1",
|
|
85
|
+
"iconv-lite": "^0.7.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@arethetypeswrong/cli": "^0.18.2",
|
|
89
|
+
"@repo/tsconfig": "0.0.0",
|
|
89
90
|
"@types/chardet": "^1.0.0",
|
|
90
|
-
"tshy": "^3.0.
|
|
91
|
+
"tshy": "^3.0.3"
|
|
91
92
|
},
|
|
92
93
|
"peerDependencies": {
|
|
93
94
|
"@types/node": ">=18"
|
|
@@ -110,5 +111,5 @@
|
|
|
110
111
|
"tsc": "tshy",
|
|
111
112
|
"attw": "attw --pack"
|
|
112
113
|
},
|
|
113
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "6881993e517e76fa891b72e1f5086fd11f7676ac"
|
|
114
115
|
}
|