@gadgetinc/ggt 0.1.6 → 0.1.8

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.
Files changed (51) hide show
  1. package/README.md +6 -6
  2. package/lib/__generated__/graphql.d.ts +45 -45
  3. package/lib/commands/help.js +1 -1
  4. package/lib/commands/help.js.map +1 -1
  5. package/lib/commands/login.d.ts +1 -1
  6. package/lib/commands/login.js +1 -1
  7. package/lib/commands/login.js.map +1 -1
  8. package/lib/commands/logout.d.ts +1 -1
  9. package/lib/commands/logout.js +2 -2
  10. package/lib/commands/logout.js.map +1 -1
  11. package/lib/commands/sync.d.ts +4 -4
  12. package/lib/commands/sync.js +13 -23
  13. package/lib/commands/sync.js.map +1 -1
  14. package/lib/commands/whoami.d.ts +1 -1
  15. package/lib/commands/whoami.js +2 -2
  16. package/lib/commands/whoami.js.map +1 -1
  17. package/lib/{lib → utils}/base-command.d.ts +0 -0
  18. package/lib/{lib → utils}/base-command.js +1 -1
  19. package/lib/utils/base-command.js.map +1 -0
  20. package/lib/{lib → utils}/client.d.ts +1 -1
  21. package/lib/{lib → utils}/client.js +3 -3
  22. package/lib/utils/client.js.map +1 -0
  23. package/lib/{lib → utils}/context.d.ts +0 -0
  24. package/lib/{lib → utils}/context.js +0 -0
  25. package/lib/utils/context.js.map +1 -0
  26. package/lib/{lib → utils}/errors.d.ts +10 -3
  27. package/lib/{lib → utils}/errors.js +61 -122
  28. package/lib/utils/errors.js.map +1 -0
  29. package/lib/{lib → utils}/flags.d.ts +0 -0
  30. package/lib/{lib → utils}/flags.js +0 -0
  31. package/lib/utils/flags.js.map +1 -0
  32. package/lib/{lib → utils}/fs-utils.d.ts +0 -0
  33. package/lib/{lib → utils}/fs-utils.js +1 -1
  34. package/lib/utils/fs-utils.js.map +1 -0
  35. package/lib/{lib → utils}/help.d.ts +0 -0
  36. package/lib/{lib → utils}/help.js +0 -0
  37. package/lib/utils/help.js.map +1 -0
  38. package/lib/{lib → utils}/sleep.d.ts +0 -0
  39. package/lib/{lib → utils}/sleep.js +0 -0
  40. package/lib/utils/sleep.js.map +1 -0
  41. package/npm-shrinkwrap.json +679 -507
  42. package/oclif.manifest.json +1 -1
  43. package/package.json +4 -4
  44. package/lib/lib/base-command.js.map +0 -1
  45. package/lib/lib/client.js.map +0 -1
  46. package/lib/lib/context.js.map +0 -1
  47. package/lib/lib/errors.js.map +0 -1
  48. package/lib/lib/flags.js.map +0 -1
  49. package/lib/lib/fs-utils.js.map +0 -1
  50. package/lib/lib/help.js.map +0 -1
  51. package/lib/lib/sleep.js.map +0 -1
