infinitered / gluegun

A delightful toolkit for building TypeScript-powered command-line apps.
MIT License
2.93k stars 147 forks source link

Support request: How to Plugins typescript #777

Closed khusseini closed 1 year ago

khusseini commented 1 year ago

Hi there,

I wanted to build some plugins for my cli application and I created a project in typescript. In the file extensions/my-extension.ts I do

import { GluegunToolbox } from "gluegun"

export default function attach(toolbox: GluegunToolbox) {
  console.log(toolbox.commandName);
}

in my cli project I install my newly created plugin. It seems to me that the extension is not loaded as the console.log does not appear anywhere. Does anyone have an example on how to create plugins in typescript?

khusseini commented 1 year ago

I just found my problem, I didn't have a correct path set for loading the plugins in my cli configuration.