Skip to content

fix: add types and import conditions to package exports#169

Merged
taras merged 1 commit intomainfrom
fix/exports-types-condition
Feb 23, 2026
Merged

fix: add types and import conditions to package exports#169
taras merged 1 commit intomainfrom
fix/exports-types-condition

Conversation

@taras
Copy link
Member

@taras taras commented Feb 23, 2026

Motivation

External TypeScript consumers using customConditions: ["development"] were unable to properly resolve types from @effectionx/* packages. The development export condition pointed to .ts source files, which works within this monorepo but causes compilation errors for external consumers who expect compiled artifacts.

This issue manifested when @effectionx/scope-eval was used as a dependency - the consuming project had to override customConditions: [] as a workaround.

Approach

Added explicit types and import conditions to all 25 package exports. The new structure ensures:

"exports": {
  ".": {
    "types": "./dist/mod.d.ts",     // TypeScript type resolution (highest priority)
    "development": "./mod.ts",       // Internal monorepo development
    "import": "./dist/mod.js",       // ESM consumers
    "default": "./dist/mod.js"       // Fallback
  }
}

Changes:

  • Updated all 25 packages with proper exports structure
  • Bumped patch version on each package (per Version Bump policy)
  • Updated AGENTS.md to document the new exports convention

Verification:

  • pnpm build
  • pnpm check
  • pnpm test ✓ (252 tests pass)
  • pnpm lint
  • pnpm fmt

Summary by CodeRabbit

  • Chores
    • Updated 26 packages with patch version increments and enhanced export configurations to support TypeScript type definitions and explicit ES module imports.

Ensures external TypeScript consumers can resolve types from compiled
.d.ts files when using customConditions. Previously, the development
condition resolved to .ts source files which caused compilation errors
for external consumers.

Updated all 25 packages with proper exports structure:
- types: ./dist/*.d.ts (TypeScript type resolution)
- development: ./*.ts (internal monorepo development)
- import: ./dist/*.js (ESM consumers)
- default: ./dist/*.js (fallback)
@taras taras force-pushed the fix/exports-types-condition branch from ff9a225 to e42dc72 Compare February 23, 2026 17:24
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

📝 Walkthrough

Walkthrough

This pull request updates package.json exports across 26 packages to explicitly define types and import export conditions alongside existing development and default conditions. Additionally, AGENTS.md documentation is updated to reflect the broadened export metadata requirements. Patch versions are incremented accordingly.

Changes

Cohort / File(s) Summary
Documentation
AGENTS.md
Updated documentation to reflect expanded package.json exports requirements, now mandating types, development, import, and default conditions.
Core Package Exports
bdd/package.json, chain/package.json, context-api/package.json, converge/package.json, deno-deploy/package.json, effect-ts/package.json, fetch/package.json, fs/package.json, fx/package.json, jsonl-store/package.json, process/package.json, raf/package.json, scope-eval/package.json, signals/package.json, stream-yaml/package.json, task-buffer/package.json, test-adapter/package.json, timebox/package.json, tinyexec/package.json, vitest/package.json, websocket/package.json, worker/package.json
Added types (pointing to ./dist/mod.d.ts) and import (pointing to ./dist/mod.js) export conditions to the root export entry. Bumped patch versions accordingly.
Multi-Path Package Exports
node/package.json
Added types and import export conditions to three export paths: "." (root), "./stream", and "./events", each pointing to corresponding distribution files. Bumped version from 0.2.1 to 0.2.2.
Multi-Path Package Exports
stream-helpers/package.json
Added types and import export conditions to two export paths: "." (root) and "./test-helpers", each pointing to corresponding distribution files. Bumped version from 0.8.0 to 0.8.1.
Multi-Path Package Exports
watch/package.json
Added types and import export conditions to two export paths: "." (pointing to ./dist/main.*) and "./lib" (pointing to ./dist/mod.*). Bumped version from 0.4.2 to 0.4.3.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • cowboyd
  • joshamaju

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Policy Compliance ❌ Error The pull request violates the Package.json Metadata Policy (Strict) by missing description fields in deno-deploy/package.json and fetch/package.json. Add description field to both deno-deploy/package.json and fetch/package.json following the policy format: active voice, single sentence, under 120 characters, no markdown or periods.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding types and import conditions to package exports across the codebase.
Description check ✅ Passed The description follows the template with both Motivation and Approach sections. It clearly explains the problem, solution, and verification steps performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/exports-types-condition

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 23, 2026

Open in StackBlitz

@effectionx/bdd

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/bdd@169

@effectionx/chain

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/chain@169

@effectionx/context-api

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/context-api@169

@effectionx/converge

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/converge@169

@effectionx/effect-ts

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/effect-ts@169

@effectionx/fetch

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/fetch@169

@effectionx/fs

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/fs@169

@effectionx/fx

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/fx@169

@effectionx/jsonl-store

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/jsonl-store@169

@effectionx/node

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/node@169

@effectionx/process

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/process@169

@effectionx/raf

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/raf@169

@effectionx/scope-eval

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/scope-eval@169

@effectionx/signals

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/signals@169

@effectionx/stream-helpers

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/stream-helpers@169

@effectionx/stream-yaml

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/stream-yaml@169

@effectionx/task-buffer

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/task-buffer@169

@effectionx/test-adapter

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/test-adapter@169

@effectionx/timebox

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/timebox@169

@effectionx/tinyexec

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/tinyexec@169

@effectionx/vitest

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/vitest@169

@effectionx/watch

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/watch@169

@effectionx/websocket

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/websocket@169

@effectionx/worker

npm i https://pkg.pr.new/thefrontside/effectionx/@effectionx/worker@169

commit: e42dc72

@taras taras merged commit e98a134 into main Feb 23, 2026
6 of 7 checks passed
@taras taras deleted the fix/exports-types-condition branch February 23, 2026 17:31
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
fetch/package.json (1)

1-35: ⚠️ Potential issue | 🔴 Critical

Missing description field — strict policy violation.

fetch/package.json has no description field. The package metadata policy requires a non-empty description (single sentence, under 120 chars, no Markdown, no trailing period). This is classified as a strict/blocking violation.

🛠️ Proposed fix
 {
   "name": "@effectionx/fetch",
+  "description": "Fetch API wrapper for making HTTP requests as Effection operations",
   "version": "0.1.1",

As per coding guidelines: "every published package must include a non-empty description field" and "Strict policy violations must be treated as blocking."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@fetch/package.json` around lines 1 - 35, The package.json for the fetch
package is missing the required description field; add a non-empty "description"
property to the JSON root (in the same object that contains "name", "version",
"main", etc.) with a single-sentence summary under 120 characters, no Markdown
and no trailing period (e.g. succinctly describe `@effectionx/fetch` purpose),
then run any package validation to ensure the strict policy violation is
resolved.
deno-deploy/package.json (1)

1-32: ⚠️ Potential issue | 🟠 Major

Missing description field — blocking policy violation.

deno-deploy/package.json has no description field. Per the package-json-metadata policy (strict), every published package must include a non-empty description (single sentence, ≤120 chars, no Markdown, no trailing period). Strict violations are treated as blocking.

Additionally: since "deprecated": "This package is Deno-specific and no longer actively maintained." is already present, consider whether this package needs to be included in the exports fix at all, or whether it should be unpublished/archived instead.

📝 Proposed fix — add a description
 {
   "name": "@effectionx/deno-deploy",
+  "description": "Effection-based integration for Deno Deploy deployment workflows",
   "version": "0.4.1",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@deno-deploy/package.json` around lines 1 - 32, Add a non-empty description
field to package.json (a single plain-sentence ≤120 characters, no Markdown, no
trailing period) to satisfy the package-json-metadata policy; update the
top-level object by inserting "description": "..." and ensure the text follows
the rules, and also re-evaluate whether the package should remain published
given the existing "deprecated": "This package is Deno-specific and no longer
actively maintained." message (if you plan to keep it published, add the
description; if not, consider unpublishing/archiving instead).
node/package.json (1)

1-48: ⚠️ Potential issue | 🟡 Minor

Missing required files field.

Same issue as timebox/package.jsonfiles is absent. For @effectionx/node this is especially worth fixing because the package exposes three subpath sources (mod.ts, stream.ts, events.ts) that all need to be listed.

📦 Proposed fix
   "sideEffects": false,
+  "files": [
+    "dist",
+    "mod.ts",
+    "stream.ts",
+    "events.ts"
+  ],
   "devDependencies": {

Based on learnings: "package.json must include files field containing dist, mod.ts, and source files."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@node/package.json` around lines 1 - 48, Add a "files" array to the
package.json for `@effectionx/node` listing the published artifacts and source
entry points so the package includes the compiled dist and the exposed subpath
sources; include "dist", "mod.ts", "stream.ts", and "events.ts" (and any other
source files that must be published) so the exports (".", "./stream",
"./events") resolve correctly when the package is installed.
timebox/package.json (1)

1-36: ⚠️ Potential issue | 🟡 Minor

Missing required files field.

The files field is absent. Without it, npm publishes every file in the package directory rather than the intentional subset (dist, mod.ts, source files).

📦 Proposed fix
   "sideEffects": false,
+  "files": [
+    "dist",
+    "mod.ts"
+  ],
   "devDependencies": {

Based on learnings: "package.json must include files field containing dist, mod.ts, and source files."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@timebox/package.json` around lines 1 - 36, Add a "files" array to
package.json listing the intended published artefacts so npm will only publish
those (e.g. include "dist", "mod.ts" and your source directory/files such as
"src" or whatever source folder is used). Update the package.json top-level
object to include "files": ["dist","mod.ts","src"] (adjust "src" to the actual
source folder name if different) and ensure the entries match the built output
and source you want published.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@deno-deploy/package.json`:
- Around line 1-32: Add a non-empty description field to package.json (a single
plain-sentence ≤120 characters, no Markdown, no trailing period) to satisfy the
package-json-metadata policy; update the top-level object by inserting
"description": "..." and ensure the text follows the rules, and also re-evaluate
whether the package should remain published given the existing "deprecated":
"This package is Deno-specific and no longer actively maintained." message (if
you plan to keep it published, add the description; if not, consider
unpublishing/archiving instead).

In `@fetch/package.json`:
- Around line 1-35: The package.json for the fetch package is missing the
required description field; add a non-empty "description" property to the JSON
root (in the same object that contains "name", "version", "main", etc.) with a
single-sentence summary under 120 characters, no Markdown and no trailing period
(e.g. succinctly describe `@effectionx/fetch` purpose), then run any package
validation to ensure the strict policy violation is resolved.

In `@node/package.json`:
- Around line 1-48: Add a "files" array to the package.json for `@effectionx/node`
listing the published artifacts and source entry points so the package includes
the compiled dist and the exposed subpath sources; include "dist", "mod.ts",
"stream.ts", and "events.ts" (and any other source files that must be published)
so the exports (".", "./stream", "./events") resolve correctly when the package
is installed.

In `@timebox/package.json`:
- Around line 1-36: Add a "files" array to package.json listing the intended
published artefacts so npm will only publish those (e.g. include "dist",
"mod.ts" and your source directory/files such as "src" or whatever source folder
is used). Update the package.json top-level object to include "files":
["dist","mod.ts","src"] (adjust "src" to the actual source folder name if
different) and ensure the entries match the built output and source you want
published.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eedaf26 and e42dc72.

📒 Files selected for processing (26)
  • AGENTS.md
  • bdd/package.json
  • chain/package.json
  • context-api/package.json
  • converge/package.json
  • deno-deploy/package.json
  • effect-ts/package.json
  • fetch/package.json
  • fs/package.json
  • fx/package.json
  • jsonl-store/package.json
  • node/package.json
  • process/package.json
  • raf/package.json
  • scope-eval/package.json
  • signals/package.json
  • stream-helpers/package.json
  • stream-yaml/package.json
  • task-buffer/package.json
  • test-adapter/package.json
  • timebox/package.json
  • tinyexec/package.json
  • vitest/package.json
  • watch/package.json
  • websocket/package.json
  • worker/package.json

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.

1 participant