@forge/cli 0.0.0-experimental-383053a → 0.0.0-experimental-3b4aabe
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/CHANGELOG.md +3872 -7
- package/README.md +18 -19
- package/npm-shrinkwrap.json +3100 -3556
- package/out/analytics-client/analytics-client.d.ts +3 -1
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +5 -1
- package/out/autocomplete/autocomplete-config.json +232 -212
- package/out/autocomplete/index.d.ts.map +1 -1
- package/out/autocomplete/index.js +12 -8
- package/out/autocomplete/isSupportedShell.d.ts +2 -0
- package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
- package/out/autocomplete/isSupportedShell.js +11 -0
- package/out/autocomplete/types.d.ts +5 -1
- package/out/autocomplete/types.d.ts.map +1 -1
- package/out/autocomplete/util.d.ts +1 -1
- package/out/autocomplete/util.d.ts.map +1 -1
- package/out/autocomplete/util.js +3 -3
- package/out/bin/cli.js +0 -2
- package/out/bin/postinstall.js +10 -1
- package/out/command-line/anon-user-id.js +6 -10
- package/out/command-line/command.d.ts +28 -8
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +190 -49
- package/out/command-line/controller/assertUnreachable.d.ts +2 -0
- package/out/command-line/controller/assertUnreachable.d.ts.map +1 -0
- package/out/command-line/controller/assertUnreachable.js +7 -0
- package/out/command-line/controller/autocomplete-controller.d.ts +2 -1
- package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -1
- package/out/command-line/controller/autocomplete-controller.js +29 -3
- package/out/command-line/controller/deploy-controller.d.ts +13 -2
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +79 -5
- package/out/command-line/controller/getNodeVersion.d.ts +2 -0
- package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
- package/out/command-line/controller/getNodeVersion.js +7 -0
- package/out/command-line/controller/install-controller.d.ts +5 -4
- package/out/command-line/controller/install-controller.d.ts.map +1 -1
- package/out/command-line/controller/install-controller.js +31 -56
- package/out/command-line/controller/lint-controller.js +1 -1
- package/out/command-line/controller/pre-command-controller.d.ts +8 -1
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -1
- package/out/command-line/controller/pre-command-controller.js +22 -2
- package/out/command-line/controller/prerequisites-controller.d.ts +11 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +34 -0
- package/out/command-line/controller/settings-controller.d.ts +19 -0
- package/out/command-line/controller/settings-controller.d.ts.map +1 -0
- package/out/command-line/controller/settings-controller.js +48 -0
- package/out/command-line/controller/stubController.d.ts +9 -0
- package/out/command-line/controller/stubController.d.ts.map +1 -0
- package/out/command-line/controller/stubController.js +15 -0
- package/out/command-line/dependency-injection.d.ts +13 -3
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +53 -22
- package/out/command-line/index.d.ts +2 -38
- package/out/command-line/index.d.ts.map +1 -1
- package/out/command-line/index.js +22 -43
- package/out/command-line/register-app-commands.d.ts.map +1 -1
- package/out/command-line/register-app-commands.js +2 -12
- package/out/command-line/register-authentication-command.d.ts.map +1 -1
- package/out/command-line/register-authentication-command.js +1 -16
- package/out/command-line/register-autocomplete-commands.d.ts +0 -2
- package/out/command-line/register-autocomplete-commands.d.ts.map +1 -1
- package/out/command-line/register-autocomplete-commands.js +2 -9
- package/out/command-line/register-deployment-commands.d.ts +8 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -1
- package/out/command-line/register-deployment-commands.js +1 -0
- package/out/command-line/register-environment-variables-commands.d.ts +1 -1
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -1
- package/out/command-line/register-environment-variables-commands.js +27 -10
- package/out/command-line/register-installation-commands.d.ts +4 -1
- package/out/command-line/register-installation-commands.d.ts.map +1 -1
- package/out/command-line/register-installation-commands.js +39 -23
- package/out/command-line/register-log-commands.d.ts +1 -0
- package/out/command-line/register-log-commands.d.ts.map +1 -1
- package/out/command-line/register-log-commands.js +26 -3
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +43 -0
- package/out/command-line/register-settings-commands.d.ts +3 -0
- package/out/command-line/register-settings-commands.d.ts.map +1 -0
- package/out/command-line/register-settings-commands.js +37 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -1
- package/out/command-line/register-webtrigger-commands.js +9 -11
- package/out/command-line/unique-machine-id.d.ts +1 -0
- package/out/command-line/unique-machine-id.d.ts.map +1 -1
- package/out/command-line/unique-machine-id.js +3 -12
- package/out/command-line/version-info.d.ts +1 -0
- package/out/command-line/version-info.d.ts.map +1 -1
- package/out/command-line/version-info.js +3 -2
- package/out/command-line/view/analytics-settings-view.d.ts +7 -0
- package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
- package/out/command-line/view/analytics-settings-view.js +18 -0
- package/out/command-line/view/deploy-view.d.ts +7 -1
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +25 -3
- package/out/command-line/view/install-view.d.ts +5 -3
- package/out/command-line/view/install-view.d.ts.map +1 -1
- package/out/command-line/view/install-view.js +19 -10
- package/out/command-line/view/lint-view.d.ts +3 -2
- package/out/command-line/view/lint-view.d.ts.map +1 -1
- package/out/command-line/view/lint-view.js +3 -0
- package/out/command-line/view/lite-lint-view.d.ts +3 -2
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -1
- package/out/command-line/view/lite-lint-view.js +3 -0
- package/out/command-line/view/settings-view.d.ts +8 -0
- package/out/command-line/view/settings-view.d.ts.map +1 -0
- package/out/command-line/view/settings-view.js +21 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -1
- package/out/deploy/deployer/deployer.d.ts.map +1 -1
- package/out/deploy/deployer/deployer.js +17 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +9 -6
- package/out/deploy/packager/archiver.d.ts +3 -2
- package/out/deploy/packager/archiver.d.ts.map +1 -1
- package/out/deploy/packager/archiver.js +10 -2
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +20 -20
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -1
- package/out/deploy/uploader/artifact-graphql-client.js +12 -9
- package/out/environment-variables/graphql-client.d.ts +1 -1
- package/out/environment-variables/graphql-client.d.ts.map +1 -1
- package/out/environment-variables/graphql-client.js +19 -13
- package/out/environment-variables/list-environment-variables.d.ts +2 -2
- package/out/environment-variables/list-environment-variables.d.ts.map +1 -1
- package/out/installations/graphql-client.d.ts +19 -13
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +168 -61
- package/out/installations/install-app-site.d.ts +2 -12
- package/out/installations/install-app-site.d.ts.map +1 -1
- package/out/installations/install-app-site.js +3 -14
- package/out/installations/uninstall-app.d.ts +5 -3
- package/out/installations/uninstall-app.d.ts.map +1 -1
- package/out/installations/uninstall-app.js +7 -7
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +12 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +47 -0
- package/out/service/cached-config-service.d.ts +8 -0
- package/out/service/cached-config-service.d.ts.map +1 -0
- package/out/service/cached-config-service.js +16 -0
- package/out/service/installation-service.d.ts +13 -13
- package/out/service/installation-service.d.ts.map +1 -1
- package/out/service/installation-service.js +38 -23
- package/out/service/lint-service.d.ts +2 -2
- package/out/service/lint-service.d.ts.map +1 -1
- package/out/service/lint-service.js +3 -3
- package/out/service/lite-lint-service.d.ts +3 -3
- package/out/service/lite-lint-service.d.ts.map +1 -1
- package/out/service/lite-lint-service.js +2 -2
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/port-finding-service.d.ts +12 -0
- package/out/service/port-finding-service.d.ts.map +1 -0
- package/out/service/port-finding-service.js +34 -0
- package/out/service/resource-packaging-service.d.ts +4 -4
- package/out/service/resource-packaging-service.d.ts.map +1 -1
- package/out/service/resource-packaging-service.js +9 -22
- package/out/service/tunnel-service.d.ts +6 -2
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +53 -12
- package/out/webtrigger/get-webtrigger-url.d.ts +10 -4
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +11 -18
- package/out/webtrigger/graphql-client.d.ts +14 -0
- package/out/webtrigger/graphql-client.d.ts.map +1 -0
- package/out/webtrigger/graphql-client.js +52 -0
- package/out/workers/analytics-message-worker.d.ts +3 -1
- package/out/workers/analytics-message-worker.d.ts.map +1 -1
- package/out/workers/analytics-message-worker.js +9 -2
- package/out/workers/forge-cli-workers.js +6 -1
- package/package.json +19 -18
- package/out/bin/preinstall.d.ts +0 -3
- package/out/bin/preinstall.d.ts.map +0 -1
- package/out/bin/preinstall.js +0 -9
- package/out/command-line/cli-prerequisites.d.ts +0 -3
- package/out/command-line/cli-prerequisites.d.ts.map +0 -1
- package/out/command-line/cli-prerequisites.js +0 -37
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PersonalApiCredentialsValidated, Logger } from '@forge/cli-shared';
|
|
2
2
|
import { Storage } from '../storage/local-file-storage';
|
|
3
|
+
import { CachedConfigService } from '../service/cached-config-service';
|
|
3
4
|
export declare type AttributeMapper<T> = (val: T) => T | undefined;
|
|
4
5
|
export declare class AnalyticsClientReporter {
|
|
5
6
|
private readonly storage;
|
|
6
7
|
private readonly logger;
|
|
7
|
-
|
|
8
|
+
private readonly configService;
|
|
9
|
+
constructor(storage: Storage, logger: Logger, configService: CachedConfigService);
|
|
8
10
|
private eventSource;
|
|
9
11
|
reportInvoke(cmdName: string, anonymousId: string): void;
|
|
10
12
|
reportSuccess(cmdName: string, cred: PersonalApiCredentialsValidated | string, attributes: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,+BAA+B,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAGxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,oBAAY,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAW3D,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,mBAAmB;IAGrD,OAAO,CAAC,WAAW,CAGjB;IAEK,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAoBxD,aAAa,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,+BAA+B,GAAG,MAAM,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GACjC,IAAI;IAqBA,aAAa,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,+BAA+B,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAClC,CAAC,EAAE,KAAK,GACP,IAAI;IAwBP,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,aAAa;CAOtB"}
|
|
@@ -19,9 +19,10 @@ function appAidOrUndefined(appAri) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
class AnalyticsClientReporter {
|
|
22
|
-
constructor(storage, logger) {
|
|
22
|
+
constructor(storage, logger, configService) {
|
|
23
23
|
this.storage = storage;
|
|
24
24
|
this.logger = logger;
|
|
25
|
+
this.configService = configService;
|
|
25
26
|
this.eventSource = {
|
|
26
27
|
source: 'forge/cli',
|
|
27
28
|
action: 'invoked'
|
|
@@ -63,6 +64,9 @@ class AnalyticsClientReporter {
|
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
processAnalyticsEvent(analyticsEvent) {
|
|
67
|
+
if (this.configService.getAnalyticsPreferences() === false) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
66
70
|
if (process.env.FORGE_DEV_DOCKER_TUNNEL || process.env.FORGE_DEV_TUNNEL) {
|
|
67
71
|
this.logger.trace(`\nAnalytics event: ${JSON.stringify(analyticsEvent, null, 2)}`);
|
|
68
72
|
}
|
|
@@ -1,218 +1,238 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
2
|
+
"commands": {
|
|
3
|
+
"autocomplete": {
|
|
4
|
+
"--verbose": {
|
|
5
|
+
"requireUserArg": false
|
|
6
|
+
},
|
|
7
|
+
"--help": {
|
|
8
|
+
"requireUserArg": false
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"create": {
|
|
12
|
+
"--verbose": {
|
|
13
|
+
"requireUserArg": false
|
|
14
|
+
},
|
|
15
|
+
"--template": {
|
|
16
|
+
"requireUserArg": true
|
|
17
|
+
},
|
|
18
|
+
"--directory": {
|
|
19
|
+
"requireUserArg": true
|
|
20
|
+
},
|
|
21
|
+
"--help": {
|
|
22
|
+
"requireUserArg": false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"deploy": {
|
|
26
|
+
"--verbose": {
|
|
27
|
+
"requireUserArg": false
|
|
28
|
+
},
|
|
29
|
+
"--no-verify": {
|
|
30
|
+
"requireUserArg": false
|
|
31
|
+
},
|
|
32
|
+
"--environment": {
|
|
33
|
+
"requireUserArg": true
|
|
34
|
+
},
|
|
35
|
+
"--help": {
|
|
36
|
+
"requireUserArg": false
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"feedback": {
|
|
40
|
+
"--verbose": {
|
|
41
|
+
"requireUserArg": false
|
|
42
|
+
},
|
|
43
|
+
"--help": {
|
|
44
|
+
"requireUserArg": false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"install": {
|
|
48
|
+
"--verbose": {
|
|
49
|
+
"requireUserArg": false
|
|
50
|
+
},
|
|
51
|
+
"--environment": {
|
|
52
|
+
"requireUserArg": true
|
|
53
|
+
},
|
|
54
|
+
"--site": {
|
|
55
|
+
"requireUserArg": true
|
|
56
|
+
},
|
|
57
|
+
"--product": {
|
|
58
|
+
"requireUserArg": true
|
|
59
|
+
},
|
|
60
|
+
"--upgrade": {
|
|
61
|
+
"requireUserArg": false
|
|
62
|
+
},
|
|
63
|
+
"--confirm-scopes": {
|
|
64
|
+
"requireUserArg": false
|
|
65
|
+
},
|
|
66
|
+
"--help": {
|
|
67
|
+
"requireUserArg": false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"install:list": {
|
|
71
|
+
"--verbose": {
|
|
72
|
+
"requireUserArg": false
|
|
73
|
+
},
|
|
74
|
+
"--help": {
|
|
75
|
+
"requireUserArg": false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"lint": {
|
|
79
|
+
"--verbose": {
|
|
80
|
+
"requireUserArg": false
|
|
81
|
+
},
|
|
82
|
+
"--fix": {
|
|
83
|
+
"requireUserArg": false
|
|
84
|
+
},
|
|
85
|
+
"--environment": {
|
|
86
|
+
"requireUserArg": true
|
|
87
|
+
},
|
|
88
|
+
"--help": {
|
|
89
|
+
"requireUserArg": false
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"login": {
|
|
93
|
+
"--verbose": {
|
|
94
|
+
"requireUserArg": false
|
|
95
|
+
},
|
|
96
|
+
"--email": {
|
|
97
|
+
"requireUserArg": true
|
|
98
|
+
},
|
|
99
|
+
"--token": {
|
|
100
|
+
"requireUserArg": true
|
|
101
|
+
},
|
|
102
|
+
"--help": {
|
|
103
|
+
"requireUserArg": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"logout": {
|
|
107
|
+
"--verbose": {
|
|
108
|
+
"requireUserArg": false
|
|
109
|
+
},
|
|
110
|
+
"--help": {
|
|
111
|
+
"requireUserArg": false
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"logs": {
|
|
115
|
+
"--verbose": {
|
|
116
|
+
"requireUserArg": false
|
|
117
|
+
},
|
|
118
|
+
"--environment": {
|
|
119
|
+
"requireUserArg": true
|
|
120
|
+
},
|
|
121
|
+
"--invocation": {
|
|
122
|
+
"requireUserArg": true
|
|
123
|
+
},
|
|
124
|
+
"--limit": {
|
|
125
|
+
"requireUserArg": true
|
|
126
|
+
},
|
|
127
|
+
"--since": {
|
|
128
|
+
"requireUserArg": true
|
|
129
|
+
},
|
|
130
|
+
"--grouped": {
|
|
131
|
+
"requireUserArg": false
|
|
132
|
+
},
|
|
133
|
+
"--help": {
|
|
134
|
+
"requireUserArg": false
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"providers": {
|
|
138
|
+
"--verbose": {
|
|
139
|
+
"requireUserArg": false
|
|
140
|
+
},
|
|
141
|
+
"--help": {
|
|
142
|
+
"requireUserArg": false
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"register": {
|
|
146
|
+
"--verbose": {
|
|
147
|
+
"requireUserArg": false
|
|
148
|
+
},
|
|
149
|
+
"--help": {
|
|
150
|
+
"requireUserArg": false
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"settings": {
|
|
154
|
+
"--verbose": {
|
|
155
|
+
"requireUserArg": false
|
|
156
|
+
},
|
|
157
|
+
"--help": {
|
|
158
|
+
"requireUserArg": false
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"tunnel": {
|
|
162
|
+
"--verbose": {
|
|
163
|
+
"requireUserArg": false
|
|
164
|
+
},
|
|
165
|
+
"--debug": {
|
|
166
|
+
"requireUserArg": false
|
|
167
|
+
},
|
|
168
|
+
"--help": {
|
|
169
|
+
"requireUserArg": false
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"uninstall": {
|
|
173
|
+
"--verbose": {
|
|
174
|
+
"requireUserArg": false
|
|
175
|
+
},
|
|
176
|
+
"--help": {
|
|
177
|
+
"requireUserArg": false
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"variables": {
|
|
181
|
+
"--verbose": {
|
|
182
|
+
"requireUserArg": false
|
|
183
|
+
},
|
|
184
|
+
"--help": {
|
|
185
|
+
"requireUserArg": false
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"variables:list": {
|
|
189
|
+
"--verbose": {
|
|
190
|
+
"requireUserArg": false
|
|
191
|
+
},
|
|
192
|
+
"--help": {
|
|
193
|
+
"requireUserArg": false
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"variables:set": {
|
|
197
|
+
"--verbose": {
|
|
198
|
+
"requireUserArg": false
|
|
199
|
+
},
|
|
200
|
+
"--help": {
|
|
201
|
+
"requireUserArg": false
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"variables:unset": {
|
|
205
|
+
"--verbose": {
|
|
206
|
+
"requireUserArg": false
|
|
207
|
+
},
|
|
208
|
+
"--help": {
|
|
209
|
+
"requireUserArg": false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"webtrigger": {
|
|
213
|
+
"--verbose": {
|
|
214
|
+
"requireUserArg": false
|
|
215
|
+
},
|
|
216
|
+
"--functionKey": {
|
|
217
|
+
"requireUserArg": true
|
|
218
|
+
},
|
|
219
|
+
"--help": {
|
|
220
|
+
"requireUserArg": false
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"whoami": {
|
|
224
|
+
"--verbose": {
|
|
225
|
+
"requireUserArg": false
|
|
226
|
+
},
|
|
227
|
+
"--help": {
|
|
228
|
+
"requireUserArg": false
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"options": {
|
|
233
|
+
"--version": {
|
|
125
234
|
"requireUserArg": false
|
|
126
235
|
},
|
|
127
|
-
"--encrypt": {
|
|
128
|
-
"requireUserArg": false
|
|
129
|
-
},
|
|
130
|
-
"--environment": {
|
|
131
|
-
"requireUserArg": true
|
|
132
|
-
},
|
|
133
|
-
"--help": {
|
|
134
|
-
"requireUserArg": false
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
"variables:unset": {
|
|
138
|
-
"--verbose": {
|
|
139
|
-
"requireUserArg": false
|
|
140
|
-
},
|
|
141
|
-
"--environment": {
|
|
142
|
-
"requireUserArg": true
|
|
143
|
-
},
|
|
144
|
-
"--help": {
|
|
145
|
-
"requireUserArg": false
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"variables:list": {
|
|
149
|
-
"--verbose": {
|
|
150
|
-
"requireUserArg": false
|
|
151
|
-
},
|
|
152
|
-
"--environment": {
|
|
153
|
-
"requireUserArg": true
|
|
154
|
-
},
|
|
155
|
-
"--help": {
|
|
156
|
-
"requireUserArg": false
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"lint": {
|
|
160
|
-
"--verbose": {
|
|
161
|
-
"requireUserArg": false
|
|
162
|
-
},
|
|
163
|
-
"--fix": {
|
|
164
|
-
"requireUserArg": false
|
|
165
|
-
},
|
|
166
|
-
"--environment": {
|
|
167
|
-
"requireUserArg": true
|
|
168
|
-
},
|
|
169
|
-
"--help": {
|
|
170
|
-
"requireUserArg": false
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
"logs": {
|
|
174
|
-
"--verbose": {
|
|
175
|
-
"requireUserArg": false
|
|
176
|
-
},
|
|
177
|
-
"--environment": {
|
|
178
|
-
"requireUserArg": true
|
|
179
|
-
},
|
|
180
|
-
"--invocation": {
|
|
181
|
-
"requireUserArg": true
|
|
182
|
-
},
|
|
183
|
-
"--limit": {
|
|
184
|
-
"requireUserArg": true
|
|
185
|
-
},
|
|
186
|
-
"--grouped": {
|
|
187
|
-
"requireUserArg": false
|
|
188
|
-
},
|
|
189
|
-
"--help": {
|
|
190
|
-
"requireUserArg": false
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
"tunnel": {
|
|
194
|
-
"--verbose": {
|
|
195
|
-
"requireUserArg": false
|
|
196
|
-
},
|
|
197
|
-
"--debug": {
|
|
198
|
-
"requireUserArg": false
|
|
199
|
-
},
|
|
200
|
-
"--help": {
|
|
201
|
-
"requireUserArg": false
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
"webtrigger": {
|
|
205
|
-
"--verbose": {
|
|
206
|
-
"requireUserArg": false
|
|
207
|
-
},
|
|
208
|
-
"--functionKey": {
|
|
209
|
-
"requireUserArg": true
|
|
210
|
-
},
|
|
211
|
-
"--help": {
|
|
212
|
-
"requireUserArg": false
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
"feedback": {
|
|
216
236
|
"--verbose": {
|
|
217
237
|
"requireUserArg": false
|
|
218
238
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,0BAA0B,uBAAwB,kBAAkB,SAC/C,GAAG,mBAAmB,GAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAM7C,eAAO,MAAM,0BAA0B,uBAAwB,kBAAkB,SAC/C,GAAG,mBAAmB,GAAG,SAuC1D,CAAC;AAEF,eAAO,MAAM,YAAY,mBAAsD,CAAC"}
|
|
@@ -9,22 +9,26 @@ const autocompleteConfig = autocomplete_config_json_1.default;
|
|
|
9
9
|
exports.processAutocompleteFactory = (autocompleteConfig) => {
|
|
10
10
|
const processAutocomplete = (_, { line, reply }) => {
|
|
11
11
|
var _a;
|
|
12
|
-
const
|
|
13
|
-
const numArgs =
|
|
12
|
+
const splitLine = line.split(' ');
|
|
13
|
+
const numArgs = splitLine.length;
|
|
14
14
|
if (numArgs === 2) {
|
|
15
|
-
|
|
15
|
+
if (splitLine.slice(-1)[0].startsWith('-')) {
|
|
16
|
+
reply(Object.keys(autocompleteConfig.options));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
reply(Object.keys(autocompleteConfig.commands));
|
|
16
20
|
}
|
|
17
21
|
else {
|
|
18
|
-
const command =
|
|
19
|
-
if (!autocompleteConfig.hasOwnProperty(command)) {
|
|
22
|
+
const command = splitLine[1];
|
|
23
|
+
if (!autocompleteConfig.commands.hasOwnProperty(command)) {
|
|
20
24
|
return;
|
|
21
25
|
}
|
|
22
|
-
const commandOptions = autocompleteConfig[command];
|
|
23
|
-
const lastArg =
|
|
26
|
+
const commandOptions = autocompleteConfig.commands[command];
|
|
27
|
+
const lastArg = splitLine.slice(-2, -1)[0];
|
|
24
28
|
if ((_a = commandOptions[lastArg]) === null || _a === void 0 ? void 0 : _a.requireUserArg) {
|
|
25
29
|
return;
|
|
26
30
|
}
|
|
27
|
-
const userOptionsSelected = util_1.
|
|
31
|
+
const userOptionsSelected = util_1.getUserOptionsSelectedFromSplitLine(splitLine);
|
|
28
32
|
const remainingOptions = util_1.getRemainingOptions(commandOptions, userOptionsSelected);
|
|
29
33
|
reply(Object.keys(remainingOptions));
|
|
30
34
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSupportedShell.d.ts","sourceRoot":"","sources":["../../src/autocomplete/isSupportedShell.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,IAAI,OAAO,CAQ1C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isSupportedShell = void 0;
|
|
4
|
+
function isSupportedShell() {
|
|
5
|
+
const shell = process.env.SHELL;
|
|
6
|
+
if (!shell) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
return /bash/.test(shell) || /zsh/.test(shell) || /fish/.test(shell);
|
|
10
|
+
}
|
|
11
|
+
exports.isSupportedShell = isSupportedShell;
|
|
@@ -4,7 +4,11 @@ export interface Option {
|
|
|
4
4
|
export interface CommandOptions {
|
|
5
5
|
[key: string]: Option;
|
|
6
6
|
}
|
|
7
|
-
export interface
|
|
7
|
+
export interface CommandConfig {
|
|
8
8
|
[key: string]: CommandOptions;
|
|
9
9
|
}
|
|
10
|
+
export interface AutocompleteConfig {
|
|
11
|
+
commands: CommandConfig;
|
|
12
|
+
options: CommandOptions;
|
|
13
|
+
}
|
|
10
14
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/autocomplete/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/autocomplete/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,aAAa,CAAC;IACxB,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommandOptions } from './types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getUserOptionsSelectedFromSplitLine: (splitLine: string[]) => string[];
|
|
3
3
|
export declare const getRemainingOptions: (commandOptions: CommandOptions, userSelectedOptions: string[]) => {
|
|
4
4
|
[x: string]: import("./types").Option;
|
|
5
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/autocomplete/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/autocomplete/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,eAAO,MAAM,mCAAmC,cAAe,MAAM,EAAE,aAEtE,CAAC;AAEF,eAAO,MAAM,mBAAmB,mBAAoB,cAAc,uBAAuB,MAAM,EAAE;;CAQhG,CAAC"}
|
package/out/autocomplete/util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRemainingOptions = exports.
|
|
4
|
-
exports.
|
|
5
|
-
return
|
|
3
|
+
exports.getRemainingOptions = exports.getUserOptionsSelectedFromSplitLine = void 0;
|
|
4
|
+
exports.getUserOptionsSelectedFromSplitLine = (splitLine) => {
|
|
5
|
+
return splitLine.slice(2).filter((o) => o.startsWith('--'));
|
|
6
6
|
};
|
|
7
7
|
exports.getRemainingOptions = (commandOptions, userSelectedOptions) => {
|
|
8
8
|
const commandOptionsClone = Object.assign({}, commandOptions);
|
package/out/bin/cli.js
CHANGED
|
@@ -3,6 +3,4 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
require("../autocomplete");
|
|
5
5
|
const command_line_1 = require("../command-line");
|
|
6
|
-
const cli_prerequisites_1 = require("../command-line/cli-prerequisites");
|
|
7
|
-
cli_prerequisites_1.checkNodeVersion();
|
|
8
6
|
command_line_1.main();
|
package/out/bin/postinstall.js
CHANGED
|
@@ -6,9 +6,18 @@ const local_file_storage_1 = require("../storage/local-file-storage");
|
|
|
6
6
|
const workers_starter_1 = require("../workers/workers-starter");
|
|
7
7
|
const version_info_1 = require("../command-line/version-info");
|
|
8
8
|
const anon_user_id_1 = require("../command-line/anon-user-id");
|
|
9
|
-
const
|
|
9
|
+
const isSupportedShell_1 = require("../autocomplete/isSupportedShell");
|
|
10
|
+
const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
11
|
+
const cached_config_service_1 = require("../service/cached-config-service");
|
|
12
|
+
const ui = new cli_shared_1.CommandLineUI(() => true);
|
|
13
|
+
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
14
|
+
const configService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
15
|
+
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(new local_file_storage_1.LocalFileStorage(), ui, configService);
|
|
10
16
|
const cliDetails = version_info_1.getCLIDetails();
|
|
11
17
|
const attributes = { version: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version };
|
|
12
18
|
const anonId = anon_user_id_1.getAnonId(true);
|
|
13
19
|
analyticsClientReporter.reportSuccess('postinstall', anonId, attributes);
|
|
20
|
+
if (isSupportedShell_1.isSupportedShell()) {
|
|
21
|
+
ui.info(cli_shared_1.Text.autocomplete.postinstall);
|
|
22
|
+
}
|
|
14
23
|
new workers_starter_1.WorkersStarter(undefined);
|
|
@@ -7,15 +7,11 @@ const cli_shared_1 = require("@forge/cli-shared");
|
|
|
7
7
|
const ANON_ID_CACHE_KEY = 'anonId';
|
|
8
8
|
function getAnonId(createNew = false) {
|
|
9
9
|
const cachedConf = cli_shared_1.CachedConf.getCache('@forge/cli');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const generatedAnonId = uuid_1.default();
|
|
18
|
-
cachedConf.set(ANON_ID_CACHE_KEY, generatedAnonId);
|
|
19
|
-
return generatedAnonId;
|
|
10
|
+
return cachedConf.cached(ANON_ID_CACHE_KEY, () => {
|
|
11
|
+
if (!createNew) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return uuid_1.default();
|
|
15
|
+
});
|
|
20
16
|
}
|
|
21
17
|
exports.getAnonId = getAnonId;
|