@forge/tunnel 1.7.4-next.4 → 1.8.0-next.5

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,16 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 1.8.0-next.5
4
+
5
+ ### Minor Changes
6
+
7
+ - 44def0a: Derive the memory limit of the Isolate based on the Lambda memory available
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [44def0a]
12
+ - @forge/runtime@2.1.0-next.0
13
+
3
14
  ## 1.7.4-next.4
4
15
 
5
16
  ### Patch Changes
@@ -12,6 +12,7 @@ export interface FsInteractor {
12
12
  mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<void>;
13
13
  }
14
14
  export declare const INVOCATION_TIMEOUT = 10;
15
+ export declare const MEMORY_LIMIT = 256;
15
16
  export declare class LocalFunctionHost implements FunctionChangeWatcher {
16
17
  private readonly configFile;
17
18
  private readonly logger;
@@ -1 +1 @@
1
- {"version":3,"file":"function-change-watcher.d.ts","sourceRoot":"","sources":["../../../../src/tunnelling/command/interactors/function-change-watcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAG1C,OAAO,EAAE,UAAU,EAA8B,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAML,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AASD,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,qBAAa,iBAAkB,YAAW,qBAAqB;IAI3D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN/B,OAAO,CAAC,YAAY,CAA8C;gBAG/C,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,YAAY,EAAE,YAAY;YAG/B,mBAAmB;IAsBpB,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA8CxD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,OAAO,CAAC,YAAY,CAElB;YAEY,8BAA8B;YAe9B,mBAAmB;CAqBlC"}
1
+ {"version":3,"file":"function-change-watcher.d.ts","sourceRoot":"","sources":["../../../../src/tunnelling/command/interactors/function-change-watcher.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,IAAI,CAAC;AAG1C,OAAO,EAAE,UAAU,EAA8B,MAAM,EAAyB,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAML,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE;AASD,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,qBAAa,iBAAkB,YAAW,qBAAqB;IAI3D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAN/B,OAAO,CAAC,YAAY,CAA8C;gBAG/C,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,EACzB,YAAY,EAAE,YAAY;YAG/B,mBAAmB;IAuBpB,aAAa,CAAC,WAAW,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA8CxD,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,OAAO,CAAC,YAAY,CAElB;YAEY,8BAA8B;YAgB9B,mBAAmB;CAqBlC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LocalFunctionHost = exports.INVOCATION_TIMEOUT = void 0;
3
+ exports.LocalFunctionHost = exports.MEMORY_LIMIT = exports.INVOCATION_TIMEOUT = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const path_1 = require("path");
6
6
  const tmp_1 = tslib_1.__importDefault(require("tmp"));
@@ -8,6 +8,7 @@ const cli_shared_1 = require("@forge/cli-shared");
8
8
  const runtime_1 = require("@forge/runtime");
9
9
  const util_1 = require("../../util");
10
10
  exports.INVOCATION_TIMEOUT = 10;
11
+ exports.MEMORY_LIMIT = 256;
11
12
  class LocalFunctionHost {
12
13
  constructor(configFile, logger, snapshot, fsInteractor) {
13
14
  this.configFile = configFile;
@@ -22,7 +23,7 @@ class LocalFunctionHost {
22
23
  async generateBundleFiles(bundle, withSnapshot) {
23
24
  await this.fsInteractor.mkdir(path_1.dirname(bundle.bundleFilePath), { recursive: true });
24
25
  if (withSnapshot) {
25
- const snapshotOutput = await this.snapshot(Buffer.from(bundle.bundleFileContent), bundle.bundleFilePath, bundle.bundleFileSourceMap ? Buffer.from(bundle.bundleFileSourceMap) : undefined);
26
+ const snapshotOutput = await this.snapshot({ isolateMemory: exports.MEMORY_LIMIT }, Buffer.from(bundle.bundleFileContent), bundle.bundleFilePath, bundle.bundleFileSourceMap ? Buffer.from(bundle.bundleFileSourceMap) : undefined);
26
27
  await this.fsInteractor.writeFile(bundle.bundleFilePath + '.snapshot', Buffer.from(snapshotOutput.buffer));
27
28
  if (snapshotOutput.logs.length > 0) {
28
29
  this.snapshotLogs.push(snapshotOutput.logs);
@@ -86,7 +87,8 @@ class LocalFunctionHost {
86
87
  appPath: srcPath,
87
88
  modName: mod,
88
89
  handler: func,
89
- timeout: exports.INVOCATION_TIMEOUT
90
+ timeout: exports.INVOCATION_TIMEOUT,
91
+ isolateMemory: exports.MEMORY_LIMIT
90
92
  });
91
93
  }
92
94
  async initializeSandboxes(srcPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "1.7.4-next.4",
3
+ "version": "1.8.0-next.5",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -20,7 +20,7 @@
20
20
  "@forge/cli-shared": "2.5.0-next.3",
21
21
  "@forge/csp": "^1.10.0",
22
22
  "@forge/isolated-vm": "3.3.10",
23
- "@forge/runtime": "2.0.2",
23
+ "@forge/runtime": "2.1.0-next.0",
24
24
  "express": "^4.17.1",
25
25
  "express-mung": "^0.5.1",
26
26
  "http-proxy-middleware": "^1.0.6",