feat: streamline and clean up codebase #63
Merged
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.

Greptile Summary
This PR removes two wrapper packages (
@init/aiand@init/security) that were primarily re-exporting external dependencies with minimal added value, and refactors@init/analyticsweb module to use a proper singleton pattern.Key Changes:
@init/aipackage - 90% re-exports of AI SDK, OpenAI provider, and Upstash vector utilities; users can now import directly fromai,@ai-sdk/react, and@upstash/vector@init/securitypackage - Arcjet re-exports removed; apps now use@arcjet/ipdirectly for IP detection in rate limitingapps/api/src/index.tsand context injection in routes have been removedexport * from "@plausible-analytics/tracker") to a singleton factory pattern with explicit initializationThe changes successfully reduce indirection and maintenance burden while preserving all functionality. The migration is clean with no remaining references to deleted packages (verified via grep). The lockfile reflects the removal of transitive dependencies.
Confidence Score: 5/5
Important Files Changed
@init/security/toolsimport with direct@arcjet/ipimport for IP detection@arcjet/ipdependency to replace removed@init/securitypackageSequence Diagram
sequenceDiagram participant Dev as Developer participant API as API Server participant Middleware as Middleware Layer participant Arcjet as @arcjet/ip participant Analytics as Web Analytics participant Plausible as Plausible Tracker Note over Dev,Plausible: Before: Security & AI packages wrapped dependencies Dev->>API: HTTP Request API->>Middleware: Security wrapper intercepts Note over Middleware: Used @init/security Middleware->>Arcjet: Get IP via wrapper Arcjet-->>Middleware: IP address Note over Dev,Plausible: After: Direct dependency usage Dev->>API: HTTP Request API->>Middleware: Direct middleware processing Note over Middleware: Uses @arcjet/ip directly Middleware->>Arcjet: Get IP (no wrapper) Arcjet-->>Middleware: IP address Note over Analytics,Plausible: Analytics refactored to singleton pattern Dev->>Analytics: createWebAnalytics(domain) Analytics->>Analytics: singleton("analytics-web") Analytics->>Plausible: init({domain}) Plausible-->>Analytics: Initialized Analytics-->>Dev: {track}