wormaworma

Built-in Plugins

Usage of all built-in plugins, including importType, aiDoc, swagger/knife4j/yapi/apifox, rename, tagModifier, and more

worma ships the following preset plugins, configured in order within the plugins array.

PluginDescriptionDocs
Template pluginsalova / alovaGlobals / axios / fetch / ky templatesPredefined Templates
renameRename API call functions and parameter names, with multiple naming stylesDetails
tagModifierChange an API's tag nameDetails
payloadModifierAdd, remove, and modify an API's parameter types, with tag/path filtering and response unwrappingDetails
apiFilterFilter APIs by URL and tagDetails
swagger / knife4j / yapi / apifoxAuto-build or pull each platform's OpenAPI file URL (YApi needs a cookie; Apifox needs projectId and an access token)Details
importTypeReuse external types and exclude them from auto-generationDetails
aiDocGenerate AI Skill docsSee AI Skills Integration

Template plugins

The five predefined templates (alova, alovaGlobals, axios, fetch, ky) are now provided as plugins. Each template plugin returns the template path via its getTemplate hook:

import { defineConfig } from 'wormajs';
import { alova, alovaGlobals, axios, fetch, ky } from 'wormajs/plugin';

export default defineConfig({
  generator: [
    {
      // Use the alova functional template
      plugins: [alova({ framework: 'vue' })],
    },
  ],
});

See Predefined Templates for details.

Plugin ordering

Plugins run in the order they appear in the plugins array:

import { defineConfig } from 'wormajs';
import {
  rename, tagModifier, payloadModifier, apiFilter, apifox, importType,
  alova, swagger
} from 'wormajs/plugin';
import { aiDoc } from 'wormajs/plugin';

export default defineConfig({
  generator: [
    {
      plugins: [
        swagger('https://petstore3.swagger.io'),
        rename({ style: 'camelCase' }),
        tagModifier(tag => `api_${tag}`),
        payloadModifier([/* ... */]),
        apiFilter({ include: '/api/v1' }),
        importType({ 'my-types|type': ['Pagination'] }),
        alova(),
        aiDoc(),
      ],
    },
  ],
});

On this page