@gjsify/cli 0.4.10 → 0.4.12

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.
@@ -233,4 +233,197 @@ export interface ConfigDataFlatpak {
233
233
  ciContainer?: string;
234
234
  /** Branches the generated workflow triggers on. Default `['main']`. */
235
235
  ciBranches?: string[];
236
+ /**
237
+ * App kind. `'app'` (default) → desktop-application MetaInfo, GUI
238
+ * finish-args, .desktop + icon required. `'cli'` → console-application
239
+ * MetaInfo with `<provides><binary>`, no .desktop, flathub.json sets
240
+ * `skip-icons-check`. Supersedes the older `--cli-only` flag on
241
+ * `gjsify flatpak init`.
242
+ */
243
+ kind?: 'app' | 'cli';
244
+ /**
245
+ * Developer attribution required by Flathub. `id` must be reverse-DNS.
246
+ * `email` (optional) becomes `<email>` inside `<developer>`.
247
+ * `nameTranslatable: false` (default) emits `translate="no"` on the
248
+ * `<name>` tag — recommended for personal/brand names that should not
249
+ * be translated. Set to `true` if the name is a descriptive phrase
250
+ * that translators should localise.
251
+ */
252
+ developer?: {
253
+ id: string;
254
+ name: string;
255
+ email?: string;
256
+ nameTranslatable?: boolean;
257
+ };
258
+ /**
259
+ * One-line summary, ≤80 chars, no trailing period (Flathub rule).
260
+ * Translatable — gettext's `msgfmt --xml --template` substitutes
261
+ * `<summary>` from `.po` files at build time. Set
262
+ * `summaryTranslatorHint` to emit a `<!-- TRANSLATORS: ... -->`
263
+ * comment before the tag.
264
+ */
265
+ summary?: string;
266
+ /** Translator hint emitted as `<!-- TRANSLATORS: ... -->` before `<summary>`. */
267
+ summaryTranslatorHint?: string;
268
+ /**
269
+ * Long description. Two forms:
270
+ * - **String** — split on blank lines into `<p>` blocks. Best for
271
+ * simple descriptions without bullet lists.
272
+ * - **Block array** — explicit blocks (`{p:..., translatorHint?:...}`
273
+ * for paragraphs or `{ul:[...], translatorHint?:...}` for bullet
274
+ * lists). Each block can carry its own translator hint. Use this
275
+ * form when you need bullet lists or per-string translator context.
276
+ */
277
+ description?: string | DescriptionBlock[];
278
+ /** Project homepage URL. Recommended; required for Flathub submission. */
279
+ homepageUrl?: string;
280
+ /** Bug tracker URL. */
281
+ bugtrackerUrl?: string;
282
+ /** VCS browser URL (e.g. GitHub repo). */
283
+ vcsBrowserUrl?: string;
284
+ /** Donation URL (e.g. OpenCollective / GitHub Sponsors). */
285
+ donationUrl?: string;
286
+ /**
287
+ * License SPDX identifiers. `project` is the project's source license
288
+ * (mandatory). `metadata` is the license under which the MetaInfo XML
289
+ * is distributed (default `'CC0-1.0'`).
290
+ */
291
+ license?: {
292
+ metadata?: string;
293
+ project: string;
294
+ };
295
+ /**
296
+ * Content-rating policy. Two forms:
297
+ * - **String** — just the spec keyword (default `'oars-1.1'`), emits
298
+ * an empty `<content_rating type="..."/>` block.
299
+ * - **Object** — keyword + `attributes` map. Each attribute is an
300
+ * OARS key (`violence-cartoon`, `social-info`, etc.) → severity
301
+ * (`none`, `mild`, `moderate`, `intense`). Flathub recommends
302
+ * declaring attributes explicitly even when they're `none` so the
303
+ * rating audit is auditable.
304
+ */
305
+ contentRating?: string | {
306
+ type?: string;
307
+ attributes?: Record<string, 'none' | 'mild' | 'moderate' | 'intense'>;
308
+ };
309
+ /** Freedesktop Menu categories (e.g. `['Development', 'Utility']`). */
310
+ categories?: string[];
311
+ /** Search keywords for app stores. */
312
+ keywords?: string[];
313
+ /**
314
+ * Release history. Most recent first. Each entry produces a
315
+ * `<release version=… date=…>` block. `description` accepts the
316
+ * same string-or-block-array shape as the top-level `description`
317
+ * field — use the array form for release notes with bullet lists
318
+ * or per-string translator hints.
319
+ */
320
+ releases?: Array<{
321
+ version: string;
322
+ date: string;
323
+ description?: string | DescriptionBlock[];
324
+ }>;
325
+ /**
326
+ * Screenshots for app-stores. `url` is an absolute HTTPS URL to a PNG.
327
+ * `caption` is optional and translatable — set `captionTranslatorHint`
328
+ * for a `<!-- TRANSLATORS: ... -->` hint. `environment` is one of
329
+ * `'plasma'|'gnome'|'cli'` — Flathub uses it to group by desktop.
330
+ * First entry defaults to `type="default"`; override with `type`.
331
+ */
332
+ screenshots?: Array<{
333
+ url: string;
334
+ caption?: string;
335
+ captionTranslatorHint?: string;
336
+ environment?: 'plasma' | 'gnome' | 'cli';
337
+ type?: 'default' | 'source';
338
+ }>;
339
+ /** Light/dark accent colours (hex `#rrggbb`) — emit `<branding>` block. */
340
+ branding?: {
341
+ accentLight: string;
342
+ accentDark: string;
343
+ };
344
+ /**
345
+ * Path to a scalable SVG icon. Flathub requires SVG (`/app/share/icons/
346
+ * hicolor/scalable/apps/<app-id>.svg`). When set, init verifies the file
347
+ * exists; when unset on `--kind app`, init prints a Flathub hint.
348
+ */
349
+ icon?: string;
350
+ /**
351
+ * Remote-hosted icon URL — emitted as `<icon type="remote">`. Useful
352
+ * for the Flathub app-store thumbnail before the local SVG ships.
353
+ */
354
+ iconRemote?: string;
355
+ /**
356
+ * Translation platform URL (Weblate, Crowdin, Transifex, etc.).
357
+ * Emitted as `<url type="translate">`. Set this when your app accepts
358
+ * community translation contributions through a hosted platform.
359
+ */
360
+ translateUrl?: string;
361
+ /**
362
+ * AppStream kudos — Flathub recognises a fixed set of "well-behaved"
363
+ * markers. Common values: `ModernToolkit`, `HiDpiIcon`,
364
+ * `TouchscreenSupport`, `UserDocs`, `HighContrast`, `Notifications`,
365
+ * `SearchProvider`. Full list at
366
+ * https://www.freedesktop.org/software/appstream/docs/sect-Metadata-DesktopApps.html#tag-dapp-kudos
367
+ */
368
+ kudos?: string[];
369
+ /**
370
+ * Things this app provides to the system. `<binary>` is auto-included
371
+ * with the value of `command` when omitted (apps + CLIs both need
372
+ * this for AppStream to register the binary correctly).
373
+ */
374
+ provides?: {
375
+ binaries?: string[];
376
+ mimetypes?: string[];
377
+ dbus?: Array<{
378
+ type: 'user' | 'system';
379
+ id: string;
380
+ }>;
381
+ };
382
+ /**
383
+ * Hardware controls the app supports (best-effort declaration —
384
+ * AppStream `<supports>`). Common values:
385
+ * `keyboard`, `pointing`, `touch`, `gamepad`, `tablet`, `console`,
386
+ * `vision`.
387
+ */
388
+ supports?: {
389
+ controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console' | 'vision'>;
390
+ /** Internet connectivity requirement. */
391
+ internet?: 'always' | 'offline-only' | 'first-run';
392
+ };
393
+ /**
394
+ * Hard requirements — AppStream `<requires>`. App won't function
395
+ * without these. `displayLengthMin` is the minimum display length in
396
+ * pixels (logical units) — typical phone-portrait minimum is 360.
397
+ */
398
+ requires?: {
399
+ displayLengthMin?: number;
400
+ internet?: 'always' | 'offline-only' | 'first-run';
401
+ controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console'>;
402
+ };
403
+ /**
404
+ * Soft recommendations — AppStream `<recommends>`. App works better
405
+ * with these but functions without them. `displayLengthMin` typical
406
+ * tablet-min recommendation is 480.
407
+ */
408
+ recommends?: {
409
+ displayLengthMin?: number;
410
+ controls?: Array<'keyboard' | 'pointing' | 'touch' | 'gamepad' | 'tablet' | 'console'>;
411
+ };
236
412
  }
