Skip to content

Plugins - External Package Plugin Support #1

Description

@epicdigitalmedia

New Feature / Enhancement Checklist

Current Limitation

Current version only supports importing functions from the functionDirectory configuration.

Feature / Enhancement Description

I would like to maintain separate packages for specific function implementations, eg: Stripe, Gigwage. The function package would include a folder structure which would be processed similar to the functionDirectory in the local project.

Example Use Case

The plugin be imported from the external package and would accept an optional configuration argument:

import StripeFunctions from '@epicdm/parse-functions-stripe';
import GigwageFunctions from '@epicdm/parse-functions-gigwage';

{
  functionDirectory: 'src/functions', // the directory to watch & build Parse functions
  moduleAlias: '@@functions', // the alias name used for importing the built files
                              // from, e.g. `import initialize, { ClassNames } from '@@functions';`
  plugins: [
    StripeFunctions({ appId: "", appSecret: "", }),
    GigwageFunctions(),
  ]
}

Alternatives / Workarounds

Current workaround would be to maintain a package and copy the folder into the functionDirectory.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions