fix: include migration files in @paperclipai/db and improve server error msg
- db build now copies src/migrations/ to dist/migrations/ after tsc,
so SQL + meta JSON files are included in the published package.
Without this, `import("@paperclipai/server")` fails at runtime with
ENOENT when scanning for migration files.
- CLI's importServerEntry() now distinguishes between "module not found"
and "server crashed during startup" for clearer error messages.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,9 +106,15 @@ async function importServerEntry(): Promise<void> {
|
||||
try {
|
||||
await import("@paperclipai/server");
|
||||
} catch (err) {
|
||||
if (isModuleNotFoundError(err)) {
|
||||
throw new Error(
|
||||
`Could not locate a Paperclip server entrypoint.\n` +
|
||||
`Tried: ${devEntry}, @paperclipai/server\n` +
|
||||
`${formatError(err)}`,
|
||||
);
|
||||
}
|
||||
throw new Error(
|
||||
`Could not locate a Paperclip server entrypoint.\n` +
|
||||
`Tried: ${devEntry}, @paperclipai/server\n` +
|
||||
`Paperclip server failed to start.\n` +
|
||||
`${formatError(err)}`,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user