413
+ /**
414
+ * A single block inside a MetaInfo `<description>`. Either a paragraph
415
+ * (`{p}`) or a bullet list (`{ul}`). Each block can carry an optional
416
+ * `translatorHint` that becomes a `<!-- TRANSLATORS: ... -->` comment
417
+ * before the block in the emitted `.metainfo.xml.in` template — gives
418
+ * translators context when the string lands in their `.po` file.
419
+ */
420
+ export type DescriptionBlock = {
421
+ p: string;
422
+ translatorHint?: string;
423
+ } | {
424
+ ul: Array<string | {
425
+ item: string;
426
+ translatorHint?: string;
427
+ }>;
428
+ translatorHint?: string;
429
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -23,7 +23,7 @@
23
23
  "clear": "rm -rf lib dist tsconfig.tsbuildinfo || exit 0",
24
24
  "check": "tsc --noEmit",
25
25
  "start": "node lib/index.js",
26
- "build": "tsc && mkdir -p lib/templates && cp -L src/templates/install.mjs.tmpl lib/templates/install.mjs.tmpl && gjsify run chmod",
26
+ "build": "tsc && mkdir -p lib/templates/flatpak && cp -L src/templates/install.mjs.tmpl lib/templates/install.mjs.tmpl && cp src/templates/flatpak/*.tmpl lib/templates/flatpak/ && gjsify run chmod",
27
27
  "build:gjs-bundle": "node lib/index.js build src/index.ts --app gjs --outfile dist/cli.gjs.mjs --shebang",
28
28
  "chmod": "chmod +x ./lib/index.js",
29
29
  "build:test:node": "node lib/index.js build src/test.mts --app node --outfile dist/test.node.mjs",
@@ -37,18 +37,18 @@
37
37
  "cli"
38
38
  ],
