@gtkx/config 1.6.0 → 2.0.0-beta.10

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.
Files changed (65) hide show
  1. package/README.md +47 -44
  2. package/dist/config-dependencies.d.ts +11 -0
  3. package/dist/config-dependencies.d.ts.map +1 -0
  4. package/dist/config-dependencies.js +83 -0
  5. package/dist/config-dependencies.js.map +1 -0
  6. package/dist/config-error.d.ts +4 -15
  7. package/dist/config-error.d.ts.map +1 -1
  8. package/dist/config-error.js +8 -55
  9. package/dist/config-error.js.map +1 -1
  10. package/dist/config.d.ts +35 -61
  11. package/dist/config.d.ts.map +1 -1
  12. package/dist/config.js +49 -94
  13. package/dist/config.js.map +1 -1
  14. package/dist/deploy.d.ts +26 -16
  15. package/dist/deploy.d.ts.map +1 -1
  16. package/dist/deploy.js +29 -4
  17. package/dist/deploy.js.map +1 -1
  18. package/dist/index.d.ts +1 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +1 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/internal.d.ts +5 -2
  23. package/dist/internal.d.ts.map +1 -1
  24. package/dist/internal.js +4 -1
  25. package/dist/internal.js.map +1 -1
  26. package/dist/loader.d.ts +2 -4
  27. package/dist/loader.d.ts.map +1 -1
  28. package/dist/loader.js +96 -22
  29. package/dist/loader.js.map +1 -1
  30. package/dist/node-version.d.ts +4 -0
  31. package/dist/node-version.d.ts.map +1 -0
  32. package/dist/node-version.js +12 -0
  33. package/dist/node-version.js.map +1 -0
  34. package/dist/schema-text.d.ts +1 -2
  35. package/dist/schema-text.d.ts.map +1 -1
  36. package/dist/schema-text.js +1 -1
  37. package/dist/schema-text.js.map +1 -1
  38. package/dist/virtual.d.ts.map +1 -1
  39. package/dist/virtual.js +1 -2
  40. package/dist/virtual.js.map +1 -1
  41. package/dist/vite-plugin.d.ts.map +1 -1
  42. package/dist/vite-plugin.js +14 -5
  43. package/dist/vite-plugin.js.map +1 -1
  44. package/dist/vite-root.d.ts +9 -0
  45. package/dist/vite-root.d.ts.map +1 -0
  46. package/dist/vite-root.js +3 -0
  47. package/dist/vite-root.js.map +1 -0
  48. package/package.json +14 -5
  49. package/src/config-dependencies.ts +114 -0
  50. package/src/config-error.ts +10 -78
  51. package/src/config.ts +60 -166
  52. package/src/deploy.ts +61 -7
  53. package/src/index.ts +1 -2
  54. package/src/internal.ts +4 -3
  55. package/src/loader.ts +138 -31
  56. package/src/node-version.ts +16 -0
  57. package/src/schema-text.ts +1 -1
  58. package/src/virtual.ts +1 -4
  59. package/src/vite-plugin.ts +17 -7
  60. package/src/vite-root.ts +8 -0
  61. package/dist/deprecations.d.ts +0 -5
  62. package/dist/deprecations.d.ts.map +0 -1
  63. package/dist/deprecations.js +0 -97
  64. package/dist/deprecations.js.map +0 -1
  65. package/src/deprecations.ts +0 -130
package/README.md CHANGED
@@ -5,15 +5,15 @@
5
5
  <h1 align="center">GTKX</h1>
6
6
 
7
7
  <p align="center">
8
- The React framework for Linux, built on GTK.<br />
9
- Write native GTK4 desktop applications with React and TypeScript.
10
- Real GTK widgets, the GNOME stack, and standard web tooling.
8
+ The React framework for Linux.<br />
9
+ Write native GNOME applications with React and TypeScript.
10
+ Real Adwaita and GTK4 widgets with standard web tooling.
11
11
  </p>
12
12
 
13
13
  <p align="center">
14
14
  <a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/v/create-gtkx?color=cb3837&logo=npm&label=create-gtkx" alt="npm version" /></a>
15
15
  <a href="https://www.npmjs.com/package/create-gtkx"><img src="https://img.shields.io/npm/dm/create-gtkx?color=cb3837&logo=npm&label=downloads" alt="npm downloads" /></a>
16
- <img src="https://img.shields.io/badge/node-%E2%89%A524-339933?logo=node.js&logoColor=white" alt="Node >= 24" />
16
+ <img src="https://img.shields.io/badge/node-%E2%89%A526.7-339933?logo=node.js&logoColor=white" alt="Node >= 26.7" />
17
17
  <a href="https://github.com/gtkx-org/gtkx/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MPL--2.0-blue.svg" alt="License: MPL-2.0" /></a>
18
18
  <a href="https://github.com/gtkx-org/gtkx/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/gtkx-org/gtkx/ci.yml?branch=main&logo=github&label=CI" alt="CI status" /></a>
19
19
  <img src="https://img.shields.io/badge/TypeScript-strict-3178c6?logo=typescript&logoColor=white" alt="TypeScript" />
@@ -38,11 +38,12 @@
38
38
 
39
39
  ## Demo
40
40
 
41
- The intrinsic elements in this snippet render GTK4 widgets, and ordinary React hooks and events drive them:
41
+ This app starts with an Adwaita application shell, renders native GTK4 widgets inside it, and uses ordinary React hooks and events:
42
42
 
43
43
  ```tsx
44
44
  import * as Gtk from "@gtkx/gi/gtk";
45
- import { GtkApplication, GtkApplicationWindow, GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
45
+ import { AdwApplication, AdwApplicationWindow, AdwHeaderBar, AdwToolbarView } from "@gtkx/jsx/adw";
46
+ import { GtkBox, GtkButton, GtkLabel } from "@gtkx/jsx/gtk";
46
47
  import { createRoot, quit } from "@gtkx/react";
47
48
  import { useState } from "react";
48
49
 
@@ -50,38 +51,40 @@ const Counter = () => {
50
51
  const [count, setCount] = useState(0);
51
52
 
52
53
  return (
53
- <GtkApplicationWindow
54
+ <AdwApplicationWindow
54
55
  title="Hello GTKX"
55
56
  defaultWidth={400}
56
57
  defaultHeight={300}
57
58
  onCloseRequest={quit}
58
59
  >
59
- <GtkBox
60
- orientation={Gtk.Orientation.VERTICAL}
61
- spacing={20}
62
- marginTop={40}
63
- marginBottom={40}
64
- marginStart={40}
65
- marginEnd={40}
66
- valign={Gtk.Align.CENTER}
67
- halign={Gtk.Align.CENTER}
68
- >
69
- <GtkLabel cssClasses={["title-1"]}>Welcome to GTKX!</GtkLabel>
70
- <GtkLabel cssClasses={["title-2"]}>{`Count: ${count}`}</GtkLabel>
71
- <GtkButton
72
- label="Increment"
73
- onClicked={() => setCount((c) => c + 1)}
74
- cssClasses={["suggested-action", "pill"]}
75
- />
76
- </GtkBox>
77
- </GtkApplicationWindow>
60
+ <AdwToolbarView topBar={<AdwHeaderBar />}>
61
+ <GtkBox
62
+ orientation={Gtk.Orientation.VERTICAL}
63
+ spacing={20}
64
+ marginTop={40}
65
+ marginBottom={40}
66
+ marginStart={40}
67
+ marginEnd={40}
68
+ valign={Gtk.Align.CENTER}
69
+ halign={Gtk.Align.CENTER}
70
+ >
71
+ <GtkLabel cssClasses={["title-1"]}>Welcome to GTKX!</GtkLabel>
72
+ <GtkLabel cssClasses={["title-2"]}>{`Count: ${String(count)}`}</GtkLabel>
73
+ <GtkButton
74
+ label="Increment"
75
+ onClicked={() => setCount((c) => c + 1)}
76
+ cssClasses={["suggested-action", "pill"]}
77
+ />
78
+ </GtkBox>
79
+ </AdwToolbarView>
80
+ </AdwApplicationWindow>
78
81
  );
79
82
  };
80
83
 
81
84
  const App = () => (
82
- <GtkApplication>
85
+ <AdwApplication>
83
86
  <Counter />
84
- </GtkApplication>
87
+ </AdwApplication>
85
88
  );
86
89
 
87
90
  createRoot().render(<App />);
@@ -91,9 +94,9 @@ This is the [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/
91
94
 
92
95
  ## Why GTKX
93
96
 
94
- ### A declarative layer for the GNOME stack
97
+ ### Adwaita-first application development
95
98
 
96
- GTK4 is mature, and GtkBuilder XML can lay out a static interface, but nothing re-renders that interface when your application state changes, and nothing hot-reloads it as you work. GTKX adds that missing layer, and the tooling around it, on top of the stack you already know:
99
+ GTKX uses Adwaita as the foundation for applications, windows, navigation, dialogs, and adaptive layouts, with the complete GTK4 toolkit underneath. It adds a declarative React layer and an integrated TypeScript toolchain to the GNOME platform:
97
100
 
98
101
  - a React reconciler that exposes every GObject as a JSX element,
99
102
  - a CLI for scaffolding, development, and production builds,
@@ -102,29 +105,29 @@ GTK4 is mature, and GtkBuilder XML can lay out a static interface, but nothing r
102
105
  - a Testing Library-style API for querying and driving your widgets in tests,
103
106
  - and a Model Context Protocol (MCP) server that exposes your live app to AI agents.
104
107
 
105
- ### The full GNOME API surface
108
+ ### Native GNOME widgets, without a compatibility layer
106
109
 
107
- React Native and similar frameworks hide the native toolkit so one API can run everywhere. GTKX exposes it: GTK4, Adwaita, and any other GObject-Introspection library on your system. Linux-only by design.
110
+ React Native and similar frameworks hide the native toolkit so one API can run everywhere. GTKX renders real Adwaita and GTK4 widgets and exposes any other GObject-Introspection library on your system. It is GNOME-native and Linux-only by design.
108
111
 
109
112
  ### Why Node.js, and why generated bindings
110
113
 
111
114
  GTKX runs on Node.js, which puts native modules, the npm ecosystem, and the tooling built for Node.js APIs within reach. GJS is GNOME's own runtime, built on SpiderMonkey rather than V8; node-gtk runs on Node.js but is lightly maintained, on the older nan/V8 ABI rather than N-API, and still centered on GTK3. The [Why GTKX guide](https://gtkx.dev/guide/why-gtkx) covers what running on Node.js means day to day.
112
115
 
113
- GTKX generates the TypeScript types and the native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. Codegen covers the whole GTK4 and Adwaita surface.
116
+ GTKX generates the TypeScript types and native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. `Adw-1` is the sole default GIR root; its GIR include pulls in `Gtk-4.0`, so codegen covers both complete API surfaces. Neither belongs in a GTKX 2 `libraries` list.
114
117
 
115
- At runtime, the native Rust core calls straight into the system GTK4, Adwaita, and GLib libraries through libffi, without loading libgirepository at all.
118
+ At runtime, the native Rust core calls straight into the system Adwaita, GTK4, and GLib libraries through libffi, without loading libgirepository at all.
116
119
 
117
120
  ## Quick start
118
121
 
119
- GTKX is Linux-only and needs Node.js 24 or later. See [Requirements](#requirements).
122
+ GTKX is Linux-only and needs Node.js 26.7 or later. See [Requirements](#requirements).
120
123
 
121
124
  Scaffold a new app with the `create-gtkx` initializer:
122
125
 
123
126
  ```sh
124
- npm create gtkx
127
+ npm create gtkx@beta
125
128
  ```
126
129
 
127
- The same command works with other package managers: `pnpm create gtkx` or `yarn create gtkx`.
130
+ The same command works with other package managers: `pnpm create gtkx@beta` or `yarn create gtkx@beta`.
128
131
 
129
132
  Then run your new app:
130
133
 
@@ -145,8 +148,8 @@ The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tu
145
148
 
146
149
  GTKX is Linux-only. You need:
147
150
 
148
- - Linux with the GTK4 (4.20 or later) and GLib development libraries, plus Adwaita (1.8 or later) once your project binds `Adw-1`
149
- - Node.js 24 or later
151
+ - Linux with the Adwaita (1.8 or later), GTK4 (4.20 or later), and GLib development libraries
152
+ - Node.js 26.7 or later
150
153
 
151
154
  The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other targets need to build it from the GTKX repository, which requires a Rust toolchain.
152
155
 
@@ -154,10 +157,10 @@ The `@gtkx/native` addon ships prebuilt for x64 and arm64 glibc Linux; other tar
154
157
 
155
158
  Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
156
159
 
157
- - [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the counter above.
158
- - [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo): a React port of the official GTK4 widget showcase, covering lists, dialogs, gestures, CSS, and OpenGL.
159
- - [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser): a WebKitWebView-based web browser.
160
- - [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations): a tour of `@gtkx/animated`, React Spring animations driven by the GTK frame clock.
160
+ - [`hello-world`](https://github.com/gtkx-org/gtkx/tree/main/examples/hello-world): the Adwaita counter above.
161
+ - [`gtk-demo`](https://github.com/gtkx-org/gtkx/tree/main/examples/gtk-demo): the official GTK4 widget showcase in an Adwaita application shell, covering lists, dialogs, gestures, CSS, and OpenGL.
162
+ - [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser): an Adwaita browser built around `WebKitWebView`.
163
+ - [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations): an Adwaita showcase for `@gtkx/animated`, with React Spring animations driven by the GTK frame clock.
161
164
  - [`navigation`](https://github.com/gtkx-org/gtkx/tree/main/examples/navigation): a tour of `@gtkx/navigation`, React Navigation's stack, tab, and drawer navigators rendered with libadwaita.
162
165
  - [`tutorial`](https://github.com/gtkx-org/gtkx/tree/main/examples/tutorial): the Tasks app the documentation builds.
163
166
 
@@ -167,7 +170,7 @@ GTKX is stable and ready for production use.
167
170
 
168
171
  ## Contributing
169
172
 
170
- Contributions are welcome. See [CONTRIBUTING.md](https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md), the [Code of Conduct](https://github.com/gtkx-org/gtkx/blob/main/CODE_OF_CONDUCT.md), and the [security policy](https://github.com/gtkx-org/gtkx/blob/main/SECURITY.md). Building the repo needs Node.js 24 or later, pnpm, and a Rust toolchain.
173
+ Contributions are welcome. See [CONTRIBUTING.md](https://github.com/gtkx-org/gtkx/blob/main/CONTRIBUTING.md), the [Code of Conduct](https://github.com/gtkx-org/gtkx/blob/main/CODE_OF_CONDUCT.md), and the [security policy](https://github.com/gtkx-org/gtkx/blob/main/SECURITY.md). Building the repo needs Node.js 26.7 or later, pnpm, and a Rust toolchain.
171
174
 
172
175
  ## License
173
176
 
@@ -0,0 +1,11 @@
1
+ import { type TransformOptions, type TransformResult } from "jiti";
2
+ type CapturedConfig<T> = {
3
+ dependencies: string[];
4
+ value: T;
5
+ };
6
+ declare const transformConfigModule: (options: TransformOptions) => TransformResult;
7
+ declare const setConfigDependencies: (value: object, dependencies: Iterable<string>) => void;
8
+ declare const configDependenciesFor: (value: unknown) => string[];
9
+ declare const captureConfigDependencies: <T>(operation: () => Promise<T>) => Promise<CapturedConfig<T>>;
10
+ export { captureConfigDependencies, configDependenciesFor, setConfigDependencies, transformConfigModule, };
11
+ //# sourceMappingURL=config-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-dependencies.d.ts","sourceRoot":"","sources":["../src/config-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,MAAM,CAAC;AAO1F,KAAK,cAAc,CAAC,CAAC,IAAI;IAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAuD9D,QAAA,MAAM,qBAAqB,GAAI,SAAS,gBAAgB,KAAG,eAY1D,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,cAAc,QAAQ,CAAC,MAAM,CAAC,KAAG,IAI9E,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,MAAM,EACqC,CAAC;AAE5F,QAAA,MAAM,yBAAyB,GAAU,CAAC,EAAE,WAAW,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAqBlG,CAAC;AAEF,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACxB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { createJiti } from "jiti";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ import { createRequire, registerHooks } from "node:module";
4
+ import { extname, sep } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ const captureStorage = new AsyncLocalStorage();
7
+ const dependenciesByValue = new WeakMap();
8
+ const CACHE_BUSTED_EXTENSIONS = new Set([".cjs", ".js", ".json", ".mjs"]);
9
+ const isTrackedPath = (path) => !path.includes(`${sep}node_modules${sep}`);
10
+ const addPath = (path) => {
11
+ if (isTrackedPath(path)) {
12
+ captureStorage.getStore()?.dependencies.add(path);
13
+ }
14
+ };
15
+ const addUrl = (url) => {
16
+ if (url.startsWith("file:")) {
17
+ addPath(fileURLToPath(url));
18
+ }
19
+ };
20
+ const cacheBustedUrl = (url) => {
21
+ if (!url.startsWith("file:")) {
22
+ return url;
23
+ }
24
+ const path = fileURLToPath(url);
25
+ if (!isTrackedPath(path) || !CACHE_BUSTED_EXTENSIONS.has(extname(path))) {
26
+ return url;
27
+ }
28
+ const parsed = new URL(url);
29
+ parsed.searchParams.set("gtkx-config-load", captureStorage.getStore()?.cacheKey ?? "uncaptured");
30
+ return parsed.href;
31
+ };
32
+ const registerResolutionHook = () => registerHooks({
33
+ resolve(specifier, context, nextResolve) {
34
+ const result = nextResolve(specifier, context);
35
+ addUrl(result.url);
36
+ return { ...result, url: cacheBustedUrl(result.url) };
37
+ },
38
+ });
39
+ const clearNativeModuleCache = (dependencies) => {
40
+ const cache = createRequire(import.meta.url).cache;
41
+ for (const path of dependencies) {
42
+ Reflect.deleteProperty(cache, path);
43
+ }
44
+ };
45
+ const transformConfigModule = (options) => {
46
+ const state = captureStorage.getStore();
47
+ if (state === undefined) {
48
+ throw new Error("Configuration transformation started outside a dependency capture");
49
+ }
50
+ if (options.filename !== undefined) {
51
+ addPath(options.filename);
52
+ }
53
+ return { code: state.transformer.transform(options) };
54
+ };
55
+ const setConfigDependencies = (value, dependencies) => {
56
+ const paths = [...new Set(dependencies)];
57
+ dependenciesByValue.set(value, paths);
58
+ clearNativeModuleCache(paths);
59
+ };
60
+ const configDependenciesFor = (value) => typeof value === "object" && value !== null ? dependenciesByValue.get(value) ?? [] : [];
61
+ const captureConfigDependencies = async (operation) => {
62
+ const state = {
63
+ cacheKey: process.hrtime.bigint().toString(),
64
+ dependencies: new Set(),
65
+ transformer: createJiti(import.meta.url, { fsCache: false, moduleCache: false }),
66
+ };
67
+ const hook = registerResolutionHook();
68
+ try {
69
+ const value = await captureStorage.run(state, operation);
70
+ return { dependencies: [...state.dependencies], value };
71
+ }
72
+ catch (error) {
73
+ if (typeof error === "object" && error !== null) {
74
+ setConfigDependencies(error, state.dependencies);
75
+ }
76
+ throw error;
77
+ }
78
+ finally {
79
+ hook.deregister();
80
+ }
81
+ };
82
+ export { captureConfigDependencies, configDependenciesFor, setConfigDependencies, transformConfigModule, };
83
+ //# sourceMappingURL=config-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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QAEzD,OAAO,EAAE,YAAY,EAAE,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC9C,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,KAAK,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACxB,CAAC","sourcesContent":["import { createJiti, type Jiti, type TransformOptions, type TransformResult } from \"jiti\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { createRequire, registerHooks } from \"node:module\";\nimport { extname, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ntype CaptureState = { cacheKey: string; dependencies: Set<string>; transformer: Jiti };\ntype CapturedConfig<T> = { dependencies: string[]; value: T };\n\nconst captureStorage: AsyncLocalStorage<CaptureState> = new AsyncLocalStorage();\nconst dependenciesByValue: WeakMap<object, string[]> = new WeakMap();\nconst CACHE_BUSTED_EXTENSIONS: ReadonlySet<string> = new Set([\".cjs\", \".js\", \".json\", \".mjs\"]);\n\nconst isTrackedPath = (path: string): boolean => !path.includes(`${sep}node_modules${sep}`);\n\nconst addPath = (path: string): void => {\n if (isTrackedPath(path)) {\n captureStorage.getStore()?.dependencies.add(path);\n }\n};\n\nconst addUrl = (url: string): void => {\n if (url.startsWith(\"file:\")) {\n addPath(fileURLToPath(url));\n }\n};\n\nconst cacheBustedUrl = (url: string): string => {\n if (!url.startsWith(\"file:\")) {\n return url;\n }\n\n const path = fileURLToPath(url);\n\n if (!isTrackedPath(path) || !CACHE_BUSTED_EXTENSIONS.has(extname(path))) {\n return url;\n }\n\n const parsed = new URL(url);\n parsed.searchParams.set(\"gtkx-config-load\", captureStorage.getStore()?.cacheKey ?? \"uncaptured\");\n\n return parsed.href;\n};\n\nconst registerResolutionHook = (): ReturnType<typeof registerHooks> =>\n registerHooks({\n resolve(specifier, context, nextResolve) {\n const result = nextResolve(specifier, context);\n addUrl(result.url);\n\n return { ...result, url: cacheBustedUrl(result.url) };\n },\n });\n\nconst clearNativeModuleCache = (dependencies: Iterable<string>): void => {\n const cache = createRequire(import.meta.url).cache;\n\n for (const path of dependencies) {\n Reflect.deleteProperty(cache, path);\n }\n};\n\nconst transformConfigModule = (options: TransformOptions): TransformResult => {\n const state = captureStorage.getStore();\n\n if (state === undefined) {\n throw new Error(\"Configuration transformation started outside a dependency capture\");\n }\n\n if (options.filename !== undefined) {\n addPath(options.filename);\n }\n\n return { code: state.transformer.transform(options) };\n};\n\nconst setConfigDependencies = (value: object, dependencies: Iterable<string>): void => {\n const paths = [...new Set(dependencies)];\n dependenciesByValue.set(value, paths);\n clearNativeModuleCache(paths);\n};\n\nconst configDependenciesFor = (value: unknown): string[] =>\n typeof value === \"object\" && value !== null ? dependenciesByValue.get(value) ?? [] : [];\n\nconst captureConfigDependencies = async <T>(operation: () => Promise<T>): Promise<CapturedConfig<T>> => {\n const state: CaptureState = {\n cacheKey: process.hrtime.bigint().toString(),\n dependencies: new Set(),\n transformer: createJiti(import.meta.url, { fsCache: false, moduleCache: false }),\n };\n const hook = registerResolutionHook();\n\n try {\n const value = await captureStorage.run(state, operation);\n\n return { dependencies: [...state.dependencies], value };\n } catch (error) {\n if (typeof error === \"object\" && error !== null) {\n setConfigDependencies(error, state.dependencies);\n }\n\n throw error;\n } finally {\n hook.deregister();\n }\n};\n\nexport {\n captureConfigDependencies,\n configDependenciesFor,\n setConfigDependencies,\n transformConfigModule,\n};\n"]}
@@ -1,17 +1,6 @@
1
- import type { z } from "zod";
2
- type IssuePath = (string | number)[];
1
+ import { z } from "zod";
3
2
  declare const isRecord: (value: unknown) => value is Record<string, unknown>;
4
- declare const rawIssue: (input: unknown, path: IssuePath, message: string, isStandalone?: boolean) => {
5
- params?: {
6
- standalone: boolean;
7
- };
8
- code: "custom";
9
- input: unknown;
10
- path: IssuePath;
11
- message: string;
12
- continue: true;
13
- };
14
- declare const missingConfigFileError: (cwd: string) => Error;
15
- declare const configError: (error: z.ZodError) => Error;
16
- export { isRecord, rawIssue, missingConfigFileError, configError };
3
+ declare const missingConfigFileError: (cwd: string, configFile?: string) => Error;
4
+ declare const configError: (error: z.ZodError, configFile?: string) => Error;
5
+ export { isRecord, missingConfigFileError, configError };
17
6
  //# sourceMappingURL=config-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAKrC,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAEzE,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,MAAM,SAAS,EAAE,SAAS,MAAM,EAAE,sBAAoB;;;;;;;;;CAOtF,CAAC;AAuDH,QAAA,MAAM,sBAAsB,GAAI,KAAK,MAAM,KAAG,KACyB,CAAC;AAExE,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,KAAG,KAQxC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAIzE,QAAA,MAAM,sBAAsB,GAAI,KAAK,MAAM,EAAE,aAAa,MAAM,KAAG,KAGW,CAAC;AAE/E,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,mBAAgC,KAAG,KACJ,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC"}
@@ -1,57 +1,10 @@
1
- const CONFIG_PREFIX = "gtkx.config.ts:";
2
- const UNRECOGNIZED_KEY_REASON = "is not a recognized key";
1
+ import { z } from "zod";
2
+ const DEFAULT_CONFIG_FILE = "gtkx.config.*";
3
3
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
- const rawIssue = (input, path, message, isStandalone = false) => ({
5
- code: "custom",
6
- input,
7
- path,
8
- message,
9
- continue: true,
10
- ...(isStandalone && { params: { standalone: true } }),
11
- });
12
- const appendSegment = (path, segment) => {
13
- if (typeof segment === "number") {
14
- return `${path}[${String(segment)}]`;
15
- }
16
- return path === "" ? String(segment) : `${path}.${String(segment)}`;
17
- };
18
- const dottedPath = (segments) => {
19
- let path = "";
20
- for (const segment of segments) {
21
- path = appendSegment(path, segment);
22
- }
23
- return path;
24
- };
25
- const isStandaloneIssue = (issue) => "params" in issue && isRecord(issue.params) && issue.params.standalone === true;
26
- const unrecognizedKeyPath = (issue, fullPath) => {
27
- if (issue.code === "unrecognized_keys") {
28
- const [key] = issue.keys;
29
- return dottedPath(key === undefined ? fullPath : [...fullPath, key]);
30
- }
31
- return issue.code === "invalid_key" ? dottedPath(fullPath) : undefined;
32
- };
33
- const keyRejectionReason = (issue) => {
34
- const nested = issue.code === "invalid_key" ? issue.issues[0] : undefined;
35
- return nested?.code === "custom" ? nested.message : UNRECOGNIZED_KEY_REASON;
36
- };
37
- const formatIssue = (issue, fullPath) => {
38
- const unrecognized = unrecognizedKeyPath(issue, fullPath);
39
- if (unrecognized !== undefined) {
40
- return `${CONFIG_PREFIX} \`${unrecognized}\` ${keyRejectionReason(issue)}`;
41
- }
42
- if (isStandaloneIssue(issue)) {
43
- return `${CONFIG_PREFIX} ${issue.message}`;
44
- }
45
- const path = dottedPath(fullPath);
46
- return path === "" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \`${path}\` ${issue.message}`;
47
- };
48
- const missingConfigFileError = (cwd) => new Error(`${CONFIG_PREFIX} no configuration file found in ${cwd}`);
49
- const configError = (error) => {
50
- const issue = error.issues[0];
51
- if (issue === undefined) {
52
- return new Error(`${CONFIG_PREFIX} invalid configuration`);
53
- }
54
- return new Error(formatIssue(issue, issue.path));
55
- };
56
- export { isRecord, rawIssue, missingConfigFileError, configError };
4
+ const configPrefix = (configFile) => `${configFile}:`;
5
+ const missingConfigFileError = (cwd, configFile) => new Error(configFile === undefined
6
+ ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`
7
+ : `${configPrefix(configFile)} no configuration file found in ${cwd}`);
8
+ const configError = (error, configFile = DEFAULT_CONFIG_FILE) => new Error(`${configPrefix(configFile)}\n${z.prettifyError(error)}`);
9
+ export { isRecord, missingConfigFileError, configError };
57
10
  //# sourceMappingURL=config-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG,iBAAiB,CAAC;AACxC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAE1D,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,IAAe,EAAE,OAAe,EAAE,YAAY,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,QAAi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C,GAAG,EAAE,CAAC,CAAC;AAExE,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAS,EAAE;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,IAAI,KAAK,CAAC,GAAG,aAAa,wBAAwB,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import type { z } from \"zod\";\n\ntype IssuePath = (string | number)[];\n\nconst CONFIG_PREFIX = \"gtkx.config.ts:\";\nconst UNRECOGNIZED_KEY_REASON = \"is not a recognized key\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst rawIssue = (input: unknown, path: IssuePath, message: string, isStandalone = false) => ({\n code: \"custom\" as const,\n input,\n path,\n message,\n continue: true as const,\n ...(isStandalone && { params: { standalone: true } }),\n});\n\nconst appendSegment = (path: string, segment: PropertyKey): string => {\n if (typeof segment === \"number\") {\n return `${path}[${String(segment)}]`;\n }\n\n return path === \"\" ? String(segment) : `${path}.${String(segment)}`;\n};\n\nconst dottedPath = (segments: PropertyKey[]): string => {\n let path = \"\";\n\n for (const segment of segments) {\n path = appendSegment(path, segment);\n }\n\n return path;\n};\n\nconst isStandaloneIssue = (issue: z.core.$ZodIssue): boolean =>\n \"params\" in issue && isRecord(issue.params) && issue.params.standalone === true;\n\nconst unrecognizedKeyPath = (issue: z.core.$ZodIssue, fullPath: PropertyKey[]): string | undefined => {\n if (issue.code === \"unrecognized_keys\") {\n const [key] = issue.keys;\n\n return dottedPath(key === undefined ? fullPath : [...fullPath, key]);\n }\n\n return issue.code === \"invalid_key\" ? dottedPath(fullPath) : undefined;\n};\n\nconst keyRejectionReason = (issue: z.core.$ZodIssue): string => {\n const nested = issue.code === \"invalid_key\" ? issue.issues[0] : undefined;\n\n return nested?.code === \"custom\" ? nested.message : UNRECOGNIZED_KEY_REASON;\n};\n\nconst formatIssue = (issue: z.core.$ZodIssue, fullPath: PropertyKey[]): string => {\n const unrecognized = unrecognizedKeyPath(issue, fullPath);\n\n if (unrecognized !== undefined) {\n return `${CONFIG_PREFIX} \\`${unrecognized}\\` ${keyRejectionReason(issue)}`;\n }\n\n if (isStandaloneIssue(issue)) {\n return `${CONFIG_PREFIX} ${issue.message}`;\n }\n\n const path = dottedPath(fullPath);\n\n return path === \"\" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \\`${path}\\` ${issue.message}`;\n};\n\nconst missingConfigFileError = (cwd: string): Error =>\n new Error(`${CONFIG_PREFIX} no configuration file found in ${cwd}`);\n\nconst configError = (error: z.ZodError): Error => {\n const issue = error.issues[0];\n\n if (issue === undefined) {\n return new Error(`${CONFIG_PREFIX} invalid configuration`);\n }\n\n return new Error(formatIssue(issue, issue.path));\n};\n\nexport { isRecord, rawIssue, missingConfigFileError, configError };\n"]}
