feat(adapter-nextjs): add Next.js adapter package with unified CLI#55
Merged
dawidurbanski merged 18 commits intoDec 21, 2025
Conversation
Add initial package.json for @universal-data-layer/adapter-nextjs with: - bin entry for udl-next CLI - peer dependencies on next and universal-data-layer - standard scripts matching other packages
Add tsconfig.json extending root config with proper output settings and path aliases. Include minimal src/index.ts placeholder required for TypeScript validation.
Add utilities for spawning child processes with line-prefixed output: - createPrefixedStream: Transform stream prepending prefix to each line - spawnWithPrefix: Spawn process with prefixed stdout/stderr - killAll: Gracefully terminate multiple processes Includes vitest config and unit tests with 100% coverage.
Add CLI module for parsing command-line arguments: - parseArgs: Parse subcommand (dev/build/start), options, and next args - printHelp: Display usage information - main: CLI entry point with command routing Supports --port, --next-port options and -- separator for Next.js args.
Add runDev function that spawns UDL and Next.js dev servers concurrently with prefixed output, signal handling, and graceful shutdown. Integrates the dev command with the CLI entry point.
Add runStart function that spawns UDL and Next.js production servers concurrently with prefixed output, signal handling, and graceful shutdown. Integrates the start command with the CLI entry point.
Add runBuild function that runs UDL server, waits for ready, runs codegen, then builds Next.js. Also adds waitForServer utility for port polling. Integrates the build command with the CLI entry point.
Create executable entry point for udl-next CLI with shebang and error handling that imports and calls main from compiled CLI module.
Export types, CLI functions, and command functions from package index to enable programmatic usage of the adapter.
Replace separate next and udl scripts with unified udl-next CLI commands. Add adapter-nextjs dependency and remove standalone udl script.
Add comprehensive README with installation, usage, CLI options, output prefixes, signal handling, and troubleshooting sections.
21 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Sync lock file after adding the @universal-data-layer/adapter-nextjs package.
…into 54-create-nextjs-adapter-package-universal-data-layeradapter-nextjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduces
@universal-data-layer/adapter-nextjs, a framework adapter package that provides a unified CLI (udl-next) for running Universal Data Layer alongside Next.js applications. This replaces the need for manual shell concurrency or running separate terminals.Before:
After:
Related Issue
Closes #54
Type of Change
What's Included
CLI Commands
udl-next devudl-next buildudl-next startFeatures
[udl],[next],[codegen]for easy debugging--port(UDL) and--next-port(Next.js) options--separator to pass arguments to Next.jschild_processmoduleFiles Added
Files Modified
examples/nextjs/package.json- Updated scripts to useudl-nextcommitlint.config.js- Addedadapter-nextjsscope.gitignore- Updated coverage patternsChecklist
Code Quality
npm run lintand fixed all issuesnpm run typecheckwith no errorsnpm run fixto format my codeTesting
npm run testand all tests passDocumentation & Changesets
npm run changesetFinal Checks
Testing Instructions
Install dependencies:
Run unit tests:
npm run test -- packages/adapter-nextjsTest CLI in the Next.js example:
Test build command:
Usage Examples
Additional Notes