Skip to content

Conversation

@pingSubhajit
Copy link
Contributor

Summary

This PR removes the Next.js dependency for import alias configuration and refactors all internal imports in the Unrag package to use TypeScript path aliases.

Changes

Part 1: Universal Import Alias Support

Previously, unrag init only patched tsconfig.json when Next.js was detected. Since Unrag is TypeScript-only, import aliases should work for any TypeScript project.

Modified files:

  • packages/unrag/cli/commands/init.ts
    • Removed Next.js conditional check (lines 650-656)
    • Now always calls patchTsconfigPaths() for TypeScript projects
    • Updated output messaging from "Next.js" to "TypeScript"

Impact:

  • Plain TypeScript projects (Bun, Deno, vanilla TS) now get tsconfig path aliases automatically
  • Existing Next.js projects continue to work as before

Part 2: Internal Import Path Aliases

Refactored all internal imports to use clean path aliases instead of relative paths.

Created:

  • packages/unrag/tsconfig.json with path mappings:
    • @cli/*./cli/*
    • @registry/*./registry/*
    • @test/*./test/*

Updated ~80 files with ~180 import changes:

  • CLI commands and lib files (15 files)
  • Registry modules (45 files):
    • Core modules
    • 12 embedding providers
    • 11 extractors
    • Store adapters (drizzle, prisma, raw-sql)
    • Connectors (notion, google-drive)
    • Rerank and eval modules
  • Test files (20 files)

@pingSubhajit pingSubhajit self-assigned this Jan 12, 2026
@vercel
Copy link

vercel bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
unrag-example-support-ticket-search Ready Ready Preview, Comment Jan 12, 2026 4:21am
unrag-web Ready Ready Preview, Comment Jan 12, 2026 4:21am

@pingSubhajit pingSubhajit merged commit cd61dbf into release/v0.2.11 Jan 12, 2026
3 of 4 checks passed
@pingSubhajit pingSubhajit deleted the refactor/universal-import-alias branch January 12, 2026 04:28
pingSubhajit added a commit that referenced this pull request Jan 12, 2026
…as refactoring (#27)

* refactor: use import alias regardless of project type
* fix: remove redundant isNext variable
* test: add test suite for checking import alias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants