@forge/tunnel 7.1.0-next.8 → 7.1.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 CHANGED
@@ -1,5 +1,152 @@
1
1
  # @forge/tunnel
2
2
 
3
+ ## 7.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a36d70b: Implement manual bundler
8
+ - d706cd8: Add support for manually bundling UI Kit resources and bypassing the built-in default bundler
9
+
10
+ ### Patch Changes
11
+
12
+ - 8a9e608: Pull the Forge tunnel proxy-sidecar image from the Portable Registry, falling back to ECR if the initial pull fails
13
+ - Updated dependencies [4d50a76]
14
+ - Updated dependencies [905d8c5]
15
+ - Updated dependencies [87d2d74]
16
+ - Updated dependencies [8a9e608]
17
+ - Updated dependencies [18b920d]
18
+ - Updated dependencies [342098d]
19
+ - Updated dependencies [c8105d8]
20
+ - Updated dependencies [4b90a07]
21
+ - Updated dependencies [3e8de63]
22
+ - Updated dependencies [cddef39]
23
+ - Updated dependencies [0949833]
24
+ - Updated dependencies [a36d70b]
25
+ - Updated dependencies [d1610cc]
26
+ - Updated dependencies [52e074e]
27
+ - Updated dependencies [8d20095]
28
+ - Updated dependencies [e7bfe5e]
29
+ - Updated dependencies [bc2d278]
30
+ - Updated dependencies [ca4fa27]
31
+ - @forge/cli-shared@9.3.0
32
+ - @forge/csp@6.3.0
33
+ - @forge/bundler@7.1.0
34
+
35
+ ## 7.1.0-next.22
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [cddef39]
40
+ - @forge/cli-shared@9.3.0-next.20
41
+ - @forge/bundler@7.1.0-next.22
42
+
43
+ ## 7.1.0-next.21
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [342098d]
48
+ - @forge/cli-shared@9.3.0-next.19
49
+ - @forge/bundler@7.1.0-next.21
50
+
51
+ ## 7.1.0-next.20
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [87d2d74]
56
+ - @forge/csp@6.3.0-next.0
57
+ - @forge/bundler@7.1.0-next.20
58
+
59
+ ## 7.1.0-next.19
60
+
61
+ ### Patch Changes
62
+
63
+ - @forge/bundler@7.1.0-next.19
64
+ - @forge/cli-shared@9.3.0-next.18
65
+
66
+ ## 7.1.0-next.18
67
+
68
+ ### Patch Changes
69
+
70
+ - Updated dependencies [8d20095]
71
+ - @forge/cli-shared@9.3.0-next.17
72
+ - @forge/bundler@7.1.0-next.18
73
+
74
+ ## 7.1.0-next.17
75
+
76
+ ### Patch Changes
77
+
78
+ - Updated dependencies [905d8c5]
79
+ - @forge/cli-shared@9.3.0-next.16
80
+ - @forge/bundler@7.1.0-next.17
81
+
82
+ ## 7.1.0-next.16
83
+
84
+ ### Patch Changes
85
+
86
+ - Updated dependencies [52e074e]
87
+ - @forge/cli-shared@9.3.0-next.15
88
+ - @forge/bundler@7.1.0-next.16
89
+
90
+ ## 7.1.0-next.15
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [c8105d8]
95
+ - Updated dependencies [3e8de63]
96
+ - @forge/cli-shared@9.3.0-next.14
97
+ - @forge/bundler@7.1.0-next.15
98
+
99
+ ## 7.1.0-next.14
100
+
101
+ ### Patch Changes
102
+
103
+ - 8a9e608: Pull the Forge tunnel proxy-sidecar image from the Portable Registry, falling back to ECR if the initial pull fails
104
+ - Updated dependencies [8a9e608]
105
+ - @forge/cli-shared@9.3.0-next.13
106
+ - @forge/bundler@7.1.0-next.14
107
+
108
+ ## 7.1.0-next.13
109
+
110
+ ### Patch Changes
111
+
112
+ - Updated dependencies [4b90a07]
113
+ - @forge/bundler@7.1.0-next.13
114
+ - @forge/cli-shared@9.3.0-next.12
115
+
116
+ ## 7.1.0-next.12
117
+
118
+ ### Patch Changes
119
+
120
+ - Updated dependencies [18b920d]
121
+ - @forge/cli-shared@9.3.0-next.11
122
+ - @forge/bundler@7.1.0-next.12
123
+
124
+ ## 7.1.0-next.11
125
+
126
+ ### Patch Changes
127
+
128
+ - @forge/bundler@7.1.0-next.11
129
+
130
+ ## 7.1.0-next.10
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [bc2d278]
135
+ - @forge/cli-shared@9.3.0-next.10
136
+ - @forge/bundler@7.1.0-next.10
137
+
138
+ ## 7.1.0-next.9
139
+
140
+ ### Minor Changes
141
+
142
+ - a36d70b: Implement manual bundler
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [a36d70b]
147
+ - @forge/bundler@7.1.0-next.9
148
+ - @forge/cli-shared@9.3.0-next.9
149
+
3
150
  ## 7.1.0-next.8
