mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-20 16:47:59 +02:00
Root package.json declared no main or exports, so OpenCode npm plugin resolution (import.meta.resolve) failed and the plugin was silently skipped (#3127). The .opencode TypeScript sources imported siblings with .js specifiers that only exist after compilation, so the home install, which loads the .ts files in place, crashed the tool registry with ERR_MODULE_NOT_FOUND (#3112). Declare main/types/exports on the root package pointing at the compiled plugin entry, switch the sources to .ts specifiers, and enable allowImportingTsExtensions with rewriteRelativeImportExtensions so the emitted dist keeps working .js specifiers. Add smoke tests that build the package, resolve and import the entry by name from a temp install, and verify every in-place relative import resolves. Fixes #3127 Fixes #3112
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
/**
|
|
* ECC Plugin for OpenCode
|
|
*
|
|
* This package provides the published ECC OpenCode plugin module:
|
|
* - Plugin hooks (auto-format, TypeScript check, console.log warning, env injection, etc.)
|
|
* - Custom tools (run-tests, check-coverage, security-audit, format-code, lint-check, git-summary)
|
|
* - Bundled reference config/assets for the wider ECC OpenCode setup
|
|
*
|
|
* Usage:
|
|
*
|
|
* Option 1: Install via npm
|
|
* ```bash
|
|
* npm install ecc-universal
|
|
* ```
|
|
*
|
|
* Then add to your opencode.json:
|
|
* ```json
|
|
* {
|
|
* "plugin": ["ecc-universal"]
|
|
* }
|
|
* ```
|
|
*
|
|
* That enables the published plugin module only. For ECC commands, agents,
|
|
* prompts, and instructions, use this repository's `.opencode/opencode.json`
|
|
* as a base or copy the bundled `.opencode/` assets into your project.
|
|
*
|
|
* Option 2: Clone and use directly
|
|
* ```bash
|
|
* git clone https://github.com/affaan-m/ECC
|
|
* cd ECC
|
|
* opencode
|
|
* ```
|
|
*
|
|
* @packageDocumentation
|
|
*/
|
|
|
|
// Export the main plugin
|
|
// opencode's legacy plugin loader iterates every module export and throws if
|
|
// any is not a plugin function, so only the plugin function may be exported.
|
|
export { default } from "./plugins/index.ts"
|