@gjsify/cli 0.64.5 → 0.64.7
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/dist/cli.gjs.mjs +264 -264
- package/lib/commands/ship.js +12 -2
- package/lib/commands/showcase.js +1 -1
- package/lib/utils/bin-shim.d.ts +16 -5
- package/lib/utils/bin-shim.js +20 -6
- package/lib/utils/install-backend-native.js +39 -1
- package/lib/utils/install-extraneous.d.ts +25 -0
- package/lib/utils/install-extraneous.js +41 -0
- package/lib/utils/ship/app-runtime.d.ts +7 -4
- package/lib/utils/ship/app-runtime.js +29 -14
- package/lib/utils/ship/formats.js +11 -15
- package/lib/utils/ship/launcher.js +20 -7
- package/lib/utils/ship/layout.d.ts +23 -0
- package/lib/utils/ship/layout.js +62 -30
- package/lib/utils/ship/msi.js +20 -3
- package/lib/utils/ship/node-runtime.d.ts +1 -1
- package/lib/utils/ship/node-runtime.js +9 -7
- package/lib/utils/ship/payload.d.ts +3 -1
- package/lib/utils/ship/payload.js +11 -1
- package/lib/utils/ship/pe-launcher.js +11 -1
- package/package.json +20 -20
package/lib/utils/ship/msi.js
CHANGED
|
@@ -34,8 +34,15 @@
|
|
|
34
34
|
// answer:
|
|
35
35
|
//
|
|
36
36
|
// 1. `wixl -a x64` sets Component `Attributes` to 256 — `msidbComponent-
|
|
37
|
-
// Attributes64bit` — on its own, so `Win64="yes"`
|
|
38
|
-
//
|
|
37
|
+
// Attributes64bit` — on its own, so `Win64="yes"` was not written here at
|
|
38
|
+
// first. ADR 0089 (win32-arm64) is what reopened the question: wixl's own
|
|
39
|
+
// source sets that bit only for `Arch.X64`/`Arch.IA64`, never for
|
|
40
|
+
// `Arch.ARM64` (`tools/wixl/builder.vala`), so an unmodified `-a arm64`
|
|
41
|
+
// build would have shipped a 32-bit component tree. `Win64` is now written
|
|
42
|
+
// explicitly for every non-x86 arch, on both backends — a Component whose
|
|
43
|
+
// bitness depends on which backend's inference happens to cover it is
|
|
44
|
+
// exactly the kind of divergence this file's whole design (one `.wxs`, two
|
|
45
|
+
// readers) exists to prevent.
|
|
39
46
|
// 2. An ABSOLUTE `Source=` resolves — and this file writes RELATIVE ones anyway,
|
|
40
47
|
// which is the measurement changing a decision rather than confirming it. The
|
|
41
48
|
// SAME document is compiled twice, on two machines: `wixl` here and WiX v3 on
|
|
@@ -240,6 +247,16 @@ function directoryTree(files) {
|
|
|
240
247
|
*/
|
|
241
248
|
export function renderWxs(input) {
|
|
242
249
|
const { settings, programDirName, archLabel } = input;
|
|
250
|
+
// EXPLICIT, not inferred — measured against msitools' own source
|
|
251
|
+
// (tools/wixl/builder.vala, `compileComponent`): `wixl -a <arch>` sets the
|
|
252
|
+
// `msidbComponentAttributes64bit` bit itself ONLY for `Arch.X64` and
|
|
253
|
+
// `Arch.IA64`; `Arch.ARM64` falls through and the component stays 32-bit
|
|
254
|
+
// unless `Win64="yes"` is written here. `candle -arch arm64` (WiX v3.14,
|
|
255
|
+
// the win32 backend) is not re-verified the same way, so this file no
|
|
256
|
+
// longer trusts EITHER backend's default for a non-x86 architecture — a
|
|
257
|
+
// Component silently installing into `%ProgramFiles(x86)%` is the wrong
|
|
258
|
+
// kind of thing to find out by running the artifact.
|
|
259
|
+
const win64 = archLabel !== 'x86';
|
|
243
260
|
const productVersion = msiProductVersion(settings.version);
|
|
244
261
|
// `Name <email>` is `PackSettings.maintainer`'s shape; ARP shows `Publisher`
|
|
245
262
|
// to a human, and an address in that field reads as a mistake.
|
|
@@ -298,7 +315,7 @@ export function renderWxs(input) {
|
|
|
298
315
|
// not the authority for it — a Windows packing host would otherwise
|
|
299
316
|
// split a name containing a backslash.
|
|
300
317
|
const name = xmlEscape(posix.basename(file.path));
|
|
301
|
-
lines.push(`${indent}<Component Id="${componentId}" Guid="${guid}">`);
|
|
318
|
+
lines.push(`${indent}<Component Id="${componentId}" Guid="${guid}" Win64="${win64 ? 'yes' : 'no'}">`);
|
|
302
319
|
// THE SHORTCUT LIVES IN THE LAUNCHER'S OWN COMPONENT, nested in its
|
|
303
320
|
// `<File>` and advertised. The obvious alternative — a second component
|
|
304
321
|
// under `ProgramMenuFolder` whose key path is an HKCU registry value —
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The targets a bundled interpreter is published for. */
|
|
2
|
-
export declare const NODE_RUNTIME_TARGETS: readonly ["darwin-arm64", "darwin-x64", "win32-x64"];
|
|
2
|
+
export declare const NODE_RUNTIME_TARGETS: readonly ["darwin-arm64", "darwin-x64", "win32-x64", "win32-arm64"];
|
|
3
3
|
export type NodeRuntimeTarget = (typeof NODE_RUNTIME_TARGETS)[number];
|
|
4
4
|
/** Is this `<platform>-<arch>` one of the published targets? */
|
|
5
5
|
export declare function isNodeRuntimeTarget(target: string): target is NodeRuntimeTarget;
|
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
// THE CALLER IS `utils/ship/app-runtime.ts` (#1354 M2b), and this paragraph used
|
|
29
29
|
// to say there was none — "⚠️ NOTHING CALLS THIS YET, outside its own spec … a
|
|
30
30
|
// promise to a caller that does not exist yet". It exists: the macOS layout stages
|
|
31
|
-
// `nodePath` into `Contents/
|
|
32
|
-
// `null`-not-throw contract is what lets that caller
|
|
33
|
-
// find while naming the interpreter package it did
|
|
34
|
-
// caller — the Windows program directory stages
|
|
35
|
-
// both non-Linux rows of the table above are now
|
|
36
|
-
// longer has a "still has none" half to record.
|
|
31
|
+
// `nodePath` into `Contents/Helpers/<display name>` and `licensePath` beside it in
|
|
32
|
+
// `Contents/Resources`, and the `null`-not-throw contract is what lets that caller
|
|
33
|
+
// stage the GTK closure it DID find while naming the interpreter package it did
|
|
34
|
+
// not. #1354 M3 adds the second caller — the Windows program directory stages
|
|
35
|
+
// `node.exe` beside its `.cmd` — so both non-Linux rows of the table above are now
|
|
36
|
+
// used, and this paragraph no longer has a "still has none" half to record.
|
|
37
|
+
// `node.exe` keeps that name verbatim: nothing collides with it on Windows, and
|
|
38
|
+
// only the darwin leaf changed — see `layout.ts`'s `dirs.helpers`.
|
|
37
39
|
//
|
|
38
40
|
// The tests keep the by-name claim honest independently of any caller: they
|
|
39
41
|
// resolve a real installed package out of a throwaway consumer tree holding
|
|
@@ -43,7 +45,7 @@ import { existsSync } from 'node:fs';
|
|
|
43
45
|
import { dirname, join } from 'node:path';
|
|
44
46
|
import { resolveInstalledPackage } from '../resolve-npm-package.js';
|
|
45
47
|
/** The targets a bundled interpreter is published for. */
|
|
46
|
-
export const NODE_RUNTIME_TARGETS = ['darwin-arm64', 'darwin-x64', 'win32-x64'];
|
|
48
|
+
export const NODE_RUNTIME_TARGETS = ['darwin-arm64', 'darwin-x64', 'win32-x64', 'win32-arm64'];
|
|
47
49
|
/** Is this `<platform>-<arch>` one of the published targets? */
|
|
48
50
|
export function isNodeRuntimeTarget(target) {
|
|
49
51
|
return NODE_RUNTIME_TARGETS.includes(target);
|
|
@@ -275,7 +275,9 @@ export declare function readBinaryArch(data: Uint8Array): string | null;
|
|
|
275
275
|
* JavaScript and ADR 0024 § A1 turns it into a design commitment — so a host
|
|
276
276
|
* comparison would refuse the very case the split exists to allow.
|
|
277
277
|
*/
|
|
278
|
-
export declare function assertPayloadMatchesArch(payload: readonly PayloadEntry[], arch: string
|
|
278
|
+
export declare function assertPayloadMatchesArch(payload: readonly PayloadEntry[], arch: string, options?: {
|
|
279
|
+
exempt?: ReadonlySet<string>;
|
|
280
|
+
}): void;
|
|
279
281
|
/**
|
|
280
282
|
* Which executable format these bytes are, or `null` for anything else.
|
|
281
283
|
*
|
|
@@ -767,11 +767,21 @@ export function readBinaryArch(data) {
|
|
|
767
767
|
* JavaScript and ADR 0024 § A1 turns it into a design commitment — so a host
|
|
768
768
|
* comparison would refuse the very case the split exists to allow.
|
|
769
769
|
*/
|
|
770
|
-
export function assertPayloadMatchesArch(payload, arch) {
|
|
770
|
+
export function assertPayloadMatchesArch(payload, arch, options = {}) {
|
|
771
771
|
for (const entry of payload) {
|
|
772
772
|
const found = readBinaryArch(entry.data);
|
|
773
773
|
if (found === null || found === arch)
|
|
774
774
|
continue;
|
|
775
|
+
// ONE NAMED EXCEPTION, not a relaxation of the rule: the windows layout's
|
|
776
|
+
// GUI-launcher stub (`pe-launcher.ts`) is x86-64 machine code on every
|
|
777
|
+
// windows arch BY DESIGN — it only `exec`s the sibling `.cmd`, which hands
|
|
778
|
+
// off to the arch-correct `node.exe` the stage actually carries, and
|
|
779
|
+
// Windows-on-ARM runs x64 code through Prism for exactly this reason. The
|
|
780
|
+
// caller names that one path; nothing else may match it, so a real
|
|
781
|
+
// cross-arch payload (the #1354/0.41.0 incident this function exists for)
|
|
782
|
+
// still throws.
|
|
783
|
+
if (options.exempt?.has(entry.path))
|
|
784
|
+
continue;
|
|
775
785
|
throw new Error(`gjsify ship: the payload is ${found}, but the package would be labelled ${arch} — ` +
|
|
776
786
|
`${entry.path} is built for ${found}.\n` +
|
|
777
787
|
' `--arch` names the architecture the PAYLOAD was built for; it does not cross-compile ' +
|
|
@@ -76,7 +76,17 @@ import { RT_GROUP_ICON, RT_ICON } from './ico.js';
|
|
|
76
76
|
export const PE_SUBSYSTEM_GUI = 2;
|
|
77
77
|
/** Where `Subsystem` lands in the emitted image: `e_lfanew` + 4 + 20 + 68. */
|
|
78
78
|
export const PE_SUBSYSTEM_OFFSET = 0x80 + 4 + 20 + 68;
|
|
79
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* `IMAGE_FILE_HEADER.Machine` for x86-64 — ALWAYS, even when `windows-dir` is staged for
|
|
81
|
+
* `--arch arm64` (ADR 0089). This stub does nothing an arm64 build needs a native image for: it
|
|
82
|
+
* `exec`s the sibling `.cmd`, which Windows resolves to the NATIVE `cmd.exe` either way (no path
|
|
83
|
+
* is given, so it comes off `System32`, and win32-on-arm64 keeps a native `cmd.exe` beside the
|
|
84
|
+
* emulated one), and that `.cmd` starts the staged `node.exe` — the arm64 build's OWN interpreter,
|
|
85
|
+
* never this stub's architecture. So the one thing a second, ARM64-native stub would buy is
|
|
86
|
+
* skipping Prism's x86-64 emulation for the ~550 bytes THIS image executes before handing off —
|
|
87
|
+
* a second machine-code emitter, a second `.rsrc` builder and a second `pei-aarch64` reader in
|
|
88
|
+
* `pe-launcher.spec.ts`, to save microseconds on a path that ends in a process handoff anyway.
|
|
89
|
+
*/
|
|
80
90
|
const MACHINE_AMD64 = 0x8664;
|
|
81
91
|
/** Where the PE signature starts. MSVC emits 0x78; nothing reads the value except through `e_lfanew`. */
|
|
82
92
|
const PE_OFFSET = 0x80;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.7",
|
|
4
4
|
"description": "CLI for Gjsify",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -142,22 +142,22 @@
|
|
|
142
142
|
"cli"
|
|
143
143
|
],
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@gjsify/blueprint": "^0.64.
|
|
146
|
-
"@gjsify/buffer": "^0.64.
|
|
147
|
-
"@gjsify/create-app": "^0.64.
|
|
148
|
-
"@gjsify/node-globals": "^0.64.
|
|
149
|
-
"@gjsify/node-polyfills": "^0.64.
|
|
150
|
-
"@gjsify/npm-registry": "^0.64.
|
|
151
|
-
"@gjsify/resolve-npm": "^0.64.
|
|
152
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.64.
|
|
153
|
-
"@gjsify/vite-plugin-blueprint": "^0.64.
|
|
154
|
-
"@gjsify/rolldown-plugin-pnp": "^0.64.
|
|
155
|
-
"@gjsify/semver": "^0.64.
|
|
156
|
-
"@gjsify/tar": "^0.64.
|
|
157
|
-
"@gjsify/tsc": "^0.64.
|
|
158
|
-
"@gjsify/utils": "^0.64.
|
|
159
|
-
"@gjsify/web-polyfills": "^0.64.
|
|
160
|
-
"@gjsify/workspace": "^0.64.
|
|
145
|
+
"@gjsify/blueprint": "^0.64.7",
|
|
146
|
+
"@gjsify/buffer": "^0.64.7",
|
|
147
|
+
"@gjsify/create-app": "^0.64.7",
|
|
148
|
+
"@gjsify/node-globals": "^0.64.7",
|
|
149
|
+
"@gjsify/node-polyfills": "^0.64.7",
|
|
150
|
+
"@gjsify/npm-registry": "^0.64.7",
|
|
151
|
+
"@gjsify/resolve-npm": "^0.64.7",
|
|
152
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.64.7",
|
|
153
|
+
"@gjsify/vite-plugin-blueprint": "^0.64.7",
|
|
154
|
+
"@gjsify/rolldown-plugin-pnp": "^0.64.7",
|
|
155
|
+
"@gjsify/semver": "^0.64.7",
|
|
156
|
+
"@gjsify/tar": "^0.64.7",
|
|
157
|
+
"@gjsify/tsc": "^0.64.7",
|
|
158
|
+
"@gjsify/utils": "^0.64.7",
|
|
159
|
+
"@gjsify/web-polyfills": "^0.64.7",
|
|
160
|
+
"@gjsify/workspace": "^0.64.7",
|
|
161
161
|
"acorn": "^8.17.0",
|
|
162
162
|
"cosmiconfig": "^9.0.2",
|
|
163
163
|
"get-tsconfig": "^4.14.0",
|
|
@@ -166,13 +166,13 @@
|
|
|
166
166
|
"yargs": "^18.0.0"
|
|
167
167
|
},
|
|
168
168
|
"devDependencies": {
|
|
169
|
-
"@gjsify/unit": "^0.64.
|
|
169
|
+
"@gjsify/unit": "^0.64.7",
|
|
170
170
|
"@types/yargs": "^17.0.35",
|
|
171
171
|
"typescript": "^6.0.3"
|
|
172
172
|
},
|
|
173
173
|
"peerDependencies": {
|
|
174
|
-
"@gjsify/oxfmt-native": "^0.64.
|
|
175
|
-
"@gjsify/rolldown-native": "^0.64.
|
|
174
|
+
"@gjsify/oxfmt-native": "^0.64.7",
|
|
175
|
+
"@gjsify/rolldown-native": "^0.64.7"
|
|
176
176
|
},
|
|
177
177
|
"peerDependenciesMeta": {
|
|
178
178
|
"@gjsify/oxfmt-native": {
|