@rightkit/release 0.2.144 → 0.2.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rightkit/release",
3
- "version": "0.2.144",
3
+ "version": "0.2.145",
4
4
  "description": "Portable release CLI/SDK with fail-closed public GitHub Releases and private R2 + RightApps distribution.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
package/pe-imports.mjs CHANGED
@@ -55,5 +55,7 @@ export function readPeImports(bytes) {
55
55
  delayImports.add(cstring(name));
56
56
  }
57
57
  }
58
- return { machine, architecture: PE_MACHINES[machine] ?? `0x${machine.toString(16)}`, imports: [...imports], delayImports: [...delayImports] };
58
+ // Optional header Subsystem is at offset 68 in both PE32 and PE32+ (2 = WINDOWS_GUI, 3 = WINDOWS_CUI).
59
+ const subsystem = buf.readUInt16LE(optional + 68);
60
+ return { machine, architecture: PE_MACHINES[machine] ?? `0x${machine.toString(16)}`, subsystem, imports: [...imports], delayImports: [...delayImports] };
59
61
  }
@@ -29,7 +29,7 @@
29
29
  "@rightkit/platform-ui": "0.2.0",
30
30
  "@rightkit/qa": "0.4.0",
31
31
  "@rightkit/qa-chrome": "0.1.3",
32
- "@rightkit/release": "0.2.144",
32
+ "@rightkit/release": "0.2.145",
33
33
  "@rightkit/settings-ui": "0.3.0",
34
34
  "@rightkit/shell": "0.1.0",
35
35
  "@rightkit/tauri": "0.2.0",
@@ -176,7 +176,8 @@
176
176
  "0.2.140",
177
177
  "0.2.141",
178
178
  "0.2.142",
179
- "0.2.143"
179
+ "0.2.143",
180
+ "0.2.144"
180
181
  ],
181
182
  "@rightkit/qa": [
182
183
  "0.1.0",
@@ -276,7 +277,7 @@
276
277
  "rightkit-browser": "0.2.3",
277
278
  "rightkit-cache": "0.1.0",
278
279
  "rightkit-contracts": "0.1.2",
279
- "rightkit-control": "0.1.9",
280
+ "rightkit-control": "0.1.11",
280
281
  "rightkit-crash": "0.2.0",
281
282
  "rightkit-db": "0.3.2",
282
283
  "rightkit-embed": "0.3.1",
@@ -333,7 +334,7 @@
333
334
  "rightkit-audio": "0.2.0",
334
335
  "rightkit-browser": "0.2.2",
335
336
  "rightkit-cache": "0.1.0",
336
- "rightkit-control": "0.1.9",
337
+ "rightkit-control": "0.1.11",
337
338
  "rightkit-crash": "0.2.0",
338
339
  "rightkit-db": "0.3.2",
339
340
  "rightkit-embed": "0.3.1",
@@ -388,7 +389,7 @@
388
389
  "@rightkit/platform-ui": "0.2.0",
389
390
  "@rightkit/qa": "0.4.0",
390
391
  "@rightkit/qa-chrome": "0.1.3",
391
- "@rightkit/release": "0.2.144",
392
+ "@rightkit/release": "0.2.145",
392
393
  "@rightkit/settings-ui": "0.3.0",
393
394
  "@rightkit/shell": "0.1.0",
394
395
  "@rightkit/tauri": "0.2.0",
@@ -504,7 +505,9 @@
504
505
  "rightkit-control": [
505
506
  "0.1.6",
506
507
  "0.1.7",
507
- "0.1.8"
508
+ "0.1.8",
509
+ "0.1.9",
510
+ "0.1.10"
508
511
  ],
509
512
  "rightkit-secrets": [
510
513
  "0.1.0",
@@ -29,7 +29,7 @@ export function windowsStageOptions({ config, base }) {
29
29
  const w = config.windows;
30
30
  if (!w?.exe || !w?.out) throw fail("SWIFT_PACKAGE_CONFIG", "windows.exe and windows.out are required");
31
31
  return { exe: rel(base, w.exe), out: rel(base, w.stageDir ?? `${w.out}.stage`), searchDirs: relList(base, w.searchDirs),
32
- include: relList(base, w.include), systemDlls: w.systemDlls, dependencies: w.dependencies, architecture: w.architecture };
32
+ include: relList(base, w.include), systemDlls: w.systemDlls, dependencies: w.dependencies, architecture: w.architecture, subsystem: w.subsystem };
33
33
  }
34
34
 
35
35
  export function msixOptions({ config, base }, staged) {
@@ -41,7 +41,9 @@ function findInDirs(name, dirs) {
41
41
  * systemDlls[] (extra allowed), dependencies[{ name, provides[] }], architecture }
42
42
  * Returns a manifest; throws SWIFT_STAGE_UNRESOLVED listing every missing DLL.
43
43
  */
44
- export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], systemDlls = [], dependencies = [], architecture, clean = true } = {}) {
44
+ const PE_SUBSYSTEMS = { gui: 2, console: 3 };
45
+
46
+ export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], systemDlls = [], dependencies = [], architecture, subsystem, clean = true } = {}) {
45
47
  if (!exe || !out) throw fail("SWIFT_STAGE_OPTIONS", "exe and out are required");
46
48
  exe = path.resolve(exe); out = path.resolve(out);
47
49
  if (!/\.exe$/i.test(exe) || !existsSync(exe) || !statSync(exe).isFile()) throw fail("SWIFT_STAGE_OPTIONS", `exe must be an existing .exe: ${exe}`);
@@ -71,6 +73,14 @@ export function stageSwiftWindows({ exe, out, searchDirs = [], include = [], sys
71
73
  const info = readPeImports(readFileSync(item.source));
72
74
  if (!["x64", "arm64"].includes(info.architecture)) throw fail("SWIFT_STAGE_ARCH", `${item.source} is ${info.architecture}; only x64 and arm64 are supported`);
73
75
  arch ??= info.architecture;
76
+ if (item.from === "<root>" && subsystem) {
77
+ const want = PE_SUBSYSTEMS[subsystem];
78
+ if (!want) throw fail("SWIFT_STAGE_OPTIONS", `windows.subsystem must be "gui" or "console", got ${JSON.stringify(subsystem)}`);
79
+ if (info.subsystem !== want) {
80
+ throw fail("SWIFT_STAGE_SUBSYSTEM", `${item.source} has PE subsystem ${info.subsystem}, expected ${want} (${subsystem})` +
81
+ (subsystem === "gui" ? "; link with -Xlinker /SUBSYSTEM:WINDOWS -Xlinker /ENTRY:mainCRTStartup so launching it opens no console window" : ""));
82
+ }
83
+ }
74
84
  if (info.architecture !== arch) throw fail("SWIFT_STAGE_ARCH", `${item.source} is ${info.architecture} but package architecture is ${arch}`);
75
85
  for (const dep of [...info.imports, ...info.delayImports]) {
76
86
  const dk = lower(dep);