@gtkx/config 1.0.0-rc.1 → 1.0.0-rc.3
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/dist/config-error.d.ts +16 -0
- package/dist/config-error.d.ts.map +1 -0
- package/dist/config-error.js +45 -0
- package/dist/config-error.js.map +1 -0
- package/dist/config.d.ts +59 -56
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +102 -42
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/loader.d.ts +15 -8
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +21 -21
- package/dist/loader.js.map +1 -1
- package/dist/user-event-signals.d.ts +4 -0
- package/dist/user-event-signals.d.ts.map +1 -0
- package/dist/user-event-signals.js +54 -0
- package/dist/user-event-signals.js.map +1 -0
- package/dist/virtual.d.ts +8 -3
- package/dist/virtual.d.ts.map +1 -1
- package/dist/virtual.js +26 -6
- package/dist/virtual.js.map +1 -1
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js +12 -13
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +5 -10
- package/src/config-error.ts +67 -0
- package/src/config.ts +210 -84
- package/src/index.ts +0 -12
- package/src/internal.ts +7 -1
- package/src/loader.ts +40 -27
- package/src/user-event-signals.ts +57 -0
- package/src/virtual.ts +28 -5
- package/src/vite-plugin.ts +25 -11
- package/dist/element-props.d.ts +0 -180
- package/dist/element-props.d.ts.map +0 -1
- package/dist/element-props.js +0 -154
- package/dist/element-props.js.map +0 -1
- package/env.d.ts +0 -8
- package/src/element-props.ts +0 -248
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
type IssuePath = (string | number)[];
|
|
3
|
+
declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
4
|
+
declare const rawIssue: (input: unknown, path: IssuePath, message: string, isStandalone?: boolean) => {
|
|
5
|
+
params?: {
|
|
6
|
+
standalone: boolean;
|
|
7
|
+
};
|
|
8
|
+
code: "custom";
|
|
9
|
+
input: unknown;
|
|
10
|
+
path: IssuePath;
|
|
11
|
+
message: string;
|
|
12
|
+
continue: true;
|
|
13
|
+
};
|
|
14
|
+
declare const configError: (error: z.ZodError) => Error;
|
|
15
|
+
export { isRecord, rawIssue, configError };
|
|
16
|
+
//# sourceMappingURL=config-error.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const CONFIG_PREFIX = "gtkx.config.ts:";
|
|
2
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
3
|
+
const rawIssue = (input, path, message, isStandalone = false) => ({
|
|
4
|
+
code: "custom",
|
|
5
|
+
input,
|
|
6
|
+
path,
|
|
7
|
+
message,
|
|
8
|
+
continue: true,
|
|
9
|
+
...(isStandalone && { params: { standalone: true } }),
|
|
10
|
+
});
|
|
11
|
+
const appendSegment = (path, segment) => {
|
|
12
|
+
if (typeof segment === "number") {
|
|
13
|
+
return `${path}[${String(segment)}]`;
|
|
14
|
+
}
|
|
15
|
+
return path === "" ? String(segment) : `${path}.${String(segment)}`;
|
|
16
|
+
};
|
|
17
|
+
const dottedPath = (segments) => {
|
|
18
|
+
let path = "";
|
|
19
|
+
for (const segment of segments) {
|
|
20
|
+
path = appendSegment(path, segment);
|
|
21
|
+
}
|
|
22
|
+
return path;
|
|
23
|
+
};
|
|
24
|
+
const isStandaloneIssue = (issue) => "params" in issue && isRecord(issue.params) && issue.params.standalone === true;
|
|
25
|
+
const formatIssue = (issue, fullPath) => {
|
|
26
|
+
if (issue.code === "unrecognized_keys") {
|
|
27
|
+
const [key] = issue.keys;
|
|
28
|
+
const path = dottedPath(key === undefined ? fullPath : [...fullPath, key]);
|
|
29
|
+
return `${CONFIG_PREFIX} \`${path}\` is not a recognized key`;
|
|
30
|
+
}
|
|
31
|
+
if (isStandaloneIssue(issue)) {
|
|
32
|
+
return `${CONFIG_PREFIX} ${issue.message}`;
|
|
33
|
+
}
|
|
34
|
+
const path = dottedPath(fullPath);
|
|
35
|
+
return path === "" ? `${CONFIG_PREFIX} ${issue.message}` : `${CONFIG_PREFIX} \`${path}\` ${issue.message}`;
|
|
36
|
+
};
|
|
37
|
+
const configError = (error) => {
|
|
38
|
+
const issue = error.issues[0];
|
|
39
|
+
if (issue === undefined) {
|
|
40
|
+
return new Error(`${CONFIG_PREFIX} invalid configuration`);
|
|
41
|
+
}
|
|
42
|
+
return new Error(formatIssue(issue, issue.path));
|
|
43
|
+
};
|
|
44
|
+
export { isRecord, rawIssue, configError };
|
|
45
|
+
//# sourceMappingURL=config-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG,iBAAiB,CAA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IG_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"]}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { type DefineConfig } from "c12";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
export declare const LIBRARIES_WILDCARD = "*";
|
|
4
|
-
export declare const GIR_LIBRARY_PATTERN: RegExp;
|
|
5
|
-
export declare const isValidApplicationId: (applicationId: string) => boolean;
|
|
6
|
-
declare const COMPILATION_MODES: readonly ["infer", "syntax", "annotation", "all"];
|
|
7
|
-
declare const PANIC_THRESHOLDS: readonly ["none", "critical_errors", "all_errors"];
|
|
8
3
|
type ReactCompilerCompilationMode = (typeof COMPILATION_MODES)[number];
|
|
9
4
|
type ReactCompilerPanicThreshold = (typeof PANIC_THRESHOLDS)[number];
|
|
10
5
|
type ReactCompilerOptions = {
|
|
@@ -15,72 +10,80 @@ type ReactCompilerOptions = {
|
|
|
15
10
|
* React Compiler options resolved for the build, with the compilation target
|
|
16
11
|
* fixed to React 19.
|
|
17
12
|
*/
|
|
18
|
-
|
|
13
|
+
type ResolvedReactCompilerOptions = ReactCompilerOptions & {
|
|
19
14
|
target: "19";
|
|
20
15
|
};
|
|
21
|
-
|
|
16
|
+
/**
|
|
17
|
+
* User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`:
|
|
18
|
+
* the GIR libraries to bind, extra `.gir` search paths, the GApplication id,
|
|
19
|
+
* a module of per-element configuration (lazy flags and custom behaviors),
|
|
20
|
+
* per-element component wrappers and omitted props keyed by GLib type name, the
|
|
21
|
+
* React Compiler and codegen settings, additional user event signals to suppress
|
|
22
|
+
* during React commits, and extra GIR records to treat as class structs.
|
|
23
|
+
*/
|
|
24
|
+
type Config = z.infer<typeof configSchema>;
|
|
25
|
+
/** A `{ module, export }` reference to a named export, as element config entries carry it. */
|
|
26
|
+
type ModuleExport = z.infer<typeof moduleExportSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* Configuration reduced to the values needed at runtime: the GApplication
|
|
29
|
+
* identifier, the resolved React Compiler options (`null` when disabled), the
|
|
30
|
+
* user event signals suppressed while a React commit is in progress, and the
|
|
31
|
+
* module path holding per-element configuration (`null` when unset).
|
|
32
|
+
*/
|
|
33
|
+
type ResolvedConfig = {
|
|
34
|
+
applicationId: string;
|
|
35
|
+
reactCompiler: ResolvedReactCompilerOptions | null;
|
|
36
|
+
userEventSignals: Record<string, string[]>;
|
|
37
|
+
elements: string | null;
|
|
38
|
+
lazyElements: string[];
|
|
39
|
+
};
|
|
40
|
+
declare const COMPILATION_MODES: readonly ["infer", "syntax", "annotation", "all"];
|
|
41
|
+
declare const PANIC_THRESHOLDS: readonly ["none", "critical_errors", "all_errors"];
|
|
42
|
+
declare const moduleExportSchema: z.ZodObject<{
|
|
43
|
+
module: z.ZodString;
|
|
44
|
+
export: z.ZodString;
|
|
45
|
+
}, z.core.$strip>;
|
|
22
46
|
declare const configSchema: z.ZodObject<{
|
|
23
|
-
libraries: z.ZodOptional<z.ZodCustom<"*"
|
|
47
|
+
libraries: z.ZodOptional<z.ZodCustom<string[] | "*", string[] | "*">>;
|
|
24
48
|
girPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
49
|
applicationId: z.ZodCustom<string, string>;
|
|
26
|
-
elementProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
27
|
-
kind: z.ZodLiteral<"container">;
|
|
28
|
-
prop: z.ZodString;
|
|
29
|
-
child: z.ZodString;
|
|
30
|
-
append: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
31
|
-
remove: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
32
|
-
insert: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
33
|
-
reorder: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
34
|
-
autowrap: z.ZodOptional<z.ZodString>;
|
|
35
|
-
adopt: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodString]>>;
|
|
36
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
-
kind: z.ZodLiteral<"value">;
|
|
38
|
-
prop: z.ZodString;
|
|
39
|
-
call: z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>;
|
|
40
|
-
after: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
42
|
-
kind: z.ZodLiteral<"controlled-text">;
|
|
43
|
-
prop: z.ZodString;
|
|
44
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
45
|
-
kind: z.ZodLiteral<"lazy">;
|
|
46
|
-
prop: z.ZodString;
|
|
47
|
-
lookup: z.ZodOptional<z.ZodString>;
|
|
48
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
49
|
-
kind: z.ZodLiteral<"list">;
|
|
50
|
-
prop: z.ZodString;
|
|
51
|
-
add: z.ZodUnion<readonly [z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>, z.ZodArray<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>]>;
|
|
52
|
-
remove: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
53
|
-
clear: z.ZodOptional<z.ZodCustom<import("./element-props.js").Call, import("./element-props.js").Call>>;
|
|
54
|
-
}, z.core.$strict>], "kind">>>>;
|
|
55
50
|
reactCompiler: z.ZodOptional<z.ZodCustom<boolean | ReactCompilerOptions, boolean | ReactCompilerOptions>>;
|
|
56
51
|
codegen: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
userEventSignals: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
53
|
+
elements: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
behaviors: z.ZodOptional<z.ZodString>;
|
|
55
|
+
config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
56
|
+
component: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
module: z.ZodString;
|
|
58
|
+
export: z.ZodString;
|
|
59
|
+
}, z.core.$strip>>;
|
|
60
|
+
props: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
module: z.ZodString;
|
|
62
|
+
export: z.ZodString;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
lazy: z.ZodOptional<z.ZodBoolean>;
|
|
65
|
+
omitProps: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
}, z.core.$strip>>>;
|
|
67
|
+
}, z.core.$strip>>;
|
|
57
68
|
}, z.core.$strip>;
|
|
58
|
-
/**
|
|
59
|
-
* User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`:
|
|
60
|
-
* the GIR libraries to bind, extra `.gir` search paths, the GApplication id,
|
|
61
|
-
* custom element prop mappings, and the React Compiler and codegen settings.
|
|
62
|
-
*/
|
|
63
|
-
export type Config = z.infer<typeof configSchema>;
|
|
64
|
-
export declare const validateConfig: (config: Config) => void;
|
|
65
69
|
/**
|
|
66
70
|
* Identity helper that returns the given configuration typed as {@link Config},
|
|
67
71
|
* enabling editor autocompletion and type checking in `gtkx.config.ts`.
|
|
68
72
|
*/
|
|
69
|
-
|
|
73
|
+
declare const defineConfig: DefineConfig<Config>;
|
|
74
|
+
declare const isValidApplicationId: (applicationId: string) => boolean;
|
|
75
|
+
declare const resolveReactCompilerOptions: (setting: Config["reactCompiler"]) => ResolvedReactCompilerOptions | null;
|
|
76
|
+
declare const validateConfig: (config: Config) => void;
|
|
70
77
|
/**
|
|
71
78
|
* Deep-merges two configurations, with `override` taking precedence over `base`.
|
|
72
79
|
* @param base The lower-priority configuration.
|
|
73
80
|
* @param override The higher-priority configuration whose values win on conflict.
|
|
74
81
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
reactCompiler: ResolvedReactCompilerOptions | null;
|
|
83
|
-
};
|
|
84
|
-
export declare const resolveConfig: (config: Config) => ResolvedConfig;
|
|
85
|
-
export {};
|
|
82
|
+
declare const mergeConfig: (base: Config, override: Config) => Config;
|
|
83
|
+
declare const resolveLazyElements: (elements: Config["elements"]) => string[];
|
|
84
|
+
declare const resolveElementComponents: (elements: Config["elements"]) => Record<string, ModuleExport>;
|
|
85
|
+
declare const resolveElementProps: (elements: Config["elements"]) => Record<string, ModuleExport>;
|
|
86
|
+
declare const resolveOmitProps: (elements: Config["elements"]) => Record<string, string[]>;
|
|
87
|
+
declare const resolveConfig: (config: Config, root?: string) => ResolvedConfig;
|
|
88
|
+
export { defineConfig, isValidApplicationId, resolveReactCompilerOptions, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmitProps, resolveConfig, type ResolvedReactCompilerOptions, type Config, type ModuleExport, type ResolvedConfig, };
|
|
86
89
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;
|
|
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,KAAK,4BAA4B,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AACvE,KAAK,2BAA2B,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,KAAK,oBAAoB,GAAG;IACxB,eAAe,CAAC,EAAE,4BAA4B,CAAC;IAC/C,cAAc,CAAC,EAAE,2BAA2B,CAAC;CAChD,CAAC;AAEF;;;GAGG;AACH,KAAK,4BAA4B,GAAG,oBAAoB,GAAG;IACvD,MAAM,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;;;;;;GAOG;AACH,KAAK,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAC3C,8FAA8F;AAC9F,KAAK,YAAY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AAC;AAEzD,QAAA,MAAM,gBAAgB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CACpB,CAAC;AAE7D,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,cAMrD,CAAC;AAEH,OAAO,EACH,YAAY,EACZ,oBAAoB,EACpB,2BAA2B,EAC3B,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,cAAc,GACtB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -1,97 +1,157 @@
|
|
|
1
1
|
import { createDefineConfig } from "c12";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
+
import { resolve } from "node:path";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
import { configError,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { configError, isRecord, rawIssue } from "./config-error.js";
|
|
6
|
+
import { resolveUserEventSignals } from "./user-event-signals.js";
|
|
7
|
+
const LIBRARIES_WILDCARD = "*";
|
|
8
|
+
const GIR_LIBRARY_PATTERN = /^[A-Za-z][A-Za-z0-9]*-\d+(?:\.\d+)*$/;
|
|
7
9
|
const APPLICATION_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]*(\.[A-Za-z_][A-Za-z0-9_-]*)+$/;
|
|
8
10
|
const APPLICATION_ID_MAX_LENGTH = 255;
|
|
9
|
-
export const isValidApplicationId = (applicationId) => {
|
|
10
|
-
if (applicationId.length === 0 || applicationId.length > APPLICATION_ID_MAX_LENGTH) {
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
return APPLICATION_ID_PATTERN.test(applicationId);
|
|
14
|
-
};
|
|
15
11
|
const COMPILATION_MODES = ["infer", "syntax", "annotation", "all"];
|
|
16
12
|
const PANIC_THRESHOLDS = ["none", "critical_errors", "all_errors"];
|
|
17
13
|
const REACT_COMPILER_TARGET = "19";
|
|
18
|
-
export const resolveReactCompilerOptions = (setting) => {
|
|
19
|
-
if (setting === false)
|
|
20
|
-
return null;
|
|
21
|
-
const overrides = setting === undefined || setting === true ? {} : setting;
|
|
22
|
-
return { ...overrides, target: REACT_COMPILER_TARGET };
|
|
23
|
-
};
|
|
24
14
|
const COMPILATION_MODE_SET = new Set(COMPILATION_MODES);
|
|
25
15
|
const PANIC_THRESHOLD_SET = new Set(PANIC_THRESHOLDS);
|
|
26
16
|
const librariesSchema = z.custom().check((ctx) => {
|
|
27
17
|
const value = ctx.value;
|
|
28
|
-
if (value === LIBRARIES_WILDCARD)
|
|
18
|
+
if (value === LIBRARIES_WILDCARD) {
|
|
29
19
|
return;
|
|
20
|
+
}
|
|
30
21
|
if (!Array.isArray(value) || value.length === 0) {
|
|
31
22
|
ctx.issues.push(rawIssue(value, [], `must be "${LIBRARIES_WILDCARD}", a non-empty string array, or omitted`));
|
|
32
23
|
return;
|
|
33
24
|
}
|
|
34
|
-
value.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (entry === LIBRARIES_WILDCARD) {
|
|
38
|
-
ctx.issues.push(rawIssue(value, [index], `to generate every library, set \`libraries: "${LIBRARIES_WILDCARD}"\` as a bare string, not an array entry`, true));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
ctx.issues.push(rawIssue(value, [index], `invalid library identifier "${String(entry)}", must be of the form "Name-Version" (e.g. "Gtk-4.0")`, true));
|
|
42
|
-
});
|
|
25
|
+
for (const [index, entry] of value.entries()) {
|
|
26
|
+
ctx.issues.push(...libraryEntryIssues(value, index, entry));
|
|
27
|
+
}
|
|
43
28
|
});
|
|
44
29
|
const applicationIdSchema = z.custom().check((ctx) => {
|
|
45
30
|
const value = ctx.value;
|
|
46
31
|
if (typeof value !== "string" || !isValidApplicationId(value)) {
|
|
47
|
-
ctx.issues.push(rawIssue(value, [], `invalid \`applicationId\` "${
|
|
32
|
+
ctx.issues.push(rawIssue(value, [], `invalid \`applicationId\` "${value}", must satisfy g_application_id_is_valid ` +
|
|
33
|
+
'(e.g. "org.example.MyApp")', true));
|
|
48
34
|
}
|
|
49
35
|
});
|
|
50
36
|
const reactCompilerSchema = z.custom().check((ctx) => {
|
|
51
37
|
const value = ctx.value;
|
|
52
|
-
if (typeof value === "boolean")
|
|
38
|
+
if (typeof value === "boolean") {
|
|
53
39
|
return;
|
|
40
|
+
}
|
|
54
41
|
if (!isRecord(value)) {
|
|
55
42
|
ctx.issues.push(rawIssue(value, [], "must be a boolean or an options object"));
|
|
56
43
|
return;
|
|
57
44
|
}
|
|
58
45
|
const compilationMode = value.compilationMode;
|
|
59
|
-
if (compilationMode
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
if (!isValidReactCompilerOption(compilationMode, COMPILATION_MODE_SET)) {
|
|
47
|
+
ctx.issues.push(rawIssue(value, [], `invalid \`reactCompiler.compilationMode\` "${String(compilationMode)}", ` +
|
|
48
|
+
`must be one of ${COMPILATION_MODES.join(", ")}`, true));
|
|
62
49
|
}
|
|
63
50
|
const panicThreshold = value.panicThreshold;
|
|
64
|
-
if (panicThreshold
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
if (!isValidReactCompilerOption(panicThreshold, PANIC_THRESHOLD_SET)) {
|
|
52
|
+
ctx.issues.push(rawIssue(value, [], `invalid \`reactCompiler.panicThreshold\` "${String(panicThreshold)}", ` +
|
|
53
|
+
`must be one of ${PANIC_THRESHOLDS.join(", ")}`, true));
|
|
67
54
|
}
|
|
68
55
|
});
|
|
56
|
+
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" }), {
|
|
57
|
+
error: "must be an array of signal names",
|
|
58
|
+
}), { error: "must be a record of GLib type names to signal name arrays" });
|
|
59
|
+
const moduleExportSchema = z.object({
|
|
60
|
+
module: z.string({ error: "must be a module specifier" }).min(1, { error: "must be a module specifier" }),
|
|
61
|
+
export: z.string({ error: "must be an export name" }).min(1, { error: "must be an export name" }),
|
|
62
|
+
}, { error: "must be a { module, export } object" });
|
|
63
|
+
const elementConfigSchema = z.object({
|
|
64
|
+
component: moduleExportSchema.optional(),
|
|
65
|
+
props: moduleExportSchema.optional(),
|
|
66
|
+
lazy: z.boolean({ error: "must be a boolean" }).optional(),
|
|
67
|
+
omitProps: z
|
|
68
|
+
.array(z.string({ error: "must be a non-empty property name" }).min(1, {
|
|
69
|
+
error: "must be a non-empty property name",
|
|
70
|
+
}), { error: "must be an array of property names" })
|
|
71
|
+
.optional(),
|
|
72
|
+
});
|
|
73
|
+
const elementsSchema = z.object({
|
|
74
|
+
behaviors: z
|
|
75
|
+
.string({ error: "must be a path to a module exporting element behaviors" })
|
|
76
|
+
.min(1, { error: "must be a path to a module exporting element behaviors" })
|
|
77
|
+
.optional(),
|
|
78
|
+
config: z.record(z.string(), elementConfigSchema).optional(),
|
|
79
|
+
});
|
|
69
80
|
const configSchema = z.object({
|
|
70
81
|
libraries: librariesSchema.optional(),
|
|
71
82
|
girPath: z.array(z.string(), { error: "must be an array of strings if provided" }).optional(),
|
|
72
83
|
applicationId: applicationIdSchema,
|
|
73
|
-
elementProps: elementPropsSchema.optional(),
|
|
74
84
|
reactCompiler: reactCompilerSchema.optional(),
|
|
75
85
|
codegen: z.boolean({ error: "must be a boolean" }).optional(),
|
|
86
|
+
userEventSignals: userEventSignalsSchema.optional(),
|
|
87
|
+
elements: elementsSchema.optional(),
|
|
76
88
|
});
|
|
77
|
-
export const validateConfig = (config) => {
|
|
78
|
-
const result = configSchema.safeParse(config);
|
|
79
|
-
if (!result.success)
|
|
80
|
-
throw configError(result.error);
|
|
81
|
-
};
|
|
82
89
|
/**
|
|
83
90
|
* Identity helper that returns the given configuration typed as {@link Config},
|
|
84
91
|
* enabling editor autocompletion and type checking in `gtkx.config.ts`.
|
|
85
92
|
*/
|
|
86
|
-
|
|
93
|
+
const defineConfig = createDefineConfig();
|
|
94
|
+
const libraryEntryIssues = (value, index, entry) => {
|
|
95
|
+
if (typeof entry === "string" && GIR_LIBRARY_PATTERN.test(entry)) {
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
if (entry === LIBRARIES_WILDCARD) {
|
|
99
|
+
const message = `to generate every library, set \`libraries: "${LIBRARIES_WILDCARD}"\` as a bare string, ` +
|
|
100
|
+
"not an array entry";
|
|
101
|
+
return [rawIssue(value, [index], message, true)];
|
|
102
|
+
}
|
|
103
|
+
const message = `invalid library identifier "${String(entry)}", must be of the form "Name-Version" ` +
|
|
104
|
+
'(e.g. "Gtk-4.0")';
|
|
105
|
+
return [rawIssue(value, [index], message, true)];
|
|
106
|
+
};
|
|
107
|
+
const isValidApplicationId = (applicationId) => {
|
|
108
|
+
if (applicationId.length === 0 || applicationId.length > APPLICATION_ID_MAX_LENGTH) {
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
return APPLICATION_ID_PATTERN.test(applicationId);
|
|
112
|
+
};
|
|
113
|
+
const resolveReactCompilerOptions = (setting) => {
|
|
114
|
+
if (setting === false) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const overrides = setting === undefined || setting === true ? {} : setting;
|
|
118
|
+
return { ...overrides, target: REACT_COMPILER_TARGET };
|
|
119
|
+
};
|
|
120
|
+
const isValidReactCompilerOption = (value, allowed) => value === undefined || (typeof value === "string" && allowed.has(value));
|
|
121
|
+
const validateConfig = (config) => {
|
|
122
|
+
const result = configSchema.safeParse(config);
|
|
123
|
+
if (!result.success) {
|
|
124
|
+
throw configError(result.error);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
87
127
|
/**
|
|
88
128
|
* Deep-merges two configurations, with `override` taking precedence over `base`.
|
|
89
129
|
* @param base The lower-priority configuration.
|
|
90
130
|
* @param override The higher-priority configuration whose values win on conflict.
|
|
91
131
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
132
|
+
const mergeConfig = (base, override) => defu(override, base);
|
|
133
|
+
const resolveElementsModule = (behaviors, root) => {
|
|
134
|
+
if (behaviors === undefined) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return root === undefined ? behaviors : resolve(root, behaviors);
|
|
138
|
+
};
|
|
139
|
+
const resolveLazyElements = (elements) => Object.entries(elements?.config ?? {})
|
|
140
|
+
.filter(([, entry]) => entry.lazy === true)
|
|
141
|
+
.map(([type]) => type);
|
|
142
|
+
const elementEntryValues = (elements, pick) => Object.fromEntries(Object.entries(elements?.config ?? {}).flatMap(([type, entry]) => {
|
|
143
|
+
const value = pick(entry);
|
|
144
|
+
return value === undefined ? [] : [[type, value]];
|
|
145
|
+
}));
|
|
146
|
+
const resolveElementComponents = (elements) => elementEntryValues(elements, (entry) => entry.component);
|
|
147
|
+
const resolveElementProps = (elements) => elementEntryValues(elements, (entry) => entry.props);
|
|
148
|
+
const resolveOmitProps = (elements) => elementEntryValues(elements, (entry) => entry.omitProps);
|
|
149
|
+
const resolveConfig = (config, root) => ({
|
|
94
150
|
applicationId: config.applicationId,
|
|
95
151
|
reactCompiler: resolveReactCompilerOptions(config.reactCompiler),
|
|
152
|
+
userEventSignals: resolveUserEventSignals(config.userEventSignals),
|
|
153
|
+
elements: resolveElementsModule(config.elements?.behaviors, root),
|
|
154
|
+
lazyElements: resolveLazyElements(config.elements),
|
|
96
155
|
});
|
|
156
|
+
export { defineConfig, isValidApplicationId, resolveReactCompilerOptions, validateConfig, mergeConfig, resolveLazyElements, resolveElementComponents, resolveElementProps, resolveOmitProps, resolveConfig, };
|
|
97
157
|
//# sourceMappingURL=config.js.map
|
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,EA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":["import { createDefineConfig, type DefineConfig } from \"c12\";\nimport { defu } from \"defu\";\nimport { z } from \"zod\";\nimport { configError, elementPropsSchema, isRecord, rawIssue } from \"./element-props.js\";\n\nexport const LIBRARIES_WILDCARD = \"*\";\n\nexport const GIR_LIBRARY_PATTERN: RegExp = /^[A-Za-z][A-Za-z0-9]*-\\d+(?:\\.\\d+)*$/;\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;\n\nexport const isValidApplicationId = (applicationId: string): boolean => {\n if (applicationId.length === 0 || applicationId.length > APPLICATION_ID_MAX_LENGTH) {\n return false;\n }\n return APPLICATION_ID_PATTERN.test(applicationId);\n};\n\nconst COMPILATION_MODES = [\"infer\", \"syntax\", \"annotation\", \"all\"] as const;\n\nconst PANIC_THRESHOLDS = [\"none\", \"critical_errors\", \"all_errors\"] as const;\n\ntype ReactCompilerCompilationMode = (typeof COMPILATION_MODES)[number];\n\ntype ReactCompilerPanicThreshold = (typeof PANIC_THRESHOLDS)[number];\n\ntype ReactCompilerOptions = {\n compilationMode?: ReactCompilerCompilationMode;\n panicThreshold?: ReactCompilerPanicThreshold;\n};\n\n/**\n * React Compiler options resolved for the build, with the compilation target\n * fixed to React 19.\n */\nexport type ResolvedReactCompilerOptions = ReactCompilerOptions & {\n target: \"19\";\n};\n\nconst REACT_COMPILER_TARGET = \"19\";\n\nexport const resolveReactCompilerOptions = (setting: Config[\"reactCompiler\"]): ResolvedReactCompilerOptions | null => {\n if (setting === false) return null;\n const overrides = setting === undefined || setting === true ? {} : setting;\n return { ...overrides, target: REACT_COMPILER_TARGET };\n};\n\nconst COMPILATION_MODE_SET: Set<string> = new Set(COMPILATION_MODES);\n\nconst PANIC_THRESHOLD_SET: Set<string> = new Set(PANIC_THRESHOLDS);\n\nconst librariesSchema = z.custom<typeof LIBRARIES_WILDCARD | string[]>().check((ctx) => {\n const value = ctx.value;\n if (value === LIBRARIES_WILDCARD) return;\n if (!Array.isArray(value) || value.length === 0) {\n ctx.issues.push(rawIssue(value, [], `must be \"${LIBRARIES_WILDCARD}\", a non-empty string array, or omitted`));\n return;\n }\n value.forEach((entry, index) => {\n if (typeof entry === \"string\" && GIR_LIBRARY_PATTERN.test(entry)) return;\n if (entry === LIBRARIES_WILDCARD) {\n ctx.issues.push(\n rawIssue(\n value,\n [index],\n `to generate every library, set \\`libraries: \"${LIBRARIES_WILDCARD}\"\\` as a bare string, not an array entry`,\n true,\n ),\n );\n return;\n }\n ctx.issues.push(\n rawIssue(\n value,\n [index],\n `invalid library identifier \"${String(entry)}\", must be of the form \"Name-Version\" (e.g. \"Gtk-4.0\")`,\n true,\n ),\n );\n });\n});\n\nconst applicationIdSchema = z.custom<string>().check((ctx) => {\n const value = ctx.value;\n if (typeof value !== \"string\" || !isValidApplicationId(value)) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`applicationId\\` \"${String(value)}\", must satisfy g_application_id_is_valid (e.g. \"org.example.MyApp\")`,\n true,\n ),\n );\n }\n});\n\nconst reactCompilerSchema = z.custom<boolean | ReactCompilerOptions>().check((ctx) => {\n const value = ctx.value;\n if (typeof value === \"boolean\") return;\n if (!isRecord(value)) {\n ctx.issues.push(rawIssue(value, [], \"must be a boolean or an options object\"));\n return;\n }\n const compilationMode = value.compilationMode;\n if (\n compilationMode !== undefined &&\n !(typeof compilationMode === \"string\" && COMPILATION_MODE_SET.has(compilationMode))\n ) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`reactCompiler.compilationMode\\` \"${String(compilationMode)}\", must be one of ${COMPILATION_MODES.join(\", \")}`,\n true,\n ),\n );\n }\n const panicThreshold = value.panicThreshold;\n if (\n panicThreshold !== undefined &&\n !(typeof panicThreshold === \"string\" && PANIC_THRESHOLD_SET.has(panicThreshold))\n ) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`reactCompiler.panicThreshold\\` \"${String(panicThreshold)}\", must be one of ${PANIC_THRESHOLDS.join(\", \")}`,\n true,\n ),\n );\n }\n});\n\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 elementProps: elementPropsSchema.optional(),\n reactCompiler: reactCompilerSchema.optional(),\n codegen: z.boolean({ error: \"must be a boolean\" }).optional(),\n});\n\n/**\n * User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`:\n * the GIR libraries to bind, extra `.gir` search paths, the GApplication id,\n * custom element prop mappings, and the React Compiler and codegen settings.\n */\nexport type Config = z.infer<typeof configSchema>;\n\nexport const validateConfig = (config: Config): void => {\n const result = configSchema.safeParse(config);\n if (!result.success) throw configError(result.error);\n};\n\n/**\n * Identity helper that returns the given configuration typed as {@link Config},\n * enabling editor autocompletion and type checking in `gtkx.config.ts`.\n */\nexport const defineConfig: DefineConfig<Config> = createDefineConfig<Config>();\n\n/**\n * Deep-merges two configurations, with `override` taking precedence over `base`.\n * @param base The lower-priority configuration.\n * @param override The higher-priority configuration whose values win on conflict.\n */\nexport const mergeConfig = (base: Config, override: Config): Config => defu(override, base);\n\n/**\n * Configuration reduced to the values needed at runtime: the GApplication\n * identifier and the resolved React Compiler options (`null` when disabled).\n */\nexport type ResolvedConfig = {\n applicationId: string;\n reactCompiler: ResolvedReactCompilerOptions | null;\n};\n\nexport const resolveConfig = (config: Config): ResolvedConfig => ({\n applicationId: config.applicationId,\n reactCompiler: resolveReactCompilerOptions(config.reactCompiler),\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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ACH,YAAY,EACZ,oBAAoB,EACpB,2BAA2B,EAC3B,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,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, rawIssue } from \"./config-error.js\";\nimport { resolveUserEventSignals } from \"./user-event-signals.js\";\n\ntype ReactCompilerCompilationMode = (typeof COMPILATION_MODES)[number];\ntype ReactCompilerPanicThreshold = (typeof PANIC_THRESHOLDS)[number];\n\ntype ReactCompilerOptions = {\n compilationMode?: ReactCompilerCompilationMode;\n panicThreshold?: ReactCompilerPanicThreshold;\n};\n\n/**\n * React Compiler options resolved for the build, with the compilation target\n * fixed to React 19.\n */\ntype ResolvedReactCompilerOptions = ReactCompilerOptions & {\n target: \"19\";\n};\n\n/**\n * User-facing configuration for a GTKX project, as authored in `gtkx.config.ts`:\n * the GIR libraries to bind, extra `.gir` search paths, the GApplication id,\n * a module of per-element configuration (lazy flags and custom behaviors),\n * per-element component wrappers and omitted props keyed by GLib type name, the\n * React Compiler and codegen settings, additional user event signals to suppress\n * during React commits, and extra GIR records to treat as class structs.\n */\ntype Config = z.infer<typeof configSchema>;\n/** A `{ module, export }` reference to a named export, as element config entries carry it. */\ntype ModuleExport = z.infer<typeof moduleExportSchema>;\ntype ElementConfigEntry = z.infer<typeof elementConfigSchema>;\n\n/**\n * Configuration reduced to the values needed at runtime: the GApplication\n * identifier, the resolved React Compiler options (`null` when disabled), the\n * user event signals suppressed while a React commit is in progress, and the\n * module path holding per-element configuration (`null` when unset).\n */\ntype ResolvedConfig = {\n applicationId: string;\n reactCompiler: ResolvedReactCompilerOptions | null;\n userEventSignals: Record<string, string[]>;\n elements: string | null;\n lazyElements: string[];\n};\n\nconst LIBRARIES_WILDCARD = \"*\";\nconst GIR_LIBRARY_PATTERN = /^[A-Za-z][A-Za-z0-9]*-\\d+(?:\\.\\d+)*$/;\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 COMPILATION_MODES = [\"infer\", \"syntax\", \"annotation\", \"all\"] as const;\nconst PANIC_THRESHOLDS = [\"none\", \"critical_errors\", \"all_errors\"] as const;\nconst REACT_COMPILER_TARGET = \"19\";\nconst COMPILATION_MODE_SET: Set<string> = new Set(COMPILATION_MODES);\nconst PANIC_THRESHOLD_SET: Set<string> = new Set(PANIC_THRESHOLDS);\n\nconst librariesSchema = z.custom<typeof LIBRARIES_WILDCARD | string[]>().check((ctx) => {\n const value = ctx.value;\n\n if (value === LIBRARIES_WILDCARD) {\n return;\n }\n\n if (!Array.isArray(value) || value.length === 0) {\n ctx.issues.push(rawIssue(value, [], `must be \"${LIBRARIES_WILDCARD}\", a non-empty string array, or omitted`));\n\n return;\n }\n\n for (const [index, entry] of value.entries()) {\n ctx.issues.push(...libraryEntryIssues(value, index, entry));\n }\n});\n\nconst applicationIdSchema = z.custom<string>().check((ctx) => {\n const value = ctx.value;\n\n if (typeof value !== \"string\" || !isValidApplicationId(value)) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`applicationId\\` \"${value}\", must satisfy g_application_id_is_valid ` +\n '(e.g. \"org.example.MyApp\")',\n true,\n ),\n );\n }\n});\n\nconst reactCompilerSchema = z.custom<boolean | ReactCompilerOptions>().check((ctx) => {\n const value = ctx.value;\n\n if (typeof value === \"boolean\") {\n return;\n }\n\n if (!isRecord(value)) {\n ctx.issues.push(rawIssue(value, [], \"must be a boolean or an options object\"));\n\n return;\n }\n\n const compilationMode = value.compilationMode;\n\n if (!isValidReactCompilerOption(compilationMode, COMPILATION_MODE_SET)) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`reactCompiler.compilationMode\\` \"${String(compilationMode)}\", ` +\n `must be one of ${COMPILATION_MODES.join(\", \")}`,\n true,\n ),\n );\n }\n\n const panicThreshold = value.panicThreshold;\n\n if (!isValidReactCompilerOption(panicThreshold, PANIC_THRESHOLD_SET)) {\n ctx.issues.push(\n rawIssue(\n value,\n [],\n `invalid \\`reactCompiler.panicThreshold\\` \"${String(panicThreshold)}\", ` +\n `must be one of ${PANIC_THRESHOLDS.join(\", \")}`,\n true,\n ),\n );\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 lazy: z.boolean({ error: \"must be a boolean\" }).optional(),\n omitProps: 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 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});\n\n/**\n * Identity helper that returns the given configuration typed as {@link Config},\n * enabling editor autocompletion and type checking in `gtkx.config.ts`.\n */\nconst defineConfig: DefineConfig<Config> = createDefineConfig<Config>();\n\nconst libraryEntryIssues = (value: unknown[], index: number, entry: unknown): ReturnType<typeof rawIssue>[] => {\n if (typeof entry === \"string\" && GIR_LIBRARY_PATTERN.test(entry)) {\n return [];\n }\n\n if (entry === LIBRARIES_WILDCARD) {\n const message =\n `to generate every library, set \\`libraries: \"${LIBRARIES_WILDCARD}\"\\` as a bare string, ` +\n \"not an array entry\";\n\n return [rawIssue(value, [index], message, true)];\n }\n\n const message =\n `invalid library identifier \"${String(entry)}\", must be of the form \"Name-Version\" ` +\n '(e.g. \"Gtk-4.0\")';\n\n return [rawIssue(value, [index], message, true)];\n};\n\nconst isValidApplicationId = (applicationId: string): boolean => {\n if (applicationId.length === 0 || applicationId.length > APPLICATION_ID_MAX_LENGTH) {\n return false;\n }\n\n return APPLICATION_ID_PATTERN.test(applicationId);\n};\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 { ...overrides, target: REACT_COMPILER_TARGET };\n};\n\nconst isValidReactCompilerOption = (value: unknown, allowed: Set<string>): boolean =>\n value === undefined || (typeof value === \"string\" && allowed.has(value));\n\nconst validateConfig = (config: Config): void => {\n const result = configSchema.safeParse(config);\n\n if (!result.success) {\n throw configError(result.error);\n }\n};\n\n/**\n * Deep-merges two configurations, with `override` taking precedence over `base`.\n * @param base The lower-priority configuration.\n * @param override The higher-priority configuration whose values win on conflict.\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.lazy === 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 resolveOmitProps = (elements: Config[\"elements\"]): Record<string, string[]> =>\n elementEntryValues(elements, (entry) => entry.omitProps);\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 defineConfig,\n isValidApplicationId,\n resolveReactCompilerOptions,\n validateConfig,\n mergeConfig,\n resolveLazyElements,\n resolveElementComponents,\n resolveElementProps,\n resolveOmitProps,\n resolveConfig,\n type ResolvedReactCompilerOptions,\n type Config,\n type ModuleExport,\n type ResolvedConfig,\n};\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { type Config, defineConfig, mergeConfig, type ResolvedConfig, type ResolvedReactCompilerOptions, } from "./config.js";
|
|
2
|
-
export type { AppliedProp, Arg, ArgRef, Call, ContainerProp, ControlledTextProp, ElementProp, LazyProp, ListProp, ValueProp, } from "./element-props.js";
|
|
3
2
|
export { type LoadedConfig, loadConfig } from "./loader.js";
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,MAAM,EACX,YAAY,EACZ,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,4BAA4B,GACpC,MAAM,aAAa,CAAC;AACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,MAAM,EACX,YAAY,EACZ,WAAW,EACX,KAAK,cAAc,EACnB,KAAK,4BAA4B,GACpC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,YAAY,EACZ,WAAW,GAGd,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,YAAY,EACZ,WAAW,GAGd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,UAAU,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export {\n type Config,\n defineConfig,\n mergeConfig,\n type ResolvedConfig,\n type ResolvedReactCompilerOptions,\n} from \"./config.js\";\nexport { type LoadedConfig, loadConfig } from \"./loader.js\";\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmitProps, } from "./config.js";
|
|
2
2
|
export { type ConfigLoader, createConfigLoader } from "./loader.js";
|
|
3
3
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmitProps, } from "./config.js";
|
|
2
2
|
export { createConfigLoader } from "./loader.js";
|
|
3
3
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAqB,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export {\n isValidApplicationId,\n resolveElementComponents,\n resolveElementProps,\n resolveLazyElements,\n resolveOmitProps,\n} from \"./config.js\";\nexport { type ConfigLoader, createConfigLoader } from \"./loader.js\";\n"]}
|
package/dist/loader.d.ts
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { type Config, type ResolvedConfig } from "./config.js";
|
|
2
2
|
/**
|
|
3
3
|
* Result of loading a `gtkx.config.ts` file: the parsed configuration, the
|
|
4
|
-
* resolved config file path
|
|
5
|
-
* root it was loaded from.
|
|
4
|
+
* resolved config file path, and the project root it was loaded from.
|
|
6
5
|
*/
|
|
7
|
-
|
|
6
|
+
type LoadedConfig = {
|
|
8
7
|
config: Config;
|
|
9
|
-
configFile: string
|
|
8
|
+
configFile: string;
|
|
10
9
|
root: string;
|
|
11
10
|
};
|
|
12
|
-
|
|
11
|
+
type LoadConfigOptions = {
|
|
13
12
|
mode?: string | undefined;
|
|
14
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Caching accessor for a project's configuration: `load` yields the validated authored config together with
|
|
16
|
+
* its file path, and `resolve` yields the projection an app needs at runtime.
|
|
17
|
+
*/
|
|
18
|
+
type ConfigLoader = {
|
|
19
|
+
load: (cwd: string) => Promise<LoadedConfig>;
|
|
20
|
+
resolve: (cwd: string) => Promise<ResolvedConfig>;
|
|
21
|
+
};
|
|
15
22
|
/**
|
|
16
23
|
* Loads and validates the `gtkx.config.ts` file for a project, returning the
|
|
17
24
|
* parsed configuration together with the config file path and project root.
|
|
18
25
|
* @param cwd Directory from which to search for the configuration file.
|
|
19
26
|
* @param options Loading options, such as the environment mode.
|
|
20
27
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export
|
|
28
|
+
declare const loadConfig: (cwd: string, options?: LoadConfigOptions) => Promise<LoadedConfig>;
|
|
29
|
+
declare const createConfigLoader: (options?: LoadConfigOptions) => ConfigLoader;
|
|
30
|
+
export { loadConfig, createConfigLoader, type LoadedConfig, type LoadConfigOptions, type ConfigLoader };
|
|
24
31
|
//# sourceMappingURL=loader.d.ts.map
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAiB,KAAK,cAAc,EAAkB,MAAM,aAAa,CAAC;AAE9F;;;GAGG;AACH,KAAK,YAAY,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GAAU,KAAK,MAAM,EAAE,UAAS,iBAAsB,KAAG,OAAO,CAAC,YAAY,CAwB5F,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,UAAS,iBAAsB,KAAG,YAiB7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,YAAY,EAAE,CAAC"}
|