1
+ {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAU,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC;AAEtE,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,UAAmB,EAAS,EAAE,CACvE,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;IAC9B,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,mCAAmC,GAAG,EAAE;IAC9E,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;AAE/E,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,UAAU,GAAG,mBAAmB,EAAS,EAAE,CAC/E,IAAI,KAAK,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nconst DEFAULT_CONFIG_FILE = \"gtkx.config.*\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst configPrefix = (configFile: string): string => `${configFile}:`;\n\nconst missingConfigFileError = (cwd: string, configFile?: string): Error =>\n new Error(configFile === undefined\n ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`\n : `${configPrefix(configFile)} no configuration file found in ${cwd}`);\n\nconst configError = (error: z.ZodError, configFile = DEFAULT_CONFIG_FILE): Error =>\n new Error(`${configPrefix(configFile)}\\n${z.prettifyError(error)}`);\n\nexport { isRecord, missingConfigFileError, configError };\n"]}
package/dist/config.d.ts CHANGED
@@ -1,15 +1,11 @@
1
1
  import { type DefineConfig } from "c12";
2
2
  import { z } from "zod";
3
- /** Accepted `reactCompiler.compilationMode` values, choosing which functions the compiler processes. */
4
- type ReactCompilerCompilationMode = (typeof COMPILATION_MODES)[number];
5
- /** Accepted `reactCompiler.panicThreshold` values, choosing which compiler diagnostics fail the build. */
6
- type ReactCompilerPanicThreshold = (typeof PANIC_THRESHOLDS)[number];
7
- /** Object form of the `reactCompiler` config key, forwarded as-is to `babel-plugin-react-compiler`. */
3
+ /** Object form of the `reactCompiler` config key, forwarded to `babel-plugin-react-compiler`. */
8
4
  type ReactCompilerOptions = {
9
- /** Which functions the compiler processes; left to the compiler's own default when omitted. */
10
- compilationMode?: ReactCompilerCompilationMode;
11
- /** Which compiler diagnostics fail the build; left to the compiler's own default when omitted. */
12
- panicThreshold?: ReactCompilerPanicThreshold;
5
+ /** Which functions the compiler processes. */
6
+ compilationMode?: (typeof COMPILATION_MODES)[number];
7
+ /** Which compiler diagnostics fail the build. */
8
+ panicThreshold?: (typeof PANIC_THRESHOLDS)[number];
13
9
  };
14
10
  /**
15
11
  * The React Compiler options the build hands to `babel-plugin-react-compiler`, with the React version
@@ -22,9 +18,8 @@ type ResolvedReactCompilerOptions = ReactCompilerOptions & {
22
18
  /**
23
19
  * User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`: the GIR libraries
24
20
  * to bind and where to find them, the GApplication id, per-element configuration, the React
25
- * Compiler, codegen, and user event signal settings, the `agents` and `mcp` blocks controlling what
26
- * coding agents are given, the `future` block opting into behavior that becomes the default in the
27
- * next major version, and the `deprecations` block silencing the warnings about flags left unset.
21
+ * Compiler, codegen, and user event signal settings, and the `agents` and `mcp` blocks controlling
22
+ * what coding agents are given.
28
23
  */
29
24
  type Config = z.infer<typeof configSchema>;
30
25
  type ModuleExport = z.infer<typeof moduleExportSchema>;
@@ -32,15 +27,6 @@ type McpSettings = {
32
27
  tools: string[];
33
28
  isReadOnly: boolean;
34
29
  };
35
- type ResolvedFuture = {
36
- isByteArrayTyped: boolean;
37
- isValueUnwrapped: boolean;
38
- isFinishTrimmed: boolean;
39
- isInoutInPlace: boolean;
40
- isResourceImported: boolean;
41
- isAdwaitaDefault: boolean;
42
- isTreeShaken: boolean;
43
- };
44
30
  /** Configuration reduced to the values the app runtime and the build need, with paths already resolved. */
45
31
  type ResolvedConfig = {
46
32
  /** The GApplication identifier the app registers under. */
@@ -68,19 +54,22 @@ declare const moduleExportSchema: z.ZodObject<{
68
54
  }, z.core.$strip>;
69
55
  /** Schema every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */
70
56
  declare const configSchema: z.ZodObject<{
71
- future: z.ZodOptional<z.ZodObject<{
72
- v2ByteArrays: z.ZodOptional<z.ZodBoolean>;
73
- v2ValueReturns: z.ZodOptional<z.ZodBoolean>;
74
- v2FinishResults: z.ZodOptional<z.ZodBoolean>;
75
- v2InoutReturns: z.ZodOptional<z.ZodBoolean>;
76
- v2ResourceImports: z.ZodOptional<z.ZodBoolean>;
77
- v2DefaultLibraries: z.ZodOptional<z.ZodBoolean>;
78
- v2TreeShaking: z.ZodOptional<z.ZodBoolean>;
79
- }, z.core.$strip>>;
80
- libraries: z.ZodOptional<z.ZodCustom<string[] | "*", string[] | "*">>;
57
+ libraries: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
58
  girPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
82
- applicationId: z.ZodCustom<string, string>;
83
- reactCompiler: z.ZodOptional<z.ZodCustom<boolean | ReactCompilerOptions, boolean | ReactCompilerOptions>>;
59
+ applicationId: z.ZodString;
60
+ reactCompiler: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
61
+ compilationMode: z.ZodOptional<z.ZodEnum<{
62
+ infer: "infer";
63
+ syntax: "syntax";
64
+ annotation: "annotation";
65
+ all: "all";
66
+ }>>;
67
+ panicThreshold: z.ZodOptional<z.ZodEnum<{
68
+ none: "none";
69
+ critical_errors: "critical_errors";
70
+ all_errors: "all_errors";
71
+ }>>;
72
+ }, z.core.$strip>]>>;
84
73
  codegen: z.ZodOptional<z.ZodBoolean>;
85
74
  userEventSignals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
86
75
  elements: z.ZodOptional<z.ZodObject<{
@@ -106,6 +95,10 @@ declare const configSchema: z.ZodObject<{
106
95
  flatpak: "flatpak";
107
96
  rpm: "rpm";
108
97
  }>>>;
98
+ architectures: z.ZodOptional<z.ZodArray<z.ZodEnum<{
99
+ arm64: "arm64";
100
+ x64: "x64";
101
+ }>>>;
109
102
  outDir: z.ZodOptional<z.ZodString>;
110
103
  name: z.ZodOptional<z.ZodString>;
111
104
  genericName: z.ZodOptional<z.ZodString>;
@@ -173,6 +166,8 @@ declare const configSchema: z.ZodObject<{
173
166
  url: z.ZodOptional<z.ZodURL>;
174
167
  }, z.core.$strict>>>;
175
168
  execArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
169
+ launcherEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
170
+ nodeFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
171
  fileAssociations: z.ZodOptional<z.ZodArray<z.ZodObject<{
177
172
  extension: z.ZodString;
178
173
  mimeType: z.ZodString;
@@ -185,11 +180,9 @@ declare const configSchema: z.ZodObject<{
185
180
  icon: z.ZodOptional<z.ZodString>;
186
181
  }, z.core.$strict>>>;
187
182
  desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
183
+ metainfoExtra: z.ZodOptional<z.ZodArray<z.ZodString>>;
188
184
  isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
189
- extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
190
- source: z.ZodString;
191
- mode: z.ZodOptional<z.ZodString>;
192
- }, z.core.$strict>]>>>;
185
+ extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodType<import("./deploy.ts").DeployExtraFileOptions, unknown, z.core.$ZodTypeInternals<import("./deploy.ts").DeployExtraFileOptions, unknown>>]>>>;
193
186
  minimumLibraryVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
194
187
  depends: z.ZodOptional<z.ZodObject<{
195
188
  deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -231,17 +224,7 @@ declare const configSchema: z.ZodObject<{
231
224
  preRemove: z.ZodOptional<z.ZodString>;
232
225
  postRemove: z.ZodOptional<z.ZodString>;
233
226
  }, z.core.$strict>>;
234
- node: z.ZodOptional<z.ZodObject<{
235
- source: z.ZodOptional<z.ZodEnum<{
236
- path: "path";
237
- download: "download";
238
- host: "host";
239
- }>>;
240
- version: z.ZodOptional<z.ZodString>;
241
- path: z.ZodOptional<z.ZodString>;
242
- shouldStrip: z.ZodOptional<z.ZodBoolean>;
243
- shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
244
- }, z.core.$strict>>;
227
+ node: z.ZodOptional<z.ZodType<import("./deploy.ts").DeployNodeOptions, unknown, z.core.$ZodTypeInternals<import("./deploy.ts").DeployNodeOptions, unknown>>>;
245
228
  signing: z.ZodOptional<z.ZodObject<{
246
229
  appimage: z.ZodOptional<z.ZodObject<{
247
230
  gpgKeyId: z.ZodString;
@@ -345,15 +328,7 @@ declare const configSchema: z.ZodObject<{
345
328
  readOnly: z.ZodOptional<z.ZodBoolean>;
346
329
  }, z.core.$strip>>;
347
330
  deprecations: z.ZodOptional<z.ZodObject<{
348
- silence: z.ZodOptional<z.ZodArray<z.ZodEnum<{
349
- "gtkx-v2-byte-arrays": "gtkx-v2-byte-arrays";
350
- "gtkx-v2-value-returns": "gtkx-v2-value-returns";
351
- "gtkx-v2-finish-results": "gtkx-v2-finish-results";
352
- "gtkx-v2-inout-returns": "gtkx-v2-inout-returns";
353
- "gtkx-v2-resource-imports": "gtkx-v2-resource-imports";
354
- "gtkx-v2-default-libraries": "gtkx-v2-default-libraries";
355
- "gtkx-v2-tree-shaking": "gtkx-v2-tree-shaking";
356
- }>>>;
331
+ silence: z.ZodOptional<z.ZodArray<z.ZodNever>>;
357
332
  }, z.core.$strip>>;
358
333
  }, z.core.$strip>;
359
334
  /**
@@ -362,7 +337,8 @@ declare const configSchema: z.ZodObject<{
362
337
  */
363
338
  declare const defineConfig: DefineConfig<Config>;
364
339
  declare const isValidApplicationId: (applicationId: string) => boolean;
365
- declare const validateConfig: (config: Config) => void;
340
+ declare const validateConfig: (config: unknown, configFile?: string) => void;
341
+ declare const graduatedFutureKeys: (config: unknown) => string[];
366
342
  /**
367
343
  * Deep-merges a configuration over a base. `override` wins over `base` on conflicting scalar and object keys, while
368
344
  * arrays are concatenated with the `override` entries first.
@@ -375,8 +351,6 @@ declare const resolveOmittedProps: (elements: Config["elements"]) => Record<stri
375
351
  declare const isAgentRulesEnabled: (config: Config) => boolean;
376
352
  declare const isAgentReferenceEnabled: (config: Config) => boolean;
377
353
  declare const resolveMcpSettings: (config: Config) => McpSettings;
378
- declare const resolveFuture: (future: Config["future"]) => ResolvedFuture;
379
- declare const unknownFutureKeys: (future: Config["future"]) => string[];
380
354
  declare const resolveConfig: (config: Config, root?: string) => ResolvedConfig;
381
- export { APPLICATION_ID_MAX_LENGTH, defineConfig, isAgentReferenceEnabled, isAgentRulesEnabled, isValidApplicationId, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveMcpSettings, resolveOmittedProps, resolveConfig, resolveFuture, unknownFutureKeys, type McpSettings, type ResolvedReactCompilerOptions, type Config, type ResolvedConfig, type ResolvedFuture, };
355
+ export { APPLICATION_ID_MAX_LENGTH, defineConfig, isAgentReferenceEnabled, isAgentRulesEnabled, isValidApplicationId, graduatedFutureKeys, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveMcpSettings, resolveOmittedProps, resolveConfig, type McpSettings, type ResolvedReactCompilerOptions, type Config, type ResolvedConfig, };
382
356
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;AAG5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,wGAAwG;AACxG,KAAK,4BAA4B,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,0GAA0G;AAC1G,KAAK,2BAA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