eliza icon indicating copy to clipboard operation
eliza copied to clipboard

Create Example Files Under `packages/_examples/*` with Corresponding Tests Under `/*/_tests` Within Each Type: Adapter, Client, Plugin, etc.

Open monilpat opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe.
There is currently no clear organization for example implementations and their corresponding tests for constructs like adapters, clients, and plugins. This can lead to confusion, inconsistent patterns, and inefficiencies for developers trying to reference or contribute.


Describe the solution you'd like
Structure the examples and tests as follows:

  1. Example files go under packages/_examples/* within their respective construct folders.
  2. Corresponding tests are organized under a _tests subfolder inside each type directory.

Proposed Structure:

packages/_examples/
  ├── adapter/
  │   ├── exampleAdapter.js
  │   └── _tests/
  │       └── exampleAdapter.test.js
  ├── client/
  │   ├── exampleClient.js
  │   └── _tests/
  │       └── exampleClient.test.js
  ├── plugin/
  │   ├── examplePlugin.js
  │   └── _tests/
  │       └── examplePlugin.test.js
  └── README.md  // High-level description of examples

Describe alternatives you've considered

  1. Tests alongside examples: Keeping tests in the same folder creates clutter, especially as examples scale.
  2. Central _tests folder: While centralized tests are clean, separating them under each type folder improves organization and traceability.

Additional context

  • This structure creates a clear relationship between example files and their tests.
  • Developers can easily locate both the example implementation and corresponding tests for constructs like adapters, clients, and plugins.
  • A high-level README.md in packages/_examples/ can document the folder's purpose and how to use the examples.

monilpat avatar Dec 15 '24 00:12 monilpat