@gtkx/config 2.0.0-beta.1 → 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.
- package/README.md +43 -40
- package/dist/config-dependencies.d.ts +11 -0
- package/dist/config-dependencies.d.ts.map +1 -0
- package/dist/config-dependencies.js +83 -0
- package/dist/config-dependencies.js.map +1 -0
- package/dist/config-error.d.ts +2 -2
- package/dist/config-error.d.ts.map +1 -1
- package/dist/config-error.js +6 -3
- package/dist/config-error.js.map +1 -1
- package/dist/config.d.ts +10 -16
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -5
- package/dist/config.js.map +1 -1
- package/dist/deploy.d.ts +26 -16
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +28 -3
- package/dist/deploy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +78 -15
- package/dist/loader.js.map +1 -1
- package/dist/node-version.d.ts +4 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +12 -0
- package/dist/node-version.js.map +1 -0
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js +14 -5
- package/dist/vite-plugin.js.map +1 -1
- package/dist/vite-root.d.ts +9 -0
- package/dist/vite-root.d.ts.map +1 -0
- package/dist/vite-root.js +3 -0
- package/dist/vite-root.js.map +1 -0
- package/package.json +6 -3
- package/src/config-dependencies.ts +114 -0
- package/src/config-error.ts +9 -4
- package/src/config.ts +5 -5
- package/src/deploy.ts +60 -6
- package/src/index.ts +1 -0
- package/src/internal.ts +3 -0
- package/src/loader.ts +111 -27
- package/src/node-version.ts +16 -0
- package/src/vite-plugin.ts +17 -7
- package/src/vite-root.ts +8 -0
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<h1 align="center">GTKX</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
The React framework for Linux
|
|
9
|
-
Write native
|
|
10
|
-
Real
|
|
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">
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
|
|
39
39
|
## Demo
|
|
40
40
|
|
|
41
|
-
|
|
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 {
|
|
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
|
-
<
|
|
54
|
+
<AdwApplicationWindow
|
|
54
55
|
title="Hello GTKX"
|
|
55
56
|
defaultWidth={400}
|
|
56
57
|
defaultHeight={300}
|
|
57
58
|
onCloseRequest={quit}
|
|
58
59
|
>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
<
|
|
85
|
+
<AdwApplication>
|
|
83
86
|
<Counter />
|
|
84
|
-
</
|
|
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
|
-
###
|
|
97
|
+
### Adwaita-first application development
|
|
95
98
|
|
|
96
|
-
|
|
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,17 +105,17 @@ 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
|
-
###
|
|
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
|
|
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
|
|
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
|
|
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
|
|
|
@@ -121,10 +124,10 @@ GTKX is Linux-only and needs Node.js 26.7 or later. See [Requirements](#requirem
|
|
|
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,7 +148,7 @@ 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
|
|
151
|
+
- Linux with the Adwaita (1.8 or later), GTK4 (4.20 or later), and GLib development libraries
|
|
149
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.
|
|
@@ -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):
|
|
159
|
-
- [`browser`](https://github.com/gtkx-org/gtkx/tree/main/examples/browser):
|
|
160
|
-
- [`animations`](https://github.com/gtkx-org/gtkx/tree/main/examples/animations):
|
|
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
|
|
|
@@ -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,"file":"config-dependencies.js","sourceRoot":"","sources":["../src/config-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0D,MAAM,MAAM,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKzC,MAAM,cAAc,GAAoC,IAAI,iBAAiB,EAAE,CAAC;AAChF,MAAM,mBAAmB,GAA8B,IAAI,OAAO,EAAE,CAAC;AACrE,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/F,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,eAAe,GAAG,EAAE,CAAC,CAAC;AAE5F,MAAM,OAAO,GAAG,CAAC,IAAY,EAAQ,EAAE;IACnC,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,cAAc,CAAC,QAAQ,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,GAAW,EAAQ,EAAE;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GAAG,EAAE;QACvB,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;KACnF,CAAC;IACF,MAAM,IAAI,GAAG,sBAAsB,EAAE,CAAC;IAEtC,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;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"]}
|
package/dist/config-error.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
3
|
-
declare const missingConfigFileError: (cwd: string) => Error;
|
|
4
|
-
declare const configError: (error: z.ZodError) => Error;
|
|
3
|
+
declare const missingConfigFileError: (cwd: string, configFile?: string) => Error;
|
|
4
|
+
declare const configError: (error: z.ZodError, configFile?: string) => Error;
|
|
5
5
|
export { isRecord, missingConfigFileError, configError };
|
|
6
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,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,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"}
|
package/dist/config-error.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const DEFAULT_CONFIG_FILE = "gtkx.config.*";
|
|
3
3
|
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
|
-
const
|
|
5
|
-
const
|
|
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)}`);
|
|
6
9
|
export { isRecord, missingConfigFileError, configError };
|
|
7
10
|
//# sourceMappingURL=config-error.js.map
|
package/dist/config-error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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
|
@@ -95,6 +95,10 @@ declare const configSchema: z.ZodObject<{
|
|
|
95
95
|
flatpak: "flatpak";
|
|
96
96
|
rpm: "rpm";
|
|
97
97
|
}>>>;
|
|
98
|
+
architectures: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
99
|
+
arm64: "arm64";
|
|
100
|
+
x64: "x64";
|
|
101
|
+
}>>>;
|
|
98
102
|
outDir: z.ZodOptional<z.ZodString>;
|
|
99
103
|
name: z.ZodOptional<z.ZodString>;
|
|
100
104
|
genericName: z.ZodOptional<z.ZodString>;
|
|
@@ -162,6 +166,8 @@ declare const configSchema: z.ZodObject<{
|
|
|
162
166
|
url: z.ZodOptional<z.ZodURL>;
|
|
163
167
|
}, z.core.$strict>>>;
|
|
164
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>>;
|
|
165
171
|
fileAssociations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
166
172
|
extension: z.ZodString;
|
|
167
173
|
mimeType: z.ZodString;
|
|
@@ -174,11 +180,9 @@ declare const configSchema: z.ZodObject<{
|
|
|
174
180
|
icon: z.ZodOptional<z.ZodString>;
|
|
175
181
|
}, z.core.$strict>>>;
|
|
176
182
|
desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
183
|
+
metainfoExtra: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
184
|
isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
-
extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.
|
|
179
|
-
source: z.ZodString;
|
|
180
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
181
|
-
}, 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>>]>>>;
|
|
182
186
|
minimumLibraryVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
183
187
|
depends: z.ZodOptional<z.ZodObject<{
|
|
184
188
|
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -220,17 +224,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
220
224
|
preRemove: z.ZodOptional<z.ZodString>;
|
|
221
225
|
postRemove: z.ZodOptional<z.ZodString>;
|
|
222
226
|
}, z.core.$strict>>;
|
|
223
|
-
node: z.ZodOptional<z.
|
|
224
|
-
source: z.ZodOptional<z.ZodEnum<{
|
|
225
|
-
path: "path";
|
|
226
|
-
download: "download";
|
|
227
|
-
host: "host";
|
|
228
|
-
}>>;
|
|
229
|
-
version: z.ZodOptional<z.ZodString>;
|
|
230
|
-
path: z.ZodOptional<z.ZodString>;
|
|
231
|
-
shouldStrip: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
-
shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
-
}, z.core.$strict>>;
|
|
227
|
+
node: z.ZodOptional<z.ZodType<import("./deploy.ts").DeployNodeOptions, unknown, z.core.$ZodTypeInternals<import("./deploy.ts").DeployNodeOptions, unknown>>>;
|
|
234
228
|
signing: z.ZodOptional<z.ZodObject<{
|
|
235
229
|
appimage: z.ZodOptional<z.ZodObject<{
|
|
236
230
|
gpgKeyId: z.ZodString;
|
|
@@ -343,7 +337,7 @@ declare const configSchema: z.ZodObject<{
|
|
|
343
337
|
*/
|
|
344
338
|
declare const defineConfig: DefineConfig<Config>;
|
|
345
339
|
declare const isValidApplicationId: (applicationId: string) => boolean;
|
|
346
|
-
declare const validateConfig: (config: unknown) => void;
|
|
340
|
+
declare const validateConfig: (config: unknown, configFile?: string) => void;
|
|
347
341
|
declare const graduatedFutureKeys: (config: unknown) => string[];
|
|
348
342
|
/**
|
|
349
343
|
* Deep-merges a configuration over a base. `override` wins over `base` on conflicting scalar and object keys, while
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,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QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CACpB,CAAC;AAEhE,QAAA,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,OAAyC,CAAC;AACxF,QAAA,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,OAA6C,CAAC;AAEhG,QAAA,MAAM,kBAAkB,GAAI,QAAQ,MAAM,KAAG,WAG3C,CAAC;AAEH,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,cAMrD,CAAC;AAEH,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,cAAc,GACtB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -8,14 +8,14 @@ import { girLibrary, text } from "./schema-text.js";
|
|
|
8
8
|
import { resolveUserEventSignals } from "./user-event-signals.js";
|
|
9
9
|
const APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\.[A-Za-z_][A-Za-z0-9_-]*)+$/;
|
|
10
10
|
const APPLICATION_ID_MAX_LENGTH = 255;
|
|
11
|
-
const
|
|
11
|
+
const IMPLICIT_LIBRARIES = new Set(["Adw-1", "Gtk-4.0"]);
|
|
12
12
|
/** Compilation modes `babel-plugin-react-compiler` accepts. */
|
|
13
13
|
const COMPILATION_MODES = ["infer", "syntax", "annotation", "all"];
|
|
14
14
|
/** Panic thresholds `babel-plugin-react-compiler` accepts. */
|
|
15
15
|
const PANIC_THRESHOLDS = ["none", "critical_errors", "all_errors"];
|
|
16
16
|
const REACT_COMPILER_TARGET = "19";
|
|
17
|
-
const librarySchema = girLibrary('must be of the form "Name-Version", such as "
|
|
18
|
-
.refine((library) => !
|
|
17
|
+
const librarySchema = girLibrary('must be of the form "Name-Version", such as "Adw-1"')
|
|
18
|
+
.refine((library) => !IMPLICIT_LIBRARIES.has(library), { error: "is bound implicitly; remove it" });
|
|
19
19
|
const librariesSchema = z
|
|
20
20
|
.array(librarySchema, { error: "must be a non-empty string array or omitted" })
|
|
21
21
|
.min(1, { error: "must be a non-empty string array or omitted" });
|
|
@@ -118,10 +118,10 @@ const resolveReactCompilerOptions = (setting) => {
|
|
|
118
118
|
target: REACT_COMPILER_TARGET,
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
|
-
const validateConfig = (config) => {
|
|
121
|
+
const validateConfig = (config, configFile) => {
|
|
122
122
|
const result = validationSchema.safeParse(config);
|
|
123
123
|
if (!result.success) {
|
|
124
|
-
throw configError(result.error);
|
|
124
|
+
throw configError(result.error, configFile);
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
const graduatedFutureKeys = (config) => {
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAqB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAmDlE,MAAM,sBAAsB,GAAG,uDAAuD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,CAAC;AAEhG,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAe,EAAE,CAAC,CAAC;IACzD,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;IAC9B,UAAU,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI;CAC5C,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,IAAa,EAAkB,EAAE,CAAC,CAAC;IACtE,aAAa,EAAE,MAAM,CAAC,aAAa;IACnC,aAAa,EAAE,2BAA2B,CAAC,MAAM,CAAC,aAAa,CAAC;IAChE,gBAAgB,EAAE,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAClE,QAAQ,EAAE,qBAAqB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC;IACjE,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC;CACrD,CAAC,CAAC;AAEH,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GAKhB,CAAC","sourcesContent":["import { createDefineConfig, type DefineConfig } from \"c12\";\nimport { defu } from \"defu\";\nimport { resolve } from \"node:path\";\nimport { z } from \"zod\";\nimport { configError, isRecord } from \"./config-error.ts\";\nimport { deploySchema } from \"./deploy.ts\";\nimport { girLibrary, text } from \"./schema-text.ts\";\nimport { resolveUserEventSignals } from \"./user-event-signals.ts\";\n\n/** Object form of the `reactCompiler` config key, forwarded to `babel-plugin-react-compiler`. */\ntype ReactCompilerOptions = {\n /** Which functions the compiler processes. */\n compilationMode?: (typeof COMPILATION_MODES)[number];\n /** Which compiler diagnostics fail the build. */\n panicThreshold?: (typeof PANIC_THRESHOLDS)[number];\n};\n\n/**\n * The React Compiler options the build hands to `babel-plugin-react-compiler`, with the React version\n * GTKX targets filled in.\n */\ntype ResolvedReactCompilerOptions = ReactCompilerOptions & {\n /** React major version the compiler emits for. */\n target: \"19\";\n};\n\n/**\n * User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`: the GIR libraries\n * to bind and where to find them, the GApplication id, per-element configuration, the React\n * Compiler, codegen, and user event signal settings, and the `agents` and `mcp` blocks controlling\n * what coding agents are given.\n */\ntype Config = z.infer<typeof configSchema>;\ntype ModuleExport = z.infer<typeof moduleExportSchema>;\ntype ElementConfigEntry = z.infer<typeof elementConfigSchema>;\n\ntype McpSettings = {\n tools: string[];\n isReadOnly: boolean;\n};\n\n/** Configuration reduced to the values the app runtime and the build need, with paths already resolved. */\ntype ResolvedConfig = {\n /** The GApplication identifier the app registers under. */\n applicationId: string;\n /** React Compiler options for the build, or `null` when the compiler is disabled. */\n reactCompiler: ResolvedReactCompilerOptions | null;\n /**\n * Signal names, keyed by GLib type name, that stay suppressed while a React commit writes to a widget.\n * `notify` stays suppressed only for the property being written.\n */\n userEventSignals: Record<string, string[]>;\n /** Path of the module exporting per-element configs, or `null` when none is configured. */\n elements: string | null;\n /** GLib type names of the elements marked `isLazy`, whose GObject their parent container creates. */\n lazyElements: string[];\n};\n\nconst APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\\.[A-Za-z_][A-Za-z0-9_-]*)+$/;\nconst APPLICATION_ID_MAX_LENGTH = 255;\nconst DEFAULT_LIBRARIES: Set<string> = new Set([\"Gtk-4.0\", \"Adw-1\"]);\n/** Compilation modes `babel-plugin-react-compiler` accepts. */\nconst COMPILATION_MODES = [\"infer\", \"syntax\", \"annotation\", \"all\"] as const;\n/** Panic thresholds `babel-plugin-react-compiler` accepts. */\nconst PANIC_THRESHOLDS = [\"none\", \"critical_errors\", \"all_errors\"] as const;\nconst REACT_COMPILER_TARGET = \"19\";\n\nconst librarySchema = girLibrary('must be of the form \"Name-Version\", such as \"Gtk-4.0\"')\n .refine((library) => !DEFAULT_LIBRARIES.has(library), { error: \"is bound by default; remove it\" });\n\nconst librariesSchema = z\n .array(librarySchema, { error: \"must be a non-empty string array or omitted\" })\n .min(1, { error: \"must be a non-empty string array or omitted\" });\n\nconst applicationIdSchema = z\n .string({ error: \"must satisfy g_application_id_is_valid\" })\n .refine((value) => isValidApplicationId(value), {\n error: 'must satisfy g_application_id_is_valid, such as \"org.example.MyApp\"',\n });\n\nconst reactCompilerSchema = z.union([\n z.boolean(),\n z.object({\n compilationMode: z.enum(COMPILATION_MODES).optional(),\n panicThreshold: z.enum(PANIC_THRESHOLDS).optional(),\n }),\n]);\n\nconst userEventSignalsSchema = z.record(\n z.string(),\n z.array(\n z.string({ error: \"must be a non-empty signal name\" }).min(1, { error: \"must be a non-empty signal name\" }),\n {\n error: \"must be an array of signal names\",\n },\n ),\n { error: \"must be a record of GLib type names to signal name arrays\" },\n);\n\nconst moduleExportSchema = z.object(\n {\n module: z.string({ error: \"must be a module specifier\" }).min(1, { error: \"must be a module specifier\" }),\n export: z.string({ error: \"must be an export name\" }).min(1, { error: \"must be an export name\" }),\n },\n { error: \"must be a { module, export } object\" },\n);\n\nconst elementConfigSchema = z.object({\n component: moduleExportSchema.optional(),\n props: moduleExportSchema.optional(),\n isLazy: z.boolean({ error: \"must be a boolean\" }).optional(),\n omittedProps: z\n .array(\n z.string({ error: \"must be a non-empty property name\" }).min(1, {\n error: \"must be a non-empty property name\",\n }),\n { error: \"must be an array of property names\" },\n )\n .optional(),\n});\n\nconst elementsSchema = z.object({\n behaviors: z\n .string({ error: \"must be a path to a module exporting element behaviors\" })\n .min(1, { error: \"must be a path to a module exporting element behaviors\" })\n .optional(),\n config: z.record(z.string(), elementConfigSchema).optional(),\n});\n\nconst agentsSchema = z.object({\n rules: z.boolean({ error: \"must be a boolean\" }).optional(),\n reference: z.boolean({ error: \"must be a boolean\" }).optional(),\n});\n\nconst mcpSchema = z.object({\n tools: z\n .array(z.string({ error: \"must be a tool name pattern\" }).min(1, { error: \"must be a tool name pattern\" }), {\n error: \"must be an array of tool name patterns\",\n })\n .optional(),\n readOnly: z.boolean({ error: \"must be a boolean\" }).optional(),\n});\n\nconst graduatedFutureSchema = z\n .object({\n v2ByteArrays: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2ValueReturns: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2FinishResults: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2InoutReturns: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2ResourceImports: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2DefaultLibraries: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2TreeShaking: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n })\n .strict();\n\nconst deprecationsSchema = z.object({\n silence: z\n .array(z.never({ error: \"does not name a current deprecation\" }), {\n error: \"must be an array of current deprecation ids\",\n })\n .optional(),\n});\n\n/** Schema every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */\nconst configSchema = z.object({\n libraries: librariesSchema.optional(),\n girPath: z.array(z.string(), { error: \"must be an array of strings if provided\" }).optional(),\n applicationId: applicationIdSchema,\n reactCompiler: reactCompilerSchema.optional(),\n codegen: z.boolean({ error: \"must be a boolean\" }).optional(),\n userEventSignals: userEventSignalsSchema.optional(),\n elements: elementsSchema.optional(),\n applicationIcon: text(\"must be a path to an icon theme directory or a single icon file\").optional(),\n deploy: deploySchema.optional(),\n agents: agentsSchema.optional(),\n mcp: mcpSchema.optional(),\n deprecations: deprecationsSchema.optional(),\n});\n\n/**\n * Returns the given configuration unchanged, typed as {@link Config}, so `gtkx.config.ts` gets\n * autocompletion and type checking.\n */\nconst defineConfig: DefineConfig<Config> = createDefineConfig<Config>();\nconst validationSchema = configSchema.extend({ future: graduatedFutureSchema.optional() });\n\nconst isValidApplicationId = (applicationId: string): boolean =>\n applicationId.length <= APPLICATION_ID_MAX_LENGTH && APPLICATION_ID_PATTERN.test(applicationId);\n\nconst resolveReactCompilerOptions = (setting: Config[\"reactCompiler\"]): ResolvedReactCompilerOptions | null => {\n if (setting === false) {\n return null;\n }\n\n const overrides = setting === undefined || setting === true ? {} : setting;\n\n return {\n ...(overrides.compilationMode !== undefined && { compilationMode: overrides.compilationMode }),\n ...(overrides.panicThreshold !== undefined && { panicThreshold: overrides.panicThreshold }),\n target: REACT_COMPILER_TARGET,\n };\n};\n\nconst validateConfig = (config: unknown): void => {\n const result = validationSchema.safeParse(config);\n\n if (!result.success) {\n throw configError(result.error);\n }\n};\n\nconst graduatedFutureKeys = (config: unknown): string[] => {\n if (!isRecord(config) || !isRecord(config.future)) {\n return [];\n }\n\n return Object.keys(config.future).toSorted((first, second) => first.localeCompare(second));\n};\n\n/**\n * Deep-merges a configuration over a base. `override` wins over `base` on conflicting scalar and object keys, while\n * arrays are concatenated with the `override` entries first.\n */\nconst mergeConfig = (base: Config, override: Config): Config => defu(override, base);\n\nconst resolveElementsModule = (behaviors: string | undefined, root: string | undefined): string | null => {\n if (behaviors === undefined) {\n return null;\n }\n\n return root === undefined ? behaviors : resolve(root, behaviors);\n};\n\nconst resolveLazyElements = (elements: Config[\"elements\"]): string[] =>\n Object.entries(elements?.config ?? {})\n .filter(([, entry]) => entry.isLazy === true)\n .map(([type]) => type);\n\nconst elementEntryValues = <T>(\n elements: Config[\"elements\"],\n pick: (entry: ElementConfigEntry) => T | undefined,\n): Record<string, T> =>\n Object.fromEntries(\n Object.entries(elements?.config ?? {}).flatMap(([type, entry]) => {\n const value = pick(entry);\n\n return value === undefined ? [] : [[type, value] as const];\n }),\n );\n\nconst resolveElementComponents = (elements: Config[\"elements\"]): Record<string, ModuleExport> =>\n elementEntryValues(elements, (entry) => entry.component);\n\nconst resolveElementProps = (elements: Config[\"elements\"]): Record<string, ModuleExport> =>\n elementEntryValues(elements, (entry) => entry.props);\n\nconst resolveOmittedProps = (elements: Config[\"elements\"]): Record<string, string[]> =>\n elementEntryValues(elements, (entry) => entry.omittedProps);\n\nconst isAgentRulesEnabled = (config: Config): boolean => config.agents?.rules !== false;\nconst isAgentReferenceEnabled = (config: Config): boolean => config.agents?.reference !== false;\n\nconst resolveMcpSettings = (config: Config): McpSettings => ({\n tools: config.mcp?.tools ?? [],\n isReadOnly: config.mcp?.readOnly === true,\n});\n\nconst resolveConfig = (config: Config, root?: string): ResolvedConfig => ({\n applicationId: config.applicationId,\n reactCompiler: resolveReactCompilerOptions(config.reactCompiler),\n userEventSignals: resolveUserEventSignals(config.userEventSignals),\n elements: resolveElementsModule(config.elements?.behaviors, root),\n lazyElements: resolveLazyElements(config.elements),\n});\n\nexport {\n APPLICATION_ID_MAX_LENGTH,\n defineConfig,\n isAgentReferenceEnabled,\n isAgentRulesEnabled,\n isValidApplicationId,\n graduatedFutureKeys,\n validateConfig,\n mergeConfig,\n resolveLazyElements,\n resolveElementComponents,\n resolveElementProps,\n resolveMcpSettings,\n resolveOmittedProps,\n resolveConfig,\n type McpSettings,\n type ResolvedReactCompilerOptions,\n type Config,\n type ResolvedConfig,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAqB,MAAM,KAAK,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAmDlE,MAAM,sBAAsB,GAAG,uDAAuD,CAAC;AACvF,MAAM,yBAAyB,GAA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AEhG,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAe,EAAE,CAAC,CAAC;IACzD,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;IAC9B,UAAU,EAAE,MAAM,CAAC,GAAG,EAAE,QAAQ,KAAK,IAAI;CAC5C,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,MAAc,EAAE,IAAa,EAAkB,EAAE,CAAC,CAAC;IACtE,aAAa,EAAE,MAAM,CAAC,aAAa;IACnC,aAAa,EAAE,2BAA2B,CAAC,MAAM,CAAC,aAAa,CAAC;IAChE,gBAAgB,EAAE,uBAAuB,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAClE,QAAQ,EAAE,qBAAqB,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC;IACjE,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,QAAQ,CAAC;CACrD,CAAC,CAAC;AAEH,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GAKhB,CAAC","sourcesContent":["import { createDefineConfig, type DefineConfig } from \"c12\";\nimport { defu } from \"defu\";\nimport { resolve } from \"node:path\";\nimport { z } from \"zod\";\nimport { configError, isRecord } from \"./config-error.ts\";\nimport { deploySchema } from \"./deploy.ts\";\nimport { girLibrary, text } from \"./schema-text.ts\";\nimport { resolveUserEventSignals } from \"./user-event-signals.ts\";\n\n/** Object form of the `reactCompiler` config key, forwarded to `babel-plugin-react-compiler`. */\ntype ReactCompilerOptions = {\n /** Which functions the compiler processes. */\n compilationMode?: (typeof COMPILATION_MODES)[number];\n /** Which compiler diagnostics fail the build. */\n panicThreshold?: (typeof PANIC_THRESHOLDS)[number];\n};\n\n/**\n * The React Compiler options the build hands to `babel-plugin-react-compiler`, with the React version\n * GTKX targets filled in.\n */\ntype ResolvedReactCompilerOptions = ReactCompilerOptions & {\n /** React major version the compiler emits for. */\n target: \"19\";\n};\n\n/**\n * User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`: the GIR libraries\n * to bind and where to find them, the GApplication id, per-element configuration, the React\n * Compiler, codegen, and user event signal settings, and the `agents` and `mcp` blocks controlling\n * what coding agents are given.\n */\ntype Config = z.infer<typeof configSchema>;\ntype ModuleExport = z.infer<typeof moduleExportSchema>;\ntype ElementConfigEntry = z.infer<typeof elementConfigSchema>;\n\ntype McpSettings = {\n tools: string[];\n isReadOnly: boolean;\n};\n\n/** Configuration reduced to the values the app runtime and the build need, with paths already resolved. */\ntype ResolvedConfig = {\n /** The GApplication identifier the app registers under. */\n applicationId: string;\n /** React Compiler options for the build, or `null` when the compiler is disabled. */\n reactCompiler: ResolvedReactCompilerOptions | null;\n /**\n * Signal names, keyed by GLib type name, that stay suppressed while a React commit writes to a widget.\n * `notify` stays suppressed only for the property being written.\n */\n userEventSignals: Record<string, string[]>;\n /** Path of the module exporting per-element configs, or `null` when none is configured. */\n elements: string | null;\n /** GLib type names of the elements marked `isLazy`, whose GObject their parent container creates. */\n lazyElements: string[];\n};\n\nconst APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\\.[A-Za-z_][A-Za-z0-9_-]*)+$/;\nconst APPLICATION_ID_MAX_LENGTH = 255;\nconst IMPLICIT_LIBRARIES: Set<string> = new Set([\"Adw-1\", \"Gtk-4.0\"]);\n/** Compilation modes `babel-plugin-react-compiler` accepts. */\nconst COMPILATION_MODES = [\"infer\", \"syntax\", \"annotation\", \"all\"] as const;\n/** Panic thresholds `babel-plugin-react-compiler` accepts. */\nconst PANIC_THRESHOLDS = [\"none\", \"critical_errors\", \"all_errors\"] as const;\nconst REACT_COMPILER_TARGET = \"19\";\n\nconst librarySchema = girLibrary('must be of the form \"Name-Version\", such as \"Adw-1\"')\n .refine((library) => !IMPLICIT_LIBRARIES.has(library), { error: \"is bound implicitly; remove it\" });\n\nconst librariesSchema = z\n .array(librarySchema, { error: \"must be a non-empty string array or omitted\" })\n .min(1, { error: \"must be a non-empty string array or omitted\" });\n\nconst applicationIdSchema = z\n .string({ error: \"must satisfy g_application_id_is_valid\" })\n .refine((value) => isValidApplicationId(value), {\n error: 'must satisfy g_application_id_is_valid, such as \"org.example.MyApp\"',\n });\n\nconst reactCompilerSchema = z.union([\n z.boolean(),\n z.object({\n compilationMode: z.enum(COMPILATION_MODES).optional(),\n panicThreshold: z.enum(PANIC_THRESHOLDS).optional(),\n }),\n]);\n\nconst userEventSignalsSchema = z.record(\n z.string(),\n z.array(\n z.string({ error: \"must be a non-empty signal name\" }).min(1, { error: \"must be a non-empty signal name\" }),\n {\n error: \"must be an array of signal names\",\n },\n ),\n { error: \"must be a record of GLib type names to signal name arrays\" },\n);\n\nconst moduleExportSchema = z.object(\n {\n module: z.string({ error: \"must be a module specifier\" }).min(1, { error: \"must be a module specifier\" }),\n export: z.string({ error: \"must be an export name\" }).min(1, { error: \"must be an export name\" }),\n },\n { error: \"must be a { module, export } object\" },\n);\n\nconst elementConfigSchema = z.object({\n component: moduleExportSchema.optional(),\n props: moduleExportSchema.optional(),\n isLazy: z.boolean({ error: \"must be a boolean\" }).optional(),\n omittedProps: z\n .array(\n z.string({ error: \"must be a non-empty property name\" }).min(1, {\n error: \"must be a non-empty property name\",\n }),\n { error: \"must be an array of property names\" },\n )\n .optional(),\n});\n\nconst elementsSchema = z.object({\n behaviors: z\n .string({ error: \"must be a path to a module exporting element behaviors\" })\n .min(1, { error: \"must be a path to a module exporting element behaviors\" })\n .optional(),\n config: z.record(z.string(), elementConfigSchema).optional(),\n});\n\nconst agentsSchema = z.object({\n rules: z.boolean({ error: \"must be a boolean\" }).optional(),\n reference: z.boolean({ error: \"must be a boolean\" }).optional(),\n});\n\nconst mcpSchema = z.object({\n tools: z\n .array(z.string({ error: \"must be a tool name pattern\" }).min(1, { error: \"must be a tool name pattern\" }), {\n error: \"must be an array of tool name patterns\",\n })\n .optional(),\n readOnly: z.boolean({ error: \"must be a boolean\" }).optional(),\n});\n\nconst graduatedFutureSchema = z\n .object({\n v2ByteArrays: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2ValueReturns: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2FinishResults: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2InoutReturns: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2ResourceImports: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2DefaultLibraries: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n v2TreeShaking: z.literal(true, { error: \"can only be true; remove the flag\" }).optional(),\n })\n .strict();\n\nconst deprecationsSchema = z.object({\n silence: z\n .array(z.never({ error: \"does not name a current deprecation\" }), {\n error: \"must be an array of current deprecation ids\",\n })\n .optional(),\n});\n\n/** Schema every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */\nconst configSchema = z.object({\n libraries: librariesSchema.optional(),\n girPath: z.array(z.string(), { error: \"must be an array of strings if provided\" }).optional(),\n applicationId: applicationIdSchema,\n reactCompiler: reactCompilerSchema.optional(),\n codegen: z.boolean({ error: \"must be a boolean\" }).optional(),\n userEventSignals: userEventSignalsSchema.optional(),\n elements: elementsSchema.optional(),\n applicationIcon: text(\"must be a path to an icon theme directory or a single icon file\").optional(),\n deploy: deploySchema.optional(),\n agents: agentsSchema.optional(),\n mcp: mcpSchema.optional(),\n deprecations: deprecationsSchema.optional(),\n});\n\n/**\n * Returns the given configuration unchanged, typed as {@link Config}, so `gtkx.config.ts` gets\n * autocompletion and type checking.\n */\nconst defineConfig: DefineConfig<Config> = createDefineConfig<Config>();\nconst validationSchema = configSchema.extend({ future: graduatedFutureSchema.optional() });\n\nconst isValidApplicationId = (applicationId: string): boolean =>\n applicationId.length <= APPLICATION_ID_MAX_LENGTH && APPLICATION_ID_PATTERN.test(applicationId);\n\nconst resolveReactCompilerOptions = (setting: Config[\"reactCompiler\"]): ResolvedReactCompilerOptions | null => {\n if (setting === false) {\n return null;\n }\n\n const overrides = setting === undefined || setting === true ? {} : setting;\n\n return {\n ...(overrides.compilationMode !== undefined && { compilationMode: overrides.compilationMode }),\n ...(overrides.panicThreshold !== undefined && { panicThreshold: overrides.panicThreshold }),\n target: REACT_COMPILER_TARGET,\n };\n};\n\nconst validateConfig = (config: unknown, configFile?: string): void => {\n const result = validationSchema.safeParse(config);\n\n if (!result.success) {\n throw configError(result.error, configFile);\n }\n};\n\nconst graduatedFutureKeys = (config: unknown): string[] => {\n if (!isRecord(config) || !isRecord(config.future)) {\n return [];\n }\n\n return Object.keys(config.future).toSorted((first, second) => first.localeCompare(second));\n};\n\n/**\n * Deep-merges a configuration over a base. `override` wins over `base` on conflicting scalar and object keys, while\n * arrays are concatenated with the `override` entries first.\n */\nconst mergeConfig = (base: Config, override: Config): Config => defu(override, base);\n\nconst resolveElementsModule = (behaviors: string | undefined, root: string | undefined): string | null => {\n if (behaviors === undefined) {\n return null;\n }\n\n return root === undefined ? behaviors : resolve(root, behaviors);\n};\n\nconst resolveLazyElements = (elements: Config[\"elements\"]): string[] =>\n Object.entries(elements?.config ?? {})\n .filter(([, entry]) => entry.isLazy === true)\n .map(([type]) => type);\n\nconst elementEntryValues = <T>(\n elements: Config[\"elements\"],\n pick: (entry: ElementConfigEntry) => T | undefined,\n): Record<string, T> =>\n Object.fromEntries(\n Object.entries(elements?.config ?? {}).flatMap(([type, entry]) => {\n const value = pick(entry);\n\n return value === undefined ? [] : [[type, value] as const];\n }),\n );\n\nconst resolveElementComponents = (elements: Config[\"elements\"]): Record<string, ModuleExport> =>\n elementEntryValues(elements, (entry) => entry.component);\n\nconst resolveElementProps = (elements: Config[\"elements\"]): Record<string, ModuleExport> =>\n elementEntryValues(elements, (entry) => entry.props);\n\nconst resolveOmittedProps = (elements: Config[\"elements\"]): Record<string, string[]> =>\n elementEntryValues(elements, (entry) => entry.omittedProps);\n\nconst isAgentRulesEnabled = (config: Config): boolean => config.agents?.rules !== false;\nconst isAgentReferenceEnabled = (config: Config): boolean => config.agents?.reference !== false;\n\nconst resolveMcpSettings = (config: Config): McpSettings => ({\n tools: config.mcp?.tools ?? [],\n isReadOnly: config.mcp?.readOnly === true,\n});\n\nconst resolveConfig = (config: Config, root?: string): ResolvedConfig => ({\n applicationId: config.applicationId,\n reactCompiler: resolveReactCompilerOptions(config.reactCompiler),\n userEventSignals: resolveUserEventSignals(config.userEventSignals),\n elements: resolveElementsModule(config.elements?.behaviors, root),\n lazyElements: resolveLazyElements(config.elements),\n});\n\nexport {\n APPLICATION_ID_MAX_LENGTH,\n defineConfig,\n isAgentReferenceEnabled,\n isAgentRulesEnabled,\n isValidApplicationId,\n graduatedFutureKeys,\n validateConfig,\n mergeConfig,\n resolveLazyElements,\n resolveElementComponents,\n resolveElementProps,\n resolveMcpSettings,\n resolveOmittedProps,\n resolveConfig,\n type McpSettings,\n type ResolvedReactCompilerOptions,\n type Config,\n type ResolvedConfig,\n};\n"]}
|
package/dist/deploy.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is
|
|
4
|
+
* installed at the entry's prefix-relative destination, and the octal mode it is installed with.
|
|
5
|
+
*/
|
|
6
|
+
type DeployExtraFileOptions = Record<"source", string> & {
|
|
7
|
+
/** Octal file mode. Setuid and setgid bits are rejected. */
|
|
8
|
+
mode?: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it
|
|
12
|
+
* is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.
|
|
13
|
+
*/
|
|
14
|
+
type DeployNodeOptions = Partial<Record<"source", "download" | "host" | "path" | undefined> & Record<"path", string | undefined> & Record<"shouldStrip" | "shouldUseCompileCache", boolean | undefined>> & {
|
|
15
|
+
/** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */
|
|
16
|
+
version?: string | undefined;
|
|
17
|
+
};
|
|
2
18
|
declare const deploySchema: z.ZodObject<{
|
|
3
19
|
targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
4
20
|
appimage: "appimage";
|
|
@@ -6,6 +22,10 @@ declare const deploySchema: z.ZodObject<{
|
|
|
6
22
|
flatpak: "flatpak";
|
|
7
23
|
rpm: "rpm";
|
|
8
24
|
}>>>;
|
|
25
|
+
architectures: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
26
|
+
arm64: "arm64";
|
|
27
|
+
x64: "x64";
|
|
28
|
+
}>>>;
|
|
9
29
|
outDir: z.ZodOptional<z.ZodString>;
|
|
10
30
|
name: z.ZodOptional<z.ZodString>;
|
|
11
31
|
genericName: z.ZodOptional<z.ZodString>;
|
|
@@ -73,6 +93,8 @@ declare const deploySchema: z.ZodObject<{
|
|
|
73
93
|
url: z.ZodOptional<z.ZodURL>;
|
|
74
94
|
}, z.core.$strict>>>;
|
|
75
95
|
execArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
96
|
+
launcherEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
97
|
+
nodeFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
76
98
|
fileAssociations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
77
99
|
extension: z.ZodString;
|
|
78
100
|
mimeType: z.ZodString;
|
|
@@ -85,11 +107,9 @@ declare const deploySchema: z.ZodObject<{
|
|
|
85
107
|
icon: z.ZodOptional<z.ZodString>;
|
|
86
108
|
}, z.core.$strict>>>;
|
|
87
109
|
desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
110
|
+
metainfoExtra: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
111
|
isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
-
extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.
|
|
90
|
-
source: z.ZodString;
|
|
91
|
-
mode: z.ZodOptional<z.ZodString>;
|
|
92
|
-
}, z.core.$strict>]>>>;
|
|
112
|
+
extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodType<DeployExtraFileOptions, unknown, z.core.$ZodTypeInternals<DeployExtraFileOptions, unknown>>]>>>;
|
|
93
113
|
minimumLibraryVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
94
114
|
depends: z.ZodOptional<z.ZodObject<{
|
|
95
115
|
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -131,17 +151,7 @@ declare const deploySchema: z.ZodObject<{
|
|
|
131
151
|
preRemove: z.ZodOptional<z.ZodString>;
|
|
132
152
|
postRemove: z.ZodOptional<z.ZodString>;
|
|
133
153
|
}, z.core.$strict>>;
|
|
134
|
-
node: z.ZodOptional<z.
|
|
135
|
-
source: z.ZodOptional<z.ZodEnum<{
|
|
136
|
-
path: "path";
|
|
137
|
-
download: "download";
|
|
138
|
-
host: "host";
|
|
139
|
-
}>>;
|
|
140
|
-
version: z.ZodOptional<z.ZodString>;
|
|
141
|
-
path: z.ZodOptional<z.ZodString>;
|
|
142
|
-
shouldStrip: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
-
shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
|
|
144
|
-
}, z.core.$strict>>;
|
|
154
|
+
node: z.ZodOptional<z.ZodType<DeployNodeOptions, unknown, z.core.$ZodTypeInternals<DeployNodeOptions, unknown>>>;
|
|
145
155
|
signing: z.ZodOptional<z.ZodObject<{
|
|
146
156
|
appimage: z.ZodOptional<z.ZodObject<{
|
|
147
157
|
gpgKeyId: z.ZodString;
|
|
@@ -236,5 +246,5 @@ declare const deploySchema: z.ZodObject<{
|
|
|
236
246
|
prefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
237
247
|
}, z.core.$strict>>;
|
|
238
248
|
}, z.core.$strict>;
|
|
239
|
-
export { deploySchema };
|
|
249
|
+
export { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };
|
|
240
250
|
//# sourceMappingURL=deploy.d.ts.map
|
package/dist/deploy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuHxB;;;GAGG;AACH,KAAK,sBAAsB,GAAG,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG;IACrD,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AA2BF;;;GAGG;AACH,KAAK,iBAAiB,GAAG,OAAO,CAC5B,MAAM,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,GAC1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAClC,MAAM,CAAC,aAAa,GAAG,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC,CACvE,GAAG;IACA,4FAA4F;IAC5F,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC,CAAC;AA2GF,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwEhB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,CAAC"}
|