@gtkx/config 2.0.0-beta.3 → 2.0.0-beta.5

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.
@@ -0,0 +1,11 @@
1
+ import { type TransformOptions, type TransformResult } from "jiti";
2
+ type CapturedConfig<T> = {
3
+ dependencies: string[];
4
+ value: T;
5
+ };
6
+ declare const transformConfigModule: (options: TransformOptions) => TransformResult;
7
+ declare const setConfigDependencies: (value: object, dependencies: Iterable<string>) => void;
8
+ declare const configDependenciesFor: (value: unknown) => string[];
9
+ declare const captureConfigDependencies: <T>(operation: () => Promise<T>) => Promise<CapturedConfig<T>>;
10
+ export { captureConfigDependencies, configDependenciesFor, setConfigDependencies, transformConfigModule, };
11
+ //# sourceMappingURL=config-dependencies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-dependencies.d.ts","sourceRoot":"","sources":["../src/config-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,MAAM,CAAC;AAO1F,KAAK,cAAc,CAAC,CAAC,IAAI;IAAE,YAAY,EAAE,MAAM,EAAE,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAuD9D,QAAA,MAAM,qBAAqB,GAAI,SAAS,gBAAgB,KAAG,eAY1D,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,cAAc,QAAQ,CAAC,MAAM,CAAC,KAAG,IAI9E,CAAC;AAEF,QAAA,MAAM,qBAAqB,GAAI,OAAO,OAAO,KAAG,MAAM,EACqC,CAAC;AAE5F,QAAA,MAAM,yBAAyB,GAAU,CAAC,EAAE,WAAW,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAqBlG,CAAC;AAEF,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACxB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { createJiti } from "jiti";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ import { createRequire, registerHooks } from "node:module";
4
+ import { extname, sep } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+ const captureStorage = new AsyncLocalStorage();
7
+ const dependenciesByValue = new WeakMap();
8
+ const CACHE_BUSTED_EXTENSIONS = new Set([".cjs", ".js", ".json", ".mjs"]);
9
+ const isTrackedPath = (path) => !path.includes(`${sep}node_modules${sep}`);
10
+ const addPath = (path) => {
11
+ if (isTrackedPath(path)) {
12
+ captureStorage.getStore()?.dependencies.add(path);
13
+ }
14
+ };
15
+ const addUrl = (url) => {
16
+ if (url.startsWith("file:")) {
17
+ addPath(fileURLToPath(url));
18
+ }
19
+ };
20
+ const cacheBustedUrl = (url) => {
21
+ if (!url.startsWith("file:")) {
22
+ return url;
23
+ }
24
+ const path = fileURLToPath(url);
25
+ if (!isTrackedPath(path) || !CACHE_BUSTED_EXTENSIONS.has(extname(path))) {
26
+ return url;
27
+ }
28
+ const parsed = new URL(url);
29
+ parsed.searchParams.set("gtkx-config-load", captureStorage.getStore()?.cacheKey ?? "uncaptured");
30
+ return parsed.href;
31
+ };
32
+ const registerResolutionHook = () => registerHooks({
33
+ resolve(specifier, context, nextResolve) {
34
+ const result = nextResolve(specifier, context);
35
+ addUrl(result.url);
36
+ return { ...result, url: cacheBustedUrl(result.url) };
37
+ },
38
+ });
39
+ const clearNativeModuleCache = (dependencies) => {
40
+ const cache = createRequire(import.meta.url).cache;
41
+ for (const path of dependencies) {
42
+ Reflect.deleteProperty(cache, path);
43
+ }
44
+ };
45
+ const transformConfigModule = (options) => {
46
+ const state = captureStorage.getStore();
47
+ if (state === undefined) {
48
+ throw new Error("Configuration transformation started outside a dependency capture");
49
+ }
50
+ if (options.filename !== undefined) {
51
+ addPath(options.filename);
52
+ }
53
+ return { code: state.transformer.transform(options) };
54
+ };
55
+ const setConfigDependencies = (value, dependencies) => {
56
+ const paths = [...new Set(dependencies)];
57
+ dependenciesByValue.set(value, paths);
58
+ clearNativeModuleCache(paths);
59
+ };
60
+ const configDependenciesFor = (value) => typeof value === "object" && value !== null ? dependenciesByValue.get(value) ?? [] : [];
61
+ const captureConfigDependencies = async (operation) => {
62
+ const state = {
63
+ cacheKey: process.hrtime.bigint().toString(),
64
+ dependencies: new Set(),
65
+ transformer: createJiti(import.meta.url, { fsCache: false, moduleCache: false }),
66
+ };
67
+ const hook = registerResolutionHook();
68
+ try {
69
+ const value = await captureStorage.run(state, operation);
70
+ return { dependencies: [...state.dependencies], value };
71
+ }
72
+ catch (error) {
73
+ if (typeof error === "object" && error !== null) {
74
+ setConfigDependencies(error, state.dependencies);
75
+ }
76
+ throw error;
77
+ }
78
+ finally {
79
+ hook.deregister();
80
+ }
81
+ };
82
+ export { captureConfigDependencies, configDependenciesFor, setConfigDependencies, transformConfigModule, };
83
+ //# sourceMappingURL=config-dependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-dependencies.js","sourceRoot":"","sources":["../src/config-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0D,MAAM,MAAM,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAKzC,MAAM,cAAc,GAAoC,IAAI,iBAAiB,EAAE,CAAC;AAChF,MAAM,mBAAmB,GAA8B,IAAI,OAAO,EAAE,CAAC;AACrE,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/F,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,CA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KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,mBAAmB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAE5F,MAAM,yBAAyB,GAAG,KAAK,EAAK,SAA2B,EAA8B,EAAE;IACnG,MAAM,KAAK,GAAiB;QACxB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5C,YAAY,EAAE,IAAI,GAAG,EAAE;QACvB,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;KACnF,CAAC;IACF,MAAM,IAAI,GAAG,sBAAsB,EAAE,CAAC;IAEtC,IAAI,CAAC;QACD,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAEzD,OAAO,EAAE,YAAY,EAAE,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,KAAK,EAAE,CAAC;IAC5D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;YAC9C,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,KAAK,CAAC;IAChB,CAAC;YAAS,CAAC;QACP,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GACxB,CAAC","sourcesContent":["import { createJiti, type Jiti, type TransformOptions, type TransformResult } from \"jiti\";\nimport { AsyncLocalStorage } from \"node:async_hooks\";\nimport { createRequire, registerHooks } from \"node:module\";\nimport { extname, sep } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\ntype CaptureState = { cacheKey: string; dependencies: Set<string>; transformer: Jiti };\ntype CapturedConfig<T> = { dependencies: string[]; value: T };\n\nconst captureStorage: AsyncLocalStorage<CaptureState> = new AsyncLocalStorage();\nconst dependenciesByValue: WeakMap<object, string[]> = new WeakMap();\nconst CACHE_BUSTED_EXTENSIONS: ReadonlySet<string> = new Set([\".cjs\", \".js\", \".json\", \".mjs\"]);\n\nconst isTrackedPath = (path: string): boolean => !path.includes(`${sep}node_modules${sep}`);\n\nconst addPath = (path: string): void => {\n if (isTrackedPath(path)) {\n captureStorage.getStore()?.dependencies.add(path);\n }\n};\n\nconst addUrl = (url: string): void => {\n if (url.startsWith(\"file:\")) {\n addPath(fileURLToPath(url));\n }\n};\n\nconst cacheBustedUrl = (url: string): string => {\n if (!url.startsWith(\"file:\")) {\n return url;\n }\n\n const path = fileURLToPath(url);\n\n if (!isTrackedPath(path) || !CACHE_BUSTED_EXTENSIONS.has(extname(path))) {\n return url;\n }\n\n const parsed = new URL(url);\n parsed.searchParams.set(\"gtkx-config-load\", captureStorage.getStore()?.cacheKey ?? \"uncaptured\");\n\n return parsed.href;\n};\n\nconst registerResolutionHook = (): ReturnType<typeof registerHooks> =>\n registerHooks({\n resolve(specifier, context, nextResolve) {\n const result = nextResolve(specifier, context);\n addUrl(result.url);\n\n return { ...result, url: cacheBustedUrl(result.url) };\n },\n });\n\nconst clearNativeModuleCache = (dependencies: Iterable<string>): void => {\n const cache = createRequire(import.meta.url).cache;\n\n for (const path of dependencies) {\n Reflect.deleteProperty(cache, path);\n }\n};\n\nconst transformConfigModule = (options: TransformOptions): TransformResult => {\n const state = captureStorage.getStore();\n\n if (state === undefined) {\n throw new Error(\"Configuration transformation started outside a dependency capture\");\n }\n\n if (options.filename !== undefined) {\n addPath(options.filename);\n }\n\n return { code: state.transformer.transform(options) };\n};\n\nconst setConfigDependencies = (value: object, dependencies: Iterable<string>): void => {\n const paths = [...new Set(dependencies)];\n dependenciesByValue.set(value, paths);\n clearNativeModuleCache(paths);\n};\n\nconst configDependenciesFor = (value: unknown): string[] =>\n typeof value === \"object\" && value !== null ? dependenciesByValue.get(value) ?? [] : [];\n\nconst captureConfigDependencies = async <T>(operation: () => Promise<T>): Promise<CapturedConfig<T>> => {\n const state: CaptureState = {\n cacheKey: process.hrtime.bigint().toString(),\n dependencies: new Set(),\n transformer: createJiti(import.meta.url, { fsCache: false, moduleCache: false }),\n };\n const hook = registerResolutionHook();\n\n try {\n const value = await captureStorage.run(state, operation);\n\n return { dependencies: [...state.dependencies], value };\n } catch (error) {\n if (typeof error === \"object\" && error !== null) {\n setConfigDependencies(error, state.dependencies);\n }\n\n throw error;\n } finally {\n hook.deregister();\n }\n};\n\nexport {\n captureConfigDependencies,\n configDependenciesFor,\n setConfigDependencies,\n transformConfigModule,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAIzE,QAAA,MAAM,sBAAsB,GAAI,KAAK,MAAM,EAAE,aAAa,MAAM,KAAG,KAGC,CAAC;AAErE,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,mBAAgC,KAAG,KACJ,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"config-error.d.ts","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CACM,CAAC;AAIzE,QAAA,MAAM,sBAAsB,GAAI,KAAK,MAAM,EAAE,aAAa,MAAM,KAAG,KAGW,CAAC;AAE/E,QAAA,MAAM,WAAW,GAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,mBAAgC,KAAG,KACJ,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { z } from "zod";
2
- const DEFAULT_CONFIG_FILE = "gtkx.config.ts";
2
+ const DEFAULT_CONFIG_FILE = "gtkx.config.*";
3
3
  const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4
4
  const configPrefix = (configFile) => `${configFile}:`;
