@gadgetinc/ggt 0.1.18 → 0.2.0
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 +6 -6
- package/bin/dev.js +24 -0
- package/bin/run.js +11 -0
- package/lib/__generated__/graphql.js +6 -9
- package/lib/__generated__/graphql.js.map +1 -1
- package/lib/commands/help.js +22 -37
- package/lib/commands/help.js.map +1 -1
- package/lib/commands/list.js +30 -56
- package/lib/commands/list.js.map +1 -1
- package/lib/commands/login.js +13 -29
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/logout.js +17 -34
- package/lib/commands/logout.js.map +1 -1
- package/lib/commands/sync.js +483 -456
- package/lib/commands/sync.js.map +1 -1
- package/lib/commands/whoami.js +17 -34
- package/lib/commands/whoami.js.map +1 -1
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -1
- package/lib/utils/base-command.js +106 -147
- package/lib/utils/base-command.js.map +1 -1
- package/lib/utils/client.js +104 -113
- package/lib/utils/client.js.map +1 -1
- package/lib/utils/context.js +63 -119
- package/lib/utils/context.js.map +1 -1
- package/lib/utils/errors.js +161 -242
- package/lib/utils/errors.js.map +1 -1
- package/lib/utils/flags.js +23 -26
- package/lib/utils/flags.js.map +1 -1
- package/lib/utils/fs-utils.js +46 -73
- package/lib/utils/fs-utils.js.map +1 -1
- package/lib/utils/help.js +19 -26
- package/lib/utils/help.js.map +1 -1
- package/lib/utils/promise.js +32 -78
- package/lib/utils/promise.js.map +1 -1
- package/lib/utils/sleep.js +6 -11
- package/lib/utils/sleep.js.map +1 -1
- package/npm-shrinkwrap.json +7569 -6914
- package/oclif.manifest.json +1 -1
- package/package.json +45 -45
- package/bin/dev +0 -20
- package/bin/run +0 -7
- package/lib/__generated__/graphql.d.ts +0 -294
- package/lib/commands/help.d.ts +0 -14
- package/lib/commands/list.d.ts +0 -18
- package/lib/commands/login.d.ts +0 -7
- package/lib/commands/logout.d.ts +0 -7
- package/lib/commands/sync.d.ts +0 -146
- package/lib/commands/whoami.d.ts +0 -7
- package/lib/index.d.ts +0 -1
- package/lib/utils/base-command.d.ts +0 -64
- package/lib/utils/client.d.ts +0 -42
- package/lib/utils/context.d.ts +0 -57
- package/lib/utils/errors.d.ts +0 -100
- package/lib/utils/flags.d.ts +0 -1
- package/lib/utils/fs-utils.d.ts +0 -21
- package/lib/utils/help.d.ts +0 -19
- package/lib/utils/promise.d.ts +0 -35
- package/lib/utils/sleep.d.ts +0 -5
package/lib/commands/sync.d.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { FSWatcher } from "chokidar";
|
|
2
|
-
import type { DebouncedFunc } from "lodash";
|
|
3
|
-
import PQueue from "p-queue";
|
|
4
|
-
import { BaseCommand } from "../utils/base-command";
|
|
5
|
-
import type { Query } from "../utils/client";
|
|
6
|
-
import { Client } from "../utils/client";
|
|
7
|
-
import { FSIgnorer } from "../utils/fs-utils";
|
|
8
|
-
import type { PublishFileSyncEventsMutation, PublishFileSyncEventsMutationVariables, RemoteFilesVersionQuery, RemoteFilesVersionQueryVariables, RemoteFileSyncEventsSubscription, RemoteFileSyncEventsSubscriptionVariables } from "../__generated__/graphql";
|
|
9
|
-
export default class Sync extends BaseCommand<typeof Sync> {
|
|
10
|
-
static priority: number;
|
|
11
|
-
static summary: string;
|
|
12
|
-
static usage: string;
|
|
13
|
-
static description: string;
|
|
14
|
-
static args: {
|
|
15
|
-
directory: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
16
|
-
};
|
|
17
|
-
static flags: {
|
|
18
|
-
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
19
|
-
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
-
"file-push-delay": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
21
|
-
"file-stability-threshold": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
22
|
-
"file-poll-interval": import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
23
|
-
};
|
|
24
|
-
static examples: string[];
|
|
25
|
-
requireUser: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The current status of the sync process.
|
|
28
|
-
*/
|
|
29
|
-
status: SyncStatus;
|
|
30
|
-
/**
|
|
31
|
-
* The absolute path to the directory to sync files to.
|
|
32
|
-
*/
|
|
33
|
-
dir: string;
|
|
34
|
-
/**
|
|
35
|
-
* A list of filepaths that have changed because of a remote file-sync event. This is used to avoid sending files that
|
|
36
|
-
* we recently received from a remote file-sync event.
|
|
37
|
-
*/
|
|
38
|
-
recentRemoteChanges: Set<string>;
|
|
39
|
-
/**
|
|
40
|
-
* A FIFO async callback queue that ensures we process file-sync events in the order they occurred.
|
|
41
|
-
*/
|
|
42
|
-
queue: PQueue<import("p-queue/dist/priority-queue").default, import("p-queue").DefaultAddOptions>;
|
|
43
|
-
/**
|
|
44
|
-
* A GraphQL client connected to the app's /edit/api/graphql-ws endpoint
|
|
45
|
-
*/
|
|
46
|
-
client: Client;
|
|
47
|
-
/**
|
|
48
|
-
* Loads the .ignore file and provides methods for checking if a file should be ignored.
|
|
49
|
-
*/
|
|
50
|
-
ignorer: FSIgnorer;
|
|
51
|
-
/**
|
|
52
|
-
* Watches the local filesystem for changes.
|
|
53
|
-
*/
|
|
54
|
-
watcher: FSWatcher;
|
|
55
|
-
/**
|
|
56
|
-
* Holds information about the state of the local filesystem. It's persisted to `.gadget/sync.json`.
|
|
57
|
-
*/
|
|
58
|
-
metadata: {
|
|
59
|
-
/**
|
|
60
|
-
* The app this filesystem is synced to.
|
|
61
|
-
*/
|
|
62
|
-
app: string;
|
|
63
|
-
/**
|
|
64
|
-
* The last filesVersion that was successfully written to the filesystem. This is used to determine if the remote
|
|
65
|
-
* filesystem is ahead of the local one.
|
|
66
|
-
*/
|
|
67
|
-
filesVersion: string;
|
|
68
|
-
/**
|
|
69
|
-
* The largest mtime that was seen on the local filesystem before `ggt sync` stopped. This is used to determine if
|
|
70
|
-
* the local filesystem has changed since the last sync.
|
|
71
|
-
*
|
|
72
|
-
* Note: This does not include the mtime of files that are ignored.
|
|
73
|
-
*/
|
|
74
|
-
mtime: number;
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* A debounced function that enqueue's local file changes to be sent to Gadget.
|
|
78
|
-
*/
|
|
79
|
-
publish: DebouncedFunc<() => void>;
|
|
80
|
-
/**
|
|
81
|
-
* Gracefully stops the sync.
|
|
82
|
-
*/
|
|
83
|
-
stop: (error?: unknown) => Promise<void>;
|
|
84
|
-
/**
|
|
85
|
-
* Turns an absolute filepath into a relative one from {@linkcode dir}.
|
|
86
|
-
*/
|
|
87
|
-
relative(to: string): string;
|
|
88
|
-
/**
|
|
89
|
-
* Combines path segments into an absolute filepath that starts at {@linkcode dir}.
|
|
90
|
-
*/
|
|
91
|
-
absolute(...pathSegments: string[]): string;
|
|
92
|
-
/**
|
|
93
|
-
* Similar to {@linkcode relative} in that it turns a filepath into a relative one from {@linkcode dir}. However, it
|
|
94
|
-
* also changes any slashes to be posix/unix-like forward slashes, condenses repeated slashes into a single slash, and
|
|
95
|
-
* adds a trailing slash if the filepath is a directory.
|
|
96
|
-
*
|
|
97
|
-
* This is used when sending file-sync events to Gadget to ensure that the paths are consistent across platforms.
|
|
98
|
-
*
|
|
99
|
-
* @see https://www.npmjs.com/package/normalize-path
|
|
100
|
-
*/
|
|
101
|
-
normalize(filepath: string, isDirectory: boolean): string;
|
|
102
|
-
/**
|
|
103
|
-
* Pretty-prints changed and deleted filepaths to the console.
|
|
104
|
-
*
|
|
105
|
-
* @param prefix The prefix to print before each line.
|
|
106
|
-
* @param changed The normalized paths that have changed.
|
|
107
|
-
* @param deleted The normalized paths that have been deleted.
|
|
108
|
-
* @param options.limit The maximum number of lines to print. Defaults to 10. If debug is enabled, this is ignored.
|
|
109
|
-
*/
|
|
110
|
-
logPaths(prefix: string, changed: string[], deleted: string[], { limit }?: {
|
|
111
|
-
limit?: number | undefined;
|
|
112
|
-
}): void;
|
|
113
|
-
/**
|
|
114
|
-
* Initializes the sync process.
|
|
115
|
-
* - Ensures the directory exists.
|
|
116
|
-
* - Ensures the directory is empty or contains a `.gadget/sync.json` file.
|
|
117
|
-
* - Ensures an app is selected and that it matches the app the directory was previously synced to.
|
|
118
|
-
* - Ensures yarn v1 is installed.
|
|
119
|
-
* - Prompts the user how to resolve conflicts if the local filesystem has changed since the last sync.
|
|
120
|
-
*/
|
|
121
|
-
init(): Promise<void>;
|
|
122
|
-
/**
|
|
123
|
-
* Runs the sync process until it is stopped or an error occurs.
|
|
124
|
-
*/
|
|
125
|
-
run(): Promise<void>;
|
|
126
|
-
/**
|
|
127
|
-
* Enqueues a function that handles file-sync events onto the {@linkcode queue}.
|
|
128
|
-
*
|
|
129
|
-
* @param fn The function to enqueue.
|
|
130
|
-
*/
|
|
131
|
-
private _enqueue;
|
|
132
|
-
}
|
|
133
|
-
export declare enum SyncStatus {
|
|
134
|
-
STARTING = 0,
|
|
135
|
-
RUNNING = 1,
|
|
136
|
-
STOPPING = 2,
|
|
137
|
-
STOPPED = 3
|
|
138
|
-
}
|
|
139
|
-
export declare enum Action {
|
|
140
|
-
CANCEL = "Cancel (Ctrl+C)",
|
|
141
|
-
MERGE = "Merge local files with remote ones",
|
|
142
|
-
RESET = "Reset local files to remote ones"
|
|
143
|
-
}
|
|
144
|
-
export declare const REMOTE_FILE_SYNC_EVENTS_SUBSCRIPTION: Query<RemoteFileSyncEventsSubscription, RemoteFileSyncEventsSubscriptionVariables>;
|
|
145
|
-
export declare const REMOTE_FILES_VERSION_QUERY: Query<RemoteFilesVersionQuery, RemoteFilesVersionQueryVariables>;
|
|
146
|
-
export declare const PUBLISH_FILE_SYNC_EVENTS_MUTATION: Query<PublishFileSyncEventsMutation, PublishFileSyncEventsMutationVariables>;
|
package/lib/commands/whoami.d.ts
DELETED
package/lib/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { run } from "@oclif/core";
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Config, Interfaces } from "@oclif/core";
|
|
2
|
-
import { Command } from "@oclif/core";
|
|
3
|
-
import type { Notification } from "node-notifier";
|
|
4
|
-
import type WindowsBalloon from "node-notifier/notifiers/balloon";
|
|
5
|
-
import type Growl from "node-notifier/notifiers/growl";
|
|
6
|
-
import type NotificationCenter from "node-notifier/notifiers/notificationcenter";
|
|
7
|
-
import type NotifySend from "node-notifier/notifiers/notifysend";
|
|
8
|
-
import type WindowsToaster from "node-notifier/notifiers/toaster";
|
|
9
|
-
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
|
|
10
|
-
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
|
|
11
|
-
/**
|
|
12
|
-
* BaseCommand is the base class for all commands in the Gadget CLI.
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
15
|
-
/**
|
|
16
|
-
* Determines how high the command is listed in the README. The lower the number, the higher the command is listed.
|
|
17
|
-
* Equal numbers are sorted alphabetically.
|
|
18
|
-
*/
|
|
19
|
-
static priority: number;
|
|
20
|
-
/**
|
|
21
|
-
* Flags that are available to all commands.
|
|
22
|
-
*
|
|
23
|
-
* Short form should be capitalized.
|
|
24
|
-
*/
|
|
25
|
-
static baseFlags: {
|
|
26
|
-
debug: Interfaces.BooleanFlag<boolean>;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Determines whether the command requires the user to be logged in or not.
|
|
30
|
-
*
|
|
31
|
-
* If true and the user is not logged in, the user will be prompted to login before the underlying command is
|
|
32
|
-
* initialized and run.
|
|
33
|
-
*/
|
|
34
|
-
readonly requireUser: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The parsed flags for the command.
|
|
37
|
-
*/
|
|
38
|
-
flags: Flags<T>;
|
|
39
|
-
/**
|
|
40
|
-
* The parsed arguments for the command.
|
|
41
|
-
*/
|
|
42
|
-
args: Args<T>;
|
|
43
|
-
constructor(argv: string[], config: Config);
|
|
44
|
-
/**
|
|
45
|
-
* Indicates whether the command is being run with the `-D/--debug` flag.
|
|
46
|
-
*/
|
|
47
|
-
get debugEnabled(): boolean;
|
|
48
|
-
init(): Promise<void>;
|
|
49
|
-
/**
|
|
50
|
-
* Sends a native OS notification to the user.
|
|
51
|
-
*
|
|
52
|
-
* @see {@link https://www.npmjs.com/package/node-notifier node-notifier}
|
|
53
|
-
*/
|
|
54
|
-
notify(notification: Notification | NotificationCenter.Notification | NotifySend.Notification | WindowsToaster.Notification | WindowsBalloon.Notification | Growl.Notification): void;
|
|
55
|
-
/**
|
|
56
|
-
* Opens the Gadget login page in the user's default browser and waits for the user to login.
|
|
57
|
-
*/
|
|
58
|
-
login(): Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Overrides the default `catch` behavior so we can control how errors are printed to the user. This is called
|
|
61
|
-
* automatically by oclif when an error is thrown during the `init` or `run` methods.
|
|
62
|
-
*/
|
|
63
|
-
catch(cause: Error): Promise<never>;
|
|
64
|
-
}
|
package/lib/utils/client.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { ExecutionResult } from "graphql-ws";
|
|
2
|
-
import type { JsonObject, SetOptional } from "type-fest";
|
|
3
|
-
import { ClientError } from "./errors";
|
|
4
|
-
declare enum ConnectionStatus {
|
|
5
|
-
CONNECTED = 0,
|
|
6
|
-
DISCONNECTED = 1,
|
|
7
|
-
RECONNECTING = 2
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Client is a GraphQL client connected to a Gadget application's /edit/api/graphql-ws endpoint.
|
|
11
|
-
*
|
|
12
|
-
* NOTE: In order to use the Client, the user must be logged in and an app must have been selected (`context.app` and
|
|
13
|
-
* `context.session` must be set).
|
|
14
|
-
*/
|
|
15
|
-
export declare class Client {
|
|
16
|
-
status: ConnectionStatus;
|
|
17
|
-
private _client;
|
|
18
|
-
constructor();
|
|
19
|
-
subscribe<Data extends JsonObject, Variables extends JsonObject, Extensions extends JsonObject = JsonObject>(payload: Payload<Data, Variables>, sink: SetOptional<Sink<Data, Extensions>, "complete">): () => void;
|
|
20
|
-
subscribeUnwrap<Data extends JsonObject, Variables extends JsonObject>(payload: Payload<Data, Variables>, sink: {
|
|
21
|
-
next: (data: Data) => void;
|
|
22
|
-
error: (error: ClientError) => void;
|
|
23
|
-
}): () => void;
|
|
24
|
-
query<Data extends JsonObject, Variables extends JsonObject, Extensions extends JsonObject = JsonObject>(payload: Payload<Data, Variables>): Promise<ExecutionResult<Data, Extensions>>;
|
|
25
|
-
queryUnwrap<Data extends JsonObject, Variables extends JsonObject>(payload: Payload<Data, Variables>): Promise<Data>;
|
|
26
|
-
dispose(): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
export type Query<Data extends JsonObject, Variables extends JsonObject = JsonObject, Extensions extends JsonObject = JsonObject> = string & {
|
|
29
|
-
__TData?: Data;
|
|
30
|
-
__TVariables?: Variables;
|
|
31
|
-
__TExtensions?: Extensions;
|
|
32
|
-
};
|
|
33
|
-
export interface Payload<Data extends JsonObject, Variables extends JsonObject> {
|
|
34
|
-
readonly query: Query<Data, Variables>;
|
|
35
|
-
readonly variables?: Variables | (() => Variables) | null;
|
|
36
|
-
}
|
|
37
|
-
export interface Sink<Data extends JsonObject, Extensions extends JsonObject> {
|
|
38
|
-
next(value: ExecutionResult<Data, Extensions>): void;
|
|
39
|
-
error(error: ClientError): void;
|
|
40
|
-
complete(): void;
|
|
41
|
-
}
|
|
42
|
-
export {};
|
package/lib/utils/context.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { Config } from "@oclif/core";
|
|
2
|
-
export declare class Context {
|
|
3
|
-
/**
|
|
4
|
-
* A reference to oclif's {@linkcode Config}.
|
|
5
|
-
*
|
|
6
|
-
* By default, oclif's {@linkcode Config} is only available as an instance property on a Command, but we want to be
|
|
7
|
-
* able to access it from anywhere. To do this, we created this global variable that references the Config. It is set
|
|
8
|
-
* by the init function in the BaseCommand.
|
|
9
|
-
*/
|
|
10
|
-
config: Config;
|
|
11
|
-
env: Env;
|
|
12
|
-
app?: App;
|
|
13
|
-
domains: {
|
|
14
|
-
app: string;
|
|
15
|
-
services: string;
|
|
16
|
-
};
|
|
17
|
-
private _session?;
|
|
18
|
-
private _user?;
|
|
19
|
-
private _availableApps;
|
|
20
|
-
private _request;
|
|
21
|
-
constructor();
|
|
22
|
-
get session(): string | undefined;
|
|
23
|
-
set session(value: string | undefined);
|
|
24
|
-
/**
|
|
25
|
-
* @returns The current user, or undefined if the user is not logged in.
|
|
26
|
-
*/
|
|
27
|
-
getUser(): Promise<User | undefined>;
|
|
28
|
-
/**
|
|
29
|
-
* @returns The list of Gadget applications the current user has access to.
|
|
30
|
-
*/
|
|
31
|
-
getAvailableApps(): Promise<App[]>;
|
|
32
|
-
setApp(appOrSlug?: App | string): Promise<void>;
|
|
33
|
-
clear(): void;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Captures the name and nature of the environment
|
|
37
|
-
*/
|
|
38
|
-
declare class Env {
|
|
39
|
-
get value(): string;
|
|
40
|
-
get productionLike(): boolean;
|
|
41
|
-
get developmentLike(): boolean;
|
|
42
|
-
get testLike(): boolean;
|
|
43
|
-
get developmentOrTestLike(): boolean;
|
|
44
|
-
}
|
|
45
|
-
export interface User {
|
|
46
|
-
id: string | number;
|
|
47
|
-
email: string;
|
|
48
|
-
name?: string;
|
|
49
|
-
}
|
|
50
|
-
export interface App {
|
|
51
|
-
id: string | number;
|
|
52
|
-
slug: string;
|
|
53
|
-
primaryDomain: string;
|
|
54
|
-
hasSplitEnvironments: boolean;
|
|
55
|
-
}
|
|
56
|
-
export declare const context: Context;
|
|
57
|
-
export {};
|
package/lib/utils/errors.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import type { GraphQLError } from "graphql";
|
|
2
|
-
import type { CloseEvent, ErrorEvent } from "ws";
|
|
3
|
-
import type Sync from "../commands/sync";
|
|
4
|
-
import type { Payload } from "./client";
|
|
5
|
-
/**
|
|
6
|
-
* Base class for all errors.
|
|
7
|
-
*
|
|
8
|
-
* Inspired by gadget's GadgetError and oclif's PrettyPrintableError.
|
|
9
|
-
*/
|
|
10
|
-
export declare abstract class BaseError extends Error {
|
|
11
|
-
/**
|
|
12
|
-
* A GGT_CLI_SOMETHING human/machine readable unique identifier for this error.
|
|
13
|
-
*/
|
|
14
|
-
code: string;
|
|
15
|
-
/**
|
|
16
|
-
* The Sentry event ID for this error.
|
|
17
|
-
*/
|
|
18
|
-
sentryEventId: `${string}-${string}-${string}-${string}-${string}`;
|
|
19
|
-
/**
|
|
20
|
-
* The underlying *thing* that caused this error.
|
|
21
|
-
*/
|
|
22
|
-
cause?: any;
|
|
23
|
-
/**
|
|
24
|
-
* Assume the stack trace exists.
|
|
25
|
-
*/
|
|
26
|
-
stack: string;
|
|
27
|
-
/**
|
|
28
|
-
* Indicates whether this error is considered a bug or not.
|
|
29
|
-
*/
|
|
30
|
-
abstract isBug: IsBug;
|
|
31
|
-
constructor(code: string, message: string);
|
|
32
|
-
capture(): Promise<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Turns this error into a user-friendly message that explains what went wrong and how to fix it. A good write up of what an error should
|
|
35
|
-
* look like can be found here: {@link https://clig.dev/#errors}
|
|
36
|
-
*/
|
|
37
|
-
render(): string;
|
|
38
|
-
protected header(): string;
|
|
39
|
-
protected footer(): string;
|
|
40
|
-
protected abstract body(): string;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Universal Error object to json blob serializer.
|
|
44
|
-
* Wraps `serialize-error` with some handy stuff, like special support for Got HTTP errors
|
|
45
|
-
*/
|
|
46
|
-
export declare function serializeError(error: Error | string | unknown): Record<string, any>;
|
|
47
|
-
export declare enum IsBug {
|
|
48
|
-
YES = "yes",
|
|
49
|
-
NO = "no",
|
|
50
|
-
MAYBE = "maybe"
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Our "catch all" error. If this error is thrown, we almost certainly have a bug.
|
|
54
|
-
*
|
|
55
|
-
* Whenever possible, we should use a more specific error so that we can provide more useful information.
|
|
56
|
-
*/
|
|
57
|
-
export declare class UnexpectedError extends BaseError {
|
|
58
|
-
cause: Error;
|
|
59
|
-
isBug: IsBug;
|
|
60
|
-
constructor(cause: Error);
|
|
61
|
-
protected body(): string;
|
|
62
|
-
}
|
|
63
|
-
export declare class ClientError extends BaseError {
|
|
64
|
-
readonly payload: Payload<any, any>;
|
|
65
|
-
cause: string | Error | readonly GraphQLError[] | CloseEvent | ErrorEvent;
|
|
66
|
-
isBug: IsBug;
|
|
67
|
-
constructor(payload: Payload<any, any>, cause: string | Error | readonly GraphQLError[] | CloseEvent | ErrorEvent);
|
|
68
|
-
body(): string;
|
|
69
|
-
}
|
|
70
|
-
export declare class YarnNotFoundError extends BaseError {
|
|
71
|
-
isBug: IsBug;
|
|
72
|
-
constructor();
|
|
73
|
-
protected body(): string;
|
|
74
|
-
}
|
|
75
|
-
export declare class FlagError<T extends {
|
|
76
|
-
name: string;
|
|
77
|
-
char?: string;
|
|
78
|
-
} = {
|
|
79
|
-
name: string;
|
|
80
|
-
char?: string;
|
|
81
|
-
}> extends BaseError {
|
|
82
|
-
#private;
|
|
83
|
-
readonly flag: T;
|
|
84
|
-
readonly description: string;
|
|
85
|
-
isBug: IsBug;
|
|
86
|
-
constructor(flag: T, description: string);
|
|
87
|
-
protected header(): string;
|
|
88
|
-
protected body(): string;
|
|
89
|
-
}
|
|
90
|
-
export declare class InvalidSyncFileError extends BaseError {
|
|
91
|
-
readonly cause: unknown;
|
|
92
|
-
readonly sync: Sync;
|
|
93
|
-
readonly app: string | undefined;
|
|
94
|
-
isBug: IsBug;
|
|
95
|
-
constructor(cause: unknown, sync: Sync, app: string | undefined);
|
|
96
|
-
protected body(): string;
|
|
97
|
-
}
|
|
98
|
-
export declare class InvalidSyncAppFlagError extends FlagError {
|
|
99
|
-
constructor(sync: Sync);
|
|
100
|
-
}
|
package/lib/utils/flags.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const app: import("@oclif/core/lib/interfaces/parser").FlagDefinition<string, Record<string, unknown>>;
|
package/lib/utils/fs-utils.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare class FSIgnorer {
|
|
2
|
-
private readonly _rootDir;
|
|
3
|
-
private readonly _alwaysIgnore;
|
|
4
|
-
readonly filepath: string;
|
|
5
|
-
private _ignorer;
|
|
6
|
-
constructor(_rootDir: string, _alwaysIgnore: string[]);
|
|
7
|
-
ignores(filepath: string): boolean;
|
|
8
|
-
reload(): void;
|
|
9
|
-
}
|
|
10
|
-
export interface WalkDirOptions {
|
|
11
|
-
ignorer?: FSIgnorer;
|
|
12
|
-
}
|
|
13
|
-
export declare function walkDir(dir: string, options?: WalkDirOptions): AsyncGenerator<string>;
|
|
14
|
-
export declare function walkDirSync(dir: string, options?: WalkDirOptions): Generator<string>;
|
|
15
|
-
export declare function isEmptyDirSync(dir: string, opts?: {
|
|
16
|
-
ignoreEnoent: boolean;
|
|
17
|
-
}): boolean;
|
|
18
|
-
export declare function isEmptyDir(dir: string, opts?: {
|
|
19
|
-
ignoreEnoent: boolean;
|
|
20
|
-
}): Promise<boolean>;
|
|
21
|
-
export declare function ignoreEnoent(error: any): void;
|
package/lib/utils/help.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Command } from "@oclif/core";
|
|
2
|
-
import { CommandHelp as OclifCommandHelp, Help as OclifHelp } from "@oclif/core";
|
|
3
|
-
export default class Help extends OclifHelp {
|
|
4
|
-
CommandHelpClass: typeof CommandHelp;
|
|
5
|
-
}
|
|
6
|
-
declare class CommandHelp extends OclifCommandHelp {
|
|
7
|
-
/**
|
|
8
|
-
* By default, oclif tries to format the description so that it fit's within the terminal window. However, if the description is already
|
|
9
|
-
* formatted with `dedent`, then the description gets mangled and the help output is not pretty.
|
|
10
|
-
*
|
|
11
|
-
* This overrides the default behavior to just use the description as-is if it already exists.
|
|
12
|
-
*/
|
|
13
|
-
protected description(): string | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Same as above, but for examples.
|
|
16
|
-
*/
|
|
17
|
-
protected examples(examples: string | string[] | Command.Example[] | undefined): string | undefined;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
package/lib/utils/promise.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Long lived references to Promises stress the garbage collector in JS. Instead of caching resolved Promises, we cache
|
|
3
|
-
* these little data objects instead which reference the resolution or rejection of the Promise, allowing the Promise
|
|
4
|
-
* object to be free'd.
|
|
5
|
-
*/
|
|
6
|
-
export declare class PromiseWrapper<T> {
|
|
7
|
-
resolution?: T;
|
|
8
|
-
rejection?: any;
|
|
9
|
-
pendingPromise?: Promise<T>;
|
|
10
|
-
constructor(promise: Promise<T>);
|
|
11
|
-
unwrap(): Promise<T>;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* A promise that can be resolved or rejected from outside its callback.
|
|
15
|
-
*
|
|
16
|
-
* This is typically used when you want to await a promise that is resolved or rejected from outside the current scope,
|
|
17
|
-
* such as from an event handler.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* const signal = new PromiseSignal();
|
|
21
|
-
* process.on("SIGINT", () => {
|
|
22
|
-
* signal.resolve();
|
|
23
|
-
* });
|
|
24
|
-
* await signal;
|
|
25
|
-
*/
|
|
26
|
-
export declare class PromiseSignal<T = void> implements Promise<T> {
|
|
27
|
-
readonly [Symbol.toStringTag]: string;
|
|
28
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
29
|
-
reject: (reason?: any) => void;
|
|
30
|
-
private _promise;
|
|
31
|
-
constructor();
|
|
32
|
-
then<R = T, E = never>(onfulfilled?: (value: T) => R | PromiseLike<R>, onrejected?: (reason: any) => E | PromiseLike<E>): Promise<R | E>;
|
|
33
|
-
catch<E = never>(onrejected?: (reason: any) => E | PromiseLike<E>): Promise<T | E>;
|
|
34
|
-
finally(onfinally?: () => void): Promise<T>;
|
|
35
|
-
}
|