@chainlink/external-adapter-framework 2.6.0 → 2.7.1
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 +1 -1
- package/adapter/types.d.ts +1 -1
- package/config/index.d.ts +4 -0
- package/config/index.js +4 -0
- package/config/index.js.map +1 -1
- package/debug/router.js +7 -36
- package/debug/router.js.map +1 -1
- package/debug/settings-page.d.ts +1 -7
- package/debug/settings-page.js +0 -22
- package/debug/settings-page.js.map +1 -1
- package/generator-adapter/generators/app/index.js +11 -5
- package/generator-adapter/node_modules/.yarn-integrity +14 -13
- package/generator-adapter/node_modules/@types/node/README.md +3 -3
- package/generator-adapter/node_modules/@types/node/async_hooks.d.ts +65 -1
- package/generator-adapter/node_modules/@types/node/buffer.buffer.d.ts +2 -0
- package/generator-adapter/node_modules/@types/node/buffer.d.ts +8 -4
- package/generator-adapter/node_modules/@types/node/child_process.d.ts +26 -122
- package/generator-adapter/node_modules/@types/node/cluster.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/compatibility/disposable.d.ts +0 -2
- package/generator-adapter/node_modules/@types/node/compatibility/indexable.d.ts +0 -3
- package/generator-adapter/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
- package/generator-adapter/node_modules/@types/node/crypto.d.ts +17 -1
- package/generator-adapter/node_modules/@types/node/diagnostics_channel.d.ts +37 -13
- package/generator-adapter/node_modules/@types/node/dns/promises.d.ts +36 -9
- package/generator-adapter/node_modules/@types/node/dns.d.ts +73 -20
- package/generator-adapter/node_modules/@types/node/events.d.ts +0 -1
- package/generator-adapter/node_modules/@types/node/fs/promises.d.ts +62 -54
- package/generator-adapter/node_modules/@types/node/fs.d.ts +149 -54
- package/generator-adapter/node_modules/@types/node/globals.d.ts +137 -478
- package/generator-adapter/node_modules/@types/node/http.d.ts +93 -6
- package/generator-adapter/node_modules/@types/node/http2.d.ts +81 -2
- package/generator-adapter/node_modules/@types/node/https.d.ts +5 -0
- package/generator-adapter/node_modules/@types/node/index.d.ts +7 -3
- package/generator-adapter/node_modules/@types/node/{inspector.d.ts → inspector.generated.d.ts} +219 -10
- package/generator-adapter/node_modules/@types/node/module.d.ts +136 -17
- package/generator-adapter/node_modules/@types/node/net.d.ts +15 -9
- package/generator-adapter/node_modules/@types/node/package.json +3 -83
- package/generator-adapter/node_modules/@types/node/perf_hooks.d.ts +2 -2
- package/generator-adapter/node_modules/@types/node/process.d.ts +3 -4
- package/generator-adapter/node_modules/@types/node/querystring.d.ts +2 -3
- package/generator-adapter/node_modules/@types/node/readline/promises.d.ts +0 -1
- package/generator-adapter/node_modules/@types/node/repl.d.ts +3 -5
- package/generator-adapter/node_modules/@types/node/sqlite.d.ts +207 -0
- package/generator-adapter/node_modules/@types/node/stream/web.d.ts +11 -3
- package/generator-adapter/node_modules/@types/node/stream.d.ts +5 -10
- package/generator-adapter/node_modules/@types/node/test.d.ts +1873 -1970
- package/generator-adapter/node_modules/@types/node/tls.d.ts +1 -1
- package/generator-adapter/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +2 -0
- package/generator-adapter/node_modules/@types/node/ts5.6/index.d.ts +7 -3
- package/generator-adapter/node_modules/@types/node/url.d.ts +12 -3
- package/generator-adapter/node_modules/@types/node/util.d.ts +33 -5
- package/generator-adapter/node_modules/@types/node/v8.d.ts +60 -30
- package/generator-adapter/node_modules/@types/node/vm.d.ts +61 -8
- package/generator-adapter/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/generator-adapter/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/generator-adapter/node_modules/@types/node/web-globals/events.d.ts +94 -0
- package/generator-adapter/node_modules/@types/node/web-globals/fetch.d.ts +46 -0
- package/generator-adapter/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/generator-adapter/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/generator-adapter/node_modules/@types/node/worker_threads.d.ts +87 -28
- package/generator-adapter/node_modules/@types/node/zlib.d.ts +8 -2
- package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.d.ts +3 -0
- package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.js +12 -2
- package/generator-adapter/node_modules/@yeoman/adapter/dist/adapter.js.map +1 -1
- package/generator-adapter/node_modules/@yeoman/adapter/dist/queued-adapter.d.ts +3 -0
- package/generator-adapter/node_modules/@yeoman/adapter/dist/queued-adapter.js +12 -2
- package/generator-adapter/node_modules/@yeoman/adapter/dist/queued-adapter.js.map +1 -1
- package/generator-adapter/node_modules/@yeoman/adapter/dist/testing/test-adapter.d.ts +3 -0
- package/generator-adapter/node_modules/@yeoman/adapter/dist/testing/test-adapter.js +12 -2
- package/generator-adapter/node_modules/@yeoman/adapter/dist/testing/test-adapter.js.map +1 -1
- package/generator-adapter/node_modules/@yeoman/adapter/package.json +4 -4
- package/generator-adapter/node_modules/@yeoman/adapter/types/adapter.d.ts +12 -1
- package/generator-adapter/node_modules/@yeoman/types/package.json +3 -3
- package/generator-adapter/node_modules/@yeoman/types/types/environment/environment.d.ts +4 -1
- package/generator-adapter/node_modules/@yeoman/types/types/environment/methods-options.d.ts +7 -3
- package/generator-adapter/node_modules/@yeoman/types/types/generator/generator.d.ts +8 -5
- package/generator-adapter/node_modules/@yeoman/types/types/generator/utils.d.ts +1 -0
- package/generator-adapter/node_modules/ansi-regex/index.d.ts +9 -13
- package/generator-adapter/node_modules/ansi-regex/index.js +6 -6
- package/generator-adapter/node_modules/ansi-regex/license +1 -1
- package/generator-adapter/node_modules/ansi-regex/package.json +12 -6
- package/generator-adapter/node_modules/ansi-regex/readme.md +4 -22
- package/generator-adapter/node_modules/cli-spinners/index.d.ts +122 -111
- package/generator-adapter/node_modules/cli-spinners/index.js +7 -11
- package/generator-adapter/node_modules/cli-spinners/package.json +15 -9
- package/generator-adapter/node_modules/cli-spinners/readme.md +23 -3
- package/generator-adapter/node_modules/cli-spinners/spinners.json +44 -1
- package/generator-adapter/node_modules/emoji-regex/README.md +14 -48
- package/generator-adapter/node_modules/emoji-regex/index.d.ts +21 -1
- package/generator-adapter/node_modules/emoji-regex/index.js +5 -3
- package/generator-adapter/node_modules/emoji-regex/package.json +12 -7
- package/generator-adapter/node_modules/get-east-asian-width/index.js +2 -3
- package/generator-adapter/node_modules/get-east-asian-width/lookup.js +11 -11
- package/generator-adapter/node_modules/get-east-asian-width/package.json +1 -1
- package/generator-adapter/node_modules/ora/index.d.ts +3 -3
- package/generator-adapter/node_modules/ora/index.js +67 -48
- package/generator-adapter/node_modules/ora/node_modules/chalk/package.json +83 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/readme.md +297 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/index.d.ts +325 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/index.js +225 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/utilities.js +33 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/generator-adapter/node_modules/ora/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/browser-symbols.js +4 -0
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/browser.js +1 -8
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/index.js +1 -20
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/package.json +10 -7
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/symbols.js +14 -0
- package/generator-adapter/node_modules/ora/node_modules/strip-ansi/package.json +3 -1
- package/generator-adapter/node_modules/ora/node_modules/strip-ansi/readme.md +5 -9
- package/generator-adapter/node_modules/ora/package.json +13 -13
- package/generator-adapter/node_modules/ora/readme.md +49 -3
- package/generator-adapter/node_modules/string-width/index.js +52 -45
- package/generator-adapter/node_modules/string-width/package.json +8 -7
- package/generator-adapter/node_modules/{string-width → strip-ansi}/node_modules/ansi-regex/index.d.ts +13 -9
- package/generator-adapter/node_modules/strip-ansi/node_modules/ansi-regex/index.js +10 -0
- package/generator-adapter/node_modules/{ora/node_modules/log-symbols/node_modules/is-unicode-supported → strip-ansi/node_modules/ansi-regex}/license +1 -1
- package/generator-adapter/node_modules/{string-width → strip-ansi}/node_modules/ansi-regex/package.json +6 -12
- package/generator-adapter/node_modules/{ora → strip-ansi}/node_modules/ansi-regex/readme.md +22 -4
- package/generator-adapter/package.json +3 -3
- package/index.js +3 -0
- package/index.js.map +1 -1
- package/package.json +19 -19
- package/status/router.d.ts +49 -0
- package/status/router.js +55 -0
- package/status/router.js.map +1 -0
- package/transports/http.d.ts +1 -2
- package/transports/sse.d.ts +2 -2
- package/transports/sse.js +2 -5
- package/transports/sse.js.map +1 -1
- package/transports/websocket.js +53 -17
- package/transports/websocket.js.map +1 -1
- package/util/settings.d.ts +11 -0
- package/util/settings.js +29 -0
- package/util/settings.js.map +1 -0
- package/generator-adapter/node_modules/@types/node/dom-events.d.ts +0 -124
- package/generator-adapter/node_modules/emoji-regex/index.mjs +0 -4
- package/generator-adapter/node_modules/ora/node_modules/ansi-regex/index.d.ts +0 -33
- package/generator-adapter/node_modules/ora/node_modules/ansi-regex/index.js +0 -10
- package/generator-adapter/node_modules/ora/node_modules/ansi-regex/package.json +0 -61
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported/index.d.ts +0 -12
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported/index.js +0 -17
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported/package.json +0 -43
- package/generator-adapter/node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported/readme.md +0 -35
- package/generator-adapter/node_modules/string-width/node_modules/ansi-regex/index.js +0 -10
- package/generator-adapter/node_modules/string-width/node_modules/ansi-regex/license +0 -9
- package/generator-adapter/node_modules/string-width/node_modules/ansi-regex/readme.md +0 -60
- package/generator-adapter/node_modules/wrap-ansi/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/generator-adapter/node_modules/wrap-ansi/node_modules/emoji-regex/README.md +0 -73
- package/generator-adapter/node_modules/wrap-ansi/node_modules/emoji-regex/index.d.ts +0 -23
- package/generator-adapter/node_modules/wrap-ansi/node_modules/emoji-regex/index.js +0 -6
- package/generator-adapter/node_modules/wrap-ansi/node_modules/emoji-regex/package.json +0 -50
- /package/generator-adapter/node_modules/{wrap-ansi/node_modules/emoji-regex → emoji-regex}/es2015/index.js +0 -0
- /package/generator-adapter/node_modules/{wrap-ansi/node_modules/emoji-regex → emoji-regex}/es2015/text.js +0 -0
- /package/generator-adapter/node_modules/{wrap-ansi/node_modules/emoji-regex → emoji-regex}/text.js +0 -0
- /package/generator-adapter/node_modules/ora/node_modules/{ansi-regex → chalk}/license +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
import * as undici from "undici-types";
|
|
4
|
+
|
|
5
|
+
type _EventSource = typeof globalThis extends { onmessage: any } ? {} : undici.EventSource;
|
|
6
|
+
type _FormData = typeof globalThis extends { onmessage: any } ? {} : undici.FormData;
|
|
7
|
+
type _Headers = typeof globalThis extends { onmessage: any } ? {} : undici.Headers;
|
|
8
|
+
type _MessageEvent = typeof globalThis extends { onmessage: any } ? {} : undici.MessageEvent;
|
|
9
|
+
type _Request = typeof globalThis extends { onmessage: any } ? {} : undici.Request;
|
|
10
|
+
type _RequestInit = typeof globalThis extends { onmessage: any } ? {} : undici.RequestInit;
|
|
11
|
+
type _Response = typeof globalThis extends { onmessage: any } ? {} : undici.Response;
|
|
12
|
+
type _ResponseInit = typeof globalThis extends { onmessage: any } ? {} : undici.ResponseInit;
|
|
13
|
+
type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : undici.WebSocket;
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
function fetch(
|
|
17
|
+
input: string | URL | Request,
|
|
18
|
+
init?: RequestInit,
|
|
19
|
+
): Promise<Response>;
|
|
20
|
+
|
|
21
|
+
interface EventSource extends _EventSource {}
|
|
22
|
+
var EventSource: typeof globalThis extends { onmessage: any; EventSource: infer T } ? T : typeof undici.EventSource;
|
|
23
|
+
|
|
24
|
+
interface FormData extends _FormData {}
|
|
25
|
+
var FormData: typeof globalThis extends { onmessage: any; FormData: infer T } ? T : typeof undici.FormData;
|
|
26
|
+
|
|
27
|
+
interface Headers extends _Headers {}
|
|
28
|
+
var Headers: typeof globalThis extends { onmessage: any; Headers: infer T } ? T : typeof undici.Headers;
|
|
29
|
+
|
|
30
|
+
interface MessageEvent extends _MessageEvent {}
|
|
31
|
+
var MessageEvent: typeof globalThis extends { onmessage: any; MessageEvent: infer T } ? T
|
|
32
|
+
: typeof undici.MessageEvent;
|
|
33
|
+
|
|
34
|
+
interface Request extends _Request {}
|
|
35
|
+
var Request: typeof globalThis extends { onmessage: any; Request: infer T } ? T : typeof undici.Request;
|
|
36
|
+
|
|
37
|
+
interface RequestInit extends _RequestInit {}
|
|
38
|
+
|
|
39
|
+
interface Response extends _Response {}
|
|
40
|
+
var Response: typeof globalThis extends { onmessage: any; Response: infer T } ? T : typeof undici.Response;
|
|
41
|
+
|
|
42
|
+
interface ResponseInit extends _ResponseInit {}
|
|
43
|
+
|
|
44
|
+
interface WebSocket extends _WebSocket {}
|
|
45
|
+
var WebSocket: typeof globalThis extends { onmessage: any; WebSocket: infer T } ? T : typeof undici.WebSocket;
|
|
46
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
// lib.webworker has `WorkerNavigator` rather than `Navigator`, so conditionals use `onabort` instead of `onmessage`
|
|
4
|
+
type _Navigator = typeof globalThis extends { onabort: any } ? {} : Navigator;
|
|
5
|
+
interface Navigator {
|
|
6
|
+
readonly hardwareConcurrency: number;
|
|
7
|
+
readonly language: string;
|
|
8
|
+
readonly languages: readonly string[];
|
|
9
|
+
readonly platform: string;
|
|
10
|
+
readonly userAgent: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
declare global {
|
|
14
|
+
interface Navigator extends _Navigator {}
|
|
15
|
+
var Navigator: typeof globalThis extends { onabort: any; Navigator: infer T } ? T : {
|
|
16
|
+
prototype: Navigator;
|
|
17
|
+
new(): Navigator;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Needs conditional inference for lib.dom and lib.webworker compatibility
|
|
21
|
+
var navigator: typeof globalThis extends { onmessage: any; navigator: infer T } ? T : Navigator;
|
|
22
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
// These interfaces are absent from lib.webworker, so the conditionals use `onabort` rather than `onmessage`
|
|
4
|
+
type _Storage = typeof globalThis extends { onabort: any } ? {} : Storage;
|
|
5
|
+
interface Storage {
|
|
6
|
+
readonly length: number;
|
|
7
|
+
clear(): void;
|
|
8
|
+
getItem(key: string): string | null;
|
|
9
|
+
key(index: number): string | null;
|
|
10
|
+
removeItem(key: string): void;
|
|
11
|
+
setItem(key: string, value: string): void;
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
interface Storage extends _Storage {}
|
|
17
|
+
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T : {
|
|
18
|
+
prototype: Storage;
|
|
19
|
+
new(): Storage;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
var localStorage: Storage;
|
|
23
|
+
var sessionStorage: Storage;
|
|
24
|
+
}
|
|
@@ -15,28 +15,31 @@
|
|
|
15
15
|
*
|
|
16
16
|
* ```js
|
|
17
17
|
* import {
|
|
18
|
-
* Worker,
|
|
18
|
+
* Worker,
|
|
19
|
+
* isMainThread,
|
|
20
|
+
* parentPort,
|
|
21
|
+
* workerData,
|
|
19
22
|
* } from 'node:worker_threads';
|
|
20
|
-
* import { parse } from 'some-js-parsing-library';
|
|
21
23
|
*
|
|
22
|
-
* if (isMainThread) {
|
|
23
|
-
*
|
|
24
|
-
* return new Promise((resolve, reject) => {
|
|
25
|
-
* const worker = new Worker(__filename, {
|
|
26
|
-
* workerData: script,
|
|
27
|
-
* });
|
|
28
|
-
* worker.on('message', resolve);
|
|
29
|
-
* worker.on('error', reject);
|
|
30
|
-
* worker.on('exit', (code) => {
|
|
31
|
-
* if (code !== 0)
|
|
32
|
-
* reject(new Error(`Worker stopped with exit code ${code}`));
|
|
33
|
-
* });
|
|
34
|
-
* });
|
|
35
|
-
* };
|
|
36
|
-
* } else {
|
|
24
|
+
* if (!isMainThread) {
|
|
25
|
+
* const { parse } = await import('some-js-parsing-library');
|
|
37
26
|
* const script = workerData;
|
|
38
27
|
* parentPort.postMessage(parse(script));
|
|
39
28
|
* }
|
|
29
|
+
*
|
|
30
|
+
* export default function parseJSAsync(script) {
|
|
31
|
+
* return new Promise((resolve, reject) => {
|
|
32
|
+
* const worker = new Worker(new URL(import.meta.url), {
|
|
33
|
+
* workerData: script,
|
|
34
|
+
* });
|
|
35
|
+
* worker.on('message', resolve);
|
|
36
|
+
* worker.on('error', reject);
|
|
37
|
+
* worker.on('exit', (code) => {
|
|
38
|
+
* if (code !== 0)
|
|
39
|
+
* reject(new Error(`Worker stopped with exit code ${code}`));
|
|
40
|
+
* });
|
|
41
|
+
* });
|
|
42
|
+
* };
|
|
40
43
|
* ```
|
|
41
44
|
*
|
|
42
45
|
* The above example spawns a Worker thread for each `parseJSAsync()` call. In
|
|
@@ -52,14 +55,15 @@
|
|
|
52
55
|
* @see [source](https://github.com/nodejs/node/blob/v22.x/lib/worker_threads.js)
|
|
53
56
|
*/
|
|
54
57
|
declare module "worker_threads" {
|
|
55
|
-
import { Blob } from "node:buffer";
|
|
56
58
|
import { Context } from "node:vm";
|
|
57
59
|
import { EventEmitter } from "node:events";
|
|
58
60
|
import { EventLoopUtilityFunction } from "node:perf_hooks";
|
|
59
61
|
import { FileHandle } from "node:fs/promises";
|
|
60
62
|
import { Readable, Writable } from "node:stream";
|
|
63
|
+
import { ReadableStream, TransformStream, WritableStream } from "node:stream/web";
|
|
61
64
|
import { URL } from "node:url";
|
|
62
|
-
import {
|
|
65
|
+
import { HeapInfo } from "node:v8";
|
|
66
|
+
import { MessageEvent } from "undici-types";
|
|
63
67
|
const isInternalThread: boolean;
|
|
64
68
|
const isMainThread: boolean;
|
|
65
69
|
const parentPort: null | MessagePort;
|
|
@@ -89,7 +93,16 @@ declare module "worker_threads" {
|
|
|
89
93
|
interface WorkerPerformance {
|
|
90
94
|
eventLoopUtilization: EventLoopUtilityFunction;
|
|
91
95
|
}
|
|
92
|
-
type
|
|
96
|
+
type Transferable =
|
|
97
|
+
| ArrayBuffer
|
|
98
|
+
| MessagePort
|
|
99
|
+
| AbortSignal
|
|
100
|
+
| FileHandle
|
|
101
|
+
| ReadableStream
|
|
102
|
+
| WritableStream
|
|
103
|
+
| TransformStream;
|
|
104
|
+
/** @deprecated Use `import { Transferable } from "node:worker_threads"` instead. */
|
|
105
|
+
type TransferListItem = Transferable;
|
|
93
106
|
/**
|
|
94
107
|
* Instances of the `worker.MessagePort` class represent one end of an
|
|
95
108
|
* asynchronous, two-way communications channel. It can be used to transfer
|
|
@@ -174,7 +187,12 @@ declare module "worker_threads" {
|
|
|
174
187
|
* behind this API, see the `serialization API of the node:v8 module`.
|
|
175
188
|
* @since v10.5.0
|
|
176
189
|
*/
|
|
177
|
-
postMessage(value: any, transferList?: readonly
|
|
190
|
+
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
|
191
|
+
/**
|
|
192
|
+
* If true, the `MessagePort` object will keep the Node.js event loop active.
|
|
193
|
+
* @since v18.1.0, v16.17.0
|
|
194
|
+
*/
|
|
195
|
+
hasRef(): boolean;
|
|
178
196
|
/**
|
|
179
197
|
* Opposite of `unref()`. Calling `ref()` on a previously `unref()`ed port does _not_ let the program exit if it's the only active handle left (the default
|
|
180
198
|
* behavior). If the port is `ref()`ed, calling `ref()` again has no effect.
|
|
@@ -261,7 +279,7 @@ declare module "worker_threads" {
|
|
|
261
279
|
/**
|
|
262
280
|
* Additional data to send in the first worker message.
|
|
263
281
|
*/
|
|
264
|
-
transferList?:
|
|
282
|
+
transferList?: Transferable[] | undefined;
|
|
265
283
|
/**
|
|
266
284
|
* @default true
|
|
267
285
|
*/
|
|
@@ -409,7 +427,7 @@ declare module "worker_threads" {
|
|
|
409
427
|
* See `port.postMessage()` for more details.
|
|
410
428
|
* @since v10.5.0
|
|
411
429
|
*/
|
|
412
|
-
postMessage(value: any, transferList?: readonly
|
|
430
|
+
postMessage(value: any, transferList?: readonly Transferable[]): void;
|
|
413
431
|
/**
|
|
414
432
|
* Sends a value to another worker, identified by its thread ID.
|
|
415
433
|
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
|
@@ -425,7 +443,7 @@ declare module "worker_threads" {
|
|
|
425
443
|
postMessageToThread(
|
|
426
444
|
threadId: number,
|
|
427
445
|
value: any,
|
|
428
|
-
transferList: readonly
|
|
446
|
+
transferList: readonly Transferable[],
|
|
429
447
|
timeout?: number,
|
|
430
448
|
): Promise<void>;
|
|
431
449
|
/**
|
|
@@ -457,6 +475,25 @@ declare module "worker_threads" {
|
|
|
457
475
|
* @return A promise for a Readable Stream containing a V8 heap snapshot
|
|
458
476
|
*/
|
|
459
477
|
getHeapSnapshot(): Promise<Readable>;
|
|
478
|
+
/**
|
|
479
|
+
* This method returns a `Promise` that will resolve to an object identical to `v8.getHeapStatistics()`,
|
|
480
|
+
* or reject with an `ERR_WORKER_NOT_RUNNING` error if the worker is no longer running.
|
|
481
|
+
* This methods allows the statistics to be observed from outside the actual thread.
|
|
482
|
+
* @since v22.16.0
|
|
483
|
+
*/
|
|
484
|
+
getHeapStatistics(): Promise<HeapInfo>;
|
|
485
|
+
/**
|
|
486
|
+
* Calls `worker.terminate()` when the dispose scope is exited.
|
|
487
|
+
*
|
|
488
|
+
* ```js
|
|
489
|
+
* async function example() {
|
|
490
|
+
* await using worker = new Worker('for (;;) {}', { eval: true });
|
|
491
|
+
* // Worker is automatically terminate when the scope is exited.
|
|
492
|
+
* }
|
|
493
|
+
* ```
|
|
494
|
+
* @since v22.18.0
|
|
495
|
+
*/
|
|
496
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
460
497
|
addListener(event: "error", listener: (err: Error) => void): this;
|
|
461
498
|
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
|
462
499
|
addListener(event: "message", listener: (value: any) => void): this;
|
|
@@ -537,18 +574,18 @@ declare module "worker_threads" {
|
|
|
537
574
|
* ```
|
|
538
575
|
* @since v15.4.0
|
|
539
576
|
*/
|
|
540
|
-
class BroadcastChannel {
|
|
577
|
+
class BroadcastChannel extends EventTarget {
|
|
541
578
|
readonly name: string;
|
|
542
579
|
/**
|
|
543
580
|
* Invoked with a single \`MessageEvent\` argument when a message is received.
|
|
544
581
|
* @since v15.4.0
|
|
545
582
|
*/
|
|
546
|
-
onmessage: (message:
|
|
583
|
+
onmessage: (message: MessageEvent) => void;
|
|
547
584
|
/**
|
|
548
585
|
* Invoked with a received message cannot be deserialized.
|
|
549
586
|
* @since v15.4.0
|
|
550
587
|
*/
|
|
551
|
-
onmessageerror: (message:
|
|
588
|
+
onmessageerror: (message: MessageEvent) => void;
|
|
552
589
|
constructor(name: string);
|
|
553
590
|
/**
|
|
554
591
|
* Closes the `BroadcastChannel` connection.
|
|
@@ -701,7 +738,25 @@ declare module "worker_threads" {
|
|
|
701
738
|
* @param value Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value
|
|
702
739
|
* for the `key` will be deleted.
|
|
703
740
|
*/
|
|
704
|
-
function setEnvironmentData(key: Serializable, value
|
|
741
|
+
function setEnvironmentData(key: Serializable, value?: Serializable): void;
|
|
742
|
+
/**
|
|
743
|
+
* Sends a value to another worker, identified by its thread ID.
|
|
744
|
+
* @param threadId The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown.
|
|
745
|
+
* If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.
|
|
746
|
+
* @param value The value to send.
|
|
747
|
+
* @param transferList If one or more `MessagePort`-like objects are passed in value, a `transferList` is required for those items
|
|
748
|
+
* or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.
|
|
749
|
+
* @param timeout Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever.
|
|
750
|
+
* If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.
|
|
751
|
+
* @since v22.5.0
|
|
752
|
+
*/
|
|
753
|
+
function postMessageToThread(threadId: number, value: any, timeout?: number): Promise<void>;
|
|
754
|
+
function postMessageToThread(
|
|
755
|
+
threadId: number,
|
|
756
|
+
value: any,
|
|
757
|
+
transferList: readonly Transferable[],
|
|
758
|
+
timeout?: number,
|
|
759
|
+
): Promise<void>;
|
|
705
760
|
|
|
706
761
|
import {
|
|
707
762
|
BroadcastChannel as _BroadcastChannel,
|
|
@@ -709,6 +764,10 @@ declare module "worker_threads" {
|
|
|
709
764
|
MessagePort as _MessagePort,
|
|
710
765
|
} from "worker_threads";
|
|
711
766
|
global {
|
|
767
|
+
function structuredClone<T>(
|
|
768
|
+
value: T,
|
|
769
|
+
options?: { transfer?: Transferable[] },
|
|
770
|
+
): T;
|
|
712
771
|
/**
|
|
713
772
|
* `BroadcastChannel` class is a global reference for `import { BroadcastChannel } from 'worker_threads'`
|
|
714
773
|
* https://nodejs.org/api/globals.html#broadcastchannel
|
|
@@ -147,6 +147,10 @@ declare module "zlib" {
|
|
|
147
147
|
* @default buffer.kMaxLength
|
|
148
148
|
*/
|
|
149
149
|
maxOutputLength?: number | undefined;
|
|
150
|
+
/**
|
|
151
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
|
152
|
+
*/
|
|
153
|
+
info?: boolean | undefined;
|
|
150
154
|
}
|
|
151
155
|
interface ZstdOptions {
|
|
152
156
|
/**
|
|
@@ -172,6 +176,10 @@ declare module "zlib" {
|
|
|
172
176
|
* @default buffer.kMaxLength
|
|
173
177
|
*/
|
|
174
178
|
maxOutputLength?: number | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* If `true`, returns an object with `buffer` and `engine`.
|
|
181
|
+
*/
|
|
182
|
+
info?: boolean | undefined;
|
|
175
183
|
}
|
|
176
184
|
interface Zlib {
|
|
177
185
|
/** @deprecated Use bytesWritten instead. */
|
|
@@ -612,8 +620,6 @@ declare module "zlib" {
|
|
|
612
620
|
const Z_FINISH: number;
|
|
613
621
|
/** @deprecated Use `constants.Z_BLOCK` */
|
|
614
622
|
const Z_BLOCK: number;
|
|
615
|
-
/** @deprecated Use `constants.Z_TREES` */
|
|
616
|
-
const Z_TREES: number;
|
|
617
623
|
// Return codes for the compression/decompression functions.
|
|
618
624
|
// Negative values are errors, positive values are used for special but normal events.
|
|
619
625
|
/** @deprecated Use `constants.Z_OK` */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
4
|
import { createPromptModule } from 'inquirer';
|
|
4
5
|
import type { InputOutputAdapter, Logger, PromptAnswers, PromptQuestions } from '../types/index.js';
|
|
5
6
|
type PromptModule = ReturnType<typeof createPromptModule>;
|
|
@@ -19,6 +20,7 @@ export declare class TerminalAdapter implements InputOutputAdapter {
|
|
|
19
20
|
log: Logger;
|
|
20
21
|
promptModule: PromptModule;
|
|
21
22
|
private abortController;
|
|
23
|
+
readonly signal: AbortSignal;
|
|
22
24
|
/**
|
|
23
25
|
* `TerminalAdapter` is the default implementation of `Adapter`, an abstraction
|
|
24
26
|
* layer that defines the I/O interactions.
|
|
@@ -34,6 +36,7 @@ export declare class TerminalAdapter implements InputOutputAdapter {
|
|
|
34
36
|
get _colorDiffRemoved(): import("chalk").ChalkInstance;
|
|
35
37
|
_colorLines(name: 'Added' | 'Removed', string: string): string;
|
|
36
38
|
close(): void;
|
|
39
|
+
abort(reason?: any): void;
|
|
37
40
|
/**
|
|
38
41
|
* Prompt a user for one or more questions and pass
|
|
39
42
|
* the answer(s) to the provided callback.
|
|
@@ -10,6 +10,7 @@ export class TerminalAdapter {
|
|
|
10
10
|
log;
|
|
11
11
|
promptModule;
|
|
12
12
|
abortController = new AbortController();
|
|
13
|
+
signal = this.abortController.signal;
|
|
13
14
|
/**
|
|
14
15
|
* `TerminalAdapter` is the default implementation of `Adapter`, an abstraction
|
|
15
16
|
* layer that defines the I/O interactions.
|
|
@@ -48,7 +49,10 @@ export class TerminalAdapter {
|
|
|
48
49
|
.join('\n');
|
|
49
50
|
}
|
|
50
51
|
close() {
|
|
51
|
-
this.
|
|
52
|
+
this.abort();
|
|
53
|
+
}
|
|
54
|
+
abort(reason) {
|
|
55
|
+
this.abortController.abort(reason);
|
|
52
56
|
}
|
|
53
57
|
/**
|
|
54
58
|
* Prompt a user for one or more questions and pass
|
|
@@ -64,7 +68,13 @@ export class TerminalAdapter {
|
|
|
64
68
|
* @return promise answers
|
|
65
69
|
*/
|
|
66
70
|
async prompt(questions, initialAnswers) {
|
|
67
|
-
|
|
71
|
+
try {
|
|
72
|
+
return await this.promptModule(questions, initialAnswers);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
this.abortController.abort(error);
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
68
78
|
}
|
|
69
79
|
separator(separator) {
|
|
70
80
|
return new inquirer.Separator(separator);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],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,CAAC;IAED,SAAS,CAAC,SAAkB;QAC1B,OAAO,IAAI,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
1
2
|
import PQueue from 'p-queue';
|
|
2
3
|
import type { InputOutputAdapter, Logger, ProgressCallback, ProgressOptions, PromptAnswers, PromptQuestions, QueuedAdapter as QueuedAdapterApi } from '../types/index.js';
|
|
3
4
|
import { type TerminalAdapterOptions } from './adapter.js';
|
|
@@ -14,6 +15,7 @@ export declare class QueuedAdapter implements QueuedAdapterApi {
|
|
|
14
15
|
delta: number;
|
|
15
16
|
log: Logger;
|
|
16
17
|
separator?: QueuedAdapterApi['separator'];
|
|
18
|
+
readonly signal: AbortSignal;
|
|
17
19
|
/**
|
|
18
20
|
* `TerminalAdapter` is the default implementation of `Adapter`, an abstraction
|
|
19
21
|
* layer that defines the I/O interactions.
|
|
@@ -26,6 +28,7 @@ export declare class QueuedAdapter implements QueuedAdapterApi {
|
|
|
26
28
|
constructor(options?: QueuedAdapterOptions);
|
|
27
29
|
newAdapter(delta?: number): QueuedAdapter;
|
|
28
30
|
close(): void;
|
|
31
|
+
abort(reason?: any): void;
|
|
29
32
|
/**
|
|
30
33
|
* Prompt a user for one or more questions and pass
|
|
31
34
|
* the answer(s) to the provided callback.
|
|
@@ -15,6 +15,7 @@ export class QueuedAdapter {
|
|
|
15
15
|
#nextChildPriority;
|
|
16
16
|
#ora;
|
|
17
17
|
separator;
|
|
18
|
+
signal;
|
|
18
19
|
/**
|
|
19
20
|
* `TerminalAdapter` is the default implementation of `Adapter`, an abstraction
|
|
20
21
|
* layer that defines the I/O interactions.
|
|
@@ -28,6 +29,7 @@ export class QueuedAdapter {
|
|
|
28
29
|
const { adapter, queue, delta, ...adapterOptions } = options ?? {};
|
|
29
30
|
this.#queue = queue ?? new PQueue({ concurrency: 1 });
|
|
30
31
|
this.actualAdapter = adapter ?? new TerminalAdapter(adapterOptions);
|
|
32
|
+
this.signal = this.actualAdapter.signal;
|
|
31
33
|
this.separator = this.actualAdapter.separator;
|
|
32
34
|
// Deffered logger
|
|
33
35
|
const defferredLogger = (...arguments_) => {
|
|
@@ -54,7 +56,10 @@ export class QueuedAdapter {
|
|
|
54
56
|
return new QueuedAdapter({ adapter: this.actualAdapter, delta: delta ?? this.#nextChildPriority--, queue: this.#queue });
|
|
55
57
|
}
|
|
56
58
|
close() {
|
|
57
|
-
this.
|
|
59
|
+
this.abort();
|
|
60
|
+
}
|
|
61
|
+
abort(reason) {
|
|
62
|
+
this.actualAdapter.abort?.(reason);
|
|
58
63
|
this.#queue.clear();
|
|
59
64
|
}
|
|
60
65
|
/**
|
|
@@ -74,6 +79,7 @@ export class QueuedAdapter {
|
|
|
74
79
|
return this.#queue.add(async () => this.actualAdapter.prompt(questions, initialAnswers), {
|
|
75
80
|
priority: PROMPT_PRIORITY + this.delta,
|
|
76
81
|
throwOnTimeout: true,
|
|
82
|
+
signal: this.signal,
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
async onIdle() {
|
|
@@ -85,7 +91,11 @@ export class QueuedAdapter {
|
|
|
85
91
|
* @returns
|
|
86
92
|
*/
|
|
87
93
|
async queue(function_) {
|
|
88
|
-
return this.#queue.add(() => function_(this.actualAdapter), {
|
|
94
|
+
return this.#queue.add(() => function_(this.actualAdapter), {
|
|
95
|
+
priority: BLOCKING_PRIORITY + this.delta,
|
|
96
|
+
throwOnTimeout: true,
|
|
97
|
+
signal: this.signal,
|
|
98
|
+
});
|
|
89
99
|
}
|
|
90
100
|
/**
|
|
91
101
|
* Log has a highest priority and should be not blocking.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queued-adapter.js","sourceRoot":"","sources":["../src/queued-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,C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C,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YACxD,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;gBACxB,IAAI,CAAC,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;gBAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
1
2
|
import { createPromptModule } from 'inquirer';
|
|
2
3
|
import type { Logger, PromptAnswers, PromptQuestions, QueuedAdapter, Task } from '../../types/index.js';
|
|
3
4
|
type PromptModule = ReturnType<typeof createPromptModule>;
|
|
@@ -45,6 +46,7 @@ export declare class TestAdapter<LogType extends Logger = Logger, SpyType = any>
|
|
|
45
46
|
readonly mockedAnswers: PromptAnswers;
|
|
46
47
|
readonly calls: PromptCalls[];
|
|
47
48
|
private abortController;
|
|
49
|
+
readonly signal: AbortSignal;
|
|
48
50
|
private readonly spyFactory;
|
|
49
51
|
constructor(options?: TestAdapterOptions<SpyType>);
|
|
50
52
|
queue<TaskResultType>(function_: Task<TaskResultType>): Promise<TaskResultType>;
|
|
@@ -55,6 +57,7 @@ export declare class TestAdapter<LogType extends Logger = Logger, SpyType = any>
|
|
|
55
57
|
name?: string | undefined;
|
|
56
58
|
} | undefined): Promise<ReturnType>;
|
|
57
59
|
close(): void;
|
|
60
|
+
abort(reason?: any): void;
|
|
58
61
|
prompt<A extends PromptAnswers = PromptAnswers>(questions: PromptQuestions<A>, initialAnswers?: Partial<A> | undefined): Promise<A>;
|
|
59
62
|
/**
|
|
60
63
|
* Add answers to the mocked answers.
|
|
@@ -52,6 +52,7 @@ export class TestAdapter {
|
|
|
52
52
|
mockedAnswers;
|
|
53
53
|
calls = [];
|
|
54
54
|
abortController = new AbortController();
|
|
55
|
+
signal = this.abortController.signal;
|
|
55
56
|
spyFactory;
|
|
56
57
|
constructor(options = {}) {
|
|
57
58
|
const { spyFactory = defaultConfig.spyFactory ?? (spyOptions => () => spyOptions.returns), log = defaultConfig.log ?? createLogger(), mockedAnswers, callback, throwOnMissingAnswer, } = options;
|
|
@@ -89,10 +90,19 @@ export class TestAdapter {
|
|
|
89
90
|
return function_({ step() { } });
|
|
90
91
|
}
|
|
91
92
|
close() {
|
|
92
|
-
this.
|
|
93
|
+
this.abort();
|
|
94
|
+
}
|
|
95
|
+
abort(reason) {
|
|
96
|
+
this.abortController.abort(reason);
|
|
93
97
|
}
|
|
94
98
|
async prompt(questions, initialAnswers) {
|
|
95
|
-
|
|
99
|
+
try {
|
|
100
|
+
return await this.promptModule(questions, initialAnswers);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
this.abortController.abort(error);
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
96
106
|
}
|
|
97
107
|
/**
|
|
98
108
|
* Add answers to the mocked answers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-adapter.js","sourceRoot":"","sources":["../../src/testing/test-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiCzC,MAAM,aAAa,GAA4B,EAAE,CAAC;AAElD,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,MAAW,EAAE,EAAE;IAC/C,IAAI,IAAI,KAAK,MAAM,EAAE;QACnB,sDAAsD;QACtD,OAAO,MAAM,KAAK,SAAS,CAAC;KAC7B;IACD,IAAI,IAAI,KAAK,SAAS,EAAE;QACtB,2DAA2D;QAC3D,OAAO,MAAM,IAAI,MAAM,KAAK,KAAK,CAAC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|
+
"version": "3.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Input Output adapter for yeoman's generator/environment stack",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"chalk": "^5.2.0",
|
|
45
45
|
"inquirer": "^12.0.0",
|
|
46
46
|
"log-symbols": "^7.0.0",
|
|
47
|
-
"ora": "^
|
|
47
|
+
"ora": "^9.0.0",
|
|
48
48
|
"p-queue": "^8.0.1",
|
|
49
49
|
"text-table": "^0.2.0"
|
|
50
50
|
},
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"yeoman-assert": "^3.1.1"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
|
-
"node": ">=
|
|
57
|
+
"node": "20 || >=22"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public",
|
|
61
61
|
"registry": "https://registry.npmjs.org/"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "543f0ff807df6e8969fcec27d996dcd6a4f975aa"
|
|
64
64
|
}
|
|
@@ -25,6 +25,11 @@ export type InputOutputAdapter = {
|
|
|
25
25
|
*/
|
|
26
26
|
log: Logger;
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* An AbortSignal to communicate aborting ongoing operations.
|
|
30
|
+
*/
|
|
31
|
+
readonly signal?: AbortSignal;
|
|
32
|
+
|
|
28
33
|
/**
|
|
29
34
|
* Prompts the user for one or more questions.
|
|
30
35
|
*
|
|
@@ -34,10 +39,16 @@ export type InputOutputAdapter = {
|
|
|
34
39
|
prompt<A extends PromptAnswers = PromptAnswers>(questions: PromptQuestions<A>, initialAnswers?: Partial<A>): Promise<A>;
|
|
35
40
|
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
42
|
+
* @deprecated use `abort` instead
|
|
43
|
+
* Close the adapter by aborting the adapter with default reason.
|
|
38
44
|
*/
|
|
39
45
|
close(): void;
|
|
40
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Aborts ongoing operations and prevents to add new operations.
|
|
49
|
+
*/
|
|
50
|
+
abort?(reason?: any): void;
|
|
51
|
+
|
|
41
52
|
/**
|
|
42
53
|
* Creates a separator for prompt choices.
|
|
43
54
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeoman/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common API for yeoman's generator/environment stack",
|
|
6
6
|
"keywords": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@types/node": ">=16.18.26",
|
|
35
|
-
"@yeoman/adapter": "^1.6.0 || ^2.0.0-beta.0",
|
|
35
|
+
"@yeoman/adapter": "^1.6.0 || ^2.0.0-beta.0 || ^3.0.0",
|
|
36
36
|
"mem-fs": "^3.0.0 || ^4.0.0-beta.1",
|
|
37
37
|
"mem-fs-editor": "^10.0.2 || >=10.0.2"
|
|
38
38
|
},
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"access": "public",
|
|
55
55
|
"registry": "https://registry.npmjs.org/"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "c29335cbc7b242990164375574220e9ba61c7d14"
|
|
58
58
|
}
|