5
5
  const missingConfigFileError = (cwd, configFile) => new Error(configFile === undefined
6
6
  ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`
7
- : `${configPrefix(configFile)} no configuration file found`);
7
+ : `${configPrefix(configFile)} no configuration file found in ${cwd}`);
8
8
  const configError = (error, configFile = DEFAULT_CONFIG_FILE) => new Error(`${configPrefix(configFile)}\n${z.prettifyError(error)}`);
9
9
  export { isRecord, missingConfigFileError, configError };
10
10
  //# sourceMappingURL=config-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAE7C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAU,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC;AAEtE,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,UAAmB,EAAS,EAAE,CACvE,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;IAC9B,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,mCAAmC,GAAG,EAAE;IAC9E,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAErE,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,UAAU,GAAG,mBAAmB,EAAS,EAAE,CAC/E,IAAI,KAAK,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nconst DEFAULT_CONFIG_FILE = \"gtkx.config.ts\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst configPrefix = (configFile: string): string => `${configFile}:`;\n\nconst missingConfigFileError = (cwd: string, configFile?: string): Error =>\n new Error(configFile === undefined\n ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`\n : `${configPrefix(configFile)} no configuration file found`);\n\nconst configError = (error: z.ZodError, configFile = DEFAULT_CONFIG_FILE): Error =>\n new Error(`${configPrefix(configFile)}\\n${z.prettifyError(error)}`);\n\nexport { isRecord, missingConfigFileError, configError };\n"]}
1
+ {"version":3,"file":"config-error.js","sourceRoot":"","sources":["../src/config-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CAClE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAEzE,MAAM,YAAY,GAAG,CAAC,UAAkB,EAAU,EAAE,CAAC,GAAG,UAAU,GAAG,CAAC;AAEtE,MAAM,sBAAsB,GAAG,CAAC,GAAW,EAAE,UAAmB,EAAS,EAAE,CACvE,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;IAC9B,CAAC,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,mCAAmC,GAAG,EAAE;IAC9E,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,mCAAmC,GAAG,EAAE,CAAC,CAAC;AAE/E,MAAM,WAAW,GAAG,CAAC,KAAiB,EAAE,UAAU,GAAG,mBAAmB,EAAS,EAAE,CAC/E,IAAI,KAAK,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { z } from \"zod\";\n\nconst DEFAULT_CONFIG_FILE = \"gtkx.config.*\";\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst configPrefix = (configFile: string): string => `${configFile}:`;\n\nconst missingConfigFileError = (cwd: string, configFile?: string): Error =>\n new Error(configFile === undefined\n ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`\n : `${configPrefix(configFile)} no configuration file found in ${cwd}`);\n\nconst configError = (error: z.ZodError, configFile = DEFAULT_CONFIG_FILE): Error =>\n new Error(`${configPrefix(configFile)}\\n${z.prettifyError(error)}`);\n\nexport { isRecord, missingConfigFileError, configError };\n"]}
package/dist/config.d.ts CHANGED
@@ -178,10 +178,7 @@ declare const configSchema: z.ZodObject<{
178
178
  desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
179
179
  metainfoExtra: z.ZodOptional<z.ZodArray<z.ZodString>>;
180
180
  isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
181
- extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
182
- source: z.ZodString;
183
- mode: z.ZodOptional<z.ZodString>;
184
- }, z.core.$strict>]>>>;
181
+ extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodType<import("./deploy.ts").DeployExtraFileOptions, unknown, z.core.$ZodTypeInternals<import("./deploy.ts").DeployExtraFileOptions, unknown>>]>>>;
185
182
  minimumLibraryVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
