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