@vercel/build-utils 14.4.0 → 14.5.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,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 14.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 90afd71: Expose the resolved rewrite destination as the request path observed by Node backend framework applications (express, hono, h3, koa, nestjs, fastify, elysia) and the unified backends builder, and warn affected backend projects about the behavior change.
8
+
9
+ ## 14.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - e5b0363: Add `Span.reportChildEvents()` so a tree of trace events produced in another process (e.g. a forked build worker) can be reported under an existing span. Its root events are reparented to that span while links internal to the set are preserved, keeping trace nesting intact.
14
+
3
15
  ## 14.4.0
4
16
 
5
17
  ### Minor Changes
@@ -76,6 +76,22 @@ function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, vali
76
76
  slug: frameworkName,
77
77
  version
78
78
  };
79
+ if (!res.routes) {
80
+ res.routes = [
81
+ { handle: "filesystem" },
82
+ {
83
+ src: "/(.*)",
84
+ dest: "/",
85
+ transforms: [
86
+ {
87
+ type: "request.path",
88
+ op: "set",
89
+ args: "/$1"
90
+ }
91
+ ]
92
+ }
93
+ ];
94
+ }
79
95
  return res;
80
96
  };
81
97
  const entrypointCallback = async (args) => {
package/dist/index.js CHANGED
@@ -39344,6 +39344,22 @@ var Span = class _Span {
39344
39344
  reporter: this._reporter
39345
39345
  });
39346
39346
  }
39347
+ /**
39348
+ * Report already-finalized trace events (e.g. collected in a child process) to this span's
39349
+ * reporter so they appear nested under this span. Any event that is a root of the passed set —
39350
+ * i.e. whose `parentId` refers to a span not present in `events` — is reparented to this span;
39351
+ * links internal to the set are preserved. Safe to call with events from any process: the
39352
+ * caller does not need to know or set this span's id.
39353
+ */
39354
+ reportChildEvents(events) {
39355
+ if (!this._reporter)
39356
+ return;
39357
+ const ids = new Set(events.map((event) => event.id));
39358
+ for (const event of events) {
39359
+ const isRoot = event.parentId === void 0 || !ids.has(event.parentId);
39360
+ this._reporter.report(isRoot ? { ...event, parentId: this.id } : event);
39361
+ }
39362
+ }
39347
39363
  async trace(fn) {
39348
39364
  try {
39349
39365
  return await fn(this);
@@ -39440,6 +39456,22 @@ function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, vali
39440
39456
  slug: frameworkName,
39441
39457
  version
39442
39458
  };
39459
+ if (!res.routes) {
39460
+ res.routes = [
39461
+ { handle: "filesystem" },
39462
+ {
39463
+ src: "/(.*)",
39464
+ dest: "/",
39465
+ transforms: [
39466
+ {
39467
+ type: "request.path",
39468
+ op: "set",
39469
+ args: "/$1"
39470
+ }
39471
+ ]
39472
+ }
39473
+ ];
39474
+ }
39443
39475
  return res;
39444
39476
  };
39445
39477
  const entrypointCallback = async (args) => {
@@ -32,6 +32,14 @@ export declare class Span {
32
32
  stop(): void;
33
33
  setAttributes(attrs: Attributes): void;
34
34
  child(name: string, attrs?: Attributes): Span;
35
+ /**
36
+ * Report already-finalized trace events (e.g. collected in a child process) to this span's
37
+ * reporter so they appear nested under this span. Any event that is a root of the passed set —
38
+ * i.e. whose `parentId` refers to a span not present in `events` — is reparented to this span;
39
+ * links internal to the set are preserved. Safe to call with events from any process: the
40
+ * caller does not need to know or set this span's id.
41
+ */
42
+ reportChildEvents(events: TraceEvent[]): void;
35
43
  trace<T>(fn: (span: Span) => T | Promise<T>): Promise<T>;
36
44
  }
37
45
  export {};
@@ -78,6 +78,22 @@ class Span {
78
78
  reporter: this._reporter
79
79
  });
80
80
  }
81
+ /**
82
+ * Report already-finalized trace events (e.g. collected in a child process) to this span's
83
+ * reporter so they appear nested under this span. Any event that is a root of the passed set —
84
+ * i.e. whose `parentId` refers to a span not present in `events` — is reparented to this span;
85
+ * links internal to the set are preserved. Safe to call with events from any process: the
86
+ * caller does not need to know or set this span's id.
87
+ */
88
+ reportChildEvents(events) {
89
+ if (!this._reporter)
90
+ return;
91
+ const ids = new Set(events.map((event) => event.id));
92
+ for (const event of events) {
93
+ const isRoot = event.parentId === void 0 || !ids.has(event.parentId);
94
+ this._reporter.report(isRoot ? { ...event, parentId: this.id } : event);
95
+ }
96
+ }
81
97
  async trace(fn) {
82
98
  try {
83
99
  return await fn(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "14.4.0",
3
+ "version": "14.5.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",