@farm.js/cli 0.1.0-beta.58 → 0.1.0-beta.59

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/bin/farm.js CHANGED
@@ -54,19 +54,14 @@ function telemetryDeployTarget(commandPath, options) {
54
54
  return undefined;
55
55
  }
56
56
 
57
- program.hook("preAction", async (_command, actionCommand) => {
57
+ program.hook("preAction", (_command, actionCommand) => {
58
58
  const commandPath = telemetryCommandPath(actionCommand);
59
59
  if (commandPath.startsWith("telemetry")) return;
60
- const {
61
- resolveFarmTelemetryCommand,
62
- showFarmTelemetryNotice,
63
- trackFarmCommand,
64
- } = require("../dist/telemetry.js");
65
- await showFarmTelemetryNotice();
60
+ const { resolveFarmTelemetryCommand, trackFarmCommand } = require("../dist/telemetry.js");
66
61
  const command = resolveFarmTelemetryCommand(commandPath);
67
62
  if (!command) return;
68
63
  const options = actionCommand.opts();
69
- await trackFarmCommand({
64
+ void trackFarmCommand({
70
65
  command,
71
66
  packageVersion: version,
72
67
  deployTarget: telemetryDeployTarget(commandPath, options),
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.js");
3
3
  const require_add_integration = require("./add-integration-Bz7WjUfh.js");
4
4
  const require_build = require("./build.js");
5
- const require_telemetry = require("./telemetry.js");
5
+ const require_telemetry = require("./telemetry-9Y6041mK.js");
6
6
  let _farm_js_core_server = require("@farm.js/core/server");
7
7
  let node_fs = require("node:fs");
8
8
  let node_fs_promises = require("node:fs/promises");
@@ -646,6 +646,9 @@ async function createGatewaySession(plan, timeoutMs) {
646
646
  if (!session.id || !session.token || !session.publicUrl) throw new Error("Preview gateway returned an invalid session.");
647
647
  return session;
648
648
  }
649
+ function getSetCookies(headers) {
650
+ return headers.getSetCookie?.call(headers) || [];
651
+ }
649
652
  async function forwardGatewayRequest(target, request) {
650
653
  const headers = new Headers();
651
654
  for (const [key, value] of Object.entries(request.headers || {})) {
@@ -664,8 +667,10 @@ async function forwardGatewayRequest(target, request) {
664
667
  const responseHeaders = {};
665
668
  response.headers.forEach((value, key) => {
666
669
  const normalized = key.toLowerCase();
667
- if (!HOP_BY_HOP_HEADERS.has(normalized)) responseHeaders[key] = value;
670
+ if (!HOP_BY_HOP_HEADERS.has(normalized) && normalized !== "set-cookie") responseHeaders[key] = value;
668
671
  });
672
+ const setCookies = getSetCookies(response.headers);
673
+ if (setCookies.length > 0) responseHeaders["set-cookie"] = setCookies;
669
674
  return {
670
675
  status: response.status,
671
676
  headers: responseHeaders,
@@ -3385,6 +3390,7 @@ exports.detectFarmPackageManager = detectFarmPackageManager;
3385
3390
  exports.escapeDoubleQuoted = escapeDoubleQuoted;
3386
3391
  exports.escapeSqlString = escapeSqlString;
3387
3392
  exports.explainFarmRoute = explainFarmRoute;
3393
+ exports.flushFarmTelemetry = require_telemetry.flushFarmTelemetry;
3388
3394
  exports.formatFarmCronJobs = formatFarmCronJobs;
3389
3395
  exports.formatFarmDeployPlan = formatFarmDeployPlan;
3390
3396
  exports.formatFarmDoctorReport = formatFarmDoctorReport;