4
151
 
5
152
  ### Patch Changes
@@ -10,9 +10,10 @@ export declare class LocalFunctionHost implements FunctionChangeWatcher {
10
10
  private readonly configFile;
11
11
  private readonly logger;
12
12
  private readonly createSandbox;
13
+ private currentSandboxPath;
13
14
  private currentTunnelOptions;
14
15
  constructor(configFile: ConfigFile, logger: Logger, createSandbox: (cfg: SandboxConfig) => Promise<Sandbox>);
15
- startWatching(bundledCode: BundlerOutput, tunnelOptions?: TunnelOptions): Promise<void>;
16
+ startWatching(bundledCode: BundlerOutput, tunnelOptions: TunnelOptions): Promise<void>;
16
17
  stopWatching(): Promise<void>;
17
18
  private onRuntimeLog;
18
19
  private runAssistantErrorAnalysis;
@@ -1 +1 @@
1
- {"version":3,"file":"function-change-watcher.d.ts","sourceRoot":"","sources":["../../../src/command/interactors/function-change-watcher.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EAEV,MAAM,EACN,aAAa,EAId,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAIL,OAAO,EACP,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvF,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,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,aAAa;IALhC,OAAO,CAAC,oBAAoB,CAA8C;gBAGvD,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC;IAG7D,aAAa,CACxB,WAAW,EAAE,aAAa,EAC1B,aAAa,GAAE,aAA2C,GACzD,OAAO,CAAC,IAAI,CAAC;IAeH,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,OAAO,CAAC,YAAY,CAOlB;IAEF,OAAO,CAAC,yBAAyB,CAa/B;YAEY,mBAAmB;WAwBnB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa;CAY7F"}
1
+ {"version":3,"file":"function-change-watcher.d.ts","sourceRoot":"","sources":["../../../src/command/interactors/function-change-watcher.ts"],"names":[],"mappings":"AACA,OAAO,EACL,UAAU,EAGV,MAAM,EACN,aAAa,EAId,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAgB,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAIL,OAAO,EACP,aAAa,EAEd,MAAM,gBAAgB,CAAC;AAIxB,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvF,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,qBAAa,iBAAkB,YAAW,qBAAqB;IAK3D,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IANhC,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,oBAAoB,CAA4B;gBAGrC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC;IAG7D,aAAa,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BtF,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,OAAO,CAAC,YAAY,CAOlB;IAEF,OAAO,CAAC,yBAAyB,CAa/B;YAEY,mBAAmB;WA8BnB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa;CAY7F"}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocalFunctionHost = exports.MEMORY_LIMIT = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const path_1 = tslib_1.__importDefault(require("path"));
6
- const promises_1 = require("fs/promises");
7
6
  const cli_shared_1 = require("@forge/cli-shared");
7
+ const bundler_1 = require("@forge/bundler");
8
8
  const runtime_1 = require("@forge/runtime");
9
9
  const util_1 = require("../../util");
10
10
  exports.MEMORY_LIMIT = 256;
@@ -12,19 +12,27 @@ class LocalFunctionHost {
12
12
  configFile;
13
13
  logger;
14
14
  createSandbox;
15
- currentTunnelOptions = cli_shared_1.defaultNoDebugTunnelOptions;
15
+ currentSandboxPath;
16
+ currentTunnelOptions;
16
17
  constructor(configFile, logger, createSandbox) {
17
18
  this.configFile = configFile;
18
19
  this.logger = logger;
19
20
  this.createSandbox = createSandbox;
20
21
  }
21
- async startWatching(bundledCode, tunnelOptions = cli_shared_1.defaultNoDebugTunnelOptions) {
22
+ async startWatching(bundledCode, tunnelOptions) {
22
23
  this.currentTunnelOptions = tunnelOptions;
23
- const pathTo = (relativePath) => path_1.default.resolve(bundledCode.outputDir, relativePath);
24
- const manifestFilePath = pathTo(cli_shared_1.manifestFileName);
25
24
  const manifestContents = JSON.stringify(await this.configFile.readConfig());
26
- await (0, promises_1.writeFile)(manifestFilePath, manifestContents);
27
- await this.initializeSandboxes(bundledCode.outputDir, tunnelOptions);
25
+ let additionalOutputs = (0, bundler_1.mergeOutputs)(bundledCode.additionalOutputs, new Map([[cli_shared_1.manifestFileName, Buffer.from(manifestContents)]]));
26
+ this.currentSandboxPath = path_1.default.resolve(cli_shared_1.TUNNEL_BUNDLE_DIRECTORY);
27
+ if (path_1.default.resolve(bundledCode.outputDir) !== this.currentSandboxPath) {
28
+ additionalOutputs = (0, bundler_1.mergeOutputs)(additionalOutputs, new Map([['', bundledCode.outputDir]]));
29
+ }
30
+ if (additionalOutputs.size > 0) {
31
+ const archiver = new cli_shared_1.DirectoryArchiver(this.currentSandboxPath);
32
+ archiver.addMany(additionalOutputs);
33
+ await archiver.finalise();
34
+ }
35
+ await this.initializeSandboxes();
28
36
  runtime_1.StaticInvocationEventEmitter.addListener(runtime_1.EVENT_P3_LOG, this.onRuntimeLog);
29
37
  }
30
38
  async stopWatching() {
@@ -37,7 +45,7 @@ class LocalFunctionHost {
37
45
  }
38
46
  };
39
47
  runAssistantErrorAnalysis = (event) => {
40
- const assistantName = this.currentTunnelOptions.assistantName;
48
+ const assistantName = this.currentTunnelOptions?.assistantName;
41
49
  if (assistantName) {
42
50
  const errorMessage = JSON.stringify(event);
43
51
  const prompt = (0, cli_shared_1.createForgeTunnelErrorPrompt)(errorMessage);
@@ -46,7 +54,12 @@ class LocalFunctionHost {
46
54
  });
47
55
  }
48
56
  };
49
- async initializeSandboxes(srcPath, tunnelOptions) {
57
+ async initializeSandboxes() {
58
+ const sandboxPath = this.currentSandboxPath;
59
+ const tunnelOptions = this.currentTunnelOptions;
60
+ if (!sandboxPath || !tunnelOptions) {
61
+ return;
62
+ }
50
63
  try {
51
64
  util_1.SandboxesContainer.stopSandboxes();
52
65
  const handlers = await this.configFile.getAppHandlers();
@@ -54,7 +67,7 @@ class LocalFunctionHost {
54
67
  await Promise.all(handlers.map(async ({ module, func }) => {
55
68
  sandboxes[`${module}.${func}`] = await this.createSandbox({
56
69
  modName: module,
57
- appPath: srcPath,
70
+ appPath: sandboxPath,
58
71
  handler: func,
59
72
  debugPort: LocalFunctionHost.getDebuggerPort(module, func, tunnelOptions),
60
73
  debugHost: tunnelOptions.debugHost
@@ -2,7 +2,7 @@ import { WatcherMonitor } from '@forge/bundler';
2
2
  import { Logger, TunnelOptions, StatsigService } from '@forge/cli-shared';
3
3
  import { ChildProcess } from 'child_process';
4
4
  import { StartTunnelResult } from '../start-tunnel-command';
5
- import chokidar, { FSWatcher } from 'chokidar';
5
+ import { FSWatcher } from 'chokidar';
6
6
  export interface DockerAuthenticator {
7
7
  authenticateDocker(): Promise<ChildProcess>;
8
8
  }
@@ -13,7 +13,7 @@ export declare class TunnelInteractor {
13
13
  constructor(logger: Logger, statsigService: StatsigService, dockerAuthenticator: DockerAuthenticator);
14
14
  private logTunnelStatus;
15
15
  handleUserExitEvent(stopFunction: () => Promise<void>, bundleMonitor: WatcherMonitor | undefined, manifestFileWatcher: FSWatcher): Promise<void>;
16
- watchAndWarnOnManifestChanges(manifestFilePath: string): chokidar.FSWatcher;
16
+ watchAndWarnOnManifestChanges(manifestFilePath: string): FSWatcher;
17
17
  watchApp: (startTunnelResult: StartTunnelResult, tunnelOptions?: TunnelOptions) => Promise<WatcherMonitor | undefined>;
18
18
  }
19
19
  //# sourceMappingURL=tunnel-interactor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tunnel-interactor.d.ts","sourceRoot":"","sources":["../../../src/command/interactors/tunnel-interactor.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAGL,MAAM,EAEN,aAAa,EACb,cAAc,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BAAmB;IAClC,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;CAC7C;AAED,qBAAa,gBAAgB;IAGzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJtC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;gBAE7B,MAAM,EAAE,MAAM,EAC/B,cAAc,EAAE,cAAc,EACb,mBAAmB,EAAE,mBAAmB;IAK3D,OAAO,CAAC,eAAe;IAShB,mBAAmB,CACxB,YAAY,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EACjC,aAAa,EAAE,cAAc,GAAG,SAAS,EACzC,mBAAmB,EAAE,SAAS,GAC7B,OAAO,CAAC,IAAI,CAAC;IAsCT,6BAA6B,CAAC,gBAAgB,EAAE,MAAM;IAUtD,QAAQ,GACb,mBAAmB,iBAAiB,EACpC,gBAAe,aAA2C,KACzD,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAwFpC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "7.1.0-next.8",
3
+ "version": "7.1.0",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -11,13 +11,13 @@
11
11
  "compile": "tsc -b -v"
12
12
  },
13
13
  "dependencies": {
14
- "@forge/bundler": "7.1.0-next.8",
15
- "@forge/cli-shared": "9.3.0-next.8",
16
- "@forge/csp": "6.2.0",
14
+ "@forge/bundler": "7.1.0",
15
+ "@forge/cli-shared": "9.3.0",
16
+ "@forge/csp": "6.3.0",
17
17
  "@forge/runtime": "7.0.0",
18
18
  "@forge/util": "^3.0.0",
19
19
  "cheerio": "^1.2.0",
20
- "chokidar": "^3.6.0",
20
+ "chokidar": "^4.0.3",
21
21
  "cloudflared": "^0.7.0",
22
22
  "docker-compose": "^1.3.0",
23
23
  "express": "^4.18.3",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@atlassian/xen-test-util": "^4.2.0",
36
- "@forge/manifest": "13.3.0-next.7",
36
+ "@forge/manifest": "13.3.0",
37
37
  "@types/express": "^4.17.21",
38
38
  "@types/jest": "^29.5.14",
39
39
  "@types/node": "20.19.1",