@segmentstream/app/next
7 public exports from @segmentstream/app/next.
Public exports
BareLinkImport
A place in the app's source that takes Next.js's `Link` itself.
interface BareLinkImport {
readonly file: string;
readonly line: number;
readonly statement: string;
}PENDING_LINKS_PLUGIN
const PENDING_LINKS_PLUGIN: unique symbol
PendingLinksBuildError
class PendingLinksBuildError extends Error {
readonly code: string;
readonly imports: readonly BareLinkImport[];
readonly name = "PendingLinksBuildError";
constructor(code: string, message: string, imports?: readonly BareLinkImport[]);
}PendingLinksOptions
interface PendingLinksOptions {
readonly ignore?: readonly string[];
}findBareLinkImports
Reads the app's own source, never dependencies, build output or hidden directories, and returns every place that takes Next.js's `Link` itself instead of a link that shows it was pressed.
function findBareLinkImports(options: {
readonly projectDir: string;
readonly distDir?: string;
readonly ignore?: readonly string[];
}): Promise<BareLinkImport[]>;verifyPendingLinks
Fails when the app's source takes Next.js's `Link` itself: such a link shows nothing between the press and the next page. `Link` from `@segmentstream/app/ui`, or the app's own link built on it, marks itself while the page loads. `useLinkStatus` and type imports from `next/link` stay allowed.
function verifyPendingLinks(options: {
readonly projectDir: string;
readonly distDir?: string;
readonly ignore?: readonly string[];
}): Promise<void>;withPendingLinks
Fails a production build whose source takes Next.js's `Link` itself instead of `Link` from `@segmentstream/app/ui`, or the app's own link built on it, which marks itself while the page it opens loads. `ignore` names project-relative files or directories the check leaves alone. Development servers are not checked. Other plugins and an existing `compiler.runAfterProductionCompile` hook keep working.
function withPendingLinks(config: NextConfig, options?: PendingLinksOptions): NextConfig;
function withPendingLinks(config: NextConfigFunction, options?: PendingLinksOptions): NextConfigFunction;
function withPendingLinks(config: Promise<NextConfig>, options?: PendingLinksOptions): Promise<NextConfig>;