186
183
  depends: z.ZodOptional<z.ZodObject<{
187
184
  deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -223,17 +220,7 @@ declare const configSchema: z.ZodObject<{
223
220
  preRemove: z.ZodOptional<z.ZodString>;
224
221
  postRemove: z.ZodOptional<z.ZodString>;
225
222
  }, z.core.$strict>>;
226
- node: z.ZodOptional<z.ZodObject<{
227
- source: z.ZodOptional<z.ZodEnum<{
228
- path: "path";
229
- download: "download";
230
- host: "host";
231
- }>>;
232
- version: z.ZodOptional<z.ZodString>;
233
- path: z.ZodOptional<z.ZodString>;
234
- shouldStrip: z.ZodOptional<z.ZodBoolean>;
235
- shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
236
- }, z.core.$strict>>;
223
+ node: z.ZodOptional<z.ZodType<import("./deploy.ts").DeployNodeOptions, unknown, z.core.$ZodTypeInternals<import("./deploy.ts").DeployNodeOptions, unknown>>>;
237
224
  signing: z.ZodOptional<z.ZodObject<{
238
225
  appimage: z.ZodOptional<z.ZodObject<{
239
226
  gpgKeyId: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC;AAG5D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,iGAAiG;AACjG,KAAK,oBAAoB,GAAG;IACxB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AAW,GAAI,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,MAA8B,CAAC;AAUrF,QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,EAGpC,CAAC;AAc/B,QAAA,MAAM,wBAAwB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAChC,CAAC;AAE7D,QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAC/B,CAAC;AAEzD,QAAA,MAAM,mBAAmB,GAAI,UAAU,MAAM,CAAC,UAAU,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CACpB,CAAC;AAEhE,QAAA,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,OAAyC,CAAC;AACxF,QAAA,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,OAA6C,CAAC;AAEhG,QAAA,MAAM,kBAAkB,GAAI,QAAQ,MAAM,KAAG,WAG3C,CAAC;AAEH,QAAA,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,cAMrD,CAAC;AAEH,OAAO,EACH,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,4BAA4B,EACjC,KAAK,MAAM,EACX,KAAK,cAAc,GACtB,CAAC"}
package/dist/deploy.d.ts CHANGED
@@ -1,4 +1,20 @@
1
1
  import { z } from "zod";
2
+ /**
3
+ * A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is
4
+ * installed at the entry's prefix-relative destination, and the octal mode it is installed with.
5
+ */
6
+ type DeployExtraFileOptions = Record<"source", string> & {
7
+ /** Octal file mode. Setuid and setgid bits are rejected. */
8
+ mode?: string | undefined;
9
+ };
10
+ /**
11
+ * The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it
12
+ * is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.
13
+ */
14
+ type DeployNodeOptions = Partial<Record<"source", "download" | "host" | "path" | undefined> & Record<"path", string | undefined> & Record<"shouldStrip" | "shouldUseCompileCache", boolean | undefined>> & {
15
+ /** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */
16
+ version?: string | undefined;
17
+ };
2
18
  declare const deploySchema: z.ZodObject<{
3
19
  targets: z.ZodOptional<z.ZodArray<z.ZodEnum<{
4
20
  appimage: "appimage";
@@ -89,10 +105,7 @@ declare const deploySchema: z.ZodObject<{
89
105
  desktopEntry: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
90
106
  metainfoExtra: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
107
  isDbusActivatable: z.ZodOptional<z.ZodBoolean>;
92
- extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
93
- source: z.ZodString;
94
- mode: z.ZodOptional<z.ZodString>;
95
- }, z.core.$strict>]>>>;
108
+ extraFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodType<DeployExtraFileOptions, unknown, z.core.$ZodTypeInternals<DeployExtraFileOptions, unknown>>]>>>;
96
109
  minimumLibraryVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
97
110
  depends: z.ZodOptional<z.ZodObject<{
98
111
  deb: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -134,17 +147,7 @@ declare const deploySchema: z.ZodObject<{
134
147
  preRemove: z.ZodOptional<z.ZodString>;
135
148
  postRemove: z.ZodOptional<z.ZodString>;
136
149
  }, z.core.$strict>>;
137
- node: z.ZodOptional<z.ZodObject<{
138
- source: z.ZodOptional<z.ZodEnum<{
139
- path: "path";
140
- download: "download";
141
- host: "host";
142
- }>>;
143
- version: z.ZodOptional<z.ZodString>;
144
- path: z.ZodOptional<z.ZodString>;
145
- shouldStrip: z.ZodOptional<z.ZodBoolean>;
146
- shouldUseCompileCache: z.ZodOptional<z.ZodBoolean>;
147
- }, z.core.$strict>>;
150
+ node: z.ZodOptional<z.ZodType<DeployNodeOptions, unknown, z.core.$ZodTypeInternals<DeployNodeOptions, unknown>>>;
148
151
  signing: z.ZodOptional<z.ZodObject<{
149
152
  appimage: z.ZodOptional<z.ZodObject<{
150
153
  gpgKeyId: z.ZodString;
@@ -239,5 +242,5 @@ declare const deploySchema: z.ZodObject<{
239
242
  prefixes: z.ZodOptional<z.ZodArray<z.ZodString>>;
240
243
  }, z.core.$strict>>;
241
244
  }, z.core.$strict>;
242
- export { deploySchema };
245
+ export { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };
243
246
  //# sourceMappingURL=deploy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0PxB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmEhB,CAAC;AAEH,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,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zB,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 {\n fileExtension,\n flag,\n girLibrary,\n relativePathRecord,\n text,\n textList,\n textRecord,\n url,\n} from \"./schema-text.ts\";\n\nconst APPIMAGE_COMPRESSIONS = [\"gzip\", \"xz\", \"zstd\"] as const;\nconst DEB_COMPRESSIONS = [\"gzip\", \"none\", \"xz\", \"zstd\"] as const;\nconst DEB_SIGN_METHODS = [\"debsign\", \"dpkg-sig\"] as const;\nconst DEB_SIGN_TYPES = [\"archive\", \"maint\", \"origin\"] as const;\nconst DEPLOY_TARGET_NAMES = [\"appimage\", \"deb\", \"flatpak\", \"rpm\"] as const;\nconst FLATPAK_MODES = [\"prebuilt\", \"source\"] as const;\nconst NODE_SOURCES = [\"download\", \"host\", \"path\"] as const;\nconst OARS_INTENSITIES = [\"intense\", \"mild\", \"moderate\", \"none\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\"] as const;\nconst RELEASE_TYPES = [\"development\", \"snapshot\", \"stable\"] as const;\nconst RELEASE_URGENCIES = [\"critical\", \"high\", \"low\", \"medium\"] as const;\nconst RPM_COMPRESSIONS = [\"gzip\", \"lzma\", \"xz\", \"zstd\"] as const;\n\nconst URL_KINDS = [\n \"bugtracker\",\n \"contact\",\n \"contribute\",\n \"donation\",\n \"faq\",\n \"help\",\n \"translate\",\n \"vcs-browser\",\n] as const;\n\nconst BOOLEAN_ERROR = \"must be a boolean\";\nconst EPOCH_ERROR = \"must be a non-negative integer\";\nconst EXTRA_FILE_ERROR = \"must be a source path or a { source, mode } entry\";\nconst FILE_MODE_ERROR = \"must be an octal file mode without setuid or setgid bits, such as 755\";\nconst FILE_MODE_PATTERN = /^[0-7]{3,4}$/;\nconst FILE_MODE_RADIX = 8;\nconst PRIVILEGED_FILE_MODE_MASK = 0o6000;\nconst HEX_COLOR_ERROR = \"must be a #rrggbb color\";\nconst HEX_COLOR_PATTERN = /^#[\\dA-Fa-f]{6}$/;\nconst KEY_FILE_ERROR = \"must be a path to a PGP key file\";\nconst KEY_ID_ERROR = \"must be a PGP key id\";\nconst LAUNCHER_ENV_ERROR = \"must be a record of POSIX environment names to values without null bytes\";\nconst LAUNCHER_ENV_NAME_ERROR = \"must be a POSIX environment name\";\nconst LAUNCHER_ENV_NAME_PATTERN = /^[A-Za-z_]\\w*$/;\nconst MINIMUM_LIBRARY_VERSION_ERROR = \"must be a version such as 4.18\";\nconst MINIMUM_LIBRARY_VERSION_PATTERN = /^\\d+(?:\\.\\d+)*$/;\nconst MINIMUM_LIBRARY_VERSIONS_ERROR = \"must be a record of GIR library ids to a minimum version\";\nconst NODE_FLAG_ERROR = \"must be a Node.js flag beginning with a hyphen and containing no null bytes\";\nconst LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form \"Name-Version\", such as \"Gtk-4.0\"';\nconst SCRIPT_ERROR = \"must be a path to a shell script\";\nconst SOURCE_PATH_ERROR = \"must be a source path\";\nconst SPDX_ERROR = \"must be an SPDX license expression\";\nconst URL_ERROR = \"must be an absolute URL\";\nconst VERSION_ERROR = \"must be a version string\";\nconst hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });\n\nconst minimumLibraryVersionSchema = z\n .string({ error: MINIMUM_LIBRARY_VERSION_ERROR })\n .regex(MINIMUM_LIBRARY_VERSION_PATTERN, { error: MINIMUM_LIBRARY_VERSION_ERROR });\n\nconst minimumLibraryVersionsSchema = z.record(girLibrary(LIBRARY_ID_ERROR), minimumLibraryVersionSchema, {\n error: MINIMUM_LIBRARY_VERSIONS_ERROR,\n});\n\nconst relationsSchema = z.strictObject({\n deb: textList(\"Debian package relation\", \"must be an array of Debian package relations\").optional(),\n rpm: textList(\"RPM package relation\", \"must be an array of RPM package relations\").optional(),\n});\n\nconst developerSchema = z.strictObject({\n id: text(\"must be a reverse-DNS developer id\").optional(),\n name: text(\"must be a developer or organization name\").optional(),\n email: text(\"must be an email address\").optional(),\n});\n\nconst screenshotSchema = z\n .strictObject({\n url: url(\"must be an absolute URL to a PNG or JPEG\").optional(),\n file: text(\"must be an image path relative to the project root\").optional(),\n caption: text(\"must be a screenshot caption\").optional(),\n isDefault: flag(BOOLEAN_ERROR).optional(),\n })\n .refine((entry) => entry.url !== undefined || entry.file !== undefined, {\n error: \"must have either a `url` or a `file`\",\n });\n\nconst releaseSchema = z.strictObject({\n version: text(VERSION_ERROR),\n date: z.iso.date({ error: \"must be an ISO date (YYYY-MM-DD)\" }),\n type: z.enum(RELEASE_TYPES, { error: \"must be one of development, snapshot, stable\" }).optional(),\n urgency: z.enum(RELEASE_URGENCIES, { error: \"must be one of critical, high, low, medium\" }).optional(),\n notes: textList(\"release note paragraph\", \"must be an array of release note paragraphs\").optional(),\n url: url(URL_ERROR).optional(),\n});\n\nconst fileAssociationSchema = z.strictObject({\n extension: fileExtension(\"must be a file extension without a leading dot\"),\n mimeType: text(\"must be a MIME type such as text/plain\"),\n description: text(\"must be a description of the file type\").optional(),\n});\n\nconst desktopActionSchema = z.strictObject({\n name: text(\"must be an action name\"),\n args: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n icon: text(\"must be an icon name\").optional(),\n});\n\nconst brandingSchema = z.strictObject({\n light: hexColorSchema,\n dark: hexColorSchema,\n});\n\nconst extraFileSchema = z.strictObject({\n source: text(SOURCE_PATH_ERROR),\n mode: z\n .string({ error: FILE_MODE_ERROR })\n .regex(FILE_MODE_PATTERN, { error: FILE_MODE_ERROR })\n .refine((mode) => (Number.parseInt(mode, FILE_MODE_RADIX) & PRIVILEGED_FILE_MODE_MASK) === 0, {\n error: FILE_MODE_ERROR,\n })\n .optional(),\n});\n\nconst extraFileEntrySchema = z.union([text(SOURCE_PATH_ERROR), extraFileSchema], { error: EXTRA_FILE_ERROR });\n\nconst launcherEnvSchema = z.record(\n z.string({ error: LAUNCHER_ENV_NAME_ERROR }).regex(LAUNCHER_ENV_NAME_PATTERN, { error: LAUNCHER_ENV_NAME_ERROR }),\n z.string({ error: LAUNCHER_ENV_ERROR }).refine((value) => !value.includes(\"\\0\"), { error: LAUNCHER_ENV_ERROR }),\n { error: (issue) => issue.code === \"invalid_key\" ? LAUNCHER_ENV_NAME_ERROR : LAUNCHER_ENV_ERROR },\n);\n\nconst nodeFlagsSchema = z.array(\n z\n .string({ error: NODE_FLAG_ERROR })\n .refine((value) => value.startsWith(\"-\") && !value.includes(\"\\0\"), { error: NODE_FLAG_ERROR }),\n { error: \"must be an array of Node.js flags\" },\n);\n\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 26.7.0\").optional(),\n path: text(\"must be a path to a node binary\").optional(),\n shouldStrip: flag(BOOLEAN_ERROR).optional(),\n shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst scriptsSchema = z.strictObject({\n preInstall: text(SCRIPT_ERROR).optional(),\n postInstall: text(SCRIPT_ERROR).optional(),\n preRemove: text(SCRIPT_ERROR).optional(),\n postRemove: text(SCRIPT_ERROR).optional(),\n});\n\nconst debSchema = z.strictObject({\n packageName: text(\"must be a Debian package name\").optional(),\n section: text(\"must be a Debian archive section\").optional(),\n priority: text(\"must be a Debian priority\").optional(),\n compression: z.enum(DEB_COMPRESSIONS, { error: \"must be one of gzip, none, xz, zstd\" }).optional(),\n fields: textRecord(\"must be a control field value\", \"must be a record of control field names to values\")\n .optional(),\n});\n\nconst rpmSchema = z.strictObject({\n packageName: text(\"must be an RPM package name\").optional(),\n group: text(\"must be an RPM group\").optional(),\n compression: z.enum(RPM_COMPRESSIONS, { error: \"must be one of gzip, lzma, xz, zstd\" }).optional(),\n prefixes: textList(\"prefix\", \"must be an array of relocation prefixes\").optional(),\n});\n\nconst appimageSchema = z.strictObject({\n fileName: text(\"must be an output file name\").optional(),\n compression: z.enum(APPIMAGE_COMPRESSIONS, { error: \"must be one of gzip, xz, zstd\" }).optional(),\n updateInformation: text(\"must be an AppImage update information string\").optional(),\n runtimeFile: text(\"must be a path to an AppImage runtime file\").optional(),\n});\n\nconst flatpakSourceSchema = z.strictObject({\n url: url(\"must be an absolute git URL\").optional(),\n tag: text(\"must be a git tag\").optional(),\n commit: text(\"must be a git commit sha\").optional(),\n});\n\nconst flatpakSchema = z.strictObject({\n mode: z.enum(FLATPAK_MODES, { error: 'must be \"prebuilt\" or \"source\"' }).optional(),\n runtime: text(\"must be a runtime id\").optional(),\n runtimeVersion: text('must be a runtime branch such as \"50\"').optional(),\n sdk: text(\"must be an SDK id\").optional(),\n nodeExtension: text(\"must be a Node SDK extension id\").optional(),\n sdkExtensions: textList(\"SDK extension id\", \"must be an array of SDK extension ids\").optional(),\n base: text(\"must be a base app id\").optional(),\n baseVersion: text(\"must be a base app version\").optional(),\n branch: text(\"must be a branch name\").optional(),\n finishArgs: textList(\"finish argument\", \"must be an array of flatpak finish arguments\").optional(),\n cleanup: textList(\"cleanup pattern\", \"must be an array of cleanup patterns\").optional(),\n buildCommands: textList(\"shell command\", \"must be an array of shell commands\").optional(),\n modules: z.array(z.unknown(), { error: \"must be an array of flatpak module objects\" }).optional(),\n source: flatpakSourceSchema.optional(),\n packageManager: z.enum(PACKAGE_MANAGERS, { error: \"must be one of npm, pnpm, yarn\" }).optional(),\n lockfile: text(\"must be a path to a lockfile\").optional(),\n runtimeRepo: url(\"must be an absolute .flatpakrepo URL\").optional(),\n shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),\n shouldInstall: flag(BOOLEAN_ERROR).optional(),\n shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst debSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n method: z.enum(DEB_SIGN_METHODS, { error: 'must be \"debsign\" or \"dpkg-sig\"' }).optional(),\n type: z.enum(DEB_SIGN_TYPES, { error: \"must be one of archive, maint, origin\" }).optional(),\n signer: text(\"must be a signer name and email\").optional(),\n});\n\nconst rpmSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n});\n\nconst flatpakSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n gpgHomeDir: text(\"must be a path to a GPG home directory\").optional(),\n});\n\nconst appimageSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n});\n\nconst signingSchema = z.strictObject({\n appimage: appimageSigningSchema.optional(),\n deb: debSigningSchema.optional(),\n flatpak: flatpakSigningSchema.optional(),\n rpm: rpmSigningSchema.optional(),\n});\n\nconst extraRelationsSchema = z.strictObject({\n recommends: relationsSchema.optional(),\n suggests: relationsSchema.optional(),\n provides: relationsSchema.optional(),\n conflicts: relationsSchema.optional(),\n replaces: relationsSchema.optional(),\n breaks: relationsSchema.optional(),\n preDepends: relationsSchema.optional(),\n});\n\nconst deploySchema = z.strictObject({\n targets: z\n .array(z.enum(DEPLOY_TARGET_NAMES, { error: \"must be one of appimage, deb, flatpak, rpm\" }), {\n error: \"must be an array of deploy targets\",\n })\n .optional(),\n outDir: text(\"must be a directory path relative to the project root\").optional(),\n name: text(\"must be the display name shown in the launcher\").optional(),\n genericName: text(\"must be a generic application name\").optional(),\n binaryName: text(\"must be a kebab-case command name\").optional(),\n version: text(VERSION_ERROR).optional(),\n release: text(\"must be a packaging revision\").optional(),\n epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),\n summary: text(\"must be a single-line summary without a trailing period\").optional(),\n description: textList(\"description paragraph\", \"must be an array of description paragraphs\").optional(),\n keywords: textList(\"search keyword\", \"must be an array of search keywords\").optional(),\n categories: textList(\"freedesktop category\", \"must be an array of freedesktop categories\").optional(),\n mimeTypes: textList(\"MIME type\", \"must be an array of MIME types\").optional(),\n developer: developerSchema.optional(),\n license: text(SPDX_ERROR).optional(),\n licenseFile: text(\"must be a path to a license file\").optional(),\n metadataLicense: text(SPDX_ERROR).optional(),\n copyright: text(\"must be a copyright line\").optional(),\n homepage: url(URL_ERROR).optional(),\n urls: z\n .partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {\n error: \"must be a record of AppStream url kinds to URLs\",\n })\n .optional(),\n screenshots: z.array(screenshotSchema, { error: \"must be an array of screenshots\" }).optional(),\n screenshotBaseUrl: url(\"must be an absolute base URL\").optional(),\n branding: brandingSchema.optional(),\n contentRating: z\n .record(z.string(), z.enum(OARS_INTENSITIES, { error: \"must be one of intense, mild, moderate, none\" }), {\n error: \"must be a record of OARS 1.1 attribute ids to intensities\",\n })\n .optional(),\n releases: z.array(releaseSchema, { error: \"must be an array of releases\" }).optional(),\n execArgs: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n launcherEnv: launcherEnvSchema.optional(),\n nodeFlags: nodeFlagsSchema.optional(),\n fileAssociations: z\n .array(fileAssociationSchema, { error: \"must be an array of file associations\" })\n .optional(),\n protocols: textList(\"URL scheme\", \"must be an array of URL schemes\").optional(),\n desktopActions: z\n .record(z.string(), desktopActionSchema, { error: \"must be a record of action ids to actions\" })\n .optional(),\n desktopEntry: textRecord(\"must be a desktop entry value\", \"must be a record of desktop entry keys to values\")\n .optional(),\n metainfoExtra: textList(\"AppStream XML fragment\", \"must be an array of AppStream XML fragments\").optional(),\n isDbusActivatable: flag(BOOLEAN_ERROR).optional(),\n extraFiles: relativePathRecord(\n \"must be a destination path inside the install prefix, without a leading slash or a .. segment\",\n extraFileEntrySchema,\n \"must be a record of prefix-relative destinations to source paths or { source, mode } entries\",\n ).optional(),\n minimumLibraryVersions: minimumLibraryVersionsSchema.optional(),\n depends: relationsSchema.optional(),\n relations: extraRelationsSchema.optional(),\n scripts: scriptsSchema.optional(),\n node: nodeRuntimeSchema.optional(),\n signing: signingSchema.optional(),\n appimage: appimageSchema.optional(),\n deb: debSchema.optional(),\n flatpak: flatpakSchema.optional(),\n rpm: rpmSchema.optional(),\n});\n\nexport { deploySchema };\n"]}
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../src/deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,GAAG,GACN,MAAM,kBAAkB,CAAC;AAE1B,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC;AAC9D,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAU,CAAC;AACjE,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAC1D,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAC/D,MAAM,mBAAmB,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AAC3E,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAU,CAAC;AACtD,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC3D,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAU,CAAC;AAC1E,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAC1D,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAU,CAAC;AACrE,MAAM,iBAAiB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAU,CAAC;AACzE,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,M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C/F,oBAAoB,EACpB,8FAA8F,CACjG,CAAC,QAAQ,EAAE;IACZ,sBAAsB,EAAE,4BAA4B,CAAC,QAAQ,EAAE;IAC/D,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC1C,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,IAAI,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;IACzB,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;IACjC,GAAG,EAAE,SAAS,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAEH,OAAO,EAAE,YAAY,EAAuD,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n fileExtension,\n flag,\n girLibrary,\n relativePathRecord,\n text,\n textList,\n textRecord,\n url,\n} from \"./schema-text.ts\";\n\nconst APPIMAGE_COMPRESSIONS = [\"gzip\", \"xz\", \"zstd\"] as const;\nconst DEB_COMPRESSIONS = [\"gzip\", \"none\", \"xz\", \"zstd\"] as const;\nconst DEB_SIGN_METHODS = [\"debsign\", \"dpkg-sig\"] as const;\nconst DEB_SIGN_TYPES = [\"archive\", \"maint\", \"origin\"] as const;\nconst DEPLOY_TARGET_NAMES = [\"appimage\", \"deb\", \"flatpak\", \"rpm\"] as const;\nconst FLATPAK_MODES = [\"prebuilt\", \"source\"] as const;\nconst NODE_SOURCES = [\"download\", \"host\", \"path\"] as const;\nconst OARS_INTENSITIES = [\"intense\", \"mild\", \"moderate\", \"none\"] as const;\nconst PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\"] as const;\nconst RELEASE_TYPES = [\"development\", \"snapshot\", \"stable\"] as const;\nconst RELEASE_URGENCIES = [\"critical\", \"high\", \"low\", \"medium\"] as const;\nconst RPM_COMPRESSIONS = [\"gzip\", \"lzma\", \"xz\", \"zstd\"] as const;\n\nconst URL_KINDS = [\n \"bugtracker\",\n \"contact\",\n \"contribute\",\n \"donation\",\n \"faq\",\n \"help\",\n \"translate\",\n \"vcs-browser\",\n] as const;\n\nconst BOOLEAN_ERROR = \"must be a boolean\";\nconst EPOCH_ERROR = \"must be a non-negative integer\";\nconst EXTRA_FILE_ERROR = \"must be a source path or a { source, mode } entry\";\nconst FILE_MODE_ERROR = \"must be an octal file mode without setuid or setgid bits, such as 755\";\nconst FILE_MODE_PATTERN = /^[0-7]{3,4}$/;\nconst FILE_MODE_RADIX = 8;\nconst PRIVILEGED_FILE_MODE_MASK = 0o6000;\nconst HEX_COLOR_ERROR = \"must be a #rrggbb color\";\nconst HEX_COLOR_PATTERN = /^#[\\dA-Fa-f]{6}$/;\nconst KEY_FILE_ERROR = \"must be a path to a PGP key file\";\nconst KEY_ID_ERROR = \"must be a PGP key id\";\nconst LAUNCHER_ENV_ERROR = \"must be a record of POSIX environment names to values without null bytes\";\nconst LAUNCHER_ENV_NAME_ERROR = \"must be a POSIX environment name\";\nconst LAUNCHER_ENV_NAME_PATTERN = /^[A-Za-z_]\\w*$/;\nconst MINIMUM_LIBRARY_VERSION_ERROR = \"must be a version such as 4.18\";\nconst MINIMUM_LIBRARY_VERSION_PATTERN = /^\\d+(?:\\.\\d+)*$/;\nconst MINIMUM_LIBRARY_VERSIONS_ERROR = \"must be a record of GIR library ids to a minimum version\";\nconst NODE_FLAG_ERROR = \"must be a Node.js flag beginning with a hyphen and containing no null bytes\";\nconst LIBRARY_ID_ERROR = 'must be a GIR library identifier of the form \"Name-Version\", such as \"Gtk-4.0\"';\nconst SCRIPT_ERROR = \"must be a path to a shell script\";\nconst SOURCE_PATH_ERROR = \"must be a source path\";\nconst SPDX_ERROR = \"must be an SPDX license expression\";\nconst URL_ERROR = \"must be an absolute URL\";\nconst VERSION_ERROR = \"must be a version string\";\nconst hexColorSchema = z.string({ error: HEX_COLOR_ERROR }).regex(HEX_COLOR_PATTERN, { error: HEX_COLOR_ERROR });\n\nconst minimumLibraryVersionSchema = z\n .string({ error: MINIMUM_LIBRARY_VERSION_ERROR })\n .regex(MINIMUM_LIBRARY_VERSION_PATTERN, { error: MINIMUM_LIBRARY_VERSION_ERROR });\n\nconst minimumLibraryVersionsSchema = z.record(girLibrary(LIBRARY_ID_ERROR), minimumLibraryVersionSchema, {\n error: MINIMUM_LIBRARY_VERSIONS_ERROR,\n});\n\nconst relationsSchema = z.strictObject({\n deb: textList(\"Debian package relation\", \"must be an array of Debian package relations\").optional(),\n rpm: textList(\"RPM package relation\", \"must be an array of RPM package relations\").optional(),\n});\n\nconst developerSchema = z.strictObject({\n id: text(\"must be a reverse-DNS developer id\").optional(),\n name: text(\"must be a developer or organization name\").optional(),\n email: text(\"must be an email address\").optional(),\n});\n\nconst screenshotSchema = z\n .strictObject({\n url: url(\"must be an absolute URL to a PNG or JPEG\").optional(),\n file: text(\"must be an image path relative to the project root\").optional(),\n caption: text(\"must be a screenshot caption\").optional(),\n isDefault: flag(BOOLEAN_ERROR).optional(),\n })\n .refine((entry) => entry.url !== undefined || entry.file !== undefined, {\n error: \"must have either a `url` or a `file`\",\n });\n\nconst releaseSchema = z.strictObject({\n version: text(VERSION_ERROR),\n date: z.iso.date({ error: \"must be an ISO date (YYYY-MM-DD)\" }),\n type: z.enum(RELEASE_TYPES, { error: \"must be one of development, snapshot, stable\" }).optional(),\n urgency: z.enum(RELEASE_URGENCIES, { error: \"must be one of critical, high, low, medium\" }).optional(),\n notes: textList(\"release note paragraph\", \"must be an array of release note paragraphs\").optional(),\n url: url(URL_ERROR).optional(),\n});\n\nconst fileAssociationSchema = z.strictObject({\n extension: fileExtension(\"must be a file extension without a leading dot\"),\n mimeType: text(\"must be a MIME type such as text/plain\"),\n description: text(\"must be a description of the file type\").optional(),\n});\n\nconst desktopActionSchema = z.strictObject({\n name: text(\"must be an action name\"),\n args: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n icon: text(\"must be an icon name\").optional(),\n});\n\nconst brandingSchema = z.strictObject({\n light: hexColorSchema,\n dark: hexColorSchema,\n});\n\n/**\n * A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is\n * installed at the entry's prefix-relative destination, and the octal mode it is installed with.\n */\ntype DeployExtraFileOptions = Record<\"source\", string> & {\n /** Octal file mode. Setuid and setgid bits are rejected. */\n mode?: string | undefined;\n};\nconst extraFileSchema: z.ZodType<DeployExtraFileOptions> = z.strictObject({\n source: text(SOURCE_PATH_ERROR),\n mode: z\n .string({ error: FILE_MODE_ERROR })\n .regex(FILE_MODE_PATTERN, { error: FILE_MODE_ERROR })\n .refine((mode) => (Number.parseInt(mode, FILE_MODE_RADIX) & PRIVILEGED_FILE_MODE_MASK) === 0, {\n error: FILE_MODE_ERROR,\n })\n .optional(),\n});\n\nconst extraFileEntrySchema = z.union([text(SOURCE_PATH_ERROR), extraFileSchema], { error: EXTRA_FILE_ERROR });\n\nconst launcherEnvSchema = z.record(\n z.string({ error: LAUNCHER_ENV_NAME_ERROR }).regex(LAUNCHER_ENV_NAME_PATTERN, { error: LAUNCHER_ENV_NAME_ERROR }),\n z.string({ error: LAUNCHER_ENV_ERROR }).refine((value) => !value.includes(\"\\0\"), { error: LAUNCHER_ENV_ERROR }),\n { error: (issue) => issue.code === \"invalid_key\" ? LAUNCHER_ENV_NAME_ERROR : LAUNCHER_ENV_ERROR },\n);\n\nconst nodeFlagsSchema = z.array(\n z\n .string({ error: NODE_FLAG_ERROR })\n .refine((value) => value.startsWith(\"-\") && !value.includes(\"\\0\"), { error: NODE_FLAG_ERROR }),\n { error: \"must be an array of Node.js flags\" },\n);\n\n/**\n * The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it\n * is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.\n */\ntype DeployNodeOptions = Partial<\n Record<\"source\", \"download\" | \"host\" | \"path\" | undefined> &\n Record<\"path\", string | undefined> &\n Record<\"shouldStrip\" | \"shouldUseCompileCache\", boolean | undefined>\n> & {\n /** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */\n version?: string | undefined;\n};\nconst nodeRuntimeSchema: z.ZodType<DeployNodeOptions> = z.strictObject({\n source: z.enum(NODE_SOURCES, { error: \"must be one of download, host, path\" }).optional(),\n version: text(\"must be a Node.js version such as 26.7.0\").optional(),\n path: text(\"must be a path to a node binary\").optional(),\n shouldStrip: flag(BOOLEAN_ERROR).optional(),\n shouldUseCompileCache: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst scriptsSchema = z.strictObject({\n preInstall: text(SCRIPT_ERROR).optional(),\n postInstall: text(SCRIPT_ERROR).optional(),\n preRemove: text(SCRIPT_ERROR).optional(),\n postRemove: text(SCRIPT_ERROR).optional(),\n});\n\nconst debSchema = z.strictObject({\n packageName: text(\"must be a Debian package name\").optional(),\n section: text(\"must be a Debian archive section\").optional(),\n priority: text(\"must be a Debian priority\").optional(),\n compression: z.enum(DEB_COMPRESSIONS, { error: \"must be one of gzip, none, xz, zstd\" }).optional(),\n fields: textRecord(\"must be a control field value\", \"must be a record of control field names to values\")\n .optional(),\n});\n\nconst rpmSchema = z.strictObject({\n packageName: text(\"must be an RPM package name\").optional(),\n group: text(\"must be an RPM group\").optional(),\n compression: z.enum(RPM_COMPRESSIONS, { error: \"must be one of gzip, lzma, xz, zstd\" }).optional(),\n prefixes: textList(\"prefix\", \"must be an array of relocation prefixes\").optional(),\n});\n\nconst appimageSchema = z.strictObject({\n fileName: text(\"must be an output file name\").optional(),\n compression: z.enum(APPIMAGE_COMPRESSIONS, { error: \"must be one of gzip, xz, zstd\" }).optional(),\n updateInformation: text(\"must be an AppImage update information string\").optional(),\n runtimeFile: text(\"must be a path to an AppImage runtime file\").optional(),\n});\n\nconst flatpakSourceSchema = z.strictObject({\n url: url(\"must be an absolute git URL\").optional(),\n tag: text(\"must be a git tag\").optional(),\n commit: text(\"must be a git commit sha\").optional(),\n});\n\nconst flatpakSchema = z.strictObject({\n mode: z.enum(FLATPAK_MODES, { error: 'must be \"prebuilt\" or \"source\"' }).optional(),\n runtime: text(\"must be a runtime id\").optional(),\n runtimeVersion: text('must be a runtime branch such as \"50\"').optional(),\n sdk: text(\"must be an SDK id\").optional(),\n nodeExtension: text(\"must be a Node SDK extension id\").optional(),\n sdkExtensions: textList(\"SDK extension id\", \"must be an array of SDK extension ids\").optional(),\n base: text(\"must be a base app id\").optional(),\n baseVersion: text(\"must be a base app version\").optional(),\n branch: text(\"must be a branch name\").optional(),\n finishArgs: textList(\"finish argument\", \"must be an array of flatpak finish arguments\").optional(),\n cleanup: textList(\"cleanup pattern\", \"must be an array of cleanup patterns\").optional(),\n buildCommands: textList(\"shell command\", \"must be an array of shell commands\").optional(),\n modules: z.array(z.unknown(), { error: \"must be an array of flatpak module objects\" }).optional(),\n source: flatpakSourceSchema.optional(),\n packageManager: z.enum(PACKAGE_MANAGERS, { error: \"must be one of npm, pnpm, yarn\" }).optional(),\n lockfile: text(\"must be a path to a lockfile\").optional(),\n runtimeRepo: url(\"must be an absolute .flatpakrepo URL\").optional(),\n shouldEmitBundle: flag(BOOLEAN_ERROR).optional(),\n shouldInstall: flag(BOOLEAN_ERROR).optional(),\n shouldUseRofilesFuse: flag(BOOLEAN_ERROR).optional(),\n});\n\nconst debSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n method: z.enum(DEB_SIGN_METHODS, { error: 'must be \"debsign\" or \"dpkg-sig\"' }).optional(),\n type: z.enum(DEB_SIGN_TYPES, { error: \"must be one of archive, maint, origin\" }).optional(),\n signer: text(\"must be a signer name and email\").optional(),\n});\n\nconst rpmSigningSchema = z.strictObject({\n keyFile: text(KEY_FILE_ERROR),\n keyId: text(KEY_ID_ERROR).optional(),\n});\n\nconst flatpakSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n gpgHomeDir: text(\"must be a path to a GPG home directory\").optional(),\n});\n\nconst appimageSigningSchema = z.strictObject({\n gpgKeyId: text(\"must be a GPG key id\"),\n});\n\nconst signingSchema = z.strictObject({\n appimage: appimageSigningSchema.optional(),\n deb: debSigningSchema.optional(),\n flatpak: flatpakSigningSchema.optional(),\n rpm: rpmSigningSchema.optional(),\n});\n\nconst extraRelationsSchema = z.strictObject({\n recommends: relationsSchema.optional(),\n suggests: relationsSchema.optional(),\n provides: relationsSchema.optional(),\n conflicts: relationsSchema.optional(),\n replaces: relationsSchema.optional(),\n breaks: relationsSchema.optional(),\n preDepends: relationsSchema.optional(),\n});\n\nconst deploySchema = z.strictObject({\n targets: z\n .array(z.enum(DEPLOY_TARGET_NAMES, { error: \"must be one of appimage, deb, flatpak, rpm\" }), {\n error: \"must be an array of deploy targets\",\n })\n .optional(),\n outDir: text(\"must be a directory path relative to the project root\").optional(),\n name: text(\"must be the display name shown in the launcher\").optional(),\n genericName: text(\"must be a generic application name\").optional(),\n binaryName: text(\"must be a kebab-case command name\").optional(),\n version: text(VERSION_ERROR).optional(),\n release: text(\"must be a packaging revision\").optional(),\n epoch: z.int({ error: EPOCH_ERROR }).min(0, { error: EPOCH_ERROR }).optional(),\n summary: text(\"must be a single-line summary without a trailing period\").optional(),\n description: textList(\"description paragraph\", \"must be an array of description paragraphs\").optional(),\n keywords: textList(\"search keyword\", \"must be an array of search keywords\").optional(),\n categories: textList(\"freedesktop category\", \"must be an array of freedesktop categories\").optional(),\n mimeTypes: textList(\"MIME type\", \"must be an array of MIME types\").optional(),\n developer: developerSchema.optional(),\n license: text(SPDX_ERROR).optional(),\n licenseFile: text(\"must be a path to a license file\").optional(),\n metadataLicense: text(SPDX_ERROR).optional(),\n copyright: text(\"must be a copyright line\").optional(),\n homepage: url(URL_ERROR).optional(),\n urls: z\n .partialRecord(z.enum(URL_KINDS), url(URL_ERROR), {\n error: \"must be a record of AppStream url kinds to URLs\",\n })\n .optional(),\n screenshots: z.array(screenshotSchema, { error: \"must be an array of screenshots\" }).optional(),\n screenshotBaseUrl: url(\"must be an absolute base URL\").optional(),\n branding: brandingSchema.optional(),\n contentRating: z\n .record(z.string(), z.enum(OARS_INTENSITIES, { error: \"must be one of intense, mild, moderate, none\" }), {\n error: \"must be a record of OARS 1.1 attribute ids to intensities\",\n })\n .optional(),\n releases: z.array(releaseSchema, { error: \"must be an array of releases\" }).optional(),\n execArgs: textList(\"argument\", \"must be an array of arguments appended to Exec\").optional(),\n launcherEnv: launcherEnvSchema.optional(),\n nodeFlags: nodeFlagsSchema.optional(),\n fileAssociations: z\n .array(fileAssociationSchema, { error: \"must be an array of file associations\" })\n .optional(),\n protocols: textList(\"URL scheme\", \"must be an array of URL schemes\").optional(),\n desktopActions: z\n .record(z.string(), desktopActionSchema, { error: \"must be a record of action ids to actions\" })\n .optional(),\n desktopEntry: textRecord(\"must be a desktop entry value\", \"must be a record of desktop entry keys to values\")\n .optional(),\n metainfoExtra: textList(\"AppStream XML fragment\", \"must be an array of AppStream XML fragments\").optional(),\n isDbusActivatable: flag(BOOLEAN_ERROR).optional(),\n extraFiles: relativePathRecord(\n \"must be a destination path inside the install prefix, without a leading slash or a .. segment\",\n extraFileEntrySchema,\n \"must be a record of prefix-relative destinations to source paths or { source, mode } entries\",\n ).optional(),\n minimumLibraryVersions: minimumLibraryVersionsSchema.optional(),\n depends: relationsSchema.optional(),\n relations: extraRelationsSchema.optional(),\n scripts: scriptsSchema.optional(),\n node: nodeRuntimeSchema.optional(),\n signing: signingSchema.optional(),\n appimage: appimageSchema.optional(),\n deb: debSchema.optional(),\n flatpak: flatpakSchema.optional(),\n rpm: rpmSchema.optional(),\n});\n\nexport { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };\n"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export { type Config, defineConfig, mergeConfig, type ResolvedConfig } from "./config.ts";
2
+ export { type DeployExtraFileOptions, type DeployNodeOptions } from "./deploy.ts";
2
3
  export { type ConfigLoader, type LoadedConfig, loadConfig } from "./loader.ts";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { defineConfig, mergeConfig } from "./config.js";
2
+ export {} from "./deploy.js";
2
3
  export { loadConfig } from "./loader.js";
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAwC,UAAU,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { type Config, defineConfig, mergeConfig, type ResolvedConfig } from \"./config.ts\";\nexport { type ConfigLoader, type LoadedConfig, loadConfig } from \"./loader.ts\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,WAAW,EAAuB,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAuD,MAAM,aAAa,CAAC;AAClF,OAAO,EAAwC,UAAU,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { type Config, defineConfig, mergeConfig, type ResolvedConfig } from \"./config.ts\";\nexport { type DeployExtraFileOptions, type DeployNodeOptions } from \"./deploy.ts\";\nexport { type ConfigLoader, type LoadedConfig, loadConfig } from \"./loader.ts\";\n"]}
@@ -1,3 +1,4 @@
1
+ export { configDependenciesFor } from "./config-dependencies.ts";
1
2
  export type { McpSettings, ResolvedReactCompilerOptions } from "./config.ts";
2
3
  export { APPLICATION_ID_MAX_LENGTH, isAgentReferenceEnabled, isAgentRulesEnabled, isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveMcpSettings, resolveOmittedProps, } from "./config.ts";
3
4
  export { createConfigLoader } from "./loader.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
package/dist/internal.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { configDependenciesFor } from "./config-dependencies.js";
1
2
  export { APPLICATION_ID_MAX_LENGTH, isAgentReferenceEnabled, isAgentRulesEnabled, isValidApplicationId, resolveElementComponents, resolveElementProps, resolveLazyElements, resolveMcpSettings, resolveOmittedProps, } from "./config.js";
2
3
  export { createConfigLoader } from "./loader.js";
3
4
  export { assertSupportedNodeVersion, MINIMUM_NODE_VERSION } from "./node-version.js";
@@ -1 +1 @@
1
- {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AACA,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export type { McpSettings, ResolvedReactCompilerOptions } from \"./config.ts\";\nexport {\n APPLICATION_ID_MAX_LENGTH,\n isAgentReferenceEnabled,\n isAgentRulesEnabled,\n isValidApplicationId,\n resolveElementComponents,\n resolveElementProps,\n resolveLazyElements,\n resolveMcpSettings,\n resolveOmittedProps,\n} from \"./config.ts\";\nexport { createConfigLoader } from \"./loader.ts\";\nexport { assertSupportedNodeVersion, MINIMUM_NODE_VERSION } from \"./node-version.ts\";\nexport { resourceBasePath } from \"./resource-base-path.ts\";\n"]}
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EACH,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { configDependenciesFor } from \"./config-dependencies.ts\";\nexport type { McpSettings, ResolvedReactCompilerOptions } from \"./config.ts\";\nexport {\n APPLICATION_ID_MAX_LENGTH,\n isAgentReferenceEnabled,\n isAgentRulesEnabled,\n isValidApplicationId,\n resolveElementComponents,\n resolveElementProps,\n resolveLazyElements,\n resolveMcpSettings,\n resolveOmittedProps,\n} from \"./config.ts\";\nexport { createConfigLoader } from \"./loader.ts\";\nexport { assertSupportedNodeVersion, MINIMUM_NODE_VERSION } from \"./node-version.ts\";\nexport { resourceBasePath } from \"./resource-base-path.ts\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,MAAM,EAGX,KAAK,cAAc,EAEtB,MAAM,aAAa,CAAC;AAGrB,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,CAA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AAEtD,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;AA8EF;;;;;GAKG;AACH,QAAA,MAAM,UAAU,GAAU,KAAK,MAAM,EAAE,UAAS,iBAAsB,KAAG,OAAO,CAAC,YAAY,CAkD5F,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,UAAS,iBAAsB,KAAG,YAkB7D,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,CAAC"}
package/dist/loader.js CHANGED
@@ -1,12 +1,44 @@
1
1
  import { isPathInside, warn } from "@gtkx/utils";
2
2
  import { loadConfig as loadConfigFile } from "c12";
3
3
  import { existsSync } from "node:fs";
4
- import { resolve } from "node:path";
4
+ import { basename, extname, isAbsolute, relative, resolve } from "node:path";
5
+ import { captureConfigDependencies, setConfigDependencies, transformConfigModule, } from "./config-dependencies.js";
5
6
  import { missingConfigFileError } from "./config-error.js";
6
7
  import { graduatedFutureKeys, resolveConfig, validateConfig, } from "./config.js";
7
8
  import { assertSupportedNodeVersion } from "./node-version.js";
8
9
  const GRADUATED_FUTURE_ENV = "GTKX_GRADUATED_FUTURE_SHOWN";
9
10
  const graduatedFutureWarnings = new Map();
11
+ const isLocalConfigSource = (source) => source.startsWith(".") || isAbsolute(source);
12
+ const isDirectoryConfigSource = (source) => {
13
+ const extension = extname(source);
14
+ return extension.length === 0 || extension === basename(source);
15
+ };
16
+ const localConfigSourcePath = (source, options) => {
17
+ if (source === "." || !isLocalConfigSource(source)) {
18
+ return undefined;
19
+ }
20
+ const cwd = options.cwd ?? process.cwd();
21
+ return isDirectoryConfigSource(source)
22
+ ? resolve(cwd, source, options.configFile ?? "gtkx.config")
23
+ : resolve(cwd, source);
24
+ };
25
+ const rejectMissingLocalConfig = (source, options) => {
26
+ const path = localConfigSourcePath(source, options);
27
+ if (path !== undefined && !existsSync(path)) {
28
+ throw new Error(`Extended configuration does not exist at ${path}`);
29
+ }
30
+ };
31
+ const withConfigDependencies = (dependencies, operation) => {
32
+ try {
33
+ return operation();
34
+ }
35
+ catch (error) {
36
+ if (typeof error === "object" && error !== null) {
37
+ setConfigDependencies(error, dependencies);
38
+ }
39
+ throw error;
40
+ }
41
+ };
10
42
  const selectedConfigFile = (root, configured) => {
11
43
  if (configured === undefined) {
12
44
  return undefined;
@@ -15,7 +47,7 @@ const selectedConfigFile = (root, configured) => {
15
47
  if (!isPathInside(root, path)) {
16
48
  throw new Error(`Configuration file ${configured} must be inside the project root ${root}`);
17
49
  }
18
- return path;
50
+ return relative(root, path);
19
51
  };
20
52
  const warnGraduatedFuture = (config, root) => {
21
53
  const keys = graduatedFutureKeys(config);
@@ -39,29 +71,45 @@ const loadConfig = async (cwd, options = {}) => {
39
71
  assertSupportedNodeVersion();
40
72
  const searched = resolve(cwd);
41
73
  const requestedConfigFile = selectedConfigFile(searched, options.configFile);
42
- const result = await loadConfigFile({
74
+ const captured = await captureConfigDependencies(() => loadConfigFile({
43
75
  name: "gtkx",
44
76
  cwd: searched,
45
77
  rcFile: false,
46
78
  globalRc: false,
47
79
  packageJson: false,
48
80
  context: { mode: options.mode },
81
+ jitiOptions: { fsCache: false, transform: transformConfigModule },
82
+ resolve: rejectMissingLocalConfig,
49
83
  ...(requestedConfigFile !== undefined && { configFile: requestedConfigFile }),
50
84
  ...((options.mode !== undefined) && { envName: options.mode }),
51
- });
85
+ }));
86
+ const result = captured.value;
52
87
  const configFile = result.configFile;
53
- if (configFile === undefined || !existsSync(resolve(searched, configFile))) {
54
- throw missingConfigFileError(searched, requestedConfigFile);
55
- }
56
- const config = result.config;
57
88
  const root = result.cwd ?? searched;
58
- validateConfig(config, configFile);
59
- warnGraduatedFuture(config, root);
60
- return {
61
- config,
62
- configFile,
63
- root,
64
- };
89
+ const layerFiles = (result.layers ?? [])
90
+ .flatMap((layer) => layer.configFile === undefined
91
+ ? []
92
+ : [resolve(layer.cwd ?? root, layer.configFile)]);
93
+ const dependencies = [
94
+ ...(configFile === undefined ? [] : [configFile]),
95
+ ...layerFiles,
96
+ ...captured.dependencies,
97
+ ];
98
+ return withConfigDependencies(dependencies, () => {
99
+ if (configFile === undefined || !existsSync(resolve(searched, configFile))) {
100
+ throw missingConfigFileError(searched, requestedConfigFile);
101
+ }
102
+ const config = result.config;
103
+ validateConfig(config, configFile);
104
+ warnGraduatedFuture(config, root);
105
+ const loaded = {
106
+ config,
107
+ configFile,
108
+ root,
109
+ };
110
+ setConfigDependencies(loaded, dependencies);
111
+ return loaded;
112
+ });
65
113
  };
66
114
  const createConfigLoader = (options = {}) => {
67
115
  assertSupportedNodeVersion();
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAEH,mBAAmB,EACnB,aAAa,EAEb,cAAc,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA6B/D,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAC3D,MAAM,uBAAuB,GAAwB,IAAI,GAAG,EAAE,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,UAA8B,EAAsB,EAAE;IAC5F,IAAI,UAAU,KAAK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,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAElF,MAAM,SAAS,GAAG,KAAK,EAAE,IAAY,EAA2B,EAAE;QAC9D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtD,OAAO,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF,OAAO;QACH,IAAI;QACJ,OAAO,EAAE,CAAC,GAAW,EAA2B,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;KAC3G,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAwC,CAAC","sourcesContent":["import { isPathInside, warn } from \"@gtkx/utils\";\nimport { loadConfig as loadConfigFile } from \"c12\";\nimport { existsSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { missingConfigFileError } from \"./config-error.ts\";\nimport {\n type Config,\n graduatedFutureKeys,\n resolveConfig,\n type ResolvedConfig,\n validateConfig,\n} from \"./config.ts\";\nimport { assertSupportedNodeVersion } from \"./node-version.ts\";\n\n/** Result of loading a project's `gtkx.config.ts` file. */\ntype LoadedConfig = {\n /** The parsed and validated configuration. */\n config: Config;\n /** Absolute path of the configuration file that was loaded. */\n configFile: string;\n /** Absolute path of the project root the configuration was resolved against. */\n root: string;\n};\n\n/** How a configuration file is read, shared by {@link loadConfig} and `createConfigLoader`. */\ntype LoadConfigOptions = {\n /**\n * Environment name such as `development`: the config's matching `$<mode>` block is layered over the\n * top-level values, and the name is passed to a config authored as a function.\n */\n mode?: string | undefined;\n} & Partial<Record<\"configFile\", string | undefined>>;\n\n/** Reads a project's configuration once per directory, caching what it loads and what it resolves. */\ntype ConfigLoader = {\n /** Loads the configuration file the given directory resolves to, as {@link loadConfig} does. */\n load: (cwd: string) => Promise<LoadedConfig>;\n /** Loads the configuration for the given directory and reduces it to what the build and the app need. */\n resolve: (cwd: string) => Promise<ResolvedConfig>;\n};\n\nconst GRADUATED_FUTURE_ENV = \"GTKX_GRADUATED_FUTURE_SHOWN\";\nconst graduatedFutureWarnings: Map<string, string> = new Map();\n\nconst selectedConfigFile = (root: string, configured: string | undefined): string | undefined => {\n if (configured === undefined) {\n return undefined;\n }\n\n const path = resolve(root, configured);\n\n if (!isPathInside(root, path)) {\n throw new Error(`Configuration file ${configured} must be inside the project root ${root}`);\n }\n\n return path;\n};\n\nconst warnGraduatedFuture = (config: unknown, root: string): void => {\n const keys = graduatedFutureKeys(config);\n const signature = keys.join(\",\");\n\n if (\n keys.length === 0 ||\n graduatedFutureWarnings.get(root) === signature ||\n process.env[GRADUATED_FUTURE_ENV] === signature\n ) {\n return;\n }\n\n graduatedFutureWarnings.set(root, signature);\n process.env[GRADUATED_FUTURE_ENV] = signature;\n warn(`GTKX 2 ignores graduated future flags: ${keys.join(\", \")}. Remove them from gtkx.config.ts.`);\n};\n\n/**\n * Loads and validates the `gtkx.config.ts` file for a project.\n * @param cwd Directory the configuration file is looked up in; parent directories are not searched.\n * @param options Loading options, such as the environment mode whose overrides are applied.\n * @throws When that directory holds no configuration file, or when the configuration fails validation.\n */\nconst loadConfig = async (cwd: string, options: LoadConfigOptions = {}): Promise<LoadedConfig> => {\n assertSupportedNodeVersion();\n const searched = resolve(cwd);\n const requestedConfigFile = selectedConfigFile(searched, options.configFile);\n\n const result = await loadConfigFile<Config>({\n name: \"gtkx\",\n cwd: searched,\n rcFile: false,\n globalRc: false,\n packageJson: false,\n context: { mode: options.mode },\n ...(requestedConfigFile !== undefined && { configFile: requestedConfigFile }),\n ...((options.mode !== undefined) && { envName: options.mode }),\n });\n\n const configFile = result.configFile;\n\n if (configFile === undefined || !existsSync(resolve(searched, configFile))) {\n throw missingConfigFileError(searched, requestedConfigFile);\n }\n\n const config = result.config;\n const root = result.cwd ?? searched;\n validateConfig(config, configFile);\n warnGraduatedFuture(config, root);\n\n return {\n config,\n configFile,\n root,\n };\n};\n\nconst createConfigLoader = (options: LoadConfigOptions = {}): ConfigLoader => {\n assertSupportedNodeVersion();\n const loaded: Map<string, Promise<LoadedConfig>> = new Map();\n const resolved: Map<string, Promise<ResolvedConfig>> = new Map();\n\n const load = (cwd: string): Promise<LoadedConfig> =>\n loaded.getOrInsertComputed(resolve(cwd), (root) => loadConfig(root, options));\n\n const resolveAt = async (root: string): Promise<ResolvedConfig> => {\n const { config, root: configRoot } = await load(root);\n\n return resolveConfig(config, configRoot);\n };\n\n return {\n load,\n resolve: (cwd: string): Promise<ResolvedConfig> => resolved.getOrInsertComputed(resolve(cwd), resolveAt),\n };\n};\n\nexport { loadConfig, createConfigLoader, type LoadedConfig, type ConfigLoader };\n"]}
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7E,OAAO,EACH,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAEH,mBAAmB,EACnB,aAAa,EAEb,cAAc,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AA6B/D,MAAM,oBAAoB,GAAG,6BAA6B,CAAC;AAC3D,MAAM,uBAAuB,GAAwB,IAAI,GAAG,EAAE,CAAC;AAI/D,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAW,EAAE,CAAC,MA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M,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QAEtD,OAAO,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC,CAAC;IAEF,OAAO;QACH,IAAI;QACJ,OAAO,EAAE,CAAC,GAAW,EAA2B,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;KAC3G,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAwC,CAAC","sourcesContent":["import { isPathInside, warn } from \"@gtkx/utils\";\nimport { loadConfig as loadConfigFile } from \"c12\";\nimport { existsSync } from \"node:fs\";\nimport { basename, extname, isAbsolute, relative, resolve } from \"node:path\";\nimport {\n captureConfigDependencies,\n setConfigDependencies,\n transformConfigModule,\n} from \"./config-dependencies.ts\";\nimport { missingConfigFileError } from \"./config-error.ts\";\nimport {\n type Config,\n graduatedFutureKeys,\n resolveConfig,\n type ResolvedConfig,\n validateConfig,\n} from \"./config.ts\";\nimport { assertSupportedNodeVersion } from \"./node-version.ts\";\n\n/** Result of loading a project's `gtkx.config.ts` file. */\ntype LoadedConfig = {\n /** The parsed and validated configuration. */\n config: Config;\n /** Absolute path of the configuration file that was loaded. */\n configFile: string;\n /** Absolute path of the project root the configuration was resolved against. */\n root: string;\n};\n\n/** How a configuration file is read, shared by {@link loadConfig} and `createConfigLoader`. */\ntype LoadConfigOptions = {\n /**\n * Environment name such as `development`: the config's matching `$<mode>` block is layered over the\n * top-level values, and the name is passed to a config authored as a function.\n */\n mode?: string | undefined;\n} & Partial<Record<\"configFile\", string | undefined>>;\n\n/** Reads a project's configuration once per directory, caching what it loads and what it resolves. */\ntype ConfigLoader = {\n /** Loads the configuration file the given directory resolves to, as {@link loadConfig} does. */\n load: (cwd: string) => Promise<LoadedConfig>;\n /** Loads the configuration for the given directory and reduces it to what the build and the app need. */\n resolve: (cwd: string) => Promise<ResolvedConfig>;\n};\n\nconst GRADUATED_FUTURE_ENV = \"GTKX_GRADUATED_FUTURE_SHOWN\";\nconst graduatedFutureWarnings: Map<string, string> = new Map();\n\ntype ConfigResolutionOptions = { configFile?: string | undefined; cwd?: string | undefined };\n\nconst isLocalConfigSource = (source: string): boolean => source.startsWith(\".\") || isAbsolute(source);\n\nconst isDirectoryConfigSource = (source: string): boolean => {\n const extension = extname(source);\n\n return extension.length === 0 || extension === basename(source);\n};\n\nconst localConfigSourcePath = (source: string, options: ConfigResolutionOptions): string | undefined => {\n if (source === \".\" || !isLocalConfigSource(source)) {\n return undefined;\n }\n\n const cwd = options.cwd ?? process.cwd();\n\n return isDirectoryConfigSource(source)\n ? resolve(cwd, source, options.configFile ?? \"gtkx.config\")\n : resolve(cwd, source);\n};\n\nconst rejectMissingLocalConfig = (source: string, options: ConfigResolutionOptions): undefined => {\n const path = localConfigSourcePath(source, options);\n\n if (path !== undefined && !existsSync(path)) {\n throw new Error(`Extended configuration does not exist at ${path}`);\n }\n};\n\nconst withConfigDependencies = <T>(dependencies: string[], operation: () => T): T => {\n try {\n return operation();\n } catch (error) {\n if (typeof error === \"object\" && error !== null) {\n setConfigDependencies(error, dependencies);\n }\n\n throw error;\n }\n};\n\nconst selectedConfigFile = (root: string, configured: string | undefined): string | undefined => {\n if (configured === undefined) {\n return undefined;\n }\n\n const path = resolve(root, configured);\n\n if (!isPathInside(root, path)) {\n throw new Error(`Configuration file ${configured} must be inside the project root ${root}`);\n }\n\n return relative(root, path);\n};\n\nconst warnGraduatedFuture = (config: unknown, root: string): void => {\n const keys = graduatedFutureKeys(config);\n const signature = keys.join(\",\");\n\n if (\n keys.length === 0 ||\n graduatedFutureWarnings.get(root) === signature ||\n process.env[GRADUATED_FUTURE_ENV] === signature\n ) {\n return;\n }\n\n graduatedFutureWarnings.set(root, signature);\n process.env[GRADUATED_FUTURE_ENV] = signature;\n warn(`GTKX 2 ignores graduated future flags: ${keys.join(\", \")}. Remove them from gtkx.config.ts.`);\n};\n\n/**\n * Loads and validates the `gtkx.config.ts` file for a project.\n * @param cwd Directory the configuration file is looked up in; parent directories are not searched.\n * @param options Loading options, such as the environment mode whose overrides are applied.\n * @throws When that directory holds no configuration file, or when the configuration fails validation.\n */\nconst loadConfig = async (cwd: string, options: LoadConfigOptions = {}): Promise<LoadedConfig> => {\n assertSupportedNodeVersion();\n const searched = resolve(cwd);\n const requestedConfigFile = selectedConfigFile(searched, options.configFile);\n\n const captured = await captureConfigDependencies(() =>\n loadConfigFile<Config>({\n name: \"gtkx\",\n cwd: searched,\n rcFile: false,\n globalRc: false,\n packageJson: false,\n context: { mode: options.mode },\n jitiOptions: { fsCache: false, transform: transformConfigModule },\n resolve: rejectMissingLocalConfig,\n ...(requestedConfigFile !== undefined && { configFile: requestedConfigFile }),\n ...((options.mode !== undefined) && { envName: options.mode }),\n }));\n const result = captured.value;\n\n const configFile = result.configFile;\n const root = result.cwd ?? searched;\n const layerFiles = (result.layers ?? [])\n .flatMap((layer) => layer.configFile === undefined\n ? []\n : [resolve(layer.cwd ?? root, layer.configFile)]);\n const dependencies = [\n ...(configFile === undefined ? [] : [configFile]),\n ...layerFiles,\n ...captured.dependencies,\n ];\n\n return withConfigDependencies(dependencies, () => {\n if (configFile === undefined || !existsSync(resolve(searched, configFile))) {\n throw missingConfigFileError(searched, requestedConfigFile);\n }\n\n const config = result.config;\n validateConfig(config, configFile);\n warnGraduatedFuture(config, root);\n\n const loaded = {\n config,\n configFile,\n root,\n };\n setConfigDependencies(loaded, dependencies);\n\n return loaded;\n });\n};\n\nconst createConfigLoader = (options: LoadConfigOptions = {}): ConfigLoader => {\n assertSupportedNodeVersion();\n const loaded: Map<string, Promise<LoadedConfig>> = new Map();\n const resolved: Map<string, Promise<ResolvedConfig>> = new Map();\n\n const load = (cwd: string): Promise<LoadedConfig> =>\n loaded.getOrInsertComputed(resolve(cwd), (root) => loadConfig(root, options));\n\n const resolveAt = async (root: string): Promise<ResolvedConfig> => {\n const { config, root: configRoot } = await load(root);\n\n return resolveConfig(config, configRoot);\n };\n\n return {\n load,\n resolve: (cwd: string): Promise<ResolvedConfig> => resolved.getOrInsertComputed(resolve(cwd), resolveAt),\n };\n};\n\nexport { loadConfig, createConfigLoader, type LoadedConfig, type ConfigLoader };\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtkx/config",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Config schema, loader, and element-prop mapping for the GTK toolchain.",
5
5
  "keywords": [
6
6
  "gtkx",
@@ -64,9 +64,10 @@
64
64
  "node": ">=26.7.0"
65
65
  },
66
66
  "dependencies": {
67
- "@gtkx/utils": "2.0.0-beta.3",
67
+ "@gtkx/utils": "2.0.0-beta.5",
68
68
  "c12": "^3.3.4",
69
69
  "defu": "^6.1.7",
70
+ "jiti": "^2.7.0",
70
71
  "vite": "^8.2.2",
71
72
  "zod": "^4.5.4"
72
73
  },
@@ -0,0 +1,114 @@
1
+ import { createJiti, type Jiti, type TransformOptions, type TransformResult } from "jiti";
2
+ import { AsyncLocalStorage } from "node:async_hooks";
3
+ import { createRequire, registerHooks } from "node:module";
4
+ import { extname, sep } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ type CaptureState = { cacheKey: string; dependencies: Set<string>; transformer: Jiti };
8
+ type CapturedConfig<T> = { dependencies: string[]; value: T };
9
+
10
+ const captureStorage: AsyncLocalStorage<CaptureState> = new AsyncLocalStorage();
11
+ const dependenciesByValue: WeakMap<object, string[]> = new WeakMap();
12
+ const CACHE_BUSTED_EXTENSIONS: ReadonlySet<string> = new Set([".cjs", ".js", ".json", ".mjs"]);
13
+
14
+ const isTrackedPath = (path: string): boolean => !path.includes(`${sep}node_modules${sep}`);
15
+
16
+ const addPath = (path: string): void => {
17
+ if (isTrackedPath(path)) {
18
+ captureStorage.getStore()?.dependencies.add(path);
19
+ }
20
+ };
21
+
22
+ const addUrl = (url: string): void => {
23
+ if (url.startsWith("file:")) {
24
+ addPath(fileURLToPath(url));
25
+ }
26
+ };
27
+
28
+ const cacheBustedUrl = (url: string): string => {
29
+ if (!url.startsWith("file:")) {
30
+ return url;
31
+ }
32
+
33
+ const path = fileURLToPath(url);
34
+
35
+ if (!isTrackedPath(path) || !CACHE_BUSTED_EXTENSIONS.has(extname(path))) {
36
+ return url;
37
+ }
38
+
39
+ const parsed = new URL(url);
40
+ parsed.searchParams.set("gtkx-config-load", captureStorage.getStore()?.cacheKey ?? "uncaptured");
41
+
42
+ return parsed.href;
43
+ };
44
+
45
+ const registerResolutionHook = (): ReturnType<typeof registerHooks> =>
46
+ registerHooks({
47
+ resolve(specifier, context, nextResolve) {
48
+ const result = nextResolve(specifier, context);
49
+ addUrl(result.url);
50
+
51
+ return { ...result, url: cacheBustedUrl(result.url) };
52
+ },
53
+ });
54
+
55
+ const clearNativeModuleCache = (dependencies: Iterable<string>): void => {
56
+ const cache = createRequire(import.meta.url).cache;
57
+
58
+ for (const path of dependencies) {
59
+ Reflect.deleteProperty(cache, path);
60
+ }
61
+ };
62
+
63
+ const transformConfigModule = (options: TransformOptions): TransformResult => {
64
+ const state = captureStorage.getStore();
65
+
66
+ if (state === undefined) {
67
+ throw new Error("Configuration transformation started outside a dependency capture");
68
+ }
69
+
70
+ if (options.filename !== undefined) {
71
+ addPath(options.filename);
72
+ }
73
+
74
+ return { code: state.transformer.transform(options) };
75
+ };
76
+
77
+ const setConfigDependencies = (value: object, dependencies: Iterable<string>): void => {
78
+ const paths = [...new Set(dependencies)];
79
+ dependenciesByValue.set(value, paths);
80
+ clearNativeModuleCache(paths);
81
+ };
82
+
83
+ const configDependenciesFor = (value: unknown): string[] =>
84
+ typeof value === "object" && value !== null ? dependenciesByValue.get(value) ?? [] : [];
85
+
86
+ const captureConfigDependencies = async <T>(operation: () => Promise<T>): Promise<CapturedConfig<T>> => {
87
+ const state: CaptureState = {
88
+ cacheKey: process.hrtime.bigint().toString(),
89
+ dependencies: new Set(),
90
+ transformer: createJiti(import.meta.url, { fsCache: false, moduleCache: false }),
91
+ };
92
+ const hook = registerResolutionHook();
93
+
94
+ try {
95
+ const value = await captureStorage.run(state, operation);
96
+
97
+ return { dependencies: [...state.dependencies], value };
98
+ } catch (error) {
99
+ if (typeof error === "object" && error !== null) {
100
+ setConfigDependencies(error, state.dependencies);
101
+ }
102
+
103
+ throw error;
104
+ } finally {
105
+ hook.deregister();
106
+ }
107
+ };
108
+
109
+ export {
110
+ captureConfigDependencies,
111
+ configDependenciesFor,
112
+ setConfigDependencies,
113
+ transformConfigModule,
114
+ };
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- const DEFAULT_CONFIG_FILE = "gtkx.config.ts";
3
+ const DEFAULT_CONFIG_FILE = "gtkx.config.*";
4
4
 
5
5
  const isRecord = (value: unknown): value is Record<string, unknown> =>
6
6
  typeof value === "object" && value !== null && !Array.isArray(value);
@@ -10,7 +10,7 @@ const configPrefix = (configFile: string): string => `${configFile}:`;
10
10
  const missingConfigFileError = (cwd: string, configFile?: string): Error =>
11
11
  new Error(configFile === undefined
12
12
  ? `${configPrefix(DEFAULT_CONFIG_FILE)} no configuration file found in ${cwd}`
13
- : `${configPrefix(configFile)} no configuration file found`);
13
+ : `${configPrefix(configFile)} no configuration file found in ${cwd}`);
14
14
 
15
15
  const configError = (error: z.ZodError, configFile = DEFAULT_CONFIG_FILE): Error =>
16
16
  new Error(`${configPrefix(configFile)}\n${z.prettifyError(error)}`);
package/src/deploy.ts CHANGED
@@ -116,7 +116,15 @@ const brandingSchema = z.strictObject({
116
116
  dark: hexColorSchema,
117
117
  });
118
118
 
119
- const extraFileSchema = z.strictObject({
119
+ /**
120
+ * A `deploy.extraFiles` entry in object form: the source file, resolved against the project root, that is
121
+ * installed at the entry's prefix-relative destination, and the octal mode it is installed with.
122
+ */
123
+ type DeployExtraFileOptions = Record<"source", string> & {
124
+ /** Octal file mode. Setuid and setgid bits are rejected. */
125
+ mode?: string | undefined;
126
+ };
127
+ const extraFileSchema: z.ZodType<DeployExtraFileOptions> = z.strictObject({
120
128
  source: text(SOURCE_PATH_ERROR),
121
129
  mode: z
122
130
  .string({ error: FILE_MODE_ERROR })
@@ -142,7 +150,19 @@ const nodeFlagsSchema = z.array(
142
150
  { error: "must be an array of Node.js flags" },
143
151
  );
144
152
 
145
- const nodeRuntimeSchema = z.strictObject({
153
+ /**
154
+ * The `deploy.node` options: where the Node.js runtime bundled with the application comes from, the version it
155
+ * is expected to be, whether its binary is stripped, and whether the launcher enables the compile cache.
156
+ */
157
+ type DeployNodeOptions = Partial<
158
+ Record<"source", "download" | "host" | "path" | undefined> &
159
+ Record<"path", string | undefined> &
160
+ Record<"shouldStrip" | "shouldUseCompileCache", boolean | undefined>
161
+ > & {
162
+ /** Expected Node.js version. Downloaded runtimes default to exactly 26.7.0 when omitted. */
163
+ version?: string | undefined;
164
+ };
165
+ const nodeRuntimeSchema: z.ZodType<DeployNodeOptions> = z.strictObject({
146
166
  source: z.enum(NODE_SOURCES, { error: "must be one of download, host, path" }).optional(),
147
167
  version: text("must be a Node.js version such as 26.7.0").optional(),
148
168
  path: text("must be a path to a node binary").optional(),
@@ -317,4 +337,4 @@ const deploySchema = z.strictObject({
317
337
  rpm: rpmSchema.optional(),
318
338
  });
319
339
 
320
- export { deploySchema };
340
+ export { deploySchema, type DeployExtraFileOptions, type DeployNodeOptions };
package/src/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { type Config, defineConfig, mergeConfig, type ResolvedConfig } from "./config.ts";
2
+ export { type DeployExtraFileOptions, type DeployNodeOptions } from "./deploy.ts";
2
3
  export { type ConfigLoader, type LoadedConfig, loadConfig } from "./loader.ts";
package/src/internal.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { configDependenciesFor } from "./config-dependencies.ts";
1
2
  export type { McpSettings, ResolvedReactCompilerOptions } from "./config.ts";
2
3
  export {
3
4
  APPLICATION_ID_MAX_LENGTH,
package/src/loader.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  import { isPathInside, warn } from "@gtkx/utils";
2
2
  import { loadConfig as loadConfigFile } from "c12";
3
3
  import { existsSync } from "node:fs";
4
- import { resolve } from "node:path";
4
+ import { basename, extname, isAbsolute, relative, resolve } from "node:path";
5
+ import {
6
+ captureConfigDependencies,
7
+ setConfigDependencies,
8
+ transformConfigModule,
9
+ } from "./config-dependencies.ts";
5
10
  import { missingConfigFileError } from "./config-error.ts";
6
11
  import {
7
12
  type Config,
@@ -42,6 +47,48 @@ type ConfigLoader = {
42
47
  const GRADUATED_FUTURE_ENV = "GTKX_GRADUATED_FUTURE_SHOWN";
43
48
  const graduatedFutureWarnings: Map<string, string> = new Map();
44
49
 
50
+ type ConfigResolutionOptions = { configFile?: string | undefined; cwd?: string | undefined };
51
+
52
+ const isLocalConfigSource = (source: string): boolean => source.startsWith(".") || isAbsolute(source);
53
+
54
+ const isDirectoryConfigSource = (source: string): boolean => {
55
+ const extension = extname(source);
56
+
57
+ return extension.length === 0 || extension === basename(source);
58
+ };
59
+
60
+ const localConfigSourcePath = (source: string, options: ConfigResolutionOptions): string | undefined => {
61
+ if (source === "." || !isLocalConfigSource(source)) {
62
+ return undefined;
63
+ }
64
+
65
+ const cwd = options.cwd ?? process.cwd();
66
+
67
+ return isDirectoryConfigSource(source)
68
+ ? resolve(cwd, source, options.configFile ?? "gtkx.config")
69
+ : resolve(cwd, source);
70
+ };
71
+
72
+ const rejectMissingLocalConfig = (source: string, options: ConfigResolutionOptions): undefined => {
73
+ const path = localConfigSourcePath(source, options);
74
+
75
+ if (path !== undefined && !existsSync(path)) {
76
+ throw new Error(`Extended configuration does not exist at ${path}`);
77
+ }
78
+ };
79
+
80
+ const withConfigDependencies = <T>(dependencies: string[], operation: () => T): T => {
81
+ try {
82
+ return operation();
83
+ } catch (error) {
84
+ if (typeof error === "object" && error !== null) {
85
+ setConfigDependencies(error, dependencies);
86
+ }
87
+
88
+ throw error;
89
+ }
90
+ };
91
+
45
92
  const selectedConfigFile = (root: string, configured: string | undefined): string | undefined => {
46
93
  if (configured === undefined) {
47
94
  return undefined;
@@ -53,7 +100,7 @@ const selectedConfigFile = (root: string, configured: string | undefined): strin
53
100
  throw new Error(`Configuration file ${configured} must be inside the project root ${root}`);
54
101
  }
55
102
 
56
- return path;
103
+ return relative(root, path);
57
104
  };
58
105
 
59
106
  const warnGraduatedFuture = (config: unknown, root: string): void => {
@@ -84,33 +131,51 @@ const loadConfig = async (cwd: string, options: LoadConfigOptions = {}): Promise
84
131
  const searched = resolve(cwd);
85
132
  const requestedConfigFile = selectedConfigFile(searched, options.configFile);
86
133
 
87
- const result = await loadConfigFile<Config>({
88
- name: "gtkx",
89
- cwd: searched,
90
- rcFile: false,
91
- globalRc: false,
92
- packageJson: false,
93
- context: { mode: options.mode },
94
- ...(requestedConfigFile !== undefined && { configFile: requestedConfigFile }),
95
- ...((options.mode !== undefined) && { envName: options.mode }),
96
- });
134
+ const captured = await captureConfigDependencies(() =>
135
+ loadConfigFile<Config>({
136
+ name: "gtkx",
137
+ cwd: searched,
138
+ rcFile: false,
139
+ globalRc: false,
140
+ packageJson: false,
141
+ context: { mode: options.mode },
142
+ jitiOptions: { fsCache: false, transform: transformConfigModule },
143
+ resolve: rejectMissingLocalConfig,
144
+ ...(requestedConfigFile !== undefined && { configFile: requestedConfigFile }),
145
+ ...((options.mode !== undefined) && { envName: options.mode }),
146
+ }));
147
+ const result = captured.value;
97
148
 
98
149
  const configFile = result.configFile;
99
-
100
- if (configFile === undefined || !existsSync(resolve(searched, configFile))) {
101
- throw missingConfigFileError(searched, requestedConfigFile);
102
- }
103
-
104
- const config = result.config;
105
150
  const root = result.cwd ?? searched;
106
- validateConfig(config, configFile);
107
- warnGraduatedFuture(config, root);
108
-
109
- return {
110
- config,
111
- configFile,
112
- root,
113
- };
151
+ const layerFiles = (result.layers ?? [])
152
+ .flatMap((layer) => layer.configFile === undefined
153
+ ? []
154
+ : [resolve(layer.cwd ?? root, layer.configFile)]);
155
+ const dependencies = [
156
+ ...(configFile === undefined ? [] : [configFile]),
157
+ ...layerFiles,
158
+ ...captured.dependencies,
159
+ ];
160
+
161
+ return withConfigDependencies(dependencies, () => {
162
+ if (configFile === undefined || !existsSync(resolve(searched, configFile))) {
163
+ throw missingConfigFileError(searched, requestedConfigFile);
164
+ }
165
+
166
+ const config = result.config;
167
+ validateConfig(config, configFile);
168
+ warnGraduatedFuture(config, root);
169
+
170
+ const loaded = {
171
+ config,
172
+ configFile,
173
+ root,
174
+ };
175
+ setConfigDependencies(loaded, dependencies);
176
+
177
+ return loaded;
178
+ });
114
179
  };
115
180
 
116
181
  const createConfigLoader = (options: LoadConfigOptions = {}): ConfigLoader => {