{"id":25113,"library":"concordialang-plugin","title":"Concordialang Plugin","description":"TypeScript interface for building Concordia Compiler plug-ins (v1.3.2). This package defines the Plugin interface and related types that must be implemented by any Concordia plug-in. It is released on npm with monthly updates. Compared to direct compiler extension, it provides a standardized API for code generation and test execution. ESM-only, requires Node >=12.20, and ships TypeScript declarations.","status":"active","version":"1.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/thiagodp/concordialang-plugin","tags":["javascript","concordialang","concordia-lang","concordia","compiler","plugin","plug-in","api","test","typescript"],"install":[{"cmd":"npm install concordialang-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add concordialang-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add concordialang-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Plugin is a named export (interface). There is no default export.","wrong":"import Plugin from 'concordialang-plugin'","symbol":"Plugin","correct":"import { Plugin } from 'concordialang-plugin'"},{"note":"Package is ESM-only; require() will fail. Use dynamic import or ESM context.","wrong":"const { TestScriptGenerationOptions } = require('concordialang-plugin')","symbol":"TestScriptGenerationOptions","correct":"import { TestScriptGenerationOptions } from 'concordialang-plugin'"},{"note":"Named export, same as others.","wrong":null,"symbol":"TestScriptExecutionOptions","correct":"import { TestScriptExecutionOptions } from 'concordialang-plugin'"}],"quickstart":{"code":"import { Plugin, TestScriptGenerationOptions, TestScriptGenerationResult, TestScriptExecutionOptions, TestScriptExecutionResult } from 'concordialang-plugin';\n\nexport default class MyPlugin implements Plugin {\n  serveCommand?: string;\n\n  async generateCode(\n    abstractTestScripts: any[],\n    options: TestScriptGenerationOptions\n  ): Promise<TestScriptGenerationResult> {\n    // Generate test code from abstract scripts\n    return { generatedFiles: [] };\n  }\n\n  async executeCode(\n    options: TestScriptExecutionOptions\n  ): Promise<TestScriptExecutionResult> {\n    // Run the tests\n    return { success: true, output: '' };\n  }\n}","lang":"typescript","description":"Example of a minimal plugin class implementing the Plugin interface with generateCode and executeCode methods."},"warnings":[{"fix":"Update your plugin implementation to match the new interfaces.","message":"v1.0.0 introduced a new API that is incompatible with earlier versions.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure you implement at least generateCode and/or executeCode as needed; omit serveCommand if not required.","message":"The Plugin interface members are optional. If not implemented, the corresponding step will be skipped.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If using the options object, check for new/changed properties.","message":"Properties 'heal' in TestScriptExecutionOptions was added in v1.3.0; previously unused properties were renamed.","severity":"deprecated","affected_versions":">=1.3.0"},{"fix":"Use import syntax or dynamic import(). Set { 'type': 'module' } in your package.json if needed.","message":"Package is ESM-only; require() fails with error 'ERR_REQUIRE_ESM'.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install 'concordialang-types' as a dependency: npm i concordialang-types","message":"Requires 'concordialang-types' as a peer dependency for type definitions.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import or dynamic import. For CommonJS, use async import() or switch to ESM.","cause":"This package is ESM-only and cannot be loaded with require().","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/concordialang-plugin not supported."},{"fix":"Add 'export default class MyPlugin implements Plugin'","cause":"Forgetting to use default export for plugin class.","error":"TypeError: MyPlugin is not a constructor"},{"fix":"Update to concordialang-plugin >=1.3.0.","cause":"Using a version earlier than 1.3.0 where 'heal' was added.","error":"Property 'heal' does not exist on type 'TestScriptExecutionOptions'"},{"fix":"Install it: npm i concordialang-types","cause":"Missing peer dependency 'concordialang-types'.","error":"Cannot find module 'concordialang-types' or its corresponding type declarations."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}