@inquirer/external-editor 1.0.2 → 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 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
- [![Graphite](https://github.com/user-attachments/assets/53db40ca-2254-481a-a094-6597f8716e29)](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>
@@ -1,7 +1,7 @@
1
- import { CreateFileError } from './errors/CreateFileError.js';
2
- import { LaunchEditorError } from './errors/LaunchEditorError.js';
3
- import { ReadFileError } from './errors/ReadFileError.js';
4
- import { RemoveFileError } from './errors/RemoveFileError.js';
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;
@@ -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 CreateFileError_js_1 = require("./errors/CreateFileError.js");
17
- Object.defineProperty(exports, "CreateFileError", { enumerable: true, get: function () { return CreateFileError_js_1.CreateFileError; } });
18
- const LaunchEditorError_js_1 = require("./errors/LaunchEditorError.js");
19
- Object.defineProperty(exports, "LaunchEditorError", { enumerable: true, get: function () { return LaunchEditorError_js_1.LaunchEditorError; } });
20
- const ReadFileError_js_1 = require("./errors/ReadFileError.js");
21
- Object.defineProperty(exports, "ReadFileError", { enumerable: true, get: function () { return ReadFileError_js_1.ReadFileError; } });
22
- const RemoveFileError_js_1 = require("./errors/RemoveFileError.js");
23
- Object.defineProperty(exports, "RemoveFileError", { enumerable: true, get: function () { return RemoveFileError_js_1.RemoveFileError; } });
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 CreateFileError_js_1.CreateFileError(createFileError);
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 ReadFileError_js_1.ReadFileError(readFileError);
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 RemoveFileError_js_1.RemoveFileError(removeFileError);
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 LaunchEditorError_js_1.LaunchEditorError(launchError);
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 LaunchEditorError_js_1.LaunchEditorError(launchError);
199
+ throw new LaunchEditorError_ts_1.LaunchEditorError(launchError);
200
200
  }
201
201
  }
202
202
  }
@@ -1,7 +1,7 @@
1
- import { CreateFileError } from './errors/CreateFileError.js';
2
- import { LaunchEditorError } from './errors/LaunchEditorError.js';
3
- import { ReadFileError } from './errors/ReadFileError.js';
4
- import { RemoveFileError } from './errors/RemoveFileError.js';
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 './errors/CreateFileError.js';
9
- import { LaunchEditorError } from './errors/LaunchEditorError.js';
10
- import { ReadFileError } from './errors/ReadFileError.js';
11
- import { RemoveFileError } from './errors/RemoveFileError.js';
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.2",
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.0",
84
+ "chardet": "^2.1.1",
85
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.2"
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": "62045dc4a4cd6f31ba0f77b20874be2409570957"
114
+ "gitHead": "6881993e517e76fa891b72e1f5086fd11f7676ac"
114
115
  }