@forge/tunnel 5.5.7-next.9 → 5.6.0-next.16
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 +56 -0
- package/out/sandbox/node-sandbox.d.ts.map +1 -1
- package/out/sandbox/node-sandbox.js +3 -1
- package/out/servers/dev-server.d.ts +3 -2
- package/out/servers/dev-server.d.ts.map +1 -1
- package/out/servers/dev-server.js +4 -2
- package/out/services/local-invocation-service.d.ts +1 -1
- package/out/services/local-invocation-service.d.ts.map +1 -1
- package/out/services/local-invocation-service.js +8 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @forge/tunnel
|
|
2
2
|
|
|
3
|
+
## 5.6.0-next.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @forge/bundler@4.20.0-next.16
|
|
8
|
+
- @forge/cli-shared@6.3.0-next.15
|
|
9
|
+
|
|
10
|
+
## 5.6.0-next.15
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 0e30430: Evergreen runtime using loader script
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [0e30430]
|
|
19
|
+
- @forge/cli-shared@6.3.0-next.14
|
|
20
|
+
- @forge/bundler@4.20.0-next.15
|
|
21
|
+
|
|
22
|
+
## 5.5.7-next.14
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [ffa1464]
|
|
27
|
+
- @forge/bundler@4.19.7-next.14
|
|
28
|
+
- @forge/cli-shared@6.3.0-next.13
|
|
29
|
+
- @forge/runtime@5.10.3-next.0
|
|
30
|
+
|
|
31
|
+
## 5.5.7-next.13
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- @forge/bundler@4.19.7-next.13
|
|
36
|
+
- @forge/cli-shared@6.3.0-next.12
|
|
37
|
+
|
|
38
|
+
## 5.5.7-next.12
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- @forge/bundler@4.19.7-next.12
|
|
43
|
+
- @forge/cli-shared@6.3.0-next.11
|
|
44
|
+
|
|
45
|
+
## 5.5.7-next.11
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- @forge/bundler@4.19.7-next.11
|
|
50
|
+
|
|
51
|
+
## 5.5.7-next.10
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Updated dependencies [34bd8b6]
|
|
56
|
+
- @forge/cli-shared@6.3.0-next.10
|
|
57
|
+
- @forge/bundler@4.19.7-next.10
|
|
58
|
+
|
|
3
59
|
## 5.5.7-next.9
|
|
4
60
|
|
|
5
61
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/node-sandbox.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,SAAS,EAIV,MAAM,gBAAgB,CAAC;AAIxB,qBAAa,WAAY,YAAW,OAAO;IACzC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkD;gBAEhE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"node-sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/node-sandbox.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,aAAa,EACb,SAAS,EAIV,MAAM,gBAAgB,CAAC;AAIxB,qBAAa,WAAY,YAAW,OAAO;IACzC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkD;gBAEhE,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,aAAa;IA6BnE,OAAO,CAAC,YAAY;IAOd,OAAO,CACX,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,aAAa,EAC/B,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,GAChC,OAAO,CAAC,gBAAgB,CAAC;IAmB5B,IAAI,IAAI,IAAI;CAGb"}
|
|
@@ -19,7 +19,9 @@ class NodeSandbox {
|
|
|
19
19
|
this.process = (0, child_process_1.fork)(RUNNER, [fileName, handler], {
|
|
20
20
|
stdio: ['ignore', 'pipe', 2, 'ipc'],
|
|
21
21
|
env: {
|
|
22
|
-
_HANDLER: this.name
|
|
22
|
+
_HANDLER: this.name,
|
|
23
|
+
FORGE_EFS_RUNTIME_PATH: appPath,
|
|
24
|
+
FORGE_CUSTOM_WRAPPER_FILE_NAME: '__forge_wrapper__.cjs'
|
|
23
25
|
},
|
|
24
26
|
execArgv: debugPort ? [`--inspect=0.0.0.0:${debugPort}`] : undefined
|
|
25
27
|
});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import http from 'http';
|
|
4
4
|
import { URL } from 'url';
|
|
5
5
|
import express from 'express';
|
|
6
|
-
import { ConfigFile, FileSystemReader, Logger, TunnelOptions } from '@forge/cli-shared';
|
|
6
|
+
import { ConfigFile, FileSystemReader, Logger, StatsigService, TunnelOptions } from '@forge/cli-shared';
|
|
7
7
|
import { ExternalRequestBody } from '@forge/runtime';
|
|
8
8
|
import { Permissions, Remotes } from '@forge/manifest';
|
|
9
9
|
import { BundlerOutput } from '@forge/bundler';
|
|
@@ -31,11 +31,12 @@ export declare class LocalDevelopmentServer implements DevelopmentServer {
|
|
|
31
31
|
private readonly logger;
|
|
32
32
|
private readonly configFile;
|
|
33
33
|
private readonly fileSystemReader;
|
|
34
|
+
private readonly statsigService;
|
|
34
35
|
private app;
|
|
35
36
|
private httpServer;
|
|
36
37
|
private permissions;
|
|
37
38
|
private remotes;
|
|
38
|
-
constructor(invocationService: InvocationService, logger: Logger, configFile: ConfigFile, fileSystemReader: FileSystemReader);
|
|
39
|
+
constructor(invocationService: InvocationService, logger: Logger, configFile: ConfigFile, fileSystemReader: FileSystemReader, statsigService: StatsigService);
|
|
39
40
|
start(port?: number, permissions?: Permissions, remotes?: Remotes): Promise<StartDevServerResult>;
|
|
40
41
|
stop(): Promise<void>;
|
|
41
42
|
compileAndWatch({ onBuildWillStart, onBuildFinished }: WatchHooks<BundlerOutput>, tunnelOptions?: TunnelOptions): Promise<BundlerOutput>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/servers/dev-server.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EACL,UAAU,EAEV,gBAAgB,EAEhB,MAAM,
|
|
1
|
+
{"version":3,"file":"dev-server.d.ts","sourceRoot":"","sources":["../../src/servers/dev-server.ts"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,OAAO,MAAM,SAAS,CAAC;AAG9B,OAAO,EACL,UAAU,EAEV,gBAAgB,EAEhB,MAAM,EAEN,cAAc,EAId,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAe,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;A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,QAAQ,CAAC,cAAc;IAVjC,OAAO,CAAC,GAAG,CAAsB;IACjC,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,OAAO,CAAsB;gBAGlB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,cAAc,EAAE,cAAc;IAQpC,KAAK,CAAC,IAAI,SAAI,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAe5F,IAAI;IAIJ,eAAe,CAC1B,EAAE,gBAAgB,EAAE,eAAe,EAAE,EAAE,UAAU,CAAC,aAAa,CAAC,EAChE,aAAa,GAAE,aAA2C,GACzD,OAAO,CAAC,aAAa,CAAC;IAyDlB,MAAM,IAAI,OAAO,CAAC,WAAW;IAI7B,gBAAgB,EAAE,OAAO,CAAC,OAAO,CA2CtC;CACH"}
|
|
@@ -23,15 +23,17 @@ class LocalDevelopmentServer {
|
|
|
23
23
|
logger;
|
|
24
24
|
configFile;
|
|
25
25
|
fileSystemReader;
|
|
26
|
+
statsigService;
|
|
26
27
|
app;
|
|
27
28
|
httpServer;
|
|
28
29
|
permissions;
|
|
29
30
|
remotes;
|
|
30
|
-
constructor(invocationService, logger, configFile, fileSystemReader) {
|
|
31
|
+
constructor(invocationService, logger, configFile, fileSystemReader, statsigService) {
|
|
31
32
|
this.invocationService = invocationService;
|
|
32
33
|
this.logger = logger;
|
|
33
34
|
this.configFile = configFile;
|
|
34
35
|
this.fileSystemReader = fileSystemReader;
|
|
36
|
+
this.statsigService = statsigService;
|
|
35
37
|
this.app = (0, express_1.default)();
|
|
36
38
|
this.app.use(express_1.default.json({ limit: '6mb' }));
|
|
37
39
|
this.app.post(`/:fnKey`, this.handleInvocation);
|
|
@@ -60,7 +62,7 @@ class LocalDevelopmentServer {
|
|
|
60
62
|
return { outputDir };
|
|
61
63
|
}
|
|
62
64
|
const getConfig = isNodeJsRuntime
|
|
63
|
-
? (0, bundler_2.getNodeRuntimeBuildConfig)((0, bundler_1.getWrapperProvider)({ fileSystemReader: this.fileSystemReader }))
|
|
65
|
+
? (0, bundler_2.getNodeRuntimeBuildConfig)((0, bundler_1.getWrapperProvider)({ fileSystemReader: this.fileSystemReader, statsigService: this.statsigService }))
|
|
64
66
|
: bundler_2.getSandboxedRuntimeBuildConfig;
|
|
65
67
|
const config = getConfig(entryPoints, {
|
|
66
68
|
isWatchMode: true,
|
|
@@ -10,6 +10,6 @@ export declare class LocalInvocationService implements InvocationService {
|
|
|
10
10
|
static INTERNAL_METRICS: string[];
|
|
11
11
|
static printMetrics: (shouldReportMetrics: boolean, metrics: {
|
|
12
12
|
[key: string]: any;
|
|
13
|
-
}[] | undefined, logger: Logger) => void;
|
|
13
|
+
}[] | undefined, metricsCompressed: string | undefined, logger: Logger) => void;
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=local-invocation-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../src/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAKV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-invocation-service.d.ts","sourceRoot":"","sources":["../../src/services/local-invocation-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAI/C,OAAO,EACL,mBAAmB,EACnB,SAAS,EAKV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAK9E,qBAAa,sBAAuB,YAAW,iBAAiB;IAE5D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAFT,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS;IAG1B,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,GAAG,CAAC;IA4DhF,MAAM,CAAC,gBAAgB,WAA6D;IAEpF,MAAM,CAAC,YAAY,wBACI,OAAO;;wCAET,MAAM,GAAG,SAAS,UAC7B,MAAM,KACb,IAAI,CAcL;CACH"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LocalInvocationService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const util_1 = require("../util");
|
|
5
6
|
const index_1 = require("../index");
|
|
6
7
|
const uuid_1 = require("uuid");
|
|
7
8
|
const runtime_1 = require("@forge/runtime");
|
|
8
9
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
10
|
+
const zlib = tslib_1.__importStar(require("node:zlib"));
|
|
9
11
|
const DEFAULT_INVOCATION_TIMEOUT = 25;
|
|
10
12
|
class LocalInvocationService {
|
|
11
13
|
configFile;
|
|
@@ -57,13 +59,16 @@ class LocalInvocationService {
|
|
|
57
59
|
});
|
|
58
60
|
clearTimeout(tunnelWarningTimeout);
|
|
59
61
|
const reportMetrics = xenInvocationRequest.isFeatureFlagEnabled(runtime_1.XEN_RUNTIME_SHOULD_REPORT_METRICS);
|
|
60
|
-
LocalInvocationService.printMetrics(reportMetrics, metrics, this.logger);
|
|
62
|
+
LocalInvocationService.printMetrics(reportMetrics, metrics, metricsCompressed, this.logger);
|
|
61
63
|
return reportMetrics ? { body, metrics, success, error, metricsCompressed } : body;
|
|
62
64
|
}
|
|
63
65
|
static INTERNAL_METRICS = ['execute.setup-request-context', 'invoke.setup-isolate'];
|
|
64
|
-
static printMetrics = (shouldReportMetrics, metrics, logger) => {
|
|
66
|
+
static printMetrics = (shouldReportMetrics, metrics, metricsCompressed, logger) => {
|
|
65
67
|
if (shouldReportMetrics && metrics?.length) {
|
|
66
|
-
|
|
68
|
+
if (metricsCompressed) {
|
|
69
|
+
metrics = JSON.parse(zlib.unzipSync(Buffer.from(metricsCompressed, 'base64')).toString());
|
|
70
|
+
}
|
|
71
|
+
logger.debug(`Metrics: ${JSON.stringify(metrics?.filter((m) => !LocalInvocationService.INTERNAL_METRICS.includes(m.name)), null, 2)}`);
|
|
67
72
|
}
|
|
68
73
|
};
|
|
69
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/tunnel",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0-next.16",
|
|
4
4
|
"description": "Tunnel functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"compile": "tsc -b -v"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@forge/bundler": "4.
|
|
15
|
-
"@forge/cli-shared": "6.
|
|
14
|
+
"@forge/bundler": "4.20.0-next.16",
|
|
15
|
+
"@forge/cli-shared": "6.3.0-next.15",
|
|
16
16
|
"@forge/csp": "3.3.0",
|
|
17
|
-
"@forge/runtime": "5.10.
|
|
17
|
+
"@forge/runtime": "5.10.3-next.0",
|
|
18
18
|
"chokidar": "^3.6.0",
|
|
19
19
|
"cloudflared": "^0.5.2",
|
|
20
20
|
"express": "^4.18.3",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@atlassian/xen-test-util": "^4.2.0",
|
|
32
|
-
"@forge/manifest": "8.0.0-next.
|
|
32
|
+
"@forge/manifest": "8.0.0-next.12",
|
|
33
33
|
"@types/express": "^4.17.21",
|
|
34
34
|
"@types/jest": "^29.5.12",
|
|
35
35
|
"@types/node": "14.18.63",
|