Skip to content

apps/server/src/common/index.ts is an empty barrel that nothing imports #167

Description

@rodriguecyber

Difficulty: Beginner · You'll need: TypeScript · Size: delete 1 file, or fill it in

What's going on

apps/server/src/common/index.ts is two lines:

/** Shared NestJS infrastructure (database, Redis, WebSocket). */
export {};

export {} exports nothing. It is the TypeScript idiom for "treat this file as a module", used when a file has no real exports — so this is a barrel file that re-exports nothing.

Nothing imports it:

grep -rn "common/index\|from '../common'\|from '../../common'" apps/server/src

Consumers already import the concrete paths — common/database/prisma.service, common/redis/redis.service, common/websocket/websocket.module.

Why it matters

The docstring advertises a shared-infrastructure entry point that does not exist. A contributor looking for "where do I import common things from" finds this file, reads the comment, and learns nothing. Either it should do its job or it should go.

Two honest options

A. Delete it. Direct imports work today and are more explicit about what depends on what. NestJS projects commonly skip barrels for this reason.

B. Make it a real barrel. Re-export PrismaModule, PrismaService, RedisModule, RedisService, WebsocketModule, then update the importers.

Either is a fine PR — but say which you picked and why. Option A is smaller and probably right; option B is defensible if the team wants a stable import surface for common/.

How to verify

npm run build --workspace=@docksight/server
npm run lint  --workspace=@docksight/server

Done when

  • apps/server/src/common/index.ts either exports something real or no longer exists
  • The server builds and lints
  • The PR says which option was chosen and why

Good first contribution. The code change is tiny; the valuable part is making a small judgment call and defending it in a PR description. That is most of what code review actually is.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:serverThe NestJS platform server (apps/server)good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions