@gjsify/cli 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.gjs.mjs +505 -490
- package/lib/cli-app.js +3 -1
- package/lib/commands/affected-classify.d.ts +7 -1
- package/lib/commands/affected-classify.js +66 -9
- package/lib/commands/affected-script-refs.d.ts +20 -0
- package/lib/commands/affected-script-refs.js +218 -0
- package/lib/commands/affected.js +24 -2
- package/lib/commands/flatpak/diff.js +8 -2
- package/lib/commands/flatpak/init.js +4 -1
- package/lib/commands/flatpak/sources.js +4 -3
- package/lib/commands/flatpak/sync-flathub.d.ts +2 -0
- package/lib/commands/flatpak/sync-flathub.js +149 -7
- package/lib/commands/flatpak/utils.d.ts +10 -0
- package/lib/commands/flatpak/utils.js +10 -0
- package/lib/commands/index.d.ts +1 -0
- package/lib/commands/index.js +1 -0
- package/lib/commands/install.js +76 -0
- package/lib/commands/link.d.ts +13 -0
- package/lib/commands/link.js +243 -0
- package/lib/commands/onboard.js +18 -2
- package/lib/commands/publish.d.ts +34 -0
- package/lib/commands/publish.js +153 -8
- package/lib/commands/ship.js +46 -4
- package/lib/types/config-data.d.ts +1 -1
- package/lib/utils/check-system-deps.d.ts +1 -17
- package/lib/utils/check-system-deps.js +10 -68
- package/lib/utils/dev-link.d.ts +222 -0
- package/lib/utils/dev-link.js +632 -0
- package/lib/utils/hang-watchdog.d.ts +95 -0
- package/lib/utils/hang-watchdog.js +194 -0
- package/lib/utils/install-backend-native.d.ts +14 -0
- package/lib/utils/install-backend-native.js +91 -13
- package/lib/utils/install-extraneous.d.ts +90 -0
- package/lib/utils/install-extraneous.js +120 -0
- package/lib/utils/install-tarball-cache.d.ts +37 -9
- package/lib/utils/install-tarball-cache.js +59 -14
- package/lib/utils/normalize-bundler-options.js +11 -0
- package/lib/utils/publish-pins.d.ts +38 -0
- package/lib/utils/publish-pins.js +47 -0
- package/lib/utils/publish-readback.d.ts +103 -17
- package/lib/utils/publish-readback.js +326 -47
- package/lib/utils/run-gjs.js +82 -6
- package/lib/utils/ship/appimage.d.ts +24 -4
- package/lib/utils/ship/appimage.js +51 -6
- package/lib/utils/ship/formats.js +44 -11
- package/lib/utils/ship/icns.d.ts +14 -0
- package/lib/utils/ship/icns.js +83 -0
- package/lib/utils/ship/ico.d.ts +25 -0
- package/lib/utils/ship/ico.js +120 -0
- package/lib/utils/ship/icons.d.ts +191 -0
- package/lib/utils/ship/icons.js +398 -0
- package/lib/utils/ship/launcher.js +16 -1
- package/lib/utils/ship/layout.d.ts +32 -0
- package/lib/utils/ship/layout.js +112 -38
- package/lib/utils/ship/msi.d.ts +1 -1
- package/lib/utils/ship/msi.js +30 -5
- package/lib/utils/ship/pe-launcher.d.ts +18 -0
- package/lib/utils/ship/pe-launcher.js +125 -4
- package/lib/utils/ship/plan.d.ts +1 -34
- package/lib/utils/ship/plan.js +7 -56
- package/lib/utils/ship/plist.d.ts +20 -10
- package/lib/utils/ship/plist.js +29 -12
- package/lib/utils/ship/schemas.d.ts +46 -0
- package/lib/utils/ship/schemas.js +92 -11
- package/lib/utils/ship/settings.js +3 -2
- package/package.json +20 -20
|
@@ -2,6 +2,8 @@ import type { LayoutMetadataInput } from './layout.js';
|
|
|
2
2
|
/** Where the two files live inside a bundle. Apple's names, not ours. */
|
|
3
3
|
export declare const BUNDLE_INFO_PLIST = "Contents/Info.plist";
|
|
4
4
|
export declare const BUNDLE_PKGINFO = "Contents/PkgInfo";
|
|
5
|
+
/** Where `CFBundleIconFile` is resolved: the bundle's resources directory, and nowhere else. */
|
|
6
|
+
export declare const BUNDLE_RESOURCES = "Contents/Resources";
|
|
5
7
|
/**
|
|
6
8
|
* Render `Contents/Info.plist`.
|
|
7
9
|
*
|
|
@@ -30,19 +32,12 @@ export declare const BUNDLE_PKGINFO = "Contents/PkgInfo";
|
|
|
30
32
|
* release). Emitting `version` twice would throw the distinction away on the one
|
|
31
33
|
* OS that has a field for it.
|
|
32
34
|
*
|
|
33
|
-
* KEYS DELIBERATELY ABSENT are listed in this module's header.
|
|
34
|
-
* is the one a reader will reach for first, and it is absent for a reason that
|
|
35
|
-
* outlives the key: M2a ships NO icon. `png2icns`, `icnsutil` and `iconutil` are
|
|
36
|
-
* all absent from this workstation and from the CI image, so an `.icns` written
|
|
37
|
-
* here could only be read back by a reader written here — `selfReading: true`,
|
|
38
|
-
* which `flatpak.spec.ts` reds. The unblocker is an independent Linux ICNS reader
|
|
39
|
-
* entering the CI image; until one does, the hicolor PNG/SVG the payload already
|
|
40
|
-
* carries stays the only icon, unread on macOS.
|
|
35
|
+
* KEYS DELIBERATELY ABSENT are listed in this module's header.
|
|
41
36
|
*
|
|
42
37
|
* A TWELFTH KEY, `ATSApplicationFontsPath`, is emitted when the bundle carries
|
|
43
38
|
* faces, and it is the first one here NOT cited to `refs/` — so the exception is
|
|
44
39
|
* stated rather than left to be noticed (ADR 0038). The rule this module opens
|
|
45
|
-
* with exists against DECORATION: the
|
|
40
|
+
* with exists against DECORATION: the four absent keys are cosmetic, nothing a
|
|
46
41
|
* reader here can open contains them, and emitting one would be a guess with no
|
|
47
42
|
* observable behind it. This key is a MECHANISM, and its citation is Apple's own
|
|
48
43
|
* *Information Property List Key Reference*, which states the scope in the terms
|
|
@@ -51,6 +46,21 @@ export declare const BUNDLE_PKGINFO = "Contents/PkgInfo";
|
|
|
51
46
|
* app and not for the system as a whole."* The value is a path relative to
|
|
52
47
|
* `Contents/Resources`.
|
|
53
48
|
*
|
|
49
|
+
* A THIRTEENTH, `CFBundleIconFile`, is the same shape of exception and closes the
|
|
50
|
+
* gap the previous version of this comment recorded: M2a shipped NO icon because
|
|
51
|
+
* nothing on Linux could read an `.icns` back. Two things changed. `icns.ts` now
|
|
52
|
+
* writes the container from rasters `icons.ts` renders through librsvg, and the
|
|
53
|
+
* readers were measured rather than assumed: CPython `struct` walks the element
|
|
54
|
+
* table in `verify-app-plist.py` (in CI), Pillow 12.3 opens all ten elements (on
|
|
55
|
+
* the workstation), `icns2png` reads three of ten and is NOT relied on, and
|
|
56
|
+
* `iconutil` on macOS is the reader with authority — a VM run, recorded with the
|
|
57
|
+
* change that lands this key. The citation is the same key reference: *"The name
|
|
58
|
+
* of the bundle's icon file, located in the Resources folder"*, and the
|
|
59
|
+
* measurement that motivates it is the released 0.8.0 bundle of one app on macOS
|
|
60
|
+
* 15.7 with no key, no `.icns` and the generic Finder icon. `CFBundleIconName` is
|
|
61
|
+
* NOT emitted: it names an asset-catalog entry (`Assets.car`), which this tree
|
|
62
|
+
* does not produce, and a name with no catalog is a dangling reference.
|
|
63
|
+
*
|
|
54
64
|
* It is also the only route there is. Pango on macOS is CoreText-backed, GTK is
|
|
55
65
|
* not built against fontconfig on that platform, and
|
|
56
66
|
* `pango_font_map_add_font_file()` answers `G_IO_ERROR_NOT_SUPPORTED` on the
|
|
@@ -63,7 +73,7 @@ export declare const BUNDLE_PKGINFO = "Contents/PkgInfo";
|
|
|
63
73
|
* Pango's CoreText map then holds the family, is unverified here — which is what
|
|
64
74
|
* `Layout.fontGap` says out loud rather than letting a green stage imply.
|
|
65
75
|
*/
|
|
66
|
-
export declare function renderInfoPlist(input: LayoutMetadataInput, fontsPath?: string): string;
|
|
76
|
+
export declare function renderInfoPlist(input: LayoutMetadataInput, fontsPath?: string, iconFile?: string): string;
|
|
67
77
|
/**
|
|
68
78
|
* Render `Contents/PkgInfo`: the package type and the signature, eight bytes, no
|
|
69
79
|
* newline.
|
package/lib/utils/ship/plist.js
CHANGED
|
@@ -14,8 +14,10 @@
|
|
|
14
14
|
// (`.github/ship-oracle/verify-modes.py`), and it parses the XML form.
|
|
15
15
|
//
|
|
16
16
|
// EVERY KEY BELOW IS CITED to a file in `refs/` that a real macOS toolchain
|
|
17
|
-
// produced or consumes
|
|
18
|
-
//
|
|
17
|
+
// produced or consumes, or — for the two MECHANISM keys, `ATSApplicationFontsPath`
|
|
18
|
+
// and `CFBundleIconFile` — to Apple's own key reference plus a measurement on a
|
|
19
|
+
// Mac. Keys that are merely plausible — `LSMinimumSystemVersion`,
|
|
20
|
+
// `NSHighResolutionCapable`, `LSApplicationCategoryType`,
|
|
19
21
|
// `NSHumanReadableCopyright` — are not emitted, because nothing a reader here can
|
|
20
22
|
// open contains them.
|
|
21
23
|
//
|
|
@@ -32,6 +34,8 @@
|
|
|
32
34
|
/** Where the two files live inside a bundle. Apple's names, not ours. */
|
|
33
35
|
export const BUNDLE_INFO_PLIST = 'Contents/Info.plist';
|
|
34
36
|
export const BUNDLE_PKGINFO = 'Contents/PkgInfo';
|
|
37
|
+
/** Where `CFBundleIconFile` is resolved: the bundle's resources directory, and nowhere else. */
|
|
38
|
+
export const BUNDLE_RESOURCES = 'Contents/Resources';
|
|
35
39
|
/**
|
|
36
40
|
* The four-character bundle type of an application, and the signature that says
|
|
37
41
|
* "none".
|
|
@@ -139,19 +143,12 @@ function arrayEntry(key, values) {
|
|
|
139
143
|
* release). Emitting `version` twice would throw the distinction away on the one
|
|
140
144
|
* OS that has a field for it.
|
|
141
145
|
*
|
|
142
|
-
* KEYS DELIBERATELY ABSENT are listed in this module's header.
|
|
143
|
-
* is the one a reader will reach for first, and it is absent for a reason that
|
|
144
|
-
* outlives the key: M2a ships NO icon. `png2icns`, `icnsutil` and `iconutil` are
|
|
145
|
-
* all absent from this workstation and from the CI image, so an `.icns` written
|
|
146
|
-
* here could only be read back by a reader written here — `selfReading: true`,
|
|
147
|
-
* which `flatpak.spec.ts` reds. The unblocker is an independent Linux ICNS reader
|
|
148
|
-
* entering the CI image; until one does, the hicolor PNG/SVG the payload already
|
|
149
|
-
* carries stays the only icon, unread on macOS.
|
|
146
|
+
* KEYS DELIBERATELY ABSENT are listed in this module's header.
|
|
150
147
|
*
|
|
151
148
|
* A TWELFTH KEY, `ATSApplicationFontsPath`, is emitted when the bundle carries
|
|
152
149
|
* faces, and it is the first one here NOT cited to `refs/` — so the exception is
|
|
153
150
|
* stated rather than left to be noticed (ADR 0038). The rule this module opens
|
|
154
|
-
* with exists against DECORATION: the
|
|
151
|
+
* with exists against DECORATION: the four absent keys are cosmetic, nothing a
|
|
155
152
|
* reader here can open contains them, and emitting one would be a guess with no
|
|
156
153
|
* observable behind it. This key is a MECHANISM, and its citation is Apple's own
|
|
157
154
|
* *Information Property List Key Reference*, which states the scope in the terms
|
|
@@ -160,6 +157,21 @@ function arrayEntry(key, values) {
|
|
|
160
157
|
* app and not for the system as a whole."* The value is a path relative to
|
|
161
158
|
* `Contents/Resources`.
|
|
162
159
|
*
|
|
160
|
+
* A THIRTEENTH, `CFBundleIconFile`, is the same shape of exception and closes the
|
|
161
|
+
* gap the previous version of this comment recorded: M2a shipped NO icon because
|
|
162
|
+
* nothing on Linux could read an `.icns` back. Two things changed. `icns.ts` now
|
|
163
|
+
* writes the container from rasters `icons.ts` renders through librsvg, and the
|
|
164
|
+
* readers were measured rather than assumed: CPython `struct` walks the element
|
|
165
|
+
* table in `verify-app-plist.py` (in CI), Pillow 12.3 opens all ten elements (on
|
|
166
|
+
* the workstation), `icns2png` reads three of ten and is NOT relied on, and
|
|
167
|
+
* `iconutil` on macOS is the reader with authority — a VM run, recorded with the
|
|
168
|
+
* change that lands this key. The citation is the same key reference: *"The name
|
|
169
|
+
* of the bundle's icon file, located in the Resources folder"*, and the
|
|
170
|
+
* measurement that motivates it is the released 0.8.0 bundle of one app on macOS
|
|
171
|
+
* 15.7 with no key, no `.icns` and the generic Finder icon. `CFBundleIconName` is
|
|
172
|
+
* NOT emitted: it names an asset-catalog entry (`Assets.car`), which this tree
|
|
173
|
+
* does not produce, and a name with no catalog is a dangling reference.
|
|
174
|
+
*
|
|
163
175
|
* It is also the only route there is. Pango on macOS is CoreText-backed, GTK is
|
|
164
176
|
* not built against fontconfig on that platform, and
|
|
165
177
|
* `pango_font_map_add_font_file()` answers `G_IO_ERROR_NOT_SUPPORTED` on the
|
|
@@ -172,7 +184,7 @@ function arrayEntry(key, values) {
|
|
|
172
184
|
* Pango's CoreText map then holds the family, is unverified here — which is what
|
|
173
185
|
* `Layout.fontGap` says out loud rather than letting a green stage imply.
|
|
174
186
|
*/
|
|
175
|
-
export function renderInfoPlist(input, fontsPath) {
|
|
187
|
+
export function renderInfoPlist(input, fontsPath, iconFile) {
|
|
176
188
|
const name = assertPlistText(input.name, 'CFBundleName', 'gjsify.ship.name');
|
|
177
189
|
const executable = assertPlistText(input.binaryName, 'CFBundleExecutable', 'gjsify.ship.binaryName');
|
|
178
190
|
const appId = assertPlistText(input.appId, 'CFBundleIdentifier', 'gjsify.ship.appId');
|
|
@@ -195,6 +207,11 @@ export function renderInfoPlist(input, fontsPath) {
|
|
|
195
207
|
stringEntry('CFBundleDevelopmentRegion', 'en'),
|
|
196
208
|
stringEntry('CFBundleDisplayName', name),
|
|
197
209
|
stringEntry('CFBundleExecutable', executable),
|
|
210
|
+
// Between Executable and Identifier is where the alphabet puts it. Absent,
|
|
211
|
+
// not empty, for a bundle that carries no icon (`kind: 'cli'`): an empty
|
|
212
|
+
// name is a file lookup that fails, which macOS answers with the same
|
|
213
|
+
// generic icon and no diagnostic.
|
|
214
|
+
...(iconFile === undefined ? [] : [stringEntry('CFBundleIconFile', iconFile)]),
|
|
198
215
|
stringEntry('CFBundleIdentifier', appId),
|
|
199
216
|
stringEntry('CFBundleInfoDictionaryVersion', '6.0'),
|
|
200
217
|
stringEntry('CFBundleName', name),
|
|
@@ -59,3 +59,49 @@ export interface CompileSchemasInput {
|
|
|
59
59
|
* anyone claims otherwise.
|
|
60
60
|
*/
|
|
61
61
|
export declare function compileSchemasForStage(input: CompileSchemasInput): Promise<StagedFile[]>;
|
|
62
|
+
/**
|
|
63
|
+
* The same compile, driven from a PAYLOAD instead of from the project's files.
|
|
64
|
+
*
|
|
65
|
+
* WHY A SECOND ENTRY POINT AND NOT A SECOND CALLER OF THE FIRST. The AppImage is
|
|
66
|
+
* the one format whose LAYOUT has an install step and whose ARTIFACT does not
|
|
67
|
+
* (`formats.ts`, the `appimage` row), so the compile cannot move to the place
|
|
68
|
+
* {@link compileSchemasForStage} runs: the Linux stage is SHARED with the `.deb`
|
|
69
|
+
* and the `.rpm`, whose `share/glib-2.0/schemas` is the SYSTEM directory. A cache
|
|
70
|
+
* staged there is our 700 bytes installed over every other package's schemas —
|
|
71
|
+
* regenerated by the postinst on dpkg, and REMOVED from the system on `rpm -e`.
|
|
72
|
+
* So the cache is produced on the AppImage's own pack path, into the AppDir, and
|
|
73
|
+
* nowhere else.
|
|
74
|
+
*
|
|
75
|
+
* FROM THE PAYLOAD AND NOT FROM `settings.schemaFiles`, which is the input that
|
|
76
|
+
* makes `--from-stage` work: a stage that crossed from another host carries the
|
|
77
|
+
* `.gschema.xml` bytes and not the project directory they came from. The same
|
|
78
|
+
* argument `packOne`'s header already makes for every other container here.
|
|
79
|
+
*
|
|
80
|
+
* `undefined` RATHER THAN AN EMPTY LIST when the payload has no schema, because
|
|
81
|
+
* the caller has to tell "nothing to compile" from "a cache is expected" — see
|
|
82
|
+
* `assertAppImageIsPackable`, which refuses the second case.
|
|
83
|
+
*/
|
|
84
|
+
export declare function compileSchemasForPayload(input: {
|
|
85
|
+
payload: readonly {
|
|
86
|
+
path: string;
|
|
87
|
+
data: Uint8Array;
|
|
88
|
+
}[];
|
|
89
|
+
workDir: string;
|
|
90
|
+
}): Promise<{
|
|
91
|
+
path: string;
|
|
92
|
+
mode: number;
|
|
93
|
+
data: Uint8Array;
|
|
94
|
+
} | undefined>;
|
|
95
|
+
/**
|
|
96
|
+
* Whether a prefix-relative payload path is a GSettings schema SOURCE.
|
|
97
|
+
*
|
|
98
|
+
* Exported because two modules ask it of the same payload and a second spelling
|
|
99
|
+
* would let them disagree: this module decides what to compile, and
|
|
100
|
+
* `assertAppImageIsPackable` decides whether a compiled cache was owed.
|
|
101
|
+
*
|
|
102
|
+
* The extension is `glib-compile-schemas`'s own — it reads `*.gschema.xml` from
|
|
103
|
+
* the directory it is given and ignores everything else — so a payload that
|
|
104
|
+
* staged `foo.xml` under `share/glib-2.0/schemas` is a file GSettings never reads
|
|
105
|
+
* and this correctly says nothing about it.
|
|
106
|
+
*/
|
|
107
|
+
export declare function isSchemaSource(path: string): boolean;
|
|
@@ -10,6 +10,19 @@
|
|
|
10
10
|
// installs and does not start, which is the class this whole command exists
|
|
11
11
|
// against.
|
|
12
12
|
//
|
|
13
|
+
// AND THE PREDICATE IS THE ARTIFACT, NOT THE LAYOUT — which is what the first
|
|
14
|
+
// version of this module got wrong and what the AppImage measured. The condition
|
|
15
|
+
// was written as `layout.os === 'linux' ? [] : compile` (`commands/ship.ts`), and
|
|
16
|
+
// it stood for a year because on Linux every format DID have an install step.
|
|
17
|
+
// An AppImage has none — that is the entire point of the format — so it inherited
|
|
18
|
+
// the Linux layout, inherited the skip, and shipped an artifact that died on
|
|
19
|
+
// `Gio.Settings.new()` at its first line. Learn6502 0.8.0's AppImage, measured:
|
|
20
|
+
//
|
|
21
|
+
// JS ERROR: Error: GSettings schema eu.jumplink.Learn6502 not found
|
|
22
|
+
//
|
|
23
|
+
// A layout is not a claim about install steps. {@link compileSchemasForPayload}
|
|
24
|
+
// is what the format that has none calls for itself.
|
|
25
|
+
//
|
|
13
26
|
// AT STAGE TIME, not at pack time, and that is the decision worth stating.
|
|
14
27
|
// A stage is a deliverable in its own right — it is what crosses to the host
|
|
15
28
|
// that finishes a `.dmg` or an `.msi` — and the warning `gjsify ship` prints
|
|
@@ -25,8 +38,8 @@
|
|
|
25
38
|
// declare it: they wrap a tree that is already assembled, so a `--from-stage`
|
|
26
39
|
// pack of one needs no GLib at all (the `macos-app-dmg` row says so).
|
|
27
40
|
import { execFile } from 'node:child_process';
|
|
28
|
-
import { basename, join } from 'node:path';
|
|
29
|
-
import { copyFileSync, mkdirSync, rmSync } from 'node:fs';
|
|
41
|
+
import { basename, join, posix } from 'node:path';
|
|
42
|
+
import { copyFileSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
30
43
|
import { promisify } from 'node:util';
|
|
31
44
|
import { SHARE } from './share-dirs.js';
|
|
32
45
|
const execFileAsync = promisify(execFile);
|
|
@@ -90,13 +103,88 @@ export async function compileSchemasForStage(input) {
|
|
|
90
103
|
mkdirSync(input.workDir, { recursive: true });
|
|
91
104
|
for (const schema of input.schemaFiles)
|
|
92
105
|
copyFileSync(schema, join(input.workDir, basename(schema)));
|
|
106
|
+
await runSchemaCompiler(input.workDir);
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
path: SCHEMA_CACHE,
|
|
110
|
+
mode: 0o644,
|
|
111
|
+
source: { kind: 'file', path: join(input.workDir, 'gschemas.compiled') },
|
|
112
|
+
},
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The same compile, driven from a PAYLOAD instead of from the project's files.
|
|
117
|
+
*
|
|
118
|
+
* WHY A SECOND ENTRY POINT AND NOT A SECOND CALLER OF THE FIRST. The AppImage is
|
|
119
|
+
* the one format whose LAYOUT has an install step and whose ARTIFACT does not
|
|
120
|
+
* (`formats.ts`, the `appimage` row), so the compile cannot move to the place
|
|
121
|
+
* {@link compileSchemasForStage} runs: the Linux stage is SHARED with the `.deb`
|
|
122
|
+
* and the `.rpm`, whose `share/glib-2.0/schemas` is the SYSTEM directory. A cache
|
|
123
|
+
* staged there is our 700 bytes installed over every other package's schemas —
|
|
124
|
+
* regenerated by the postinst on dpkg, and REMOVED from the system on `rpm -e`.
|
|
125
|
+
* So the cache is produced on the AppImage's own pack path, into the AppDir, and
|
|
126
|
+
* nowhere else.
|
|
127
|
+
*
|
|
128
|
+
* FROM THE PAYLOAD AND NOT FROM `settings.schemaFiles`, which is the input that
|
|
129
|
+
* makes `--from-stage` work: a stage that crossed from another host carries the
|
|
130
|
+
* `.gschema.xml` bytes and not the project directory they came from. The same
|
|
131
|
+
* argument `packOne`'s header already makes for every other container here.
|
|
132
|
+
*
|
|
133
|
+
* `undefined` RATHER THAN AN EMPTY LIST when the payload has no schema, because
|
|
134
|
+
* the caller has to tell "nothing to compile" from "a cache is expected" — see
|
|
135
|
+
* `assertAppImageIsPackable`, which refuses the second case.
|
|
136
|
+
*/
|
|
137
|
+
export async function compileSchemasForPayload(input) {
|
|
138
|
+
const sources = input.payload.filter((entry) => isSchemaSource(entry.path));
|
|
139
|
+
if (sources.length === 0)
|
|
140
|
+
return undefined;
|
|
141
|
+
rmSync(input.workDir, { recursive: true, force: true, maxRetries: 5 });
|
|
142
|
+
mkdirSync(input.workDir, { recursive: true });
|
|
143
|
+
for (const source of sources) {
|
|
144
|
+
// `posix.basename` AND NOT `basename`, which the function above correctly
|
|
145
|
+
// uses one screen up. The two take different kinds of string: that one is
|
|
146
|
+
// handed a path read off THIS filesystem, where the host is the authority;
|
|
147
|
+
// this one is handed a `PayloadEntry.path`, which is POSIX-separated by its
|
|
148
|
+
// own type contract and built with `posix.join`. On win32 the host-aware
|
|
149
|
+
// `basename` also separates on `\`, so a Linux schema whose filename
|
|
150
|
+
// legitimately contains a backslash would be silently truncated while
|
|
151
|
+
// assembling a payload that is not the host's.
|
|
152
|
+
writeFileSync(join(input.workDir, posix.basename(source.path)), source.data);
|
|
153
|
+
}
|
|
154
|
+
await runSchemaCompiler(input.workDir);
|
|
155
|
+
return { path: SCHEMA_CACHE, mode: 0o644, data: readFileSync(join(input.workDir, 'gschemas.compiled')) };
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Whether a prefix-relative payload path is a GSettings schema SOURCE.
|
|
159
|
+
*
|
|
160
|
+
* Exported because two modules ask it of the same payload and a second spelling
|
|
161
|
+
* would let them disagree: this module decides what to compile, and
|
|
162
|
+
* `assertAppImageIsPackable` decides whether a compiled cache was owed.
|
|
163
|
+
*
|
|
164
|
+
* The extension is `glib-compile-schemas`'s own — it reads `*.gschema.xml` from
|
|
165
|
+
* the directory it is given and ignores everything else — so a payload that
|
|
166
|
+
* staged `foo.xml` under `share/glib-2.0/schemas` is a file GSettings never reads
|
|
167
|
+
* and this correctly says nothing about it.
|
|
168
|
+
*/
|
|
169
|
+
export function isSchemaSource(path) {
|
|
170
|
+
return path.startsWith(`${SHARE.schemas}/`) && path.endsWith('.gschema.xml');
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* `glib-compile-schemas --strict` over a directory, with the two failures named.
|
|
174
|
+
*
|
|
175
|
+
* Split out when the AppImage needed the same compile from different bytes. The
|
|
176
|
+
* MESSAGES are the reason it is one function rather than two copies: they are the
|
|
177
|
+
* whole value of this module over a bare `execFile`, and an ENOENT that named the
|
|
178
|
+
* package on one path and not the other is the drift this shape cannot have.
|
|
179
|
+
*/
|
|
180
|
+
async function runSchemaCompiler(workDir) {
|
|
93
181
|
try {
|
|
94
|
-
await execFileAsync(SCHEMA_COMPILER, ['--strict', `--targetdir=${
|
|
182
|
+
await execFileAsync(SCHEMA_COMPILER, ['--strict', `--targetdir=${workDir}`, workDir]);
|
|
95
183
|
}
|
|
96
184
|
catch (error) {
|
|
97
185
|
const failure = error;
|
|
98
186
|
if (failure.code === 'ENOENT') {
|
|
99
|
-
throw new Error(`gjsify ship: this
|
|
187
|
+
throw new Error(`gjsify ship: this artifact has no install step, so \`${SCHEMA_COMPILER}\` has to run HERE to ` +
|
|
100
188
|
`turn the payload's schemas into \`${SCHEMA_CACHE}\` — and it is not on PATH. ` +
|
|
101
189
|
`Install it (${SCHEMA_COMPILER_HINT}). Without the compiled cache the launcher points ` +
|
|
102
190
|
'XDG_DATA_DIRS at a schema directory GSettings aborts on, so the bundle would build and ' +
|
|
@@ -108,11 +196,4 @@ export async function compileSchemasForStage(input) {
|
|
|
108
196
|
'cache\n is written without it, so the app still aborts on the schema that was dropped. ' +
|
|
109
197
|
'Fix the\n file it names, or drop it from `gjsify.ship.schemas`.');
|
|
110
198
|
}
|
|
111
|
-
return [
|
|
112
|
-
{
|
|
113
|
-
path: SCHEMA_CACHE,
|
|
114
|
-
mode: 0o644,
|
|
115
|
-
source: { kind: 'file', path: join(input.workDir, 'gschemas.compiled') },
|
|
116
|
-
},
|
|
117
|
-
];
|
|
118
199
|
}
|
|
@@ -175,8 +175,9 @@ export function resolveShipSettings(input) {
|
|
|
175
175
|
const description = descriptionParagraphs(metadata.description) ?? [summary];
|
|
176
176
|
const sections = sectionsFor(metadata.categories);
|
|
177
177
|
if (kind === 'app' && discovered.iconFiles.length === 0) {
|
|
178
|
-
warnings.push(`gjsify ship: no icon found — the installed app will show a placeholder in menus and app stores
|
|
179
|
-
'
|
|
178
|
+
warnings.push(`gjsify ship: no icon found — the installed app will show a placeholder in menus and app stores ` +
|
|
179
|
+
'on Linux, and the darwin and windows layouts refuse to stage without one. Point ' +
|
|
180
|
+
'`gjsify.ship.icon` at an SVG (or a directory of sized PNGs).');
|
|
180
181
|
}
|
|
181
182
|
// Resolved here rather than in the packer, because the packer may run on a
|
|
182
183
|
// host with no `package.json` at all (ADR 0024 § A2) — and because the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "CLI for Gjsify",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
"build:test:node": "node lib/index.js build src/test.mts --app node --outfile dist/test.node.mjs",
|
|
132
132
|
"test:node": "node dist/test.node.mjs",
|
|
133
133
|
"test:bun": "bun dist/test.node.mjs",
|
|
134
|
-
"test:deno": "deno run -A --no-lock --node-modules-dir=none dist/test.node.mjs",
|
|
134
|
+
"test:deno": "deno run -A --no-lock --node-modules-dir=none --min-dep-age=0 dist/test.node.mjs",
|
|
135
135
|
"test:cross-runtime": "gjsify run build:test:node && gjsify run test:node && gjsify run test:bun && gjsify run test:deno",
|
|
136
136
|
"test": "gjsify run build:test:node && gjsify run test:node"
|
|
137
137
|
},
|
|
@@ -142,21 +142,21 @@
|
|
|
142
142
|
"cli"
|
|
143
143
|
],
|
|
144
144
|
"dependencies": {
|
|
145
|
-
"@gjsify/buffer": "^0.
|
|
146
|
-
"@gjsify/create-app": "^0.
|
|
147
|
-
"@gjsify/node-globals": "^0.
|
|
148
|
-
"@gjsify/node-polyfills": "^0.
|
|
149
|
-
"@gjsify/npm-registry": "^0.
|
|
150
|
-
"@gjsify/resolve-npm": "^0.
|
|
151
|
-
"@gjsify/rolldown-plugin-gjsify": "^0.
|
|
152
|
-
"@gjsify/vite-plugin-blueprint": "^0.
|
|
153
|
-
"@gjsify/rolldown-plugin-pnp": "^0.
|
|
154
|
-
"@gjsify/semver": "^0.
|
|
155
|
-
"@gjsify/tar": "^0.
|
|
156
|
-
"@gjsify/tsc": "^0.
|
|
157
|
-
"@gjsify/utils": "^0.
|
|
158
|
-
"@gjsify/web-polyfills": "^0.
|
|
159
|
-
"@gjsify/workspace": "^0.
|
|
145
|
+
"@gjsify/buffer": "^0.52.0",
|
|
146
|
+
"@gjsify/create-app": "^0.52.0",
|
|
147
|
+
"@gjsify/node-globals": "^0.52.0",
|
|
148
|
+
"@gjsify/node-polyfills": "^0.52.0",
|
|
149
|
+
"@gjsify/npm-registry": "^0.52.0",
|
|
150
|
+
"@gjsify/resolve-npm": "^0.52.0",
|
|
151
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.52.0",
|
|
152
|
+
"@gjsify/vite-plugin-blueprint": "^0.52.0",
|
|
153
|
+
"@gjsify/rolldown-plugin-pnp": "^0.52.0",
|
|
154
|
+
"@gjsify/semver": "^0.52.0",
|
|
155
|
+
"@gjsify/tar": "^0.52.0",
|
|
156
|
+
"@gjsify/tsc": "^0.52.0",
|
|
157
|
+
"@gjsify/utils": "^0.52.0",
|
|
158
|
+
"@gjsify/web-polyfills": "^0.52.0",
|
|
159
|
+
"@gjsify/workspace": "^0.52.0",
|
|
160
160
|
"acorn": "^8.17.0",
|
|
161
161
|
"cosmiconfig": "^9.0.2",
|
|
162
162
|
"get-tsconfig": "^4.14.0",
|
|
@@ -165,13 +165,13 @@
|
|
|
165
165
|
"yargs": "^18.0.0"
|
|
166
166
|
},
|
|
167
167
|
"devDependencies": {
|
|
168
|
-
"@gjsify/unit": "^0.
|
|
168
|
+
"@gjsify/unit": "^0.52.0",
|
|
169
169
|
"@types/yargs": "^17.0.35",
|
|
170
170
|
"typescript": "^6.0.3"
|
|
171
171
|
},
|
|
172
172
|
"peerDependencies": {
|
|
173
|
-
"@gjsify/oxfmt-native": "^0.
|
|
174
|
-
"@gjsify/rolldown-native": "^0.
|
|
173
|
+
"@gjsify/oxfmt-native": "^0.52.0",
|
|
174
|
+
"@gjsify/rolldown-native": "^0.52.0"
|
|
175
175
|
},
|
|
176
176
|
"peerDependenciesMeta": {
|
|
177
177
|
"@gjsify/oxfmt-native": {
|