fix: add types and import conditions to package exports#169
Conversation
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)
ff9a225 to
e42dc72
Compare
📝 WalkthroughWalkthroughThis pull request updates package.json exports across 26 packages to explicitly define Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
@effectionx/bdd
@effectionx/chain
@effectionx/context-api
@effectionx/converge
@effectionx/effect-ts
@effectionx/fetch
@effectionx/fs
@effectionx/fx
@effectionx/jsonl-store
@effectionx/node
@effectionx/process
@effectionx/raf
@effectionx/scope-eval
@effectionx/signals
@effectionx/stream-helpers
@effectionx/stream-yaml
@effectionx/task-buffer
@effectionx/test-adapter
@effectionx/timebox
@effectionx/tinyexec
@effectionx/vitest
@effectionx/watch
@effectionx/websocket
@effectionx/worker
commit: |
There was a problem hiding this comment.
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 | 🔴 CriticalMissing
descriptionfield — strict policy violation.
fetch/package.jsonhas nodescriptionfield. 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
descriptionfield" 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 | 🟠 MajorMissing
descriptionfield — blocking policy violation.
deno-deploy/package.jsonhas nodescriptionfield. Per the package-json-metadata policy (strict), every published package must include a non-emptydescription(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 | 🟡 MinorMissing required
filesfield.Same issue as
timebox/package.json—filesis absent. For@effectionx/nodethis 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
filesfield containingdist,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 | 🟡 MinorMissing required
filesfield.The
filesfield 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
filesfield containingdist,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
📒 Files selected for processing (26)
AGENTS.mdbdd/package.jsonchain/package.jsoncontext-api/package.jsonconverge/package.jsondeno-deploy/package.jsoneffect-ts/package.jsonfetch/package.jsonfs/package.jsonfx/package.jsonjsonl-store/package.jsonnode/package.jsonprocess/package.jsonraf/package.jsonscope-eval/package.jsonsignals/package.jsonstream-helpers/package.jsonstream-yaml/package.jsontask-buffer/package.jsontest-adapter/package.jsontimebox/package.jsontinyexec/package.jsonvitest/package.jsonwatch/package.jsonwebsocket/package.jsonworker/package.json
Motivation
External TypeScript consumers using
customConditions: ["development"]were unable to properly resolve types from@effectionx/*packages. Thedevelopmentexport condition pointed to.tssource files, which works within this monorepo but causes compilation errors for external consumers who expect compiled artifacts.This issue manifested when
@effectionx/scope-evalwas used as a dependency - the consuming project had to overridecustomConditions: []as a workaround.Approach
Added explicit
typesandimportconditions to all 25 package exports. The new structure ensures:Changes:
Verification:
pnpm build✓pnpm check✓pnpm test✓ (252 tests pass)pnpm lint✓pnpm fmt✓Summary by CodeRabbit