package/README.md CHANGED
@@ -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.6/src/commands/sync.ts)_
122
+ _See code: [src/commands/sync.ts](https://github.com/gadget-inc/ggt/blob/v0.1.8/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.6/src/commands/help.ts)_
136
+ _See code: [src/commands/help.ts](https://github.com/gadget-inc/ggt/blob/v0.1.8/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.6/src/commands/login.ts)_
152
+ _See code: [src/commands/login.ts](https://github.com/gadget-inc/ggt/blob/v0.1.8/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.6/src/commands/logout.ts)_
167
+ _See code: [src/commands/logout.ts](https://github.com/gadget-inc/ggt/blob/v0.1.8/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.6/src/commands/whoami.ts)_
182
+ _See code: [src/commands/whoami.ts](https://github.com/gadget-inc/ggt/blob/v0.1.8/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 declare type Maybe<T> = T | null;
7
- export declare type InputMaybe<T> = Maybe<T>;
8
- export declare type Exact<T extends {
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 declare type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
13
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {
14
14
  [SubKey in K]?: Maybe<T[SubKey]>;
15
15
  };
16
- export declare type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
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 declare type Scalars = {
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 declare type DeleteAppStatusResult = {
32
+ export type DeleteAppStatusResult = {
33
33
  __typename?: 'DeleteAppStatusResult';
34
34
  isNotCreator?: Maybe<Scalars['Boolean']>;
35
35
  success: Scalars['Boolean'];
36
36
  };
37
- export declare type EnvironmentPatchResult = {
37
+ export type EnvironmentPatchResult = {
38
38
  __typename?: 'EnvironmentPatchResult';
39
39
  success: Scalars['Boolean'];
40
40
  };
41
- export declare type EnvironmentPublishResult = {
41
+ export type EnvironmentPublishResult = {
42
42
  __typename?: 'EnvironmentPublishResult';
43
43
  success: Scalars['Boolean'];
44
44
  };
45
- export declare type EnvironmentSubscriptionResult = {
45
+ export type EnvironmentSubscriptionResult = {
46
46
  __typename?: 'EnvironmentSubscriptionResult';
47
47
  patches: Array<Scalars['JSON']>;
48
48
  };
49
- export declare type FileSyncChangedEvent = {
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 declare type FileSyncChangedEventInput = {
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 declare type FileSyncDeletedEvent = {
62
+ export type FileSyncDeletedEvent = {
63
63
  __typename?: 'FileSyncDeletedEvent';
64
64
  path: Scalars['String'];
65
65
  };
66
- export declare type FileSyncDeletedEventInput = {
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 declare type GadgetRole = {
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 declare type LogSearchResult = {
80
+ export type LogSearchResult = {
81
81
  __typename?: 'LogSearchResult';
82
82
  data: Scalars['JSON'];
83
83
  status: Scalars['String'];
84
84
  };
85
- export declare type MigrateEnvironmentsResult = {
85
+ export type MigrateEnvironmentsResult = {
86
86
  __typename?: 'MigrateEnvironmentsResult';
87
87
  success: Scalars['Boolean'];
88
88
  };
89
- export declare type Mutation = {
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 declare type MutationPatchEnvironmentTreeArgs = {
100
+ export type MutationPatchEnvironmentTreeArgs = {
101
101
  clientID: Scalars['String'];
102
102
  patches: Array<Scalars['JSON']>;
103
103
  };
104
- export declare type MutationPublishFileSyncEventsArgs = {
104
+ export type MutationPublishFileSyncEventsArgs = {
105
105
  input: PublishFileSyncEventsInput;
106
106
  };
107
- export declare type MutationRefreshScopesArgs = {
107
+ export type MutationRefreshScopesArgs = {
108
108
  appConfigKey: Scalars['String'];
109
109
  connectionKey: Scalars['String'];
110
110
  shopId: Scalars['String'];
111
111
  };
112
- export declare type MutationRegisterWebhooksArgs = {
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 declare type MutationUnregisterWebhooksArgs = {
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 declare type PublishFileSyncEventsInput = {
123
+ export type PublishFileSyncEventsInput = {
124
124
  changed: Array<FileSyncChangedEventInput>;
125
125
  deleted: Array<FileSyncDeletedEventInput>;
126
126
  expectedRemoteFilesVersion: Scalars['String'];
127
127
  };
128
- export declare type PublishFileSyncEventsResult = {
128
+ export type PublishFileSyncEventsResult = {
129
129
  __typename?: 'PublishFileSyncEventsResult';
130
130
  remoteFilesVersion: Scalars['String'];
131
131
  };
132
- export declare type Query = {
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 declare type QueryEnvironmentTreePathArgs = {
142
+ export type QueryEnvironmentTreePathArgs = {
143
143
  path: Scalars['String'];
144
144
  };
145
- export declare type QueryLogsSearchArgs = {
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 declare type RefreshScopesResult = {
153
+ export type RefreshScopesResult = {
154
154
  __typename?: 'RefreshScopesResult';
155
155
  success: Scalars['Boolean'];
156
156
  };
157
- export declare type RegisterWebhooksResult = {
157
+ export type RegisterWebhooksResult = {
158
158
  __typename?: 'RegisterWebhooksResult';
159
159
  success: Scalars['Boolean'];
160
160
  };
161
- export declare type RemoteFileSyncEvents = {
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 declare type Subscription = {
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 declare type SubscriptionEnvironmentTreePathPatchesArgs = {
175
+ export type SubscriptionEnvironmentTreePathPatchesArgs = {
176
176
  clientID: Scalars['String'];
177
177
  path: Scalars['String'];
178
178
  };
179
- export declare type SubscriptionLogsSearchArgs = {
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 declare type SubscriptionRemoteFileSyncEventsArgs = {
184
+ export type SubscriptionRemoteFileSyncEventsArgs = {
185
185
  encoding?: InputMaybe<FileSyncEncoding>;
186
186
  localFilesVersion: Scalars['String'];
187
187
  };
188
- export declare type TypeManifestEntry = {
188
+ export type TypeManifestEntry = {
189
189
  __typename?: 'TypeManifestEntry';
190
190
  declaration: Scalars['String'];
191
191
  path: Scalars['String'];
192
192
  };
193
- export declare type TypesManifest = {
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 declare type UnregisterWebhooksResult = {
199
+ export type UnregisterWebhooksResult = {
200
200
  __typename?: 'UnregisterWebhooksResult';
201
201
  success: Scalars['Boolean'];
202
202
  };
203
- export declare type User = {
203
+ export type User = {
204
204
  __typename?: 'User';
205
205
  email: Scalars['String'];
206
206
  name?: Maybe<Scalars['String']>;
207
207
  };
208
- export declare type RemoteFileSyncEventsSubscriptionVariables = Exact<{
208
+ export type RemoteFileSyncEventsSubscriptionVariables = Exact<{
209
209
  localFilesVersion: Scalars['String'];
210
210
  }>;
211
- export declare type RemoteFileSyncEventsSubscription = {
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 declare type RemoteFilesVersionQueryVariables = Exact<{
229
+ export type RemoteFilesVersionQueryVariables = Exact<{
230
230
  [key: string]: never;
231
231
  }>;
232
- export declare type RemoteFilesVersionQuery = {
232
+ export type RemoteFilesVersionQuery = {
233
233
  __typename?: 'Query';
234
234
  remoteFilesVersion: string;
235
235
  };
236
- export declare type PublishFileSyncEventsMutationVariables = Exact<{
236
+ export type PublishFileSyncEventsMutationVariables = Exact<{
237
237
  input: PublishFileSyncEventsInput;
238
238
  }>;
239
- export declare type PublishFileSyncEventsMutation = {
239
+ export type PublishFileSyncEventsMutation = {
240
240
  __typename?: 'Mutation';
241
241
  publishFileSyncEvents: {
242
242
  __typename?: 'PublishFileSyncEventsResult';
@@ -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("../lib/help"));
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
  *
@@ -1 +1 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AACtC,+DAA+B;AAE/B;;;;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 \"../lib/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"]}
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"]}
@@ -1,4 +1,4 @@
1
- import { BaseCommand } from "../lib/base-command";
1
+ import { BaseCommand } from "../utils/base-command";
2
2
  export default class Login extends BaseCommand {
3
3
  static summary: string;
4
4
  static usage: string;
@@ -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("../lib/base-command");
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,sDAAkD;AAElD,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 \"../lib/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"]}
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"]}
@@ -1,4 +1,4 @@
1
- import { BaseCommand } from "../lib/base-command";
1
+ import { BaseCommand } from "../utils/base-command";
2
2
  export default class Logout extends BaseCommand {
3
3
  static summary: string;
4
4
  static usage: string;
@@ -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("../lib/base-command");
6
- const context_1 = require("../lib/context");
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,sDAAkD;AAClD,4CAAyC;AAEzC,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 \"../lib/base-command\";\nimport { context } from \"../lib/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"]}
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"]}
@@ -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 "../lib/base-command";
5
- import type { Query } from "../lib/client";
6
- import { Client } from "../lib/client";
7
- import { Ignorer } from "../lib/fs-utils";
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;
@@ -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("../lib/base-command");
20
- const client_1 = require("../lib/client");
21
- const context_1 = require("../lib/context");
22
- const errors_1 = require("../lib/errors");
23
- const flags_1 = require("../lib/flags");
24
- const fs_utils_1 = require("../lib/fs-utils");
25
- const sleep_1 = require("../lib/sleep");
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.FlagError({ name: "app", char: "a" }, (0, ts_dedent_1.default) `
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 %o", { metadata: this.metadata, remoteFilesVersion, hasRemoteChanges, hasLocalChanges });
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,7 +294,9 @@ 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].map((e) => [e.path, e]));
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) {
@@ -475,7 +465,7 @@ Object.defineProperty(Sync, "description", {
475
465
  * Storing your source code in a Git repository like GitHub (https://github.com/)
476
466
 
477
467
  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.
468
+ directories that won't be received or sent to Gadget when syncing.
479
469
 
480
470
  The following files and directories are always ignored:
481
471
  * .gadget