Plugin Development
Plugins extend StackSolo with new resource types and providers.
Plugin Structure
Section titled “Plugin Structure”my-plugin/├── package.json├── tsconfig.json├── tsup.config.ts└── src/ ├── index.ts # Plugin entry point └── resources/ └── my-resource.tsPlugin Interface
Section titled “Plugin Interface”import { StackSoloPlugin } from '@stacksolo/core';import { myResource } from './resources/my-resource';
const plugin: StackSoloPlugin = { name: 'my-plugin', version: '0.1.0', resources: [myResource],};
export default plugin;Resource Definition
Section titled “Resource Definition”import { defineResource } from '@stacksolo/core';
export const myResource = defineResource({ id: 'my-plugin:my-resource', name: 'My Resource',
configSchema: { type: 'object', properties: { name: { type: 'string' }, // ... JSON Schema }, required: ['name'], },
generate(config, context) { return { imports: ['import { Something } from "cdktf"'], code: `new Something(stack, '${config.name}', { ... })`, outputs: ['url'], }; },});Build Configuration
Section titled “Build Configuration”import { defineConfig } from 'tsup';
export default defineConfig({ entry: ['src/index.ts'], format: ['esm'], target: 'node18', external: ['@stacksolo/core'], dts: true,});Package Setup
Section titled “Package Setup”{ "name": "@my-org/stacksolo-plugin-example", "type": "module", "main": "dist/index.js", "peerDependencies": { "@stacksolo/core": "^0.1.0" }}Using Your Plugin
Section titled “Using Your Plugin”{ "project": { "plugins": ["@my-org/stacksolo-plugin-example"], "networks": [{ "myResources": [{ "name": "example" }] }] }}