@forge/cli 8.0.1 → 8.1.0-next.1
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 +28 -0
- package/npm-shrinkwrap.json +42 -42
- 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,33 @@
|
|
|
1
1
|
# @forge/cli
|
|
2
2
|
|
|
3
|
+
## 8.1.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c43a07c: enable nodejs runtime debugger
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [c43a07c]
|
|
12
|
+
- @forge/cli-shared@3.26.0-next.0
|
|
13
|
+
- @forge/node-runtime@0.11.0-next.1
|
|
14
|
+
- @forge/runtime@5.6.0-next.0
|
|
15
|
+
- @forge/tunnel@4.1.0-next.1
|
|
16
|
+
- @forge/bundler@4.15.9-next.1
|
|
17
|
+
- @forge/lint@4.0.11-next.0
|
|
18
|
+
|
|
19
|
+
## 8.1.0-next.0
|
|
20
|
+
|
|
21
|
+
### Minor Changes
|
|
22
|
+
|
|
23
|
+
- e6ce012: support debug during tunnel for runtime v2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- @forge/bundler@4.15.9-next.0
|
|
28
|
+
- @forge/node-runtime@0.10.1-next.0
|
|
29
|
+
- @forge/tunnel@4.0.9-next.0
|
|
30
|
+
|
|
3
31
|
## 8.0.1
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli",
|
|
3
|
-
"version": "8.0.1",
|
|
3
|
+
"version": "8.1.0-next.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@forge/cli",
|
|
9
|
-
"version": "8.0.1",
|
|
9
|
+
"version": "8.1.0-next.1",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "UNLICENSED",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@forge/bundler": "4.15.
|
|
14
|
-
"@forge/cli-shared": "3.
|
|
13
|
+
"@forge/bundler": "4.15.9-next.1",
|
|
14
|
+
"@forge/cli-shared": "3.26.0-next.0",
|
|
15
15
|
"@forge/egress": "1.2.13",
|
|
16
|
-
"@forge/lint": "4.0.
|
|
16
|
+
"@forge/lint": "4.0.11-next.0",
|
|
17
17
|
"@forge/manifest": "6.3.1",
|
|
18
|
-
"@forge/node-runtime": "0.
|
|
19
|
-
"@forge/runtime": "5.
|
|
20
|
-
"@forge/tunnel": "4.0.
|
|
18
|
+
"@forge/node-runtime": "0.11.0-next.1",
|
|
19
|
+
"@forge/runtime": "5.6.0-next.0",
|
|
20
|
+
"@forge/tunnel": "4.1.0-next.1",
|
|
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.1",
|
|
882
|
+
"resolved": "https://registry.npmjs.org/@forge/bundler/-/bundler-4.15.9-next.1.tgz",
|
|
883
|
+
"integrity": "sha512-43oifjejkTjhdCemWQIF63c/mhIfsFKJvJ1bxVALFWOBWIFLz7vd4qfIfXyItVLa2mSq0DWuTdU4yaU5fK38TA==",
|
|
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.
|
|
895
|
-
"@forge/lint": "4.0.
|
|
896
|
-
"@forge/node-runtime": "0.
|
|
894
|
+
"@forge/cli-shared": "3.26.0-next.0",
|
|
895
|
+
"@forge/lint": "4.0.11-next.0",
|
|
896
|
+
"@forge/node-runtime": "0.11.0-next.1",
|
|
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,9 +950,9 @@
|
|
|
950
950
|
"integrity": "sha512-n4AWXkzMA4Pv4nam+dTu7PHgDQtMwaAF2MalOWF323zGvYKS/gZJY+7efJq0DLP783iTfjvYT879EHhCrfvEXA=="
|
|
951
951
|
},
|
|
952
952
|
"node_modules/@forge/cli-shared": {
|
|
953
|
-
"version": "3.
|
|
954
|
-
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.
|
|
955
|
-
"integrity": "sha512-
|
|
953
|
+
"version": "3.26.0-next.0",
|
|
954
|
+
"resolved": "https://registry.npmjs.org/@forge/cli-shared/-/cli-shared-3.26.0-next.0.tgz",
|
|
955
|
+
"integrity": "sha512-faWu/u5xNz9FsEbvypnwqctfw3JOLXROOgMWaVtDnxKH4DPsBnfWS0or2LRmZdrCmvuZ+VirLZyArHPx8btRXw==",
|
|
956
956
|
"dependencies": {
|
|
957
957
|
"@forge/manifest": "6.3.1",
|
|
958
958
|
"@forge/util": "1.4.2",
|
|
@@ -1005,11 +1005,11 @@
|
|
|
1005
1005
|
}
|
|
1006
1006
|
},
|
|
1007
1007
|
"node_modules/@forge/lint": {
|
|
1008
|
-
"version": "4.0.
|
|
1009
|
-
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-4.0.
|
|
1010
|
-
"integrity": "sha512
|
|
1008
|
+
"version": "4.0.11-next.0",
|
|
1009
|
+
"resolved": "https://registry.npmjs.org/@forge/lint/-/lint-4.0.11-next.0.tgz",
|
|
1010
|
+
"integrity": "sha512-7ay345/qIr/ijM1nH+PZblD/IyMVoVyae985szCwSZMytDtM20GneVWDsqckGsuog9+9YEGxTuJCEEogAwMLpw==",
|
|
1011
1011
|
"dependencies": {
|
|
1012
|
-
"@forge/cli-shared": "3.
|
|
1012
|
+
"@forge/cli-shared": "3.26.0-next.0",
|
|
1013
1013
|
"@forge/egress": "1.2.13",
|
|
1014
1014
|
"@forge/manifest": "6.3.1",
|
|
1015
1015
|
"@typescript-eslint/typescript-estree": "^5.62.0",
|
|
@@ -1037,20 +1037,20 @@
|
|
|
1037
1037
|
}
|
|
1038
1038
|
},
|
|
1039
1039
|
"node_modules/@forge/node-runtime": {
|
|
1040
|
-
"version": "0.
|
|
1041
|
-
"resolved": "https://registry.npmjs.org/@forge/node-runtime/-/node-runtime-0.
|
|
1042
|
-
"integrity": "sha512-
|
|
1040
|
+
"version": "0.11.0-next.1",
|
|
1041
|
+
"resolved": "https://registry.npmjs.org/@forge/node-runtime/-/node-runtime-0.11.0-next.1.tgz",
|
|
1042
|
+
"integrity": "sha512-RR0iIfDpi5CveTIef0hXXKDT8jfdmydp1Ip0GcSVZ6IQqZO8lbrEsI6UFq8Lcu+CCy7yxgoYFn6YR3BwFgWCIw==",
|
|
1043
1043
|
"dependencies": {
|
|
1044
|
-
"@forge/api": "3.
|
|
1045
|
-
"@forge/runtime": "5.
|
|
1044
|
+
"@forge/api": "3.4.0-next.0",
|
|
1045
|
+
"@forge/runtime": "5.6.0-next.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",
|
|
@@ -1066,9 +1066,9 @@
|
|
|
1066
1066
|
"integrity": "sha512-n4AWXkzMA4Pv4nam+dTu7PHgDQtMwaAF2MalOWF323zGvYKS/gZJY+7efJq0DLP783iTfjvYT879EHhCrfvEXA=="
|
|
1067
1067
|
},
|
|
1068
1068
|
"node_modules/@forge/runtime": {
|
|
1069
|
-
"version": "5.
|
|
1070
|
-
"resolved": "https://registry.npmjs.org/@forge/runtime/-/runtime-5.
|
|
1071
|
-
"integrity": "sha512-
|
|
1069
|
+
"version": "5.6.0-next.0",
|
|
1070
|
+
"resolved": "https://registry.npmjs.org/@forge/runtime/-/runtime-5.6.0-next.0.tgz",
|
|
1071
|
+
"integrity": "sha512-cxkby96VZPkMMiaQ7hqOa9ObrXBg9x250kIdku/j2wtCxfKHKfCOEjU86jpfN/N2CbgIB0kbzJ2QM/BpwY1hdg==",
|
|
1072
1072
|
"dependencies": {
|
|
1073
1073
|
"@forge/util": "1.4.2",
|
|
1074
1074
|
"fp-ts": "^2.16.2",
|
|
@@ -1081,14 +1081,14 @@
|
|
|
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.1.0-next.1",
|
|
1085
|
+
"resolved": "https://registry.npmjs.org/@forge/tunnel/-/tunnel-4.1.0-next.1.tgz",
|
|
1086
|
+
"integrity": "sha512-1tRjNwElAsZ8l3c0BRAmGD8j7rsBp4XcpJbZxJ+DRxMnQiy0sJVwwskoQFcTjLJdmd7DQH5AKwoBpeUkVNYu0w==",
|
|
1087
1087
|
"dependencies": {
|
|
1088
|
-
"@forge/bundler": "4.15.
|
|
1089
|
-
"@forge/cli-shared": "3.
|
|
1088
|
+
"@forge/bundler": "4.15.9-next.1",
|
|
1089
|
+
"@forge/cli-shared": "3.26.0-next.0",
|
|
1090
1090
|
"@forge/csp": "3.2.1",
|
|
1091
|
-
"@forge/runtime": "5.
|
|
1091
|
+
"@forge/runtime": "5.6.0-next.0",
|
|
1092
1092
|
"express": "^4.18.3",
|
|
1093
1093
|
"express-intercept": "^1.1.0",
|
|
1094
1094
|
"http-proxy-middleware": "^2.0.6",
|
|
@@ -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,EAAE,MAAM,aAAa,CAAC;AAMpC,OAAO,EAKL,sBAAsB,EACtB,+BAA+B,EAG/B,EAAE,EACF,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"tunnel-service.d.ts","sourceRoot":"","sources":["../../src/service/tunnel-service.ts"],"names":[],"mappings":"AA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D,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,2BAA2B;CASpC;AAED,qBAAa,kBAAmB,SAAQ,wBAAwB;IACjD,GAAG,CACd,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,+BAA+B,EACtC,YAAY,EAAE,OAAO,EACrB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC,IAAI,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC;IA2BhB,OAAO,CAAC,uBAAuB;CAUhC;AAED,qBAAa,mBAAoB,SAAQ,wBAAwB;IAI7D,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBAHjC,4BAA4B,EAAE,4BAA4B,EAC1D,mBAAmB,EAAE,mBAAmB,EACvB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,sBAAsB;IAK9C,GAAG,CACd,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,+BAA+B,EACtC,YAAY,EAAE,OAAO,GACpB,OAAO,CAAC,IAAI,CAAC;IA4DH,eAAe,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,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.1",
|
|
3
|
+
"version": "8.1.0-next.1",
|
|
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.
|
|
21
|
+
"@forge/bundler": "4.15.9-next.1",
|
|
22
|
+
"@forge/cli-shared": "3.26.0-next.0",
|
|
23
23
|
"@forge/egress": "1.2.13",
|
|
24
|
-
"@forge/lint": "4.0.
|
|
24
|
+
"@forge/lint": "4.0.11-next.0",
|
|
25
25
|
"@forge/manifest": "6.3.1",
|
|
26
|
-
"@forge/node-runtime": "0.
|
|
27
|
-
"@forge/runtime": "5.
|
|
28
|
-
"@forge/tunnel": "4.0.
|
|
26
|
+
"@forge/node-runtime": "0.11.0-next.1",
|
|
27
|
+
"@forge/runtime": "5.6.0-next.0",
|
|
28
|
+
"@forge/tunnel": "4.1.0-next.1",
|
|
29
29
|
"@forge/util": "1.4.2",
|
|
30
30
|
"@sentry/node": "7.100.1",
|
|
31
31
|
"ajv": "^8.12.0",
|