@gtkx/config 2.0.0-beta.13 → 2.0.0-beta.15
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 +2 -2
- package/dist/config.d.ts +134 -25
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/deploy.d.ts +681 -126
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/vite-plugin.d.ts +5 -0
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +5 -5
- package/src/config.ts +134 -25
- package/src/deploy.ts +681 -126
- package/src/index.ts +5 -0
- package/src/vite-plugin.ts +5 -0
package/src/config.ts
CHANGED
|
@@ -9,9 +9,17 @@ import { resolveUserEventSignals } from "./user-event-signals.ts";
|
|
|
9
9
|
|
|
10
10
|
/** Object form of the `reactCompiler` config key, forwarded to `babel-plugin-react-compiler`. */
|
|
11
11
|
type ReactCompilerOptions = {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Which functions the React Compiler processes.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue `"infer"`, the React Compiler's own default
|
|
16
|
+
*/
|
|
13
17
|
compilationMode?: "all" | "annotation" | "infer" | "syntax" | undefined;
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Which React Compiler diagnostics fail the build.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue `"none"`, the React Compiler's own default
|
|
22
|
+
*/
|
|
15
23
|
panicThreshold?: "all_errors" | "critical_errors" | "none" | undefined;
|
|
16
24
|
};
|
|
17
25
|
|
|
@@ -26,43 +34,94 @@ type ResolvedReactCompilerOptions = ReactCompilerOptions & {
|
|
|
26
34
|
|
|
27
35
|
/**
|
|
28
36
|
* GTKX project configuration authored in `gtkx.config.ts` and validated when loaded.
|
|
37
|
+
*
|
|
38
|
+
* [Configuration and Codegen](https://gtkx.dev/v2/guide/configuration-and-codegen) shows how to set up the file
|
|
39
|
+
* and what codegen generates from it.
|
|
29
40
|
*/
|
|
30
41
|
type Config = {
|
|
31
42
|
/**
|
|
32
43
|
* Additional GIR libraries to bind, such as `WebKit-6.0`.
|
|
33
44
|
* Adwaita and GTK are included implicitly and must not be listed.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue None: GTKX binds `Adw-1`, `Gtk-4.0` and the libraries they depend on
|
|
34
47
|
*/
|
|
35
48
|
libraries?: string[] | undefined;
|
|
36
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Additional GIR search directories, searched before the system ones. Relative paths are resolved from the
|
|
51
|
+
* project root.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue None: GTKX searches `/usr/share/gir-1.0` and the GIR directories pkg-config reports for
|
|
54
|
+
* `gobject-introspection-1.0`
|
|
55
|
+
*/
|
|
37
56
|
girPath?: string[] | undefined;
|
|
38
57
|
/**
|
|
39
58
|
* GApplication identifier, such as `com.example.Tasks`. Required to run, build or deploy the project as an
|
|
40
59
|
* application; a package that is not an application, such as a component library, leaves it out.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue None: the project loads as a package, with `isApplication` set to `false`
|
|
41
62
|
*/
|
|
42
63
|
applicationId?: string | undefined;
|
|
43
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Whether to enable the React Compiler, or options passed to it. `false` disables it.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue `true`
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* reactCompiler: { compilationMode: "annotation" },
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
44
73
|
reactCompiler?: boolean | ReactCompilerOptions | undefined;
|
|
45
74
|
/**
|
|
46
75
|
* Whether GTKX generates project bindings. Set to `false` to reuse an installed binding store.
|
|
47
|
-
*
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `true`
|
|
48
78
|
*/
|
|
49
79
|
codegen?: boolean | undefined;
|
|
50
80
|
/**
|
|
51
81
|
* Additional signals to suppress during React property updates, keyed by GLib type name.
|
|
52
82
|
* Entries extend the built-in signal lists.
|
|
83
|
+
*
|
|
84
|
+
* @defaultValue `{}`: only the built-in lists
|
|
53
85
|
*/
|
|
54
86
|
userEventSignals?: Record<string, string[]> | undefined;
|
|
55
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* Custom element behaviors and overrides for generated components, props, and documentation.
|
|
89
|
+
*
|
|
90
|
+
* @defaultValue `{}`: no custom behaviors or overrides
|
|
91
|
+
*/
|
|
56
92
|
elements?: ElementsOptions | undefined;
|
|
57
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* Path to an icon theme directory or a single SVG, PNG or XPM application icon file, relative to the project
|
|
95
|
+
* root. Deployment requires an icon.
|
|
96
|
+
*
|
|
97
|
+
* @defaultValue The one `<applicationId>.svg`, `.png` or `.xpm` file in the project root, if exactly one
|
|
98
|
+
* exists
|
|
99
|
+
*/
|
|
58
100
|
applicationIcon?: string | undefined;
|
|
59
|
-
/**
|
|
101
|
+
/**
|
|
102
|
+
* Application metadata, bundled runtime settings, and packaging options used by `gtkx deploy`.
|
|
103
|
+
*
|
|
104
|
+
* @defaultValue `{}`: metadata comes from `package.json` and packaging builds a Flatpak
|
|
105
|
+
*/
|
|
60
106
|
deploy?: DeployOptions | undefined;
|
|
61
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Controls the project instructions and reference files generated for coding agents.
|
|
109
|
+
*
|
|
110
|
+
* @defaultValue `{}`: an application gets both, a package neither
|
|
111
|
+
*/
|
|
62
112
|
agents?: AgentsOptions | undefined;
|
|
63
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Default tool selection and access mode for the project's MCP server. The `gtkx mcp` flags `--tools` and
|
|
115
|
+
* `--read-only` take precedence.
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue `{}`: every tool, app interactions included
|
|
118
|
+
*/
|
|
64
119
|
mcp?: McpOptions | undefined;
|
|
65
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* Controls warnings for deprecated configuration and behavior.
|
|
122
|
+
*
|
|
123
|
+
* @defaultValue `{}`: every deprecation warning is shown
|
|
124
|
+
*/
|
|
66
125
|
deprecations?: DeprecationsOptions | undefined;
|
|
67
126
|
};
|
|
68
127
|
/** A {@link Config} whose `applicationId` is known, as loaded for an application. */
|
|
@@ -84,32 +143,66 @@ type ElementPropsExport = {
|
|
|
84
143
|
export: string;
|
|
85
144
|
/**
|
|
86
145
|
* How the exported props are combined: `intersection` is inherited; `factory` applies only to this type.
|
|
87
|
-
*
|
|
146
|
+
*
|
|
147
|
+
* @defaultValue `"intersection"`
|
|
88
148
|
*/
|
|
89
149
|
composition?: "factory" | "intersection" | undefined;
|
|
90
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Props that can only be set when the element is created; changing them afterward throws.
|
|
152
|
+
*
|
|
153
|
+
* @defaultValue `[]`
|
|
154
|
+
*/
|
|
91
155
|
constructOnly?: string[] | undefined;
|
|
92
156
|
};
|
|
93
157
|
|
|
94
158
|
/** Overrides for one GLib type in `elements.config`, keyed by its registered type name. */
|
|
95
159
|
type ElementConfigOptions = {
|
|
96
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Component export that wraps the generated element.
|
|
162
|
+
*
|
|
163
|
+
* @defaultValue None: no wrapper `component`
|
|
164
|
+
*/
|
|
97
165
|
component?: ModuleExport | undefined;
|
|
98
|
-
/**
|
|
166
|
+
/**
|
|
167
|
+
* Additional props type to combine with the generated element props.
|
|
168
|
+
*
|
|
169
|
+
* @defaultValue None: no extra `props` type
|
|
170
|
+
*/
|
|
99
171
|
props?: ElementPropsExport | undefined;
|
|
100
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* Whether the parent container creates this element's GObject instead of the element constructing its own.
|
|
174
|
+
* Subtypes inherit the setting.
|
|
175
|
+
*
|
|
176
|
+
* @defaultValue `false`
|
|
177
|
+
*/
|
|
101
178
|
isLazy?: boolean | undefined;
|
|
102
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* Accepted child GLib type names to show in the generated element documentation.
|
|
181
|
+
*
|
|
182
|
+
* @defaultValue `[]`
|
|
183
|
+
*/
|
|
103
184
|
acceptedChildTypes?: string[] | undefined;
|
|
104
|
-
/**
|
|
185
|
+
/**
|
|
186
|
+
* GObject properties to leave out of generated props, such as properties managed by an element behavior.
|
|
187
|
+
*
|
|
188
|
+
* @defaultValue `[]`: every GObject property becomes a prop
|
|
189
|
+
*/
|
|
105
190
|
omittedProps?: string[] | undefined;
|
|
106
191
|
};
|
|
107
192
|
|
|
108
193
|
/** The `elements` options: custom element behaviors and per-type overrides for generated elements. */
|
|
109
194
|
type ElementsOptions = {
|
|
110
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Path, relative to the project root, of the module exporting the element behavior map.
|
|
197
|
+
*
|
|
198
|
+
* @defaultValue None: only the behaviors built into `@gtkx/react` apply
|
|
199
|
+
*/
|
|
111
200
|
behaviors?: string | undefined;
|
|
112
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Element configuration overrides keyed by GLib type name, such as `GtkWidget`.
|
|
203
|
+
*
|
|
204
|
+
* @defaultValue `{}`
|
|
205
|
+
*/
|
|
113
206
|
config?: Record<string, ElementConfigOptions> | undefined;
|
|
114
207
|
};
|
|
115
208
|
|
|
@@ -118,13 +211,16 @@ type AgentsOptions = {
|
|
|
118
211
|
/**
|
|
119
212
|
* Whether codegen maintains the GTKX rules in `AGENTS.md` and creates a missing `CLAUDE.md` import.
|
|
120
213
|
* `false` removes rules written earlier, deleting `AGENTS.md` and the `CLAUDE.md` import when nothing else
|
|
121
|
-
* remains.
|
|
214
|
+
* remains.
|
|
215
|
+
*
|
|
216
|
+
* @defaultValue `true` for an application, `false` for a package without an `applicationId`
|
|
122
217
|
*/
|
|
123
218
|
rules?: boolean | undefined;
|
|
124
219
|
/**
|
|
125
220
|
* Whether codegen writes the generated element reference to `.gtkx/reference` and points the rules at it.
|
|
126
|
-
* `false` removes a reference generated earlier.
|
|
127
|
-
*
|
|
221
|
+
* `false` removes a reference generated earlier.
|
|
222
|
+
*
|
|
223
|
+
* @defaultValue `true` for an application, `false` for a package without an `applicationId`
|
|
128
224
|
*/
|
|
129
225
|
reference?: boolean | undefined;
|
|
130
226
|
};
|
|
@@ -134,18 +230,31 @@ type McpOptions = {
|
|
|
134
230
|
/**
|
|
135
231
|
* Tool name patterns applied in order: `*` matches any text and a leading `!` excludes matches.
|
|
136
232
|
* Omitted, empty, or exclusion-only lists start with all tools; other lists start with none.
|
|
233
|
+
* `gtkx mcp --tools` overrides it.
|
|
234
|
+
*
|
|
235
|
+
* @defaultValue `[]`: every tool
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* tools: ["gtkx_*", "!gtkx_take_screenshot"],
|
|
239
|
+
* ```
|
|
137
240
|
*/
|
|
138
241
|
tools?: string[] | undefined;
|
|
139
242
|
/**
|
|
140
243
|
* Whether the MCP server exposes only inspection and reference tools, excluding app interactions.
|
|
141
|
-
*
|
|
244
|
+
* `gtkx mcp --read-only` overrides it.
|
|
245
|
+
*
|
|
246
|
+
* @defaultValue `false`
|
|
142
247
|
*/
|
|
143
248
|
readOnly?: boolean | undefined;
|
|
144
249
|
};
|
|
145
250
|
|
|
146
251
|
/** The `deprecations` options: which deprecation warnings stay silent. */
|
|
147
252
|
type DeprecationsOptions = {
|
|
148
|
-
/**
|
|
253
|
+
/**
|
|
254
|
+
* Deprecation identifiers whose warnings are suppressed. There are currently no accepted identifiers.
|
|
255
|
+
*
|
|
256
|
+
* @defaultValue `[]`
|
|
257
|
+
*/
|
|
149
258
|
silence?: never[] | undefined;
|
|
150
259
|
};
|
|
151
260
|
|