@thexjs/core 1.6.0 → 1.6.1
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/README.md +7 -1
- package/dist/adapter.d.ts +5 -0
- package/dist/adapter.js +13 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -248,6 +248,9 @@ Only variables prefixed `THEXJS_PUBLIC_` may reach the browser. `@thexjs/env`'s
|
|
|
248
248
|
| `renderPage`, `renderStaticPage`, `renderStreamingPage`, `LoaderArgs`, `LoaderReturn` | Lower-level render functions |
|
|
249
249
|
| `scanRoutes`, `scanPages`, `scanApiDir`, `scanLayouts`, `scanLayoutsDir`, `scanMiddleware`, `scanNotFound`, `findLayoutChain`, `findMiddlewareChain`, `generateManifestSource`, `writeManifest` | Routing internals |
|
|
250
250
|
| `Island`, `IslandProvider`, `IslandMode`, `IslandEntry` | Selective hydration |
|
|
251
|
+
| `Image`, `ImageProps`, `buildSrcSet`, `SRCSET_WIDTHS`, `setImageRemoteHosts` | Optimized image component & srcset builder |
|
|
252
|
+
| `Link`, `LinkProps` | Client-side navigation link component |
|
|
253
|
+
| `createImageProxyHandler`, `ImageProxyOptions` | Remote image proxy handler for `_next/image`-style rewriting |
|
|
251
254
|
| `scanContent`, `renderMarkdown`, `escapeHtml`, `ContentEntry`, `Frontmatter` | Markdown content collections |
|
|
252
255
|
| `composeMiddleware`, `MiddlewareContext`, `MiddlewareFn`, `MiddlewareNext` | Middleware |
|
|
253
256
|
| `registerServerFunctions`, `generateServerFunctionClient`, `getServerFunctionHandler`, `resetServerFunctions` | Server functions/actions internals |
|
|
@@ -255,10 +258,13 @@ Only variables prefixed `THEXJS_PUBLIC_` may reach the browser. `@thexjs/env`'s
|
|
|
255
258
|
| `DefaultNotFound`, `renderErrorOverlay`, `CLIENT_NAV_SCRIPT` | Defaults / dev tooling |
|
|
256
259
|
| `checkCsrf`, `verifyOrigin`, `verifyCsrfToken`, `generateCsrfToken`, `withCsrfCookie`, `CsrfOptions`, `CsrfResult` | CSRF protection |
|
|
257
260
|
| `buildSecurityHeaders`, `applySecurityHeaders`, `SecurityHeadersOptions` | Security response headers (CSP/HSTS/etc.) |
|
|
258
|
-
| `createRateLimiter`, `rateLimitMiddleware`, `RateLimitOptions`, `RateLimitResult`, `
|
|
261
|
+
| `createRateLimiter`, `rateLimitMiddleware`, `RateLimitOptions`, `RateLimitResult`, `RateLimitStore`, `createRedisRateLimitStore` | Rate limiting (per-IP fixed window) |
|
|
259
262
|
| `findLeakedEnvKeys`, `assertNoEnvLeakage`, `EnvLeakageError`, `PUBLIC_ENV_PREFIX` | Server/client env var isolation |
|
|
260
263
|
| `logger`, `withRequestLogging`, `Logger`, `LogFields` | Structured JSON logging |
|
|
261
264
|
| `setErrorReporter`, `getErrorReporter`, `reportException`, `createSentryReporter`, `createOtelReporter`, `combineReporters`, `noopReporter`, `ErrorReporter` | Error reporting (Sentry/OpenTelemetry hook) |
|
|
265
|
+
| `setTracer`, `getTracer`, `runWithRequestSpan`, `tracePhase`, `tracePhaseSync`, `withRequestTracing`, `traceRequestId`, `dbTraceAttributes`, `TracerLike`, `TraceSpan` | Tracing / OpenTelemetry spans |
|
|
266
|
+
| `createInMemoryMetrics`, `createOtlpMetricsReporter`, `withRequestMetrics`, `noopMetrics`, `MetricsReporter`, `CounterSeries`, `HistogramSeries` | Metrics collection (Prometheus/OTLP) |
|
|
267
|
+
| `audit`, `setAuditSink`, `clientIpFromRequest`, `requestIdFromRequest`, `AuditSink`, `AuditEntry` | Audit logging |
|
|
262
268
|
| `createHealthCheckHandler`, `HealthCheckOptions`, `HealthCheck`, `ReadinessResult` | `/healthz` and `/readyz` |
|
|
263
269
|
|
|
264
270
|
## License
|
package/dist/adapter.d.ts
CHANGED
|
@@ -73,6 +73,11 @@ interface ResolvedAction {
|
|
|
73
73
|
parentPath: string;
|
|
74
74
|
paramNames: string[];
|
|
75
75
|
module: CompiledModuleRef;
|
|
76
|
+
/** Client-visible function names for this action module — the names the
|
|
77
|
+
* island-bundle stub generator emits fetch() calls for. Includes each key
|
|
78
|
+
* of a batched `export const actions = {...}` plus individually-exported
|
|
79
|
+
* functions. */
|
|
80
|
+
fnNames?: string[];
|
|
76
81
|
}
|
|
77
82
|
interface BuildManifest {
|
|
78
83
|
/** The project root the build ran from (used to relativize emitted paths). */
|
package/dist/adapter.js
CHANGED
|
@@ -216,15 +216,22 @@ async function resolveBuildManifest(options, scratchDir) {
|
|
|
216
216
|
const segments = actionFile.routePath.split("/").filter(Boolean);
|
|
217
217
|
const fileName = segments[segments.length - 1] ?? "";
|
|
218
218
|
const parentPath = fileName === "index" || !fileName ? actionFile.routePath : `/${segments.slice(0, -1).join("/")}`;
|
|
219
|
+
const actionMod = await import(actionFile.filePath);
|
|
220
|
+
const fnNames = [];
|
|
221
|
+
const batched = actionMod.actions;
|
|
222
|
+
if (batched) fnNames.push(...Object.keys(batched));
|
|
223
|
+
for (const [key, value] of Object.entries(actionMod)) {
|
|
224
|
+
if (key === "default" || key === "actions" || typeof value !== "function") continue;
|
|
225
|
+
fnNames.push(key);
|
|
226
|
+
}
|
|
227
|
+
if (fnNames.length > 0) {
|
|
228
|
+
actionModules.set(actionFile.filePath, { parentPath, fnNames });
|
|
229
|
+
}
|
|
219
230
|
actions.push({
|
|
220
231
|
parentPath,
|
|
221
232
|
paramNames: actionFile.paramNames,
|
|
222
|
-
module: registry.ref(actionFile.filePath, "action")
|
|
223
|
-
|
|
224
|
-
const actionMod = await import(actionFile.filePath);
|
|
225
|
-
actionModules.set(actionFile.filePath, {
|
|
226
|
-
parentPath,
|
|
227
|
-
fnNames: Object.keys(actionMod).filter((k) => k !== "default")
|
|
233
|
+
module: registry.ref(actionFile.filePath, "action"),
|
|
234
|
+
...fnNames.length > 0 ? { fnNames } : {}
|
|
228
235
|
});
|
|
229
236
|
}
|
|
230
237
|
}
|
package/package.json
CHANGED