@elmeragroup/internal 0.2.0-canary.4 → 0.2.0-canary.6

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.
@@ -56,8 +56,14 @@ function readRscStatus(sourceFile) {
56
56
  }
57
57
  return "server";
58
58
  }
59
- /** Package name a forwarded prop comes from, e.g. `@base-ui/react` or `react`. */
60
- function declaringPackage(declarationPath) {
59
+ /**
60
+ * Package name a forwarded prop comes from, e.g. `@base-ui/react` or `react`. TypeScript's default
61
+ * library is `typescript` wherever the compiler installed it: TypeScript 7 ships it inside a
62
+ * per-platform package such as `@typescript/typescript-linux-x64`, and an artifact must not depend
63
+ * on the machine that generated it.
64
+ */
65
+ function declaringPackage(context, declarationPath) {
66
+ if (context.program.getSourceFileMetadata(declarationPath)?.isDefaultLibrary === true) return "typescript";
61
67
  const last = declarationPath.lastIndexOf("/node_modules/");
62
68
  if (last === -1) return null;
63
69
  const segments = declarationPath.slice(last + 14).split("/");
@@ -187,7 +193,7 @@ function forwardedOfProps(context, properties) {
187
193
  if (!isForwardedProp(context, property)) continue;
188
194
  count += 1;
189
195
  for (const declaration of property.declarations) {
190
- const packageName = declaringPackage(declaration.path);
196
+ const packageName = declaringPackage(context, declaration.path);
191
197
  if (packageName !== null) from.add(packageName);
192
198
  }
193
199
  }
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { n as ApiArtifactsError, t as ApiArtifactsDriftError } from "./errors-CT
3
3
  //#region src/index.ts
4
4
  /** Generates API artifacts with the Elmera UI documentation defaults. */
5
5
  async function generateApiArtifacts(options) {
6
- const { generateApiArtifacts: generate } = await import("./dist-CztIPpu1.mjs");
6
+ const { generateApiArtifacts: generate } = await import("./dist-DR31PLLJ.mjs");
7
7
  return generate({
8
8
  ...options,
9
9
  includeExternalTypes: options.includeExternalTypes ?? ["@base-ui/react"],
package/dist/release.mjs CHANGED
@@ -144,6 +144,54 @@ function packageManifestGitPath(pkg) {
144
144
  return join(relative(pkg.checkoutRoot, pkg.packageDirectory), "package.json").replaceAll("\\", "/");
145
145
  }
146
146
  //#endregion
147
+ //#region ../release/dist/connection-retry.js
148
+ /**
149
+ * Failure codes of a request whose pooled keep-alive connection was already gone. GitHub drops
150
+ * idle connections within a minute without a keep-alive hint, and the engine blocks its event
151
+ * loop while the adapter packs and while npm runs, so the pool cannot notice before it reuses the
152
+ * socket: the next request fails with `UND_ERR_SOCKET` ("other side closed") or `EPIPE`.
153
+ */
154
+ const DROPPED_CONNECTION_CODES = /* @__PURE__ */ new Set([
155
+ "UND_ERR_SOCKET",
156
+ "EPIPE",
157
+ "ECONNRESET"
158
+ ]);
159
+ /**
160
+ * Methods the engine may send twice. GET, HEAD, PUT and DELETE are idempotent, and the engine's
161
+ * only PATCH sets fixed fields on its own release. POST writes are never resent: each follows a
162
+ * state read, so rerunning the Merge job resumes them instead.
163
+ */
164
+ const RESENDABLE_METHODS = /* @__PURE__ */ new Set([
165
+ "GET",
166
+ "HEAD",
167
+ "PUT",
168
+ "DELETE",
169
+ "PATCH"
170
+ ]);
171
+ /** The system error a failed fetch carries as its `cause`; only its code is read. */
172
+ const isCodedCause = Schema.is(Schema.Struct({ code: Schema.String }));
173
+ function droppedConnection(error) {
174
+ return error instanceof TypeError && isCodedCause(error.cause) && DROPPED_CONNECTION_CODES.has(error.cause.code);
175
+ }
176
+ function requestMethod(input, init) {
177
+ return (init?.method ?? (input instanceof Request ? input.method : "GET")).toUpperCase();
178
+ }
179
+ /**
180
+ * Wraps `fetcher` so a resendable request that fails on a dropped connection is sent once more,
181
+ * which opens a fresh connection. HTTP error statuses, aborts, other network failures, a POST, and
182
+ * a second drop all pass through unchanged.
183
+ */
184
+ function resendOnDroppedConnection(fetcher) {
185
+ return async (input, init) => {
186
+ try {
187
+ return await fetcher(input, init);
188
+ } catch (error) {
189
+ if (!droppedConnection(error) || !RESENDABLE_METHODS.has(requestMethod(input, init))) throw error;
190
+ return fetcher(input, init);
191
+ }
192
+ };
193
+ }
194
+ //#endregion
147
195
  //#region ../release/dist/github.js
148
196
  /** Brands a decoded GitHub release id; the two id spaces are nominal, so they must not mix. */
149
197
  const releaseId = Brand.nominal();
@@ -184,7 +232,7 @@ function releaseEnvironment() {
184
232
  return {
185
233
  repository: process.env.GITHUB_REPOSITORY ?? "",
186
234
  token: Redacted.make(process.env.GH_TOKEN ?? ""),
187
- fetch: (input, init) => globalThis.fetch(input, init)
235
+ fetch: resendOnDroppedConnection((input, init) => globalThis.fetch(input, init))
188
236
  };
189
237
  }
190
238
  /**
package/package.json CHANGED
@@ -11,14 +11,14 @@
11
11
  "@types/node": "25.9.5",
12
12
  "vitest": "4.1.11",
13
13
  "tsdown": "0.23.0",
14
- "@elmeragroup/api-artifacts": "0.0.0",
15
14
  "@elmeragroup/typescript-config": "0.0.0",
15
+ "@elmeragroup/api-artifacts": "0.0.0",
16
+ "@elmeragroup/api-extractor": "0.0.0",
16
17
  "@elmeragroup/oxlint-plugin": "0.0.0",
17
18
  "@elmeragroup/oxlint-plugin-anti-slop": "0.0.0",
18
- "@elmeragroup/api-extractor": "0.0.0",
19
19
  "@elmeragroup/release": "0.0.0"
20
20
  },
21
- "version": "0.2.0-canary.4",
21
+ "version": "0.2.0-canary.6",
22
22
  "exports": {
23
23
  ".": {
24
24
  "types": "./dist/index.d.mts",
@@ -69,7 +69,7 @@
69
69
  },
70
70
  "sideEffects": false,
71
71
  "elmeraRelease": {
72
- "commit": "4cf302fa476d26ce43fab03ae1509807b0161e39",
72
+ "commit": "cd971badfc723d1194fa8052c71978f6d490f397",
73
73
  "channel": "canary"
74
74
  },
75
75
  "scripts": {