Skip to content

plugin-autocomplete does not support bundling #846

Open
@sergei-dyshel

Description

@sergei-dyshel

I tried to modify https://github.com/oclif/plugin-test-esbuild to use https://github.com/oclif/plugin-autocomplete to be able to generate completion for bundled scripts.

The example already uses https://github.com/oclif/plugin-plugins in the following way (https://github.com/oclif/plugin-test-esbuild/blob/main/src/index.ts#L13-L15):

import * as PluginPlugins from '@oclif/plugin-plugins'
export const COMMANDS: Record<string, Command.Class> = {
  ...PluginPlugins.commands,
...

However this doesn't work with plug-autocomplete because it doesn't export any commands, as can be seen here: https://github.com/oclif/plugin-autocomplete/blob/main/src/index.ts.

Wondering if it's done on purpose, or we can change it something like

import Index from './commands/autocomplete'
import Create from './commands/autocomplete/create'
import Script from './commands/autocomplete/script'

export const commands = {
  autocomplete: Index,
  'autocomplete:create': Create,
  'autocomplete:script': Script,
}

export {default as hook} from './hooks/refresh-cache'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions