Registry / type-stubs / concordialang-plugin

concordialang-plugin

JSON →
library1.3.2jsnpmunverified

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.

npm install concordialang-plugin
INSTALL
IMPORT
SIG · CONCORDIALANG-PLUG
C
concordialang-plugin
type-stubsjavascriptv1.3.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Plugin
import { Plugin } from 'concordialang-plugin'
import Plugin from 'concordialang-plugin'
Plugin is a named export (interface). There is no default export.
TestScriptGenerationOptions
import { TestScriptGenerationOptions } from 'concordialang-plugin'
const { TestScriptGenerationOptions } = require('concordialang-plugin')
Package is ESM-only; require() will fail. Use dynamic import or ESM context.
TestScriptExecutionOptions
import { TestScriptExecutionOptions } from 'concordialang-plugin'
Named export, same as others.

Example of a minimal plugin class implementing the Plugin interface with generateCode and executeCode methods.

import { Plugin, TestScriptGenerationOptions, TestScriptGenerationResult, TestScriptExecutionOptions, TestScriptExecutionResult } from 'concordialang-plugin'; export default class MyPlugin implements Plugin { serveCommand?: string; async generateCode( abstractTestScripts: any[], options: TestScriptGenerationOptions ): Promise<TestScriptGenerationResult> { // Generate test code from abstract scripts return { generatedFiles: [] }; } async executeCode( options: TestScriptExecutionOptions ): Promise<TestScriptExecutionResult> { // Run the tests return { success: true, output: '' }; } }
Debug
Known issues
breakingv1.0.0 introduced a new API that is incompatible with earlier versions.
fix
Update your plugin implementation to match the new interfaces.
affects: <1.0.0
gotchaThe Plugin interface members are optional. If not implemented, the corresponding step will be skipped.
fix
Ensure you implement at least generateCode and/or executeCode as needed; omit serveCommand if not required.
affects: >=1.0.0
deprecatedProperties 'heal' in TestScriptExecutionOptions was added in v1.3.0; previously unused properties were renamed.
fix
If using the options object, check for new/changed properties.
affects: >=1.3.0
gotchaPackage is ESM-only; require() fails with error 'ERR_REQUIRE_ESM'.
fix
Use import syntax or dynamic import(). Set { 'type': 'module' } in your package.json if needed.
affects: >=1.0.0
gotchaRequires 'concordialang-types' as a peer dependency for type definitions.
fix
Install 'concordialang-types' as a dependency: npm i concordialang-types
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/concordialang-plugin not supported.
This package is ESM-only and cannot be loaded with require().
fix
Use import or dynamic import. For CommonJS, use async import() or switch to ESM.
TypeError: MyPlugin is not a constructor
Forgetting to use default export for plugin class.
fix
Add 'export default class MyPlugin implements Plugin'
Property 'heal' does not exist on type 'TestScriptExecutionOptions'
Using a version earlier than 1.3.0 where 'heal' was added.
fix
Update to concordialang-plugin >=1.3.0.
Cannot find module 'concordialang-types' or its corresponding type declarations.
Missing peer dependency 'concordialang-types'.
fix
Install it: npm i concordialang-types
Upgrade
Version history
1.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
45 hits · last 30 days
node
38
OpenAI (training)
1
Resources
concordialang-plugin — npm install concordialang-plugin · libregistry