npm package diff
Package: @forge/tunnel
Versions: 6.0.0-next.13 - 6.0.0-next.14
File: package/out/command/start-tunnel-command.js
Index: package/out/command/start-tunnel-command.js
===================================================================
--- package/out/command/start-tunnel-command.js
+++ package/out/command/start-tunnel-command.js
@@ -1,32 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StartTunnelCommand = void 0;
const tslib_1 = require("tslib");
-const cli_shared_1 = require("@forge/cli-shared");
-const runtime_1 = require("@forge/runtime");
const node_cache_1 = tslib_1.__importDefault(require("node-cache"));
const portfinder_1 = require("portfinder");
const servers_1 = require("../servers");
-const index_1 = require("../index");
class StartTunnelCommand {
getAppConfig;
devServer;
tunnelFactory;
tunnelClient;
functionHost;
- inspector;
logger;
configFile;
tunnelServers = {};
cspReporterServer;
- constructor(getAppConfig, devServer, tunnelFactory, tunnelClient, functionHost, inspector, logger, configFile) {
+ constructor(getAppConfig, devServer, tunnelFactory, tunnelClient, functionHost, logger, configFile) {
this.getAppConfig = getAppConfig;
this.devServer = devServer;
this.tunnelFactory = tunnelFactory;
this.tunnelClient = tunnelClient;
this.functionHost = functionHost;
- this.inspector = inspector;
this.logger = logger;
this.configFile = configFile;
}
stopServices = async (appId, environmentKey) => {
@@ -34,9 +29,8 @@
this.functionHost.stopWatching(),
this.tunnelClient.unregisterTunnels(appId, environmentKey),
this.tunnelFactory.closeTunnel(),
this.devServer.stop(),
- this.inspector.stopServer(),
...Object.values(this.tunnelServers).map((server) => server.stop()),
this.cspReporterServer?.stop()
]);
};
@@ -99,28 +93,16 @@
resourceKey
}))
};
await this.tunnelClient.registerTunnels(appId, environmentKey, tunnelDefinitions);
- const inspectorAddress = (0, index_1.isInspectorEnabled)() ? this.inspector.startServer(index_1.INSPECTOR_PORT) : undefined;
const stopFunction = async () => this.stopServices(appId, environmentKey);
const reloadSandboxes = async (bundledCode, tunnelOptions) => {
await this.functionHost.stopWatching();
- try {
- await this.functionHost.startWatching(bundledCode, tunnelOptions);
- }
- catch (e) {
- if (e instanceof runtime_1.SnapshotCodeError) {
- this.logger.error(new Error(cli_shared_1.Text.snapshot.error('App code snapshot error', e.message)));
- }
- else {
- throw e;
- }
- }
+ await this.functionHost.startWatching(bundledCode, tunnelOptions);
};
return {
localPort: faasTunnelServer.port,
tunnelDefinitions,
- inspectorAddress,
stopFunction,
reloadSandboxes,
faasServer: faasTunnelServer.devServer,
uiServers: customUITunnelsServers.map(({ devServer }) => devServer)