@forge/cli 0.0.0-experimental-c3effe3 → 0.0.0-experimental-a9f00a0
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 +19 -7
- package/npm-shrinkwrap.json +29 -1372
- package/out/analytics-client/analytics-client.d.ts +0 -24
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +0 -115
- package/out/analytics-client/analytics-message-handler.d.ts +1 -5
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -1
- package/out/analytics-client/analytics-message-handler.js +2 -30
- package/out/bin/postinstall.js +0 -13
- package/out/command-line/command.d.ts +0 -2
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +21 -55
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +0 -1
- package/out/command-line/dependency-injection.d.ts.map +1 -1
- package/out/command-line/dependency-injection.js +4 -6
- package/out/command-line/view/deploy-view.d.ts.map +1 -1
- package/out/command-line/view/deploy-view.js +1 -2
- package/out/deploy/packager/packager.d.ts +1 -3
- package/out/deploy/packager/packager.d.ts.map +1 -1
- package/out/deploy/packager/packager.js +1 -24
- package/out/installations/graphql-client.d.ts +0 -1
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +3 -65
- package/out/service/tunnel-analytics-service.d.ts +0 -5
- package/out/service/tunnel-analytics-service.d.ts.map +1 -1
- package/out/service/tunnel-analytics-service.js +3 -14
- package/out/service/tunnel-service.d.ts +1 -3
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +2 -5
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -1
- package/out/webtrigger/get-webtrigger-url.js +1 -4
- package/out/workers/forge-cli-workers.js +1 -1
- package/package.json +4 -6
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import { PersonalApiCredentialsValidated, Logger } from '@forge/cli-shared';
|
|
2
|
-
import { Storage } from '../storage/local-file-storage';
|
|
3
|
-
import { CachedConfigService } from '../service/cached-config-service';
|
|
4
1
|
export declare type AttributeMapper<T> = (val: T) => T | undefined;
|
|
5
2
|
export declare class AnalyticsClientReporter {
|
|
6
|
-
private readonly storage;
|
|
7
|
-
private readonly logger;
|
|
8
|
-
private readonly configService;
|
|
9
|
-
constructor(storage: Storage, logger: Logger, configService: CachedConfigService);
|
|
10
|
-
private eventSource;
|
|
11
|
-
reportInvoke(cmdName: string, anonymousId: string): void;
|
|
12
|
-
reportSuccess(cmdName: string, cred: PersonalApiCredentialsValidated | string, attributes: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}): void;
|
|
15
|
-
reportFailure(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}, e: Error): void;
|
|
18
|
-
private processAnalyticsEvent;
|
|
19
|
-
private _getUserId;
|
|
20
|
-
private _getErrorDetails;
|
|
21
|
-
private _asContainer;
|
|
22
|
-
private _nodeVersion;
|
|
23
|
-
private _machineId;
|
|
24
|
-
private _asAttribute;
|
|
25
|
-
private _getAttributes;
|
|
26
|
-
private _getContainer;
|
|
27
3
|
}
|
|
28
4
|
//# sourceMappingURL=analytics-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAAA,oBAAY,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;AAE3D,qBAAa,uBAAuB;CAAG"}
|
|
@@ -1,121 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnalyticsClientReporter = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const analytics_node_client_1 = require("@forge/util/packages/analytics-node-client");
|
|
6
|
-
const os = tslib_1.__importStar(require("os"));
|
|
7
|
-
const cs_ari_1 = require("@forge/util/packages/cs-ari");
|
|
8
|
-
const analytics_message_handler_1 = require("./analytics-message-handler");
|
|
9
|
-
const uuid = require("uuid");
|
|
10
|
-
const cli_shared_1 = require("@forge/cli-shared");
|
|
11
|
-
const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
12
|
-
const Identity = (value) => value;
|
|
13
|
-
function appAidOrUndefined(appAri) {
|
|
14
|
-
try {
|
|
15
|
-
return cs_ari_1.parseAppAri(cs_ari_1.parse(appAri)).appId;
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
4
|
class AnalyticsClientReporter {
|
|
22
|
-
constructor(storage, logger, configService) {
|
|
23
|
-
this.storage = storage;
|
|
24
|
-
this.logger = logger;
|
|
25
|
-
this.configService = configService;
|
|
26
|
-
this.eventSource = {
|
|
27
|
-
source: 'forge/cli',
|
|
28
|
-
action: 'invoked'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
reportInvoke(cmdName, anonymousId) {
|
|
32
|
-
this.processAnalyticsEvent({
|
|
33
|
-
id: uuid(),
|
|
34
|
-
eventType: analytics_message_handler_1.EventType.UI,
|
|
35
|
-
event: {
|
|
36
|
-
anonymousId,
|
|
37
|
-
timestamp: new Date(),
|
|
38
|
-
os: {
|
|
39
|
-
name: os.platform(),
|
|
40
|
-
version: os.release()
|
|
41
|
-
},
|
|
42
|
-
uiEvent: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: this._getAttributes({}) })
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
reportSuccess(cmdName, cred, attributes) {
|
|
47
|
-
this.processAnalyticsEvent({
|
|
48
|
-
id: uuid(),
|
|
49
|
-
eventType: analytics_message_handler_1.EventType.TRACK,
|
|
50
|
-
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
51
|
-
name: os.platform(),
|
|
52
|
-
version: os.release()
|
|
53
|
-
} }, this._getUserId(cred)), { trackEvent: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: this._getAttributes(attributes), containers: this._getContainer(attributes) }) })
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
reportFailure(cmdName, cred, attributes, e) {
|
|
57
|
-
this.processAnalyticsEvent({
|
|
58
|
-
id: uuid(),
|
|
59
|
-
eventType: analytics_message_handler_1.EventType.OPERATIONAL,
|
|
60
|
-
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
61
|
-
name: os.platform(),
|
|
62
|
-
version: os.release()
|
|
63
|
-
} }, this._getUserId(cred)), { operationalEvent: Object.assign(Object.assign({}, this.eventSource), { actionSubject: cmdName, attributes: Object.assign(Object.assign({}, this._getAttributes(attributes)), this._getErrorDetails(e)), containers: this._getContainer(attributes) }) })
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
processAnalyticsEvent(analyticsEvent) {
|
|
67
|
-
if (this.configService.getAnalyticsPreferences() === false) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (process.env.FORGE_DEV_DOCKER_TUNNEL || process.env.FORGE_DEV_TUNNEL) {
|
|
71
|
-
this.logger.trace(`\nAnalytics event: ${JSON.stringify(analyticsEvent, null, 2)}`);
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
this.storage.addAnalyticsEvent(analyticsEvent);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
_getUserId(cred) {
|
|
78
|
-
return typeof cred === 'string'
|
|
79
|
-
? {
|
|
80
|
-
anonymousId: cred
|
|
81
|
-
}
|
|
82
|
-
: {
|
|
83
|
-
userIdType: analytics_node_client_1.userTypes.ATLASSIAN_ACCOUNT,
|
|
84
|
-
userId: cred.accountId
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
_getErrorDetails(e) {
|
|
88
|
-
if (e instanceof cli_shared_1.GraphQlMutationError) {
|
|
89
|
-
return { error: e.getCode() };
|
|
90
|
-
}
|
|
91
|
-
return { error: e.constructor.name };
|
|
92
|
-
}
|
|
93
|
-
_asContainer(attrValue, containerType, type, mapper = Identity) {
|
|
94
|
-
const mappedValue = mapper(attrValue);
|
|
95
|
-
return mappedValue
|
|
96
|
-
? {
|
|
97
|
-
[containerType]: {
|
|
98
|
-
id: mappedValue,
|
|
99
|
-
type
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
: undefined;
|
|
103
|
-
}
|
|
104
|
-
_nodeVersion() {
|
|
105
|
-
return { node: process.version };
|
|
106
|
-
}
|
|
107
|
-
_machineId() {
|
|
108
|
-
return { machineId: unique_machine_id_1.getMachineId() };
|
|
109
|
-
}
|
|
110
|
-
_asAttribute(attrValue, name, mapper = Identity) {
|
|
111
|
-
const mappedValue = mapper(attrValue);
|
|
112
|
-
return mappedValue ? { [name]: mappedValue } : {};
|
|
113
|
-
}
|
|
114
|
-
_getAttributes(attributes) {
|
|
115
|
-
return Object.assign(Object.assign(Object.assign(Object.assign({}, attributes), this._asAttribute(attributes.appId, 'appId', appAidOrUndefined)), this._nodeVersion()), this._machineId());
|
|
116
|
-
}
|
|
117
|
-
_getContainer(attributes) {
|
|
118
|
-
return Object.assign(Object.assign(Object.assign({}, this._asContainer(attributes.appId, 'app', 'appId', appAidOrUndefined)), this._asContainer(attributes.appEnv, 'appEnv', 'environment')), this._asContainer(attributes.product, 'product', 'product'));
|
|
119
|
-
}
|
|
120
5
|
}
|
|
121
6
|
exports.AnalyticsClientReporter = AnalyticsClientReporter;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { OperationalEvent, TrackEvent, UIEvent } from '@forge/util/packages/analytics-node-client';
|
|
2
1
|
export declare enum EventType {
|
|
3
2
|
TRACK = "track",
|
|
4
3
|
OPERATIONAL = "operational",
|
|
@@ -7,15 +6,12 @@ export declare enum EventType {
|
|
|
7
6
|
export interface AnalyticsMessage {
|
|
8
7
|
id: string;
|
|
9
8
|
eventType: EventType;
|
|
10
|
-
event:
|
|
9
|
+
event: unknown;
|
|
11
10
|
}
|
|
12
11
|
export interface MessageHandler<T> {
|
|
13
12
|
handleMessage(message: T): Promise<void>;
|
|
14
13
|
}
|
|
15
14
|
export declare class AnalyticsMessageHandler implements MessageHandler<AnalyticsMessage> {
|
|
16
|
-
private readonly environment?;
|
|
17
|
-
constructor(environment?: string | undefined);
|
|
18
|
-
private readonly aClient;
|
|
19
15
|
handleMessage: (message: AnalyticsMessage | undefined) => Promise<void>;
|
|
20
16
|
}
|
|
21
17
|
//# sourceMappingURL=analytics-message-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"analytics-message-handler.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-message-handler.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,WAAW,gBAAgB;IAC3B,EAAE,OAAO;CACV;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,aAAa,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,qBAAa,uBAAwB,YAAW,cAAc,CAAC,gBAAgB,CAAC;IAMvE,aAAa,YAAmB,gBAAgB,GAAG,SAAS,KAAG,OAAO,CAAC,IAAI,CAAC,CAAW;CAC/F"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnalyticsMessageHandler = exports.EventType = void 0;
|
|
4
|
-
const analytics_node_client_1 = require("@forge/util/packages/analytics-node-client");
|
|
5
4
|
var EventType;
|
|
6
5
|
(function (EventType) {
|
|
7
6
|
EventType["TRACK"] = "track";
|
|
@@ -9,35 +8,8 @@ var EventType;
|
|
|
9
8
|
EventType["UI"] = "ui";
|
|
10
9
|
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
11
10
|
class AnalyticsMessageHandler {
|
|
12
|
-
constructor(
|
|
13
|
-
this.
|
|
14
|
-
this.aClient = analytics_node_client_1.analyticsClient({
|
|
15
|
-
env: this.environment || 'prod',
|
|
16
|
-
product: 'forge',
|
|
17
|
-
subproduct: 'cli',
|
|
18
|
-
flushAt: 1,
|
|
19
|
-
flushInterval: 1
|
|
20
|
-
});
|
|
21
|
-
this.handleMessage = async (message) => {
|
|
22
|
-
if (!message) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
switch (message.eventType) {
|
|
27
|
-
case EventType.TRACK:
|
|
28
|
-
await this.aClient.sendTrackEvent(message.event);
|
|
29
|
-
break;
|
|
30
|
-
case EventType.OPERATIONAL:
|
|
31
|
-
await this.aClient.sendOperationalEvent(message.event);
|
|
32
|
-
break;
|
|
33
|
-
case EventType.UI:
|
|
34
|
-
await this.aClient.sendUIEvent(message.event);
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
}
|
|
40
|
-
};
|
|
11
|
+
constructor() {
|
|
12
|
+
this.handleMessage = async (message) => void 0;
|
|
41
13
|
}
|
|
42
14
|
}
|
|
43
15
|
exports.AnalyticsMessageHandler = AnalyticsMessageHandler;
|
package/out/bin/postinstall.js
CHANGED
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const analytics_client_1 = require("../analytics-client/analytics-client");
|
|
4
3
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
const local_file_storage_1 = require("../storage/local-file-storage");
|
|
6
4
|
const workers_starter_1 = require("../workers/workers-starter");
|
|
7
|
-
const version_info_1 = require("../command-line/version-info");
|
|
8
|
-
const anon_user_id_1 = require("../command-line/anon-user-id");
|
|
9
5
|
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
6
|
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);
|
|
16
|
-
const cliDetails = version_info_1.getCLIDetails();
|
|
17
|
-
const attributes = { version: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version };
|
|
18
|
-
const anonId = anon_user_id_1.getAnonId(true);
|
|
19
|
-
analyticsClientReporter.reportSuccess('postinstall', anonId, attributes);
|
|
20
7
|
if (isSupportedShell_1.isSupportedShell()) {
|
|
21
8
|
ui.info(cli_shared_1.Text.autocomplete.postinstall);
|
|
22
9
|
}
|
|
@@ -35,7 +35,6 @@ export declare class Command {
|
|
|
35
35
|
private static concatenateNames;
|
|
36
36
|
private readonly cmd;
|
|
37
37
|
private newCommand;
|
|
38
|
-
private requiresAuthentication;
|
|
39
38
|
private requiresAnalyticsConsent;
|
|
40
39
|
private requiredOptionFlags;
|
|
41
40
|
private preconditionFn;
|
|
@@ -69,7 +68,6 @@ export declare class Command {
|
|
|
69
68
|
actionProcessor: (cb: (...cbArgs: any[]) => ActionResult, ...args: any[]) => Promise<void>;
|
|
70
69
|
configureOutput(obj: OutputConfiguration): this;
|
|
71
70
|
private checkPreconditions;
|
|
72
|
-
private checkAuthentication;
|
|
73
71
|
private checkVersion;
|
|
74
72
|
private validateContext;
|
|
75
73
|
private findLastValidCommand;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command-line/command.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,cAAc,EAAU,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command-line/command.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,cAAc,EAAU,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AASpE,OAAO,EAAQ,EAAE,EAAmB,MAAM,mBAAmB,CAAC;AAI9D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,aAAK,oBAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACpD,aAAK,YAAY,GAAG,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,+BAA+B,CAAC;IAAC,SAAS,EAAE,GAAG,CAAA;CAAE,GAAG,IAAI,CAAC,CAAC;AAOhG,qBAAa,YAAa,SAAQ,cAAc;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;gBAEzB,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM;IAK/C,cAAc,QAAO,M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E;IAMxB,iBAAiB,IAAI,IAAI;IAazB,oBAAoB,IAAI,IAAI;IAW5B,uBAAuB,IAAI,IAAI;IAI/B,yBAAyB,IAAI,IAAI;IAKxC,OAAO,CAAC,8BAA8B;IAW/B,eAAe,mBAA0B,GAAG,EAAE,4BAA4B,GAAG,EAAE,mBAgDpF;IAEK,eAAe,CAAC,GAAG,EAAE,mBAAmB,GAAG,IAAI;YAKxC,kBAAkB;IAUhC,OAAO,CAAC,YAAY;YAgBN,eAAe;IAmB7B,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,cAAc;IAwCtB,OAAO,CAAC,eAAe;CAyBxB"}
|
|
@@ -6,11 +6,9 @@ const commander_1 = tslib_1.__importStar(require("commander"));
|
|
|
6
6
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
7
7
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
8
8
|
const cli_shared_2 = require("@forge/cli-shared");
|
|
9
|
-
const cli_shared_3 = require("@forge/cli-shared");
|
|
10
9
|
const environment_1 = require("./environment");
|
|
11
|
-
const
|
|
10
|
+
const cli_shared_3 = require("@forge/cli-shared");
|
|
12
11
|
const version_info_1 = require("./version-info");
|
|
13
|
-
const anon_user_id_1 = require("./anon-user-id");
|
|
14
12
|
const errors_1 = require("./errors");
|
|
15
13
|
const command_suggestion_service_1 = tslib_1.__importDefault(require("../service/command-suggestion-service"));
|
|
16
14
|
class WrapperError extends commander_1.CommanderError {
|
|
@@ -32,7 +30,6 @@ class Command {
|
|
|
32
30
|
this.cliDetails = cliDetails;
|
|
33
31
|
this.expectsArguments = expectsArguments;
|
|
34
32
|
this.analyticsName = analyticsName;
|
|
35
|
-
this.requiresAuthentication = true;
|
|
36
33
|
this.requiresAnalyticsConsent = true;
|
|
37
34
|
this.requiredOptionFlags = [];
|
|
38
35
|
this.preconditionFn = [];
|
|
@@ -43,21 +40,20 @@ class Command {
|
|
|
43
40
|
return this;
|
|
44
41
|
};
|
|
45
42
|
this.actionProcessor = async (cb, ...args) => {
|
|
46
|
-
var _a
|
|
43
|
+
var _a;
|
|
47
44
|
if (this.newCommand) {
|
|
48
|
-
this.ui.error(new Error(
|
|
45
|
+
this.ui.error(new Error(cli_shared_2.Text.deprecate(this.newCommand)));
|
|
49
46
|
}
|
|
50
47
|
const cmdName = this.cmd.name();
|
|
51
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
52
48
|
let attributes = {};
|
|
53
49
|
try {
|
|
54
50
|
if (!this.expectsArguments && args.length > 2) {
|
|
55
|
-
throw new
|
|
51
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.extraArguments(cmdName));
|
|
56
52
|
}
|
|
57
53
|
const [options] = args;
|
|
58
54
|
if (options === null || options === void 0 ? void 0 : options.nonInteractive) {
|
|
59
55
|
if (!this.satisfiesNonInteractiveOptions(options)) {
|
|
60
|
-
throw new
|
|
56
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.nonInteractive.error.missingRequiredOption(cmdName, this.requiredOptionFlags));
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
59
|
if (this.requiresAnalyticsConsent) {
|
|
@@ -69,30 +65,20 @@ class Command {
|
|
|
69
65
|
}
|
|
70
66
|
const preconditionCheckAttributes = await this.checkPreconditions(...args);
|
|
71
67
|
attributes = Object.assign(Object.assign({}, attributes), preconditionCheckAttributes);
|
|
72
|
-
const actualCred = await this.checkAuthentication();
|
|
73
|
-
if (actualCred) {
|
|
74
|
-
cred = actualCred;
|
|
75
|
-
}
|
|
76
68
|
const result = await cb(...args);
|
|
77
69
|
if (result) {
|
|
78
70
|
attributes = Object.assign(Object.assign({}, attributes), result.analytics);
|
|
79
|
-
if (result.creds) {
|
|
80
|
-
cred = result.creds;
|
|
81
|
-
}
|
|
82
71
|
}
|
|
83
|
-
this.analyticsClient.reportSuccess((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes);
|
|
84
72
|
}
|
|
85
73
|
catch (e) {
|
|
86
74
|
if (isErrorWithAnalytics(e)) {
|
|
87
75
|
attributes = Object.assign(Object.assign({}, e.getAttributes()), attributes);
|
|
88
76
|
}
|
|
89
77
|
if (e instanceof errors_1.DeferredErrors) {
|
|
90
|
-
e.getErrors().forEach((error) => { var _a; return this.analyticsClient.reportFailure((_a = this.analyticsName) !== null && _a !== void 0 ? _a : cmdName, cred, attributes, error); });
|
|
91
78
|
process.exit(1);
|
|
92
79
|
}
|
|
93
80
|
else {
|
|
94
|
-
|
|
95
|
-
cli_shared_4.exitOnError(this.ui)(e);
|
|
81
|
+
cli_shared_3.exitOnError(this.ui)(e);
|
|
96
82
|
}
|
|
97
83
|
}
|
|
98
84
|
};
|
|
@@ -119,7 +105,7 @@ class Command {
|
|
|
119
105
|
const trimmedName = name.trim();
|
|
120
106
|
const expectsArguments = trimmedName.endsWith(']') || trimmedName.endsWith('>');
|
|
121
107
|
const subCommand = new Command(this.ui, this.analyticsClient, this.preCommandController, this.cliDetails, cmd, expectsArguments, Command.concatenateNames(this.analyticsName, cmd.name()));
|
|
122
|
-
subCommand.option('--verbose',
|
|
108
|
+
subCommand.option('--verbose', cli_shared_2.Text.optionVerbose);
|
|
123
109
|
subCommand.exitOverride((err) => {
|
|
124
110
|
throw new WrapperError(err, subCommand.cmd.name());
|
|
125
111
|
});
|
|
@@ -169,7 +155,7 @@ class Command {
|
|
|
169
155
|
}
|
|
170
156
|
nonInteractiveOption(...args) {
|
|
171
157
|
this.requiredOptionFlags = args;
|
|
172
|
-
this.cmd.option('--non-interactive',
|
|
158
|
+
this.cmd.option('--non-interactive', cli_shared_2.Text.nonInteractive.description);
|
|
173
159
|
return this;
|
|
174
160
|
}
|
|
175
161
|
action(fn) {
|
|
@@ -195,7 +181,7 @@ class Command {
|
|
|
195
181
|
this.unknownCommand(argv);
|
|
196
182
|
return;
|
|
197
183
|
}
|
|
198
|
-
return
|
|
184
|
+
return cli_shared_3.exitOnError(this.ui)(err);
|
|
199
185
|
}
|
|
200
186
|
}
|
|
201
187
|
getDefinedCommands() {
|
|
@@ -211,23 +197,22 @@ class Command {
|
|
|
211
197
|
return this.commands;
|
|
212
198
|
}
|
|
213
199
|
environmentOption() {
|
|
214
|
-
this.option('-e, --environment [environment]',
|
|
200
|
+
this.option('-e, --environment [environment]', cli_shared_2.Text.env.option(cli_shared_1.DEFAULT_ENVIRONMENT_OPTION, cli_shared_1.VALID_ENVIRONMENT_OPTIONS));
|
|
215
201
|
this.precondition(() => {
|
|
216
|
-
this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment ||
|
|
202
|
+
this.cmd.opts().environment = environment_1.checkEnvironmentOption(this.cmd.opts().environment || cli_shared_1.DEFAULT_ENVIRONMENT_OPTION);
|
|
217
203
|
return { appEnv: this.cmd.opts().environment };
|
|
218
204
|
});
|
|
219
205
|
return this;
|
|
220
206
|
}
|
|
221
207
|
siteAndProductOption() {
|
|
222
|
-
this.option('-s, --site [site]',
|
|
223
|
-
this.option('-p, --product [product]',
|
|
208
|
+
this.option('-s, --site [site]', cli_shared_2.Text.optionSite);
|
|
209
|
+
this.option('-p, --product [product]', cli_shared_2.Text.optionProduct(cli_shared_1.SUPPORTED_PRODUCTS));
|
|
224
210
|
this.precondition(() => {
|
|
225
211
|
return this.validateContext();
|
|
226
212
|
});
|
|
227
213
|
return this;
|
|
228
214
|
}
|
|
229
215
|
requireNoAuthentication() {
|
|
230
|
-
this.requiresAuthentication = false;
|
|
231
216
|
return this;
|
|
232
217
|
}
|
|
233
218
|
requireNoAnalyticsConsent() {
|
|
@@ -251,13 +236,6 @@ class Command {
|
|
|
251
236
|
}
|
|
252
237
|
return attributes;
|
|
253
238
|
}
|
|
254
|
-
async checkAuthentication() {
|
|
255
|
-
if (this.requiresAuthentication) {
|
|
256
|
-
const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(this.ui);
|
|
257
|
-
return credentialsGetter.getCredentials();
|
|
258
|
-
}
|
|
259
|
-
return undefined;
|
|
260
|
-
}
|
|
261
239
|
checkVersion() {
|
|
262
240
|
if (!this.cliDetails ||
|
|
263
241
|
!this.cliDetails.latest ||
|
|
@@ -266,7 +244,7 @@ class Command {
|
|
|
266
244
|
return;
|
|
267
245
|
}
|
|
268
246
|
if (semver_1.default.gt(this.cliDetails.latest, this.cliDetails.version)) {
|
|
269
|
-
this.ui.warn(
|
|
247
|
+
this.ui.warn(cli_shared_2.Text.error.outdatedCLIVersion(this.cliDetails.version, this.cliDetails.latest));
|
|
270
248
|
}
|
|
271
249
|
else if (semver_1.default.gt(this.cliDetails.version, this.cliDetails.latest)) {
|
|
272
250
|
version_info_1.clearVersionCache(this.cliDetails.name);
|
|
@@ -274,9 +252,9 @@ class Command {
|
|
|
274
252
|
}
|
|
275
253
|
async validateContext() {
|
|
276
254
|
if (this.cmd.opts().product) {
|
|
277
|
-
const capitalizedProduct =
|
|
278
|
-
if (!
|
|
279
|
-
throw new
|
|
255
|
+
const capitalizedProduct = cli_shared_1.capitalizeProduct(this.cmd.opts().product);
|
|
256
|
+
if (!cli_shared_1.isSuppportedProduct(capitalizedProduct)) {
|
|
257
|
+
throw new cli_shared_2.ValidationError(cli_shared_2.Text.error.invalidProduct);
|
|
280
258
|
}
|
|
281
259
|
this.cmd.opts().product = capitalizedProduct;
|
|
282
260
|
}
|
|
@@ -284,7 +262,7 @@ class Command {
|
|
|
284
262
|
if (this.cmd.opts().site) {
|
|
285
263
|
trySite = this.cmd.opts().site;
|
|
286
264
|
}
|
|
287
|
-
this.cmd.opts().site = trySite ?
|
|
265
|
+
this.cmd.opts().site = trySite ? cli_shared_1.validateSite(trySite) : undefined;
|
|
288
266
|
return { product: this.cmd.opts().product };
|
|
289
267
|
}
|
|
290
268
|
findLastValidCommand(argv) {
|
|
@@ -314,16 +292,16 @@ class Command {
|
|
|
314
292
|
return cmd._hidden !== true;
|
|
315
293
|
})
|
|
316
294
|
.map((cmd) => cmd.name()));
|
|
317
|
-
errorMessage.push(
|
|
295
|
+
errorMessage.push(cli_shared_2.Text.invalidCmd(argv.slice(2, lastCommandIndex + 2).join(' ')));
|
|
318
296
|
if (suggestions.length) {
|
|
319
297
|
errorMessage.push(`Did you mean:`);
|
|
320
298
|
const suggestionsPrefixed = suggestions.map((suggestion) => [...argv.slice(2, lastCommandIndex + 1), suggestion].join(' '));
|
|
321
299
|
errorMessage.push(suggestionsPrefixed.join('\n'));
|
|
322
|
-
errorMessage.push(
|
|
300
|
+
errorMessage.push(cli_shared_2.Text.invalidCmdHelp);
|
|
323
301
|
this.ui.info(errorMessage.join('\n\n'));
|
|
324
302
|
}
|
|
325
303
|
else {
|
|
326
|
-
errorMessage.push(
|
|
304
|
+
errorMessage.push(cli_shared_2.Text.invalidCmdHelp);
|
|
327
305
|
this.ui.error(new Error(errorMessage.join(' ')));
|
|
328
306
|
}
|
|
329
307
|
}
|
|
@@ -348,18 +326,6 @@ class Command {
|
|
|
348
326
|
}
|
|
349
327
|
exports.Command = Command;
|
|
350
328
|
Command.reportHelp = async (cmd, cmdError) => {
|
|
351
|
-
try {
|
|
352
|
-
let cred = anon_user_id_1.getAnonId(true);
|
|
353
|
-
try {
|
|
354
|
-
const credentialsGetter = cli_shared_1.getCredentialsStoreProvider(cmd.ui);
|
|
355
|
-
cred = await credentialsGetter.getCredentials();
|
|
356
|
-
}
|
|
357
|
-
catch (noTokenError) {
|
|
358
|
-
}
|
|
359
|
-
cmd.analyticsClient.reportSuccess('help', cred, { command: cmdError.getCommandName() });
|
|
360
|
-
}
|
|
361
|
-
catch (err) {
|
|
362
|
-
}
|
|
363
329
|
return;
|
|
364
330
|
};
|
|
365
331
|
Command.isError = (cmdError) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/tunnel-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAIb,+BAA+B,EAChC,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,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BAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU;IAG5B,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAWnE,eAAe,CAC1B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,+BAA+B,EACtC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,IAAI,CAAC;CAwBjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAUlB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAML,0BAA0B,EAG3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AAExG,OAAO,EAAE,+BAA+B,EAAE,MAAM,qDAAqD,CAAC;AACtG,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAIlG,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAI3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAQtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAWlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,eAAO,MAAM,eAAe,eAAsB,UAAU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0OvE,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDependencies = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const bundler_1 = require("@forge/bundler");
|
|
6
5
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
6
|
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
8
7
|
const analytics_client_1 = require("../analytics-client/analytics-client");
|
|
@@ -28,7 +27,6 @@ const resources_uploader_service_1 = require("../service/resources-uploader-serv
|
|
|
28
27
|
const tunnel_analytics_service_1 = require("../service/tunnel-analytics-service");
|
|
29
28
|
const tunnel_service_1 = require("../service/tunnel-service");
|
|
30
29
|
const migration_keys_service_1 = require("../service/migration-keys-service");
|
|
31
|
-
const local_file_storage_1 = require("../storage/local-file-storage");
|
|
32
30
|
const get_webtrigger_url_1 = require("../webtrigger/get-webtrigger-url");
|
|
33
31
|
const worker_info_1 = require("../workers/worker-info");
|
|
34
32
|
const workers_starter_1 = require("../workers/workers-starter");
|
|
@@ -57,7 +55,7 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
57
55
|
const ui = new cli_shared_1.CommandLineUI(() => cmd.verbose);
|
|
58
56
|
const cachedConf = cli_shared_1.CachedConf.getCache(unique_machine_id_1.FORGE_CLI_PACKAGE);
|
|
59
57
|
const cachedConfigService = new cached_config_service_1.CachedConfigService(cachedConf);
|
|
60
|
-
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter(
|
|
58
|
+
const analyticsClientReporter = new analytics_client_1.AnalyticsClientReporter();
|
|
61
59
|
const workerInfo = worker_info_1.getWorkerInfo(cliDetails);
|
|
62
60
|
const workersStarter = new workers_starter_1.WorkersStarter(workerInfo);
|
|
63
61
|
const fileReader = new cli_shared_1.FileSystemReader();
|
|
@@ -117,7 +115,7 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
117
115
|
const archiverFactory = () => new deploy_1.ZipArchiver();
|
|
118
116
|
const uploaderArtifactClient = new deploy_1.ArtifactGraphQLClient(graphQLClient);
|
|
119
117
|
const triggerDeployClient = new deploy_1.TriggerDeployGraphQLClient(graphQLClient);
|
|
120
|
-
const appPackager = new deploy_1.AppPackager(archiverFactory, ui
|
|
118
|
+
const appPackager = new deploy_1.AppPackager(archiverFactory, ui);
|
|
121
119
|
const archiveUploader = new deploy_1.AppArchiveUploader(assertiveAppConfigReader, uploaderArtifactClient, fileUploader, ui, new resources_uploader_service_1.ResourcesUploaderService(fileReader));
|
|
122
120
|
const deployer = new deploy_1.ArtifactDeployer(assertiveAppConfigReader, triggerDeployClient, deployMonitorClient, cli_shared_1.pause, ui);
|
|
123
121
|
const packageUploadDeployCommand = new deploy_1.PackageUploadDeployCommand(appPackager, archiveUploader, deployer);
|
|
@@ -139,8 +137,8 @@ exports.getDependencies = async (cliDetails) => {
|
|
|
139
137
|
const configFilePortFindingService = new port_finding_service_1.ConfigFilePortFindingService(configFile);
|
|
140
138
|
const localTunnelService = new tunnel_service_1.LocalTunnelService(configFilePortFindingService);
|
|
141
139
|
const dockerService = new docker_service_1.DockerService();
|
|
142
|
-
const tunnelAnalyticsService = new tunnel_analytics_service_1.TunnelAnalyticsService(
|
|
143
|
-
const dockerTunnelService = new tunnel_service_1.DockerTunnelService(configFilePortFindingService, dockerService
|
|
140
|
+
const tunnelAnalyticsService = new tunnel_analytics_service_1.TunnelAnalyticsService();
|
|
141
|
+
const dockerTunnelService = new tunnel_service_1.DockerTunnelService(configFilePortFindingService, dockerService);
|
|
144
142
|
const tunnelController = new tunnel_controller_1.TunnelController(tunnelAnalyticsService, localTunnelService, dockerTunnelService, tunnelView);
|
|
145
143
|
const stubController = new stubController_1.StubController();
|
|
146
144
|
const prerequisitesController = new prerequisites_controller_1.PrerequisitesController(ui, featureFlagService, cliDetails);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/deploy-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAuC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAE5B,SAAS,IAAI,EAAE;IAIf,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIvC,kBAAkB,IAAI,IAAI;IAI1B,mCAAmC,IAAI,IAAI;IAK3C,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,IAAI;IAKlD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAI3C,qBAAqB,IAAI,IAAI;IAI7B,8BAA8B,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAInG,8BAA8B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAIzD,mCAAmC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAI3E,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,kCAAkC,IAAI,OAAO,CAAC,OAAO,CAAC;IAItD,wBAAwB,CACnC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,MAAM,EACnB,wBAAwB,EAAE,OAAO,EACjC,cAAc,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,gBAAgB,CAAC;CAY7B"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeployView = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const lint_1 = require("@forge/lint");
|
|
6
|
-
const cs_ari_1 = require("@forge/util/packages/cs-ari");
|
|
7
6
|
class DeployView {
|
|
8
7
|
constructor(ui) {
|
|
9
8
|
this.ui = ui;
|
|
@@ -50,7 +49,7 @@ class DeployView {
|
|
|
50
49
|
const result = await this.ui.displayProgress(() => deployCallback(), cli_shared_1.Text.deploy.cmd.start2(environment, cli_shared_1.environmentToOption), cli_shared_1.Text.deploy.cmd.success);
|
|
51
50
|
this.ui.info(cli_shared_1.Text.deploy.cmd.successDetails(environment, cli_shared_1.environmentToOption));
|
|
52
51
|
if (environment === 'production' && showDistributionPageLink) {
|
|
53
|
-
this.ui.info(
|
|
52
|
+
this.ui.info('fff');
|
|
54
53
|
}
|
|
55
54
|
return result;
|
|
56
55
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Logger } from '@forge/cli-shared';
|
|
2
2
|
import { Archiver } from './archiver';
|
|
3
|
-
import { Bundler } from '@forge/bundler';
|
|
4
3
|
export interface PackagerBundlerOutput {
|
|
5
4
|
output: {
|
|
6
5
|
[filename: string]: string;
|
|
@@ -28,8 +27,7 @@ export declare class BundlerError extends Error {
|
|
|
28
27
|
export declare class AppPackager implements Packager {
|
|
29
28
|
private readonly archiverFactory;
|
|
30
29
|
private readonly logger;
|
|
31
|
-
|
|
32
|
-
constructor(archiverFactory: () => Archiver, logger: Logger, bundle: Bundler);
|
|
30
|
+
constructor(archiverFactory: () => Archiver, logger: Logger);
|
|
33
31
|
package(handlers: Array<string>): Promise<PackageResult>;
|
|
34
32
|
}
|
|
35
33
|
//# sourceMappingURL=packager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,SAAS,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,YAAa,SAAQ,KAAK;CAAG;AAE1C,qBAAa,WAAY,YAAW,QAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAAkB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAxD,eAAe,EAAE,MAAM,QAAQ,EAAmB,MAAM,EAAE,MAAM;IAEhF,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;CAgCtE"}
|