- Refactored the SignupWorkflowService to throw a DomainHttpException for legacy account conflicts, improving error handling. - Updated the SignupForm component to include initialEmail and showFooterLinks props, enhancing user experience during account creation. - Improved the AccountStep in the SignupForm to allow users to add optional details, such as date of birth and gender, for a more personalized signup process. - Enhanced the PasswordStep to include terms acceptance and marketing consent options, ensuring compliance and user engagement. - Updated various catalog views to improve layout and user guidance, streamlining the onboarding process for new users.
48 lines
1.7 KiB
JavaScript
48 lines
1.7 KiB
JavaScript
#!/usr/bin/env node
|
|
// Ensure dev-time Next.js manifests exist to avoid noisy ENOENT errors
|
|
import { mkdirSync, existsSync, writeFileSync, rmSync } from "fs";
|
|
import { join } from "path";
|
|
import { URL } from "node:url";
|
|
|
|
const root = new URL("..", import.meta.url).pathname; // apps/portal
|
|
const nextDir = join(root, ".next");
|
|
const routesManifestPath = join(nextDir, "routes-manifest.json");
|
|
const serverDir = join(nextDir, "server");
|
|
const vendorChunksDir = join(serverDir, "vendor-chunks");
|
|
const webpackRuntimePath = join(serverDir, "webpack-runtime.js");
|
|
|
|
try {
|
|
// Ensure .next exists
|
|
mkdirSync(nextDir, { recursive: true });
|
|
|
|
// Proactively clear stale vendor chunks to avoid version-mismatch runtime errors
|
|
// e.g. Cannot find module './vendor-chunks/zod@x.y.z.js'
|
|
try {
|
|
if (existsSync(vendorChunksDir)) {
|
|
rmSync(vendorChunksDir, { recursive: true, force: true });
|
|
console.log("[dev-prep] Cleared .next/server/vendor-chunks");
|
|
}
|
|
if (existsSync(webpackRuntimePath)) {
|
|
rmSync(webpackRuntimePath);
|
|
console.log("[dev-prep] Removed .next/server/webpack-runtime.js to force regeneration");
|
|
}
|
|
} catch (e) {
|
|
console.warn("[dev-prep] Failed to clear vendor-chunks:", e?.message || e);
|
|
}
|
|
if (!existsSync(routesManifestPath)) {
|
|
const minimalManifest = {
|
|
version: 5,
|
|
pages404: true,
|
|
basePath: "",
|
|
redirects: [],
|
|
rewrites: { beforeFiles: [], afterFiles: [], fallback: [] },
|
|
headers: [],
|
|
};
|
|
writeFileSync(routesManifestPath, JSON.stringify(minimalManifest, null, 2));
|
|
|
|
console.log("[dev-prep] Created minimal .next/routes-manifest.json");
|
|
}
|
|
} catch (err) {
|
|
console.warn("[dev-prep] Failed to prepare Next dev files:", err?.message || err);
|
|
}
|