diff --git a/packages/banira/README.md b/packages/banira/README.md index 0a32e67..359d6ce 100644 --- a/packages/banira/README.md +++ b/packages/banira/README.md @@ -1,79 +1,14 @@ # banira -The core library of the banira.js toolchain, providing essential utilities and runtime support for developing web components using vanilla JavaScript. +The core library of the banira toolchain, providing essential utilities and runtime support for developing web components using vanilla JavaScript. -## Classes - -### Compiler -The core TypeScript compilation engine that supports both standard and virtual filesystem operations. It provides: -- Flexible compilation with customizable compiler options -- Support for virtual filesystem compilation -- Built-in transformers for ES module compatibility -- Default configuration targeting modern browsers - -### TestHelper -A powerful testing utility for web components that provides: -- JSDOM-based testing environment -- Component mounting and initialization -- Support for both pre-compiled and TypeScript components -- Customizable JSDOM options for specific testing needs - -### ResultAnalyzer -Analyzes compilation results and provides detailed diagnostics: -- Error and warning categorization -- Formatted diagnostic messages -- Access to compiler output files -- Source file analysis capabilities - -### VirtualCompilerHost -A TypeScript compiler host implementation using a virtual filesystem: -- In-memory file operations -- Isolation for testing and development -- Compatible with standard TypeScript compiler API -- Configurable working directory and file structure - -## Usage - -### Testing Components - -```typescript -import { TestHelper } from 'banira'; - -const helper = new TestHelper(); -const context = await helper.mountAsScript('my-component', componentCode); - -// Access the mounted component -const component = context.querySelector('my-component'); -``` +![Diagram](https://mermaid.ink/img/pako:eNplUb1uwyAQfhXrJkey-wAeOnmqFHVIp4gFwflPhrPgUBVFefdisKM4ZYHv57474A6KNEID3Uy_apCOi59W2CIu71RpbrUis5BFyx_sT1mZ_FGYdmGlxhldRppU3aPNgNFzPeC87OrXpf0-l2XaTlu9VsHEQMkj2fKZvwZFw3Oqoq4_31rtKEmTfzcfJtlAFl4aCruXHdL-Df5CJEO6QZagAoPOyFHHF72vnAAe0KCAJh41djLMLEDYR7TKwHS5WQUNu4AVhEVLxnaUvZNmJxdpr0QRdnL2EaMemdw5f1r6uwochX7YHI8_YJeXvA?type=svg) -### Virtual Filesystem - -```typescript -import { createVirtualFs } from 'banira'; - -const fs = createVirtualFs({ - '/src/component.ts': ` - class MyComponent extends HTMLElement { - // component code - } - ` -}); -``` - -## API Reference - -For detailed API documentation, please refer to the generated API documentation in the project root. - -## Dependencies - -- jsdom: ^25.0.1 -- memfs: ^4.15.1 -- typescript: ^5.7.2 - -## Contributing - -This package is part of the banira.js monorepo. Please refer to the main project's README for contribution guidelines. +## Classes -## License +| Class | Description | +|----|----| +| Compiler | Uses tsc to compile TypeScript files to Javascript | +| TestHelper | Helper class for testing web components in a JSDOM environment | +| DocGen | Generates html documentation for Webcomponents based on @example tags | -MIT © Sebastian Schürmann