@skathi-native/cli 0.1.0-beta.1 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/aot/host-globals.json +105 -0
  2. package/aot/native.ts +142 -0
  3. package/aot/pin.ts +67 -0
  4. package/aot/toolchain.lock.json +17 -0
  5. package/aot/transform.ts +69 -0
  6. package/cli/aot-build.ts +189 -0
  7. package/cli/build-app.ts +67 -25
  8. package/cli/config.ts +44 -101
  9. package/cli/create.ts +107 -234
  10. package/cli/help.ts +159 -0
  11. package/cli/host-fetch.ts +87 -48
  12. package/cli/host.ts +18 -8
  13. package/cli/sk.ts +35 -110
  14. package/cli/skpk.ts +4 -0
  15. package/package.json +4 -2
  16. package/templates/icon.png +0 -0
  17. package/templates/minimal/.vscode/settings.json +3 -0
  18. package/templates/minimal/assets/hello.txt +1 -0
  19. package/templates/minimal/src/App.vue +142 -0
  20. package/templates/minimal/src/main.ts +4 -0
  21. package/templates/showcase/.vscode/settings.json +3 -0
  22. package/templates/showcase/assets/hello.txt +1 -0
  23. package/templates/showcase/assets/media/aurora.png +0 -0
  24. package/templates/showcase/assets/media/clip.mp4 +0 -0
  25. package/templates/showcase/assets/media/sticker.tgs +0 -0
  26. package/templates/showcase/src/App.vue +128 -0
  27. package/templates/showcase/src/components/Card.vue +41 -0
  28. package/templates/showcase/src/components/Icon.vue +29 -0
  29. package/templates/showcase/src/components/Page.vue +41 -0
  30. package/templates/showcase/src/components/Titlebar.vue +132 -0
  31. package/templates/showcase/src/engine.ts +10 -0
  32. package/templates/showcase/src/icons.ts +22 -0
  33. package/templates/showcase/src/main.ts +7 -0
  34. package/templates/showcase/src/pages/AudioPage.vue +121 -0
  35. package/templates/showcase/src/pages/FilesPage.vue +87 -0
  36. package/templates/showcase/src/pages/FormsPage.vue +138 -0
  37. package/templates/showcase/src/pages/GraphicsPage.vue +154 -0
  38. package/templates/showcase/src/pages/HomePage.vue +140 -0
  39. package/templates/showcase/src/pages/LocalePage.vue +71 -0
  40. package/templates/showcase/src/pages/MediaPage.vue +85 -0
  41. package/templates/showcase/src/pages/MotionPage.vue +199 -0
  42. package/templates/showcase/src/pages/NetworkPage.vue +104 -0
  43. package/templates/showcase/src/pages/PermissionsPage.vue +80 -0
  44. package/templates/showcase/src/pages/StoragePage.vue +104 -0
  45. package/templates/showcase/src/pages/StylesPage.vue +199 -0
  46. package/templates/showcase/src/pages/SystemPage.vue +89 -0
  47. package/templates/showcase/src/pages/TrayPage.vue +66 -0
  48. package/templates/showcase/src/pages/WindowPage.vue +128 -0
  49. package/templates/showcase/src/product.ts +2 -0
  50. package/templates/showcase/src/router.ts +149 -0
  51. package/templates/showcase/src/stores/counter.ts +9 -0
  52. package/templates/showcase/src/stores/desktop.ts +115 -0
  53. package/templates/showcase/src/styles.css +140 -0
package/cli/build-app.ts CHANGED
@@ -8,21 +8,15 @@
8
8
  // without a re-stamp. On macOS (or `--platform macos` with `--host <mac sk-app>`) the last step is
9
9
  // macos-bundle.ts: the host is copied into `<exeName>.app`, the SKPK goes in Contents/Resources,
10
10
  // and the bundle is signed (ad hoc unless an identity is given). On Linux the SKPK is appended to a
