`broccoli-node-api` is a TypeScript package that provides canonical type definitions for the Broccoli Node API. It is an essential component for developers creating custom plugins (nodes) for the Broccoli build system, ensuring type safety and enhancing the developer experience within the Broccoli ecosystem. As of version 1.7.0, this library comprehensively covers types for core concepts like `Node`, `InputNode`, `TransformNode`, and `SourceNode`, along with their associated information objects such as `TransformNodeInfo` and `SourceNodeInfo`, and callback interfaces like `CallbackObject` and `BuildChangeObject`. The package directly mirrors the specification outlined in the official Broccoli Node API documentation, facilitating the correct implementation of build hooks and data structures. Its release cadence is tightly coupled with the evolution of the Broccoli core, aiming to always provide up-to-date type definitions. Its primary differentiator is its role as the official, direct, and canonical source of truth for plugin typings within the Broccoli build system.
npm install broccoli-node-apiVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to implement a basic Broccoli `TransformNode` using the provided TypeScript types, including the `__broccoliGetInfo__` method and the `build` callback.
Consult the Broccoli documentation and the `broccoli-node-api` changelog for specific API changes. Update your Broccoli plugins to conform to the new interface specifications, particularly how `__broccoliGetInfo__` and the `CallbackObject` methods are implemented.
Ensure all imports from `broccoli-node-api` use the `import type` syntax: `import type { SymbolName } from 'broccoli-node-api';`. These types are stripped out during compilation and have no runtime presence.Use `instantiationStack` primarily for debugging and diagnostic reporting. Avoid parsing or making critical application logic decisions based on its precise string content. If specific stack information is needed, consider implementing custom stack capturing mechanisms.
Add an explicit type import statement: `import type { TransformNode } from 'broccoli-node-api';`Change the import statement to `import type { TransformNode } from 'broccoli-node-api';`. `TransformNode` is a type definition, not a runtime construct.Ensure your Broccoli plugin fully implements all the properties and methods required by the specific `NodeInfo` interface (e.g., `TransformNodeInfo`, `SourceNodeInfo`), as detailed in the Broccoli Node API documentation. The TypeScript error indicates exactly which property is missing.
No dependency data recorded yet.