feat: Support ArchiveTarget linux artifacts to include exporting a .desktop file#9699
Open
mmaietta wants to merge 17 commits into
Open
feat: Support ArchiveTarget linux artifacts to include exporting a .desktop file#9699mmaietta wants to merge 17 commits into
ArchiveTarget linux artifacts to include exporting a .desktop file#9699mmaietta wants to merge 17 commits into
Conversation
…ude the .desktop file
🦋 Changeset detectedLatest commit: eb72b95 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ktop-file-archives
…ning on multiple toolset versions into separate test suite (since they're toolset independent)
There was a problem hiding this comment.
Pull request overview
Adds support for emitting Linux .desktop files for archive-style targets, with related config/schema updates and tests.
Changes:
- Emits
.desktopartifacts for Linux archive targets whendesktopis configured. - Expands
desktopoption typing/schema to allow booleans. - Adds/updates Linux packaging tests and snapshots for archive desktop output.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
packages/app-builder-lib/src/linuxPackager.ts |
Adds archive desktop artifact emission logic. |
packages/app-builder-lib/src/targets/LinuxTargetHelper.ts |
Normalizes boolean desktop config and updates validation. |
packages/app-builder-lib/src/options/linuxOptions.ts |
Updates desktop option docs and type. |
packages/app-builder-lib/src/targets/targetFactory.ts |
Exports archive target set for reuse. |
packages/app-builder-lib/scheme.json |
Updates generated schema for desktop booleans/docs. |
test/src/linux/linuxPackagerTest.ts |
Adds archive desktop tests and reorganizes AppImage tests. |
test/snapshots/linux/linuxPackagerTest.js.snap |
Updates Linux packager snapshots. |
test/snapshots/linux/linuxArchiveTest.js.snap |
Adds archive-related snapshots. |
.changeset/hip-rooms-throw.md |
Adds minor changeset entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+467
to
+475
| linux: { | ||
| description: "Test Comment", | ||
| desktop: { | ||
| entry: { | ||
| Name: "Test App", | ||
| }, | ||
| }, | ||
| }, | ||
| { | ||
| projectDirCreated: projectDir => | ||
| modifyPackageJson(projectDir, data => { | ||
| data.author = "Foo" | ||
| }), | ||
| } | ||
| )) | ||
| }, |
| import { ToolsetConfig } from "app-builder-lib/src" | ||
|
|
||
| const appImageTarget = Platform.LINUX.createTarget("appimage", Arch.x64) | ||
| const zipTarget = Platform.LINUX.createTarget("zip", Arch.x64) |
Comment on lines
+38
to
+39
| override async pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<any> { | ||
| await super.pack(outDir, arch, targets, taskManager) |
# Conflicts: # packages/app-builder-lib/src/linuxPackager.ts # packages/app-builder-lib/src/targets/LinuxTargetHelper.ts # test/snapshots/linux/linuxPackagerTest.js.snap # test/src/linux/linuxPackagerTest.ts
…ktop-file-archives # Conflicts: # packages/app-builder-lib/src/targets/LinuxTargetHelper.ts
Resolve conflicts from the v27 ESM migration (#9544): - linuxPackager.ts: combine ESM imports (.js, builder-util/internal, targets/linux/*) with the desktop-emission pack() override - LinuxTargetHelper.ts (moved to targets/linux/): keep desktop boolean normalization + InvalidConfigurationError for desktop.entry.Exec/Comment alongside master's desktopName validation - platformPackager.ts: cast `this as unknown as LinuxPackager` now that LinuxPackager has extra private members (getHelper/_helper/emittedDesktopFiles) - scheme.json: regenerated (desktop now LinuxDesktopFile | boolean | null) - tests: drop linuxPackagerTest.js.snap (deleted upstream) and reduce linuxPackagerTest.ts to the new archive/desktop coverage; AppImage/icon/ license cases already live in linuxPackagerTestSuite.ts Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… coverage Security/correctness: - Escape every .desktop field value at the single serialization site (except the already-quoted Exec key) so user desktop.entry overrides, desktopActions, MimeType, and Categories can no longer inject extra key=value lines (e.g. a second Exec=). No-op for normal inputs. - Correct the pack() comment: desktop emission runs concurrently with archive builds, not strictly after; the build still fails on archive error. Docs: - linux.md: distinguish package-format (always bundled) vs archive (opt-in) desktop files; document the boolean option and installed-app Exec/Icon caveat. - linux.desktop JSDoc: archive behavior + no per-target archive override. - scheme.json: regenerated (desktop now LinuxDesktopFile | boolean | null). Tests (e2e expansion, all CI-safe): - default-content contract; 7z/tar.* per-format emission + within-build dedup; multi-arch shared-outDir dedup; desktopName -> StartupWMClass (not filename); fileAssociations+protocols -> MimeType; desktopActions; dir-only emits none; appImage+zip emits one standalone; newline-injection regression tests. - Commit reviewed snapshot baseline test/snapshots/linux/linuxPackagerTest.js.snap. - Update generated linuxPackager suite snapshots: forbid desktop.Exec now throws InvalidConfigurationError (snapshot captures the error code). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements: #9091
CC @t3chguy