-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
Type definitions from @repo/shared are not accessible to consumers
Description
The @cloudflare/sandbox package re-exports type definitions from @repo/shared, but this package is not available to consumers because it's listed as a devDependency rather than a regular dependency, and it's not published to npm.
Current Behavior
In dist/index.d.ts:
export * from '@repo/shared';
export { BaseExecOptions, ExecEvent, ExecOptions, ExecResult, FileChunk, FileMetadata, FileStreamEvent, GitCheckoutResult, ISandbox, LogEvent, PortCloseResult, PortExposeResult, PortListResult, Process, ProcessCleanupResult, ProcessInfoResult, ProcessKillResult, ProcessListResult, ProcessLogsResult, ProcessOptions, ProcessStartResult, ProcessStatus, StartProcessRequest, StreamOptions, isExecResult, isProcess, isProcessStatus } from '@repo/shared';In package.json:
{
"devDependencies": {
"@repo/shared": "^0.0.0"
}
}Impact
When consuming the @cloudflare/sandbox package, TypeScript cannot resolve these re-exported types because @repo/shared is:
- Not installed (it's a devDependency)
- Not published to npm (it's an internal monorepo package)
This results in:
- Loss of type safety for methods like
listFiles()which return types from@repo/shared(e.g.,ListFilesResult) - Consumers must use
anytypes or manually recreate the type definitions - TypeScript errors when trying to import re-exported types
Steps to Reproduce
- Install
@cloudflare/sandboxin a project - Try to use types from the package:
import { Sandbox, ListFilesResult } from '@cloudflare/sandbox'; const sandbox: Sandbox; const files: ListFilesResult = await sandbox.listFiles('/');
- TypeScript will fail to resolve
ListFilesResultand related types
Expected Behavior
All type definitions should be accessible to consumers of the package without requiring unpublished dependencies.
Environment
@cloudflare/sandboxversion: 0.4.11- TypeScript version: 5.x
- Package manager: pnpm/npm/yarn
Workaround
Currently, consumers must manually define the types locally:
interface FileInfo {
path: string;
name: string;
isDirectory: boolean;
size?: number;
modifiedAt?: number;
}ajzbc and whoiskatrin
Metadata
Metadata
Assignees
Labels
No labels