You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(plugins): add --from flag to load plugin command (#5)
* feat(plugins): add --from flag to load plugin command
- Add --from flag to load plugins from any URL (npm, file://, https://, git://)
- Enforce exclusive usage of package name vs --from flag
- Update help text and documentation with new functionality
- Add examples for loading plugins from various sources
- Adhere to npm standards by wrapping npm install directly
Commands are now mutually exclusive:
- c8 load plugin <name> (from npm registry)
- c8 load plugin --from <url> (from any valid URL)
Refs: Plugin system enhancement
* refactor(plugins): remove metadata export requirement
- Plugins now only need to export commands object
- Remove metadata validation from listPlugins
- Simplify plugin detection to check for c8ctl-plugin.js/ts file
- Update all tests to remove metadata checks
- Update documentation and examples
This simplifies plugin development by removing unnecessary boilerplate.
# (assuming the plugin exports an 'analyze' command)
365
370
c8 analyze
@@ -381,7 +386,7 @@ c8 list plugins
381
386
382
387
**Plugin Development:**
383
388
384
-
Plugins should include a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file that exports custom commands. The `c8ctl` runtime object provides environment information:
389
+
Plugins must be regular Node.js modules with a `c8ctl-plugin.js` or `c8ctl-plugin.ts` file in the root directory. The plugin file must export a `commands` object. The `c8ctl` runtime object provides environment information:
0 commit comments