@gtkx/config 0.21.0 → 1.0.0-rc.1
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 +137 -82
- package/dist/config.d.ts +76 -35
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +76 -83
- package/dist/config.js.map +1 -1
- package/dist/element-props.d.ts +180 -0
- package/dist/element-props.d.ts.map +1 -0
- package/dist/element-props.js +154 -0
- package/dist/element-props.js.map +1 -0
- package/dist/index.d.ts +3 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +3 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +3 -0
- package/dist/internal.js.map +1 -0
- package/dist/loader.d.ts +19 -15
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +25 -39
- package/dist/loader.js.map +1 -1
- package/dist/virtual.d.ts +2 -4
- package/dist/virtual.d.ts.map +1 -1
- package/dist/virtual.js +2 -14
- package/dist/virtual.js.map +1 -1
- package/dist/vite-plugin.d.ts +16 -0
- package/dist/vite-plugin.d.ts.map +1 -0
- package/dist/vite-plugin.js +32 -0
- package/dist/vite-plugin.js.map +1 -0
- package/env.d.ts +4 -22
- package/package.json +20 -7
- package/src/config.ts +134 -144
- package/src/element-props.ts +248 -0
- package/src/index.ts +14 -82
- package/src/internal.ts +2 -0
- package/src/loader.ts +36 -56
- package/src/virtual.ts +3 -32
- package/src/vite-plugin.ts +37 -0
- package/dist/bundled-modules.d.ts +0 -2
- package/dist/bundled-modules.d.ts.map +0 -1
- package/dist/bundled-modules.js +0 -2
- package/dist/bundled-modules.js.map +0 -1
- package/dist/data-dir.d.ts +0 -4
- package/dist/data-dir.d.ts.map +0 -1
- package/dist/data-dir.js +0 -37
- package/dist/data-dir.js.map +0 -1
- package/dist/plugin.d.ts +0 -9
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -24
- package/dist/plugin.js.map +0 -1
- package/dist/runtime.d.ts +0 -22
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -22
- package/dist/runtime.js.map +0 -1
- package/dist/table-rules-ir.d.ts +0 -36
- package/dist/table-rules-ir.d.ts.map +0 -1
- package/dist/table-rules-ir.js +0 -2
- package/dist/table-rules-ir.js.map +0 -1
- package/dist/table-schema.d.ts +0 -107
- package/dist/table-schema.d.ts.map +0 -1
- package/dist/table-schema.js +0 -199
- package/dist/table-schema.js.map +0 -1
- package/dist/validators.d.ts +0 -4
- package/dist/validators.d.ts.map +0 -1
- package/dist/validators.js +0 -10
- package/dist/validators.js.map +0 -1
- package/dist/wrapper-protocol.d.ts +0 -12
- package/dist/wrapper-protocol.d.ts.map +0 -1
- package/dist/wrapper-protocol.js +0 -12
- package/dist/wrapper-protocol.js.map +0 -1
- package/src/bundled-modules.ts +0 -1
- package/src/data-dir.ts +0 -39
- package/src/plugin.ts +0 -30
- package/src/table-rules-ir.ts +0 -42
- package/src/table-schema.ts +0 -342
- package/src/validators.ts +0 -15
- package/src/wrapper-protocol.ts +0 -21
package/dist/plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAyB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAQ/G,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAgC,EAAU,EAAE;IAC/E,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,sBAAsB,EAAE,CAAC;IAClE,IAAI,IAAwB,CAAC;IAE7B,OAAO;QACH,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,MAAM,CAAC,MAAkB;YACrB,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC;YAC3B,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;QACjD,CAAC;QACD,SAAS,CAAC,EAAU;YAChB,IAAI,EAAE,KAAK,sBAAsB;gBAAE,OAAO,+BAA+B,CAAC;YAC1E,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAU;YACjB,IAAI,EAAE,KAAK,+BAA+B;gBAAE,OAAO,SAAS,CAAC;YAC7D,OAAO,sBAAsB,CAAC,MAAM,UAAU,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAC3E,CAAC;KACJ,CAAC;AACN,CAAC,CAAC"}
|
package/dist/runtime.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference path="../virtual.d.ts" preserve="true" />
|
|
2
|
-
/**
|
|
3
|
-
* Runtime window onto the project's resolved `gtkx.config.ts`: a verbatim
|
|
4
|
-
* re-export of the `virtual:gtkx-config` module served by `gtkx dev`/
|
|
5
|
-
* `gtkx build` and by the `@gtkx/vitest` plugin. Each resolved config field
|
|
6
|
-
* is a named constant — frozen at build time, identical on every import —
|
|
7
|
-
* alongside the codegen-derived metadata tables.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { applicationId } from "@gtkx/config/runtime";
|
|
12
|
-
* import { GtkApplication, GtkApplicationWindow } from "@gtkx/jsx/gtk";
|
|
13
|
-
*
|
|
14
|
-
* const App = () => (
|
|
15
|
-
* <GtkApplication applicationId={applicationId}>
|
|
16
|
-
* <GtkApplicationWindow title="Hello" defaultWidth={400} defaultHeight={300} />
|
|
17
|
-
* </GtkApplication>
|
|
18
|
-
* );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export * from "virtual:gtkx-config";
|
|
22
|
-
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,qBAAqB,CAAC"}
|
package/dist/runtime.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference path="../virtual.d.ts" preserve="true" />
|
|
2
|
-
/**
|
|
3
|
-
* Runtime window onto the project's resolved `gtkx.config.ts`: a verbatim
|
|
4
|
-
* re-export of the `virtual:gtkx-config` module served by `gtkx dev`/
|
|
5
|
-
* `gtkx build` and by the `@gtkx/vitest` plugin. Each resolved config field
|
|
6
|
-
* is a named constant — frozen at build time, identical on every import —
|
|
7
|
-
* alongside the codegen-derived metadata tables.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```tsx
|
|
11
|
-
* import { applicationId } from "@gtkx/config/runtime";
|
|
12
|
-
* import { GtkApplication, GtkApplicationWindow } from "@gtkx/jsx/gtk";
|
|
13
|
-
*
|
|
14
|
-
* const App = () => (
|
|
15
|
-
* <GtkApplication applicationId={applicationId}>
|
|
16
|
-
* <GtkApplicationWindow title="Hello" defaultWidth={400} defaultHeight={300} />
|
|
17
|
-
* </GtkApplication>
|
|
18
|
-
* );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export * from "virtual:gtkx-config";
|
|
22
|
-
//# sourceMappingURL=runtime.js.map
|
package/dist/runtime.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,cAAc,qBAAqB,CAAC"}
|
package/dist/table-rules-ir.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type PropCondition = "defined" | "nonNull" | "truthy";
|
|
2
|
-
export type SetterPropStep = {
|
|
3
|
-
prop: string;
|
|
4
|
-
call?: string;
|
|
5
|
-
set?: string;
|
|
6
|
-
when?: PropCondition;
|
|
7
|
-
skipWhenGetterEquals?: string;
|
|
8
|
-
requireGetterTruthyWithValue?: string;
|
|
9
|
-
skipWhenGetterDivergedFromCommitted?: string;
|
|
10
|
-
};
|
|
11
|
-
export type SetterPropGroup = {
|
|
12
|
-
kind: "setters";
|
|
13
|
-
props: SetterPropStep[];
|
|
14
|
-
always?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export type SignalPropRule = {
|
|
17
|
-
kind: "signal";
|
|
18
|
-
prop: string;
|
|
19
|
-
signal: string;
|
|
20
|
-
noArgs?: boolean;
|
|
21
|
-
returnValue?: unknown;
|
|
22
|
-
};
|
|
23
|
-
export type PropRule = SetterPropGroup | SignalPropRule;
|
|
24
|
-
export type AddMethodArg = "widget" | "id" | "title" | "iconName";
|
|
25
|
-
export type AddMethodRule = {
|
|
26
|
-
method: string;
|
|
27
|
-
args: AddMethodArg[];
|
|
28
|
-
requires: AddMethodArg[];
|
|
29
|
-
};
|
|
30
|
-
export type PageMetaSetter = {
|
|
31
|
-
setter: string;
|
|
32
|
-
prop: string;
|
|
33
|
-
fallback?: unknown;
|
|
34
|
-
whenPresent?: boolean;
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=table-rules-ir.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-rules-ir.d.ts","sourceRoot":"","sources":["../src/table-rules-ir.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,mCAAmC,CAAC,EAAE,MAAM,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,eAAe,GAAG,cAAc,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,IAAI,GAAG,OAAO,GAAG,UAAU,CAAC;AAElE,MAAM,MAAM,aAAa,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC"}
|
package/dist/table-rules-ir.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-rules-ir.js","sourceRoot":"","sources":["../src/table-rules-ir.ts"],"names":[],"mappings":""}
|
package/dist/table-schema.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export type VerbArgs = "child" | "childName" | "null" | "prefixChild" | "prefixNull";
|
|
2
|
-
export type DetachGuard = {
|
|
3
|
-
side: "child" | "parent";
|
|
4
|
-
getter: string;
|
|
5
|
-
};
|
|
6
|
-
export type MethodVerb = {
|
|
7
|
-
kind: "method";
|
|
8
|
-
attach: string;
|
|
9
|
-
attachArgs: VerbArgs;
|
|
10
|
-
detach: string;
|
|
11
|
-
detachArgs: VerbArgs;
|
|
12
|
-
detachGuard?: DetachGuard;
|
|
13
|
-
};
|
|
14
|
-
export type ContainerPropRow = {
|
|
15
|
-
attach: string;
|
|
16
|
-
attachArgs?: VerbArgs;
|
|
17
|
-
detach?: string;
|
|
18
|
-
detachArgs?: VerbArgs;
|
|
19
|
-
detachGuard?: DetachGuard;
|
|
20
|
-
};
|
|
21
|
-
export type OrderedInsertVerb = {
|
|
22
|
-
kind: "orderedInsert";
|
|
23
|
-
attach: string;
|
|
24
|
-
detach: string;
|
|
25
|
-
collection: string;
|
|
26
|
-
};
|
|
27
|
-
export type AttachVerb = MethodVerb | OrderedInsertVerb;
|
|
28
|
-
export type ElementMapRule = {
|
|
29
|
-
child: string;
|
|
30
|
-
parentType?: string;
|
|
31
|
-
parentMethod?: string;
|
|
32
|
-
verb: AttachVerb;
|
|
33
|
-
};
|
|
34
|
-
export type PresenceCondition = "defined" | "nonNull";
|
|
35
|
-
export type CallArg = {
|
|
36
|
-
kind: "item";
|
|
37
|
-
path?: string;
|
|
38
|
-
fallback?: unknown;
|
|
39
|
-
} | {
|
|
40
|
-
kind: "value";
|
|
41
|
-
value: unknown;
|
|
42
|
-
};
|
|
43
|
-
export type CallStep = {
|
|
44
|
-
method: string;
|
|
45
|
-
args: CallArg[];
|
|
46
|
-
when?: {
|
|
47
|
-
path: string;
|
|
48
|
-
is: PresenceCondition;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export type ConstructSetter = {
|
|
52
|
-
method: string;
|
|
53
|
-
path: string;
|
|
54
|
-
when: PresenceCondition;
|
|
55
|
-
};
|
|
56
|
-
export type ConstructStep = {
|
|
57
|
-
type: string;
|
|
58
|
-
setters: ConstructSetter[];
|
|
59
|
-
attach: string;
|
|
60
|
-
};
|
|
61
|
-
export type ArrayPropRow = {
|
|
62
|
-
itemType: string;
|
|
63
|
-
clear?: string;
|
|
64
|
-
remove?: CallStep;
|
|
65
|
-
add?: CallStep[];
|
|
66
|
-
construct?: ConstructStep;
|
|
67
|
-
set?: string;
|
|
68
|
-
appendOnce?: boolean;
|
|
69
|
-
};
|
|
70
|
-
export type ObjectPropRow = {
|
|
71
|
-
itemType: string;
|
|
72
|
-
set: CallStep[];
|
|
73
|
-
unset?: CallStep[];
|
|
74
|
-
};
|
|
75
|
-
export type VirtualPropRow = {
|
|
76
|
-
type: string;
|
|
77
|
-
setter: string;
|
|
78
|
-
after?: string;
|
|
79
|
-
};
|
|
80
|
-
export type PerElementPropRows<Row> = Record<string, Record<string, Row>>;
|
|
81
|
-
/**
|
|
82
|
-
* Names of the child-attachment method shapes a GObject type can satisfy. Each
|
|
83
|
-
* shape corresponds to a runtime method whose presence *and* signature (argument
|
|
84
|
-
* arity, parameter types, nullability) `@gtkx/codegen` verifies against the GIR
|
|
85
|
-
* model, so the reconciler can rely on the call shape instead of duck-typing the
|
|
86
|
-
* method name alone.
|
|
87
|
-
*/
|
|
88
|
-
export type AttachShape = "append" | "add" | "setContent" | "setChild" | "getChild" | "remove" | "reorderChildAfter" | "insertChildAfter" | "insert" | "getFirstChild";
|
|
89
|
-
/**
|
|
90
|
-
* Maps a GLib type name to the verified {@link AttachShape}s its own methods
|
|
91
|
-
* introduce. The reconciler resolves an instance's full shape set by unioning
|
|
92
|
-
* the entries across its type-name chain and implemented interfaces.
|
|
93
|
-
*/
|
|
94
|
-
export type AttachShapeTable = Record<string, AttachShape[]>;
|
|
95
|
-
export type UserTableRows = {
|
|
96
|
-
containerProps?: PerElementPropRows<ContainerPropRow> | undefined;
|
|
97
|
-
arrayProps?: PerElementPropRows<ArrayPropRow> | undefined;
|
|
98
|
-
objectProps?: PerElementPropRows<ObjectPropRow> | undefined;
|
|
99
|
-
virtualProps?: PerElementPropRows<VirtualPropRow> | undefined;
|
|
100
|
-
elementMap?: ElementMapRule[] | undefined;
|
|
101
|
-
};
|
|
102
|
-
export declare const validateContainerPropRows: (containerProps: unknown) => void;
|
|
103
|
-
export declare const validateElementMap: (elementMap: unknown) => void;
|
|
104
|
-
export declare const validateArrayPropRows: (arrayProps: unknown) => void;
|
|
105
|
-
export declare const validateObjectPropRows: (objectProps: unknown) => void;
|
|
106
|
-
export declare const validateVirtualPropRows: (virtualProps: unknown) => void;
|
|
107
|
-
//# sourceMappingURL=table-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-schema.d.ts","sourceRoot":"","sources":["../src/table-schema.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,WAAW,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,CAAC;AAErF,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,QAAQ,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAA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,IAE3D,CAAC;AAeF,eAAO,MAAM,sBAAsB,GAAI,aAAa,OAAO,KAAG,IAE7D,CAAC;AAaF,eAAO,MAAM,uBAAuB,GAAI,cAAc,OAAO,KAAG,IAE/D,CAAC"}
|
package/dist/table-schema.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { CAMEL_CASE_NAME_PATTERN, PASCAL_CASE_NAME_PATTERN, validateArrayOf } from "./validators.js";
|
|
2
|
-
const VERB_ARGS = ["child", "childName", "null", "prefixChild", "prefixNull"];
|
|
3
|
-
const PRESENCE_CONDITIONS = ["defined", "nonNull"];
|
|
4
|
-
const fail = (path, message) => {
|
|
5
|
-
throw new Error(`gtkx.config.ts: invalid \`${path}\` — ${message}`);
|
|
6
|
-
};
|
|
7
|
-
const requireRecord = (value, path) => {
|
|
8
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
9
|
-
fail(path, "must be an object");
|
|
10
|
-
}
|
|
11
|
-
return value;
|
|
12
|
-
};
|
|
13
|
-
const requireTypeName = (value, path) => {
|
|
14
|
-
if (typeof value !== "string" || !PASCAL_CASE_NAME_PATTERN.test(value)) {
|
|
15
|
-
fail(path, `must be a PascalCase GLib type name (e.g. "GtkWidget"), got "${String(value)}"`);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const requireMethodName = (value, path) => {
|
|
19
|
-
if (typeof value !== "string" || !CAMEL_CASE_NAME_PATTERN.test(value)) {
|
|
20
|
-
fail(path, `must be a camelCase method name (e.g. "addController"), got "${String(value)}"`);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const requireFieldName = (value, path) => {
|
|
24
|
-
if (typeof value !== "string" || !CAMEL_CASE_NAME_PATTERN.test(value)) {
|
|
25
|
-
fail(path, `must be a camelCase item field name (e.g. "iconName"), got "${String(value)}"`);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const requireReactMemberName = (value, path, example) => {
|
|
29
|
-
if (typeof value !== "string" || !PASCAL_CASE_NAME_PATTERN.test(value)) {
|
|
30
|
-
fail(path, `must be a PascalCase exported member of @gtkx/react (e.g. "${example}")`);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const validateVerbArgs = (value, path) => {
|
|
34
|
-
if (!VERB_ARGS.includes(value)) {
|
|
35
|
-
fail(path, `must be one of ${VERB_ARGS.join(", ")}`);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
const validateDetachGuard = (value, path) => {
|
|
39
|
-
const guard = requireRecord(value, path);
|
|
40
|
-
if (guard["side"] !== "child" && guard["side"] !== "parent") {
|
|
41
|
-
fail(`${path}.side`, 'must be "child" or "parent"');
|
|
42
|
-
}
|
|
43
|
-
requireMethodName(guard["getter"], `${path}.getter`);
|
|
44
|
-
};
|
|
45
|
-
const validateMethodVerb = (verb, path) => {
|
|
46
|
-
requireMethodName(verb["attach"], `${path}.attach`);
|
|
47
|
-
requireMethodName(verb["detach"], `${path}.detach`);
|
|
48
|
-
validateVerbArgs(verb["attachArgs"], `${path}.attachArgs`);
|
|
49
|
-
validateVerbArgs(verb["detachArgs"], `${path}.detachArgs`);
|
|
50
|
-
if (verb["detachGuard"] !== undefined)
|
|
51
|
-
validateDetachGuard(verb["detachGuard"], `${path}.detachGuard`);
|
|
52
|
-
};
|
|
53
|
-
const validateContainerPropRow = (value, path) => {
|
|
54
|
-
const row = requireRecord(value, path);
|
|
55
|
-
requireMethodName(row["attach"], `${path}.attach`);
|
|
56
|
-
if (row["attachArgs"] !== undefined)
|
|
57
|
-
validateVerbArgs(row["attachArgs"], `${path}.attachArgs`);
|
|
58
|
-
if (row["detach"] !== undefined)
|
|
59
|
-
requireMethodName(row["detach"], `${path}.detach`);
|
|
60
|
-
if (row["detachArgs"] !== undefined)
|
|
61
|
-
validateVerbArgs(row["detachArgs"], `${path}.detachArgs`);
|
|
62
|
-
if (row["detachGuard"] !== undefined)
|
|
63
|
-
validateDetachGuard(row["detachGuard"], `${path}.detachGuard`);
|
|
64
|
-
};
|
|
65
|
-
export const validateContainerPropRows = (containerProps) => {
|
|
66
|
-
validatePropRowMap(containerProps, "containerProps", validateContainerPropRow);
|
|
67
|
-
};
|
|
68
|
-
const validateOrderedInsertVerb = (verb, path) => {
|
|
69
|
-
requireMethodName(verb["attach"], `${path}.attach`);
|
|
70
|
-
requireMethodName(verb["detach"], `${path}.detach`);
|
|
71
|
-
requireMethodName(verb["collection"], `${path}.collection`);
|
|
72
|
-
};
|
|
73
|
-
const validateVerb = (value, path) => {
|
|
74
|
-
const verb = requireRecord(value, path);
|
|
75
|
-
if (verb["kind"] === "method")
|
|
76
|
-
validateMethodVerb(verb, path);
|
|
77
|
-
else if (verb["kind"] === "orderedInsert")
|
|
78
|
-
validateOrderedInsertVerb(verb, path);
|
|
79
|
-
else
|
|
80
|
-
fail(`${path}.kind`, 'must be "method" or "orderedInsert"');
|
|
81
|
-
};
|
|
82
|
-
const validateElementMapRule = (value, path) => {
|
|
83
|
-
const rule = requireRecord(value, path);
|
|
84
|
-
requireTypeName(rule["child"], `${path}.child`);
|
|
85
|
-
if (rule["parentType"] === undefined && rule["parentMethod"] === undefined) {
|
|
86
|
-
fail(path, "must declare `parentType` or `parentMethod`");
|
|
87
|
-
}
|
|
88
|
-
if (rule["parentType"] !== undefined)
|
|
89
|
-
requireTypeName(rule["parentType"], `${path}.parentType`);
|
|
90
|
-
if (rule["parentMethod"] !== undefined)
|
|
91
|
-
requireMethodName(rule["parentMethod"], `${path}.parentMethod`);
|
|
92
|
-
validateVerb(rule["verb"], `${path}.verb`);
|
|
93
|
-
};
|
|
94
|
-
export const validateElementMap = (elementMap) => {
|
|
95
|
-
if (elementMap === undefined)
|
|
96
|
-
return;
|
|
97
|
-
validateArrayOf(elementMap, "elementMap", validateElementMapRule, (path) => fail(path, "must be an array of attach rules"));
|
|
98
|
-
};
|
|
99
|
-
const validateWhen = (when, path) => {
|
|
100
|
-
if (when === undefined)
|
|
101
|
-
return;
|
|
102
|
-
const condition = requireRecord(when, path);
|
|
103
|
-
requireFieldName(condition["path"], `${path}.path`);
|
|
104
|
-
if (!PRESENCE_CONDITIONS.includes(condition["is"])) {
|
|
105
|
-
fail(`${path}.is`, `must be one of ${PRESENCE_CONDITIONS.join(", ")}`);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
const validateCallArg = (value, path) => {
|
|
109
|
-
const arg = requireRecord(value, path);
|
|
110
|
-
if (arg["kind"] === "item") {
|
|
111
|
-
if (arg["path"] !== undefined)
|
|
112
|
-
requireFieldName(arg["path"], `${path}.path`);
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (arg["kind"] !== "value")
|
|
116
|
-
fail(`${path}.kind`, 'must be "item" or "value"');
|
|
117
|
-
};
|
|
118
|
-
const validateCallStep = (value, path) => {
|
|
119
|
-
const step = requireRecord(value, path);
|
|
120
|
-
requireMethodName(step["method"], `${path}.method`);
|
|
121
|
-
validateArrayOf(step["args"], `${path}.args`, validateCallArg, (argsPath) => fail(argsPath, "must be an array"));
|
|
122
|
-
validateWhen(step["when"], `${path}.when`);
|
|
123
|
-
};
|
|
124
|
-
const validateConstructSetter = (setter, setterPath) => {
|
|
125
|
-
const record = requireRecord(setter, setterPath);
|
|
126
|
-
requireMethodName(record["method"], `${setterPath}.method`);
|
|
127
|
-
requireFieldName(record["path"], `${setterPath}.path`);
|
|
128
|
-
if (!PRESENCE_CONDITIONS.includes(record["when"])) {
|
|
129
|
-
fail(`${setterPath}.when`, `must be one of ${PRESENCE_CONDITIONS.join(", ")}`);
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
const validateConstructStep = (value, path) => {
|
|
133
|
-
const step = requireRecord(value, path);
|
|
134
|
-
requireTypeName(step["type"], `${path}.type`);
|
|
135
|
-
requireMethodName(step["attach"], `${path}.attach`);
|
|
136
|
-
validateArrayOf(step["setters"], `${path}.setters`, validateConstructSetter, (settersPath) => fail(settersPath, "must be an array"));
|
|
137
|
-
};
|
|
138
|
-
const validateArrayPropRow = (value, path) => {
|
|
139
|
-
const row = requireRecord(value, path);
|
|
140
|
-
requireReactMemberName(row["itemType"], `${path}.itemType`, "ScaleMark");
|
|
141
|
-
if (row["clear"] !== undefined)
|
|
142
|
-
requireMethodName(row["clear"], `${path}.clear`);
|
|
143
|
-
if (row["set"] !== undefined)
|
|
144
|
-
requireMethodName(row["set"], `${path}.set`);
|
|
145
|
-
if (row["appendOnce"] !== undefined && typeof row["appendOnce"] !== "boolean") {
|
|
146
|
-
fail(`${path}.appendOnce`, "must be a boolean");
|
|
147
|
-
}
|
|
148
|
-
if (row["remove"] !== undefined)
|
|
149
|
-
validateCallStep(row["remove"], `${path}.remove`);
|
|
150
|
-
if (row["add"] !== undefined) {
|
|
151
|
-
validateArrayOf(row["add"], `${path}.add`, validateCallStep, (addPath) => fail(addPath, "must be an array of call steps"));
|
|
152
|
-
}
|
|
153
|
-
if (row["construct"] !== undefined)
|
|
154
|
-
validateConstructStep(row["construct"], `${path}.construct`);
|
|
155
|
-
};
|
|
156
|
-
export const validateArrayPropRows = (arrayProps) => {
|
|
157
|
-
validatePropRowMap(arrayProps, "arrayProps", validateArrayPropRow);
|
|
158
|
-
};
|
|
159
|
-
const validateObjectPropRow = (value, path) => {
|
|
160
|
-
const row = requireRecord(value, path);
|
|
161
|
-
requireReactMemberName(row["itemType"], `${path}.itemType`, "DragSourceIcon");
|
|
162
|
-
validateArrayOf(row["set"], `${path}.set`, validateCallStep, (setPath) => fail(setPath, "must be an array of call steps"));
|
|
163
|
-
if (row["unset"] !== undefined) {
|
|
164
|
-
validateArrayOf(row["unset"], `${path}.unset`, validateCallStep, (unsetPath) => fail(unsetPath, "must be an array of call steps"));
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
export const validateObjectPropRows = (objectProps) => {
|
|
168
|
-
validatePropRowMap(objectProps, "objectProps", validateObjectPropRow);
|
|
169
|
-
};
|
|
170
|
-
const QUALIFIED_TYPE_PATTERN = /^[A-Z][A-Za-z0-9]*\.[A-Z][A-Za-z0-9]*$/;
|
|
171
|
-
const validateVirtualPropRow = (value, path) => {
|
|
172
|
-
const row = requireRecord(value, path);
|
|
173
|
-
if (typeof row["type"] !== "string" || !QUALIFIED_TYPE_PATTERN.test(row["type"])) {
|
|
174
|
-
fail(`${path}.type`, `must be a qualified GIR type (e.g. "Gtk.DrawingAreaDrawFunc")`);
|
|
175
|
-
}
|
|
176
|
-
requireMethodName(row["setter"], `${path}.setter`);
|
|
177
|
-
if (row["after"] !== undefined)
|
|
178
|
-
requireMethodName(row["after"], `${path}.after`);
|
|
179
|
-
};
|
|
180
|
-
export const validateVirtualPropRows = (virtualProps) => {
|
|
181
|
-
validatePropRowMap(virtualProps, "virtualProps", validateVirtualPropRow);
|
|
182
|
-
};
|
|
183
|
-
const validatePropRowMap = (value, tableName, validateRow) => {
|
|
184
|
-
if (value === undefined)
|
|
185
|
-
return;
|
|
186
|
-
const map = requireRecord(value, tableName);
|
|
187
|
-
for (const [jsxName, props] of Object.entries(map)) {
|
|
188
|
-
requireTypeName(jsxName, `${tableName} key "${jsxName}"`);
|
|
189
|
-
const propMap = requireRecord(props, `${tableName}.${jsxName}`);
|
|
190
|
-
if (Object.keys(propMap).length === 0) {
|
|
191
|
-
fail(`${tableName}.${jsxName}`, "must declare at least one prop");
|
|
192
|
-
}
|
|
193
|
-
for (const [propName, row] of Object.entries(propMap)) {
|
|
194
|
-
requireMethodName(propName, `${tableName}.${jsxName} prop "${propName}"`);
|
|
195
|
-
validateRow(row, `${tableName}.${jsxName}.${propName}`);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
//# sourceMappingURL=table-schema.js.map
|
package/dist/table-schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"table-schema.js","sourceRoot":"","sources":["../src/table-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AA2HrG,M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,GAAG,CAAC,EAAE,CAAC;QACjD,eAAe,CAAC,OAAO,EAAE,GAAG,SAAS,SAAS,OAAO,GAAG,CAAC,CAAC;QAC1D,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,EAAE,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC,CAAC;QAChE,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,EAAE,gCAAgC,CAAC,CAAC;QACtE,CAAC;QACD,KAAK,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACpD,iBAAiB,CAAC,QAAQ,EAAE,GAAG,SAAS,IAAI,OAAO,UAAU,QAAQ,GAAG,CAAC,CAAC;YAC1E,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,IAAI,OAAO,IAAI,QAAQ,EAAE,CAAC,CAAC;QAC5D,CAAC;IACL,CAAC;AACL,CAAC,CAAC"}
|
package/dist/validators.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const PASCAL_CASE_NAME_PATTERN: RegExp;
|
|
2
|
-
export declare const CAMEL_CASE_NAME_PATTERN: RegExp;
|
|
3
|
-
export declare const validateArrayOf: (value: unknown, path: string, validateElement: (element: unknown, elementPath: string) => void, onNotArray: (path: string) => never) => void;
|
|
4
|
-
//# sourceMappingURL=validators.d.ts.map
|
package/dist/validators.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAE,MAA8B,CAAC;AAEtE,eAAO,MAAM,uBAAuB,EAAE,MAA8B,CAAC;AAErE,eAAO,MAAM,eAAe,GACxB,OAAO,OAAO,EACd,MAAM,MAAM,EACZ,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,EAChE,YAAY,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,KACpC,IAKF,CAAC"}
|
package/dist/validators.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const PASCAL_CASE_NAME_PATTERN = /^[A-Z][A-Za-z0-9]*$/;
|
|
2
|
-
export const CAMEL_CASE_NAME_PATTERN = /^[a-z][A-Za-z0-9]*$/;
|
|
3
|
-
export const validateArrayOf = (value, path, validateElement, onNotArray) => {
|
|
4
|
-
if (!Array.isArray(value))
|
|
5
|
-
onNotArray(path);
|
|
6
|
-
value.forEach((element, index) => {
|
|
7
|
-
validateElement(element, `${path}[${index}]`);
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=validators.js.map
|
package/dist/validators.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAW,qBAAqB,CAAC;AAEtE,MAAM,CAAC,MAAM,uBAAuB,GAAW,qBAAqB,CAAC;AAErE,MAAM,CAAC,MAAM,eAAe,GAAG,CAC3B,KAAc,EACd,IAAY,EACZ,eAAgE,EAChE,UAAmC,EAC/B,EAAE;IACN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAC7B,eAAe,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const WRAPPER_NODE_ELEMENT = "__GTKX_WRAPPER_NODE__";
|
|
2
|
-
export declare const META_OBJECT_KIND = "meta-object";
|
|
3
|
-
export declare const LAYOUT_CHILD_KIND = "layout-child";
|
|
4
|
-
export declare const OVERLAY_KIND = "overlay";
|
|
5
|
-
export declare const TAB_LABEL_KIND = "tab-label";
|
|
6
|
-
export declare const SLOT_KIND = "slot";
|
|
7
|
-
export declare const CONTAINER_PROP_KIND = "container-slot";
|
|
8
|
-
export declare const TEXT_ANCHOR_KIND = "text-anchor";
|
|
9
|
-
export declare const TEXT_PAINTABLE_KIND = "text-paintable";
|
|
10
|
-
export declare const BUFFER_TEXT_KIND = "text";
|
|
11
|
-
export declare const LABEL_TEXT_KIND = "label-text";
|
|
12
|
-
//# sourceMappingURL=wrapper-protocol.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper-protocol.d.ts","sourceRoot":"","sources":["../src/wrapper-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAEhD,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,gBAAgB,CAAC;AAE9C,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAEpD,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC,eAAO,MAAM,eAAe,eAAe,CAAC"}
|
package/dist/wrapper-protocol.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const WRAPPER_NODE_ELEMENT = "__GTKX_WRAPPER_NODE__";
|
|
2
|
-
export const META_OBJECT_KIND = "meta-object";
|
|
3
|
-
export const LAYOUT_CHILD_KIND = "layout-child";
|
|
4
|
-
export const OVERLAY_KIND = "overlay";
|
|
5
|
-
export const TAB_LABEL_KIND = "tab-label";
|
|
6
|
-
export const SLOT_KIND = "slot";
|
|
7
|
-
export const CONTAINER_PROP_KIND = "container-slot";
|
|
8
|
-
export const TEXT_ANCHOR_KIND = "text-anchor";
|
|
9
|
-
export const TEXT_PAINTABLE_KIND = "text-paintable";
|
|
10
|
-
export const BUFFER_TEXT_KIND = "text";
|
|
11
|
-
export const LABEL_TEXT_KIND = "label-text";
|
|
12
|
-
//# sourceMappingURL=wrapper-protocol.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper-protocol.js","sourceRoot":"","sources":["../src/wrapper-protocol.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAE5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;AAEtC,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAC;AAE1C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC"}
|
package/src/bundled-modules.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const gtkxBundledModulePatterns: RegExp[] = [/@gtkx\/(config|ffi|gi|react|jsx|testing|css)/, /[/\\]\.gtkx[/\\]/];
|
package/src/data-dir.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
|
|
4
|
-
export const DATA_IMPORT_PREFIX = "#data";
|
|
5
|
-
|
|
6
|
-
export const DATA_IMPORT_KEY: string = `${DATA_IMPORT_PREFIX}/*`;
|
|
7
|
-
|
|
8
|
-
const CONDITION_PRIORITY = ["default", "import", "node"] as const;
|
|
9
|
-
|
|
10
|
-
const targetString = (entry: unknown): string | null => {
|
|
11
|
-
if (typeof entry === "string") return entry;
|
|
12
|
-
if (entry !== null && typeof entry === "object" && !Array.isArray(entry)) {
|
|
13
|
-
const conditions = entry as Record<string, unknown>;
|
|
14
|
-
for (const condition of CONDITION_PRIORITY) {
|
|
15
|
-
const value = conditions[condition];
|
|
16
|
-
if (typeof value === "string") return value;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return null;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const DATA_TARGET_PATTERN = /^\.?\/?(.+?)\/\*$/;
|
|
23
|
-
|
|
24
|
-
const directoryFromTarget = (target: string): string | null => {
|
|
25
|
-
const match = DATA_TARGET_PATTERN.exec(target);
|
|
26
|
-
return match?.[1] ?? null;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const resolveDataDir = (root: string): string | null => {
|
|
30
|
-
let manifest: { imports?: Record<string, unknown> };
|
|
31
|
-
try {
|
|
32
|
-
manifest = JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
33
|
-
} catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
const target = targetString(manifest.imports?.[DATA_IMPORT_KEY]);
|
|
37
|
-
if (target === null) return null;
|
|
38
|
-
return directoryFromTarget(target);
|
|
39
|
-
};
|
package/src/plugin.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Plugin, UserConfig } from "vite";
|
|
2
|
-
import { createGtkxConfigLoader, type GtkxConfigLoader } from "./loader.js";
|
|
3
|
-
import { GTKX_CONFIG_VIRTUAL_ID, RESOLVED_GTKX_CONFIG_VIRTUAL_ID, renderGtkxConfigModule } from "./virtual.js";
|
|
4
|
-
|
|
5
|
-
export interface GtkxConfigPluginOptions {
|
|
6
|
-
name: string;
|
|
7
|
-
loadConfig?: GtkxConfigLoader;
|
|
8
|
-
config?: (config: UserConfig) => Omit<UserConfig, "plugins"> | null | undefined;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const createGtkxConfigPlugin = (options: GtkxConfigPluginOptions): Plugin => {
|
|
12
|
-
const loadConfig = options.loadConfig ?? createGtkxConfigLoader();
|
|
13
|
-
let root: string | undefined;
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
name: options.name,
|
|
17
|
-
config(config: UserConfig) {
|
|
18
|
-
root = config.root ?? root;
|
|
19
|
-
return options.config?.(config) ?? undefined;
|
|
20
|
-
},
|
|
21
|
-
resolveId(id: string) {
|
|
22
|
-
if (id === GTKX_CONFIG_VIRTUAL_ID) return RESOLVED_GTKX_CONFIG_VIRTUAL_ID;
|
|
23
|
-
return undefined;
|
|
24
|
-
},
|
|
25
|
-
async load(id: string) {
|
|
26
|
-
if (id !== RESOLVED_GTKX_CONFIG_VIRTUAL_ID) return undefined;
|
|
27
|
-
return renderGtkxConfigModule(await loadConfig(root ?? process.cwd()));
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
};
|
package/src/table-rules-ir.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export type PropCondition = "defined" | "nonNull" | "truthy";
|
|
2
|
-
|
|
3
|
-
export type SetterPropStep = {
|
|
4
|
-
prop: string;
|
|
5
|
-
call?: string;
|
|
6
|
-
set?: string;
|
|
7
|
-
when?: PropCondition;
|
|
8
|
-
skipWhenGetterEquals?: string;
|
|
9
|
-
requireGetterTruthyWithValue?: string;
|
|
10
|
-
skipWhenGetterDivergedFromCommitted?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type SetterPropGroup = {
|
|
14
|
-
kind: "setters";
|
|
15
|
-
props: SetterPropStep[];
|
|
16
|
-
always?: boolean;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type SignalPropRule = {
|
|
20
|
-
kind: "signal";
|
|
21
|
-
prop: string;
|
|
22
|
-
signal: string;
|
|
23
|
-
noArgs?: boolean;
|
|
24
|
-
returnValue?: unknown;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export type PropRule = SetterPropGroup | SignalPropRule;
|
|
28
|
-
|
|
29
|
-
export type AddMethodArg = "widget" | "id" | "title" | "iconName";
|
|
30
|
-
|
|
31
|
-
export type AddMethodRule = {
|
|
32
|
-
method: string;
|
|
33
|
-
args: AddMethodArg[];
|
|
34
|
-
requires: AddMethodArg[];
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export type PageMetaSetter = {
|
|
38
|
-
setter: string;
|
|
39
|
-
prop: string;
|
|
40
|
-
fallback?: unknown;
|
|
41
|
-
whenPresent?: boolean;
|
|
42
|
-
};
|