@ts-for-gir/generator-base 4.0.0-beta.21 → 4.0.0-beta.23
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 +39 -4
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<p align="center">
|
|
7
7
|
<img src="https://img.shields.io/github/actions/workflow/status/gjsify/ts-for-gir/ci.yml" />
|
|
8
8
|
<img src="https://img.shields.io/github/license/gjsify/ts-for-gir" />
|
|
9
|
-
<img src="https://img.shields.io/npm/v/@ts-for-gir/
|
|
10
|
-
<img src="https://img.shields.io/npm/dw/@ts-for-gir/
|
|
9
|
+
<img src="https://img.shields.io/npm/v/@ts-for-gir/generator-base" />
|
|
10
|
+
<img src="https://img.shields.io/npm/dw/@ts-for-gir/generator-base" />
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">TypeScript type definition generator for GObject introspection GIR files</p>
|
|
@@ -16,6 +16,41 @@
|
|
|
16
16
|
<img src="https://raw.githubusercontent.com/gjsify/ts-for-gir/main/.github/feeling.gif" />
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
|
-
# Generator
|
|
20
|
-
|
|
19
|
+
# Generator Base
|
|
20
|
+
|
|
21
|
+
This package defines the base interface that all generators in the ts-for-gir ecosystem must implement. It provides a common contract for various types of generators, ensuring they have a consistent API.
|
|
22
|
+
|
|
23
|
+
## Purpose
|
|
24
|
+
|
|
25
|
+
The generator-base package serves as the foundation for creating specific generators like:
|
|
26
|
+
- TypeScript definition generators (implemented in `@ts-for-gir/generator-typescript`)
|
|
27
|
+
- HTML documentation generators (placeholder in `@ts-for-gir/generator-html-doc`)
|
|
28
|
+
- Potentially other output formats in the future
|
|
29
|
+
|
|
30
|
+
## Interface
|
|
31
|
+
|
|
32
|
+
The package defines a simple but powerful `Generator` interface with three lifecycle methods:
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
interface Generator {
|
|
36
|
+
start(registry: NSRegistry): Promise<void>;
|
|
37
|
+
generate(registry: NSRegistry, module: GirModule): Promise<void>;
|
|
38
|
+
finish(registry: NSRegistry, girModules: GirModule[]): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This interface allows for:
|
|
43
|
+
1. Initial setup (`start`)
|
|
44
|
+
2. Per-module generation (`generate`)
|
|
45
|
+
3. Final cleanup and post-processing (`finish`)
|
|
46
|
+
|
|
47
|
+
## Generator Types
|
|
48
|
+
|
|
49
|
+
The package also includes a `GeneratorType` enum that defines the available generator types:
|
|
50
|
+
- `TYPES` - For generating TypeScript type definitions
|
|
51
|
+
- `HTML_DOC` - For generating HTML documentation
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
This package is not used directly by end users but serves as a dependency for concrete generator implementations and the main CLI tool.
|
|
21
56
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ts-for-gir/generator-base",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.23",
|
|
4
4
|
"description": "Base generator for ts-for-gir",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"generator"
|
|
35
35
|
],
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^22.13.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
39
|
-
"@typescript-eslint/parser": "^8.
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"eslint-config-prettier": "^10.
|
|
37
|
+
"@types/node": "^22.13.11",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "^8.27.0",
|
|
39
|
+
"@typescript-eslint/parser": "^8.27.0",
|
|
40
|
+
"eslint": "^9.22.0",
|
|
41
|
+
"eslint-config-prettier": "^10.1.1",
|
|
42
42
|
"eslint-plugin-prettier": "^5.2.3",
|
|
43
|
-
"prettier": "^3.5.
|
|
43
|
+
"prettier": "^3.5.3",
|
|
44
44
|
"rimraf": "^6.0.1",
|
|
45
|
-
"typescript": "^5.
|
|
45
|
+
"typescript": "^5.8.2"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@ts-for-gir/lib": "^4.0.0-beta.
|
|
48
|
+
"@ts-for-gir/lib": "^4.0.0-beta.23"
|
|
49
49
|
}
|
|
50
50
|
}
|