@gjsify/cli 0.36.0 → 0.38.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 +169 -169
- package/lib/actions/build.d.ts +7 -0
- package/lib/actions/build.js +18 -3
- package/lib/bundler-pick.js +61 -87
- package/lib/cli-fail.d.ts +4 -7
- package/lib/cli-fail.js +29 -55
- package/lib/commands/affected.js +161 -286
- package/lib/commands/install.d.ts +63 -66
- package/lib/commands/install.js +372 -536
- package/lib/config.d.ts +14 -0
- package/lib/config.js +18 -1
- package/lib/templates/install.mjs.tmpl +164 -75
- package/lib/types/cli-build-options.d.ts +33 -67
- package/lib/types/command.d.ts +9 -12
- package/lib/types/config-data.d.ts +137 -221
- package/lib/utils/auth-npmrc.d.ts +5 -10
- package/lib/utils/auth-npmrc.js +11 -21
- package/lib/utils/bin-shim.d.ts +40 -25
- package/lib/utils/bin-shim.js +51 -26
- package/lib/utils/clear-targets.d.ts +8 -11
- package/lib/utils/clear-targets.js +22 -29
- package/lib/utils/copy-targets.d.ts +13 -19
- package/lib/utils/copy-targets.js +31 -44
- package/lib/utils/dep-aggregation.d.ts +7 -15
- package/lib/utils/dep-aggregation.js +9 -22
- package/lib/utils/detect-native-packages.d.ts +89 -122
- package/lib/utils/detect-native-packages.js +119 -169
- package/lib/utils/dir-link.d.ts +29 -48
- package/lib/utils/dir-link.js +33 -56
- package/lib/utils/discover-showcases.d.ts +6 -7
- package/lib/utils/discover-showcases.js +11 -15
- package/lib/utils/dlx-cache.d.ts +29 -38
- package/lib/utils/dlx-cache.js +53 -63
- package/lib/utils/force-exit.d.ts +0 -3
- package/lib/utils/force-exit.js +13 -24
- package/lib/utils/gi-search-path.d.ts +16 -24
- package/lib/utils/gi-search-path.js +54 -82
- package/lib/utils/gjs-bundle-guard.d.ts +5 -13
- package/lib/utils/gjs-bundle-guard.js +35 -57
- package/lib/utils/gjs-source-escape.d.ts +2 -2
- package/lib/utils/gjs-source-escape.js +21 -39
- package/lib/utils/gjsify-shim.d.ts +17 -20
- package/lib/utils/gjsify-shim.js +80 -120
- package/lib/utils/html-entry.d.ts +8 -12
- package/lib/utils/html-entry.js +19 -28
- package/lib/utils/install-backend-native.d.ts +123 -161
- package/lib/utils/install-backend-native.js +536 -737
- package/lib/utils/install-backend.d.ts +42 -57
- package/lib/utils/install-backend.js +16 -21
- package/lib/utils/install-cache-fs.d.ts +10 -15
- package/lib/utils/install-cache-fs.js +18 -26
- package/lib/utils/install-lock.d.ts +5 -6
- package/lib/utils/install-lock.js +46 -65
- package/lib/utils/install-packument-cache.d.ts +27 -33
- package/lib/utils/install-packument-cache.js +44 -57
- package/lib/utils/install-progress.d.ts +2 -9
- package/lib/utils/install-progress.js +14 -39
- package/lib/utils/install-tarball-cache.d.ts +14 -20
- package/lib/utils/install-tarball-cache.js +41 -59
- package/lib/utils/library-output.d.ts +9 -22
- package/lib/utils/library-output.js +19 -37
- package/lib/utils/load-npmrc.d.ts +5 -6
- package/lib/utils/load-npmrc.js +18 -27
- package/lib/utils/node-bundle-guard.d.ts +4 -8
- package/lib/utils/node-bundle-guard.js +21 -35
- package/lib/utils/node-script.js +40 -53
- package/lib/utils/node-version.d.ts +5 -14
- package/lib/utils/node-version.js +15 -24
- package/lib/utils/normalize-bundler-options.d.ts +7 -11
- package/lib/utils/normalize-bundler-options.js +24 -42
- package/lib/utils/npm-oidc.d.ts +23 -37
- package/lib/utils/npm-oidc.js +28 -53
- package/lib/utils/npm-otp-cache.d.ts +4 -4
- package/lib/utils/npm-otp-cache.js +20 -25
- package/lib/utils/npm-otp.d.ts +20 -30
- package/lib/utils/npm-otp.js +32 -51
- package/lib/utils/onboard-probe.d.ts +7 -13
- package/lib/utils/onboard-probe.js +16 -27
- package/lib/utils/parse-spec.d.ts +3 -3
- package/lib/utils/parse-spec.js +4 -5
- package/lib/utils/pkg-json-edit.d.ts +7 -12
- package/lib/utils/pkg-json-edit.js +13 -26
- package/lib/utils/pkg-json.d.ts +11 -18
- package/lib/utils/pkg-json.js +19 -28
- package/lib/utils/prefixed-output.d.ts +3 -4
- package/lib/utils/prefixed-output.js +13 -19
- package/lib/utils/prompt.d.ts +3 -4
- package/lib/utils/prompt.js +14 -18
- package/lib/utils/publish-diagnose.d.ts +11 -16
- package/lib/utils/publish-diagnose.js +15 -28
- package/lib/utils/publish-headers.d.ts +7 -11
- package/lib/utils/publish-headers.js +36 -65
- package/lib/utils/publishable-packages.d.ts +4 -6
- package/lib/utils/publishable-packages.js +14 -18
- package/lib/utils/resolve-gjs-entry.d.ts +5 -8
- package/lib/utils/resolve-gjs-entry.js +10 -27
- package/lib/utils/resolve-npm-package.d.ts +6 -11
- package/lib/utils/resolve-npm-package.js +29 -63
- package/lib/utils/resolve-plugin-by-name.d.ts +11 -19
- package/lib/utils/resolve-plugin-by-name.js +9 -14
- package/lib/utils/run-gjs.d.ts +16 -21
- package/lib/utils/run-gjs.js +31 -56
- package/lib/utils/run-lifecycle-script.d.ts +5 -9
- package/lib/utils/run-lifecycle-script.js +23 -42
- package/lib/utils/run-node.d.ts +21 -33
- package/lib/utils/run-node.js +43 -64
- package/lib/utils/runtimes.d.ts +25 -35
- package/lib/utils/runtimes.js +34 -46
- package/lib/utils/spawn.d.ts +32 -48
- package/lib/utils/spawn.js +51 -84
- package/lib/utils/stdin.d.ts +2 -2
- package/lib/utils/stdin.js +10 -25
- package/lib/utils/suggest.d.ts +6 -7
- package/lib/utils/suggest.js +8 -10
- package/lib/utils/system-gi.d.ts +36 -27
- package/lib/utils/system-gi.js +85 -114
- package/lib/utils/trust-registry.d.ts +4 -8
- package/lib/utils/trust-registry.js +7 -15
- package/lib/utils/win32-command.d.ts +8 -14
- package/lib/utils/win32-command.js +29 -43
- package/lib/utils/workspace-root.js +7 -12
- package/package.json +18 -18
|
@@ -2,13 +2,11 @@ import type { RolldownOptions, OutputOptions, RolldownPluginOption } from 'rolld
|
|
|
2
2
|
import type { App } from '@gjsify/rolldown-plugin-gjsify';
|
|
3
3
|
import type { ConfigDataLibrary, ConfigDataTypescript } from './index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Plugin entry resolvable by package name from the project's `node_modules
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `options`.
|
|
5
|
+
* Plugin entry resolvable by package name from the project's `node_modules`, so
|
|
6
|
+
* the plugin chain can be described in `package.json#gjsify` without dropping to
|
|
7
|
+
* a JS-form config file. The CLI imports the named module, picks `export`
|
|
8
|
+
* (default: `default`), and calls it with `options`.
|
|
10
9
|
*
|
|
11
|
-
* Example:
|
|
12
10
|
* ```jsonc
|
|
13
11
|
* { "name": "@gjsify/vite-plugin-blueprint", "options": { "minify": true } }
|
|
14
12
|
* { "name": "@gjsify/vite-plugin-gettext", "export": "msgfmtPlugin", "options": { ... } }
|
|
@@ -20,29 +18,23 @@ export interface BundlerPluginByName {
|
|
|
20
18
|
options?: unknown;
|
|
21
19
|
}
|
|
22
20
|
/**
|
|
23
|
-
* Subset of `RolldownOptions` accepted in `.gjsifyrc.js
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* `output.file` / `output.dir` here.
|
|
21
|
+
* Subset of `RolldownOptions` accepted in `.gjsifyrc.js`, a thin pass-through:
|
|
22
|
+
* the orchestrator applies platform defaults on top, so most projects only set
|
|
23
|
+
* `output.file` / `output.dir`.
|
|
27
24
|
*
|
|
28
|
-
* `output` is
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* `plugins` is widened to also accept `BundlerPluginByName` entries — these
|
|
33
|
-
* are resolved by the CLI from the project's `node_modules` before the
|
|
34
|
-
* Rolldown call.
|
|
25
|
+
* `output` is a single `OutputOptions` object — Rolldown also accepts an array
|
|
26
|
+
* for multi-output builds, but this CLI surface targets the single-output case.
|
|
27
|
+
* `plugins` additionally accepts {@link BundlerPluginByName} entries, resolved
|
|
28
|
+
* from `node_modules` before the Rolldown call.
|
|
35
29
|
*/
|
|
36
30
|
export type BundlerOptions = Omit<RolldownOptions, 'output' | 'plugins'> & {
|
|
37
31
|
output?: OutputOptions;
|
|
38
32
|
plugins?: Array<RolldownPluginOption | BundlerPluginByName>;
|
|
39
33
|
};
|
|
40
34
|
/**
|
|
41
|
-
* Legacy `esbuild?: BuildOptions` shape
|
|
42
|
-
*
|
|
43
|
-
* subset
|
|
44
|
-
*
|
|
45
|
-
* Drop in 0.5.0.
|
|
35
|
+
* Legacy `esbuild?: BuildOptions` shape, still read as a compatibility shim.
|
|
36
|
+
* Setting it logs a deprecation warning; `legacyEsbuildToRolldown` maps the
|
|
37
|
+
* supported subset into `bundler` at config-load time.
|
|
46
38
|
*/
|
|
47
39
|
export interface LegacyEsbuildOptions {
|
|
48
40
|
outfile?: string;
|
|
@@ -63,26 +55,22 @@ export interface LegacyEsbuildOptions {
|
|
|
63
55
|
loader?: Record<string, string>;
|
|
64
56
|
}
|
|
65
57
|
export interface ConfigData {
|
|
66
|
-
/** Switch on the verbose mode */
|
|
67
58
|
verbose?: boolean;
|
|
68
59
|
/**
|
|
69
|
-
*
|
|
70
|
-
* `
|
|
71
|
-
*
|
|
72
|
-
* under gjs, `node` when it runs under node/bun/deno). Consumed by the build
|
|
73
|
-
* handler and passed to `BuildAction.start`.
|
|
60
|
+
* Build target for an application build. Resolved in `Config.forBuild` as CLI
|
|
61
|
+
* flag (`--app`) > `package.json#gjsify.app` > host-runtime default (`gjs` when
|
|
62
|
+
* the CLI runs under gjs, `node` under node/bun/deno).
|
|
74
63
|
*/
|
|
75
64
|
app?: App;
|
|
76
65
|
/**
|
|
77
|
-
* Bundler-level options forwarded to Rolldown.
|
|
78
|
-
*
|
|
79
|
-
*
|
|
66
|
+
* Bundler-level options forwarded to Rolldown. The orchestrator applies
|
|
67
|
+
* platform-specific defaults on top — most projects only set `output.file` /
|
|
68
|
+
* `output.dir`.
|
|
80
69
|
*/
|
|
81
70
|
bundler?: BundlerOptions;
|
|
82
71
|
/**
|
|
83
|
-
* @deprecated Use `bundler
|
|
84
|
-
*
|
|
85
|
-
* Rolldown shape and logs a deprecation warning.
|
|
72
|
+
* @deprecated Use `bundler`. The shim maps the supported subset of esbuild
|
|
73
|
+
* fields into the equivalent Rolldown shape and logs a deprecation warning.
|
|
86
74
|
*/
|
|
87
75
|
esbuild?: LegacyEsbuildOptions;
|
|
88
76
|
library?: ConfigDataLibrary;
|
|
@@ -90,131 +78,105 @@ export interface ConfigData {
|
|
|
90
78
|
/** An array of glob patterns to exclude matches and aliases */
|
|
91
79
|
exclude?: string[];
|
|
92
80
|
/**
|
|
93
|
-
* Inject a console shim into GJS builds for clean output (no GLib prefix,
|
|
94
|
-
*
|
|
81
|
+
* Inject a console shim into GJS app builds for clean output (no GLib prefix,
|
|
82
|
+
* working ANSI colors). Default: true.
|
|
95
83
|
*/
|
|
96
84
|
consoleShim?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Comma-separated list of global identifiers to register in the bundle.
|
|
99
|
-
* See CliBuildOptions for format.
|
|
100
|
-
*/
|
|
85
|
+
/** Comma-separated global identifiers to register. Format: see CliBuildOptions. */
|
|
101
86
|
globals?: string;
|
|
102
87
|
/**
|
|
103
88
|
* Prepend a shebang to the output bundle and mark it executable.
|
|
104
89
|
*
|
|
105
|
-
* `true` →
|
|
90
|
+
* `true` → the default `#!/usr/bin/env -S gjs -m` line
|
|
106
91
|
* `false` → no shebang (default)
|
|
107
|
-
* `"…"` → custom line
|
|
108
|
-
* placeholders against `process.env
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* Example: `"shebang": "${env:GJS_CONSOLE:-/usr/bin/env -S gjs} -m"`
|
|
114
|
-
*
|
|
115
|
-
* See also `CliBuildOptions.shebang`.
|
|
92
|
+
* `"…"` → custom line, supporting `${env:NAME}` and `${env:NAME:-default}`
|
|
93
|
+
* placeholders against `process.env`; a leading `#!` is added if
|
|
94
|
+
* omitted. For outer build tools (Meson, Flatpak) that export the
|
|
95
|
+
* interpreter path, e.g.
|
|
96
|
+
* `"${env:GJS_CONSOLE:-/usr/bin/env -S gjs} -m"`.
|
|
116
97
|
*/
|
|
117
98
|
shebang?: boolean | string;
|
|
118
|
-
/**
|
|
119
|
-
* Extra module aliases layered on top of the built-in alias map.
|
|
120
|
-
* Comes from `gjsify build --alias FROM=TO`.
|
|
121
|
-
*/
|
|
99
|
+
/** Extra module aliases layered on the built-in map (`build --alias FROM=TO`). */
|
|
122
100
|
aliases?: Record<string, string>;
|
|
123
101
|
/**
|
|
124
|
-
* Global identifiers to remove from the auto-detected set before writing
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
102
|
+
* Global identifiers to remove from the auto-detected set before writing the
|
|
103
|
+
* inject stub — for false positives from dead browser-compat code in npm deps
|
|
104
|
+
* whose polyfills need unavailable native libs. `["fetch", "XMLHttpRequest"]`
|
|
105
|
+
* excludes the HTTP polyfill stack.
|
|
128
106
|
*/
|
|
129
107
|
excludeGlobals?: string[];
|
|
130
108
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
109
|
+
* Overrides for the ad-hoc bundle `gjsify run --node-script <file>` builds under
|
|
110
|
+
* GJS. Unset keys fall through to the package-level `globals` / `excludeGlobals`
|
|
111
|
+
* above, so most packages need only those. `@gjsify/adwaita-web` forced the split:
|
|
112
|
+
* its browser bundle wants the DOM registers, while the script that COMPILES its
|
|
113
|
+
* stylesheet must not have them — injecting them made that bundle demand `gi://Gdk`
|
|
114
|
+
* and believe it was running on Node (#1053).
|
|
115
|
+
*/
|
|
116
|
+
nodeScript?: {
|
|
117
|
+
globals?: string;
|
|
118
|
+
excludeGlobals?: string[];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Compile-time defines from `package.json` fields: JS identifier → dotted
|
|
122
|
+
* package.json path. Values are JSON-stringified before merging into
|
|
123
|
+
* `bundler.transform.define`.
|
|
134
124
|
*
|
|
135
|
-
* Example:
|
|
136
125
|
* ```jsonc
|
|
137
126
|
* "defineFromPackageJson": {
|
|
138
127
|
* "__PACKAGE_VERSION__": { "field": "version" },
|
|
139
128
|
* "__PACKAGE_NAME__": { "field": "name" }
|
|
140
129
|
* }
|
|
141
130
|
* ```
|
|
142
|
-
*
|
|
143
|
-
* Replaces the wrapper-script pattern (`spawnSync('gjsify', ['build',
|
|
144
|
-
* '--define', '__VERSION__=' + JSON.stringify(pkg.version)])`) used by
|
|
145
|
-
* `@ts-for-gir/cli` before this option existed.
|
|
146
131
|
*/
|
|
147
132
|
defineFromPackageJson?: Record<string, {
|
|
148
133
|
field: string;
|
|
149
134
|
}>;
|
|
150
135
|
/**
|
|
151
|
-
* Compile-time defines
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* `
|
|
155
|
-
*
|
|
156
|
-
* so consumer code can safely guard with `typeof X === 'undefined'` or
|
|
157
|
-
* `X ?? fallback`.
|
|
136
|
+
* Compile-time defines from `process.env` at config-load time, for projects
|
|
137
|
+
* whose build is driven by an outer tool (Meson, Make, CI) that exports
|
|
138
|
+
* variables. Values are JSON-stringified into `bundler.transform.define`; an
|
|
139
|
+
* unset variable with no `default` becomes the literal `undefined`, so consumers
|
|
140
|
+
* can guard with `typeof X === 'undefined'` or `X ?? fallback`.
|
|
158
141
|
*
|
|
159
|
-
* Example:
|
|
160
142
|
* ```jsonc
|
|
161
143
|
* "defineFromEnv": {
|
|
162
144
|
* "__APPLICATION_ID__": { "env": "APPLICATION_ID", "default": "org.example.App" },
|
|
163
145
|
* "__PREFIX__": { "env": "PREFIX" }
|
|
164
146
|
* }
|
|
165
147
|
* ```
|
|
166
|
-
*
|
|
167
|
-
* Designed for projects whose build is driven by an outer tool (Meson,
|
|
168
|
-
* Make, CI) that exports environment variables — avoids a wrapper script
|
|
169
|
-
* just to thread them through to the bundler.
|
|
170
148
|
*/
|
|
171
149
|
defineFromEnv?: Record<string, {
|
|
172
150
|
env: string;
|
|
173
151
|
default?: string;
|
|
174
152
|
}>;
|
|
175
153
|
/**
|
|
176
|
-
* Extension → loader-kind map for files Rolldown does not classify
|
|
177
|
-
*
|
|
178
|
-
* pattern.
|
|
154
|
+
* Extension → loader-kind map for files Rolldown does not classify natively,
|
|
155
|
+
* e.g. `{ ".ui": "text", ".glsl": "text", ".png": "dataurl" }`.
|
|
179
156
|
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* .jpg → image/jpeg, .gif → image/gif, .svg → image/svg+xml,
|
|
187
|
-
* .webp → image/webp, fallback application/octet-stream).
|
|
188
|
-
* Good for Excalibur's `ImageSource` and any library that
|
|
189
|
-
* accepts a data: URL rather than a separate asset file.
|
|
157
|
+
* `'text'` — contents as a JS string default export. GLSL shaders, `.ui`
|
|
158
|
+
* GtkBuilder XML, `.asm`.
|
|
159
|
+
* `'dataurl'` — `data:<mime>;base64,<b64>` string default export, MIME inferred
|
|
160
|
+
* from the extension (fallback `application/octet-stream`). For
|
|
161
|
+
* anything accepting a data: URL rather than a separate asset,
|
|
162
|
+
* e.g. Excalibur's `ImageSource`.
|
|
190
163
|
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
* "loaders": { ".ui": "text", ".glsl": "text", ".png": "dataurl" }
|
|
194
|
-
* ```
|
|
195
|
-
*
|
|
196
|
-
* Lives at the top level (not under `bundler`) so it doesn't leak into
|
|
197
|
-
* Rolldown's options on pass-through; the CLI converts it into a plugin
|
|
198
|
-
* prepended to the bundler's plugin chain.
|
|
164
|
+
* Top-level rather than under `bundler` so it does not leak into Rolldown's
|
|
165
|
+
* options on pass-through; the CLI turns it into a plugin prepended to the chain.
|
|
199
166
|
*/
|
|
200
167
|
loaders?: Record<string, 'text' | 'dataurl'>;
|
|
201
168
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* declaratively. CLI flags override these values.
|
|
169
|
+
* Config for `gjsify flatpak <sub>`, in its own namespace so the bundler config
|
|
170
|
+
* does not accumulate concerns and `flatpak init` / `flatpak ci` can read
|
|
171
|
+
* defaults declaratively. CLI flags override these.
|
|
206
172
|
*/
|
|
207
173
|
flatpak?: ConfigDataFlatpak;
|
|
208
174
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* are the real configuration files; we only need a pointer here.
|
|
175
|
+
* Config for `gjsify format` / `lint` / `fix`. A thin shell: oxc's own
|
|
176
|
+
* `.oxfmtrc.json` / `.oxlintrc.json` are the real configuration files.
|
|
212
177
|
*/
|
|
213
178
|
format?: ConfigDataFormat;
|
|
214
|
-
/**
|
|
215
|
-
* Test-runner configuration consumed by `gjsify test`. CLI flags
|
|
216
|
-
* (--entry, --outdir, --runtime) override these values.
|
|
217
|
-
*/
|
|
179
|
+
/** Config for `gjsify test`. `--entry`, `--outdir`, `--runtime` override these. */
|
|
218
180
|
test?: ConfigDataTest;
|
|
219
181
|
}
|
|
220
182
|
/** Optional pointer to a non-default oxc config file. */
|
|
@@ -226,10 +188,7 @@ export interface ConfigDataFormat {
|
|
|
226
188
|
*/
|
|
227
189
|
configPath?: string;
|
|
228
190
|
}
|
|
229
|
-
/**
|
|
230
|
-
* `gjsify test` configuration. All fields optional — sensible defaults
|
|
231
|
-
* apply when missing.
|
|
232
|
-
*/
|
|
191
|
+
/** `gjsify test` configuration. */
|
|
233
192
|
export interface ConfigDataTest {
|
|
234
193
|
/** Path to the test entry. Default: `src/test.mts`. */
|
|
235
194
|
entry?: string;
|
|
@@ -238,10 +197,7 @@ export interface ConfigDataTest {
|
|
|
238
197
|
/** Default runtimes when `--runtime` not specified. Default: `['gjs', 'node']`. */
|
|
239
198
|
runtimes?: Array<'gjs' | 'node'>;
|
|
240
199
|
}
|
|
241
|
-
/**
|
|
242
|
-
* Flatpak-toolchain config consumed by the `gjsify flatpak` subcommand
|
|
243
|
-
* group. All fields optional — sensible defaults apply when missing.
|
|
244
|
-
*/
|
|
200
|
+
/** Flatpak-toolchain config for the `gjsify flatpak` subcommand group. */
|
|
245
201
|
export interface ConfigDataFlatpak {
|
|
246
202
|
/** Reverse-DNS app id, e.g. `eu.jumplink.Learn6502`. Defaults to `package.json#name` if it looks like a reverse-DNS id. */
|
|
247
203
|
appId?: string;
|
|
@@ -254,14 +210,11 @@ export interface ConfigDataFlatpak {
|
|
|
254
210
|
/** Runtime/SDK version, e.g. `'50'` for GNOME or `'24.08'` for Freedesktop. */
|
|
255
211
|
runtimeVersion?: string;
|
|
256
212
|
/**
|
|
257
|
-
* Extra SDK extensions
|
|
258
|
-
* `['org.freedesktop.Sdk.Extension.llvm17']` for
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
* needs no build-time Node anymore. (Before Phase D-3 we added
|
|
263
|
-
* `org.freedesktop.Sdk.Extension.node24` here by default for the
|
|
264
|
-
* yarn-install + esbuild build step — that's no longer required.)
|
|
213
|
+
* Extra SDK extensions for the manifest, e.g.
|
|
214
|
+
* `['org.freedesktop.Sdk.Extension.llvm17']` for native code needing a specific
|
|
215
|
+
* toolchain. Leave empty for pure gjsify projects: the GNOME runtime already
|
|
216
|
+
* ships GJS + GLib + libsoup and `gjsify build` produces a self-contained bundle
|
|
217
|
+
* that needs no build-time Node.
|
|
265
218
|
*/
|
|
266
219
|
sdkExtensions?: string[];
|
|
267
220
|
/** Path components prepended to PATH inside the build sandbox. */
|
|
@@ -273,10 +226,9 @@ export interface ConfigDataFlatpak {
|
|
|
273
226
|
/** Extra Flatpak modules prepended before the app's own meson/simple module (e.g. `blueprint-compiler` build). */
|
|
274
227
|
extraModules?: unknown[];
|
|
275
228
|
/**
|
|
276
|
-
* Full replacement for the manifest's `modules` array
|
|
277
|
-
* `extraModules` nor the meson default
|
|
278
|
-
*
|
|
279
|
-
* install via shell commands (`buildsystem: simple`) instead of meson.
|
|
229
|
+
* Full replacement for the manifest's `modules` array: used verbatim, with
|
|
230
|
+
* neither `extraModules` nor the meson default added. For CLI tools that ship a
|
|
231
|
+
* pre-built bundle and install via shell commands (`buildsystem: simple`).
|
|
280
232
|
*/
|
|
281
233
|
modules?: unknown[];
|
|
282
234
|
/** Cleanup glob patterns applied to the final manifest, e.g. `['/include', '/lib/pkgconfig']`. */
|
|
@@ -284,36 +236,32 @@ export interface ConfigDataFlatpak {
|
|
|
284
236
|
/** Source-of-truth lockfile for `gjsify flatpak deps` — `yarn.lock` or `package-lock.json`. */
|
|
285
237
|
lockfile?: string;
|
|
286
238
|
/**
|
|
287
|
-
* GitHub-Actions container image override for `gjsify flatpak ci`.
|
|
288
|
-
*
|
|
289
|
-
*
|
|
239
|
+
* GitHub-Actions container image override for `gjsify flatpak ci`. Default is
|
|
240
|
+
* derived from runtime + runtimeVersion, e.g. gnome+50 →
|
|
241
|
+
* `ghcr.io/flathub-infra/flatpak-github-actions:gnome-50`.
|
|
290
242
|
*/
|
|
291
243
|
ciContainer?: string;
|
|
292
244
|
/** Branches the generated workflow triggers on. Default `['main']`. */
|
|
293
245
|
ciBranches?: string[];
|
|
294
246
|
/**
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
298
|
-
*
|
|
299
|
-
* `gjsify flatpak init`.
|
|
247
|
+
* `'app'` (default) → desktop-application MetaInfo, GUI finish-args, .desktop +
|
|
248
|
+
* icon required. `'cli'` → console-application MetaInfo with
|
|
249
|
+
* `<provides><binary>`, no .desktop, and `skip-icons-check` in flathub.json.
|
|
250
|
+
* Supersedes the older `--cli-only` flag on `gjsify flatpak init`.
|
|
300
251
|
*/
|
|
301
252
|
kind?: 'app' | 'cli';
|
|
302
253
|
/**
|
|
303
|
-
* App display name (`.desktop` `Name=` + MetaInfo `<name>`).
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* human-readable name shown in app stores (e.g. `"Learn 6502 Assembly"`).
|
|
254
|
+
* App display name (`.desktop` `Name=` + MetaInfo `<name>`). The default derives
|
|
255
|
+
* it from `package.json#name`, which works when that is the reverse-DNS app id
|
|
256
|
+
* and breaks when it is an npm name like `learn6502` — set it explicitly to the
|
|
257
|
+
* human-readable store name, e.g. `"Learn 6502 Assembly"`.
|
|
308
258
|
*/
|
|
309
259
|
name?: string;
|
|
310
260
|
/**
|
|
311
|
-
* Developer attribution required by Flathub
|
|
312
|
-
* `
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* be translated. Set to `true` if the name is a descriptive phrase
|
|
316
|
-
* that translators should localise.
|
|
261
|
+
* Developer attribution required by Flathub; `id` must be reverse-DNS.
|
|
262
|
+
* `nameTranslatable: false` (default) emits `translate="no"` on `<name>`, right
|
|
263
|
+
* for personal/brand names; set it `true` for a descriptive phrase translators
|
|
264
|
+
* should localise.
|
|
317
265
|
*/
|
|
318
266
|
developer?: {
|
|
319
267
|
id: string;
|
|
@@ -322,23 +270,17 @@ export interface ConfigDataFlatpak {
|
|
|
322
270
|
nameTranslatable?: boolean;
|
|
323
271
|
};
|
|
324
272
|
/**
|
|
325
|
-
* One-line summary, ≤80 chars, no trailing period (Flathub rule).
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
* `summaryTranslatorHint` to emit a `<!-- TRANSLATORS: ... -->`
|
|
329
|
-
* comment before the tag.
|
|
273
|
+
* One-line summary, ≤80 chars, no trailing period (Flathub rule). Translatable:
|
|
274
|
+
* gettext's `msgfmt --xml --template` substitutes `<summary>` from `.po` files
|
|
275
|
+
* at build time.
|
|
330
276
|
*/
|
|
331
277
|
summary?: string;
|
|
332
278
|
/** Translator hint emitted as `<!-- TRANSLATORS: ... -->` before `<summary>`. */
|
|
333
279
|
summaryTranslatorHint?: string;
|
|
334
280
|
/**
|
|
335
|
-
* Long description
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
* - **Block array** — explicit blocks (`{p:..., translatorHint?:...}`
|
|
339
|
-
* for paragraphs or `{ul:[...], translatorHint?:...}` for bullet
|
|
340
|
-
* lists). Each block can carry its own translator hint. Use this
|
|
341
|
-
* form when you need bullet lists or per-string translator context.
|
|
281
|
+
* Long description, either a string split on blank lines into `<p>` blocks, or
|
|
282
|
+
* an explicit {@link DescriptionBlock} array when you need bullet lists or
|
|
283
|
+
* per-string translator context.
|
|
342
284
|
*/
|
|
343
285
|
description?: string | DescriptionBlock[];
|
|
344
286
|
/** Project homepage URL. Recommended; required for Flathub submission. */
|
|
@@ -350,23 +292,18 @@ export interface ConfigDataFlatpak {
|
|
|
350
292
|
/** Donation URL (e.g. OpenCollective / GitHub Sponsors). */
|
|
351
293
|
donationUrl?: string;
|
|
352
294
|
/**
|
|
353
|
-
* License SPDX identifiers
|
|
354
|
-
*
|
|
355
|
-
* is distributed (default `'CC0-1.0'`).
|
|
295
|
+
* License SPDX identifiers: `project` is the source license (mandatory),
|
|
296
|
+
* `metadata` the license the MetaInfo XML ships under (default `'CC0-1.0'`).
|
|
356
297
|
*/
|
|
357
298
|
license?: {
|
|
358
299
|
metadata?: string;
|
|
359
300
|
project: string;
|
|
360
301
|
};
|
|
361
302
|
/**
|
|
362
|
-
* Content-rating policy
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
366
|
-
* OARS key (`violence-cartoon`, `social-info`, etc.) → severity
|
|
367
|
-
* (`none`, `mild`, `moderate`, `intense`). Flathub recommends
|
|
368
|
-
* declaring attributes explicitly even when they're `none` so the
|
|
369
|
-
* rating audit is auditable.
|
|
303
|
+
* Content-rating policy: either the bare spec keyword (default `'oars-1.1'`,
|
|
304
|
+
* emitting an empty `<content_rating type="…"/>`), or keyword + an `attributes`
|
|
305
|
+
* map of OARS key → severity. Flathub recommends declaring attributes explicitly
|
|
306
|
+
* even when they are `none`, so the rating stays auditable.
|
|
370
307
|
*/
|
|
371
308
|
contentRating?: string | {
|
|
372
309
|
type?: string;
|
|
@@ -377,11 +314,9 @@ export interface ConfigDataFlatpak {
|
|
|
377
314
|
/** Search keywords for app stores. */
|
|
378
315
|
keywords?: string[];
|
|
379
316
|
/**
|
|
380
|
-
* Release history
|
|
381
|
-
* `<release version=… date=…>` block. `description`
|
|
382
|
-
*
|
|
383
|
-
* field — use the array form for release notes with bullet lists
|
|
384
|
-
* or per-string translator hints.
|
|
317
|
+
* Release history, most recent first; each entry produces a
|
|
318
|
+
* `<release version=… date=…>` block. `description` takes the same
|
|
319
|
+
* string-or-block-array shape as the top-level `description`.
|
|
385
320
|
*/
|
|
386
321
|
releases?: Array<{
|
|
387
322
|
version: string;
|
|
@@ -389,11 +324,9 @@ export interface ConfigDataFlatpak {
|
|
|
389
324
|
description?: string | DescriptionBlock[];
|
|
390
325
|
}>;
|
|
391
326
|
/**
|
|
392
|
-
*
|
|
393
|
-
* `
|
|
394
|
-
*
|
|
395
|
-
* `'plasma'|'gnome'|'cli'` — Flathub uses it to group by desktop.
|
|
396
|
-
* First entry defaults to `type="default"`; override with `type`.
|
|
327
|
+
* App-store screenshots. `url` must be an absolute HTTPS URL to a PNG;
|
|
328
|
+
* `environment` lets Flathub group by desktop; the first entry defaults to
|
|
329
|
+
* `type="default"`.
|
|
397
330
|
*/
|
|
398
331
|
screenshots?: Array<{
|
|
399
332
|
url: string;
|
|
@@ -408,34 +341,28 @@ export interface ConfigDataFlatpak {
|
|
|
408
341
|
accentDark: string;
|
|
409
342
|
};
|
|
410
343
|
/**
|
|
411
|
-
* Path to a scalable SVG icon
|
|
412
|
-
* hicolor/scalable/apps/<app-id>.svg`). When set, init
|
|
413
|
-
* exists; when unset on `--kind app`, init prints a
|
|
344
|
+
* Path to a scalable SVG icon; Flathub requires SVG
|
|
345
|
+
* (`/app/share/icons/hicolor/scalable/apps/<app-id>.svg`). When set, init
|
|
346
|
+
* verifies the file exists; when unset on `--kind app`, init prints a hint.
|
|
414
347
|
*/
|
|
415
348
|
icon?: string;
|
|
416
|
-
/**
|
|
417
|
-
* Remote-hosted icon URL — emitted as `<icon type="remote">`. Useful
|
|
418
|
-
* for the Flathub app-store thumbnail before the local SVG ships.
|
|
419
|
-
*/
|
|
349
|
+
/** Remote-hosted icon URL, emitted as `<icon type="remote">`. */
|
|
420
350
|
iconRemote?: string;
|
|
421
351
|
/**
|
|
422
|
-
* Translation
|
|
423
|
-
*
|
|
424
|
-
* community translation contributions through a hosted platform.
|
|
352
|
+
* Translation-platform URL (Weblate, Crowdin, …), emitted as
|
|
353
|
+
* `<url type="translate">`.
|
|
425
354
|
*/
|
|
426
355
|
translateUrl?: string;
|
|
427
356
|
/**
|
|
428
|
-
* AppStream kudos —
|
|
429
|
-
*
|
|
430
|
-
* `TouchscreenSupport`, `UserDocs`, `HighContrast`, `Notifications`,
|
|
431
|
-
* `SearchProvider`. Full list at
|
|
357
|
+
* AppStream kudos — a fixed set of "well-behaved" markers, e.g.
|
|
358
|
+
* `ModernToolkit`, `HiDpiIcon`, `TouchscreenSupport`, `UserDocs`.
|
|
432
359
|
* https://www.freedesktop.org/software/appstream/docs/sect-Metadata-DesktopApps.html#tag-dapp-kudos
|
|
433
360
|
*/
|
|
434
361
|
kudos?: string[];
|
|
435
362
|
/**
|
|
436
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
363
|
+
* What this app provides to the system. `<binary>` is auto-included with the
|
|
364
|
+
* value of `command` when omitted — AppStream needs it to register the binary
|
|
365
|
+
* for both apps and CLIs.
|
|
439
366
|
*/
|
|
440
367
|
provides?: {
|
|
441
368
|
binaries?: string[];
|
|
@@ -445,21 +372,14 @@ export interface ConfigDataFlatpak {
|
|
|
445
372
|
id: string;
|
|
446
373
|
}>;
|
|
447
374
|
};
|
|
448
|
-
/**
|
|
449
|
-
* Hardware controls the app supports (best-effort declaration —
|
|
450
|
-
* AppStream `<supports>`). Common values:
|
|
451
|
-
* `keyboard`, `pointing`, `touch`, `gamepad`, `tablet`, `console`,
|
|
452
|
-
* `vision`.
|
|
453
|
-
*/
|
|
375
|
+
/** Best-effort hardware-support declaration — AppStream `<supports>`. */
|
|
454
376
|
supports?: {
|
|
455
377
|
controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console' | 'vision'>;
|
|
456
|
-
/** Internet connectivity requirement. */
|
|
457
378
|
internet?: 'always' | 'offline-only' | 'first-run';
|
|
458
379
|
};
|
|
459
380
|
/**
|
|
460
|
-
* Hard requirements — AppStream `<requires
|
|
461
|
-
*
|
|
462
|
-
* pixels (logical units) — typical phone-portrait minimum is 360.
|
|
381
|
+
* Hard requirements — AppStream `<requires>`; the app will not function without
|
|
382
|
+
* them. `displayLengthMin` is in logical pixels (phone-portrait minimum: 360).
|
|
463
383
|
*/
|
|
464
384
|
requires?: {
|
|
465
385
|
displayLengthMin?: number;
|
|
@@ -467,28 +387,24 @@ export interface ConfigDataFlatpak {
|
|
|
467
387
|
controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console'>;
|
|
468
388
|
};
|
|
469
389
|
/**
|
|
470
|
-
* Soft recommendations — AppStream `<recommends
|
|
471
|
-
*
|
|
472
|
-
* tablet-min recommendation is 480.
|
|
390
|
+
* Soft recommendations — AppStream `<recommends>`; the app works better with
|
|
391
|
+
* them but functions without. Typical tablet `displayLengthMin`: 480.
|
|
473
392
|
*/
|
|
474
393
|
recommends?: {
|
|
475
394
|
displayLengthMin?: number;
|
|
476
395
|
controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console'>;
|
|
477
396
|
};
|
|
478
397
|
/**
|
|
479
|
-
* Flathub tracking-repo override for `gjsify flatpak sync-flathub` /
|
|
480
|
-
*
|
|
481
|
-
* `flathub/eu.jumplink.Learn6502`). Set this when the upstream repo
|
|
482
|
-
* deviates from that convention.
|
|
398
|
+
* Flathub tracking-repo override for `gjsify flatpak sync-flathub` / `diff`.
|
|
399
|
+
* Default `flathub/<appId>`; set when the upstream repo deviates.
|
|
483
400
|
*/
|
|
484
401
|
flathubRepo?: string;
|
|
485
402
|
}
|
|
486
403
|
/**
|
|
487
|
-
*
|
|
488
|
-
* (`{
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
* translators context when the string lands in their `.po` file.
|
|
404
|
+
* One block inside a MetaInfo `<description>`: a paragraph (`{p}`) or a bullet
|
|
405
|
+
* list (`{ul}`). An optional `translatorHint` becomes a `<!-- TRANSLATORS: … -->`
|
|
406
|
+
* comment before the block in the emitted `.metainfo.xml.in`, giving translators
|
|
407
|
+
* context once the string lands in their `.po` file.
|
|
492
408
|
*/
|
|
493
409
|
export type DescriptionBlock = {
|
|
494
410
|
p: string;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
/** The `.npmrc` file `gjsify login` writes to (matches `load-npmrc.ts`'s userconfig source). */
|
|
2
2
|
export declare function userconfigNpmrcPath(): string;
|
|
3
3
|
/**
|
|
4
|
-
* The npm "nerf-dart" key for a registry
|
|
5
|
-
*
|
|
4
|
+
* The npm "nerf-dart" key for a registry — the URL with the protocol removed,
|
|
5
|
+
* host + path, trailing slash: `//registry.npmjs.org/`. npm keys credentials by
|
|
6
|
+
* this, so the exact shape is what makes the token findable.
|
|
6
7
|
*/
|
|
7
8
|
export declare function nerfDart(registry: string): string;
|
|
8
9
|
/** The full `_authToken` config key for a registry. */
|
|
9
10
|
export declare function authTokenKey(registry: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Upsert `<nerf-dart>:_authToken=<token>` in the userconfig `.npmrc`, preserving
|
|
12
|
-
* all other lines. Returns the file path written.
|
|
13
|
-
*/
|
|
11
|
+
/** Upsert `<nerf-dart>:_authToken=<token>`; returns the file path written. */
|
|
14
12
|
export declare function writeAuthToken(registry: string, token: string): string;
|
|
15
|
-
/**
|
|
16
|
-
* Remove the `<nerf-dart>:_authToken=` line for a registry from the userconfig
|
|
17
|
-
* `.npmrc`. Returns `{ path, removed }` — `removed` is false if no line matched.
|
|
18
|
-
*/
|
|
13
|
+
/** Drop the registry's `_authToken` line; `removed` is false when none matched. */
|
|
19
14
|
export declare function removeAuthToken(registry: string): {
|
|
20
15
|
path: string;
|
|
21
16
|
removed: boolean;
|