11
- // copy of the host ELF (elf.ts). `PACKAGERS` holds the three.
11
+ // copy of the host ELF (elf.ts). `PACKAGERS` holds the three. With `--aot` (Windows x64), aot-build.ts adds
12
+ // the app's native image to the SKPK.
12
13
 
13
14
  import { createHash } from "node:crypto";
14
15
  import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
15
16
  import { join, relative, resolve, sep } from "node:path";
17
+ import { aotCheck, aotPlatformProblem, buildNative, hostAot, type NativeBuild } from "./aot-build";
16
18
  import { collectAssets, type AssetFile } from "./assets";
17
- import {
18
- loadAppConfig,
19
- partsLeftOut,
20
- variantFor,
21
- variantWarnings,
22
- type AppConfig,
23
- type PackConfig,
24
- type Variant,
25
- } from "./config";
19
+ import { ConfigError, loadAppConfig, parseVariant, type AppConfig, type PackConfig, type Variant } from "./config";
26
20
  import { stampElf, type ElfStampResult } from "./elf";
27
21
  import { CLI_VERSION, PKG_DIR, type ResolvedHost } from "./host";
28
22
  import { resolveOrFetchHost } from "./host-fetch";
@@ -55,20 +49,26 @@ export interface BuildOptions {
55
49
  configPath?: string | undefined;
56
50
  out?: string | undefined;
57
51
  host?: string | undefined;
58
- /** The host variant; overrides sk.config.json's `windows` selection. */
52
+ /** The host variant (standard or no-devtools); overrides the mode's. */
59
53
  variant?: Variant | undefined;
60
54
  console?: boolean;
61
55
  payloadOnly?: boolean;
62
56
  allowHostMismatch?: boolean;
63
57
  defines?: string[] | undefined;
64
58
  aotInputs?: boolean;
59
+ /** Compile the app to a native image (over sk.config.json "aot"). */
60
+ aot?: boolean | undefined;
61
+ /** The sk-aot to use instead of the checkout's or the release's. */
62
+ aotCompiler?: string | undefined;
63
+ /** Colors in a report that refuses the build. */
64
+ color?: boolean;
65
65
  platform?: Platform | undefined;
66
66
  /** macOS: a codesign identity (`-` = ad hoc), or false for none; over `macos.sign`. */
67
67
  sign?: string | false | undefined;
68
68
  /**
69
69
  * `sk build` is "debug": devtools always in, the bundle not minified, <app>/dist/debug. `sk publish` is
70
- * "release": sk.config.json's engine selection, and without one, no devtools; <app>/dist/release. Unset:
71
- * the config's selection into <app>/dist, as the API always did.
70
+ * "release": no devtools unless sk.config.json has "publishDevtools": true; <app>/dist/release. Unset:
71
+ * the standard host into <app>/dist.
72
72
  */
73
73
  mode?: "debug" | "release" | undefined;
74
74
  /** Plain lines instead of the default progress on stderr. */
@@ -76,12 +76,9 @@ export interface BuildOptions {
76
76
  progress?: Progress;
77
77
  }
78
78
 
79
- /** The variant a mode builds when neither `--variant` nor a selection flag names one. */
79
+ /** The variant a mode builds when `--variant` names none. */
80
80
  export function modeVariant(config: AppConfig, mode: BuildOptions["mode"]): Variant {
81
- const selected = config.windows.variant;
82
- if (mode === "debug") return variantFor(partsLeftOut(selected).filter((p) => p !== "devtools"));
83
- if (mode === "release" && !config.windows.selected) return "no-devtools";
84
- return selected;
81
+ return mode === "release" && !config.publishDevtools ? "no-devtools" : "standard";
85
82
  }
86
83
 
87
84
  interface BuilderAsset {
@@ -122,6 +119,14 @@ export interface BuildResult {
122
119
  payloadBytes: number;
123
120
  packs: { name: string; path: string; bytes: number; assets: number }[];
124
121
  aotInputs: string | null;
122
+ native: {
123
+ manifest: string;
124
+ imageBytes: number;
125
+ compressedBytes: number;
126
+ entry: number;
127
+ compiler: string;
128
+ ms: number;
129
+ } | null;
125
130
  warnings: string[];
126
131
  ms: { bundle: number; assets: number; stamp: number; total: number };
127
132
  }
@@ -354,9 +359,15 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
354
359
  const platform = options.platform ?? currentPlatform();
355
360
  const config = loadAppConfig(options.target, { configPath: options.configPath, platform });
356
361
  const warnings = [...config.warnings];
357
- const asked: Variant = options.variant ?? modeVariant(config, options.mode);
358
- partsLeftOut(asked);
359
- warnings.push(...variantWarnings(asked));
362
+ const variant: Variant =
363
+ options.variant === undefined ? modeVariant(config, options.mode) : parseVariant(options.variant, "--variant");
364
+ const aot = options.aot ?? config.aot;
365
+ if (aot) {
366
+ const problem = aotPlatformProblem(platform);
367
+ if (problem) throw new ConfigError(problem);
368
+ if (options.payloadOnly)
369
+ throw new ConfigError("--aot compiles against the host it stamps, so it cannot be combined with --payload-only");
370
+ }
360
371
  const outDir = resolve(options.out ?? join(config.appRoot, "dist", ...(options.mode ? [options.mode] : [])));
361
372
  const work = join(outDir, ".sk");
362
373
  mkdirSync(work, { recursive: true });
@@ -367,7 +378,7 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
367
378
  ? null
368
379
  : await resolveOrFetchHost({
369
380
  host: options.host,
370
- variant: asked,
381
+ variant,
371
382
  allowMismatch: options.allowHostMismatch,
372
383
  platform,
373
384
  log,
@@ -375,10 +386,8 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
375
386
  if (host) {
376
387
  progress.detail(`${host.info.variant} · Skathi ${host.info.skathi} ${host.info.profile} · ${host.source}`);
377
388
  if (host.unverified) warnings.push(host.unverified);
378
- if (host.substitute) warnings.push(host.substitute);
379
389
  }
380
- // The payload names the host it runs on, which a stand-in changes.
381
- const variant: Variant = host?.substitute ? host.info.variant : asked;
390
+ const hostNative = aot && host ? hostAot(host) : null;
382
391
 
383
392
  const jsOut = join(work, "app.prod.js");
384
393
  const assetsJson = join(work, "assets.json");
@@ -417,6 +426,7 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
417
426
  const script = readFileSync(jsOut);
418
427
  const windowJson = readFileSync(join(work, "window.json"));
419
428
  const msBundle = performance.now() - tb;
429
+ if (aot) await aotCheck(options.target, options.configPath, progress, options.color ?? false);
420
430
 
421
431
  progress.step("assets");
422
432
  const ta = performance.now();
@@ -477,6 +487,21 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
477
487
  for (const p of packs) writeFileSync(join(work, p.file), p.blob);
478
488
  progress.detail(`${collected.files.length} files · ${kib(collected.totalBytes)}`);
479
489
 
490
+ let native: NativeBuild | null = null;
491
+ const tn = performance.now();
492
+ if (hostNative) {
493
+ native = await buildNative({
494
+ source: script,
495
+ aot: hostNative,
496
+ compilerPath: options.aotCompiler,
497
+ work: join(work, "aot"),
498
+ progress,
499
+ log,
500
+ });
501
+ inputs.push(...native.inputs);
502
+ }
503
+ const msNative = performance.now() - tn;
504
+
480
505
  let packaged: Packaged | null = null;
481
506
  const ts = performance.now();
482
507
  progress.step(options.payloadOnly || !host ? "payload" : platform === "macos" ? "app bundle" : "exe");
@@ -510,6 +535,14 @@ async function build(options: BuildOptions, progress: Progress): Promise<BuildRe
510
535
  assets: collected.files,
511
536
  bundleBytes: script.length,
512
537
  aotInputs: options.aotInputs ? join(work, "aot-inputs", "manifest.json") : null,
538
+ native: native && {
539
+ manifest: native.manifestPath,
540
+ imageBytes: native.imageBytes,
541
+ compressedBytes: native.compressedBytes,
542
+ entry: native.entry,
543
+ compiler: native.compiler.path,
544
+ ms: Math.round(msNative),
545
+ },
513
546
  payloadBytes: packaged?.payload.length ?? readFileSync(skpk).length,
514
547
  packs: packs.map((p) => ({
515
548
  name: p.name,
@@ -580,6 +613,15 @@ export function summary(r: BuildResult, color = false): string {
580
613
  ),
581
614
  row("payload", `${kib(r.payloadBytes)} ${p.dim(r.skpk)}`),
582
615
  );
616
+ if (r.native) {
617
+ lines.push(
618
+ row(
619
+ "native",
620
+ `${mib(r.native.imageBytes)} image (${mib(r.native.compressedBytes)} in the payload), entry ${r.native.entry} ` +
621
+ p.dim(r.native.manifest),
622
+ ),
623
+ );
624
+ }
583
625
  for (const pk of r.packs)
584
626
  lines.push(row("pack", `${pk.name}: ${pk.assets} asset(s), ${kib(pk.bytes)} ${p.dim(pk.path)}`));
585
627
  lines.push(`${p.green("done")} in ${seconds(r.ms.total)}`);
package/cli/config.ts CHANGED
@@ -8,8 +8,9 @@
8
8
  // "packs": [{ "name": "fonts", "match": ["**/*.woff2"] }, { "name": "assets" }]
9
9
  // assets in their own .skpk files, in order; no "match" takes the rest
10
10
  // "define", "aliases" Vite's `define`; a bare module name -> the app's own stand-in file
11
- // "windows": { exeName, icon, company, copyright, description, console,
12
- // without | features | host } engine parts left out / taken / a whole variant by name
11
+ // "publishDevtools": true sk publish keeps devtools (the standard host instead of no-devtools)
12
+ // "aot": true sk build and sk publish compile the app to a native image (Windows x64)
13
+ // "windows": { exeName, icon, company, copyright, description, console }
13
14
  // "macos": { bundleId, exeName, icon, category, minimumSystemVersion, copyright,
14
15
  // microphoneUsageDescription, cameraUsageDescription, sign }
15
16
  //
@@ -21,82 +22,26 @@ import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
21
22
  import type { Platform } from "./platform";
22
23
  import { numericVersion } from "./versioninfo";
23
24
 
24
- /**
25
- * The parts of the engine a host can be built WITHOUT: the same list and order as `OPTIONAL` in
26
- * crates/sk-app/src/payload.rs. `devtools` is the listener, inspector and F12; the rest are cargo features of sk-app.
27
- */
28
- export const OPTIONAL = ["devtools", "audio", "clipboard", "storages", "indexeddb", "webgpu"] as const;
29
- export type Part = (typeof OPTIONAL)[number];
30
-
31
- /** A host's name: `standard`, else the parts left out as `no-<part>` joined by `+` in {@link OPTIONAL}'s order. The host cache is keyed by it. */
25
+ /** A prod host's name, the key the host cache and the release find it by: the whole engine, with or without devtools. */
32
26
  export type Variant = string;
33
- export const VARIANTS: Variant[] = ["standard", "no-devtools"];
34
-
35
- const isPart = (p: unknown): p is Part => typeof p === "string" && (OPTIONAL as readonly string[]).includes(p);
36
-
37
- export function variantFor(without: Iterable<Part>): Variant {
38
- const off = new Set(without);
39
- const names = OPTIONAL.filter((p) => off.has(p)).map((p) => `no-${p}`);
40
- return names.length ? names.join("+") : "standard";
41
- }
42
-
43
- export function partsLeftOut(variant: Variant): Part[] {
44
- if (variant === "standard") return [];
45
- const off = new Set<Part>();
46
- for (const name of variant.split("+")) {
47
- const p = name.startsWith("no-") ? name.slice(3) : "";
48
- if (!isPart(p)) {
49
- throw new ConfigError(
50
- `${JSON.stringify(variant)} is not a host variant — "standard", or the parts left out as no-<part> joined by "+" ` +
51
- `(parts: ${OPTIONAL.join(", ")})`,
52
- );
53
- }
54
- off.add(p);
55
- }
56
- return OPTIONAL.filter((p) => off.has(p));
57
- }
27
+ export const VARIANTS: readonly Variant[] = ["standard", "no-devtools"];
58
28
 
59
- /** A list of part names: `"audio,clipboard"` or an array; spaces separate too (PowerShell passes an unquoted `audio,clipboard` as `"audio clipboard"`). */
60
- export function parseParts(list: unknown, where: string): Part[] {
61
- const items = typeof list === "string" ? list.split(/[\s,]+/).filter(Boolean) : list;
62
- if (!Array.isArray(items)) throw new ConfigError(`${where} must be a list of parts (${OPTIONAL.join(", ")})`);
63
- const out = new Set<Part>();
64
- for (const p of items) {
65
- if (!isPart(p))
66
- throw new ConfigError(`${where}: ${JSON.stringify(p)} is not a part — known parts are ${OPTIONAL.join(", ")}`);
67
- out.add(p);
68
- }
69
- return OPTIONAL.filter((p) => out.has(p));
70
- }
29
+ /** The cargo features of sk-app every published host carries (crates/sk-app/src/payload.rs `OPTIONAL`, after devtools). */
30
+ export const ENGINE_FEATURES = ["audio", "clipboard", "storages", "indexeddb", "webgpu"] as const;
71
31
 
72
- /** The variant a selection asks for (`host` is the legacy whole-variant spelling). */
73
- export function selectVariant(
74
- sel: { features?: Part[] | undefined; without?: Part[] | undefined; host?: Variant | undefined },
75
- where: string,
76
- ): Variant {
77
- const given = [sel.features && "features", sel.without && "without", sel.host && "host"].filter(Boolean);
78
- if (given.length > 1) throw new ConfigError(`${where}: give one of ${given.join(" / ")}, not several`);
79
- if (sel.features) return variantFor(OPTIONAL.filter((p) => !sel.features!.includes(p)));
80
- if (sel.without) return variantFor(sel.without);
81
- if (sel.host) return variantFor(partsLeftOut(sel.host));
82
- return "standard";
83
- }
32
+ export const PARTS_NOT_SELECTABLE =
33
+ "engine parts are no longer selectable: every published app carries the whole engine. " +
34
+ '"publishDevtools": true in sk.config.json keeps devtools in sk publish builds; ' +
35
+ "to trim the engine, embed it with the sk-app crate (sk_app::embed) and its cargo features";
84
36
 
85
- export function variantWarnings(variant: Variant): string[] {
86
- const off = new Set(partsLeftOut(variant));
87
- const out: string[] = [];
88
- if (!off.has("indexeddb") && off.has("storages")) {
89
- out.push("the host has indexedDB but no storages: its databases are in memory and nothing survives a restart");
90
- }
91
- return out;
37
+ export function parseVariant(v: unknown, where: string): Variant {
38
+ const name = typeof v === "string" ? v.trim() : "";
39
+ if (VARIANTS.includes(name)) return name;
40
+ throw new ConfigError(`${where}: ${JSON.stringify(v)} is not a host variant — ${VARIANTS.join(" or ")}`);
92
41
  }
93
42
 
94
43
  export function cargoFeatureArgs(variant: Variant): string[] {
95
- const off = partsLeftOut(variant);
96
- const features = ["prod", ...(off.includes("devtools") ? ["no-devtools"] : [])];
97
- const defaults = OPTIONAL.filter((p) => p !== "devtools");
98
- if (!off.some((p) => p !== "devtools")) return ["--features", features.join(",")];
99
- return ["--no-default-features", "--features", [...features, ...defaults.filter((p) => !off.includes(p))].join(",")];
44
+ return ["--features", parseVariant(variant, "cargo") === "no-devtools" ? "prod,no-devtools" : "prod"];
100
45
  }
101
46
 
102
47
  export interface WindowsConfig {
@@ -106,12 +51,6 @@ export interface WindowsConfig {
106
51
  copyright?: string | undefined;
107
52
  description?: string | undefined;
108
53
  console?: boolean;
109
- host?: Variant;
110
- features?: Part[];
111
- without?: Part[];
112
- variant: Variant;
113
- /** Whether the config chose the engine parts (`host`, `features` or `without`). */
114
- selected?: boolean;
115
54
  }
116
55
 
117
56
  /** `"macos"`, defaults applied. Read on every platform, so a typo fails a Windows build too. */
@@ -144,6 +83,10 @@ export interface AppConfig {
144
83
  assetsDeclared: boolean;
145
84
  publicDir: string | null;
146
85
  packs: PackConfig[];
86
+ /** Whether `sk build` and `sk publish` compile the app to a native image (`--aot` / `--no-aot` win). */
87
+ aot: boolean;
88
+ /** Whether `sk publish` stamps the standard host (devtools in) instead of no-devtools. */
89
+ publishDevtools: boolean;
147
90
  windows: WindowsConfig;
148
91
  macos: MacConfig;
149
92
  exeName: string;
@@ -162,6 +105,7 @@ export interface PackConfig {
162
105
  }
163
106
 
164
107
  const PACK_NAME = /^[a-z0-9][a-z0-9_-]{0,63}$/;
108
+ export const PACK_KEYS: ReadonlySet<string> = new Set(["name", "match"]);
165
109
 
166
110
  function parsePacks(raw: unknown): PackConfig[] {
167
111
  if (raw === undefined) return [];
@@ -170,11 +114,11 @@ function parsePacks(raw: unknown): PackConfig[] {
170
114
  const seen = new Set<string>();
171
115
  return raw.map((p, i) => {
172
116
  if (!p || typeof p !== "object" || Array.isArray(p)) throw bad(`entry ${i} must be an object`);
173
- const { name, match, ...rest } = p as Record<string, unknown>;
174
- const extra = Object.keys(rest).filter((k) => !k.startsWith("$"));
117
+ const { name, match } = p as Record<string, unknown>;
118
+ const extra = Object.keys(p).filter((k) => !k.startsWith("$") && !PACK_KEYS.has(k));
175
119
  if (extra.length)
176
120
  throw bad(
177
- `entry ${i} has unknown key(s) ${extra.map((k) => JSON.stringify(k)).join(", ")} — known keys are name, match`,
121
+ `entry ${i} has unknown key(s) ${extra.map((k) => JSON.stringify(k)).join(", ")} — known keys are ${[...PACK_KEYS].join(", ")}`,
178
122
  );
179
123
  if (typeof name !== "string" || !PACK_NAME.test(name) || name === "app") {
180
124
  throw bad(
@@ -202,13 +146,15 @@ export interface LaunchConfig {
202
146
  protocols: string[];
203
147
  }
204
148
 
205
- const TOP_LEVEL = new Set([
149
+ export const TOP_LEVEL: ReadonlySet<string> = new Set([
206
150
  "name",
207
151
  "platforms",
208
152
  "productName",
209
153
  "version",
210
154
  "window",
211
155
  "devtools",
156
+ "publishDevtools",
157
+ "aot",
212
158
  "httpCache",
213
159
  "assets",
214
160
  "publicDir",
@@ -285,18 +231,16 @@ function readLaunch(raw: Record<string, unknown>, name: string): LaunchConfig {
285
231
  protocols,
286
232
  };
287
233
  }
288
- const WINDOWS_KEYS = new Set([
234
+ export const WINDOWS_KEYS: ReadonlySet<string> = new Set([
289
235
  "exeName",
290
236
  "icon",
291
237
  "company",
292
238
  "copyright",
293
239
  "description",
294
240
  "console",
295
- "host",
296
- "features",
297
- "without",
298
241
  ]);
299
- const MACOS_KEYS = new Set([
242
+ const REMOVED_WINDOWS_KEYS = new Set(["host", "features", "without"]);
243
+ export const MACOS_KEYS: ReadonlySet<string> = new Set([
300
244
  "bundleId",
301
245
  "exeName",
302
246
  "icon",
@@ -539,7 +483,15 @@ export function loadAppConfig(
539
483
  throw new ConfigError('sk.config.json "define" must be an object of { "NAME": value }');
540
484
  }
541
485
 
542
- const windows: WindowsConfig = { variant: "standard" };
486
+ if (raw.publishDevtools !== undefined && typeof raw.publishDevtools !== "boolean") {
487
+ throw new ConfigError('sk.config.json "publishDevtools" must be true or false');
488
+ }
489
+ const publishDevtools = raw.publishDevtools === true;
490
+ if (raw.aot !== undefined && typeof raw.aot !== "boolean") {
491
+ throw new ConfigError('sk.config.json "aot" must be true or false');
492
+ }
493
+
494
+ const windows: WindowsConfig = {};
543
495
  if (raw.windows !== undefined) {
544
496
  if (!raw.windows || typeof raw.windows !== "object" || Array.isArray(raw.windows)) {
545
497
  throw new ConfigError('sk.config.json "windows" must be an object');
@@ -547,6 +499,9 @@ export function loadAppConfig(
547
499
  const w = raw.windows as Record<string, unknown>;
548
500
  for (const key of Object.keys(w)) {
549
501
  if (key.startsWith("$")) continue;
502
+ if (REMOVED_WINDOWS_KEYS.has(key)) {
503
+ throw new ConfigError(`sk.config.json "windows.${key}": ${PARTS_NOT_SELECTABLE}`);
504
+ }
550
505
  if (!WINDOWS_KEYS.has(key)) {
551
506
  throw new ConfigError(
552
507
  `sk.config.json "windows": unknown key ${JSON.stringify(key)} — known keys are ${[...WINDOWS_KEYS].join(", ")}`,
@@ -563,20 +518,6 @@ export function loadAppConfig(
563
518
  throw new ConfigError('sk.config.json "windows.console" must be true or false');
564
519
  windows.console = w.console;
565
520
  }
566
- if (w.host !== undefined) {
567
- if (typeof w.host !== "string")
568
- throw new ConfigError('sk.config.json "windows.host" must be a host variant, e.g. "no-devtools"');
569
- try {
570
- partsLeftOut(w.host);
571
- } catch (e) {
572
- throw new ConfigError(`sk.config.json "windows.host": ${(e as Error).message}`);
573
- }
574
- windows.host = w.host;
575
- }
576
- if (w.features !== undefined) windows.features = parseParts(w.features, where("windows.features"));
577
- if (w.without !== undefined) windows.without = parseParts(w.without, where("windows.without"));
578
- windows.variant = selectVariant(windows, where('"windows"'));
579
- windows.selected = windows.host !== undefined || windows.features !== undefined || windows.without !== undefined;
580
521
  }
581
522
 
582
523
  if (raw.httpCache !== undefined && raw.httpCache !== false) {
@@ -624,6 +565,8 @@ export function loadAppConfig(
624
565
  assetsDeclared,
625
566
  publicDir,
626
567
  packs,
568
+ publishDevtools,
569
+ aot: raw.aot === true,
627
570
  windows,
628
571
  macos,
629
572
  exeName,