Skip to content

fix: move ep_ai_core from peerDependencies to dependencies#34

Merged
JohnMcLear merged 1 commit into
mainfrom
fix/move-ep-ai-core-to-dependencies
Jun 2, 2026
Merged

fix: move ep_ai_core from peerDependencies to dependencies#34
JohnMcLear merged 1 commit into
mainfrom
fix/move-ep-ai-core-to-dependencies

Conversation

@JohnMcLear

Copy link
Copy Markdown
Member

ep_ai_core is a hard runtime dependency (required at startup via require('ep_ai_core/index')). As a peerDependency it was not auto-installed, causing a MODULE_NOT_FOUND crash when users ran pnpm run plugins i ep_ai_chat.

Users had to manually install ep_ai_core separately with no indication of the issue. Moving it to dependencies ensures it is installed automatically.

This was reported in #33 where a user couldn't get the plugin working after installation.

ep_ai_core is a hard runtime dependency (required at startup via
require('ep_ai_core/index')). As a peerDependency it was not auto-
installed, causing a MODULE_NOT_FOUND crash when users ran:

  pnpm run plugins i ep_ai_chat

Users had to manually install ep_ai_core separately with no
indication. Moving it to dependencies ensures it is installed
automatically.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Review Summary by Qodo

Move ep_ai_core to dependencies for automatic installation

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Move ep_ai_core from peerDependencies to dependencies
• Fixes MODULE_NOT_FOUND crash on plugin installation
• Ensures automatic installation of required runtime dependency
• Resolves issue where users had to manually install ep_ai_core
Diagram
flowchart LR
  A["peerDependencies<br/>ep_ai_core"] -->|"move to"| B["dependencies<br/>ep_ai_core"]
  B -->|"ensures"| C["Auto-installed<br/>on plugin install"]
  C -->|"prevents"| D["MODULE_NOT_FOUND<br/>crash"]

Loading

Grey Divider

File Changes

1. package.json 🐞 Bug fix +3/-1

Move ep_ai_core to dependencies section

• Moved ep_ai_core from peerDependencies to new dependencies section
• Kept version constraint as >=0.0.1
• Maintained ep_comments_page as optional peer dependency

package.json


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jun 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Context used

Grey Divider


Action required

1. Overbroad version range 🐞 Bug ☼ Reliability
Description
package.json sets ep_ai_core to ">=0.0.1", which allows any future major version and can introduce
breaking API changes that crash the plugin at startup when it requires ep_ai_core/index. Because the
require happens at module load time, incompatibility will surface as an immediate startup failure
rather than a recoverable runtime error.
Code

package.json[R20-22]

Evidence
The dependency range is unbounded upward, and the code requires ep_ai_core at module load, making
version/API mismatches a startup crash.

package.json[17-25]
index.js[1-10]
contextBuilder.js[1-8]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`ep_ai_core` is declared as a runtime dependency but the range is `>=0.0.1`, which can resolve to any future version (including major) and break `require('ep_ai_core/index')` at startup.

## Issue Context
`ep_ai_core` is required during module initialization in multiple files, so incompatibility is a hard failure.

## Fix Focus Areas
- package.json[20-25]

## Suggested change
Change the version specifier to a bounded compatible range (pick one based on your compatibility policy):
- Prefer `^0.0.1` (or another known-good minimum) if you follow semver compatibility.
- Or pin an exact version if the API is unstable.
- Or use `<1.0.0` upper bound if you want to accept all 0.x but not 1.x+ (example: `">=0.0.1 <1"`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Advisory comments

2. Install docs may mislead 🐞 Bug ⚙ Maintainability
Description
README still instructs users to install ep_ai_core separately, but after moving ep_ai_core into
dependencies that step may be redundant and can confuse users about the supported installation flow.
This inconsistency increases the chance of users following outdated guidance or reporting
already-fixed setup problems.
Code

package.json[R20-25]

Evidence
README explicitly says ep_ai_core is required and shows an install command that includes it, while
package.json now declares ep_ai_core as a dependency (implying auto-install via the package
manager).

README.md[10-20]
package.json[20-25]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Documentation still says to install `ep_ai_core` explicitly, but `ep_ai_core` is now declared as a direct dependency of this plugin.

## Issue Context
Depending on how Etherpad's plugin installer handles transitive deps, the explicit install step may now be redundant; at minimum it should be clarified to match the new packaging intent.

## Fix Focus Areas
- README.md[10-20]
- package.json[20-25]

## Suggested change
Update the README Installation section to reflect the intended/required command(s) after this dependency change (for example, install only `ep_ai_chat`, or clarify when explicit `ep_ai_core` installation is still necessary for Etherpad plugin discovery).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread package.json
Comment on lines +20 to +22
"dependencies": {
"ep_ai_core": ">=0.0.1"
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Overbroad version range 🐞 Bug ☼ Reliability

package.json sets ep_ai_core to ">=0.0.1", which allows any future major version and can introduce
breaking API changes that crash the plugin at startup when it requires ep_ai_core/index. Because the
require happens at module load time, incompatibility will surface as an immediate startup failure
rather than a recoverable runtime error.
Agent Prompt
## Issue description
`ep_ai_core` is declared as a runtime dependency but the range is `>=0.0.1`, which can resolve to any future version (including major) and break `require('ep_ai_core/index')` at startup.

## Issue Context
`ep_ai_core` is required during module initialization in multiple files, so incompatibility is a hard failure.

## Fix Focus Areas
- package.json[20-25]

## Suggested change
Change the version specifier to a bounded compatible range (pick one based on your compatibility policy):
- Prefer `^0.0.1` (or another known-good minimum) if you follow semver compatibility.
- Or pin an exact version if the API is unstable.
- Or use `<1.0.0` upper bound if you want to accept all 0.x but not 1.x+ (example: `">=0.0.1 <1"`).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@JohnMcLear JohnMcLear merged commit 2e15376 into main Jun 2, 2026
3 checks passed
JohnMcLear added a commit that referenced this pull request Jun 2, 2026
Drop the manual ep_ai_core pre-install from both backend-tests and frontend-tests so CI walks the same path a user does (`pnpm run plugins i ep_ai_chat`). ep_ai_core now resolves via "dependencies"; a regression back to peerDependencies fails the frontend job, which runs on same-repo PRs. README install command simplified accordingly. Follow-up to #34 (closed #33).
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant