8000 fix: cleanup and fix configs package by ChristopherTrimboli · Pull Request #5524 · elizaOS/eliza · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: cleanup and fix configs package #5524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 11, 2025
Merged

Conversation

ChristopherTrimboli
Copy link
Member
@ChristopherTrimboli ChristopherTrimboli commented Jul 11, 2025

🧹 Config Package Cleanup and Documentation Update

This PR addresses several issues found in the @elizaos/config package and brings it up to standard with proper documentation.

Changes Made:

1. Fixed Missing Build Exports

  • Removed references to non-existent build/ directory from index.ts and index.d.ts
  • The package was trying to export build configurations that didn't exist in the source

2. Corrected Package Name References

  • Fixed configPaths exports that incorrectly referenced @elizaos/core instead of @elizaos/config
  • Note: These were later updated to @elizaos/configs per user preference

3. Replaced Incorrect README

  • The README was a complete copy of the plugin-starter template 🤦
  • Created proper documentation that actually describes what this config package does:
    • Shared TypeScript, ESLint, and Prettier configurations
    • Usage examples for each config type
    • Proper installation and setup instructions

4. Cleaned Up tsup Configuration

  • Removed non-existent entry points (src/specs/v1/*.ts, src/specs/v2/index.ts)
  • Removed unnecessary external dependencies (like @solana/web3.js, sharp, zod)
  • Simplified build config appropriate for a configuration package:
    • bundle: false - this package just re-exports configs
    • minify: false - keep exported paths readable

5. Updated TypeScript Paths

  • Removed references to non-existent packages in tsconfig.base.json:
    • @elizaos/agent, @elizaos/api-service, @elizaos/plugin-autocoder, etc.
  • Only kept packages that actually exist in eliza/packages/

Issues Found But Not Fixed:

  1. Missing tsup dependency: The package.json has "build": "tsup" but doesn't list tsup in devDependencies
  2. Build necessity unclear: The package exports point directly to src/ files, but main/module/types point to dist/. Consider if this package even needs a build step.

Testing:

  • Verify configs can be imported correctly from other packages
  • Ensure build process works after adding tsup dependency
  • Test that TypeScript path resolution works with the updated paths

This cleanup ensures the config package is properly documented and doesn't reference non-existent code, making it easier for developers to understand and use the shared configurations across the ElizaOS ecosystem.

Copy link
Contributor
coderabbitai bot commented Jul 11, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-configs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
claude bot commented Jul 11, 2025

Claude finished @ChristopherTrimboli's task —— View job


ElizaOS PR Review - Configs Package Cleanup

Review Summary

This PR properly cleans up the configs package by converting it from a generic plugin template to a proper configuration package. The changes are mostly well-structured and align with ElizaOS patterns.

APPROVED CHANGES

Package Configuration (packages/config/package.json):

  • ✅ Properly updated metadata (author, repository, homepage, bugs)
  • ✅ Correct license change from "UNLICENSED" to "MIT"
  • ✅ Added tsup build script using bun (monorepo compliance)
  • ✅ Removed plugin-specific agentConfig section
  • ✅ Clean dependency structure with only dev dependencies

Documentation (packages/config/README.md):

  • ✅ Complete rewrite from generic plugin template to proper config package docs
  • ✅ Clear usage examples for TypeScript, ESLint, and Prettier configurations
  • ✅ Proper installation instructions using bun add -d @elizaos/config
  • ✅ Well-documented exports and configuration paths

Build Configuration (packages/config/tsup.config.ts):

  • ✅ Appropriate tsup configuration for a config package
  • ✅ ESM format with proper TypeScript declaration generation
  • ✅ Correct decision to not bundle (just re-exports configs)
  • ✅ References correct tsconfig.build.json

Code Updates:

  • ✅ Removed build config exports from packages/config/src/index.ts
  • ✅ Properly synchronized type definitions in index.d.ts
  • ✅ All referenced configuration files exist in the codebase
  • ✅ Updated TypeScript path mappings in tsconfig.base.json

Lock File (bun.lock):

  • ✅ Proper workspace dependency addition
  • ✅ Minor Node.js type version updates (24.0.12 → 24.0.13)

⚠️ CRITICAL ISSUES REQUIRING FIXES

1. Missing Test Coverage:

  • NO TESTS FOUND - The package has zero test coverage
  • ❌ According to ElizaOS principles: "CODE WITHOUT TEST COVERAGE IS PROBABLY BROKEN"
  • ❌ This config package exports critical configurations that could break other packages

2. Path Inconsistencies:

  • packages/config/src/index.ts:27-30 - Config paths reference @elizaos/configs but package name is @elizaos/config
  • ❌ This mismatch will cause import failures when using configPaths

3. Invalid Build Config References:

  • packages/config/src/index.ts:32-35 - References non-existent build configs
  • ❌ These paths don't exist and will cause runtime errors

🔧 REQUIRED CHANGES

  1. Fix Package Name References:

    // packages/config/src/index.ts:27-30
    - base: '@elizaos/configs/typescript/tsconfig.base.json',
    + base: '@elizaos/config/typescript/tsconfig.base.json',
  2. Remove Invalid Build Config References:

    // packages/config/src/index.ts:32-35 - Remove this entire section:
    // build: {
    //   plugin: '@elizaos/configs/build/build.config.plugin.ts',
    //   script: '@elizaos/configs/build/build.plugin.ts',
    // },
  3. Add Test Coverage:

    // Add tests to verify:
    // - Config exports work correctly
    // - TypeScript configs compile properly  
    // - ESLint configs are valid
    // - Prettier configs format correctly

🚨 SECURITY REVIEW

  • ✅ No exposed credentials or API keys
  • ✅ No suspicious code patterns
  • ✅ No external API calls
  • ✅ All file changes are legitimate configuration updates

📋 RECOMMENDATIONS

  1. Add Integration Tests: Test that configs work when consumed by other packages
  2. Add Build Verification: Ensure bun run build produces correct output
  3. Consider removing manual index.d.ts: Let tsup generate it automatically

VERDICT: ⚠️ CHANGES REQUIRED - This PR cannot be approved until path references are fixed and test coverage is added. The fixes are straightforward but critical for proper functionality.


cursor[bot]

This comment was marked as outdated.

@ChristopherTrimboli ChristopherTrimboli changed the title fixL cleanup and fix configs package fix: cleanup and fix configs package Jul 11, 2025
@ChristopherTrimboli ChristopherTrimboli merged commit 9ad4ce0 into feat/add-configs Jul 11, 2025
4 of 5 checks passed
@ChristopherTrimboli ChristopherTrimboli deleted the fix-configs branch July 11, 2025 02:28
Copy link
@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Exported Configurations Missing from Build

The package.json exports field points to individual configuration files in src/. However, the files field was changed to only include dist/, and the tsup build configuration only processes src/index.ts without bundling. As a result, the exported configuration files are neither built into nor included in the dist/ directory, leading to import failures in the published package.

packages/config/package.json#L25-L37

},
"exports": {
"./eslint/eslint.config.plugin.js": "./src/eslint/eslint.config.plugin.js",
"./eslint/eslint.config.base.js": "./src/eslint/eslint.config.base.js",
"./eslint/eslint.config.frontend.js": "./src/eslint/eslint.config.frontend.js",
"./prettier/prettier.config.js": "./src/prettier/prettier.config.js",
"./typescript/tsconfig.base.json": "./src/typescript/tsconfig.base.json",
"./typescript/tsconfig.plugin.json": "./src/typescript/tsconfig.plugin.json",
"./typescript/tsconfig.frontend.json": "./src/typescript/tsconfig.frontend.json",
"./typescript/tsconfig.test.json": "./src/typescript/tsconfig.test.json"
},
"files": [
"dist"

packages/config/tsup.config.ts#L3-L4

export default defineConfig({
entry: ['src/index.ts'],

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

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
0