@forge/tunnel 2.0.0-next.3 → 2.0.0-next.4

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 2.0.0-next.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 35172f2: Add ngrok debug logs
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [35172f2]
12
+ - @forge/cli-shared@3.0.0-next.2
13
+ - @forge/bundler@3.0.12-next.2
14
+
3
15
  ## 2.0.0-next.3
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1 @@
1
+ log_level: debug
@@ -1 +1 @@
1
- {"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/create-tunnel-service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAQD,qBAAa,wBAAyB,YAAW,mBAAmB;IAGtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAqB;gBAER,MAAM,EAAE,MAAM;IAE9B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAU3C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB1C"}
1
+ {"version":3,"file":"create-tunnel-service.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/services/create-tunnel-service.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAIjD,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAQD,qBAAa,wBAAyB,YAAW,mBAAmB;IAGtD,OAAO,CAAC,QAAQ,CAAC,MAAM;IAFnC,OAAO,CAAC,QAAQ,CAAqB;gBAER,MAAM,EAAE,MAAM;IAE9B,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAyB3C,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CAkB1C"}
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const ngrok = tslib_1.__importStar(require("ngrok"));
6
6
  const url_1 = require("url");
7
7
  const cli_shared_1 = require("@forge/cli-shared");
8
+ const fs_1 = require("fs");
9
+ const path_1 = tslib_1.__importDefault(require("path"));
8
10
  class NgrokError extends Error {
9
11
  constructor() {
10
12
  super(cli_shared_1.Text.tunnel.error.ngrok);
@@ -15,8 +17,22 @@ class NgrokCreateTunnelService {
15
17
  this.logger = logger;
16
18
  }
17
19
  async establishTunnel(port) {
20
+ const configDir = process.env.CONFIG_DIR
21
+ ? process.env.CONFIG_DIR
22
+ : path_1.default.join(__dirname, '..', '..', '..', 'config');
23
+ const configFile = `${configDir}/ngrok.yml`;
18
24
  try {
19
- this.endpoint = await ngrok.connect(port);
25
+ const options = {
26
+ addr: port,
27
+ configPath: fs_1.existsSync(configFile) ? configFile : '',
28
+ onStatusChange: (status) => {
29
+ this.logger.debug(cli_shared_1.Text.tunnel.tunnelStatusChange(status));
30
+ },
31
+ onLogEvent: (data) => {
32
+ this.logger.debug(`${data}`);
33
+ }
34
+ };
35
+ this.endpoint = await ngrok.connect(options);
20
36
  this.logger.debug(cli_shared_1.Text.tunnel.startedTunnel(this.endpoint));
21
37
  return new url_1.URL(this.endpoint);
22
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.4",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -16,8 +16,8 @@
16
16
  "postbuild": "chmod +x out/*.js"
17
17
  },
18
18
  "dependencies": {
19
- "@forge/bundler": "3.0.12-next.1",
20
- "@forge/cli-shared": "3.0.0-next.1",
19
+ "@forge/bundler": "3.0.12-next.2",
20
+ "@forge/cli-shared": "3.0.0-next.2",
21
21
  "@forge/csp": "^1.11.0",
22
22
  "@forge/isolated-vm": "3.3.10",
23
23
  "@forge/runtime": "2.3.0-next.1",