@gtkx/config 1.0.0 → 1.2.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.
- package/README.md +1 -1
- package/dist/config-error.d.ts +2 -1
- package/dist/config-error.d.ts.map +1 -1
- package/dist/config-error.js +16 -4
- package/dist/config-error.js.map +1 -1
- package/dist/config.d.ts +242 -4
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -1
- package/dist/config.js.map +1 -1
- package/dist/deploy.d.ts +237 -0
- package/dist/deploy.d.ts.map +1 -0
- package/dist/deploy.js +232 -0
- package/dist/deploy.js.map +1 -0
- 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 +2 -2
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +10 -8
- package/dist/loader.js.map +1 -1
- package/dist/schema-text.d.ts +10 -0
- package/dist/schema-text.d.ts.map +1 -0
- package/dist/schema-text.js +19 -0
- package/dist/schema-text.js.map +1 -0
- package/dist/user-event-signals.d.ts +1 -2
- package/dist/user-event-signals.d.ts.map +1 -1
- package/dist/user-event-signals.js +1 -1
- package/dist/user-event-signals.js.map +1 -1
- package/dist/vite-plugin.d.ts +2 -2
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js +1 -1
- package/dist/vite-plugin.js.map +1 -1
- package/package.json +12 -2
- package/src/config-error.ts +23 -4
- package/src/config.ts +11 -3
- package/src/deploy.ts +260 -0
- package/src/internal.ts +1 -0
- package/src/loader.ts +12 -8
- package/src/schema-text.ts +38 -0
- package/src/user-event-signals.ts +1 -1
- package/src/vite-plugin.ts +3 -3
package/dist/deploy.d.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
declare const deploySchema: z.ZodObject<{
|
|
3
|
+
targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
4
|
+
appimage: "appimage";
|
|
5
|
+
deb: "deb";
|
|
6
|
+
flatpak: "flatpak";
|
|
7
|
+
rpm: "rpm";
|
|
8
|
+
}>>>;
|
|
9
|
+
outDir: z.ZodOptional<z.ZodString>;
|
|
10
|
+
name: z.ZodOptional<z.ZodString>;
|
|
11
|
+
genericName: z.ZodOptional<z.ZodString>;
|
|
12
|
+
binaryName: z.ZodOptional<z.ZodString>;
|
|
13
|
+
version: z.ZodOptional<z.ZodString>;
|
|
14
|
+
release: z.ZodOptional<z.ZodString>;
|
|
15
|
+
epoch: z.ZodOptional<z.ZodInt>;
|
|
16
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
17
|
+
description: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
mimeTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
+
developer: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
id: z.ZodOptional<z.ZodString>;
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
email: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, z.core.$strict>>;
|
|
26
|
+
license: z.ZodOptional<z.ZodString>;
|
|
27
|
+
licenseFile: z.ZodOptional<z.ZodString>;
|
|
28
|
+
metadataLicense: z.ZodOptional<z.ZodString>;
|
|
29
|
+
copyright: z.ZodOptional<z.ZodString>;
|
|
30
|
+
homepage: z.ZodOptional<z.ZodURL>;
|
|
31
|
+
urls: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
32
|
+
bugtracker: "bugtracker";
|
|
33
|
+
contact: "contact";
|
|
34
|
+
contribute: "contribute";
|
|
35
|
+
donation: "donation";
|
|
36
|
+
faq: "faq";
|
|
37
|
+
help: "help";
|
|
38
|
+
translate: "translate";
|
|
39
|
+
"vcs-browser": "vcs-browser";
|
|
40
|
+
}> & z.core.$partial, z.ZodURL>>;
|
|
41
|
+
icons: z.ZodOptional<z.ZodString>;
|
|
42
|
+
screenshots: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
43
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
44
|
+
file: z.ZodOptional<z.ZodString>;
|
|
45
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
46
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
}, z.core.$strict>>>;
|
|
48
|
+
screenshotBaseUrl: z.ZodOptional<z.ZodURL>;
|
|
49
|
+
branding: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
light: z.ZodString;
|
|
51
|
+
dark: z.ZodString;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
contentRating: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
54
|
+
none: "none";
|
|
55
|
+
intense: "intense";
|
|
56
|
+
mild: "mild";
|
|
57
|
+
moderate: "moderate";
|
|
58
|
+
}>>>;
|
|
59
|
+
releases: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
60
|
+
version: z.ZodString;
|
|
61
|
+
date: z.ZodISODate;
|
|
62
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
development: "development";
|
|
64
|
+
snapshot: "snapshot";
|
|
65
|
+
stable: "stable";
|
|
66
|
+
}>>;
|
|
67
|
+
urgency: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
critical: "critical";
|
|
69
|
+
high: "high";
|
|
70
|
+
low: "low";
|
|
71
|
+
medium: "medium";
|
|
72
|
+
}>>;
|
|
73
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
75
|
+
}, z.core.$strict>>>;
|
|
76
|
+
execArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
77
|
+
fileAssociations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
+
extension: z.ZodString;
|
|
79
|
+
mimeType: z.ZodString;
|
|
80
|
+
description: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strict>>>;
|
|
82
|
+
protocols: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
83
|
+
desktopActions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
86
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, z.core.$strict>>>;
|
|
88
|
+
desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
89
|
+
isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
|
|
90
|
+
extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
depends: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
93
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
relations: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
recommends: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
98
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
99
|
+
}, z.core.$strict>>;
|
|
100
|
+
suggests: z.ZodOptional<z.ZodObject<{
|
|
101
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
provides: z.ZodOptional<z.ZodObject<{
|
|
105
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
106
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
107
|
+
}, z.core.$strict>>;
|
|
108
|
+
conflicts: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
replaces: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
breaks: z.ZodOptional<z.ZodObject<{
|
|
117
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
preDepends: z.ZodOptional<z.ZodObject<{
|
|
121
|
+
deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
122
|
+
rpm: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
123
|
+
}, z.core.$strict>>;
|
|
124
|
+
}, z.core.$strict>>;
|
|
125
|
+
scripts: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
preInstall: z.ZodOptional<z.ZodString>;
|
|
127
|
+
postInstall: z.ZodOptional<z.ZodString>;
|
|
128
|
+
preRemove: z.ZodOptional<z.ZodString>;
|
|
129
|
+
postRemove: z.ZodOptional<z.ZodString>;
|
|
130
|
+
}, z.core.$strict>>;
|
|
131
|
+
node: z.ZodOptional<z.ZodObject<{
|
|
132
|
+
source: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
path: "path";
|
|
134
|
+
download: "download";
|
|
135
|
+
host: "host";
|
|
136
|
+
}>>;
|
|
137
|
+
version: z.ZodOptional<z.ZodString>;
|
|
138
|
+
path: z.ZodOptional<z.ZodString>;
|
|
139
|
+
shouldStrip: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
|
|
141
|
+
}, z.core.$strict>>;
|
|
142
|
+
signing: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
appimage: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
gpgKeyId: z.ZodString;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
deb: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
keyFile: z.ZodString;
|
|
148
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
149
|
+
method: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
debsign: "debsign";
|
|
151
|
+
"dpkg-sig": "dpkg-sig";
|
|
152
|
+
}>>;
|
|
153
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
154
|
+
origin: "origin";
|
|
155
|
+
archive: "archive";
|
|
156
|
+
maint: "maint";
|
|
157
|
+
}>>;
|
|
158
|
+
signer: z.ZodOptional<z.ZodString>;
|
|
159
|
+
}, z.core.$strict>>;
|
|
160
|
+
flatpak: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
gpgKeyId: z.ZodString;
|
|
162
|
+
gpgHomeDir: z.ZodOptional<z.ZodString>;
|
|
163
|
+
}, z.core.$strict>>;
|
|
164
|
+
rpm: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
keyFile: z.ZodString;
|
|
166
|
+
keyId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
}, z.core.$strict>>;
|
|
169
|
+
appimage: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
fileName: z.ZodOptional<z.ZodString>;
|
|
171
|
+
compression: z.ZodOptional<z.ZodEnum<{
|
|
172
|
+
gzip: "gzip";
|
|
173
|
+
xz: "xz";
|
|
174
|
+
zstd: "zstd";
|
|
175
|
+
}>>;
|
|
176
|
+
updateInformation: z.ZodOptional<z.ZodString>;
|
|
177
|
+
runtimeFile: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
deb: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
packageName: z.ZodOptional<z.ZodString>;
|
|
181
|
+
section: z.ZodOptional<z.ZodString>;
|
|
182
|
+
priority: z.ZodOptional<z.ZodString>;
|
|
183
|
+
compression: z.ZodOptional<z.ZodEnum<{
|
|
184
|
+
gzip: "gzip";
|
|
185
|
+
xz: "xz";
|
|
186
|
+
zstd: "zstd";
|
|
187
|
+
none: "none";
|
|
188
|
+
}>>;
|
|
189
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
190
|
+
}, z.core.$strict>>;
|
|
191
|
+
flatpak: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
prebuilt: "prebuilt";
|
|
194
|
+
source: "source";
|
|
195
|
+
}>>;
|
|
196
|
+
runtime: z.ZodOptional<z.ZodString>;
|
|
197
|
+
runtimeVersion: z.ZodOptional<z.ZodString>;
|
|
198
|
+
sdk: z.ZodOptional<z.ZodString>;
|
|
199
|
+
nodeExtension: z.ZodOptional<z.ZodString>;
|
|
200
|
+
sdkExtensions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
201
|
+
base: z.ZodOptional<z.ZodString>;
|
|
202
|
+
baseVersion: z.ZodOptional<z.ZodString>;
|
|
203
|
+
branch: z.ZodOptional<z.ZodString>;
|
|
204
|
+
finishArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
205
|
+
cleanup: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
206
|
+
buildCommands: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
207
|
+
modules: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
208
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
209
|
+
url: z.ZodOptional<z.ZodURL>;
|
|
210
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
211
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
212
|
+
}, z.core.$strict>>;
|
|
213
|
+
packageManager: z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
npm: "npm";
|
|
215
|
+
pnpm: "pnpm";
|
|
216
|
+
yarn: "yarn";
|
|
217
|
+
}>>;
|
|
218
|
+
lockfile: z.ZodOptional<z.ZodString>;
|
|
219
|
+
runtimeRepo: z.ZodOptional<z.ZodURL>;
|
|
220
|
+
shouldEmitBundle: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
shouldInstall: z.ZodOptional<z.ZodBoolean>;
|
|
222
|
+
shouldUseRofilesFuse: z.ZodOptional<z.ZodBoolean>;
|
|
223
|
+
}, z.core.$strict>>;
|
|
224
|
+
rpm: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
packageName: z.ZodOptional<z.ZodString>;
|
|
226
|
+
group: z.ZodOptional<z.ZodString>;
|
|
227
|
+
compression: z.ZodOptional<z.ZodEnum<{
|
|
228
|
+
gzip: "gzip";
|
|
229
|
+
xz: "xz";
|
|
230
|
+
zstd: "zstd";
|
|
231
|
+
lzma: "lzma";
|
|
232
|
+
}>>;
|
|
233
|
+
prefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
}, z.core.$strict>>;
|
|
235
|
+
}, z.core.$strict>;
|
|
236
|
+
export { deploySchema };
|
|
237
|
+
//# sourceMappingURL=deploy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiMxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgEhB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/deploy.js
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { fileExtension, flag, relativePathRecord, text, textList, textRecord, url } from "./schema-text.js";
|
|
3
|
+
const APPIMAGE_COMPRESSIONS = ["gzip", "xz", "zstd"];
|
|
4
|
+
const DEB_COMPRESSIONS = ["gzip", "none", "xz", "zstd"];
|
|
5
|
+
const DEB_SIGN_METHODS = ["debsign", "dpkg-sig"];
|
|
6
|
+
const DEB_SIGN_TYPES = ["archive", "maint", "origin"];
|
|
7
|
+
const DEPLOY_TARGET_NAMES = ["appimage", "deb", "flatpak", "rpm"];
|
|
8
|
+
const FLATPAK_MODES = ["prebuilt", "source"];
|
|
9
|
+
const NODE_SOURCES = ["download", "host", "path"];
|
|
10
|
+
const OARS_INTENSITIES = ["intense", "mild", "moderate", "none"];
|
|
11
|
+
const PACKAGE_MANAGERS = ["npm", "pnpm", "yarn"];
|
|
12
|
+
const RELEASE_TYPES = ["development", "snapshot", "stable"];
|
|
13
|
+
const RELEASE_URGENCIES = ["critical", "high", "low", "medium"];
|
|
14
|
+
const RPM_COMPRESSIONS = ["gzip", "lzma", "xz", "zstd"];
|
|
15
|
+
const URL_KINDS = [
|
|
16
|
+
"bugtracker",
|
|
17
|
+
"contact",
|
|
18
|
+
"contribute",
|
|
19
|
+
"donation",
|
|
20
|
+
"faq",
|
|
21
|
+
"help",
|
|
22
|
+
"translate",
|
|
23
|
+
"vcs-browser",
|
|
24
|
+
];
|
|
25
|
+
const BOOLEAN_ERROR = "must be a boolean";
|
|
26
|
+
const EPOCH_ERROR = "must be a non-negative integer";
|
|
27
|
+
const HEX_COLOR_ERROR = "must be a #rrggbb color";
|
|
28
|
+
const HEX_COLOR_PATTERN = /^#[\dA-Fa-f]{6}$/;
|
|
29
|
+
const KEY_FILE_ERROR = "must be a path to a PGP key file";
|
|
30
|
+
const KEY_ID_ERROR = "must be a PGP key id";
|
|
31
|
+
const SCRIPT_ERROR = "must be a path to a shell script";
|
|
32
|
+
const SPDX_ERROR = "must be an SPDX license expression";
|
|
33
|
+
const URL_ERROR = "must be an absolute URL";
|
|
34
|
+
const VERSION_ERROR = "must be a version string";
|
|
35
|
+
const hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });
|
|
36
|
+
const relationsSchema = z.strictObject({
|
|
37
|
+
deb: textList("Debian package relation", "must be an array of Debian package relations").optional(),
|
|
38
|
+
rpm: textList("RPM package relation", "must be an array of RPM package relations").optional(),
|
|
39
|
+
});
|
|
40
|
+
const developerSchema = z.strictObject({
|
|
41
|
+
id: text("must be a reverse-DNS developer id").optional(),
|
|
42
|
+
name: text("must be a developer or organization name").optional(),
|
|
43
|
+
email: text("must be an email address").optional(),
|
|
44
|
+
});
|
|
45
|
+
const screenshotSchema = z
|
|
46
|
+
.strictObject({
|
|
47
|
+
url: url("must be an absolute URL to a PNG or JPEG").optional(),
|
|
48
|
+
file: text("must be an image path relative to the project root").optional(),
|
|
49
|
+
caption: text("must be a screenshot caption").optional(),
|
|
50
|
+
isDefault: flag(BOOLEAN_ERROR).optional(),
|
|
51
|
+
})
|
|
52
|
+
.refine((entry) => entry.url !== undefined || entry.file !== undefined, {
|
|
53
|
+
error: "must have either a `url` or a `file`",
|
|
54
|
+
});
|
|
55
|
+
const releaseSchema = z.strictObject({
|
|
56
|
+
version: text(VERSION_ERROR),
|
|
57
|
+
date: z.iso.date({ error: "must be an ISO date (YYYY-MM-DD)" }),
|
|
58
|
+
type: z.enum(RELEASE_TYPES, { error: "must be one of development, snapshot, stable" }).optional(),
|
|
59
|
+
urgency: z.enum(RELEASE_URGENCIES, { error: "must be one of critical, high, low, medium" }).optional(),
|
|
60
|
+
notes: textList("release note paragraph", "must be an array of release note paragraphs").optional(),
|
|
61
|
+
url: url(URL_ERROR).optional(),
|
|
62
|
+
});
|
|
63
|
+
const fileAssociationSchema = z.strictObject({
|
|
64
|
+
extension: fileExtension("must be a file extension without a leading dot"),
|
|
65
|
+
mimeType: text("must be a MIME type such as text/plain"),
|
|
66
|
+
description: text("must be a description of the file type").optional(),
|
|
67
|
+
});
|
|
68
|
+
const desktopActionSchema = z.strictObject({
|
|
69
|
+
name: text("must be an action name"),
|
|
70
|
+
args: textList("argument", "must be an array of arguments appended to Exec").optional(),
|
|
71
|
+
icon: text("must be an icon name").optional(),
|
|
72
|
+
});
|
|
73
|
+
const brandingSchema = z.strictObject({
|
|
74
|
+
light: hexColorSchema,
|
|
75
|
+
dark: hexColorSchema,
|
|
76
|
+
});
|
|
77
|
+
const nodeRuntimeSchema = z.strictObject({
|
|
78
|
+
source: z.enum(NODE_SOURCES, { error: "must be one of download, host, path" }).optional(),
|
|
79
|
+
version: text("must be a Node.js version such as 24.19.0").optional(),
|
|
80
|
+
path: text("must be a path to a node binary").optional(),
|
|
81
|
+
shouldStrip: flag(BOOLEAN_ERROR).optional(),
|
|
82
|
+
shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),
|
|
83
|
+
});
|
|
84
|
+
const scriptsSchema = z.strictObject({
|
|
85
|
+
preInstall: text(SCRIPT_ERROR).optional(),
|
|
86
|
+
postInstall: text(SCRIPT_ERROR).optional(),
|
|
87
|
+
preRemove: text(SCRIPT_ERROR).optional(),
|
|
88
|
+
postRemove: text(SCRIPT_ERROR).optional(),
|
|
89
|
+
});
|
|
90
|
+
const debSchema = z.strictObject({
|
|
91
|
+
packageName: text("must be a Debian package name").optional(),
|
|
92
|
+
section: text("must be a Debian archive section").optional(),
|
|
93
|
+
priority: text("must be a Debian priority").optional(),
|
|
94
|
+
compression: z.enum(DEB_COMPRESSIONS, { error: "must be one of gzip, none, xz, zstd" }).optional(),
|
|
95
|
+
fields: textRecord("must be a control field value", "must be a record of control field names to values")
|
|
96
|
+
.optional(),
|
|
97
|
+
});
|
|
98
|
+
const rpmSchema = z.strictObject({
|
|
99
|
+
packageName: text("must be an RPM package name").optional(),
|
|
100
|
+
group: text("must be an RPM group").optional(),
|
|
101
|
+
compression: z.enum(RPM_COMPRESSIONS, { error: "must be one of gzip, lzma, xz, zstd" }).optional(),
|
|
102
|
+
prefixes: textList("prefix", "must be an array of relocation prefixes").optional(),
|
|
103
|
+
});
|
|
104
|
+
const appimageSchema = z.strictObject({
|
|
105
|
+
fileName: text("must be an output file name").optional(),
|
|
106
|
+
compression: z.enum(APPIMAGE_COMPRESSIONS, { error: "must be one of gzip, xz, zstd" }).optional(),
|
|
107
|
+
updateInformation: text("must be an AppImage update information string").optional(),
|
|
108
|
+
runtimeFile: text("must be a path to an AppImage runtime file").optional(),
|
|
109
|
+
});
|
|
110
|
+
const flatpakSourceSchema = z.strictObject({
|
|
111
|
+
url: url("must be an absolute git URL").optional(),
|
|
112
|
+
tag: text("must be a git tag").optional(),
|
|
113
|
+
commit: text("must be a git commit sha").optional(),
|
|
114
|
+
});
|
|
115
|
+
const flatpakSchema = z.strictObject({
|
|
116
|
+
mode: z.enum(FLATPAK_MODES, { error: 'must be "prebuilt" or "source"' }).optional(),
|
|
117
|
+
runtime: text("must be a runtime id").optional(),
|
|
118
|
+
runtimeVersion: text('must be a runtime branch such as "50"').optional(),
|
|
119
|
+
sdk: text("must be an SDK id").optional(),
|
|
120
|
+
nodeExtension: text("must be a Node SDK extension id").optional(),
|
|
121
|
+
sdkExtensions: textList("SDK extension id", "must be an array of SDK extension ids").optional(),
|
|
122
|
+
base: text("must be a base app id").optional(),
|
|
123
|
+
baseVersion: text("must be a base app version").optional(),
|
|
124
|
+
branch: text("must be a branch name").optional(),
|
|
125
|
+
finishArgs: textList("finish argument", "must be an array of flatpak finish arguments").optional(),
|
|
126
|
+
cleanup: textList("cleanup pattern", "must be an array of cleanup patterns").optional(),
|
|
127
|
+
buildCommands: textList("shell command", "must be an array of shell commands").optional(),
|
|
128
|
+
modules: z.array(z.unknown(), { error: "must be an array of flatpak module objects" }).optional(),
|
|
129
|
+
source: flatpakSourceSchema.optional(),
|
|
130
|
+
packageManager: z.enum(PACKAGE_MANAGERS, { error: "must be one of npm, pnpm, yarn" }).optional(),
|
|
131
|
+
lockfile: text("must be a path to a lockfile").optional(),
|
|
132
|
+
runtimeRepo: url("must be an absolute .flatpakrepo URL").optional(),
|
|
133
|
+
shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),
|
|
134
|
+
shouldInstall: flag(BOOLEAN_ERROR).optional(),
|
|
135
|
+
shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),
|
|
136
|
+
});
|
|
137
|
+
const debSigningSchema = z.strictObject({
|
|
138
|
+
keyFile: text(KEY_FILE_ERROR),
|
|
139
|
+
keyId: text(KEY_ID_ERROR).optional(),
|
|
140
|
+
method: z.enum(DEB_SIGN_METHODS, { error: 'must be "debsign" or "dpkg-sig"' }).optional(),
|
|
141
|
+
type: z.enum(DEB_SIGN_TYPES, { error: "must be one of archive, maint, origin" }).optional(),
|
|
142
|
+
signer: text("must be a signer name and email").optional(),
|
|
143
|
+
});
|
|
144
|
+
const rpmSigningSchema = z.strictObject({
|
|
145
|
+
keyFile: text(KEY_FILE_ERROR),
|
|
146
|
+
keyId: text(KEY_ID_ERROR).optional(),
|
|
147
|
+
});
|
|
148
|
+
const flatpakSigningSchema = z.strictObject({
|
|
149
|
+
gpgKeyId: text("must be a GPG key id"),
|
|
150
|
+
gpgHomeDir: text("must be a path to a GPG home directory").optional(),
|
|
151
|
+
});
|
|
152
|
+
const appimageSigningSchema = z.strictObject({
|
|
153
|
+
gpgKeyId: text("must be a GPG key id"),
|
|
154
|
+
});
|
|
155
|
+
const signingSchema = z.strictObject({
|
|
156
|
+
appimage: appimageSigningSchema.optional(),
|
|
157
|
+
deb: debSigningSchema.optional(),
|
|
158
|
+
flatpak: flatpakSigningSchema.optional(),
|
|
159
|
+
rpm: rpmSigningSchema.optional(),
|
|
160
|
+
});
|
|
161
|
+
const extraRelationsSchema = z.strictObject({
|
|
162
|
+
recommends: relationsSchema.optional(),
|
|
163
|
+
suggests: relationsSchema.optional(),
|
|
164
|
+
provides: relationsSchema.optional(),
|
|
165
|
+
conflicts: relationsSchema.optional(),
|
|
166
|
+
replaces: relationsSchema.optional(),
|
|
167
|
+
breaks: relationsSchema.optional(),
|
|
168
|
+
preDepends: relationsSchema.optional(),
|
|
169
|
+
});
|
|
170
|
+
const deploySchema = z.strictObject({
|
|
171
|
+
targets: z
|
|
172
|
+
.array(z.enum(DEPLOY_TARGET_NAMES, { error: "must be one of appimage, deb, flatpak, rpm" }), {
|
|
173
|
+
error: "must be an array of deploy targets",
|
|
174
|
+
})
|
|
175
|
+
.optional(),
|
|
176
|
+
outDir: text("must be a directory path relative to the project root").optional(),
|
|
177
|
+
name: text("must be the display name shown in the launcher").optional(),
|
|
178
|
+
genericName: text("must be a generic application name").optional(),
|
|
179
|
+
binaryName: text("must be a kebab-case command name").optional(),
|
|
180
|
+
version: text(VERSION_ERROR).optional(),
|
|
181
|
+
release: text("must be a packaging revision").optional(),
|
|
182
|
+
epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),
|
|
183
|
+
summary: text("must be a single-line summary without a trailing period").optional(),
|
|
184
|
+
description: textList("description paragraph", "must be an array of description paragraphs").optional(),
|
|
185
|
+
keywords: textList("search keyword", "must be an array of search keywords").optional(),
|
|
186
|
+
categories: textList("freedesktop category", "must be an array of freedesktop categories").optional(),
|
|
187
|
+
mimeTypes: textList("MIME type", "must be an array of MIME types").optional(),
|
|
188
|
+
developer: developerSchema.optional(),
|
|
189
|
+
license: text(SPDX_ERROR).optional(),
|
|
190
|
+
licenseFile: text("must be a path to a license file").optional(),
|
|
191
|
+
metadataLicense: text(SPDX_ERROR).optional(),
|
|
192
|
+
copyright: text("must be a copyright line").optional(),
|
|
193
|
+
homepage: url(URL_ERROR).optional(),
|
|
194
|
+
urls: z
|
|
195
|
+
.partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {
|
|
196
|
+
error: "must be a record of AppStream url kinds to URLs",
|
|
197
|
+
})
|
|
198
|
+
.optional(),
|
|
199
|
+
icons: text("must be a path to an icon theme directory or a single icon file").optional(),
|
|
200
|
+
screenshots: z.array(screenshotSchema, { error: "must be an array of screenshots" }).optional(),
|
|
201
|
+
screenshotBaseUrl: url("must be an absolute base URL").optional(),
|
|
202
|
+
branding: brandingSchema.optional(),
|
|
203
|
+
contentRating: z
|
|
204
|
+
.record(z.string(), z.enum(OARS_INTENSITIES, { error: "must be one of intense, mild, moderate, none" }), {
|
|
205
|
+
error: "must be a record of OARS 1.1 attribute ids to intensities",
|
|
206
|
+
})
|
|
207
|
+
.optional(),
|
|
208
|
+
releases: z.array(releaseSchema, { error: "must be an array of releases" }).optional(),
|
|
209
|
+
execArgs: textList("argument", "must be an array of arguments appended to Exec").optional(),
|
|
210
|
+
fileAssociations: z
|
|
211
|
+
.array(fileAssociationSchema, { error: "must be an array of file associations" })
|
|
212
|
+
.optional(),
|
|
213
|
+
protocols: textList("URL scheme", "must be an array of URL schemes").optional(),
|
|
214
|
+
desktopActions: z
|
|
215
|
+
.record(z.string(), desktopActionSchema, { error: "must be a record of action ids to actions" })
|
|
216
|
+
.optional(),
|
|
217
|
+
desktopEntry: textRecord("must be a desktop entry value", "must be a record of desktop entry keys to values")
|
|
218
|
+
.optional(),
|
|
219
|
+
isDbusActivatable: flag(BOOLEAN_ERROR).optional(),
|
|
220
|
+
extraFiles: relativePathRecord("must be a destination path inside the install prefix, without a leading slash or a .. segment", "must be a source path", "must be a record of prefix-relative destinations to source paths").optional(),
|
|
221
|
+
depends: relationsSchema.optional(),
|
|
222
|
+
relations: extraRelationsSchema.optional(),
|
|
223
|
+
scripts: scriptsSchema.optional(),
|
|
224
|
+
node: nodeRuntimeSchema.optional(),
|
|
225
|
+
signing: signingSchema.optional(),
|
|
226
|
+
appimage: appimageSchema.optional(),
|
|
227
|
+
deb: debSchema.optional(),
|
|
228
|
+
flatpak: flatpakSchema.optional(),
|
|
229
|
+
rpm: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AC1B,+FAA+F,EAC/F,uBAAuB,EACvB,kEAAkE,CACrE,CAAC,QAAQ,EAAE;IACZ,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;IACzB,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { fileExtension, flag, relativePathRecord, text, textList, textRecord, url } from \"./schema-text.ts\";\n\nconst APPIMAGE_COMPRESSIONS = [\"gzip\", \"xz\", \"zstd\"] as const;\nconst DEB_COMPRESSIONS = [\"gzip\", \"none\", \"xz\", \"zstd\"] as const;\nconst DEB_SIGN_METHODS = [\"debsign\", \"dpkg-sig\"] as const;\nconst DEB_SIGN_TYPES = [\"archive\", \"maint\", \"origin\"] as const;\nconst DEPLOY_TARGET_NAMES = [\"appimage\", \"deb\", \"flatpak\", \"rpm\"] as const;\nconst FLATPAK_MODES = [\"prebuilt\", \"source\"] as const;\nconst NODE_SOURCES = [\"download\", \"host\", \"path\"] as const;\nconst OARS_INTENSITIES = [\"intense\", \"mild\", \"moderate\", \"none\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\"] as const;\nconst RELEASE_TYPES = [\"development\", \"snapshot\", \"stable\"] as const;\nconst RELEASE_URGENCIES = [\"critical\", \"high\", \"low\", \"medium\"] as const;\nconst RPM_COMPRESSIONS = [\"gzip\", \"lzma\", \"xz\", \"zstd\"] as const;\n\nconst URL_KINDS = [\n \"bugtracker\",\n \"contact\",\n \"contribute\",\n \"donation\",\n \"faq\",\n \"help\",\n \"translate\",\n \"vcs-browser\",\n] as const;\n\nconst BOOLEAN_ERROR = \"must be a boolean\";\nconst EPOCH_ERROR = \"must be a non-negative integer\";\nconst HEX_COLOR_ERROR = \"must be a #rrggbb color\";\nconst HEX_COLOR_PATTERN = /^#[\\dA-Fa-f]{6}$/;\nconst KEY_FILE_ERROR = \"must be a path to a PGP key file\";\nconst KEY_ID_ERROR = \"must be a PGP key id\";\nconst SCRIPT_ERROR = \"must be a path to a shell script\";\nconst SPDX_ERROR = \"must be an SPDX license expression\";\nconst URL_ERROR = \"must be an absolute URL\";\nconst VERSION_ERROR = \"must be a version string\";\nconst hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });\n\nconst relationsSchema = z.strictObject({\n deb: textList(\"Debian package relation\", \"must be an array of Debian package relations\").optional(),\n rpm: textList(\"RPM package relation\", \"must be an array of RPM package relations\").optional(),\n});\n\nconst developerSchema = z.strictObject({\n id: text(\"must be a reverse-DNS developer id\").optional(),\n name: text(\"must be a developer or organization name\").optional(),\n email: text(\"must be an email address\").optional(),\n});\n\nconst screenshotSchema = z\n .strictObject({\n url: url(\"must be an absolute URL to a PNG or JPEG\").optional(),\n file: text(\"must be an image path relative to the project root\").optional(),\n caption: text(\"must be a screenshot caption\").optional(),\n isDefault: flag(BOOLEAN_ERROR).optional(),\n })\n .refine((entry) => entry.url !== undefined || entry.file !== undefined, {\n error: \"must have either a `url` or a `file`\",\n });\n\nconst releaseSchema = z.strictObject({\n version: text(VERSION_ERROR),\n date: z.iso.date({ error: \"must be an ISO date (YYYY-MM-DD)\" }),\n type: z.enum(RELEASE_TYPES, { error: \"must be one of development, snapshot, stable\" }).optional(),\n urgency: z.enum(RELEASE_URGENCIES, { error: \"must be one of critical, high, low, medium\" }).optional(),\n notes: textList(\"release note paragraph\", \"must be an array of release note paragraphs\").optional(),\n url: url(URL_ERROR).optional(),\n});\n\nconst fileAssociationSchema = z.strictObject({\n extension: fileExtension(\"must be a file extension without a leading dot\"),\n mimeType: text(\"must be a MIME type such as text/plain\"),\n description: text(\"must be a description of the file type\").optional(),\n});\n\nconst desktopActionSchema = z.strictObject({\n name: text(\"must be an action name\"),\n args: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n icon: text(\"must be an icon name\").optional(),\n});\n\nconst brandingSchema = z.strictObject({\n light: hexColorSchema,\n dark: hexColorSchema,\n});\n\nconst nodeRuntimeSchema = z.strictObject({\n source: z.enum(NODE_SOURCES, { error: \"must be one of download, host, path\" }).optional(),\n version: text(\"must be a Node.js version such as 24.19.0\").optional(),\n path: text(\"must be a path to a node binary\").optional(),\n shouldStrip: flag(BOOLEAN_ERROR).optional(),\n shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst scriptsSchema = z.strictObject({\n preInstall: text(SCRIPT_ERROR).optional(),\n postInstall: text(SCRIPT_ERROR).optional(),\n preRemove: text(SCRIPT_ERROR).optional(),\n postRemove: text(SCRIPT_ERROR).optional(),\n});\n\nconst debSchema = z.strictObject({\n packageName: text(\"must be a Debian package name\").optional(),\n section: text(\"must be a Debian archive section\").optional(),\n priority: text(\"must be a Debian priority\").optional(),\n compression: z.enum(DEB_COMPRESSIONS, { error: \"must be one of gzip, none, xz, zstd\" }).optional(),\n fields: textRecord(\"must be a control field value\", \"must be a record of control field names to values\")\n .optional(),\n});\n\nconst rpmSchema = z.strictObject({\n packageName: text(\"must be an RPM package name\").optional(),\n group: text(\"must be an RPM group\").optional(),\n compression: z.enum(RPM_COMPRESSIONS, { error: \"must be one of gzip, lzma, xz, zstd\" }).optional(),\n prefixes: textList(\"prefix\", \"must be an array of relocation prefixes\").optional(),\n});\n\nconst appimageSchema = z.strictObject({\n fileName: text(\"must be an output file name\").optional(),\n compression: z.enum(APPIMAGE_COMPRESSIONS, { error: \"must be one of gzip, xz, zstd\" }).optional(),\n updateInformation: text(\"must be an AppImage update information string\").optional(),\n runtimeFile: text(\"must be a path to an AppImage runtime file\").optional(),\n});\n\nconst flatpakSourceSchema = z.strictObject({\n url: url(\"must be an absolute git URL\").optional(),\n tag: text(\"must be a git tag\").optional(),\n commit: text(\"must be a git commit sha\").optional(),\n});\n\nconst flatpakSchema = z.strictObject({\n mode: z.enum(FLATPAK_MODES, { error: 'must be \"prebuilt\" or \"source\"' }).optional(),\n runtime: text(\"must be a runtime id\").optional(),\n runtimeVersion: text('must be a runtime branch such as \"50\"').optional(),\n sdk: text(\"must be an SDK id\").optional(),\n nodeExtension: text(\"must be a Node SDK extension id\").optional(),\n sdkExtensions: textList(\"SDK extension id\", \"must be an array of SDK extension ids\").optional(),\n base: text(\"must be a base app id\").optional(),\n baseVersion: text(\"must be a base app version\").optional(),\n branch: text(\"must be a branch name\").optional(),\n finishArgs: textList(\"finish argument\", \"must be an array of flatpak finish arguments\").optional(),\n cleanup: textList(\"cleanup pattern\", \"must be an array of cleanup patterns\").optional(),\n buildCommands: textList(\"shell command\", \"must be an array of shell commands\").optional(),\n modules: z.array(z.unknown(), { error: \"must be an array of flatpak module objects\" }).optional(),\n source: flatpakSourceSchema.optional(),\n packageManager: z.enum(PACKAGE_MANAGERS, { error: \"must be one of npm, pnpm, yarn\" }).optional(),\n lockfile: text(\"must be a path to a lockfile\").optional(),\n runtimeRepo: url(\"must be an absolute .flatpakrepo URL\").optional(),\n shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),\n shouldInstall: flag(BOOLEAN_ERROR).optional(),\n shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst debSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n method: z.enum(DEB_SIGN_METHODS, { error: 'must be \"debsign\" or \"dpkg-sig\"' }).optional(),\n type: z.enum(DEB_SIGN_TYPES, { error: \"must be one of archive, maint, origin\" }).optional(),\n signer: text(\"must be a signer name and email\").optional(),\n});\n\nconst rpmSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n});\n\nconst flatpakSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n gpgHomeDir: text(\"must be a path to a GPG home directory\").optional(),\n});\n\nconst appimageSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n});\n\nconst signingSchema = z.strictObject({\n appimage: appimageSigningSchema.optional(),\n deb: debSigningSchema.optional(),\n flatpak: flatpakSigningSchema.optional(),\n rpm: rpmSigningSchema.optional(),\n});\n\nconst extraRelationsSchema = z.strictObject({\n recommends: relationsSchema.optional(),\n suggests: relationsSchema.optional(),\n provides: relationsSchema.optional(),\n conflicts: relationsSchema.optional(),\n replaces: relationsSchema.optional(),\n breaks: relationsSchema.optional(),\n preDepends: relationsSchema.optional(),\n});\n\nconst deploySchema = z.strictObject({\n targets: z\n .array(z.enum(DEPLOY_TARGET_NAMES, { error: \"must be one of appimage, deb, flatpak, rpm\" }), {\n error: \"must be an array of deploy targets\",\n })\n .optional(),\n outDir: text(\"must be a directory path relative to the project root\").optional(),\n name: text(\"must be the display name shown in the launcher\").optional(),\n genericName: text(\"must be a generic application name\").optional(),\n binaryName: text(\"must be a kebab-case command name\").optional(),\n version: text(VERSION_ERROR).optional(),\n release: text(\"must be a packaging revision\").optional(),\n epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),\n summary: text(\"must be a single-line summary without a trailing period\").optional(),\n description: textList(\"description paragraph\", \"must be an array of description paragraphs\").optional(),\n keywords: textList(\"search keyword\", \"must be an array of search keywords\").optional(),\n categories: textList(\"freedesktop category\", \"must be an array of freedesktop categories\").optional(),\n mimeTypes: textList(\"MIME type\", \"must be an array of MIME types\").optional(),\n developer: developerSchema.optional(),\n license: text(SPDX_ERROR).optional(),\n licenseFile: text(\"must be a path to a license file\").optional(),\n metadataLicense: text(SPDX_ERROR).optional(),\n copyright: text(\"must be a copyright line\").optional(),\n homepage: url(URL_ERROR).optional(),\n urls: z\n .partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {\n error: \"must be a record of AppStream url kinds to URLs\",\n })\n .optional(),\n icons: text(\"must be a path to an icon theme directory or a single icon file\").optional(),\n screenshots: z.array(screenshotSchema, { error: \"must be an array of screenshots\" }).optional(),\n screenshotBaseUrl: url(\"must be an absolute base URL\").optional(),\n branding: brandingSchema.optional(),\n contentRating: z\n .record(z.string(), z.enum(OARS_INTENSITIES, { error: \"must be one of intense, mild, moderate, none\" }), {\n error: \"must be a record of OARS 1.1 attribute ids to intensities\",\n })\n .optional(),\n releases: z.array(releaseSchema, { error: \"must be an array of releases\" }).optional(),\n execArgs: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n fileAssociations: z\n .array(fileAssociationSchema, { error: \"must be an array of file associations\" })\n .optional(),\n protocols: textList(\"URL scheme\", \"must be an array of URL schemes\").optional(),\n desktopActions: z\n .record(z.string(), desktopActionSchema, { error: \"must be a record of action ids to actions\" })\n .optional(),\n desktopEntry: textRecord(\"must be a desktop entry value\", \"must be a record of desktop entry keys to values\")\n .optional(),\n isDbusActivatable: flag(BOOLEAN_ERROR).optional(),\n extraFiles: relativePathRecord(\n \"must be a destination path inside the install prefix, without a leading slash or a .. segment\",\n \"must be a source path\",\n \"must be a record of prefix-relative destinations to source paths\",\n ).optional(),\n depends: relationsSchema.optional(),\n relations: extraRelationsSchema.optional(),\n scripts: scriptsSchema.optional(),\n node: nodeRuntimeSchema.optional(),\n signing: signingSchema.optional(),\n appimage: appimageSchema.optional(),\n deb: debSchema.optional(),\n flatpak: flatpakSchema.optional(),\n rpm: rpmSchema.optional(),\n});\n\nexport { deploySchema };\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { ResolvedReactCompilerOptions } from "./config.ts";
|
|
2
|
-
export { isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmittedProps, } from "./config.ts";
|
|
2
|
+
export { APPLICATION_ID_MAX_LENGTH, isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmittedProps, } from "./config.ts";
|
|
3
3
|
export { createConfigLoader } from "./loader.ts";
|
|
4
4
|
//# 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,YAAY,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/internal.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmittedProps, } from "./config.js";
|
|
1
|
+
export { APPLICATION_ID_MAX_LENGTH, isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveOmittedProps, } 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":"AACA,OAAO,EACH,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { ResolvedReactCompilerOptions } from \"./config.ts\";\nexport {\n isValidApplicationId,\n resolveElementComponents,\n resolveElementProps,\n resolveLazyElements,\n resolveOmittedProps,\n} from \"./config.ts\";\nexport { createConfigLoader } from \"./loader.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AACA,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export type { ResolvedReactCompilerOptions } from \"./config.ts\";\nexport {\n APPLICATION_ID_MAX_LENGTH,\n isValidApplicationId,\n resolveElementComponents,\n resolveElementProps,\n resolveLazyElements,\n resolveOmittedProps,\n} from \"./config.ts\";\nexport { createConfigLoader } from \"./loader.ts\";\n"]}
|
package/dist/loader.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ type ConfigLoader = {
|
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Loads and validates the `gtkx.config.ts` file for a project.
|
|
28
|
-
* @param cwd Directory the configuration file is looked up in.
|
|
28
|
+
* @param cwd Directory the configuration file is looked up in; parent directories are not searched.
|
|
29
29
|
* @param options Loading options, such as the environment mode whose overrides are applied.
|
|
30
|
-
* @throws When
|
|
30
|
+
* @throws When that directory holds no configuration file, or when the configuration fails validation.
|
|
31
31
|
*/
|
|
32
32
|
declare const loadConfig: (cwd: string, options?: LoadConfigOptions) => Promise<LoadedConfig>;
|
|
33
33
|
declare const createConfigLoader: (options?: LoadConfigOptions) => ConfigLoader;
|
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":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAiB,KAAK,cAAc,EAAkB,MAAM,aAAa,CAAC;AAE9F,2DAA2D;AAC3D,KAAK,YAAY,GAAG;IAChB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,+FAA+F;AAC/F,KAAK,iBAAiB,GAAG;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAAC;AAEF,sGAAsG;AACtG,KAAK,YAAY,GAAG;IAChB,gGAAgG;IAChG,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,yGAAyG;IACzG,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,CA2B5F,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,UAAS,iBAAsB,KAAG,YAiB7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,CAAC"}
|
package/dist/loader.js
CHANGED
|
@@ -2,33 +2,35 @@ import { getOrInsert } from "@gtkx/utils";
|
|
|
2
2
|
import { loadConfig as loadConfigFile } from "c12";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
+
import { missingConfigFileError } from "./config-error.js";
|
|
5
6
|
import { resolveConfig, validateConfig } from "./config.js";
|
|
6
7
|
/**
|
|
7
8
|
* Loads and validates the `gtkx.config.ts` file for a project.
|
|
8
|
-
* @param cwd Directory the configuration file is looked up in.
|
|
9
|
+
* @param cwd Directory the configuration file is looked up in; parent directories are not searched.
|
|
9
10
|
* @param options Loading options, such as the environment mode whose overrides are applied.
|
|
10
|
-
* @throws When
|
|
11
|
+
* @throws When that directory holds no configuration file, or when the configuration fails validation.
|
|
11
12
|
*/
|
|
12
13
|
const loadConfig = async (cwd, options = {}) => {
|
|
14
|
+
const searched = resolve(cwd);
|
|
13
15
|
const result = await loadConfigFile({
|
|
14
16
|
name: "gtkx",
|
|
15
|
-
cwd,
|
|
17
|
+
cwd: searched,
|
|
16
18
|
rcFile: false,
|
|
17
19
|
globalRc: false,
|
|
18
20
|
packageJson: false,
|
|
19
21
|
context: { mode: options.mode },
|
|
20
22
|
...((options.mode !== undefined) && { envName: options.mode }),
|
|
21
23
|
});
|
|
22
|
-
const config = result.config;
|
|
23
24
|
const configFile = result.configFile;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error(`gtkx.config.ts: no configuration file was found from ${cwd}`);
|
|
25
|
+
if (configFile === undefined || !existsSync(resolve(searched, configFile))) {
|
|
26
|
+
throw missingConfigFileError(searched);
|
|
27
27
|
}
|
|
28
|
+
const config = result.config;
|
|
29
|
+
validateConfig(config);
|
|
28
30
|
return {
|
|
29
31
|
config,
|
|
30
32
|
configFile,
|
|
31
|
-
root: result.cwd ??
|
|
33
|
+
root: result.cwd ?? searched,
|
|
32
34
|
};
|
|
33
35
|
};
|
|
34
36
|
const createConfigLoader = (options = {}) => {
|