39
39
  "dependencies": {
40
- "@gjsify/buffer": "^0.4.10",
41
- "@gjsify/create-app": "^0.4.10",
42
- "@gjsify/node-globals": "^0.4.10",
43
- "@gjsify/node-polyfills": "^0.4.10",
44
- "@gjsify/npm-registry": "^0.4.10",
45
- "@gjsify/resolve-npm": "^0.4.10",
46
- "@gjsify/rolldown-plugin-gjsify": "^0.4.10",
47
- "@gjsify/rolldown-plugin-pnp": "^0.4.10",
48
- "@gjsify/semver": "^0.4.10",
49
- "@gjsify/tar": "^0.4.10",
50
- "@gjsify/web-polyfills": "^0.4.10",
51
- "@gjsify/workspace": "^0.4.10",
40
+ "@gjsify/buffer": "^0.4.12",
41
+ "@gjsify/create-app": "^0.4.12",
42
+ "@gjsify/node-globals": "^0.4.12",
43
+ "@gjsify/node-polyfills": "^0.4.12",
44
+ "@gjsify/npm-registry": "^0.4.12",
45
+ "@gjsify/resolve-npm": "^0.4.12",
46
+ "@gjsify/rolldown-plugin-gjsify": "^0.4.12",
47
+ "@gjsify/rolldown-plugin-pnp": "^0.4.12",
48
+ "@gjsify/semver": "^0.4.12",
49
+ "@gjsify/tar": "^0.4.12",
50
+ "@gjsify/web-polyfills": "^0.4.12",
51
+ "@gjsify/workspace": "^0.4.12",
52
52
  "cosmiconfig": "^9.0.1",
53
53
  "get-tsconfig": "^4.14.0",
54
54
  "pkg-types": "^2.3.1",
@@ -56,12 +56,12 @@
56
56
  "yargs": "^18.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@gjsify/unit": "^0.4.10",
59
+ "@gjsify/unit": "^0.4.12",
60
60
  "@types/yargs": "^17.0.35",
61
61
  "typescript": "^6.0.3"
62
62
  },
63
63
  "peerDependencies": {
64
- "@gjsify/rolldown-native": "^0.4.10"
64
+ "@gjsify/rolldown-native": "^0.4.12"
65
65
  },
66
66
  "peerDependenciesMeta": {
67
67
  "@gjsify/rolldown-native": {