kire 0.0.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -7
- package/dist/cjs/index.js +2241 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/index.js +2209 -0
- package/dist/esm/package.json +1 -0
- package/dist/types/compiler.d.ts +54 -0
- package/dist/types/directives/component.d.ts +3 -0
- package/dist/types/directives/import.d.ts +3 -0
- package/dist/types/directives/index.d.ts +2 -0
- package/dist/types/directives/layout.d.ts +3 -0
- package/dist/types/directives/natives.d.ts +3 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/kire.d.ts +242 -0
- package/dist/types/parser.d.ts +113 -0
- package/dist/types/runtime.d.ts +3 -0
- package/dist/types/types.d.ts +372 -0
- package/dist/types/utils/elements-runner.d.ts +6 -0
- package/dist/types/utils/html.d.ts +6 -0
- package/dist/types/utils/layered-map.d.ts +20 -0
- package/dist/types/utils/md5.d.ts +1 -0
- package/dist/types/utils/params.d.ts +30 -0
- package/dist/types/utils/resolve.d.ts +9 -0
- package/dist/types/utils/scoped.d.ts +10 -0
- package/kire-schema.json +277 -0
- package/package.json +37 -8
- package/bun.lock +0 -26
- package/index.ts +0 -1
- package/tsconfig.json +0 -29
package/README.md
CHANGED
|
@@ -1,15 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Kire Core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The core engine of **Kire**, a powerful, expressive, and lightweight template engine for JavaScript/TypeScript environments. Kire is designed to be fast, extensible via plugins, and familiar to developers used to Blade (Laravel) or Edge (AdonisJS).
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Expressive Syntax**: Clean and readable directives like `@if`, `@for`, `@include`, `@component`.
|
|
8
|
+
- **Async Support**: First-class support for asynchronous operations within templates.
|
|
9
|
+
- **Extensible**: robust plugin system to add custom directives, elements, and functionality.
|
|
10
|
+
- **Components & Slots**: Modern component architecture with slot support.
|
|
11
|
+
- **High Performance**: Compiles templates to efficient JavaScript functions.
|
|
12
|
+
- **Zero Dependencies**: The core logic is self-contained.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
4
15
|
|
|
5
16
|
```bash
|
|
6
|
-
|
|
17
|
+
npm install kire
|
|
18
|
+
# or
|
|
19
|
+
bun add kire
|
|
7
20
|
```
|
|
8
21
|
|
|
9
|
-
|
|
22
|
+
## Basic Usage
|
|
10
23
|
|
|
11
|
-
```
|
|
12
|
-
|
|
24
|
+
```typescript
|
|
25
|
+
import { Kire } from 'kire';
|
|
26
|
+
|
|
27
|
+
const kire = new Kire();
|
|
28
|
+
|
|
29
|
+
const template = `
|
|
30
|
+
<h1>Hello, {{ name }}!</h1>
|
|
31
|
+
@if(isAdmin)
|
|
32
|
+
<button>Admin Panel</button>
|
|
33
|
+
@end
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
const html = await kire.render(template, {
|
|
37
|
+
name: 'World',
|
|
38
|
+
isAdmin: true
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
console.log(html);
|
|
13
42
|
```
|
|
14
43
|
|
|
15
|
-
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
MIT
|