|
1 | 1 | # banira
|
2 | 2 |
|
3 |
| -The core library of the banira.js toolchain, providing essential utilities and runtime support for developing web components using vanilla JavaScript. |
| 3 | +The core library of the banira toolchain, providing essential utilities and runtime support for developing web components using vanilla JavaScript. |
4 | 4 |
|
5 |
| -## Classes |
6 |
| - |
7 |
| -### Compiler |
8 |
| -The core TypeScript compilation engine that supports both standard and virtual filesystem operations. It provides: |
9 |
| -- Flexible compilation with customizable compiler options |
10 |
| -- Support for virtual filesystem compilation |
11 |
| -- Built-in transformers for ES module compatibility |
12 |
| -- Default configuration targeting modern browsers |
13 |
| - |
14 |
| -### TestHelper |
15 |
| -A powerful testing utility for web components that provides: |
16 |
| -- JSDOM-based testing environment |
17 |
| -- Component mounting and initialization |
18 |
| -- Support for both pre-compiled and TypeScript components |
19 |
| -- Customizable JSDOM options for specific testing needs |
20 |
| - |
21 |
| -### ResultAnalyzer |
22 |
| -Analyzes compilation results and provides detailed diagnostics: |
23 |
| -- Error and warning categorization |
24 |
| -- Formatted diagnostic messages |
25 |
| -- Access to compiler output files |
26 |
| -- Source file analysis capabilities |
27 |
| - |
28 |
| -### VirtualCompilerHost |
29 |
| -A TypeScript compiler host implementation using a virtual filesystem: |
30 |
| -- In-memory file operations |
31 |
| -- Isolation for testing and development |
32 |
| -- Compatible with standard TypeScript compiler API |
33 |
| -- Configurable working directory and file structure |
34 |
| - |
35 |
| -## Usage |
36 |
| - |
37 |
| -### Testing Components |
38 |
| - |
39 |
| -```typescript |
40 |
| -import { TestHelper } from 'banira'; |
41 |
| - |
42 |
| -const helper = new TestHelper(); |
43 |
| -const context = await helper.mountAsScript('my-component', componentCode); |
44 |
| - |
45 |
| -// Access the mounted component |
46 |
| -const component = context.querySelector('my-component'); |
47 |
| -``` |
| 5 | + |
48 | 6 |
|
49 |
| -### Virtual Filesystem |
50 |
| - |
51 |
| -```typescript |
52 |
| -import { createVirtualFs } from 'banira'; |
53 |
| - |
54 |
| -const fs = createVirtualFs({ |
55 |
| - '/src/component.ts': ` |
56 |
| - class MyComponent extends HTMLElement { |
57 |
| - // component code |
58 |
| - } |
59 |
| - ` |
60 |
| -}); |
61 |
| -``` |
62 |
| - |
63 |
| -## API Reference |
64 |
| - |
65 |
| -For detailed API documentation, please refer to the generated API documentation in the project root. |
66 |
| - |
67 |
| -## Dependencies |
68 |
| - |
69 |
| -- jsdom: ^25.0.1 |
70 |
| -- memfs: ^4.15.1 |
71 |
| -- typescript: ^5.7.2 |
72 |
| - |
73 |
| -## Contributing |
74 |
| - |
75 |
| -This package is part of the banira.js monorepo. Please refer to the main project's README for contribution guidelines. |
| 7 | +## Classes |
76 | 8 |
|
77 |
| -## License |
| 9 | +| Class | Description | |
| 10 | +|----|----| |
| 11 | +| Compiler | Uses tsc to compile TypeScript files to Javascript | |
| 12 | +| TestHelper | Helper class for testing web components in a JSDOM environment | |
| 13 | +| DocGen | Generates html documentation for Webcomponents based on @example tags | |
78 | 14 |
|
79 |
| -MIT © Sebastian Schürmann |
0 commit comments