@gadgetinc/ggt 0.1.7 → 0.1.9
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 +7 -7
- package/lib/__generated__/graphql.d.ts +45 -45
- package/lib/commands/help.js +1 -1
- package/lib/commands/help.js.map +1 -1
- package/lib/commands/login.d.ts +1 -1
- package/lib/commands/login.js +1 -1
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/logout.d.ts +1 -1
- package/lib/commands/logout.js +2 -2
- package/lib/commands/logout.js.map +1 -1
- package/lib/commands/sync.d.ts +4 -4
- package/lib/commands/sync.js +20 -25
- package/lib/commands/sync.js.map +1 -1
- package/lib/commands/whoami.d.ts +1 -1
- package/lib/commands/whoami.js +2 -2
- package/lib/commands/whoami.js.map +1 -1
- package/lib/{lib → utils}/base-command.d.ts +0 -0
- package/lib/{lib → utils}/base-command.js +1 -1
- package/lib/utils/base-command.js.map +1 -0
- package/lib/{lib → utils}/client.d.ts +1 -1
- package/lib/{lib → utils}/client.js +3 -3
- package/lib/utils/client.js.map +1 -0
- package/lib/{lib → utils}/context.d.ts +0 -0
- package/lib/{lib → utils}/context.js +0 -0
- package/lib/utils/context.js.map +1 -0
- package/lib/{lib → utils}/errors.d.ts +7 -1
- package/lib/{lib → utils}/errors.js +73 -61
- package/lib/utils/errors.js.map +1 -0
- package/lib/{lib → utils}/flags.d.ts +0 -0
- package/lib/{lib → utils}/flags.js +0 -0
- package/lib/utils/flags.js.map +1 -0
- package/lib/{lib → utils}/fs-utils.d.ts +0 -0
- package/lib/{lib → utils}/fs-utils.js +1 -1
- package/lib/utils/fs-utils.js.map +1 -0
- package/lib/{lib → utils}/help.d.ts +0 -0
- package/lib/{lib → utils}/help.js +0 -0
- package/lib/utils/help.js.map +1 -0
- package/lib/{lib → utils}/sleep.d.ts +0 -0
- package/lib/{lib → utils}/sleep.js +0 -0
- package/lib/utils/sleep.js.map +1 -0
- package/npm-shrinkwrap.json +2757 -2891
- package/oclif.manifest.json +1 -1
- package/package.json +35 -34
- package/lib/lib/base-command.js.map +0 -1
- package/lib/lib/client.js.map +0 -1
- package/lib/lib/context.js.map +0 -1
- package/lib/lib/errors.js.map +0 -1
- package/lib/lib/flags.js.map +0 -1
- package/lib/lib/fs-utils.js.map +0 -1
- package/lib/lib/help.js.map +0 -1
- package/lib/lib/sleep.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<br>
|
|
7
7
|
|
|
8
8
|
<a href="https://github.com/gadget-inc/ggt/actions/workflows/ci.yml?query=branch%3Amain">
|
|
9
|
-
<img alt="ci workflow status" src="https://img.shields.io/github/workflow/status/gadget-inc/ggt/ci
|
|
9
|
+
<img alt="ci workflow status" src="https://img.shields.io/github/actions/workflow/status/gadget-inc/ggt/ci.yml?branch=main&label=ci">
|
|
10
10
|
</a>
|
|
11
11
|
<a href="https://www.npmjs.com/package/@gadgetinc/ggt">
|
|
12
12
|
<img alt="npm version" src="https://img.shields.io/npm/v/@gadgetinc/ggt">
|
|
@@ -86,7 +86,7 @@ DESCRIPTION
|
|
|
86
86
|
* Storing your source code in a Git repository like GitHub (https://github.com/)
|
|
87
87
|
|
|
88
88
|
Sync includes the concept of a `.ignore` file. This file can contain a list of files and
|
|
89
|
-
directories that won't be sent to Gadget when syncing.
|
|
89
|
+
directories that won't be received or sent to Gadget when syncing.
|
|
90
90
|
|
|
91
91
|
The following files and directories are always ignored:
|
|
92
92
|
* .gadget
|
|
@@ -119,7 +119,7 @@ EXAMPLES
|
|
|
119
119
|
$ ggt sync --app https://my-app.gadget.app/edit
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
_See code: [src/commands/sync.ts](https://github.com/gadget-inc/ggt/blob/v0.1.
|
|
122
|
+
_See code: [src/commands/sync.ts](https://github.com/gadget-inc/ggt/blob/v0.1.9/src/commands/sync.ts)_
|
|
123
123
|
|
|
124
124
|
### `ggt help [COMMAND]`
|
|
125
125
|
|
|
@@ -133,7 +133,7 @@ ARGUMENTS
|
|
|
133
133
|
COMMAND The command to show help for.
|
|
134
134
|
```
|
|
135
135
|
|
|
136
|
-
_See code: [src/commands/help.ts](https://github.com/gadget-inc/ggt/blob/v0.1.
|
|
136
|
+
_See code: [src/commands/help.ts](https://github.com/gadget-inc/ggt/blob/v0.1.9/src/commands/help.ts)_
|
|
137
137
|
|
|
138
138
|
### `ggt login`
|
|
139
139
|
|
|
@@ -149,7 +149,7 @@ EXAMPLES
|
|
|
149
149
|
Hello, Jane Doe (jane@example.com)
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
_See code: [src/commands/login.ts](https://github.com/gadget-inc/ggt/blob/v0.1.
|
|
152
|
+
_See code: [src/commands/login.ts](https://github.com/gadget-inc/ggt/blob/v0.1.9/src/commands/login.ts)_
|
|
153
153
|
|
|
154
154
|
### `ggt logout`
|
|
155
155
|
|
|
@@ -164,7 +164,7 @@ EXAMPLES
|
|
|
164
164
|
Goodbye
|
|
165
165
|
```
|
|
166
166
|
|
|
167
|
-
_See code: [src/commands/logout.ts](https://github.com/gadget-inc/ggt/blob/v0.1.
|
|
167
|
+
_See code: [src/commands/logout.ts](https://github.com/gadget-inc/ggt/blob/v0.1.9/src/commands/logout.ts)_
|
|
168
168
|
|
|
169
169
|
### `ggt whoami`
|
|
170
170
|
|
|
@@ -179,7 +179,7 @@ EXAMPLES
|
|
|
179
179
|
You are logged in as Jane Doe (jane@example.com)
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
_See code: [src/commands/whoami.ts](https://github.com/gadget-inc/ggt/blob/v0.1.
|
|
182
|
+
_See code: [src/commands/whoami.ts](https://github.com/gadget-inc/ggt/blob/v0.1.9/src/commands/whoami.ts)_
|
|
183
183
|
|
|
184
184
|
<!-- commandsstop -->
|
|
185
185
|
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
* THIS IS A GENERATED FILE! You shouldn't edit it manually. Regenerate it using `npm run generate-graphql`.
|
|
4
4
|
* ======================================================
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
6
|
+
export type Maybe<T> = T | null;
|
|
7
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
8
|
+
export type Exact<T extends {
|
|
9
9
|
[key: string]: unknown;
|
|
10
10
|
}> = {
|
|
11
11
|
[K in keyof T]: T[K];
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
|
|
14
14
|
[SubKey in K]?: Maybe<T[SubKey]>;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
|
|
17
17
|
[SubKey in K]: Maybe<T[SubKey]>;
|
|
18
18
|
};
|
|
19
19
|
/** All built-in and custom scalars, mapped to their actual values */
|
|
20
|
-
export
|
|
20
|
+
export type Scalars = {
|
|
21
21
|
ID: string;
|
|
22
22
|
String: string;
|
|
23
23
|
Boolean: boolean;
|
|
@@ -29,64 +29,64 @@ export declare type Scalars = {
|
|
|
29
29
|
[key: string]: any;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
export
|
|
32
|
+
export type DeleteAppStatusResult = {
|
|
33
33
|
__typename?: 'DeleteAppStatusResult';
|
|
34
34
|
isNotCreator?: Maybe<Scalars['Boolean']>;
|
|
35
35
|
success: Scalars['Boolean'];
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type EnvironmentPatchResult = {
|
|
38
38
|
__typename?: 'EnvironmentPatchResult';
|
|
39
39
|
success: Scalars['Boolean'];
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export type EnvironmentPublishResult = {
|
|
42
42
|
__typename?: 'EnvironmentPublishResult';
|
|
43
43
|
success: Scalars['Boolean'];
|
|
44
44
|
};
|
|
45
|
-
export
|
|
45
|
+
export type EnvironmentSubscriptionResult = {
|
|
46
46
|
__typename?: 'EnvironmentSubscriptionResult';
|
|
47
47
|
patches: Array<Scalars['JSON']>;
|
|
48
48
|
};
|
|
49
|
-
export
|
|
49
|
+
export type FileSyncChangedEvent = {
|
|
50
50
|
__typename?: 'FileSyncChangedEvent';
|
|
51
51
|
content: Scalars['String'];
|
|
52
52
|
encoding: FileSyncEncoding;
|
|
53
53
|
mode: Scalars['Float'];
|
|
54
54
|
path: Scalars['String'];
|
|
55
55
|
};
|
|
56
|
-
export
|
|
56
|
+
export type FileSyncChangedEventInput = {
|
|
57
57
|
content: Scalars['String'];
|
|
58
58
|
encoding?: InputMaybe<FileSyncEncoding>;
|
|
59
59
|
mode: Scalars['Float'];
|
|
60
60
|
path: Scalars['String'];
|
|
61
61
|
};
|
|
62
|
-
export
|
|
62
|
+
export type FileSyncDeletedEvent = {
|
|
63
63
|
__typename?: 'FileSyncDeletedEvent';
|
|
64
64
|
path: Scalars['String'];
|
|
65
65
|
};
|
|
66
|
-
export
|
|
66
|
+
export type FileSyncDeletedEventInput = {
|
|
67
67
|
path: Scalars['String'];
|
|
68
68
|
};
|
|
69
69
|
export declare enum FileSyncEncoding {
|
|
70
70
|
Base64 = "base64",
|
|
71
71
|
Utf8 = "utf8"
|
|
72
72
|
}
|
|
73
|
-
export
|
|
73
|
+
export type GadgetRole = {
|
|
74
74
|
__typename?: 'GadgetRole';
|
|
75
75
|
key: Scalars['String'];
|
|
76
76
|
name: Scalars['String'];
|
|
77
77
|
order: Scalars['Int'];
|
|
78
78
|
selectable: Scalars['Boolean'];
|
|
79
79
|
};
|
|
80
|
-
export
|
|
80
|
+
export type LogSearchResult = {
|
|
81
81
|
__typename?: 'LogSearchResult';
|
|
82
82
|
data: Scalars['JSON'];
|
|
83
83
|
status: Scalars['String'];
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type MigrateEnvironmentsResult = {
|
|
86
86
|
__typename?: 'MigrateEnvironmentsResult';
|
|
87
87
|
success: Scalars['Boolean'];
|
|
88
88
|
};
|
|
89
|
-
export
|
|
89
|
+
export type Mutation = {
|
|
90
90
|
__typename?: 'Mutation';
|
|
91
91
|
deleteApp?: Maybe<DeleteAppStatusResult>;
|
|
92
92
|
migrateEnvironments?: Maybe<MigrateEnvironmentsResult>;
|
|
@@ -97,39 +97,39 @@ export declare type Mutation = {
|
|
|
97
97
|
registerWebhooks?: Maybe<RegisterWebhooksResult>;
|
|
98
98
|
unregisterWebhooks?: Maybe<UnregisterWebhooksResult>;
|
|
99
99
|
};
|
|
100
|
-
export
|
|
100
|
+
export type MutationPatchEnvironmentTreeArgs = {
|
|
101
101
|
clientID: Scalars['String'];
|
|
102
102
|
patches: Array<Scalars['JSON']>;
|
|
103
103
|
};
|
|
104
|
-
export
|
|
104
|
+
export type MutationPublishFileSyncEventsArgs = {
|
|
105
105
|
input: PublishFileSyncEventsInput;
|
|
106
106
|
};
|
|
107
|
-
export
|
|
107
|
+
export type MutationRefreshScopesArgs = {
|
|
108
108
|
appConfigKey: Scalars['String'];
|
|
109
109
|
connectionKey: Scalars['String'];
|
|
110
110
|
shopId: Scalars['String'];
|
|
111
111
|
};
|
|
112
|
-
export
|
|
112
|
+
export type MutationRegisterWebhooksArgs = {
|
|
113
113
|
connectionKey: Scalars['String'];
|
|
114
114
|
keepExtraTopics?: InputMaybe<Scalars['Boolean']>;
|
|
115
115
|
modelKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
116
116
|
shopIds: Array<Scalars['String']>;
|
|
117
117
|
};
|
|
118
|
-
export
|
|
118
|
+
export type MutationUnregisterWebhooksArgs = {
|
|
119
119
|
connectionKey: Scalars['String'];
|
|
120
120
|
modelKeys?: InputMaybe<Array<Scalars['String']>>;
|
|
121
121
|
shopIds?: InputMaybe<Array<Scalars['String']>>;
|
|
122
122
|
};
|
|
123
|
-
export
|
|
123
|
+
export type PublishFileSyncEventsInput = {
|
|
124
124
|
changed: Array<FileSyncChangedEventInput>;
|
|
125
125
|
deleted: Array<FileSyncDeletedEventInput>;
|
|
126
126
|
expectedRemoteFilesVersion: Scalars['String'];
|
|
127
127
|
};
|
|
128
|
-
export
|
|
128
|
+
export type PublishFileSyncEventsResult = {
|
|
129
129
|
__typename?: 'PublishFileSyncEventsResult';
|
|
130
130
|
remoteFilesVersion: Scalars['String'];
|
|
131
131
|
};
|
|
132
|
-
export
|
|
132
|
+
export type Query = {
|
|
133
133
|
__typename?: 'Query';
|
|
134
134
|
currentUser: User;
|
|
135
135
|
environmentTreePath?: Maybe<Scalars['JSON']>;
|
|
@@ -139,10 +139,10 @@ export declare type Query = {
|
|
|
139
139
|
runTestSupportFunction?: Maybe<Scalars['JSON']>;
|
|
140
140
|
typesManifest: TypesManifest;
|
|
141
141
|
};
|
|
142
|
-
export
|
|
142
|
+
export type QueryEnvironmentTreePathArgs = {
|
|
143
143
|
path: Scalars['String'];
|
|
144
144
|
};
|
|
145
|
-
export
|
|
145
|
+
export type QueryLogsSearchArgs = {
|
|
146
146
|
direction?: InputMaybe<Scalars['String']>;
|
|
147
147
|
end?: InputMaybe<Scalars['DateTime']>;
|
|
148
148
|
limit?: InputMaybe<Scalars['Int']>;
|
|
@@ -150,21 +150,21 @@ export declare type QueryLogsSearchArgs = {
|
|
|
150
150
|
start?: InputMaybe<Scalars['DateTime']>;
|
|
151
151
|
step?: InputMaybe<Scalars['Int']>;
|
|
152
152
|
};
|
|
153
|
-
export
|
|
153
|
+
export type RefreshScopesResult = {
|
|
154
154
|
__typename?: 'RefreshScopesResult';
|
|
155
155
|
success: Scalars['Boolean'];
|
|
156
156
|
};
|
|
157
|
-
export
|
|
157
|
+
export type RegisterWebhooksResult = {
|
|
158
158
|
__typename?: 'RegisterWebhooksResult';
|
|
159
159
|
success: Scalars['Boolean'];
|
|
160
160
|
};
|
|
161
|
-
export
|
|
161
|
+
export type RemoteFileSyncEvents = {
|
|
162
162
|
__typename?: 'RemoteFileSyncEvents';
|
|
163
163
|
changed: Array<FileSyncChangedEvent>;
|
|
164
164
|
deleted: Array<FileSyncDeletedEvent>;
|
|
165
165
|
remoteFilesVersion: Scalars['String'];
|
|
166
166
|
};
|
|
167
|
-
export
|
|
167
|
+
export type Subscription = {
|
|
168
168
|
__typename?: 'Subscription';
|
|
169
169
|
editorActive?: Maybe<Scalars['Boolean']>;
|
|
170
170
|
environmentTreePathPatches?: Maybe<EnvironmentSubscriptionResult>;
|
|
@@ -172,43 +172,43 @@ export declare type Subscription = {
|
|
|
172
172
|
remoteFileSyncEvents: RemoteFileSyncEvents;
|
|
173
173
|
typesManifestStream: TypesManifest;
|
|
174
174
|
};
|
|
175
|
-
export
|
|
175
|
+
export type SubscriptionEnvironmentTreePathPatchesArgs = {
|
|
176
176
|
clientID: Scalars['String'];
|
|
177
177
|
path: Scalars['String'];
|
|
178
178
|
};
|
|
179
|
-
export
|
|
179
|
+
export type SubscriptionLogsSearchArgs = {
|
|
180
180
|
limit?: InputMaybe<Scalars['Int']>;
|
|
181
181
|
query: Scalars['String'];
|
|
182
182
|
start?: InputMaybe<Scalars['DateTime']>;
|
|
183
183
|
};
|
|
184
|
-
export
|
|
184
|
+
export type SubscriptionRemoteFileSyncEventsArgs = {
|
|
185
185
|
encoding?: InputMaybe<FileSyncEncoding>;
|
|
186
186
|
localFilesVersion: Scalars['String'];
|
|
187
187
|
};
|
|
188
|
-
export
|
|
188
|
+
export type TypeManifestEntry = {
|
|
189
189
|
__typename?: 'TypeManifestEntry';
|
|
190
190
|
declaration: Scalars['String'];
|
|
191
191
|
path: Scalars['String'];
|
|
192
192
|
};
|
|
193
|
-
export
|
|
193
|
+
export type TypesManifest = {
|
|
194
194
|
__typename?: 'TypesManifest';
|
|
195
195
|
dependenciesHash: Scalars['String'];
|
|
196
196
|
entries: Array<TypeManifestEntry>;
|
|
197
197
|
environmentVersion: Scalars['Int'];
|
|
198
198
|
};
|
|
199
|
-
export
|
|
199
|
+
export type UnregisterWebhooksResult = {
|
|
200
200
|
__typename?: 'UnregisterWebhooksResult';
|
|
201
201
|
success: Scalars['Boolean'];
|
|
202
202
|
};
|
|
203
|
-
export
|
|
203
|
+
export type User = {
|
|
204
204
|
__typename?: 'User';
|
|
205
205
|
email: Scalars['String'];
|
|
206
206
|
name?: Maybe<Scalars['String']>;
|
|
207
207
|
};
|
|
208
|
-
export
|
|
208
|
+
export type RemoteFileSyncEventsSubscriptionVariables = Exact<{
|
|
209
209
|
localFilesVersion: Scalars['String'];
|
|
210
210
|
}>;
|
|
211
|
-
export
|
|
211
|
+
export type RemoteFileSyncEventsSubscription = {
|
|
212
212
|
__typename?: 'Subscription';
|
|
213
213
|
remoteFileSyncEvents: {
|
|
214
214
|
__typename?: 'RemoteFileSyncEvents';
|
|
@@ -226,17 +226,17 @@ export declare type RemoteFileSyncEventsSubscription = {
|
|
|
226
226
|
}>;
|
|
227
227
|
};
|
|
228
228
|
};
|
|
229
|
-
export
|
|
229
|
+
export type RemoteFilesVersionQueryVariables = Exact<{
|
|
230
230
|
[key: string]: never;
|
|
231
231
|
}>;
|
|
232
|
-
export
|
|
232
|
+
export type RemoteFilesVersionQuery = {
|
|
233
233
|
__typename?: 'Query';
|
|
234
234
|
remoteFilesVersion: string;
|
|
235
235
|
};
|
|
236
|
-
export
|
|
236
|
+
export type PublishFileSyncEventsMutationVariables = Exact<{
|
|
237
237
|
input: PublishFileSyncEventsInput;
|
|
238
238
|
}>;
|
|
239
|
-
export
|
|
239
|
+
export type PublishFileSyncEventsMutation = {
|
|
240
240
|
__typename?: 'Mutation';
|
|
241
241
|
publishFileSyncEvents: {
|
|
242
242
|
__typename?: 'PublishFileSyncEventsResult';
|
package/lib/commands/help.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
-
const help_1 = tslib_1.__importDefault(require("../
|
|
5
|
+
const help_1 = tslib_1.__importDefault(require("../utils/help"));
|
|
6
6
|
/**
|
|
7
7
|
* Copied from @oclif/plugin-help. Uses our own {@link Help} template class instead of the one from @oclif/core.
|
|
8
8
|
*
|
package/lib/commands/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,iEAAiC;AAEjC;;;;GAIG;AACH,MAAqB,WAAY,SAAQ,cAAO;IAO9C,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;;AAXH,8BAYC;AAXQ;;;;WAAkB,KAAK;GAAC;AAExB;;;;WAAmB,uBAAuB;GAAC;AAE3C;;;;WAAgB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;GAAC","sourcesContent":["import { Command } from \"@oclif/core\";\nimport Help from \"../utils/help\";\n\n/**\n * Copied from @oclif/plugin-help. Uses our own {@link Help} template class instead of the one from @oclif/core.\n *\n * @see https://github.com/oclif/plugin-help/blob/67b580570257b45e92d3a04d50bf2a432c59afe3/src/commands/help.ts\n */\nexport default class HelpCommand extends Command {\n static override strict = false;\n\n static override summary = \"Display help for ggt.\";\n\n static override args = [{ name: \"command\", required: false, description: \"The command to show help for.\" }];\n\n async run(): Promise<void> {\n const { argv } = await this.parse();\n const help = new Help(this.config, { all: true });\n await help.showHelp(argv);\n }\n}\n"]}
|
package/lib/commands/login.d.ts
CHANGED
package/lib/commands/login.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const ts_dedent_1 = tslib_1.__importDefault(require("ts-dedent"));
|
|
5
|
-
const base_command_1 = require("../
|
|
5
|
+
const base_command_1 = require("../utils/base-command");
|
|
6
6
|
class Login extends base_command_1.BaseCommand {
|
|
7
7
|
async run() {
|
|
8
8
|
await this.login();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;AAAA,kEAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":";;;AAAA,kEAA+B;AAC/B,wDAAoD;AAEpD,MAAqB,KAAM,SAAQ,0BAAW;IAa5C,KAAK,CAAC,GAAG;QACP,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;;AAfH,wBAgBC;AAfQ;;;;WAAmB,yBAAyB;GAAC;AAE7C;;;;WAAiB,OAAO;GAAC;AAEzB;;;;WAAoB;QACzB,IAAA,mBAAM,EAAA;;;;KAIL;KACF;GAAC","sourcesContent":["import dedent from \"ts-dedent\";\nimport { BaseCommand } from \"../utils/base-command\";\n\nexport default class Login extends BaseCommand {\n static override summary = \"Log in to your account.\";\n\n static override usage = \"login\";\n\n static override examples = [\n dedent`\n $ ggt login\n Your browser has been opened. Please log in to your account.\n Hello, Jane Doe (jane@example.com)\n `,\n ];\n\n async run(): Promise<void> {\n await this.login();\n }\n}\n"]}
|
package/lib/commands/logout.d.ts
CHANGED
package/lib/commands/logout.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const ts_dedent_1 = tslib_1.__importDefault(require("ts-dedent"));
|
|
5
|
-
const base_command_1 = require("../
|
|
6
|
-
const context_1 = require("../
|
|
5
|
+
const base_command_1 = require("../utils/base-command");
|
|
6
|
+
const context_1 = require("../utils/context");
|
|
7
7
|
class Logout extends base_command_1.BaseCommand {
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
9
9
|
async run() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;AAAA,kEAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../src/commands/logout.ts"],"names":[],"mappings":";;;AAAA,kEAA+B;AAC/B,wDAAoD;AACpD,8CAA2C;AAE3C,MAAqB,MAAO,SAAQ,0BAAW;IAY7C,4DAA4D;IAC5D,KAAK,CAAC,GAAG;QACP,IAAI,iBAAO,CAAC,OAAO,EAAE;YACnB,iBAAO,CAAC,OAAO,GAAG,SAAS,CAAC;YAC5B,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SACrB;aAAM;YACL,IAAI,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;SACnC;IACH,CAAC;;AApBH,yBAqBC;AApBQ;;;;WAAmB,0BAA0B;GAAC;AAE9C;;;;WAAiB,QAAQ;GAAC;AAE1B;;;;WAAoB;QACzB,IAAA,mBAAM,EAAA;;;KAGL;KACF;GAAC","sourcesContent":["import dedent from \"ts-dedent\";\nimport { BaseCommand } from \"../utils/base-command\";\nimport { context } from \"../utils/context\";\n\nexport default class Logout extends BaseCommand {\n static override summary = \"Log out of your account.\";\n\n static override usage = \"logout\";\n\n static override examples = [\n dedent`\n $ ggt logout\n Goodbye\n `,\n ];\n\n // eslint-disable-next-line @typescript-eslint/require-await\n async run(): Promise<void> {\n if (context.session) {\n context.session = undefined;\n this.log(\"Goodbye\");\n } else {\n this.log(\"You are not logged in\");\n }\n }\n}\n"]}
|
package/lib/commands/sync.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FSWatcher } from "chokidar";
|
|
2
2
|
import type { DebouncedFunc } from "lodash";
|
|
3
3
|
import PQueue from "p-queue";
|
|
4
|
-
import { BaseCommand } from "../
|
|
5
|
-
import type { Query } from "../
|
|
6
|
-
import { Client } from "../
|
|
7
|
-
import { Ignorer } from "../
|
|
4
|
+
import { BaseCommand } from "../utils/base-command";
|
|
5
|
+
import type { Query } from "../utils/client";
|
|
6
|
+
import { Client } from "../utils/client";
|
|
7
|
+
import { Ignorer } from "../utils/fs-utils";
|
|
8
8
|
import type { PublishFileSyncEventsMutation, PublishFileSyncEventsMutationVariables, RemoteFilesVersionQuery, RemoteFilesVersionQueryVariables, RemoteFileSyncEventsSubscription, RemoteFileSyncEventsSubscriptionVariables } from "../__generated__/graphql";
|
|
9
9
|
export default class Sync extends BaseCommand {
|
|
10
10
|
static priority: number;
|
package/lib/commands/sync.js
CHANGED
|
@@ -16,13 +16,13 @@ const p_queue_1 = tslib_1.__importDefault(require("p-queue"));
|
|
|
16
16
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
17
17
|
const ts_dedent_1 = tslib_1.__importDefault(require("ts-dedent"));
|
|
18
18
|
const which_1 = tslib_1.__importDefault(require("which"));
|
|
19
|
-
const base_command_1 = require("../
|
|
20
|
-
const client_1 = require("../
|
|
21
|
-
const context_1 = require("../
|
|
22
|
-
const errors_1 = require("../
|
|
23
|
-
const flags_1 = require("../
|
|
24
|
-
const fs_utils_1 = require("../
|
|
25
|
-
const sleep_1 = require("../
|
|
19
|
+
const base_command_1 = require("../utils/base-command");
|
|
20
|
+
const client_1 = require("../utils/client");
|
|
21
|
+
const context_1 = require("../utils/context");
|
|
22
|
+
const errors_1 = require("../utils/errors");
|
|
23
|
+
const flags_1 = require("../utils/flags");
|
|
24
|
+
const fs_utils_1 = require("../utils/fs-utils");
|
|
25
|
+
const sleep_1 = require("../utils/sleep");
|
|
26
26
|
const graphql_1 = require("../__generated__/graphql");
|
|
27
27
|
class Sync extends base_command_1.BaseCommand {
|
|
28
28
|
constructor() {
|
|
@@ -163,19 +163,7 @@ class Sync extends base_command_1.BaseCommand {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
if (flags.app && flags.app !== this.metadata.app && !flags.force) {
|
|
166
|
-
throw new errors_1.
|
|
167
|
-
You were about to sync the following app to the following directory:
|
|
168
|
-
|
|
169
|
-
${flags.app} → ${this.dir}
|
|
170
|
-
|
|
171
|
-
However, that directory has already been synced with this app:
|
|
172
|
-
|
|
173
|
-
${this.metadata.app}
|
|
174
|
-
|
|
175
|
-
If you're sure that you want to sync "${flags.app}" to "${this.dir}", run \`ggt sync\` again with the \`--force\` flag:
|
|
176
|
-
|
|
177
|
-
$ ggt sync ${this.argv.join(" ")} --force
|
|
178
|
-
`);
|
|
166
|
+
throw new errors_1.InvalidSyncAppFlagError(this, flags.app);
|
|
179
167
|
}
|
|
180
168
|
await context_1.context.setApp(this.metadata.app);
|
|
181
169
|
this.client = new client_1.Client();
|
|
@@ -215,7 +203,7 @@ class Sync extends base_command_1.BaseCommand {
|
|
|
215
203
|
this.logPaths(Array.from(changedFiles.keys()), { limit: changedFiles.size });
|
|
216
204
|
this.log();
|
|
217
205
|
}
|
|
218
|
-
this.debug("init %
|
|
206
|
+
this.debug("init %O", { metadata: this.metadata, remoteFilesVersion, hasRemoteChanges, hasLocalChanges });
|
|
219
207
|
let action;
|
|
220
208
|
if (hasLocalChanges) {
|
|
221
209
|
({ action } = await (0, inquirer_1.prompt)({
|
|
@@ -306,12 +294,17 @@ class Sync extends base_command_1.BaseCommand {
|
|
|
306
294
|
}, {
|
|
307
295
|
error: (error) => void this.stop(error),
|
|
308
296
|
next: ({ remoteFileSyncEvents: { remoteFilesVersion, changed, deleted } }) => {
|
|
309
|
-
const remoteFiles = new Map([...deleted, ...changed]
|
|
297
|
+
const remoteFiles = new Map([...deleted, ...changed]
|
|
298
|
+
.filter((event) => event.path.startsWith(".gadget/") || !this.ignorer.ignores(event.path))
|
|
299
|
+
.map((e) => [e.path, e]));
|
|
310
300
|
void this.queue
|
|
311
301
|
.add(async () => {
|
|
312
302
|
if (!remoteFiles.size) {
|
|
313
|
-
|
|
314
|
-
|
|
303
|
+
if (BigInt(remoteFilesVersion) > BigInt(this.metadata.filesVersion)) {
|
|
304
|
+
// we still need to update filesVersion, otherwise our expectedFilesVersion will be behind the next time we publish
|
|
305
|
+
this.debug("updated local files version from %s to %s", this.metadata.filesVersion, remoteFilesVersion);
|
|
306
|
+
this.metadata.filesVersion = remoteFilesVersion;
|
|
307
|
+
}
|
|
315
308
|
return;
|
|
316
309
|
}
|
|
317
310
|
this.log("Received");
|
|
@@ -338,6 +331,7 @@ class Sync extends base_command_1.BaseCommand {
|
|
|
338
331
|
this.ignorer.reload();
|
|
339
332
|
}
|
|
340
333
|
}, { stopOnError: false });
|
|
334
|
+
this.debug("updated local files version from %s to %s", this.metadata.filesVersion, remoteFilesVersion);
|
|
341
335
|
this.metadata.filesVersion = remoteFilesVersion;
|
|
342
336
|
})
|
|
343
337
|
.catch(this.stop);
|
|
@@ -381,6 +375,7 @@ class Sync extends base_command_1.BaseCommand {
|
|
|
381
375
|
const { remoteFilesVersion } = data.publishFileSyncEvents;
|
|
382
376
|
this.debug("remote files version after publishing %s", remoteFilesVersion);
|
|
383
377
|
if (BigInt(remoteFilesVersion) > BigInt(this.metadata.filesVersion)) {
|
|
378
|
+
this.debug("updated local files version from %s to %s", this.metadata.filesVersion, remoteFilesVersion);
|
|
384
379
|
this.metadata.filesVersion = remoteFilesVersion;
|
|
385
380
|
}
|
|
386
381
|
}
|
|
@@ -475,7 +470,7 @@ Object.defineProperty(Sync, "description", {
|
|
|
475
470
|
* Storing your source code in a Git repository like GitHub (https://github.com/)
|
|
476
471
|
|
|
477
472
|
Sync includes the concept of a \`.ignore\` file. This file can contain a list of files and
|
|
478
|
-
directories that won't be sent to Gadget when syncing.
|
|
473
|
+
directories that won't be received or sent to Gadget when syncing.
|
|
479
474
|
|
|
480
475
|
The following files and directories are always ignored:
|
|
481
476
|
* .gadget
|