@gjsify/cli 0.64.4 → 0.64.6
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 +263 -263
- package/lib/commands/ship.js +20 -2
- 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 +22 -4
- package/lib/utils/ship/app-runtime.js +45 -16
- package/lib/utils/ship/gtk-runtime-acquire.d.ts +36 -0
- package/lib/utils/ship/gtk-runtime-acquire.js +59 -0
- package/lib/utils/ship/launcher.js +20 -7
- package/lib/utils/ship/layout.d.ts +23 -0
- package/lib/utils/ship/layout.js +32 -1
- package/lib/utils/ship/node-runtime.js +8 -6
- package/package.json +20 -20
package/lib/utils/ship/layout.js
CHANGED
|
@@ -75,6 +75,28 @@ function appBundleDir(identity) {
|
|
|
75
75
|
}
|
|
76
76
|
return `${identity.name}.app`;
|
|
77
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Refuse an `identity.name` that cannot be the carried interpreter's own file
|
|
80
|
+
* name under `Contents/Helpers` (`dirs.helpers`) — `appRuntimePaths` in
|
|
81
|
+
* `utils/ship/app-runtime.ts` is the only caller.
|
|
82
|
+
*
|
|
83
|
+
* A SUPERSET of {@link BUNDLE_NAME_FORBIDDEN}, not a restatement: the bundle
|
|
84
|
+
* directory wraps the same string in `.app`, so a name of "." or ".." becomes
|
|
85
|
+
* "..app" or "....app" — both ordinary directory names — while this leaf is
|
|
86
|
+
* `identity.name` taken LITERALLY, where "." and ".." name the directory
|
|
87
|
+
* itself and its parent. An empty name and a NUL byte are refused for the same
|
|
88
|
+
* reason `windowsProgramDirName` refuses them one OS over: neither is a name a
|
|
89
|
+
* filesystem can hold.
|
|
90
|
+
*/
|
|
91
|
+
export function assertUsableAsHelperName(name) {
|
|
92
|
+
if (name === '' || name === '.' || name === '..' || BUNDLE_NAME_FORBIDDEN.test(name) || name.includes('\u0000')) {
|
|
93
|
+
throw new Error(`gjsify ship: the macOS layout would name the carried interpreter "${name}" under ` +
|
|
94
|
+
'`Contents/Helpers`, and that is not usable as a file name — empty, ".", ".." and anything ' +
|
|
95
|
+
'containing "/", ":", "\\" or a NUL byte are refused. Set `gjsify.ship.name` to the display ' +
|
|
96
|
+
'name you want.');
|
|
97
|
+
}
|
|
98
|
+
return name;
|
|
99
|
+
}
|
|
78
100
|
/**
|
|
79
101
|
* The rasters a row writes its icon from, or nothing for a CLI — and a refusal
|
|
80
102
|
* for an application that arrives without them.
|
|
@@ -117,6 +139,7 @@ export const LAYOUTS = {
|
|
|
117
139
|
native: `lib/${identity.binaryName}/gi`,
|
|
118
140
|
data: 'share',
|
|
119
141
|
other: '',
|
|
142
|
+
helpers: '',
|
|
120
143
|
}),
|
|
121
144
|
// THE RASTERS THE BUILD-TIME READERS OF THE THEME NEED, and the one row
|
|
122
145
|
// whose icon is written as ordinary payload files rather than into a
|
|
@@ -280,6 +303,14 @@ export const LAYOUTS = {
|
|
|
280
303
|
native: `${app}/Contents/Resources/native`,
|
|
281
304
|
data: `${app}/Contents/Resources/share`,
|
|
282
305
|
other: `${app}/Contents/Resources`,
|
|
306
|
+
// Apple's own nested-code location (alongside `Frameworks`,
|
|
307
|
+
// `PlugIns`, `XPCServices` — `codesign(1)`'s bundle format), and the
|
|
308
|
+
// one place `appRuntimePaths` can put the interpreter under a name
|
|
309
|
+
// that is not `binaryName`: `Contents/MacOS` already holds the
|
|
310
|
+
// launcher, and APFS is case-insensitive by default, so a second
|
|
311
|
+
// file there named `<BinaryName>` collides with it bytewise even
|
|
312
|
+
// when the casing differs.
|
|
313
|
+
helpers: `${app}/Contents/Helpers`,
|
|
283
314
|
};
|
|
284
315
|
},
|
|
285
316
|
// The two files that make the directory a BUNDLE. Without `Info.plist`
|
|
@@ -411,7 +442,7 @@ export const LAYOUTS = {
|
|
|
411
442
|
// LOADER: `lib/` is what the launcher prepends to `PATH`, because Windows
|
|
412
443
|
// has no rpath — a DLL is found on `PATH`, in the directory of the image
|
|
413
444
|
// that loaded it, or not at all.
|
|
414
|
-
dirs: () => ({ launcher: '', bundle: 'app', native: 'lib', data: 'share', other: '' }),
|
|
445
|
+
dirs: () => ({ launcher: '', bundle: 'app', native: 'lib', data: 'share', other: '', helpers: '' }),
|
|
415
446
|
// NO METADATA, and one PROGRAM. A Windows installer's metadata lives in the
|
|
416
447
|
// `.msi`'s own tables, not in a file inside the program directory —
|
|
417
448
|
// `msi.ts` puts every such fact in the `Product`/`Package` attributes of the
|
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/cli",
|
|
3
|
-
"version": "0.64.
|
|
3
|
+
"version": "0.64.6",
|
|
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.6",
|
|
146
|
+
"@gjsify/buffer": "^0.64.6",
|
|
147
|
+
"@gjsify/create-app": "^0.64.6",
|
|
148
|
+
"@gjsify/node-globals": "^0.64.6",
|
|
149
|
+
"@gjsify/node-polyfills": "^0.64.6",
|
|
150
|
+
"@gjsify/npm-registry": "^0.64.6",
|
|
151
|
+
"@gjsify/resolve-npm": "^0.64.6",
|
|
152
|
+
"@gjsify/rolldown-plugin-gjsify": "^0.64.6",
|
|
153
|
+
"@gjsify/vite-plugin-blueprint": "^0.64.6",
|
|
154
|
+
"@gjsify/rolldown-plugin-pnp": "^0.64.6",
|
|
155
|
+
"@gjsify/semver": "^0.64.6",
|
|
156
|
+
"@gjsify/tar": "^0.64.6",
|
|
157
|
+
"@gjsify/tsc": "^0.64.6",
|
|
158
|
+
"@gjsify/utils": "^0.64.6",
|
|
159
|
+
"@gjsify/web-polyfills": "^0.64.6",
|
|
160
|
+
"@gjsify/workspace": "^0.64.6",
|
|
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.6",
|
|
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.6",
|
|
175
|
+
"@gjsify/rolldown-native": "^0.64.6"
|
|
176
176
|
},
|
|
177
177
|
"peerDependenciesMeta": {
|
|
178
178
|
"@gjsify/oxfmt-native": {
|