@qzsy/vinext 0.1.86 → 0.1.87

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.
@@ -152,7 +152,11 @@ type NextConfig = {
152
152
  * @see https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength
153
153
  */
154
154
  reactMaxHeadersLength?: number; /** User agents that require blocking metadata in the initial head. */
155
- htmlLimitedBots?: RegExp | string;
155
+ htmlLimitedBots?: RegExp | string; /** Development logging controls. Mirrors Next.js `logging` config. */
156
+ logging?: {
157
+ /** Log Server Function invocations in development. Defaults to true. */serverFunctions?: boolean;
158
+ [key: string]: unknown;
159
+ };
156
160
  /**
157
161
  * Enable Cache Components (Next.js 16).
158
162
  * When true, enables the "use cache" directive for pages, components, and functions.
@@ -291,7 +295,8 @@ type ResolvedNextConfig = {
291
295
  * during App Router SSR. `0` disables emission. Defaults to 6000.
292
296
  */
293
297
  reactMaxHeadersLength: number; /** Serialized htmlLimitedBots regexp source from next.config. */
294
- htmlLimitedBots: string | undefined;
298
+ htmlLimitedBots: string | undefined; /** Whether Server Function invocations are logged during development. */
299
+ serverFunctionsLogging: boolean;
295
300
  /**
296
301
  * Packages that should be treated as server-external (not bundled by Vite).
297
302
  * Sourced from `serverExternalPackages` or the legacy
@@ -620,6 +620,7 @@ async function resolveNextConfig(config, root = process.cwd(), options = {}) {
620
620
  expireTime: DEFAULT_EXPIRE_TIME,
621
621
  reactMaxHeadersLength: DEFAULT_REACT_MAX_HEADERS_LENGTH,
622
622
  htmlLimitedBots: void 0,
623
+ serverFunctionsLogging: true,
623
624
  serverExternalPackages: [],
624
625
  cacheHandler: void 0,
625
626
  cacheMaxMemorySize: void 0,
@@ -695,6 +696,7 @@ async function resolveNextConfig(config, root = process.cwd(), options = {}) {
695
696
  const serverActionsBodySizeLimitLabel = serverActionsBodySizeLimitConfig === void 0 ? "1 MB" : String(serverActionsBodySizeLimitConfig);
696
697
  const hashSalt = (readOptionalString(experimental?.outputHashSalt) ?? "") + (process.env.NEXT_HASH_SALT ?? "");
697
698
  const htmlLimitedBots = resolveHtmlLimitedBots(config.htmlLimitedBots);
699
+ const serverFunctionsLogging = readOptionalRecord(config.logging)?.serverFunctions !== false;
698
700
  const rawOptimize = experimental?.optimizePackageImports;
699
701
  const optimizePackageImports = Array.isArray(rawOptimize) ? rawOptimize.filter((x) => typeof x === "string") : [];
700
702
  const inlineCss = experimental?.inlineCss === true;
@@ -796,6 +798,7 @@ async function resolveNextConfig(config, root = process.cwd(), options = {}) {
796
798
  expireTime: typeof config.expireTime === "number" ? config.expireTime : DEFAULT_EXPIRE_TIME,
797
799
  reactMaxHeadersLength: typeof config.reactMaxHeadersLength === "number" ? config.reactMaxHeadersLength : DEFAULT_REACT_MAX_HEADERS_LENGTH,
798
800
  htmlLimitedBots,
801
+ serverFunctionsLogging,
799
802
  serverExternalPackages,
800
803
  cacheHandler,
801
804
  cacheMaxMemorySize,
package/dist/index.js CHANGED
@@ -784,6 +784,7 @@ function vinext(options = {}) {
784
784
  defines["process.env.__VINEXT_IMAGE_UNOPTIMIZED"] = JSON.stringify(String(nextConfig.images?.unoptimized === true));
785
785
  defines["process.env.__VINEXT_BUILD_ID"] = JSON.stringify(nextConfig.buildId);
786
786
  defines["process.env.__VINEXT_RSC_COMPATIBILITY_ID"] = JSON.stringify(rscCompatibilityId);
787
+ defines["process.env.__VINEXT_SERVER_FUNCTIONS_LOGGING"] = JSON.stringify(String(nextConfig.serverFunctionsLogging));
787
788
  defines["process.env.__VINEXT_DEPLOYMENT_ID"] = JSON.stringify(nextConfig.deploymentId ?? "");
788
789
  defines["process.env.NEXT_DEPLOYMENT_ID"] = nextConfig.deploymentId ? JSON.stringify(nextConfig.deploymentId) : "false";
789
790
  defines["process.env.NEXT_RUNTIME"] = "\"\"";
@@ -20,10 +20,10 @@ import { parseNextHttpErrorDigest } from "./next-error-digest.js";
20
20
  import { matchPrerenderRouteParamsPayload, readTrustedPrerenderRouteParams, serializePrerenderRouteParamsHeader } from "./prerender-route-params.js";
21
21
  import { getRenderedConcreteUrlPathsForRoute } from "./pregenerated-concrete-paths.js";
22
22
  import { pickRootParams, setRootParams } from "../shims/root-params.js";
23
+ import { flattenErrorCauses } from "../utils/error-cause.js";
23
24
  import { createServerActionNotFoundResponse, getServerActionNotFoundMessage } from "./server-action-not-found.js";
24
25
  import { buildPageCacheTags } from "./implicit-tags.js";
25
26
  import { buildPostMwRequestContext } from "./app-post-middleware-context.js";
26
- import { flattenErrorCauses } from "../utils/error-cause.js";
27
27
  import { finalizeAppRscResponse } from "./app-rsc-response-finalizer.js";
28
28
  import { normalizeRscRequest } from "./app-rsc-request-normalization.js";
29
29
  import { runWithPrerenderWorkUnit } from "./prerender-work-unit-setup.js";
@@ -139,7 +139,7 @@ function fitLogInfoForHeader(info) {
139
139
  }
140
140
  }
141
141
  function isDevServerActionLoggingEnabled() {
142
- return process.env.NODE_ENV !== "production";
142
+ return process.env.NODE_ENV !== "production" && process.env.__VINEXT_SERVER_FUNCTIONS_LOGGING !== "false";
143
143
  }
144
144
  function isInlineActionExport(exportedName) {
145
145
  return INLINE_ACTION_PREFIXES.some((prefix) => exportedName.startsWith(prefix));
@@ -50,7 +50,7 @@ declare class RedirectErrorBoundary extends React.Component<{
50
50
  children?: React.ReactNode;
51
51
  });
52
52
  static getDerivedStateFromError(error: unknown): RedirectBoundaryState;
53
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
53
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
54
54
  }
55
55
  declare function RedirectBoundary({
56
56
  children
@@ -70,7 +70,7 @@ declare class ErrorBoundaryInner extends React.Component<ErrorBoundaryInnerProps
70
70
  componentDidMount(): void;
71
71
  componentWillUnmount(): void;
72
72
  reset: () => void;
73
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
73
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
74
74
  }
75
75
  declare function ErrorBoundary({
76
76
  fallback,
@@ -118,7 +118,7 @@ declare class ForbiddenBoundaryInner extends React.Component<ForbiddenBoundaryIn
118
118
  constructor(props: ForbiddenBoundaryInnerProps);
119
119
  static getDerivedStateFromProps(props: ForbiddenBoundaryInnerProps, state: ForbiddenBoundaryState): ForbiddenBoundaryState | null;
120
120
  static getDerivedStateFromError(error: unknown): Partial<ForbiddenBoundaryState>;
121
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
121
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
122
122
  }
123
123
  declare function ForbiddenBoundary({
124
124
  fallback,
@@ -142,7 +142,7 @@ declare class UnauthorizedBoundaryInner extends React.Component<UnauthorizedBoun
142
142
  constructor(props: UnauthorizedBoundaryInnerProps);
143
143
  static getDerivedStateFromProps(props: UnauthorizedBoundaryInnerProps, state: UnauthorizedBoundaryState): UnauthorizedBoundaryState | null;
144
144
  static getDerivedStateFromError(error: unknown): Partial<UnauthorizedBoundaryState>;
145
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
145
+ render(): string | number | bigint | boolean | React.JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
146
146
  }
147
147
  declare function UnauthorizedBoundary({
148
148
  fallback,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzsy/vinext",
3
- "version": "0.1.86",
3
+ "version": "0.1.87",
4
4
  "description": "Run Next.js apps on Vite. Drop-in replacement for the next CLI.",
5
5
  "license": "MIT",
6
6
  "repository": {