@gtkx/config 1.0.0-rc.4 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +5 -5
  2. package/dist/config-error.d.ts +2 -1
  3. package/dist/config-error.d.ts.map +1 -1
  4. package/dist/config-error.js +16 -4
  5. package/dist/config-error.js.map +1 -1
  6. package/dist/config.d.ts +239 -5
  7. package/dist/config.d.ts.map +1 -1
  8. package/dist/config.js +6 -33
  9. package/dist/config.js.map +1 -1
  10. package/dist/deploy.d.ts +237 -0
  11. package/dist/deploy.d.ts.map +1 -0
  12. package/dist/deploy.js +232 -0
  13. package/dist/deploy.js.map +1 -0
  14. package/dist/index.d.ts +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/internal.d.ts +2 -2
  18. package/dist/internal.d.ts.map +1 -1
  19. package/dist/internal.js +1 -1
  20. package/dist/internal.js.map +1 -1
  21. package/dist/loader.d.ts +6 -3
  22. package/dist/loader.d.ts.map +1 -1
  23. package/dist/loader.js +10 -8
  24. package/dist/loader.js.map +1 -1
  25. package/dist/schema-text.d.ts +10 -0
  26. package/dist/schema-text.d.ts.map +1 -0
  27. package/dist/schema-text.js +19 -0
  28. package/dist/schema-text.js.map +1 -0
  29. package/dist/user-event-signals.d.ts +1 -2
  30. package/dist/user-event-signals.d.ts.map +1 -1
  31. package/dist/user-event-signals.js +1 -7
  32. package/dist/user-event-signals.js.map +1 -1
  33. package/dist/vite-plugin.d.ts +8 -1
  34. package/dist/vite-plugin.d.ts.map +1 -1
  35. package/dist/vite-plugin.js +5 -1
  36. package/dist/vite-plugin.js.map +1 -1
  37. package/package.json +13 -3
  38. package/src/config-error.ts +23 -4
  39. package/src/config.ts +6 -36
  40. package/src/deploy.ts +260 -0
  41. package/src/index.ts +1 -1
  42. package/src/internal.ts +2 -1
  43. package/src/loader.ts +16 -9
  44. package/src/schema-text.ts +38 -0
  45. package/src/user-event-signals.ts +1 -7
  46. package/src/vite-plugin.ts +11 -2
package/README.md CHANGED
@@ -108,7 +108,7 @@ React Native and similar frameworks hide the native toolkit so one API can run e
108
108
 
109
109
  ### Why Node.js, and why generated bindings
110
110
 
111
- 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 the comparison in full.
111
+ 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
112
 
113
113
  GTKX generates the TypeScript types and the native FFI calls from the same GObject-Introspection data, so the types cannot drift from the calls they back. Codegen covers the whole GTK4 and Adwaita surface.
114
114
 
@@ -121,10 +121,10 @@ GTKX is Linux-only and needs Node.js 24 or later. See [Requirements](#requiremen
121
121
  Scaffold a new app with the `create-gtkx` initializer:
122
122
 
123
123
  ```sh
124
- npm create gtkx@rc
124
+ npm create gtkx
125
125
  ```
126
126
 
127
- The same command works with other package managers: `pnpm create gtkx@rc` or `yarn create gtkx@rc`.
127
+ The same command works with other package managers: `pnpm create gtkx` or `yarn create gtkx`.
128
128
 
129
129
  Then run your new app:
130
130
 
@@ -145,7 +145,7 @@ The documentation at **[gtkx.dev](https://gtkx.dev)** includes a step-by-step tu
145
145
 
146
146
  GTKX is Linux-only. You need:
147
147
 
148
- - Linux with the GTK4 (4.20 or later), Adwaita (1.8 or later), and GLib development libraries
148
+ - Linux with the GTK4 (4.20 or later) and GLib development libraries, plus Adwaita (1.8 or later) once your project binds `Adw-1`
149
149
  - Node.js 24 or later
150
150
 
151
151
  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.
@@ -161,7 +161,7 @@ Explore the [example apps](https://github.com/gtkx-org/gtkx/tree/main/examples):
161
161
 
162
162
  ## Status
163
163
 
164
- GTKX 1.0 is at the release candidate stage.
164
+ GTKX is stable and ready for production use.
165
165
 
166
166
  ## Contributing
167
167
 
@@ -11,6 +11,7 @@ declare const rawIssue: (input: unknown, path: IssuePath, message: string, isSta
11
11
  message: string;
12
12
  continue: true;
13
13
  };
14
+ declare const missingConfigFileError: (cwd: string) => Error;
14
15
  declare const configError: (error: z.ZodError) => Error;
15
- export { isRecord, rawIssue, configError };
16
+ export { isRecord, rawIssue, missingConfigFileError, configError };
16
17
  //# sourceMappingURL=config-error.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAIrC,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAEzE,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,MAAM,SAAS,EAAE,SAAS,MAAM,EAAE,sBAAoB;;;;;;;;;CAOtF,CAAC;AAwCH,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,KAAG,KAQxC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,SAAS,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;AAKrC,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAEzE,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,MAAM,SAAS,EAAE,SAAS,MAAM,EAAE,sBAAoB;;;;;;;;;CAOtF,CAAC;AAuDH,QAAA,MAAM,sBAAsB,GAAI,KAAK,MAAM,KAAG,KACyB,CAAC;AAExE,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,KAAG,KAQxC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  const CONFIG_PREFIX = "gtkx.config.ts:";
2
+ const UNRECOGNIZED_KEY_REASON = "is not a recognized key";
2
3
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3
4
  const rawIssue = (input, path, message, isStandalone = false) => ({
4
5
  code: "custom",
@@ -22,11 +23,21 @@ const dottedPath = (segments) => {
22
23
  return path;
23
24
  };
24
25
  const isStandaloneIssue = (issue) => "params" in issue && isRecord(issue.params) && issue.params.standalone === true;
25
- const formatIssue = (issue, fullPath) => {
26
+ const unrecognizedKeyPath = (issue, fullPath) => {
26
27
  if (issue.code === "unrecognized_keys") {
27
28
  const [key] = issue.keys;
28
- const path = dottedPath(key === undefined ? fullPath : [...fullPath, key]);
29
- return `${CONFIG_PREFIX} \`${path}\` is not a recognized key`;
29
+ return dottedPath(key === undefined ? fullPath : [...fullPath, key]);
30
+ }
31
+ return issue.code === "invalid_key" ? dottedPath(fullPath) : undefined;
32
+ };
33
+ const keyRejectionReason = (issue) => {
34
+ const nested = issue.code === "invalid_key" ? issue.issues[0] : undefined;
35
+ return nested?.code === "custom" ? nested.message : UNRECOGNIZED_KEY_REASON;
36
+ };
37
+ const formatIssue = (issue, fullPath) => {
38
+ const unrecognized = unrecognizedKeyPath(issue, fullPath);
39
+ if (unrecognized !== undefined) {
40
+ return `${CONFIG_PREFIX} \`${unrecognized}\` ${keyRejectionReason(issue)}`;
30
41
  }
31
42
  if (isStandaloneIssue(issue)) {
32
43
  return `${CONFIG_PREFIX} ${issue.message}`;
@@ -34,6 +45,7 @@ const formatIssue = (issue, fullPath) => {
34
45
  const path = dottedPath(fullPath);
35
46
  return path === "" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \`${path}\` ${issue.message}`;
36
47
  };
48
+ const missingConfigFileError = (cwd) => new Error(`${CONFIG_PREFIX} no configuration file found in ${cwd}`);
37
49
  const configError = (error) => {
38
50
  const issue = error.issues[0];
39
51
  if (issue === undefined) {
@@ -41,5 +53,5 @@ const configError = (error) => {
41
53
  }
42
54
  return new Error(formatIssue(issue, issue.path));
43
55
  };
44
- export { isRecord, rawIssue, configError };
56
+ export { isRecord, rawIssue, missingConfigFileError, configError };
45
57
  //# sourceMappingURL=config-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAExC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,IAAe,EAAE,OAAe,EAAE,YAAY,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,QAAiB;IACvB,KAAK;IACL,IAAI;IACJ,OAAO;IACP,QAAQ,EAAE,IAAa;IACvB,GAAG,CAAC,YAAY,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,C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AC,OAAO,EAAE,CAAC;IAC/C,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAElC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa,MAAM,IAAI,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;AAC/G,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAS,EAAE;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,IAAI,KAAK,CAAC,GAAG,aAAa,wBAAwB,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import type { z } from \"zod\";\n\ntype IssuePath = (string | number)[];\n\nconst CONFIG_PREFIX = \"gtkx.config.ts:\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst rawIssue = (input: unknown, path: IssuePath, message: string, isStandalone = false) => ({\n code: \"custom\" as const,\n input,\n path,\n message,\n continue: true as const,\n ...(isStandalone && { params: { standalone: true } }),\n});\n\nconst appendSegment = (path: string, segment: PropertyKey): string => {\n if (typeof segment === \"number\") {\n return `${path}[${String(segment)}]`;\n }\n\n return path === \"\" ? String(segment) : `${path}.${String(segment)}`;\n};\n\nconst dottedPath = (segments: PropertyKey[]): string => {\n let path = \"\";\n\n for (const segment of segments) {\n path = appendSegment(path, segment);\n }\n\n return path;\n};\n\nconst isStandaloneIssue = (issue: z.core.$ZodIssue): boolean =>\n \"params\" in issue && isRecord(issue.params) && issue.params.standalone === true;\n\nconst formatIssue = (issue: z.core.$ZodIssue, fullPath: PropertyKey[]): string => {\n if (issue.code === \"unrecognized_keys\") {\n const [key] = issue.keys;\n const path = dottedPath(key === undefined ? fullPath : [...fullPath, key]);\n\n return `${CONFIG_PREFIX} \\`${path}\\` is not a recognized key`;\n }\n\n if (isStandaloneIssue(issue)) {\n return `${CONFIG_PREFIX} ${issue.message}`;\n }\n\n const path = dottedPath(fullPath);\n\n return path === \"\" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \\`${path}\\` ${issue.message}`;\n};\n\nconst configError = (error: z.ZodError): Error => {\n const issue = error.issues[0];\n\n if (issue === undefined) {\n return new Error(`${CONFIG_PREFIX} invalid configuration`);\n }\n\n return new Error(formatIssue(issue, issue.path));\n};\n\nexport { isRecord, rawIssue, configError };\n"]}
1
+ {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG,iBAAiB,CAAC;AACxC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAE1D,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAE,IAAe,EAAE,OAAe,EAAE,YAAY,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1F,IAAI,EAAE,QAAiB;IACvB,KAAK;IACL,IAAI;IACJ,OAAO;IACP,QAAQ,EAAE,IAAa;IACvB,GAAG,CAAC,YAAY,IAAI,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;CACxD,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,OAAoB,EAAU,EAAE;IACjE,IAAI,O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AAC;IAC/D,CAAC;IAED,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import type { z } from \"zod\";\n\ntype IssuePath = (string | number)[];\n\nconst CONFIG_PREFIX = \"gtkx.config.ts:\";\nconst UNRECOGNIZED_KEY_REASON = \"is not a recognized key\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst rawIssue = (input: unknown, path: IssuePath, message: string, isStandalone = false) => ({\n code: \"custom\" as const,\n input,\n path,\n message,\n continue: true as const,\n ...(isStandalone && { params: { standalone: true } }),\n});\n\nconst appendSegment = (path: string, segment: PropertyKey): string => {\n if (typeof segment === \"number\") {\n return `${path}[${String(segment)}]`;\n }\n\n return path === \"\" ? String(segment) : `${path}.${String(segment)}`;\n};\n\nconst dottedPath = (segments: PropertyKey[]): string => {\n let path = \"\";\n\n for (const segment of segments) {\n path = appendSegment(path, segment);\n }\n\n return path;\n};\n\nconst isStandaloneIssue = (issue: z.core.$ZodIssue): boolean =>\n \"params\" in issue && isRecord(issue.params) && issue.params.standalone === true;\n\nconst unrecognizedKeyPath = (issue: z.core.$ZodIssue, fullPath: PropertyKey[]): string | undefined => {\n if (issue.code === \"unrecognized_keys\") {\n const [key] = issue.keys;\n\n return dottedPath(key === undefined ? fullPath : [...fullPath, key]);\n }\n\n return issue.code === \"invalid_key\" ? dottedPath(fullPath) : undefined;\n};\n\nconst keyRejectionReason = (issue: z.core.$ZodIssue): string => {\n const nested = issue.code === \"invalid_key\" ? issue.issues[0] : undefined;\n\n return nested?.code === \"custom\" ? nested.message : UNRECOGNIZED_KEY_REASON;\n};\n\nconst formatIssue = (issue: z.core.$ZodIssue, fullPath: PropertyKey[]): string => {\n const unrecognized = unrecognizedKeyPath(issue, fullPath);\n\n if (unrecognized !== undefined) {\n return `${CONFIG_PREFIX} \\`${unrecognized}\\` ${keyRejectionReason(issue)}`;\n }\n\n if (isStandaloneIssue(issue)) {\n return `${CONFIG_PREFIX} ${issue.message}`;\n }\n\n const path = dottedPath(fullPath);\n\n return path === \"\" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \\`${path}\\` ${issue.message}`;\n};\n\nconst missingConfigFileError = (cwd: string): Error =>\n new Error(`${CONFIG_PREFIX} no configuration file found in ${cwd}`);\n\nconst configError = (error: z.ZodError): Error => {\n const issue = error.issues[0];\n\n if (issue === undefined) {\n return new Error(`${CONFIG_PREFIX} invalid configuration`);\n }\n\n return new Error(formatIssue(issue, issue.path));\n};\n\nexport { isRecord, rawIssue, missingConfigFileError, configError };\n"]}
package/dist/config.d.ts CHANGED
@@ -25,7 +25,6 @@ type ResolvedReactCompilerOptions = ReactCompilerOptions & {
25
25
  * Compiler, codegen, and user event signal settings.
26
26
  */
27
27
  type Config = z.infer<typeof configSchema>;
28
- /** A named export referenced as plain data, so codegen can emit an import for it without loading the module. */
29
28
  type ModuleExport = z.infer<typeof moduleExportSchema>;
30
29
  /** Configuration reduced to the values the app runtime and the build need, with paths already resolved. */
31
30
  type ResolvedConfig = {
@@ -40,14 +39,16 @@ type ResolvedConfig = {
40
39
  /** GLib type names of the elements marked `isLazy`, whose GObject their parent container creates. */
41
40
  lazyElements: string[];
42
41
  };
42
+ declare const APPLICATION_ID_MAX_LENGTH = 255;
43
+ /** Compilation modes `babel-plugin-react-compiler` accepts. */
43
44
  declare const COMPILATION_MODES: readonly ["infer", "syntax", "annotation", "all"];
45
+ /** Panic thresholds `babel-plugin-react-compiler` accepts. */
44
46
  declare const PANIC_THRESHOLDS: readonly ["none", "critical_errors", "all_errors"];
45
- /** Validates a `{ module, export }` reference to a named export. */
46
47
  declare const moduleExportSchema: z.ZodObject<{
47
48
  module: z.ZodString;
48
49
  export: z.ZodString;
49
50
  }, z.core.$strip>;
50
- /** The shape every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */
51
+ /** Schema every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */
51
52
  declare const configSchema: z.ZodObject<{
52
53
  libraries: z.ZodOptional<z.ZodCustom<string[] | "*", string[] | "*">>;
53
54
  girPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -70,6 +71,240 @@ declare const configSchema: z.ZodObject<{
70
71
  omittedProps: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
72
  }, z.core.$strip>>>;
72
73
  }, z.core.$strip>>;
74
+ deploy: z.ZodOptional<z.ZodObject<{
75
+ targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
76
+ appimage: "appimage";
77
+ deb: "deb";
78
+ flatpak: "flatpak";
79
+ rpm: "rpm";
80
+ }>>>;
81
+ outDir: z.ZodOptional<z.ZodString>;
82
+ name: z.ZodOptional<z.ZodString>;
83
+ genericName: z.ZodOptional<z.ZodString>;
84
+ binaryName: z.ZodOptional<z.ZodString>;
85
+ version: z.ZodOptional<z.ZodString>;
86
+ release: z.ZodOptional<z.ZodString>;
87
+ epoch: z.ZodOptional<z.ZodInt>;
88
+ summary: z.ZodOptional<z.ZodString>;
89
+ description: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
+ categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
92
+ mimeTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ developer: z.ZodOptional<z.ZodObject<{
94
+ id: z.ZodOptional<z.ZodString>;
95
+ name: z.ZodOptional<z.ZodString>;
96
+ email: z.ZodOptional<z.ZodString>;
97
+ }, z.core.$strict>>;
98
+ license: z.ZodOptional<z.ZodString>;
99
+ licenseFile: z.ZodOptional<z.ZodString>;
100
+ metadataLicense: z.ZodOptional<z.ZodString>;
101
+ copyright: z.ZodOptional<z.ZodString>;
102
+ homepage: z.ZodOptional<z.ZodURL>;
103
+ urls: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
104
+ bugtracker: "bugtracker";
105
+ contact: "contact";
106
+ contribute: "contribute";
107
+ donation: "donation";
108
+ faq: "faq";
109
+ help: "help";
110
+ translate: "translate";
111
+ "vcs-browser": "vcs-browser";
112
+ }> & z.core.$partial, z.ZodURL>>;
113
+ icons: z.ZodOptional<z.ZodString>;
114
+ screenshots: z.ZodOptional<z.ZodArray<z.ZodObject<{
115
+ url: z.ZodOptional<z.ZodURL>;
116
+ file: z.ZodOptional<z.ZodString>;
117
+ caption: z.ZodOptional<z.ZodString>;
118
+ isDefault: z.ZodOptional<z.ZodBoolean>;
119
+ }, z.core.$strict>>>;
120
+ screenshotBaseUrl: z.ZodOptional<z.ZodURL>;
121
+ branding: z.ZodOptional<z.ZodObject<{
122
+ light: z.ZodString;
123
+ dark: z.ZodString;
124
+ }, z.core.$strict>>;
125
+ contentRating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
126
+ none: "none";
127
+ intense: "intense";
128
+ mild: "mild";
129
+ moderate: "moderate";
130
+ }>>>;
131
+ releases: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ version: z.ZodString;
133
+ date: z.ZodISODate;
134
+ type: z.ZodOptional<z.ZodEnum<{
135
+ development: "development";
136
+ snapshot: "snapshot";
137
+ stable: "stable";
138
+ }>>;
139
+ urgency: z.ZodOptional<z.ZodEnum<{
140
+ critical: "critical";
141
+ high: "high";
142
+ low: "low";
143
+ medium: "medium";
144
+ }>>;
145
+ notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
146
+ url: z.ZodOptional<z.ZodURL>;
147
+ }, z.core.$strict>>>;
148
+ execArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ fileAssociations: z.ZodOptional<z.ZodArray<z.ZodObject<{
150
+ extension: z.ZodString;
151
+ mimeType: z.ZodString;
152
+ description: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strict>>>;
154
+ protocols: z.ZodOptional<z.ZodArray<z.ZodString>>;
155
+ desktopActions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
156
+ name: z.ZodString;
157
+ args: z.ZodOptional<z.ZodArray<z.ZodString>>;
158
+ icon: z.ZodOptional<z.ZodString>;
159
+ }, z.core.$strict>>>;
160
+ desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
161
+ isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
162
+ extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
163
+ depends: z.ZodOptional<z.ZodObject<{
164
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
165
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
166
+ }, z.core.$strict>>;
167
+ relations: z.ZodOptional<z.ZodObject<{
168
+ recommends: z.ZodOptional<z.ZodObject<{
169
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
170
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ }, z.core.$strict>>;
172
+ suggests: z.ZodOptional<z.ZodObject<{
173
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
174
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
175
+ }, z.core.$strict>>;
176
+ provides: z.ZodOptional<z.ZodObject<{
177
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
178
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
179
+ }, z.core.$strict>>;
180
+ conflicts: z.ZodOptional<z.ZodObject<{
181
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
182
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
183
+ }, z.core.$strict>>;
184
+ replaces: z.ZodOptional<z.ZodObject<{
185
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
186
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
187
+ }, z.core.$strict>>;
188
+ breaks: z.ZodOptional<z.ZodObject<{
189
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
190
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
+ }, z.core.$strict>>;
192
+ preDepends: z.ZodOptional<z.ZodObject<{
193
+ deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
194
+ rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ }, z.core.$strict>>;
196
+ }, z.core.$strict>>;
197
+ scripts: z.ZodOptional<z.ZodObject<{
198
+ preInstall: z.ZodOptional<z.ZodString>;
199
+ postInstall: z.ZodOptional<z.ZodString>;
200
+ preRemove: z.ZodOptional<z.ZodString>;
201
+ postRemove: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>>;
203
+ node: z.ZodOptional<z.ZodObject<{
204
+ source: z.ZodOptional<z.ZodEnum<{
205
+ path: "path";
206
+ download: "download";
207
+ host: "host";
208
+ }>>;
209
+ version: z.ZodOptional<z.ZodString>;
210
+ path: z.ZodOptional<z.ZodString>;
211
+ shouldStrip: z.ZodOptional<z.ZodBoolean>;
212
+ shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
213
+ }, z.core.$strict>>;
214
+ signing: z.ZodOptional<z.ZodObject<{
215
+ appimage: z.ZodOptional<z.ZodObject<{
216
+ gpgKeyId: z.ZodString;
217
+ }, z.core.$strict>>;
218
+ deb: z.ZodOptional<z.ZodObject<{
219
+ keyFile: z.ZodString;
220
+ keyId: z.ZodOptional<z.ZodString>;
221
+ method: z.ZodOptional<z.ZodEnum<{
222
+ debsign: "debsign";
223
+ "dpkg-sig": "dpkg-sig";
224
+ }>>;
225
+ type: z.ZodOptional<z.ZodEnum<{
226
+ origin: "origin";
227
+ archive: "archive";
228
+ maint: "maint";
229
+ }>>;
230
+ signer: z.ZodOptional<z.ZodString>;
231
+ }, z.core.$strict>>;
232
+ flatpak: z.ZodOptional<z.ZodObject<{
233
+ gpgKeyId: z.ZodString;
234
+ gpgHomeDir: z.ZodOptional<z.ZodString>;
235
+ }, z.core.$strict>>;
236
+ rpm: z.ZodOptional<z.ZodObject<{
237
+ keyFile: z.ZodString;
238
+ keyId: z.ZodOptional<z.ZodString>;
239
+ }, z.core.$strict>>;
240
+ }, z.core.$strict>>;
241
+ appimage: z.ZodOptional<z.ZodObject<{
242
+ fileName: z.ZodOptional<z.ZodString>;
243
+ compression: z.ZodOptional<z.ZodEnum<{
244
+ gzip: "gzip";
245
+ xz: "xz";
246
+ zstd: "zstd";
247
+ }>>;
248
+ updateInformation: z.ZodOptional<z.ZodString>;
249
+ runtimeFile: z.ZodOptional<z.ZodString>;
250
+ }, z.core.$strict>>;
251
+ deb: z.ZodOptional<z.ZodObject<{
252
+ packageName: z.ZodOptional<z.ZodString>;
253
+ section: z.ZodOptional<z.ZodString>;
254
+ priority: z.ZodOptional<z.ZodString>;
255
+ compression: z.ZodOptional<z.ZodEnum<{
256
+ gzip: "gzip";
257
+ xz: "xz";
258
+ zstd: "zstd";
259
+ none: "none";
260
+ }>>;
261
+ fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
262
+ }, z.core.$strict>>;
263
+ flatpak: z.ZodOptional<z.ZodObject<{
264
+ mode: z.ZodOptional<z.ZodEnum<{
265
+ prebuilt: "prebuilt";
266
+ source: "source";
267
+ }>>;
268
+ runtime: z.ZodOptional<z.ZodString>;
269
+ runtimeVersion: z.ZodOptional<z.ZodString>;
270
+ sdk: z.ZodOptional<z.ZodString>;
271
+ nodeExtension: z.ZodOptional<z.ZodString>;
272
+ sdkExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
273
+ base: z.ZodOptional<z.ZodString>;
274
+ baseVersion: z.ZodOptional<z.ZodString>;
275
+ branch: z.ZodOptional<z.ZodString>;
276
+ finishArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
277
+ cleanup: z.ZodOptional<z.ZodArray<z.ZodString>>;
278
+ buildCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
279
+ modules: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
280
+ source: z.ZodOptional<z.ZodObject<{
281
+ url: z.ZodOptional<z.ZodURL>;
282
+ tag: z.ZodOptional<z.ZodString>;
283
+ commit: z.ZodOptional<z.ZodString>;
284
+ }, z.core.$strict>>;
285
+ packageManager: z.ZodOptional<z.ZodEnum<{
286
+ npm: "npm";
287
+ pnpm: "pnpm";
288
+ yarn: "yarn";
289
+ }>>;
290
+ lockfile: z.ZodOptional<z.ZodString>;
291
+ runtimeRepo: z.ZodOptional<z.ZodURL>;
292
+ shouldEmitBundle: z.ZodOptional<z.ZodBoolean>;
293
+ shouldInstall: z.ZodOptional<z.ZodBoolean>;
294
+ shouldUseRofilesFuse: z.ZodOptional<z.ZodBoolean>;
295
+ }, z.core.$strict>>;
296
+ rpm: z.ZodOptional<z.ZodObject<{
297
+ packageName: z.ZodOptional<z.ZodString>;
298
+ group: z.ZodOptional<z.ZodString>;
299
+ compression: z.ZodOptional<z.ZodEnum<{
300
+ gzip: "gzip";
301
+ xz: "xz";
302
+ zstd: "zstd";
303
+ lzma: "lzma";
304
+ }>>;
305
+ prefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
306
+ }, z.core.$strict>>;
307
+ }, z.core.$strict>>;
73
308
  }, z.core.$strip>;
74
309
  /**
75
310
  * Returns the given configuration unchanged, typed as {@link Config}, so `gtkx.config.ts` gets
@@ -77,7 +312,6 @@ declare const configSchema: z.ZodObject<{
77
312
  */
78
313
  declare const defineConfig: DefineConfig<Config>;
79
314
  declare const isValidApplicationId: (applicationId: string) => boolean;
80
- declare const resolveReactCompilerOptions: (setting: Config["reactCompiler"]) => ResolvedReactCompilerOptions | null;
81
315
  declare const validateConfig: (config: Config) => void;
82
316
  /**
83
317
  * Deep-merges two configurations. `override` wins over `base` on conflicting scalar and object keys, while
@@ -89,5 +323,5 @@ declare const resolveElementComponents: (elements: Config["elements"]) => Record
89
323
  declare const resolveElementProps: (elements: Config["elements"]) => Record<string, ModuleExport>;
90
324
  declare const resolveOmittedProps: (elements: Config["elements"]) => Record<string, string[]>;
91
325
  declare const resolveConfig: (config: Config, root?: string) => ResolvedConfig;
92
- export { defineConfig, isValidApplicationId, resolveReactCompilerOptions, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmittedProps, resolveConfig, type ResolvedReactCompilerOptions, type Config, type ModuleExport, type ResolvedConfig, };
326
+ export { APPLICATION_ID_MAX_LENGTH, defineConfig, isValidApplicationId, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmittedProps, resolveConfig, type ResolvedReactCompilerOptions, type Config, type ResolvedConfig, };
93
327
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;AAG5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,wGAAwG;AACxG,KAAK,4BAA4B,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,0GAA0G;AAC1G,KAAK,2BAA2B,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,uGAAuG;AACvG,KAAK,oBAAoB,GAAG;IACxB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAC/C,kGAAkG;IAClG,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAChD,CAAC;AAEF;;;GAGG;AACH,KAAK,4BAA4B,GAAG,oBAAoB,GAAG;IACvD,kDAAkD;IAClD,MAAM,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3C,gHAAgH;AAChH,KAAK,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAIvD,2GAA2G;AAC3G,KA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AA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,EAGpC,CAAC;AAc/B,QAAA,MAAM,wBAAwB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAChC,CAAC;AAE7D,QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAC/B,CAAC;AAEzD,QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CACpB,CAAC;AAEhE,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,cAMrD,CAAC;AAEH,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,cAAc,GACtB,CAAC"}
package/dist/config.js CHANGED
@@ -3,17 +3,19 @@ import { defu } from "defu";
3
3
  import { resolve } from "node:path";
4
4
  import { z } from "zod";
5
5
  import { configError, isRecord, rawIssue } from "./config-error.js";
6
+ import { deploySchema } from "./deploy.js";
6
7
  import { resolveUserEventSignals } from "./user-event-signals.js";
7
8
  const LIBRARIES_WILDCARD = "*";
8
9
  const GIR_LIBRARY_PATTERN = /^[A-Za-z][A-Za-z0-9]*-\d+(?:\.\d+)*$/;
9
10
  const APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\.[A-Za-z_][A-Za-z0-9_-]*)+$/;
10
11
  const APPLICATION_ID_MAX_LENGTH = 255;
12
+ /** Compilation modes `babel-plugin-react-compiler` accepts. */
11
13
  const COMPILATION_MODES = ["infer", "syntax", "annotation", "all"];
14
+ /** Panic thresholds `babel-plugin-react-compiler` accepts. */
12
15
  const PANIC_THRESHOLDS = ["none", "critical_errors", "all_errors"];
13
16
  const REACT_COMPILER_TARGET = "19";
14
17
  const COMPILATION_MODE_SET = new Set(COMPILATION_MODES);
15
18
  const PANIC_THRESHOLD_SET = new Set(PANIC_THRESHOLDS);
16
- /** Validates `libraries`: the `"*"` wildcard on its own, or a non-empty array of `Name-Version` identifiers. */
17
19
  const librariesSchema = z.custom().check((ctx) => {
18
20
  const value = ctx.value;
19
21
  if (value === LIBRARIES_WILDCARD) {
@@ -27,7 +29,6 @@ const librariesSchema = z.custom().check((ctx) => {
27
29
  ctx.issues.push(...libraryEntryIssues(value, index, entry));
28
30
  }
29
31
  });
30
- /** Validates `applicationId` against the reverse-DNS form `g_application_id_is_valid` accepts. */
31
32
  const applicationIdSchema = z.custom().check((ctx) => {
32
33
  const value = ctx.value;
33
34
  if (typeof value !== "string" || !isValidApplicationId(value)) {
@@ -35,7 +36,6 @@ const applicationIdSchema = z.custom().check((ctx) => {
35
36
  '(e.g. "org.example.MyApp")', true));
36
37
  }
37
38
  });
38
- /** Validates `reactCompiler`: a boolean, or an options object whose mode and threshold are known values. */
39
39
  const reactCompilerSchema = z.custom().check((ctx) => {
40
40
  const value = ctx.value;
41
41
  if (typeof value === "boolean") {
@@ -56,67 +56,40 @@ const reactCompilerSchema = z.custom().check((ctx) => {
56
56
  `must be one of ${PANIC_THRESHOLDS.join(", ")}`, true));
57
57
  }
58
58
  });
59
- /** Validates `userEventSignals`: GLib type names mapped to arrays of non-empty signal names. */
60
59
  const userEventSignalsSchema = z.record(z.string(), z.array(z.string({ error: "must be a non-empty signal name" }).min(1, { error: "must be a non-empty signal name" }), {
61
60
  error: "must be an array of signal names",
62
61
  }), { error: "must be a record of GLib type names to signal name arrays" });
63
- /** Validates a `{ module, export }` reference to a named export. */
64
62
  const moduleExportSchema = z.object({
65
- /** Specifier the export is imported from. */
66
63
  module: z.string({ error: "must be a module specifier" }).min(1, { error: "must be a module specifier" }),
67
- /** Identifier the module exports it under. */
68
64
  export: z.string({ error: "must be an export name" }).min(1, { error: "must be an export name" }),
69
65
  }, { error: "must be a { module, export } object" });
70
- /** Validates one entry of `elements.config`. */
71
66
  const elementConfigSchema = z.object({
72
- /** Component that wraps the generated element. */
73
67
  component: moduleExportSchema.optional(),
74
- /** Base props interface the generated element props extend. */
75
68
  props: moduleExportSchema.optional(),
76
- /** Marks the element as having no GObject of its own, its parent container creating one instead. */
77
69
  isLazy: z.boolean({ error: "must be a boolean" }).optional(),
78
- /** GObject properties to leave out of the generated element props, such as those a behavior fills. */
79
70
  omittedProps: z
80
71
  .array(z.string({ error: "must be a non-empty property name" }).min(1, {
81
72
  error: "must be a non-empty property name",
82
73
  }), { error: "must be an array of property names" })
83
74
  .optional(),
84
75
  });
85
- /** Validates `elements`: the behaviors module the app loads at runtime, plus the per-type entries. */
86
76
  const elementsSchema = z.object({
87
- /**
88
- * Path, resolved against the project root, of a module default-exporting element configs keyed by
89
- * GLib type name, as `defineElements` returns.
90
- */
91
77
  behaviors: z
92
78
  .string({ error: "must be a path to a module exporting element behaviors" })
93
79
  .min(1, { error: "must be a path to a module exporting element behaviors" })
94
80
  .optional(),
95
- /** Per-element entries, keyed by GLib type name. */
96
81
  config: z.record(z.string(), elementConfigSchema).optional(),
97
82
  });
98
- /** The shape every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */
83
+ /** Schema every `gtkx.config.ts` is validated against, and the source of the {@link Config} type. */
99
84
  const configSchema = z.object({
100
- /**
101
- * GIR namespaces to bind as `Name-Version`, or `"*"` for every one installed; omitting it gives
102
- * `Gtk-4.0`, which is also prepended to any list that names no Gtk version of its own.
103
- */
104
85
  libraries: librariesSchema.optional(),
105
- /** Directories searched for `.gir` files ahead of `GTKX_GIR_PATH` and the system locations. */
106
86
  girPath: z.array(z.string(), { error: "must be an array of strings if provided" }).optional(),
107
- /** Reverse-DNS GApplication identifier, and the default `applicationId` of the application element. */
108
87
  applicationId: applicationIdSchema,
109
- /** React Compiler settings; the compiler runs unless this is `false`. */
110
88
  reactCompiler: reactCompilerSchema.optional(),
111
- /** Whether to generate the binding stores; `false` makes the CLI resolve an already-installed one. */
112
89
  codegen: z.boolean({ error: "must be a boolean" }).optional(),
113
- /**
114
- * Signal names, keyed by GLib type name, that stay suppressed while a React commit applies props, so
115
- * their handlers only ever report user interaction. Unioned with the built-in GTK4 and Adwaita table.
116
- */
117
90
  userEventSignals: userEventSignalsSchema.optional(),
118
- /** Per-element customization: where the behaviors module lives and how each type's element is shaped. */
119
91
  elements: elementsSchema.optional(),
92
+ deploy: deploySchema.optional(),
120
93
  });
121
94
  /**
122
95
  * Returns the given configuration unchanged, typed as {@link Config}, so `gtkx.config.ts` gets
@@ -184,5 +157,5 @@ const resolveConfig = (config, root) => ({
184
157
  elements: resolveElementsModule(config.elements?.behaviors, root),
185
158
  lazyElements: resolveLazyElements(config.elements),
186
159
  });
187
- export { defineConfig, isValidApplicationId, resolveReactCompilerOptions, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmittedProps, resolveConfig, };
160
+ export { APPLICATION_ID_MAX_LENGTH, defineConfig, isValidApplicationId, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmittedProps, resolveConfig, };
188
161
  //# sourceMappingURL=config.js.map