@gtkx/config 2.0.0-beta.6 → 2.0.0-beta.7
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.js +3 -3
- package/dist/config.js.map +1 -1
- package/dist/deploy.js +1 -1
- package/dist/deploy.js.map +1 -1
- package/package.json +5 -3
- package/src/config.ts +3 -3
- package/src/deploy.ts +1 -1
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
|
|
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" });
|
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,CAAC;AACvF,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,iBAAiB,GAAgB,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AACrE,+DAA+D;AAC/D,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAU,CAAC;AAC5E,8DAA8D;AAC9D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,YAAY,CAAU,CAAC;AAC5E,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,aAAa,GAAG,UAAU,CAAC,uDAAuD,CAAC;KACpF,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,iBAAiB,C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AAqB,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, 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"]}
|
|
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,GAAG,GAAG,CAAC;AACtC,MAAM,kBAAkB,GAAgB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;AACtE,+DAA+D;AAC/D,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAU,CAAC;AAC5E,8DAA8D;AAC9D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,YAAY,CAAU,CAAC;AAC5E,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC,MAAM,aAAa,GAAG,UAAU,CAAC,qDAAqD,CAAC;KAClF,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,kBA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E,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.js
CHANGED
|
@@ -40,7 +40,7 @@ const MINIMUM_LIBRARY_VERSION_ERROR = "must be a version such as 4.18";
|
|
|
40
40
|
const MINIMUM_LIBRARY_VERSION_PATTERN = /^\d+(?:\.\d+)*$/;
|
|
41
41
|
const MINIMUM_LIBRARY_VERSIONS_ERROR = "must be a record of GIR library ids to a minimum version";
|
|
42
42
|
const NODE_FLAG_ERROR = "must be a Node.js flag beginning with a hyphen and containing no null bytes";
|
|
43
|
-
const LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form "Name-Version", such as "
|
|
43
|
+
const LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form "Name-Version", such as "Adw-1"';
|
|
44
44
|
const SCRIPT_ERROR = "must be a path to a shell script";
|
|
45
45
|
const SOURCE_PATH_ERROR = "must be a source path";
|
|
46
46
|
const SPDX_ERROR = "must be an SPDX license expression";
|
package/dist/deploy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,GAAG,GACN,MAAM,kBAAkB,CAAC;AAE1B,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC;AAC9D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CA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E;CAC5B,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAuD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n fileExtension,\n flag,\n girLibrary,\n relativePathRecord,\n text,\n textList,\n textRecord,\n url,\n} from \"./schema-text.ts\";\n\nconst APPIMAGE_COMPRESSIONS = [\"gzip\", \"xz\", \"zstd\"] as const;\nconst DEB_COMPRESSIONS = [\"gzip\", \"none\", \"xz\", \"zstd\"] as const;\nconst DEB_SIGN_METHODS = [\"debsign\", \"dpkg-sig\"] as const;\nconst DEB_SIGN_TYPES = [\"archive\", \"maint\", \"origin\"] as const;\nconst DEPLOY_TARGET_NAMES = [\"appimage\", \"deb\", \"flatpak\", \"rpm\"] as const;\nconst FLATPAK_MODES = [\"prebuilt\", \"source\"] as const;\nconst NODE_SOURCES = [\"download\", \"host\", \"path\"] as const;\nconst OARS_INTENSITIES = [\"intense\", \"mild\", \"moderate\", \"none\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\"] as const;\nconst RELEASE_TYPES = [\"development\", \"snapshot\", \"stable\"] as const;\nconst RELEASE_URGENCIES = [\"critical\", \"high\", \"low\", \"medium\"] as const;\nconst RPM_COMPRESSIONS = [\"gzip\", \"lzma\", \"xz\", \"zstd\"] as const;\n\nconst URL_KINDS = [\n \"bugtracker\",\n \"contact\",\n \"contribute\",\n \"donation\",\n \"faq\",\n \"help\",\n \"translate\",\n \"vcs-browser\",\n] as const;\n\nconst BOOLEAN_ERROR = \"must be a boolean\";\nconst EPOCH_ERROR = \"must be a non-negative integer\";\nconst EXTRA_FILE_ERROR = \"must be a source path or a { source, mode } entry\";\nconst FILE_MODE_ERROR = \"must be an octal file mode without setuid or setgid bits, such as 755\";\nconst FILE_MODE_PATTERN = /^[0-7]{3,4}$/;\nconst FILE_MODE_RADIX = 8;\nconst PRIVILEGED_FILE_MODE_MASK = 0o6000;\nconst HEX_COLOR_ERROR = \"must be a #rrggbb color\";\nconst HEX_COLOR_PATTERN = /^#[\\dA-Fa-f]{6}$/;\nconst KEY_FILE_ERROR = \"must be a path to a PGP key file\";\nconst KEY_ID_ERROR = \"must be a PGP key id\";\nconst LAUNCHER_ENV_ERROR = \"must be a record of POSIX environment names to values without null bytes\";\nconst LAUNCHER_ENV_NAME_ERROR = \"must be a POSIX environment name\";\nconst LAUNCHER_ENV_NAME_PATTERN = /^[A-Za-z_]\\w*$/;\nconst MINIMUM_LIBRARY_VERSION_ERROR = \"must be a version such as 4.18\";\nconst MINIMUM_LIBRARY_VERSION_PATTERN = /^\\d+(?:\\.\\d+)*$/;\nconst MINIMUM_LIBRARY_VERSIONS_ERROR = \"must be a record of GIR library ids to a minimum version\";\nconst NODE_FLAG_ERROR = \"must be a Node.js flag beginning with a hyphen and containing no null bytes\";\nconst LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form \"Name-Version\", such as \"Gtk-4.0\"';\nconst SCRIPT_ERROR = \"must be a path to a shell script\";\nconst SOURCE_PATH_ERROR = \"must be a source path\";\nconst SPDX_ERROR = \"must be an SPDX license expression\";\nconst URL_ERROR = \"must be an absolute URL\";\nconst VERSION_ERROR = \"must be a version string\";\nconst hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });\n\nconst minimumLibraryVersionSchema = z\n .string({ error: MINIMUM_LIBRARY_VERSION_ERROR })\n .regex(MINIMUM_LIBRARY_VERSION_PATTERN, { error: MINIMUM_LIBRARY_VERSION_ERROR });\n\nconst minimumLibraryVersionsSchema = z.record(girLibrary(LIBRARY_ID_ERROR), minimumLibraryVersionSchema, {\n error: MINIMUM_LIBRARY_VERSIONS_ERROR,\n});\n\nconst relationsSchema = z.strictObject({\n deb: textList(\"Debian package relation\", \"must be an array of Debian package relations\").optional(),\n rpm: textList(\"RPM package relation\", \"must be an array of RPM package relations\").optional(),\n});\n\nconst developerSchema = z.strictObject({\n id: text(\"must be a reverse-DNS developer id\").optional(),\n name: text(\"must be a developer or organization name\").optional(),\n email: text(\"must be an email address\").optional(),\n});\n\nconst screenshotSchema = z\n .strictObject({\n url: url(\"must be an absolute URL to a PNG or JPEG\").optional(),\n file: text(\"must be an image path relative to the project root\").optional(),\n caption: text(\"must be a screenshot caption\").optional(),\n isDefault: flag(BOOLEAN_ERROR).optional(),\n })\n .refine((entry) => entry.url !== undefined || entry.file !== undefined, {\n error: \"must have either a `url` or a `file`\",\n });\n\nconst releaseSchema = z.strictObject({\n version: text(VERSION_ERROR),\n date: z.iso.date({ error: \"must be an ISO date (YYYY-MM-DD)\" }),\n type: z.enum(RELEASE_TYPES, { error: \"must be one of development, snapshot, stable\" }).optional(),\n urgency: z.enum(RELEASE_URGENCIES, { error: \"must be one of critical, high, low, medium\" }).optional(),\n notes: textList(\"release note paragraph\", \"must be an array of release note paragraphs\").optional(),\n url: url(URL_ERROR).optional(),\n});\n\nconst fileAssociationSchema = z.strictObject({\n extension: fileExtension(\"must be a file extension without a leading dot\"),\n mimeType: text(\"must be a MIME type such as text/plain\"),\n description: text(\"must be a description of the file type\").optional(),\n});\n\nconst desktopActionSchema = z.strictObject({\n name: text(\"must be an action name\"),\n args: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n icon: text(\"must be an icon name\").optional(),\n});\n\nconst brandingSchema = z.strictObject({\n light: hexColorSchema,\n dark: hexColorSchema,\n});\n\n/**\n * A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is\n * installed at the entry's prefix-relative destination, and the octal mode it is installed with.\n */\ntype DeployExtraFileOptions = Record<\"source\", string> & {\n /** Octal file mode. Setuid and setgid bits are rejected. */\n mode?: string | undefined;\n};\nconst extraFileSchema: z.ZodType<DeployExtraFileOptions> = z.strictObject({\n source: text(SOURCE_PATH_ERROR),\n mode: z\n .string({ error: FILE_MODE_ERROR })\n .regex(FILE_MODE_PATTERN, { error: FILE_MODE_ERROR })\n .refine((mode) => (Number.parseInt(mode, FILE_MODE_RADIX) & PRIVILEGED_FILE_MODE_MASK) === 0, {\n error: FILE_MODE_ERROR,\n })\n .optional(),\n});\n\nconst extraFileEntrySchema = z.union([text(SOURCE_PATH_ERROR), extraFileSchema], { error: EXTRA_FILE_ERROR });\n\nconst launcherEnvSchema = z.record(\n z.string({ error: LAUNCHER_ENV_NAME_ERROR }).regex(LAUNCHER_ENV_NAME_PATTERN, { error: LAUNCHER_ENV_NAME_ERROR }),\n z.string({ error: LAUNCHER_ENV_ERROR }).refine((value) => !value.includes(\"\\0\"), { error: LAUNCHER_ENV_ERROR }),\n { error: (issue) => issue.code === \"invalid_key\" ? LAUNCHER_ENV_NAME_ERROR : LAUNCHER_ENV_ERROR },\n);\n\nconst nodeFlagsSchema = z.array(\n z\n .string({ error: NODE_FLAG_ERROR })\n .refine((value) => value.startsWith(\"-\") && !value.includes(\"\\0\"), { error: NODE_FLAG_ERROR }),\n { error: \"must be an array of Node.js flags\" },\n);\n\n/**\n * The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it\n * is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.\n */\ntype DeployNodeOptions = Partial<\n Record<\"source\", \"download\" | \"host\" | \"path\" | undefined> &\n Record<\"path\", string | undefined> &\n Record<\"shouldStrip\" | \"shouldUseCompileCache\", boolean | undefined>\n> & {\n /** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */\n version?: string | undefined;\n};\nconst nodeRuntimeSchema: z.ZodType<DeployNodeOptions> = z.strictObject({\n source: z.enum(NODE_SOURCES, { error: \"must be one of download, host, path\" }).optional(),\n version: text(\"must be a Node.js version such as 26.7.0\").optional(),\n path: text(\"must be a path to a node binary\").optional(),\n shouldStrip: flag(BOOLEAN_ERROR).optional(),\n shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst scriptsSchema = z.strictObject({\n preInstall: text(SCRIPT_ERROR).optional(),\n postInstall: text(SCRIPT_ERROR).optional(),\n preRemove: text(SCRIPT_ERROR).optional(),\n postRemove: text(SCRIPT_ERROR).optional(),\n});\n\nconst debSchema = z.strictObject({\n packageName: text(\"must be a Debian package name\").optional(),\n section: text(\"must be a Debian archive section\").optional(),\n priority: text(\"must be a Debian priority\").optional(),\n compression: z.enum(DEB_COMPRESSIONS, { error: \"must be one of gzip, none, xz, zstd\" }).optional(),\n fields: textRecord(\"must be a control field value\", \"must be a record of control field names to values\")\n .optional(),\n});\n\nconst rpmSchema = z.strictObject({\n packageName: text(\"must be an RPM package name\").optional(),\n group: text(\"must be an RPM group\").optional(),\n compression: z.enum(RPM_COMPRESSIONS, { error: \"must be one of gzip, lzma, xz, zstd\" }).optional(),\n prefixes: textList(\"prefix\", \"must be an array of relocation prefixes\").optional(),\n});\n\nconst appimageSchema = z.strictObject({\n fileName: text(\"must be an output file name\").optional(),\n compression: z.enum(APPIMAGE_COMPRESSIONS, { error: \"must be one of gzip, xz, zstd\" }).optional(),\n updateInformation: text(\"must be an AppImage update information string\").optional(),\n runtimeFile: text(\"must be a path to an AppImage runtime file\").optional(),\n});\n\nconst flatpakSourceSchema = z.strictObject({\n url: url(\"must be an absolute git URL\").optional(),\n tag: text(\"must be a git tag\").optional(),\n commit: text(\"must be a git commit sha\").optional(),\n});\n\nconst flatpakSchema = z.strictObject({\n mode: z.enum(FLATPAK_MODES, { error: 'must be \"prebuilt\" or \"source\"' }).optional(),\n runtime: text(\"must be a runtime id\").optional(),\n runtimeVersion: text('must be a runtime branch such as \"50\"').optional(),\n sdk: text(\"must be an SDK id\").optional(),\n nodeExtension: text(\"must be a Node SDK extension id\").optional(),\n sdkExtensions: textList(\"SDK extension id\", \"must be an array of SDK extension ids\").optional(),\n base: text(\"must be a base app id\").optional(),\n baseVersion: text(\"must be a base app version\").optional(),\n branch: text(\"must be a branch name\").optional(),\n finishArgs: textList(\"finish argument\", \"must be an array of flatpak finish arguments\").optional(),\n cleanup: textList(\"cleanup pattern\", \"must be an array of cleanup patterns\").optional(),\n buildCommands: textList(\"shell command\", \"must be an array of shell commands\").optional(),\n modules: z.array(z.unknown(), { error: \"must be an array of flatpak module objects\" }).optional(),\n source: flatpakSourceSchema.optional(),\n packageManager: z.enum(PACKAGE_MANAGERS, { error: \"must be one of npm, pnpm, yarn\" }).optional(),\n lockfile: text(\"must be a path to a lockfile\").optional(),\n runtimeRepo: url(\"must be an absolute .flatpakrepo URL\").optional(),\n shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),\n shouldInstall: flag(BOOLEAN_ERROR).optional(),\n shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst debSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n method: z.enum(DEB_SIGN_METHODS, { error: 'must be \"debsign\" or \"dpkg-sig\"' }).optional(),\n type: z.enum(DEB_SIGN_TYPES, { error: \"must be one of archive, maint, origin\" }).optional(),\n signer: text(\"must be a signer name and email\").optional(),\n});\n\nconst rpmSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n});\n\nconst flatpakSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n gpgHomeDir: text(\"must be a path to a GPG home directory\").optional(),\n});\n\nconst appimageSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n});\n\nconst signingSchema = z.strictObject({\n appimage: appimageSigningSchema.optional(),\n deb: debSigningSchema.optional(),\n flatpak: flatpakSigningSchema.optional(),\n rpm: rpmSigningSchema.optional(),\n});\n\nconst extraRelationsSchema = z.strictObject({\n recommends: relationsSchema.optional(),\n suggests: relationsSchema.optional(),\n provides: relationsSchema.optional(),\n conflicts: relationsSchema.optional(),\n replaces: relationsSchema.optional(),\n breaks: relationsSchema.optional(),\n preDepends: relationsSchema.optional(),\n});\n\nconst deploySchema = z.strictObject({\n targets: z\n .array(z.enum(DEPLOY_TARGET_NAMES, { error: \"must be one of appimage, deb, flatpak, rpm\" }), {\n error: \"must be an array of deploy targets\",\n })\n .optional(),\n outDir: text(\"must be a directory path relative to the project root\").optional(),\n name: text(\"must be the display name shown in the launcher\").optional(),\n genericName: text(\"must be a generic application name\").optional(),\n binaryName: text(\"must be a kebab-case command name\").optional(),\n version: text(VERSION_ERROR).optional(),\n release: text(\"must be a packaging revision\").optional(),\n epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),\n summary: text(\"must be a single-line summary without a trailing period\").optional(),\n description: textList(\"description paragraph\", \"must be an array of description paragraphs\").optional(),\n keywords: textList(\"search keyword\", \"must be an array of search keywords\").optional(),\n categories: textList(\"freedesktop category\", \"must be an array of freedesktop categories\").optional(),\n mimeTypes: textList(\"MIME type\", \"must be an array of MIME types\").optional(),\n developer: developerSchema.optional(),\n license: text(SPDX_ERROR).optional(),\n licenseFile: text(\"must be a path to a license file\").optional(),\n metadataLicense: text(SPDX_ERROR).optional(),\n copyright: text(\"must be a copyright line\").optional(),\n homepage: url(URL_ERROR).optional(),\n urls: z\n .partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {\n error: \"must be a record of AppStream url kinds to URLs\",\n })\n .optional(),\n screenshots: z.array(screenshotSchema, { error: \"must be an array of screenshots\" }).optional(),\n screenshotBaseUrl: url(\"must be an absolute base URL\").optional(),\n branding: brandingSchema.optional(),\n contentRating: z\n .record(z.string(), z.enum(OARS_INTENSITIES, { error: \"must be one of intense, mild, moderate, none\" }), {\n error: \"must be a record of OARS 1.1 attribute ids to intensities\",\n })\n .optional(),\n releases: z.array(releaseSchema, { error: \"must be an array of releases\" }).optional(),\n execArgs: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n launcherEnv: launcherEnvSchema.optional(),\n nodeFlags: nodeFlagsSchema.optional(),\n fileAssociations: z\n .array(fileAssociationSchema, { error: \"must be an array of file associations\" })\n .optional(),\n protocols: textList(\"URL scheme\", \"must be an array of URL schemes\").optional(),\n desktopActions: z\n .record(z.string(), desktopActionSchema, { error: \"must be a record of action ids to actions\" })\n .optional(),\n desktopEntry: textRecord(\"must be a desktop entry value\", \"must be a record of desktop entry keys to values\")\n .optional(),\n metainfoExtra: textList(\"AppStream XML fragment\", \"must be an array of AppStream XML fragments\").optional(),\n isDbusActivatable: flag(BOOLEAN_ERROR).optional(),\n extraFiles: relativePathRecord(\n \"must be a destination path inside the install prefix, without a leading slash or a .. segment\",\n extraFileEntrySchema,\n \"must be a record of prefix-relative destinations to source paths or { source, mode } entries\",\n ).optional(),\n minimumLibraryVersions: minimumLibraryVersionsSchema.optional(),\n depends: relationsSchema.optional(),\n relations: extraRelationsSchema.optional(),\n scripts: scriptsSchema.optional(),\n node: nodeRuntimeSchema.optional(),\n signing: signingSchema.optional(),\n appimage: appimageSchema.optional(),\n deb: debSchema.optional(),\n flatpak: flatpakSchema.optional(),\n rpm: rpmSchema.optional(),\n});\n\nexport { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };\n"]}
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,GAAG,GACN,MAAM,kBAAkB,CAAC;AAE1B,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC;AAC9D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC;AACjE,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAC1D,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAC/D,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AAC3E,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,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AAC,YAAY,EAAE,iCAAiC,CAAC,CAAC,QAAQ,EAAE;IAC/E,cAAc,EAAE,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,mBAAmB,EAAE,EAAE,KAAK,EAAE,2CAA2C,EAAE,CAAC;SAC/F,QAAQ,EAAE;IACf,YAAY,EAAE,UAAU,CAAC,+BAA+B,EAAE,kDAAkD,CAAC;SACxG,QAAQ,EAAE;IACf,aAAa,EAAE,QAAQ,CAAC,wBAAwB,EAAE,6CAA6C,CAAC,CAAC,QAAQ,EAAE;IAC3G,iBAAiB,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;IACjD,UAAU,EAAE,kBAAkB,CAC1B,+FAA+F,EAC/F,oBAAoB,EACpB,8FAA8F,CACjG,CAAC,QAAQ,EAAE;IACZ,sBAAsB,EAAE,4BAA4B,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;IACzB,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAuD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n fileExtension,\n flag,\n girLibrary,\n relativePathRecord,\n text,\n textList,\n textRecord,\n url,\n} from \"./schema-text.ts\";\n\nconst APPIMAGE_COMPRESSIONS = [\"gzip\", \"xz\", \"zstd\"] as const;\nconst DEB_COMPRESSIONS = [\"gzip\", \"none\", \"xz\", \"zstd\"] as const;\nconst DEB_SIGN_METHODS = [\"debsign\", \"dpkg-sig\"] as const;\nconst DEB_SIGN_TYPES = [\"archive\", \"maint\", \"origin\"] as const;\nconst DEPLOY_TARGET_NAMES = [\"appimage\", \"deb\", \"flatpak\", \"rpm\"] as const;\nconst FLATPAK_MODES = [\"prebuilt\", \"source\"] as const;\nconst NODE_SOURCES = [\"download\", \"host\", \"path\"] as const;\nconst OARS_INTENSITIES = [\"intense\", \"mild\", \"moderate\", \"none\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\"] as const;\nconst RELEASE_TYPES = [\"development\", \"snapshot\", \"stable\"] as const;\nconst RELEASE_URGENCIES = [\"critical\", \"high\", \"low\", \"medium\"] as const;\nconst RPM_COMPRESSIONS = [\"gzip\", \"lzma\", \"xz\", \"zstd\"] as const;\n\nconst URL_KINDS = [\n \"bugtracker\",\n \"contact\",\n \"contribute\",\n \"donation\",\n \"faq\",\n \"help\",\n \"translate\",\n \"vcs-browser\",\n] as const;\n\nconst BOOLEAN_ERROR = \"must be a boolean\";\nconst EPOCH_ERROR = \"must be a non-negative integer\";\nconst EXTRA_FILE_ERROR = \"must be a source path or a { source, mode } entry\";\nconst FILE_MODE_ERROR = \"must be an octal file mode without setuid or setgid bits, such as 755\";\nconst FILE_MODE_PATTERN = /^[0-7]{3,4}$/;\nconst FILE_MODE_RADIX = 8;\nconst PRIVILEGED_FILE_MODE_MASK = 0o6000;\nconst HEX_COLOR_ERROR = \"must be a #rrggbb color\";\nconst HEX_COLOR_PATTERN = /^#[\\dA-Fa-f]{6}$/;\nconst KEY_FILE_ERROR = \"must be a path to a PGP key file\";\nconst KEY_ID_ERROR = \"must be a PGP key id\";\nconst LAUNCHER_ENV_ERROR = \"must be a record of POSIX environment names to values without null bytes\";\nconst LAUNCHER_ENV_NAME_ERROR = \"must be a POSIX environment name\";\nconst LAUNCHER_ENV_NAME_PATTERN = /^[A-Za-z_]\\w*$/;\nconst MINIMUM_LIBRARY_VERSION_ERROR = \"must be a version such as 4.18\";\nconst MINIMUM_LIBRARY_VERSION_PATTERN = /^\\d+(?:\\.\\d+)*$/;\nconst MINIMUM_LIBRARY_VERSIONS_ERROR = \"must be a record of GIR library ids to a minimum version\";\nconst NODE_FLAG_ERROR = \"must be a Node.js flag beginning with a hyphen and containing no null bytes\";\nconst LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form \"Name-Version\", such as \"Adw-1\"';\nconst SCRIPT_ERROR = \"must be a path to a shell script\";\nconst SOURCE_PATH_ERROR = \"must be a source path\";\nconst SPDX_ERROR = \"must be an SPDX license expression\";\nconst URL_ERROR = \"must be an absolute URL\";\nconst VERSION_ERROR = \"must be a version string\";\nconst hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });\n\nconst minimumLibraryVersionSchema = z\n .string({ error: MINIMUM_LIBRARY_VERSION_ERROR })\n .regex(MINIMUM_LIBRARY_VERSION_PATTERN, { error: MINIMUM_LIBRARY_VERSION_ERROR });\n\nconst minimumLibraryVersionsSchema = z.record(girLibrary(LIBRARY_ID_ERROR), minimumLibraryVersionSchema, {\n error: MINIMUM_LIBRARY_VERSIONS_ERROR,\n});\n\nconst relationsSchema = z.strictObject({\n deb: textList(\"Debian package relation\", \"must be an array of Debian package relations\").optional(),\n rpm: textList(\"RPM package relation\", \"must be an array of RPM package relations\").optional(),\n});\n\nconst developerSchema = z.strictObject({\n id: text(\"must be a reverse-DNS developer id\").optional(),\n name: text(\"must be a developer or organization name\").optional(),\n email: text(\"must be an email address\").optional(),\n});\n\nconst screenshotSchema = z\n .strictObject({\n url: url(\"must be an absolute URL to a PNG or JPEG\").optional(),\n file: text(\"must be an image path relative to the project root\").optional(),\n caption: text(\"must be a screenshot caption\").optional(),\n isDefault: flag(BOOLEAN_ERROR).optional(),\n })\n .refine((entry) => entry.url !== undefined || entry.file !== undefined, {\n error: \"must have either a `url` or a `file`\",\n });\n\nconst releaseSchema = z.strictObject({\n version: text(VERSION_ERROR),\n date: z.iso.date({ error: \"must be an ISO date (YYYY-MM-DD)\" }),\n type: z.enum(RELEASE_TYPES, { error: \"must be one of development, snapshot, stable\" }).optional(),\n urgency: z.enum(RELEASE_URGENCIES, { error: \"must be one of critical, high, low, medium\" }).optional(),\n notes: textList(\"release note paragraph\", \"must be an array of release note paragraphs\").optional(),\n url: url(URL_ERROR).optional(),\n});\n\nconst fileAssociationSchema = z.strictObject({\n extension: fileExtension(\"must be a file extension without a leading dot\"),\n mimeType: text(\"must be a MIME type such as text/plain\"),\n description: text(\"must be a description of the file type\").optional(),\n});\n\nconst desktopActionSchema = z.strictObject({\n name: text(\"must be an action name\"),\n args: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n icon: text(\"must be an icon name\").optional(),\n});\n\nconst brandingSchema = z.strictObject({\n light: hexColorSchema,\n dark: hexColorSchema,\n});\n\n/**\n * A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is\n * installed at the entry's prefix-relative destination, and the octal mode it is installed with.\n */\ntype DeployExtraFileOptions = Record<\"source\", string> & {\n /** Octal file mode. Setuid and setgid bits are rejected. */\n mode?: string | undefined;\n};\nconst extraFileSchema: z.ZodType<DeployExtraFileOptions> = z.strictObject({\n source: text(SOURCE_PATH_ERROR),\n mode: z\n .string({ error: FILE_MODE_ERROR })\n .regex(FILE_MODE_PATTERN, { error: FILE_MODE_ERROR })\n .refine((mode) => (Number.parseInt(mode, FILE_MODE_RADIX) & PRIVILEGED_FILE_MODE_MASK) === 0, {\n error: FILE_MODE_ERROR,\n })\n .optional(),\n});\n\nconst extraFileEntrySchema = z.union([text(SOURCE_PATH_ERROR), extraFileSchema], { error: EXTRA_FILE_ERROR });\n\nconst launcherEnvSchema = z.record(\n z.string({ error: LAUNCHER_ENV_NAME_ERROR }).regex(LAUNCHER_ENV_NAME_PATTERN, { error: LAUNCHER_ENV_NAME_ERROR }),\n z.string({ error: LAUNCHER_ENV_ERROR }).refine((value) => !value.includes(\"\\0\"), { error: LAUNCHER_ENV_ERROR }),\n { error: (issue) => issue.code === \"invalid_key\" ? LAUNCHER_ENV_NAME_ERROR : LAUNCHER_ENV_ERROR },\n);\n\nconst nodeFlagsSchema = z.array(\n z\n .string({ error: NODE_FLAG_ERROR })\n .refine((value) => value.startsWith(\"-\") && !value.includes(\"\\0\"), { error: NODE_FLAG_ERROR }),\n { error: \"must be an array of Node.js flags\" },\n);\n\n/**\n * The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it\n * is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.\n */\ntype DeployNodeOptions = Partial<\n Record<\"source\", \"download\" | \"host\" | \"path\" | undefined> &\n Record<\"path\", string | undefined> &\n Record<\"shouldStrip\" | \"shouldUseCompileCache\", boolean | undefined>\n> & {\n /** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */\n version?: string | undefined;\n};\nconst nodeRuntimeSchema: z.ZodType<DeployNodeOptions> = z.strictObject({\n source: z.enum(NODE_SOURCES, { error: \"must be one of download, host, path\" }).optional(),\n version: text(\"must be a Node.js version such as 26.7.0\").optional(),\n path: text(\"must be a path to a node binary\").optional(),\n shouldStrip: flag(BOOLEAN_ERROR).optional(),\n shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst scriptsSchema = z.strictObject({\n preInstall: text(SCRIPT_ERROR).optional(),\n postInstall: text(SCRIPT_ERROR).optional(),\n preRemove: text(SCRIPT_ERROR).optional(),\n postRemove: text(SCRIPT_ERROR).optional(),\n});\n\nconst debSchema = z.strictObject({\n packageName: text(\"must be a Debian package name\").optional(),\n section: text(\"must be a Debian archive section\").optional(),\n priority: text(\"must be a Debian priority\").optional(),\n compression: z.enum(DEB_COMPRESSIONS, { error: \"must be one of gzip, none, xz, zstd\" }).optional(),\n fields: textRecord(\"must be a control field value\", \"must be a record of control field names to values\")\n .optional(),\n});\n\nconst rpmSchema = z.strictObject({\n packageName: text(\"must be an RPM package name\").optional(),\n group: text(\"must be an RPM group\").optional(),\n compression: z.enum(RPM_COMPRESSIONS, { error: \"must be one of gzip, lzma, xz, zstd\" }).optional(),\n prefixes: textList(\"prefix\", \"must be an array of relocation prefixes\").optional(),\n});\n\nconst appimageSchema = z.strictObject({\n fileName: text(\"must be an output file name\").optional(),\n compression: z.enum(APPIMAGE_COMPRESSIONS, { error: \"must be one of gzip, xz, zstd\" }).optional(),\n updateInformation: text(\"must be an AppImage update information string\").optional(),\n runtimeFile: text(\"must be a path to an AppImage runtime file\").optional(),\n});\n\nconst flatpakSourceSchema = z.strictObject({\n url: url(\"must be an absolute git URL\").optional(),\n tag: text(\"must be a git tag\").optional(),\n commit: text(\"must be a git commit sha\").optional(),\n});\n\nconst flatpakSchema = z.strictObject({\n mode: z.enum(FLATPAK_MODES, { error: 'must be \"prebuilt\" or \"source\"' }).optional(),\n runtime: text(\"must be a runtime id\").optional(),\n runtimeVersion: text('must be a runtime branch such as \"50\"').optional(),\n sdk: text(\"must be an SDK id\").optional(),\n nodeExtension: text(\"must be a Node SDK extension id\").optional(),\n sdkExtensions: textList(\"SDK extension id\", \"must be an array of SDK extension ids\").optional(),\n base: text(\"must be a base app id\").optional(),\n baseVersion: text(\"must be a base app version\").optional(),\n branch: text(\"must be a branch name\").optional(),\n finishArgs: textList(\"finish argument\", \"must be an array of flatpak finish arguments\").optional(),\n cleanup: textList(\"cleanup pattern\", \"must be an array of cleanup patterns\").optional(),\n buildCommands: textList(\"shell command\", \"must be an array of shell commands\").optional(),\n modules: z.array(z.unknown(), { error: \"must be an array of flatpak module objects\" }).optional(),\n source: flatpakSourceSchema.optional(),\n packageManager: z.enum(PACKAGE_MANAGERS, { error: \"must be one of npm, pnpm, yarn\" }).optional(),\n lockfile: text(\"must be a path to a lockfile\").optional(),\n runtimeRepo: url(\"must be an absolute .flatpakrepo URL\").optional(),\n shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),\n shouldInstall: flag(BOOLEAN_ERROR).optional(),\n shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst debSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n method: z.enum(DEB_SIGN_METHODS, { error: 'must be \"debsign\" or \"dpkg-sig\"' }).optional(),\n type: z.enum(DEB_SIGN_TYPES, { error: \"must be one of archive, maint, origin\" }).optional(),\n signer: text(\"must be a signer name and email\").optional(),\n});\n\nconst rpmSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n});\n\nconst flatpakSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n gpgHomeDir: text(\"must be a path to a GPG home directory\").optional(),\n});\n\nconst appimageSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n});\n\nconst signingSchema = z.strictObject({\n appimage: appimageSigningSchema.optional(),\n deb: debSigningSchema.optional(),\n flatpak: flatpakSigningSchema.optional(),\n rpm: rpmSigningSchema.optional(),\n});\n\nconst extraRelationsSchema = z.strictObject({\n recommends: relationsSchema.optional(),\n suggests: relationsSchema.optional(),\n provides: relationsSchema.optional(),\n conflicts: relationsSchema.optional(),\n replaces: relationsSchema.optional(),\n breaks: relationsSchema.optional(),\n preDepends: relationsSchema.optional(),\n});\n\nconst deploySchema = z.strictObject({\n targets: z\n .array(z.enum(DEPLOY_TARGET_NAMES, { error: \"must be one of appimage, deb, flatpak, rpm\" }), {\n error: \"must be an array of deploy targets\",\n })\n .optional(),\n outDir: text(\"must be a directory path relative to the project root\").optional(),\n name: text(\"must be the display name shown in the launcher\").optional(),\n genericName: text(\"must be a generic application name\").optional(),\n binaryName: text(\"must be a kebab-case command name\").optional(),\n version: text(VERSION_ERROR).optional(),\n release: text(\"must be a packaging revision\").optional(),\n epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),\n summary: text(\"must be a single-line summary without a trailing period\").optional(),\n description: textList(\"description paragraph\", \"must be an array of description paragraphs\").optional(),\n keywords: textList(\"search keyword\", \"must be an array of search keywords\").optional(),\n categories: textList(\"freedesktop category\", \"must be an array of freedesktop categories\").optional(),\n mimeTypes: textList(\"MIME type\", \"must be an array of MIME types\").optional(),\n developer: developerSchema.optional(),\n license: text(SPDX_ERROR).optional(),\n licenseFile: text(\"must be a path to a license file\").optional(),\n metadataLicense: text(SPDX_ERROR).optional(),\n copyright: text(\"must be a copyright line\").optional(),\n homepage: url(URL_ERROR).optional(),\n urls: z\n .partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {\n error: \"must be a record of AppStream url kinds to URLs\",\n })\n .optional(),\n screenshots: z.array(screenshotSchema, { error: \"must be an array of screenshots\" }).optional(),\n screenshotBaseUrl: url(\"must be an absolute base URL\").optional(),\n branding: brandingSchema.optional(),\n contentRating: z\n .record(z.string(), z.enum(OARS_INTENSITIES, { error: \"must be one of intense, mild, moderate, none\" }), {\n error: \"must be a record of OARS 1.1 attribute ids to intensities\",\n })\n .optional(),\n releases: z.array(releaseSchema, { error: \"must be an array of releases\" }).optional(),\n execArgs: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n launcherEnv: launcherEnvSchema.optional(),\n nodeFlags: nodeFlagsSchema.optional(),\n fileAssociations: z\n .array(fileAssociationSchema, { error: \"must be an array of file associations\" })\n .optional(),\n protocols: textList(\"URL scheme\", \"must be an array of URL schemes\").optional(),\n desktopActions: z\n .record(z.string(), desktopActionSchema, { error: \"must be a record of action ids to actions\" })\n .optional(),\n desktopEntry: textRecord(\"must be a desktop entry value\", \"must be a record of desktop entry keys to values\")\n .optional(),\n metainfoExtra: textList(\"AppStream XML fragment\", \"must be an array of AppStream XML fragments\").optional(),\n isDbusActivatable: flag(BOOLEAN_ERROR).optional(),\n extraFiles: relativePathRecord(\n \"must be a destination path inside the install prefix, without a leading slash or a .. segment\",\n extraFileEntrySchema,\n \"must be a record of prefix-relative destinations to source paths or { source, mode } entries\",\n ).optional(),\n minimumLibraryVersions: minimumLibraryVersionsSchema.optional(),\n depends: relationsSchema.optional(),\n relations: extraRelationsSchema.optional(),\n scripts: scriptsSchema.optional(),\n node: nodeRuntimeSchema.optional(),\n signing: signingSchema.optional(),\n appimage: appimageSchema.optional(),\n deb: debSchema.optional(),\n flatpak: flatpakSchema.optional(),\n rpm: rpmSchema.optional(),\n});\n\nexport { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };\n"]}
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/config",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-beta.7",
|
|
4
|
+
"description": "Configuration and element-prop mapping for Adwaita-first GTKX apps.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
7
7
|
"gtk",
|
|
8
8
|
"gtk4",
|
|
9
|
+
"adwaita",
|
|
10
|
+
"gnome",
|
|
9
11
|
"react",
|
|
10
12
|
"typescript",
|
|
11
13
|
"config",
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
"node": ">=26.7.0"
|
|
65
67
|
},
|
|
66
68
|
"dependencies": {
|
|
67
|
-
"@gtkx/utils": "2.0.0-beta.
|
|
69
|
+
"@gtkx/utils": "2.0.0-beta.7",
|
|
68
70
|
"c12": "^3.3.4",
|
|
69
71
|
"defu": "^6.1.7",
|
|
70
72
|
"jiti": "^2.7.0",
|
package/src/config.ts
CHANGED
|
@@ -58,15 +58,15 @@ type ResolvedConfig = {
|
|
|
58
58
|
|
|
59
59
|
const APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\.[A-Za-z_][A-Za-z0-9_-]*)+$/;
|
|
60
60
|
const APPLICATION_ID_MAX_LENGTH = 255;
|
|
61
|
-
const
|
|
61
|
+
const IMPLICIT_LIBRARIES: Set<string> = new Set(["Adw-1", "Gtk-4.0"]);
|
|
62
62
|
/** Compilation modes `babel-plugin-react-compiler` accepts. */
|
|
63
63
|
const COMPILATION_MODES = ["infer", "syntax", "annotation", "all"] as const;
|
|
64
64
|
/** Panic thresholds `babel-plugin-react-compiler` accepts. */
|
|
65
65
|
const PANIC_THRESHOLDS = ["none", "critical_errors", "all_errors"] as const;
|
|
66
66
|
const REACT_COMPILER_TARGET = "19";
|
|
67
67
|
|
|
68
|
-
const librarySchema = girLibrary('must be of the form "Name-Version", such as "
|
|
69
|
-
.refine((library) => !
|
|
68
|
+
const librarySchema = girLibrary('must be of the form "Name-Version", such as "Adw-1"')
|
|
69
|
+
.refine((library) => !IMPLICIT_LIBRARIES.has(library), { error: "is bound implicitly; remove it" });
|
|
70
70
|
|
|
71
71
|
const librariesSchema = z
|
|
72
72
|
.array(librarySchema, { error: "must be a non-empty string array or omitted" })
|
package/src/deploy.ts
CHANGED
|
@@ -52,7 +52,7 @@ const MINIMUM_LIBRARY_VERSION_ERROR = "must be a version such as 4.18";
|
|
|
52
52
|
const MINIMUM_LIBRARY_VERSION_PATTERN = /^\d+(?:\.\d+)*$/;
|
|
53
53
|
const MINIMUM_LIBRARY_VERSIONS_ERROR = "must be a record of GIR library ids to a minimum version";
|
|
54
54
|
const NODE_FLAG_ERROR = "must be a Node.js flag beginning with a hyphen and containing no null bytes";
|
|
55
|
-
const LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form "Name-Version", such as "
|
|
55
|
+
const LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form "Name-Version", such as "Adw-1"';
|
|
56
56
|
const SCRIPT_ERROR = "must be a path to a shell script";
|
|
57
57
|
const SOURCE_PATH_ERROR = "must be a source path";
|
|
58
58
|
const SPDX_ERROR = "must be an SPDX license expression";
|