@forge/cli 8.0.1-next.2 → 8.1.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/npm-shrinkwrap.json +46 -46
- package/out/autocomplete/autocomplete-config.json +6 -0
- package/out/command-line/controller/tunnel-controller.d.ts +3 -3
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -1
- package/out/command-line/controller/tunnel-controller.js +12 -3
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -1
- package/out/command-line/register-tunnel-commands.js +2 -0
- package/out/service/tunnel-service.d.ts +5 -6
- package/out/service/tunnel-service.d.ts.map +1 -1
- package/out/service/tunnel-service.js +13 -7
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @forge/cli
|
|
2
2
|
|
|
3
|
+
## 8.1.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- e6ce012: support debug during tunnel for runtime v2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @forge/bundler@4.15.9-next.0
|
|
12
|
+
- @forge/node-runtime@0.10.1-next.0
|
|
13
|
+
- @forge/tunnel@4.0.9-next.0
|
|
14
|
+
|
|
15
|
+
## 8.0.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [da345ba]
|
|
20
|
+
- Updated dependencies [8a3a052]
|
|
21
|
+
- Updated dependencies [bd8bc91]
|
|
22
|
+
- Updated dependencies [af75e0f]
|
|
23
|
+
- @forge/node-runtime@0.10.0
|
|
24
|
+
- @forge/cli-shared@3.25.2
|
|
25
|
+
- @forge/manifest@6.3.1
|
|
26
|
+
- @forge/bundler@4.15.8
|
|
27
|
+
- @forge/lint@4.0.10
|
|
28
|
+
- @forge/tunnel@4.0.8
|
|
29
|
+
|
|
3
30
|
## 8.0.1-next.2
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0-next.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@forge/cli",
|
|
9
|
-
"version": "8.0
|
|
9
|
+
"version": "8.1.0-next.0",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@forge/bundler": "4.15.
|
|
14
|
-
"@forge/cli-shared": "3.25.2
|
|
13
|
+
"@forge/bundler": "4.15.9-next.0",
|
|
14
|
+
"@forge/cli-shared": "3.25.2",
|
|
15
15
|
"@forge/egress": "1.2.13",
|
|
16
|
-
"@forge/lint": "4.0.10
|
|
17
|
-
"@forge/manifest": "6.3.1
|
|
18
|
-
"@forge/node-runtime": "0.10.
|
|
16
|
+
"@forge/lint": "4.0.10",
|
|
17
|
+
"@forge/manifest": "6.3.1",
|
|
18
|
+
"@forge/node-runtime": "0.10.1-next.0",
|
|
19
19
|
"@forge/runtime": "5.5.0",
|
|
20
|
-
"@forge/tunnel": "4.0.
|
|
20
|
+
"@forge/tunnel": "4.0.9-next.0",
|
|
21
21
|
"@forge/util": "1.4.2",
|
|
22
22
|
"@sentry/node": "7.100.1",
|
|
23
23
|
"ajv": "^8.12.0",
|
|
@@ -878,9 +878,9 @@
|
|
|
878
878
|
"integrity": "sha512-zG50ZRzbKyWHVb/XjI6iCIyyDNmSHdlclvehMjFZ/A3qpHExjSCjaszeY6gBDJKD2GORKKjQ3LS1UyRpiVVvkA=="
|
|
879
879
|
},
|
|
880
880
|
"node_modules/@forge/bundler": {
|
|
881
|
-
"version": "4.15.
|
|
882
|
-
"resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.15.
|
|
883
|
-
"integrity": "sha512-
|
|
881
|
+
"version": "4.15.9-next.0",
|
|
882
|
+
"resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.15.9-next.0.tgz",
|
|
883
|
+
"integrity": "sha512-yP9g7FeWNm5QFsGvcEu18+BaU0EdWxUHG0/MRiaUE/b7grBITQCM82SzTJi3nE69pWXbekaXE548XXN0rLuPhA==",
|
|
884
884
|
"dependencies": {
|
|
885
885
|
"@babel/core": "^7.24.0",
|
|
886
886
|
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
@@ -889,11 +889,11 @@
|
|
|
889
889
|
"@babel/plugin-transform-optional-chaining": "^7.23.4",
|
|
890
890
|
"@babel/plugin-transform-react-jsx": "^7.23.4",
|
|
891
891
|
"@babel/preset-typescript": "^7.23.3",
|
|
892
|
-
"@forge/api": "3.
|
|
892
|
+
"@forge/api": "3.4.0-next.0",
|
|
893
893
|
"@forge/babel-plugin-transform-ui": "1.1.18",
|
|
894
|
-
"@forge/cli-shared": "3.25.2
|
|
895
|
-
"@forge/lint": "4.0.10
|
|
896
|
-
"@forge/node-runtime": "0.10.
|
|
894
|
+
"@forge/cli-shared": "3.25.2",
|
|
895
|
+
"@forge/lint": "4.0.10",
|
|
896
|
+
"@forge/node-runtime": "0.10.1-next.0",
|
|
897
897
|
"@forge/util": "1.4.2",
|
|
898
898
|
"assert": "^2.1.0",
|
|
899
899
|
"babel-loader": "^8.3.0",
|
|
@@ -932,9 +932,9 @@
|
|
|
932
932
|
}
|
|
933
933
|
},
|
|
934
934
|
"node_modules/@forge/bundler/node_modules/@forge/api": {
|
|
935
|
-
"version": "3.
|
|
936
|
-
"resolved": "https://registry.npmjs.org/@forge/api/-/api-3.
|
|
937
|
-
"integrity": "sha512-
|
|
935
|
+
"version": "3.4.0-next.0",
|
|
936
|
+
"resolved": "https://registry.npmjs.org/@forge/api/-/api-3.4.0-next.0.tgz",
|
|
937
|
+
"integrity": "sha512-GQ0VmedjuXeKGdI3YEZMGtr7aBb8L2ifO/DYTaY8W6b0lWu1Kl2yKaWahYWUjXWoV8Jyzyhcy+dgNLZHKLLhaQ==",
|
|
938
938
|
"dependencies": {
|
|
939
939
|
"@forge/auth": "0.0.5",
|
|
940
940
|
"@forge/egress": "1.2.13",
|
|
@@ -950,11 +950,11 @@
|
|
|
950
950
|
"integrity": "sha512-n4AWXkzMA4Pv4nam+dTu7PHgDQtMwaAF2MalOWF323zGvYKS/gZJY+7efJq0DLP783iTfjvYT879EHhCrfvEXA=="
|
|
951
951
|
},
|
|
952
952
|
"node_modules/@forge/cli-shared": {
|
|
953
|
-
"version": "3.25.2
|
|
954
|
-
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.25.2
|
|
955
|
-
"integrity": "sha512-
|
|
953
|
+
"version": "3.25.2",
|
|
954
|
+
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.25.2.tgz",
|
|
955
|
+
"integrity": "sha512-ZEvoMsqx3vANCIaVldlZ9TS5TZQBnNDpBhnmsVHN2Oi45xP/l/ox4lAE7YZxYiqEy9cQRZSTBTJQE2wFZr2tbw==",
|
|
956
956
|
"dependencies": {
|
|
957
|
-
"@forge/manifest": "6.3.1
|
|
957
|
+
"@forge/manifest": "6.3.1",
|
|
958
958
|
"@forge/util": "1.4.2",
|
|
959
959
|
"@sentry/node": "7.100.1",
|
|
960
960
|
"adm-zip": "^0.5.10",
|
|
@@ -988,9 +988,9 @@
|
|
|
988
988
|
}
|
|
989
989
|
},
|
|
990
990
|
"node_modules/@forge/csp": {
|
|
991
|
-
"version": "3.2.1
|
|
992
|
-
"resolved": "https://registry.npmjs.org/@forge/csp/-/csp-3.2.1
|
|
993
|
-
"integrity": "sha512-
|
|
991
|
+
"version": "3.2.1",
|
|
992
|
+
"resolved": "https://registry.npmjs.org/@forge/csp/-/csp-3.2.1.tgz",
|
|
993
|
+
"integrity": "sha512-eNzJTqyf4KarGC2uFJcof7WNoA80pYvVWBRkDi8ZZcwSy8094sqTpcWGK0cS8fwHT1b2DfwCnofhBNJGsIQi9w==",
|
|
994
994
|
"dependencies": {
|
|
995
995
|
"cheerio": "^0.22.0",
|
|
996
996
|
"content-security-policy-parser": "^0.4.1"
|
|
@@ -1005,13 +1005,13 @@
|
|
|
1005
1005
|
}
|
|
1006
1006
|
},
|
|
1007
1007
|
"node_modules/@forge/lint": {
|
|
1008
|
-
"version": "4.0.10
|
|
1009
|
-
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-4.0.10
|
|
1010
|
-
"integrity": "sha512
|
|
1008
|
+
"version": "4.0.10",
|
|
1009
|
+
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-4.0.10.tgz",
|
|
1010
|
+
"integrity": "sha512-/qNZfEc2VL/jGbKN0/Rw9f01AJqQAhgKTkeeBRrWQMee7oQetphat8nfvM7goXG+ie5qs4mjT5i8S4PXpg8E8Q==",
|
|
1011
1011
|
"dependencies": {
|
|
1012
|
-
"@forge/cli-shared": "3.25.2
|
|
1012
|
+
"@forge/cli-shared": "3.25.2",
|
|
1013
1013
|
"@forge/egress": "1.2.13",
|
|
1014
|
-
"@forge/manifest": "6.3.1
|
|
1014
|
+
"@forge/manifest": "6.3.1",
|
|
1015
1015
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
1016
1016
|
"array.prototype.flatmap": "^1.3.2",
|
|
1017
1017
|
"atlassian-openapi": "^1.0.18",
|
|
@@ -1020,9 +1020,9 @@
|
|
|
1020
1020
|
}
|
|
1021
1021
|
},
|
|
1022
1022
|
"node_modules/@forge/manifest": {
|
|
1023
|
-
"version": "6.3.1
|
|
1024
|
-
"resolved": "https://registry.npmjs.org/@forge/manifest/-/manifest-6.3.1
|
|
1025
|
-
"integrity": "sha512-
|
|
1023
|
+
"version": "6.3.1",
|
|
1024
|
+
"resolved": "https://registry.npmjs.org/@forge/manifest/-/manifest-6.3.1.tgz",
|
|
1025
|
+
"integrity": "sha512-vA1FCkVMjw0Xj1cLwH+ePAwHEl6EBaSqSofrNBBZ4I8rvf2LB89mdPqA1w+z0r29xsAnw7u1o+BjacoMOBOfRg==",
|
|
1026
1026
|
"dependencies": {
|
|
1027
1027
|
"@forge/util": "1.4.2",
|
|
1028
1028
|
"ajv": "^8.12.0",
|
|
@@ -1037,20 +1037,20 @@
|
|
|
1037
1037
|
}
|
|
1038
1038
|
},
|
|
1039
1039
|
"node_modules/@forge/node-runtime": {
|
|
1040
|
-
"version": "0.10.
|
|
1041
|
-
"resolved": "https://registry.npmjs.org/@forge/node-runtime/-/node-runtime-0.10.
|
|
1042
|
-
"integrity": "sha512-
|
|
1040
|
+
"version": "0.10.1-next.0",
|
|
1041
|
+
"resolved": "https://registry.npmjs.org/@forge/node-runtime/-/node-runtime-0.10.1-next.0.tgz",
|
|
1042
|
+
"integrity": "sha512-BPkLmMH3fIKmKxztKp5CQYiQbj8Icxa/n0ARy3PII2TBg3CZz+Yj6FPeufhd8x43k5s/dBwwsgP6rSaQyAbpPQ==",
|
|
1043
1043
|
"dependencies": {
|
|
1044
|
-
"@forge/api": "3.
|
|
1044
|
+
"@forge/api": "3.4.0-next.0",
|
|
1045
1045
|
"@forge/runtime": "5.5.0",
|
|
1046
1046
|
"agentkeepalive": "^4.5.0",
|
|
1047
1047
|
"uuid": "^9.0.1"
|
|
1048
1048
|
}
|
|
1049
1049
|
},
|
|
1050
1050
|
"node_modules/@forge/node-runtime/node_modules/@forge/api": {
|
|
1051
|
-
"version": "3.
|
|
1052
|
-
"resolved": "https://registry.npmjs.org/@forge/api/-/api-3.
|
|
1053
|
-
"integrity": "sha512-
|
|
1051
|
+
"version": "3.4.0-next.0",
|
|
1052
|
+
"resolved": "https://registry.npmjs.org/@forge/api/-/api-3.4.0-next.0.tgz",
|
|
1053
|
+
"integrity": "sha512-GQ0VmedjuXeKGdI3YEZMGtr7aBb8L2ifO/DYTaY8W6b0lWu1Kl2yKaWahYWUjXWoV8Jyzyhcy+dgNLZHKLLhaQ==",
|
|
1054
1054
|
"dependencies": {
|
|
1055
1055
|
"@forge/auth": "0.0.5",
|
|
1056
1056
|
"@forge/egress": "1.2.13",
|
|
@@ -1081,13 +1081,13 @@
|
|
|
1081
1081
|
}
|
|
1082
1082
|
},
|
|
1083
1083
|
"node_modules/@forge/tunnel": {
|
|
1084
|
-
"version": "4.0.
|
|
1085
|
-
"resolved": "https://registry.npmjs.org/@forge/tunnel/-/tunnel-4.0.
|
|
1086
|
-
"integrity": "sha512-
|
|
1084
|
+
"version": "4.0.9-next.0",
|
|
1085
|
+
"resolved": "https://registry.npmjs.org/@forge/tunnel/-/tunnel-4.0.9-next.0.tgz",
|
|
1086
|
+
"integrity": "sha512-hDiTZrYoDCeLLIt04Z8gjphvJSsQMuo81zNxdckvNWB3M9AN79v9H71gfWEGhS/CfFK84bSHURRpr9yWgd4Mug==",
|
|
1087
1087
|
"dependencies": {
|
|
1088
|
-
"@forge/bundler": "4.15.
|
|
1089
|
-
"@forge/cli-shared": "3.25.2
|
|
1090
|
-
"@forge/csp": "3.2.1
|
|
1088
|
+
"@forge/bundler": "4.15.9-next.0",
|
|
1089
|
+
"@forge/cli-shared": "3.25.2",
|
|
1090
|
+
"@forge/csp": "3.2.1",
|
|
1091
1091
|
"@forge/runtime": "5.5.0",
|
|
1092
1092
|
"express": "^4.18.3",
|
|
1093
1093
|
"express-intercept": "^1.1.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CommandLineUI, ConfigFile, PersonalApiCredentialsValidated } from '@forge/cli-shared';
|
|
1
|
+
import { CommandLineUI, ConfigFile, PersonalApiCredentialsValidated, TunnelCommandOptions, TunnelOptions } from '@forge/cli-shared';
|
|
2
2
|
import { TunnelAnalyticsService } from '../../service/tunnel-analytics-service';
|
|
3
|
-
import { DockerTunnelService,
|
|
3
|
+
import { DockerTunnelService, TunnelService } from '../../service/tunnel-service';
|
|
4
4
|
import { TunnelView } from '../view/tunnel-view';
|
|
5
5
|
export declare class TunnelController {
|
|
6
6
|
private readonly analyticsService;
|
|
@@ -10,7 +10,7 @@ export declare class TunnelController {
|
|
|
10
10
|
private readonly tunnelView;
|
|
11
11
|
private readonly configFile;
|
|
12
12
|
constructor(analyticsService: TunnelAnalyticsService, nodeTunnelService: TunnelService, localTunnelService: TunnelService, dockerTunnelService: DockerTunnelService, tunnelView: TunnelView, configFile: ConfigFile);
|
|
13
|
-
run(tunnelOptions:
|
|
13
|
+
run(tunnelOptions: TunnelCommandOptions, ui: CommandLineUI): Promise<void>;
|
|
14
14
|
runDockerTunnel(tunnelOptions: TunnelOptions, creds: PersonalApiCredentialsValidated, debugEnabled: boolean): Promise<void>;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=tunnel-controller.d.ts.map
|
|
@@ -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,EACb,UAAU,EAGV,+BAA+B,
|
|
1
|
+
{"version":3,"file":"tunnel-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/tunnel-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,UAAU,EAGV,+BAA+B,EAC/B,oBAAoB,EAEpB,aAAa,EACd,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAkC,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,UAAU;gBALV,gBAAgB,EAAE,sBAAsB,EACxC,iBAAiB,EAAE,aAAa,EAChC,kBAAkB,EAAE,aAAa,EACjC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU;IAG5B,GAAG,CAAC,aAAa,EAAE,oBAAoB,EAAE,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA2B1E,eAAe,CAC1B,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,+BAA+B,EACtC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TunnelController = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const docker_service_1 = require("../../service/docker-service");
|
|
6
|
+
const tunnel_service_1 = require("../../service/tunnel-service");
|
|
6
7
|
class TunnelController {
|
|
7
8
|
constructor(analyticsService, nodeTunnelService, localTunnelService, dockerTunnelService, tunnelView, configFile) {
|
|
8
9
|
this.analyticsService = analyticsService;
|
|
@@ -13,16 +14,24 @@ class TunnelController {
|
|
|
13
14
|
this.configFile = configFile;
|
|
14
15
|
}
|
|
15
16
|
async run(tunnelOptions, ui) {
|
|
17
|
+
const options = Object.assign(Object.assign({}, tunnelOptions), { debugStartingPort: undefined });
|
|
18
|
+
if (tunnelOptions.debugStartingPort !== undefined) {
|
|
19
|
+
const port = parseInt(tunnelOptions.debugStartingPort);
|
|
20
|
+
if (isNaN(port) || port < 0 || port > 65535) {
|
|
21
|
+
throw new tunnel_service_1.InvalidDebugStartingPortNumber(tunnelOptions.debugStartingPort);
|
|
22
|
+
}
|
|
23
|
+
options.debugStartingPort = port;
|
|
24
|
+
}
|
|
16
25
|
const creds = await (0, cli_shared_1.getCredentialStore)(ui).getCredentials();
|
|
17
26
|
const localTunnelErrorCallback = this.tunnelView.getTunnelErrorHandler(cli_shared_1.exitOnError);
|
|
18
27
|
this.tunnelView.dockerPreamble(tunnelOptions.environment);
|
|
19
28
|
if ((await this.configFile.runtimeType()) === cli_shared_1.RuntimeType.nodejs) {
|
|
20
|
-
return await this.nodeTunnelService.run(
|
|
29
|
+
return await this.nodeTunnelService.run(options, creds, ui.debugEnabled);
|
|
21
30
|
}
|
|
22
31
|
if (process.env.FORGE_DEV_TUNNEL) {
|
|
23
|
-
return await this.localTunnelService.run(
|
|
32
|
+
return await this.localTunnelService.run(options, creds, ui.debugEnabled, localTunnelErrorCallback);
|
|
24
33
|
}
|
|
25
|
-
await this.runDockerTunnel(
|
|
34
|
+
await this.runDockerTunnel(options, creds, ui.debugEnabled);
|
|
26
35
|
}
|
|
27
36
|
async runDockerTunnel(tunnelOptions, creds, debugEnabled) {
|
|
28
37
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"register-tunnel-commands.d.ts","sourceRoot":"","sources":["../../src/command-line/register-tunnel-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,mDAAoD,YAAY,KAAG,IAY/F,CAAC"}
|
|
@@ -9,6 +9,8 @@ const registerCommands = ({ cmd, ui, controllers: { tunnelController } }) => {
|
|
|
9
9
|
.description(cli_shared_1.Text.tunnel.cmd)
|
|
10
10
|
.environmentOption()
|
|
11
11
|
.option('-d, --debug', cli_shared_1.Text.tunnel.optionDebugger)
|
|
12
|
+
.option('-p,--debugStartingPort [debugStartingPort]', cli_shared_1.Text.tunnel.debuggerPort, '9229')
|
|
13
|
+
.option('-f,--debugFunctionHandlers [debugFunctionHandlers...]', cli_shared_1.Text.tunnel.functionHandlers)
|
|
12
14
|
.action(async (options) => {
|
|
13
15
|
await tunnelController.run(options, ui);
|
|
14
16
|
});
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { spawn } from 'cross-spawn';
|
|
2
|
-
import { PersonalApiCredentials, PersonalApiCredentialsValidated, UI, UserError } from '@forge/cli-shared';
|
|
2
|
+
import { PersonalApiCredentials, PersonalApiCredentialsValidated, TunnelOptions, UI, UserError } from '@forge/cli-shared';
|
|
3
3
|
import { StartTunnelCommand, TunnelInteractor } from '@forge/tunnel';
|
|
4
4
|
import { CachedConfigService } from './cached-config-service';
|
|
5
5
|
import { DockerService } from './docker-service';
|
|
6
6
|
import { ConfigFilePortFindingService } from './port-finding-service';
|
|
7
7
|
import { TunnelAnalyticsService } from './tunnel-analytics-service';
|
|
8
|
-
export interface TunnelOptions {
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
environment?: string;
|
|
11
|
-
}
|
|
12
8
|
export declare const CONTAINER_NAME: string;
|
|
13
9
|
export declare const IMAGE_NAME: string;
|
|
14
10
|
export declare type TunnelService = {
|
|
15
11
|
run(tunnelOptions: TunnelOptions, creds: PersonalApiCredentialsValidated, debugEnabled: boolean, onError?: (err: Error) => Promise<void>): Promise<void>;
|
|
16
12
|
};
|
|
17
|
-
export declare class
|
|
13
|
+
export declare class FunctionHandlersMustBeDefinedInDebugMode extends UserError {
|
|
18
14
|
constructor();
|
|
19
15
|
}
|
|
16
|
+
export declare class InvalidDebugStartingPortNumber extends UserError {
|
|
17
|
+
constructor(port: string);
|
|
18
|
+
}
|
|
20
19
|
declare abstract class TunnelServiceBase implements TunnelService {
|
|
21
20
|
protected readonly cachedConfigService: CachedConfigService;
|
|
22
21
|
constructor(cachedConfigService: CachedConfigService);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-service.d.ts","sourceRoot":"","sources":["../../src/service/tunnel-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,E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,KAAK,CAAC,CAAC;YAKnD,qBAAqB;IAMnC,OAAO,CAAC,oBAAoB;IAqB5B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,gBAAgB;IAsBxB,SAAS,CAAC,yBAAyB,IAAI,mBAAmB,EAAE;YAI9C,gBAAgB;CAG/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DockerTunnelService = exports.LocalTunnelService = exports.InProcessTunnelService = exports.
|
|
3
|
+
exports.DockerTunnelService = exports.LocalTunnelService = exports.InProcessTunnelService = exports.InvalidDebugStartingPortNumber = exports.FunctionHandlersMustBeDefinedInDebugMode = exports.IMAGE_NAME = exports.CONTAINER_NAME = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cross_spawn_1 = require("cross-spawn");
|
|
6
6
|
const os_1 = tslib_1.__importDefault(require("os"));
|
|
@@ -28,12 +28,18 @@ else {
|
|
|
28
28
|
exports.IMAGE_NAME = process.env.FORGE_DEV_DOCKER_TUNNEL
|
|
29
29
|
? 'local/forge-tunnel:test'
|
|
30
30
|
: `atlassian/forge-tunnel:${versionTags[0]}`;
|
|
31
|
-
class
|
|
31
|
+
class FunctionHandlersMustBeDefinedInDebugMode extends cli_shared_1.UserError {
|
|
32
32
|
constructor() {
|
|
33
|
-
super(cli_shared_1.Text.tunnel.
|
|
33
|
+
super(cli_shared_1.Text.tunnel.functionHandlersMustBeDefined);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
exports.
|
|
36
|
+
exports.FunctionHandlersMustBeDefinedInDebugMode = FunctionHandlersMustBeDefinedInDebugMode;
|
|
37
|
+
class InvalidDebugStartingPortNumber extends cli_shared_1.UserError {
|
|
38
|
+
constructor(port) {
|
|
39
|
+
super(cli_shared_1.Text.tunnel.invalidDebugStartingPortNumber(port));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.InvalidDebugStartingPortNumber = InvalidDebugStartingPortNumber;
|
|
37
43
|
class TunnelServiceBase {
|
|
38
44
|
constructor(cachedConfigService) {
|
|
39
45
|
this.cachedConfigService = cachedConfigService;
|
|
@@ -57,8 +63,8 @@ class InProcessTunnelService extends TunnelServiceBase {
|
|
|
57
63
|
}
|
|
58
64
|
async run(tunnelOptions, creds, debugEnabled, onError) {
|
|
59
65
|
try {
|
|
60
|
-
if (tunnelOptions.debug
|
|
61
|
-
throw new
|
|
66
|
+
if (tunnelOptions.debug && !tunnelOptions.debugFunctionHandlers) {
|
|
67
|
+
throw new FunctionHandlersMustBeDefinedInDebugMode();
|
|
62
68
|
}
|
|
63
69
|
const resourcePortMap = await this.configFilePortFindingService.findPorts();
|
|
64
70
|
const tunnel = await this.startTunnelCommand.execute({
|
|
@@ -67,7 +73,7 @@ class InProcessTunnelService extends TunnelServiceBase {
|
|
|
67
73
|
host: 'localhost',
|
|
68
74
|
ngrokConfig: this.ngrokConfigPath()
|
|
69
75
|
});
|
|
70
|
-
const monitor = await this.tunnelInteractor.watchApp(tunnel);
|
|
76
|
+
const monitor = await this.tunnelInteractor.watchApp(tunnel, tunnelOptions);
|
|
71
77
|
await this.tunnelInteractor.handleUserExitEvent(tunnel.stopFunction, monitor);
|
|
72
78
|
}
|
|
73
79
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "8.0
|
|
3
|
+
"version": "8.1.0-next.0",
|
|
4
4
|
"description": "A command line interface for managing Atlassian-hosted apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"postinstall": "node -e \"fs.existsSync('./out/bin/postinstall.js') && require('./out/bin/postinstall.js')\""
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/bundler": "4.15.
|
|
22
|
-
"@forge/cli-shared": "3.25.2
|
|
21
|
+
"@forge/bundler": "4.15.9-next.0",
|
|
22
|
+
"@forge/cli-shared": "3.25.2",
|
|
23
23
|
"@forge/egress": "1.2.13",
|
|
24
|
-
"@forge/lint": "4.0.10
|
|
25
|
-
"@forge/manifest": "6.3.1
|
|
26
|
-
"@forge/node-runtime": "0.10.
|
|
24
|
+
"@forge/lint": "4.0.10",
|
|
25
|
+
"@forge/manifest": "6.3.1",
|
|
26
|
+
"@forge/node-runtime": "0.10.1-next.0",
|
|
27
27
|
"@forge/runtime": "5.5.0",
|
|
28
|
-
"@forge/tunnel": "4.0.
|
|
28
|
+
"@forge/tunnel": "4.0.9-next.0",
|
|
29
29
|
"@forge/util": "1.4.2",
|
|
30
30
|
"@sentry/node": "7.100.1",
|
|
31
31
|
"ajv": "^8.12.0",
|