@gtkx/cli 1.0.0 → 1.2.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/README.md +1 -1
- package/dist/builder.d.ts +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +20 -3
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/freshness.js +2 -2
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +3 -0
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +9 -5
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +31 -20
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +1 -1
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +5 -6
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +11 -1
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +22 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +44 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +4 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts +2 -2
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +28 -4
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts +8 -0
- package/dist/deploy/depends.d.ts.map +1 -0
- package/dist/deploy/depends.js +27 -0
- package/dist/deploy/depends.js.map +1 -0
- package/dist/deploy/download.d.ts +20 -0
- package/dist/deploy/download.d.ts.map +1 -0
- package/dist/deploy/download.js +98 -0
- package/dist/deploy/download.js.map +1 -0
- package/dist/deploy/freedesktop/copyright.d.ts +4 -0
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -0
- package/dist/deploy/freedesktop/copyright.js +33 -0
- package/dist/deploy/freedesktop/copyright.js.map +1 -0
- package/dist/deploy/freedesktop/dbus-service.d.ts +4 -0
- package/dist/deploy/freedesktop/dbus-service.d.ts.map +1 -0
- package/dist/deploy/freedesktop/dbus-service.js +15 -0
- package/dist/deploy/freedesktop/dbus-service.js.map +1 -0
- package/dist/deploy/freedesktop/desktop-entry.d.ts +4 -0
- package/dist/deploy/freedesktop/desktop-entry.d.ts.map +1 -0
- package/dist/deploy/freedesktop/desktop-entry.js +73 -0
- package/dist/deploy/freedesktop/desktop-entry.js.map +1 -0
- package/dist/deploy/freedesktop/ini.d.ts +7 -0
- package/dist/deploy/freedesktop/ini.d.ts.map +1 -0
- package/dist/deploy/freedesktop/ini.js +22 -0
- package/dist/deploy/freedesktop/ini.js.map +1 -0
- package/dist/deploy/freedesktop/metainfo-sections.d.ts +13 -0
- package/dist/deploy/freedesktop/metainfo-sections.d.ts.map +1 -0
- package/dist/deploy/freedesktop/metainfo-sections.js +73 -0
- package/dist/deploy/freedesktop/metainfo-sections.js.map +1 -0
- package/dist/deploy/freedesktop/metainfo.d.ts +4 -0
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -0
- package/dist/deploy/freedesktop/metainfo.js +29 -0
- package/dist/deploy/freedesktop/metainfo.js.map +1 -0
- package/dist/deploy/freedesktop/mime-package.d.ts +4 -0
- package/dist/deploy/freedesktop/mime-package.d.ts.map +1 -0
- package/dist/deploy/freedesktop/mime-package.js +16 -0
- package/dist/deploy/freedesktop/mime-package.js.map +1 -0
- package/dist/deploy/freedesktop/validate.d.ts +4 -0
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -0
- package/dist/deploy/freedesktop/validate.js +81 -0
- package/dist/deploy/freedesktop/validate.js.map +1 -0
- package/dist/deploy/freedesktop/xml.d.ts +11 -0
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -0
- package/dist/deploy/freedesktop/xml.js +33 -0
- package/dist/deploy/freedesktop/xml.js.map +1 -0
- package/dist/deploy/git.d.ts +4 -0
- package/dist/deploy/git.d.ts.map +1 -0
- package/dist/deploy/git.js +17 -0
- package/dist/deploy/git.js.map +1 -0
- package/dist/deploy/install-hints.d.ts +5 -0
- package/dist/deploy/install-hints.d.ts.map +1 -0
- package/dist/deploy/install-hints.js +88 -0
- package/dist/deploy/install-hints.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +8 -0
- package/dist/deploy/nfpm/config.d.ts.map +1 -0
- package/dist/deploy/nfpm/config.js +119 -0
- package/dist/deploy/nfpm/config.js.map +1 -0
- package/dist/deploy/nfpm/contents.d.ts +12 -0
- package/dist/deploy/nfpm/contents.d.ts.map +1 -0
- package/dist/deploy/nfpm/contents.js +48 -0
- package/dist/deploy/nfpm/contents.js.map +1 -0
- package/dist/deploy/nfpm/description.d.ts +5 -0
- package/dist/deploy/nfpm/description.d.ts.map +1 -0
- package/dist/deploy/nfpm/description.js +5 -0
- package/dist/deploy/nfpm/description.js.map +1 -0
- package/dist/deploy/nfpm/optional.d.ts +5 -0
- package/dist/deploy/nfpm/optional.d.ts.map +1 -0
- package/dist/deploy/nfpm/optional.js +4 -0
- package/dist/deploy/nfpm/optional.js.map +1 -0
- package/dist/deploy/nfpm/pack.d.ts +5 -0
- package/dist/deploy/nfpm/pack.d.ts.map +1 -0
- package/dist/deploy/nfpm/pack.js +32 -0
- package/dist/deploy/nfpm/pack.js.map +1 -0
- package/dist/deploy/node-runtime/download.d.ts +3 -0
- package/dist/deploy/node-runtime/download.d.ts.map +1 -0
- package/dist/deploy/node-runtime/download.js +39 -0
- package/dist/deploy/node-runtime/download.js.map +1 -0
- package/dist/deploy/node-runtime/elf.d.ts +7 -0
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -0
- package/dist/deploy/node-runtime/elf.js +100 -0
- package/dist/deploy/node-runtime/elf.js.map +1 -0
- package/dist/deploy/node-runtime/guard.d.ts +4 -0
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -0
- package/dist/deploy/node-runtime/guard.js +22 -0
- package/dist/deploy/node-runtime/guard.js.map +1 -0
- package/dist/deploy/node-runtime/index.d.ts +4 -0
- package/dist/deploy/node-runtime/index.d.ts.map +1 -0
- package/dist/deploy/node-runtime/index.js +61 -0
- package/dist/deploy/node-runtime/index.js.map +1 -0
- package/dist/deploy/payload/copy-tree.d.ts +7 -0
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -0
- package/dist/deploy/payload/copy-tree.js +36 -0
- package/dist/deploy/payload/copy-tree.js.map +1 -0
- package/dist/deploy/payload/icons.d.ts +6 -0
- package/dist/deploy/payload/icons.d.ts.map +1 -0
- package/dist/deploy/payload/icons.js +53 -0
- package/dist/deploy/payload/icons.js.map +1 -0
- package/dist/deploy/payload/launcher.d.ts +5 -0
- package/dist/deploy/payload/launcher.d.ts.map +1 -0
- package/dist/deploy/payload/launcher.js +22 -0
- package/dist/deploy/payload/launcher.js.map +1 -0
- package/dist/deploy/payload/schemas.d.ts +4 -0
- package/dist/deploy/payload/schemas.d.ts.map +1 -0
- package/dist/deploy/payload/schemas.js +17 -0
- package/dist/deploy/payload/schemas.js.map +1 -0
- package/dist/deploy/payload/stage.d.ts +15 -0
- package/dist/deploy/payload/stage.d.ts.map +1 -0
- package/dist/deploy/payload/stage.js +100 -0
- package/dist/deploy/payload/stage.js.map +1 -0
- package/dist/deploy/registry.d.ts +7 -0
- package/dist/deploy/registry.d.ts.map +1 -0
- package/dist/deploy/registry.js +30 -0
- package/dist/deploy/registry.js.map +1 -0
- package/dist/deploy/run-deploy.d.ts +11 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -0
- package/dist/deploy/run-deploy.js +157 -0
- package/dist/deploy/run-deploy.js.map +1 -0
- package/dist/deploy/settings/arch.d.ts +4 -0
- package/dist/deploy/settings/arch.d.ts.map +1 -0
- package/dist/deploy/settings/arch.js +13 -0
- package/dist/deploy/settings/arch.js.map +1 -0
- package/dist/deploy/settings/categories.d.ts +4 -0
- package/dist/deploy/settings/categories.d.ts.map +1 -0
- package/dist/deploy/settings/categories.js +29 -0
- package/dist/deploy/settings/categories.js.map +1 -0
- package/dist/deploy/settings/exec.d.ts +6 -0
- package/dist/deploy/settings/exec.d.ts.map +1 -0
- package/dist/deploy/settings/exec.js +20 -0
- package/dist/deploy/settings/exec.js.map +1 -0
- package/dist/deploy/settings/identity.d.ts +18 -0
- package/dist/deploy/settings/identity.d.ts.map +1 -0
- package/dist/deploy/settings/identity.js +73 -0
- package/dist/deploy/settings/identity.js.map +1 -0
- package/dist/deploy/settings/index.d.ts +11 -0
- package/dist/deploy/settings/index.d.ts.map +1 -0
- package/dist/deploy/settings/index.js +103 -0
- package/dist/deploy/settings/index.js.map +1 -0
- package/dist/deploy/settings/package-manifest.d.ts +16 -0
- package/dist/deploy/settings/package-manifest.d.ts.map +1 -0
- package/dist/deploy/settings/package-manifest.js +42 -0
- package/dist/deploy/settings/package-manifest.js.map +1 -0
- package/dist/deploy/settings/paths.d.ts +9 -0
- package/dist/deploy/settings/paths.d.ts.map +1 -0
- package/dist/deploy/settings/paths.js +82 -0
- package/dist/deploy/settings/paths.js.map +1 -0
- package/dist/deploy/settings/screenshots.d.ts +8 -0
- package/dist/deploy/settings/screenshots.d.ts.map +1 -0
- package/dist/deploy/settings/screenshots.js +79 -0
- package/dist/deploy/settings/screenshots.js.map +1 -0
- package/dist/deploy/settings/starter.d.ts +4 -0
- package/dist/deploy/settings/starter.d.ts.map +1 -0
- package/dist/deploy/settings/starter.js +28 -0
- package/dist/deploy/settings/starter.js.map +1 -0
- package/dist/deploy/settings/version.d.ts +9 -0
- package/dist/deploy/settings/version.d.ts.map +1 -0
- package/dist/deploy/settings/version.js +37 -0
- package/dist/deploy/settings/version.js.map +1 -0
- package/dist/deploy/targets/appimage.d.ts +4 -0
- package/dist/deploy/targets/appimage.d.ts.map +1 -0
- package/dist/deploy/targets/appimage.js +105 -0
- package/dist/deploy/targets/appimage.js.map +1 -0
- package/dist/deploy/targets/deb.d.ts +4 -0
- package/dist/deploy/targets/deb.d.ts.map +1 -0
- package/dist/deploy/targets/deb.js +4 -0
- package/dist/deploy/targets/deb.js.map +1 -0
- package/dist/deploy/targets/flatpak-manifest.d.ts +6 -0
- package/dist/deploy/targets/flatpak-manifest.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-manifest.js +48 -0
- package/dist/deploy/targets/flatpak-manifest.js.map +1 -0
- package/dist/deploy/targets/flatpak-pnpm.d.ts +15 -0
- package/dist/deploy/targets/flatpak-pnpm.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-pnpm.js +69 -0
- package/dist/deploy/targets/flatpak-pnpm.js.map +1 -0
- package/dist/deploy/targets/flatpak-prebuilt.d.ts +8 -0
- package/dist/deploy/targets/flatpak-prebuilt.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-prebuilt.js +43 -0
- package/dist/deploy/targets/flatpak-prebuilt.js.map +1 -0
- package/dist/deploy/targets/flatpak-source.d.ts +5 -0
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-source.js +119 -0
- package/dist/deploy/targets/flatpak-source.js.map +1 -0
- package/dist/deploy/targets/flatpak-sources.d.ts +19 -0
- package/dist/deploy/targets/flatpak-sources.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-sources.js +122 -0
- package/dist/deploy/targets/flatpak-sources.js.map +1 -0
- package/dist/deploy/targets/flatpak.d.ts +4 -0
- package/dist/deploy/targets/flatpak.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak.js +113 -0
- package/dist/deploy/targets/flatpak.js.map +1 -0
- package/dist/deploy/targets/nfpm-target.d.ts +5 -0
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -0
- package/dist/deploy/targets/nfpm-target.js +26 -0
- package/dist/deploy/targets/nfpm-target.js.map +1 -0
- package/dist/deploy/targets/rpm.d.ts +4 -0
- package/dist/deploy/targets/rpm.d.ts.map +1 -0
- package/dist/deploy/targets/rpm.js +4 -0
- package/dist/deploy/targets/rpm.js.map +1 -0
- package/dist/deploy/tools.d.ts +20 -0
- package/dist/deploy/tools.d.ts.map +1 -0
- package/dist/deploy/tools.js +106 -0
- package/dist/deploy/tools.js.map +1 -0
- package/dist/deploy/types.d.ts +140 -0
- package/dist/deploy/types.d.ts.map +1 -0
- package/dist/deploy/types.js +2 -0
- package/dist/deploy/types.js.map +1 -0
- package/dist/deploy/vendored/appimagetool.d.ts +7 -0
- package/dist/deploy/vendored/appimagetool.d.ts.map +1 -0
- package/dist/deploy/vendored/appimagetool.js +42 -0
- package/dist/deploy/vendored/appimagetool.js.map +1 -0
- package/dist/deploy/vendored/nfpm.d.ts +3 -0
- package/dist/deploy/vendored/nfpm.d.ts.map +1 -0
- package/dist/deploy/vendored/nfpm.js +60 -0
- package/dist/deploy/vendored/nfpm.js.map +1 -0
- package/dist/dev/change-queue.d.ts +11 -0
- package/dist/dev/change-queue.d.ts.map +1 -0
- package/dist/dev/change-queue.js +34 -0
- package/dist/dev/change-queue.js.map +1 -0
- package/dist/dev/failure-tracker.d.ts +10 -0
- package/dist/dev/failure-tracker.d.ts.map +1 -0
- package/dist/dev/failure-tracker.js +61 -0
- package/dist/dev/failure-tracker.js.map +1 -0
- package/dist/dev/missing-import.d.ts +4 -0
- package/dist/dev/missing-import.d.ts.map +1 -0
- package/dist/dev/missing-import.js +23 -0
- package/dist/dev/missing-import.js.map +1 -0
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +25 -6
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner.d.ts +8 -4
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +334 -66
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/supervisor.d.ts +1 -2
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +1 -1
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +13 -2
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +30 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/internal/entry-arg.d.ts +1 -7
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +18 -11
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/module-loads.d.ts +7 -0
- package/dist/internal/module-loads.d.ts.map +1 -0
- package/dist/internal/module-loads.js +21 -0
- package/dist/internal/module-loads.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +16 -0
- package/dist/internal/prepare-project.d.ts.map +1 -0
- package/dist/internal/prepare-project.js +15 -0
- package/dist/internal/prepare-project.js.map +1 -0
- package/dist/internal/run-cli-tool.d.ts +2 -1
- package/dist/internal/run-cli-tool.d.ts.map +1 -1
- package/dist/internal/run-cli-tool.js +15 -6
- package/dist/internal/run-cli-tool.js.map +1 -1
- package/dist/internal/staging-dir.d.ts +8 -1
- package/dist/internal/staging-dir.d.ts.map +1 -1
- package/dist/internal/staging-dir.js +38 -2
- package/dist/internal/staging-dir.js.map +1 -1
- package/dist/mcp/serialize-widget.d.ts +2 -1
- package/dist/mcp/serialize-widget.d.ts.map +1 -1
- package/dist/mcp/serialize-widget.js +1 -1
- package/dist/mcp/serialize-widget.js.map +1 -1
- package/dist/mcp/testing-loader.d.ts +5 -2
- package/dist/mcp/testing-loader.d.ts.map +1 -1
- package/dist/mcp/testing-loader.js +7 -3
- package/dist/mcp/testing-loader.js.map +1 -1
- package/dist/refresh-runtime.d.ts +2 -1
- package/dist/refresh-runtime.d.ts.map +1 -1
- package/dist/refresh-runtime.js +32 -2
- package/dist/refresh-runtime.js.map +1 -1
- package/dist/settings/schema.d.ts +1 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +1 -1
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-extensions.d.ts +2 -1
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -1
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +4 -0
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -0
- package/dist/vite-plugins/asset-imports.js +88 -0
- package/dist/vite-plugins/asset-imports.js.map +1 -0
- package/dist/vite-plugins/asset-specifier.d.ts +5 -0
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -0
- package/dist/vite-plugins/asset-specifier.js +7 -0
- package/dist/vite-plugins/asset-specifier.js.map +1 -0
- package/dist/vite-plugins/esm-extension.d.ts +4 -0
- package/dist/vite-plugins/esm-extension.d.ts.map +1 -0
- package/dist/vite-plugins/esm-extension.js +4 -0
- package/dist/vite-plugins/esm-extension.js.map +1 -0
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts +1 -3
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +4 -0
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +2 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +2 -1
- package/dist/vite-plugins/resource-shared.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +30 -29
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts +4 -0
- package/dist/vite-plugins/self-contained.d.ts.map +1 -0
- package/dist/vite-plugins/self-contained.js +244 -0
- package/dist/vite-plugins/self-contained.js.map +1 -0
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +19 -40
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts +4 -0
- package/dist/vite-plugins/store-links.d.ts.map +1 -0
- package/dist/vite-plugins/store-links.js +19 -0
- package/dist/vite-plugins/store-links.js.map +1 -0
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +51 -12
- package/dist/vite-plugins/undeclared-library.js.map +1 -1
- package/dist/vite-plugins/worker.d.ts.map +1 -1
- package/dist/vite-plugins/worker.js +3 -1
- package/dist/vite-plugins/worker.js.map +1 -1
- package/env.d.ts +106 -25
- package/package.json +20 -13
- package/src/builder.ts +22 -4
- package/src/cli.ts +7 -2
- package/src/codegen/freshness.ts +2 -2
- package/src/codegen/report.ts +4 -0
- package/src/codegen/run-codegen.ts +48 -24
- package/src/codegen/store-resolver.ts +1 -1
- package/src/commands/build.ts +5 -6
- package/src/commands/codegen.ts +14 -1
- package/src/commands/deploy.ts +47 -0
- package/src/commands/dev.ts +4 -4
- package/src/commands/docs.ts +40 -4
- package/src/deploy/depends.ts +42 -0
- package/src/deploy/download.ts +148 -0
- package/src/deploy/freedesktop/copyright.ts +41 -0
- package/src/deploy/freedesktop/dbus-service.ts +19 -0
- package/src/deploy/freedesktop/desktop-entry.ts +102 -0
- package/src/deploy/freedesktop/ini.ts +39 -0
- package/src/deploy/freedesktop/metainfo-sections.ts +116 -0
- package/src/deploy/freedesktop/metainfo.ts +46 -0
- package/src/deploy/freedesktop/mime-package.ts +28 -0
- package/src/deploy/freedesktop/validate.ts +124 -0
- package/src/deploy/freedesktop/xml.ts +53 -0
- package/src/deploy/git.ts +20 -0
- package/src/deploy/install-hints.ts +111 -0
- package/src/deploy/nfpm/config.ts +153 -0
- package/src/deploy/nfpm/contents.ts +69 -0
- package/src/deploy/nfpm/description.ts +11 -0
- package/src/deploy/nfpm/optional.ts +8 -0
- package/src/deploy/nfpm/pack.ts +44 -0
- package/src/deploy/node-runtime/download.ts +48 -0
- package/src/deploy/node-runtime/elf.ts +145 -0
- package/src/deploy/node-runtime/guard.ts +29 -0
- package/src/deploy/node-runtime/index.ts +80 -0
- package/src/deploy/payload/copy-tree.ts +51 -0
- package/src/deploy/payload/icons.ts +80 -0
- package/src/deploy/payload/launcher.ts +27 -0
- package/src/deploy/payload/schemas.ts +27 -0
- package/src/deploy/payload/stage.ts +145 -0
- package/src/deploy/registry.ts +40 -0
- package/src/deploy/run-deploy.ts +241 -0
- package/src/deploy/settings/arch.ts +18 -0
- package/src/deploy/settings/categories.ts +39 -0
- package/src/deploy/settings/exec.ts +29 -0
- package/src/deploy/settings/identity.ts +133 -0
- package/src/deploy/settings/index.ts +189 -0
- package/src/deploy/settings/package-manifest.ts +68 -0
- package/src/deploy/settings/paths.ts +115 -0
- package/src/deploy/settings/screenshots.ts +125 -0
- package/src/deploy/settings/starter.ts +41 -0
- package/src/deploy/settings/version.ts +59 -0
- package/src/deploy/targets/appimage.ts +140 -0
- package/src/deploy/targets/deb.ts +6 -0
- package/src/deploy/targets/flatpak-manifest.ts +61 -0
- package/src/deploy/targets/flatpak-pnpm.ts +115 -0
- package/src/deploy/targets/flatpak-prebuilt.ts +59 -0
- package/src/deploy/targets/flatpak-source.ts +181 -0
- package/src/deploy/targets/flatpak-sources.ts +198 -0
- package/src/deploy/targets/flatpak.ts +144 -0
- package/src/deploy/targets/nfpm-target.ts +33 -0
- package/src/deploy/targets/rpm.ts +6 -0
- package/src/deploy/tools.ts +156 -0
- package/src/deploy/types.ts +174 -0
- package/src/deploy/vendored/appimagetool.ts +57 -0
- package/src/deploy/vendored/nfpm.ts +79 -0
- package/src/dev/change-queue.ts +59 -0
- package/src/dev/failure-tracker.ts +92 -0
- package/src/dev/missing-import.ts +32 -0
- package/src/dev/runner-deps.ts +34 -6
- package/src/dev/runner.ts +506 -102
- package/src/dev/supervisor.ts +0 -3
- package/src/dev/vite-dev-server.ts +54 -3
- package/src/internal/entry-arg.ts +25 -11
- package/src/internal/module-loads.ts +32 -0
- package/src/internal/prepare-project.ts +23 -0
- package/src/internal/run-cli-tool.ts +22 -6
- package/src/internal/staging-dir.ts +57 -2
- package/src/mcp/serialize-widget.ts +3 -2
- package/src/mcp/testing-loader.ts +19 -4
- package/src/refresh-runtime.ts +48 -2
- package/src/settings/schema.ts +0 -1
- package/src/vite-plugins/asset-extensions.ts +2 -1
- package/src/vite-plugins/asset-imports.ts +134 -0
- package/src/vite-plugins/asset-specifier.ts +9 -0
- package/src/vite-plugins/esm-extension.ts +4 -0
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +1 -1
- package/src/vite-plugins/index.ts +4 -0
- package/src/vite-plugins/resource-shared.ts +2 -0
- package/src/vite-plugins/resources.ts +33 -33
- package/src/vite-plugins/self-contained.ts +352 -0
- package/src/vite-plugins/settings.ts +21 -48
- package/src/vite-plugins/store-links.ts +25 -0
- package/src/vite-plugins/undeclared-library.ts +74 -12
- package/src/vite-plugins/worker.ts +4 -1
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js +0 -3
- package/dist/internal.js.map +0 -1
- package/src/internal.ts +0 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { errorMessage, info, tryResolveExecutable } from "@gtkx/utils";
|
|
2
|
+
import { existsSync, mkdirSync, statSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { stringify } from "yaml";
|
|
5
|
+
import { runCliTool } from "../../internal/run-cli-tool.js";
|
|
6
|
+
import { APPSTREAMCLI, DESKTOP_FILE_VALIDATE, FLATPAK, FLATPAK_BUILDER } from "../tools.js";
|
|
7
|
+
import { branchFor, renderFlatpakManifest } from "./flatpak-manifest.js";
|
|
8
|
+
import { detectPackageManager, generateNodeSources, pnpmPinFor } from "./flatpak-sources.js";
|
|
9
|
+
const PREFIX = "/app";
|
|
10
|
+
const TARGET_DIR = "flatpak";
|
|
11
|
+
const FLATHUB_REPO = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
|
12
|
+
const BUILDER_REF = "org.flatpak.Builder";
|
|
13
|
+
const flatpakTarget = {
|
|
14
|
+
name: "flatpak",
|
|
15
|
+
prefix: PREFIX,
|
|
16
|
+
tools: [FLATPAK, FLATPAK_BUILDER, DESKTOP_FILE_VALIDATE, APPSTREAMCLI],
|
|
17
|
+
render: (payload) => renderManifests(payload),
|
|
18
|
+
pack: (payload) => Promise.try(() => packFlatpak(payload)),
|
|
19
|
+
};
|
|
20
|
+
const flatpakDir = (settings) => join(settings.paths.targets, TARGET_DIR);
|
|
21
|
+
const manifestPathFor = (settings) => join(flatpakDir(settings), `${settings.applicationId}.yml`);
|
|
22
|
+
const resolveBuilder = () => {
|
|
23
|
+
if (tryResolveExecutable(FLATPAK_BUILDER.command) !== undefined) {
|
|
24
|
+
return { tool: FLATPAK_BUILDER.command, prefix: [] };
|
|
25
|
+
}
|
|
26
|
+
return { tool: FLATPAK.command, prefix: ["run", BUILDER_REF] };
|
|
27
|
+
};
|
|
28
|
+
const isSourceMode = (settings) => settings.deploy.flatpak?.mode === "source";
|
|
29
|
+
const renderManifests = (payload) => {
|
|
30
|
+
const settings = payload.settings;
|
|
31
|
+
if (isSourceMode(settings)) {
|
|
32
|
+
const manager = detectPackageManager(settings);
|
|
33
|
+
generateNodeSources(settings, manager, pnpmPinFor(settings, manager));
|
|
34
|
+
}
|
|
35
|
+
return [{
|
|
36
|
+
path: manifestPathFor(settings),
|
|
37
|
+
contents: stringify(renderFlatpakManifest(payload), { lineWidth: 0 }),
|
|
38
|
+
}];
|
|
39
|
+
};
|
|
40
|
+
const builderArgsFor = (settings, dir) => [
|
|
41
|
+
"--force-clean",
|
|
42
|
+
"--user",
|
|
43
|
+
"--install-deps-from=flathub",
|
|
44
|
+
`--default-branch=${branchFor(settings)}`,
|
|
45
|
+
...(settings.deploy.flatpak?.shouldUseRofilesFuse === false ? ["--disable-rofiles-fuse"] : []),
|
|
46
|
+
`--state-dir=${join(dir, "state")}`,
|
|
47
|
+
`--repo=${join(dir, "repo")}`,
|
|
48
|
+
join(dir, "build"),
|
|
49
|
+
manifestPathFor(settings),
|
|
50
|
+
];
|
|
51
|
+
const buildFlatpak = (settings) => {
|
|
52
|
+
const dir = flatpakDir(settings);
|
|
53
|
+
const builder = resolveBuilder();
|
|
54
|
+
info("flatpak: running flatpak-builder, this can take several minutes");
|
|
55
|
+
try {
|
|
56
|
+
runCliTool({
|
|
57
|
+
tool: builder.tool,
|
|
58
|
+
args: [...builder.prefix, ...builderArgsFor(settings, dir)],
|
|
59
|
+
target: "the flatpak",
|
|
60
|
+
shouldStream: true,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
throw new Error(`${errorMessage(error)}\n\nIf it stopped at "Failure spawning rofiles-fuse", the build is running ` +
|
|
65
|
+
"somewhere FUSE is unavailable, such as a container. Set `deploy.flatpak.shouldUseRofilesFuse: false` " +
|
|
66
|
+
"to build without it.", { cause: error });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const bundleArgsFor = (settings, target) => {
|
|
70
|
+
const signing = settings.deploy.signing?.flatpak;
|
|
71
|
+
const runtimeRepo = settings.deploy.flatpak?.runtimeRepo ?? FLATHUB_REPO;
|
|
72
|
+
return [
|
|
73
|
+
"build-bundle",
|
|
74
|
+
join(flatpakDir(settings), "repo"),
|
|
75
|
+
target,
|
|
76
|
+
settings.applicationId,
|
|
77
|
+
branchFor(settings),
|
|
78
|
+
`--arch=${settings.arch.flatpak}`,
|
|
79
|
+
`--runtime-repo=${runtimeRepo}`,
|
|
80
|
+
...(signing === undefined ? [] : [`--gpg-sign=${signing.gpgKeyId}`]),
|
|
81
|
+
...(signing?.gpgHomeDir === undefined ? [] : [`--gpg-homedir=${signing.gpgHomeDir}`]),
|
|
82
|
+
];
|
|
83
|
+
};
|
|
84
|
+
const bundleFlatpak = (settings) => {
|
|
85
|
+
const output = settings.paths.output;
|
|
86
|
+
mkdirSync(output, { recursive: true });
|
|
87
|
+
const version = settings.versions.packageVersion;
|
|
88
|
+
const target = join(output, `${settings.applicationId}-${version}-${settings.arch.flatpak}.flatpak`);
|
|
89
|
+
runCliTool({ tool: FLATPAK.command, args: bundleArgsFor(settings, target), target: "the flatpak bundle" });
|
|
90
|
+
if (!existsSync(target)) {
|
|
91
|
+
throw new Error(`flatpak build-bundle reported success but wrote no bundle at ${target}`);
|
|
92
|
+
}
|
|
93
|
+
return { path: target, size: statSync(target).size };
|
|
94
|
+
};
|
|
95
|
+
const installFlatpak = (settings) => {
|
|
96
|
+
runCliTool({
|
|
97
|
+
tool: FLATPAK.command,
|
|
98
|
+
args: ["install", "--user", "--noninteractive", "--reinstall", join(flatpakDir(settings), "repo"),
|
|
99
|
+
settings.applicationId],
|
|
100
|
+
target: "the flatpak",
|
|
101
|
+
shouldStream: true,
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
const packFlatpak = (payload) => {
|
|
105
|
+
const settings = payload.settings;
|
|
106
|
+
buildFlatpak(settings);
|
|
107
|
+
if (settings.deploy.flatpak?.shouldInstall === true) {
|
|
108
|
+
installFlatpak(settings);
|
|
109
|
+
}
|
|
110
|
+
return settings.deploy.flatpak?.shouldEmitBundle === false ? [] : [bundleFlatpak(settings)];
|
|
111
|
+
};
|
|
112
|
+
export { flatpakTarget };
|
|
113
|
+
//# sourceMappingURL=flatpak.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flatpak.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AA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,aAAa;QACrB,YAAY,EAAE,IAAI;KACrB,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,OAAsB,EAAoB,EAAE;IAC7D,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAEvB,IAAI,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,EAAE,CAAC;QAClD,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,gBAAgB,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { errorMessage, info, tryResolveExecutable } from \"@gtkx/utils\";\nimport { existsSync, mkdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { stringify } from \"yaml\";\nimport type { DeployArtifact, DeployManifest, DeployPayload, DeploySettings, DeployTarget } from \"../types.js\";\nimport { runCliTool } from \"../../internal/run-cli-tool.js\";\nimport { APPSTREAMCLI, DESKTOP_FILE_VALIDATE, FLATPAK, FLATPAK_BUILDER } from \"../tools.js\";\nimport { branchFor, renderFlatpakManifest } from \"./flatpak-manifest.js\";\nimport { detectPackageManager, generateNodeSources, pnpmPinFor } from \"./flatpak-sources.js\";\n\ntype BuilderInvocation = {\n tool: string;\n prefix: string[];\n};\n\nconst PREFIX = \"/app\";\nconst TARGET_DIR = \"flatpak\";\nconst FLATHUB_REPO = \"https://dl.flathub.org/repo/flathub.flatpakrepo\";\nconst BUILDER_REF = \"org.flatpak.Builder\";\n\nconst flatpakTarget: DeployTarget = {\n name: \"flatpak\",\n prefix: PREFIX,\n tools: [FLATPAK, FLATPAK_BUILDER, DESKTOP_FILE_VALIDATE, APPSTREAMCLI],\n render: (payload) => renderManifests(payload),\n pack: (payload) => Promise.try(() => packFlatpak(payload)),\n};\n\nconst flatpakDir = (settings: DeploySettings): string => join(settings.paths.targets, TARGET_DIR);\n\nconst manifestPathFor = (settings: DeploySettings): string =>\n join(flatpakDir(settings), `${settings.applicationId}.yml`);\n\nconst resolveBuilder = (): BuilderInvocation => {\n if (tryResolveExecutable(FLATPAK_BUILDER.command) !== undefined) {\n return { tool: FLATPAK_BUILDER.command, prefix: [] };\n }\n\n return { tool: FLATPAK.command, prefix: [\"run\", BUILDER_REF] };\n};\n\nconst isSourceMode = (settings: DeploySettings): boolean => settings.deploy.flatpak?.mode === \"source\";\n\nconst renderManifests = (payload: DeployPayload): DeployManifest[] => {\n const settings = payload.settings;\n\n if (isSourceMode(settings)) {\n const manager = detectPackageManager(settings);\n generateNodeSources(settings, manager, pnpmPinFor(settings, manager));\n }\n\n return [{\n path: manifestPathFor(settings),\n contents: stringify(renderFlatpakManifest(payload), { lineWidth: 0 }),\n }];\n};\n\nconst builderArgsFor = (settings: DeploySettings, dir: string): string[] => [\n \"--force-clean\",\n \"--user\",\n \"--install-deps-from=flathub\",\n `--default-branch=${branchFor(settings)}`,\n ...(settings.deploy.flatpak?.shouldUseRofilesFuse === false ? [\"--disable-rofiles-fuse\"] : []),\n `--state-dir=${join(dir, \"state\")}`,\n `--repo=${join(dir, \"repo\")}`,\n join(dir, \"build\"),\n manifestPathFor(settings),\n];\n\nconst buildFlatpak = (settings: DeploySettings): void => {\n const dir = flatpakDir(settings);\n const builder = resolveBuilder();\n info(\"flatpak: running flatpak-builder, this can take several minutes\");\n\n try {\n runCliTool({\n tool: builder.tool,\n args: [...builder.prefix, ...builderArgsFor(settings, dir)],\n target: \"the flatpak\",\n shouldStream: true,\n });\n } catch (error) {\n throw new Error(\n `${errorMessage(error)}\\n\\nIf it stopped at \"Failure spawning rofiles-fuse\", the build is running ` +\n \"somewhere FUSE is unavailable, such as a container. Set `deploy.flatpak.shouldUseRofilesFuse: false` \" +\n \"to build without it.\",\n { cause: error },\n );\n }\n};\n\nconst bundleArgsFor = (settings: DeploySettings, target: string): string[] => {\n const signing = settings.deploy.signing?.flatpak;\n const runtimeRepo = settings.deploy.flatpak?.runtimeRepo ?? FLATHUB_REPO;\n\n return [\n \"build-bundle\",\n join(flatpakDir(settings), \"repo\"),\n target,\n settings.applicationId,\n branchFor(settings),\n `--arch=${settings.arch.flatpak}`,\n `--runtime-repo=${runtimeRepo}`,\n ...(signing === undefined ? [] : [`--gpg-sign=${signing.gpgKeyId}`]),\n ...(signing?.gpgHomeDir === undefined ? [] : [`--gpg-homedir=${signing.gpgHomeDir}`]),\n ];\n};\n\nconst bundleFlatpak = (settings: DeploySettings): DeployArtifact => {\n const output = settings.paths.output;\n mkdirSync(output, { recursive: true });\n const version = settings.versions.packageVersion;\n const target = join(output, `${settings.applicationId}-${version}-${settings.arch.flatpak}.flatpak`);\n runCliTool({ tool: FLATPAK.command, args: bundleArgsFor(settings, target), target: \"the flatpak bundle\" });\n\n if (!existsSync(target)) {\n throw new Error(`flatpak build-bundle reported success but wrote no bundle at ${target}`);\n }\n\n return { path: target, size: statSync(target).size };\n};\n\nconst installFlatpak = (settings: DeploySettings): void => {\n runCliTool({\n tool: FLATPAK.command,\n args: [\"install\", \"--user\", \"--noninteractive\", \"--reinstall\", join(flatpakDir(settings), \"repo\"),\n settings.applicationId],\n target: \"the flatpak\",\n shouldStream: true,\n });\n};\n\nconst packFlatpak = (payload: DeployPayload): DeployArtifact[] => {\n const settings = payload.settings;\n buildFlatpak(settings);\n\n if (settings.deploy.flatpak?.shouldInstall === true) {\n installFlatpak(settings);\n }\n\n return settings.deploy.flatpak?.shouldEmitBundle === false ? [] : [bundleFlatpak(settings)];\n};\n\nexport { flatpakTarget };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nfpm-target.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/nfpm-target.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAiD,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/F,OAAO,EAAE,KAAK,YAAY,EAAoB,MAAM,mBAAmB,CAAC;AAqBxE,QAAA,MAAM,UAAU,GAAI,UAAU,YAAY,KAAG,YAM3C,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { stringify } from "yaml";
|
|
3
|
+
import { renderNfpmConfig } from "../nfpm/config.js";
|
|
4
|
+
import { packWithNfpm } from "../nfpm/pack.js";
|
|
5
|
+
import { TAR } from "../tools.js";
|
|
6
|
+
const MANIFEST_FILENAME = "nfpm.yaml";
|
|
7
|
+
const PREFIX = "/usr";
|
|
8
|
+
const manifestPathFor = (payload, packager) => join(payload.settings.paths.targets, packager, MANIFEST_FILENAME);
|
|
9
|
+
const renderManifests = (payload, packager) => [
|
|
10
|
+
{
|
|
11
|
+
path: manifestPathFor(payload, packager),
|
|
12
|
+
contents: stringify(renderNfpmConfig(payload, packager), { lineWidth: 0 }),
|
|
13
|
+
},
|
|
14
|
+
];
|
|
15
|
+
const packPackage = async (payload, packager) => [
|
|
16
|
+
await packWithNfpm(payload, packager, manifestPathFor(payload, packager)),
|
|
17
|
+
];
|
|
18
|
+
const nfpmTarget = (packager) => ({
|
|
19
|
+
name: packager,
|
|
20
|
+
prefix: PREFIX,
|
|
21
|
+
tools: [TAR],
|
|
22
|
+
render: (payload) => renderManifests(payload, packager),
|
|
23
|
+
pack: (payload) => packPackage(payload, packager),
|
|
24
|
+
});
|
|
25
|
+
export { nfpmTarget };
|
|
26
|
+
//# sourceMappingURL=nfpm-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nfpm-target.js","sourceRoot":"","sources":["../../../src/deploy/targets/nfpm-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SA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AE,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport { stringify } from \"yaml\";\nimport type { DeployArtifact, DeployManifest, DeployPayload, DeployTarget } from \"../types.js\";\nimport { type NfpmPackager, renderNfpmConfig } from \"../nfpm/config.js\";\nimport { packWithNfpm } from \"../nfpm/pack.js\";\nimport { TAR } from \"../tools.js\";\n\nconst MANIFEST_FILENAME = \"nfpm.yaml\";\nconst PREFIX = \"/usr\";\n\nconst manifestPathFor = (payload: DeployPayload, packager: NfpmPackager): string =>\n join(payload.settings.paths.targets, packager, MANIFEST_FILENAME);\n\nconst renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => [\n {\n path: manifestPathFor(payload, packager),\n contents: stringify(renderNfpmConfig(payload, packager), { lineWidth: 0 }),\n },\n];\n\nconst packPackage = async (payload: DeployPayload, packager: NfpmPackager): Promise<DeployArtifact[]> => [\n await packWithNfpm(payload, packager, manifestPathFor(payload, packager)),\n];\n\nconst nfpmTarget = (packager: NfpmPackager): DeployTarget => ({\n name: packager,\n prefix: PREFIX,\n tools: [TAR],\n render: (payload) => renderManifests(payload, packager),\n pack: (payload) => packPackage(payload, packager),\n});\n\nexport { nfpmTarget };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpm.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/rpm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,QAAA,MAAM,SAAS,EAAE,YAAgC,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpm.js","sourceRoot":"","sources":["../../../src/deploy/targets/rpm.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,SAAS,GAAiB,UAAU,CAAC,KAAK,CAAC,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import type { DeployTarget } from \"../types.js\";\nimport { nfpmTarget } from \"./nfpm-target.js\";\n\nconst rpmTarget: DeployTarget = nfpmTarget(\"rpm\");\n\nexport { rpmTarget };\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DeployTool } from "./types.js";
|
|
2
|
+
type ToolReport = {
|
|
3
|
+
missingRequired: DeployTool[];
|
|
4
|
+
missingOptional: DeployTool[];
|
|
5
|
+
};
|
|
6
|
+
declare const GENERATOR_PNPM_OPTION = "--pnpm-store-version";
|
|
7
|
+
declare const APPSTREAMCLI: DeployTool;
|
|
8
|
+
declare const DESKTOP_FILE_VALIDATE: DeployTool;
|
|
9
|
+
declare const FILE_TOOL: DeployTool;
|
|
10
|
+
declare const FLATPAK: DeployTool;
|
|
11
|
+
declare const FLATPAK_BUILDER: DeployTool;
|
|
12
|
+
declare const FLATPAK_NODE_GENERATOR: DeployTool;
|
|
13
|
+
declare const FLATPAK_NODE_GENERATOR_PNPM: DeployTool;
|
|
14
|
+
declare const STRIP: DeployTool;
|
|
15
|
+
declare const TAR: DeployTool;
|
|
16
|
+
declare const probeTools: (tools: DeployTool[]) => ToolReport;
|
|
17
|
+
declare const assertTools: (report: ToolReport) => void;
|
|
18
|
+
declare const warnMissingOptional: (report: ToolReport) => void;
|
|
19
|
+
export { APPSTREAMCLI, FLATPAK_NODE_GENERATOR, FLATPAK_NODE_GENERATOR_PNPM, GENERATOR_PNPM_OPTION, assertTools, DESKTOP_FILE_VALIDATE, FILE_TOOL, FLATPAK, FLATPAK_BUILDER, probeTools, STRIP, TAR, warnMissingOptional, };
|
|
20
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/deploy/tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,KAAK,UAAU,GAAG;IACd,eAAe,EAAE,UAAU,EAAE,CAAC;IAC9B,eAAe,EAAE,UAAU,EAAE,CAAC;CACjC,CAAC;AAKF,QAAA,MAAM,qBAAqB,yBAAyB,CAAC;AAErD,QAAA,MAAM,YAAY,EAAE,UAInB,CAAC;AAEF,QAAA,MAAM,qBAAqB,EAAE,UAI5B,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,UAIhB,CAAC;AAEF,QAAA,MAAM,OAAO,EAAE,UAId,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,UAMtB,CAAC;AAEF,QAAA,MAAM,sBAAsB,EAAE,UAI7B,CAAC;AAEF,QAAA,MAAM,2BAA2B,EAAE,UAGlC,CAAC;AAEF,QAAA,MAAM,KAAK,EAAE,UAIZ,CAAC;AAEF,QAAA,MAAM,GAAG,EAAE,UAIV,CAAC;AA8BF,QAAA,MAAM,UAAU,GAAI,OAAO,UAAU,EAAE,KAAG,UAOzC,CAAC;AAwBF,QAAA,MAAM,WAAW,GAAI,QAAQ,UAAU,KAAG,IAIzC,CAAC;AAEF,QAAA,MAAM,mBAAmB,GAAI,QAAQ,UAAU,KAAG,IAIjD,CAAC;AAEF,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,OAAO,EACP,eAAe,EACf,UAAU,EACV,KAAK,EACL,GAAG,EACH,mBAAmB,GACtB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { tryResolveExecutable, warn } from "@gtkx/utils";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { detectPackageFamily, installHints } from "./install-hints.js";
|
|
4
|
+
const DETAIL_COLUMN = 26;
|
|
5
|
+
const FLATPAK_BUILDER_REF = "org.flatpak.Builder";
|
|
6
|
+
const FLATPAK_NODE_GENERATOR_COMMAND = "flatpak-node-generator";
|
|
7
|
+
const GENERATOR_PNPM_OPTION = "--pnpm-store-version";
|
|
8
|
+
const APPSTREAMCLI = {
|
|
9
|
+
command: "appstreamcli",
|
|
10
|
+
purpose: "validates the AppStream metainfo",
|
|
11
|
+
isOptional: false,
|
|
12
|
+
};
|
|
13
|
+
const DESKTOP_FILE_VALIDATE = {
|
|
14
|
+
command: "desktop-file-validate",
|
|
15
|
+
purpose: "validates the desktop entry",
|
|
16
|
+
isOptional: false,
|
|
17
|
+
};
|
|
18
|
+
const FILE_TOOL = {
|
|
19
|
+
command: "file",
|
|
20
|
+
purpose: "required by appimagetool to inspect the payload",
|
|
21
|
+
isOptional: false,
|
|
22
|
+
};
|
|
23
|
+
const FLATPAK = {
|
|
24
|
+
command: "flatpak",
|
|
25
|
+
purpose: "installs the runtime and writes the bundle",
|
|
26
|
+
isOptional: false,
|
|
27
|
+
};
|
|
28
|
+
const FLATPAK_BUILDER = {
|
|
29
|
+
command: "flatpak-builder",
|
|
30
|
+
purpose: "builds the Flatpak",
|
|
31
|
+
isOptional: false,
|
|
32
|
+
isPresent: () => tryResolveExecutable("flatpak-builder") !== undefined || isFlatpakRefInstalled(FLATPAK_BUILDER_REF),
|
|
33
|
+
};
|
|
34
|
+
const FLATPAK_NODE_GENERATOR = {
|
|
35
|
+
command: FLATPAK_NODE_GENERATOR_COMMAND,
|
|
36
|
+
purpose: "vendors the dependencies a Flathub build installs offline",
|
|
37
|
+
isOptional: false,
|
|
38
|
+
};
|
|
39
|
+
const FLATPAK_NODE_GENERATOR_PNPM = {
|
|
40
|
+
...FLATPAK_NODE_GENERATOR,
|
|
41
|
+
isPresent: () => hasGeneratorPnpmSupport(),
|
|
42
|
+
};
|
|
43
|
+
const STRIP = {
|
|
44
|
+
command: "strip",
|
|
45
|
+
purpose: "would shrink the bundled Node.js by removing its symbols",
|
|
46
|
+
isOptional: true,
|
|
47
|
+
};
|
|
48
|
+
const TAR = {
|
|
49
|
+
command: "tar",
|
|
50
|
+
purpose: "unpacks the downloaded Node.js and packaging tools",
|
|
51
|
+
isOptional: false,
|
|
52
|
+
};
|
|
53
|
+
const isFlatpakRefInstalled = (ref) => {
|
|
54
|
+
const flatpak = tryResolveExecutable(FLATPAK.command);
|
|
55
|
+
if (flatpak === undefined) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
return spawnSync(flatpak, ["info", ref], { stdio: "ignore" }).status === 0;
|
|
59
|
+
};
|
|
60
|
+
const hasGeneratorPnpmSupport = () => {
|
|
61
|
+
const generator = tryResolveExecutable(FLATPAK_NODE_GENERATOR_COMMAND);
|
|
62
|
+
if (generator === undefined) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
const help = spawnSync(generator, ["--help"], { encoding: "utf8" });
|
|
66
|
+
return help.error === undefined && help.output.join("").includes(GENERATOR_PNPM_OPTION);
|
|
67
|
+
};
|
|
68
|
+
const isToolPresent = (tool) => tool.isPresent === undefined ? tryResolveExecutable(tool.command) !== undefined : tool.isPresent();
|
|
69
|
+
const uniqueTools = (tools) => new Map(tools.map((tool) => [tool.command, tool])).values().toArray();
|
|
70
|
+
const probeTools = (tools) => {
|
|
71
|
+
const missing = uniqueTools(tools).filter((tool) => !isToolPresent(tool));
|
|
72
|
+
return {
|
|
73
|
+
missingRequired: missing.filter((tool) => !tool.isOptional),
|
|
74
|
+
missingOptional: missing.filter((tool) => tool.isOptional),
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
const pad = (text) => text.padEnd(DETAIL_COLUMN);
|
|
78
|
+
const toolLines = (tool, hints) => [
|
|
79
|
+
` ${pad(tool.command)}${tool.purpose}`,
|
|
80
|
+
...hints.map((hint) => ` ${pad("")}${hint}`),
|
|
81
|
+
];
|
|
82
|
+
const missingToolsMessage = (report) => {
|
|
83
|
+
const family = detectPackageFamily();
|
|
84
|
+
const required = report.missingRequired.flatMap((tool) => toolLines(tool, installHints(tool.command, family)));
|
|
85
|
+
const count = report.missingRequired.length;
|
|
86
|
+
const plural = count === 1 ? "tool is" : "tools are";
|
|
87
|
+
return [
|
|
88
|
+
`Cannot deploy: ${String(count)} required ${plural} missing.`,
|
|
89
|
+
"",
|
|
90
|
+
...required,
|
|
91
|
+
"",
|
|
92
|
+
"Narrow the run with --target if you do not need every package format.",
|
|
93
|
+
].join("\n");
|
|
94
|
+
};
|
|
95
|
+
const assertTools = (report) => {
|
|
96
|
+
if (report.missingRequired.length > 0) {
|
|
97
|
+
throw new Error(missingToolsMessage(report));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const warnMissingOptional = (report) => {
|
|
101
|
+
for (const tool of report.missingOptional) {
|
|
102
|
+
warn(`${tool.command} is not installed: it ${tool.purpose}`);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
export { APPSTREAMCLI, FLATPAK_NODE_GENERATOR, FLATPAK_NODE_GENERATOR_PNPM, GENERATOR_PNPM_OPTION, assertTools, DESKTOP_FILE_VALIDATE, FILE_TOOL, FLATPAK, FLATPAK_BUILDER, probeTools, STRIP, TAR, warnMissingOptional, };
|
|
106
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/deploy/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvE,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAClD,MAAM,8BAA8B,GAAG,wBAAwB,CAAC;AAChE,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAErD,MAAM,YAAY,GAAe;IAC7B,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,kCAAkC;IAC3C,UAAU,EAAE,KAAK;CACpB,CAAC;AAEF,MAAM,qBAAqB,GAAe;IACtC,OAAO,EAAE,u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,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;IACjD,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAQ,EAAE;IACrD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;QACxC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,yBAAyB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,OAAO,EACP,eAAe,EACf,UAAU,EACV,KAAK,EACL,GAAG,EACH,mBAAmB,GACtB,CAAC","sourcesContent":["import { tryResolveExecutable, warn } from \"@gtkx/utils\";\nimport { spawnSync } from \"node:child_process\";\nimport type { DeployTool } from \"./types.js\";\nimport { detectPackageFamily, installHints } from \"./install-hints.js\";\n\ntype ToolReport = {\n missingRequired: DeployTool[];\n missingOptional: DeployTool[];\n};\n\nconst DETAIL_COLUMN = 26;\nconst FLATPAK_BUILDER_REF = \"org.flatpak.Builder\";\nconst FLATPAK_NODE_GENERATOR_COMMAND = \"flatpak-node-generator\";\nconst GENERATOR_PNPM_OPTION = \"--pnpm-store-version\";\n\nconst APPSTREAMCLI: DeployTool = {\n command: \"appstreamcli\",\n purpose: \"validates the AppStream metainfo\",\n isOptional: false,\n};\n\nconst DESKTOP_FILE_VALIDATE: DeployTool = {\n command: \"desktop-file-validate\",\n purpose: \"validates the desktop entry\",\n isOptional: false,\n};\n\nconst FILE_TOOL: DeployTool = {\n command: \"file\",\n purpose: \"required by appimagetool to inspect the payload\",\n isOptional: false,\n};\n\nconst FLATPAK: DeployTool = {\n command: \"flatpak\",\n purpose: \"installs the runtime and writes the bundle\",\n isOptional: false,\n};\n\nconst FLATPAK_BUILDER: DeployTool = {\n command: \"flatpak-builder\",\n purpose: \"builds the Flatpak\",\n isOptional: false,\n isPresent: () =>\n tryResolveExecutable(\"flatpak-builder\") !== undefined || isFlatpakRefInstalled(FLATPAK_BUILDER_REF),\n};\n\nconst FLATPAK_NODE_GENERATOR: DeployTool = {\n command: FLATPAK_NODE_GENERATOR_COMMAND,\n purpose: \"vendors the dependencies a Flathub build installs offline\",\n isOptional: false,\n};\n\nconst FLATPAK_NODE_GENERATOR_PNPM: DeployTool = {\n ...FLATPAK_NODE_GENERATOR,\n isPresent: () => hasGeneratorPnpmSupport(),\n};\n\nconst STRIP: DeployTool = {\n command: \"strip\",\n purpose: \"would shrink the bundled Node.js by removing its symbols\",\n isOptional: true,\n};\n\nconst TAR: DeployTool = {\n command: \"tar\",\n purpose: \"unpacks the downloaded Node.js and packaging tools\",\n isOptional: false,\n};\n\nconst isFlatpakRefInstalled = (ref: string): boolean => {\n const flatpak = tryResolveExecutable(FLATPAK.command);\n\n if (flatpak === undefined) {\n return false;\n }\n\n return spawnSync(flatpak, [\"info\", ref], { stdio: \"ignore\" }).status === 0;\n};\n\nconst hasGeneratorPnpmSupport = (): boolean => {\n const generator = tryResolveExecutable(FLATPAK_NODE_GENERATOR_COMMAND);\n\n if (generator === undefined) {\n return false;\n }\n\n const help = spawnSync(generator, [\"--help\"], { encoding: \"utf8\" });\n\n return help.error === undefined && help.output.join(\"\").includes(GENERATOR_PNPM_OPTION);\n};\n\nconst isToolPresent = (tool: DeployTool): boolean =>\n tool.isPresent === undefined ? tryResolveExecutable(tool.command) !== undefined : tool.isPresent();\n\nconst uniqueTools = (tools: DeployTool[]): DeployTool[] =>\n new Map(tools.map((tool) => [tool.command, tool])).values().toArray();\n\nconst probeTools = (tools: DeployTool[]): ToolReport => {\n const missing = uniqueTools(tools).filter((tool) => !isToolPresent(tool));\n\n return {\n missingRequired: missing.filter((tool) => !tool.isOptional),\n missingOptional: missing.filter((tool) => tool.isOptional),\n };\n};\n\nconst pad = (text: string): string => text.padEnd(DETAIL_COLUMN);\n\nconst toolLines = (tool: DeployTool, hints: string[]): string[] => [\n ` ${pad(tool.command)}${tool.purpose}`,\n ...hints.map((hint) => ` ${pad(\"\")}${hint}`),\n];\n\nconst missingToolsMessage = (report: ToolReport): string => {\n const family = detectPackageFamily();\n const required = report.missingRequired.flatMap((tool) => toolLines(tool, installHints(tool.command, family)));\n const count = report.missingRequired.length;\n const plural = count === 1 ? \"tool is\" : \"tools are\";\n\n return [\n `Cannot deploy: ${String(count)} required ${plural} missing.`,\n \"\",\n ...required,\n \"\",\n \"Narrow the run with --target if you do not need every package format.\",\n ].join(\"\\n\");\n};\n\nconst assertTools = (report: ToolReport): void => {\n if (report.missingRequired.length > 0) {\n throw new Error(missingToolsMessage(report));\n }\n};\n\nconst warnMissingOptional = (report: ToolReport): void => {\n for (const tool of report.missingOptional) {\n warn(`${tool.command} is not installed: it ${tool.purpose}`);\n }\n};\n\nexport {\n APPSTREAMCLI,\n FLATPAK_NODE_GENERATOR,\n FLATPAK_NODE_GENERATOR_PNPM,\n GENERATOR_PNPM_OPTION,\n assertTools,\n DESKTOP_FILE_VALIDATE,\n FILE_TOOL,\n FLATPAK,\n FLATPAK_BUILDER,\n probeTools,\n STRIP,\n TAR,\n warnMissingOptional,\n};\n"]}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { Config } from "@gtkx/config";
|
|
2
|
+
type DeployConfig = NonNullable<Config["deploy"]>;
|
|
3
|
+
type DeployTargetName = NonNullable<DeployConfig["targets"]>[number];
|
|
4
|
+
type PackageFamily = "arch" | "debian" | "fedora" | "suse" | "unknown";
|
|
5
|
+
type DeployTool = {
|
|
6
|
+
command: string;
|
|
7
|
+
purpose: string;
|
|
8
|
+
isOptional: boolean;
|
|
9
|
+
isPresent?: () => boolean;
|
|
10
|
+
};
|
|
11
|
+
type StagedFile = {
|
|
12
|
+
rel: string;
|
|
13
|
+
abs: string;
|
|
14
|
+
mode: number;
|
|
15
|
+
};
|
|
16
|
+
type NodeRuntime = {
|
|
17
|
+
path: string;
|
|
18
|
+
version: string;
|
|
19
|
+
glibcFloor: string | null;
|
|
20
|
+
isStripped: boolean;
|
|
21
|
+
};
|
|
22
|
+
type DeployDeveloper = {
|
|
23
|
+
id: string | null;
|
|
24
|
+
name: string;
|
|
25
|
+
email: string | null;
|
|
26
|
+
};
|
|
27
|
+
type DeployScreenshot = {
|
|
28
|
+
url: string;
|
|
29
|
+
caption: string | null;
|
|
30
|
+
isDefault: boolean;
|
|
31
|
+
};
|
|
32
|
+
type DeployRelease = {
|
|
33
|
+
version: string;
|
|
34
|
+
date: string;
|
|
35
|
+
type: string | null;
|
|
36
|
+
urgency: string | null;
|
|
37
|
+
notes: string[];
|
|
38
|
+
url: string | null;
|
|
39
|
+
};
|
|
40
|
+
type DeployFileAssociation = {
|
|
41
|
+
extension: string;
|
|
42
|
+
mimeType: string;
|
|
43
|
+
description: string | null;
|
|
44
|
+
};
|
|
45
|
+
type DeployDesktopAction = {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
args: string[];
|
|
49
|
+
icon: string | null;
|
|
50
|
+
};
|
|
51
|
+
type DeployVersions = {
|
|
52
|
+
upstream: string;
|
|
53
|
+
packageVersion: string;
|
|
54
|
+
debRevision: string;
|
|
55
|
+
rpmRelease: string;
|
|
56
|
+
epoch: number | null;
|
|
57
|
+
};
|
|
58
|
+
type DeployArch = {
|
|
59
|
+
deb: string;
|
|
60
|
+
rpm: string;
|
|
61
|
+
flatpak: string;
|
|
62
|
+
appimage: string;
|
|
63
|
+
node: string;
|
|
64
|
+
};
|
|
65
|
+
type DeployPaths = {
|
|
66
|
+
root: string;
|
|
67
|
+
dist: string;
|
|
68
|
+
outDir: string;
|
|
69
|
+
metadata: string;
|
|
70
|
+
runtime: string;
|
|
71
|
+
stage: string;
|
|
72
|
+
overlay: string;
|
|
73
|
+
targets: string;
|
|
74
|
+
output: string;
|
|
75
|
+
dataDir: string | null;
|
|
76
|
+
iconsDir: string | null;
|
|
77
|
+
iconFile: string | null;
|
|
78
|
+
licenseFile: string | null;
|
|
79
|
+
schemaFiles: string[];
|
|
80
|
+
};
|
|
81
|
+
type DeploySettings = {
|
|
82
|
+
applicationId: string;
|
|
83
|
+
binaryName: string;
|
|
84
|
+
name: string;
|
|
85
|
+
genericName: string | null;
|
|
86
|
+
summary: string;
|
|
87
|
+
description: string[];
|
|
88
|
+
keywords: string[];
|
|
89
|
+
categories: string[];
|
|
90
|
+
mimeTypes: string[];
|
|
91
|
+
developer: DeployDeveloper;
|
|
92
|
+
license: string;
|
|
93
|
+
metadataLicense: string;
|
|
94
|
+
copyright: string;
|
|
95
|
+
homepage: string | null;
|
|
96
|
+
urls: Record<string, string>;
|
|
97
|
+
screenshots: DeployScreenshot[];
|
|
98
|
+
branding: {
|
|
99
|
+
light: string;
|
|
100
|
+
dark: string;
|
|
101
|
+
} | null;
|
|
102
|
+
contentRating: Record<string, string>;
|
|
103
|
+
releases: DeployRelease[];
|
|
104
|
+
execArgs: string[];
|
|
105
|
+
execToken: string | null;
|
|
106
|
+
fileAssociations: DeployFileAssociation[];
|
|
107
|
+
protocols: string[];
|
|
108
|
+
desktopActions: DeployDesktopAction[];
|
|
109
|
+
desktopEntry: Record<string, string>;
|
|
110
|
+
isDbusActivatable: boolean;
|
|
111
|
+
extraFiles: Record<string, string>;
|
|
112
|
+
versions: DeployVersions;
|
|
113
|
+
arch: DeployArch;
|
|
114
|
+
paths: DeployPaths;
|
|
115
|
+
libraries: string[];
|
|
116
|
+
deploy: DeployConfig;
|
|
117
|
+
};
|
|
118
|
+
type DeployPayload = {
|
|
119
|
+
settings: DeploySettings;
|
|
120
|
+
node: NodeRuntime | null;
|
|
121
|
+
stage: StagedFile[];
|
|
122
|
+
overlays: Record<DeployTargetName, StagedFile[]>;
|
|
123
|
+
};
|
|
124
|
+
type DeployManifest = {
|
|
125
|
+
path: string;
|
|
126
|
+
contents: string;
|
|
127
|
+
};
|
|
128
|
+
type DeployArtifact = {
|
|
129
|
+
path: string;
|
|
130
|
+
size: number;
|
|
131
|
+
};
|
|
132
|
+
type DeployTarget = {
|
|
133
|
+
name: DeployTargetName;
|
|
134
|
+
prefix: string;
|
|
135
|
+
tools: DeployTool[];
|
|
136
|
+
render: (payload: DeployPayload) => DeployManifest[];
|
|
137
|
+
pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;
|
|
138
|
+
};
|
|
139
|
+
export type { DeployArch, DeployArtifact, DeployConfig, DeployDesktopAction, DeployDeveloper, DeployFileAssociation, DeployManifest, DeployPaths, DeployPayload, DeployRelease, DeployScreenshot, DeploySettings, DeployTarget, DeployTargetName, DeployTool, DeployVersions, NodeRuntime, PackageFamily, StagedFile, };
|
|
140
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,KAAK,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAClD,KAAK,gBAAgB,GAAG,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvE,KAAK,UAAU,GAAG;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,OAAO,CAAC;CAC7B,CAAC;AAEF,KAAK,UAAU,GAAG;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CAChB,CA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,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,EAAE,CAAC;IACrD,IAAI,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAC5F,CAAC;AAEF,YAAY,EACR,UAAU,EACV,cAAc,EACd,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,WAAW,EACX,aAAa,EACb,UAAU,GACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/deploy/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Config } from \"@gtkx/config\";\n\ntype DeployConfig = NonNullable<Config[\"deploy\"]>;\ntype DeployTargetName = NonNullable<DeployConfig[\"targets\"]>[number];\ntype PackageFamily = \"arch\" | \"debian\" | \"fedora\" | \"suse\" | \"unknown\";\n\ntype DeployTool = {\n command: string;\n purpose: string;\n isOptional: boolean;\n isPresent?: () => boolean;\n};\n\ntype StagedFile = {\n rel: string;\n abs: string;\n mode: number;\n};\n\ntype NodeRuntime = {\n path: string;\n version: string;\n glibcFloor: string | null;\n isStripped: boolean;\n};\n\ntype DeployDeveloper = {\n id: string | null;\n name: string;\n email: string | null;\n};\n\ntype DeployScreenshot = {\n url: string;\n caption: string | null;\n isDefault: boolean;\n};\n\ntype DeployRelease = {\n version: string;\n date: string;\n type: string | null;\n urgency: string | null;\n notes: string[];\n url: string | null;\n};\n\ntype DeployFileAssociation = {\n extension: string;\n mimeType: string;\n description: string | null;\n};\n\ntype DeployDesktopAction = {\n id: string;\n name: string;\n args: string[];\n icon: string | null;\n};\n\ntype DeployVersions = {\n upstream: string;\n packageVersion: string;\n debRevision: string;\n rpmRelease: string;\n epoch: number | null;\n};\n\ntype DeployArch = {\n deb: string;\n rpm: string;\n flatpak: string;\n appimage: string;\n node: string;\n};\n\ntype DeployPaths = {\n root: string;\n dist: string;\n outDir: string;\n metadata: string;\n runtime: string;\n stage: string;\n overlay: string;\n targets: string;\n output: string;\n dataDir: string | null;\n iconsDir: string | null;\n iconFile: string | null;\n licenseFile: string | null;\n schemaFiles: string[];\n};\n\ntype DeploySettings = {\n applicationId: string;\n binaryName: string;\n name: string;\n genericName: string | null;\n summary: string;\n description: string[];\n keywords: string[];\n categories: string[];\n mimeTypes: string[];\n developer: DeployDeveloper;\n license: string;\n metadataLicense: string;\n copyright: string;\n homepage: string | null;\n urls: Record<string, string>;\n screenshots: DeployScreenshot[];\n branding: { light: string; dark: string } | null;\n contentRating: Record<string, string>;\n releases: DeployRelease[];\n execArgs: string[];\n execToken: string | null;\n fileAssociations: DeployFileAssociation[];\n protocols: string[];\n desktopActions: DeployDesktopAction[];\n desktopEntry: Record<string, string>;\n isDbusActivatable: boolean;\n extraFiles: Record<string, string>;\n versions: DeployVersions;\n arch: DeployArch;\n paths: DeployPaths;\n libraries: string[];\n deploy: DeployConfig;\n};\n\ntype DeployPayload = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n stage: StagedFile[];\n overlays: Record<DeployTargetName, StagedFile[]>;\n};\n\ntype DeployManifest = {\n path: string;\n contents: string;\n};\n\ntype DeployArtifact = {\n path: string;\n size: number;\n};\n\ntype DeployTarget = {\n name: DeployTargetName;\n prefix: string;\n tools: DeployTool[];\n render: (payload: DeployPayload) => DeployManifest[];\n pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;\n};\n\nexport type {\n DeployArch,\n DeployArtifact,\n DeployConfig,\n DeployDesktopAction,\n DeployDeveloper,\n DeployFileAssociation,\n DeployManifest,\n DeployPaths,\n DeployPayload,\n DeployRelease,\n DeployScreenshot,\n DeploySettings,\n DeployTarget,\n DeployTargetName,\n DeployTool,\n DeployVersions,\n NodeRuntime,\n PackageFamily,\n StagedFile,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appimagetool.d.ts","sourceRoot":"","sources":["../../../src/deploy/vendored/appimagetool.ts"],"names":[],"mappings":"AAGA,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AA4BF,QAAA,MAAM,sBAAsB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,eAAe,CAoB3E,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { cacheDir, downloadFile } from "../download.js";
|
|
3
|
+
const APPIMAGETOOL_VERSION = "1.9.1";
|
|
4
|
+
const RUNTIME_VERSION = "20251108";
|
|
5
|
+
const APPIMAGETOOL_URL = `https://github.com/AppImage/appimagetool/releases/download/${APPIMAGETOOL_VERSION}`;
|
|
6
|
+
const RUNTIME_URL = `https://github.com/AppImage/type2-runtime/releases/download/${RUNTIME_VERSION}`;
|
|
7
|
+
const EXECUTABLE_MODE = 0o755;
|
|
8
|
+
const APPIMAGETOOL_DIGESTS = {
|
|
9
|
+
aarch64: "f0837e7448a0c1e4e650a93bb3e85802546e60654ef287576f46c71c126a9158",
|
|
10
|
+
x86_64: "ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0",
|
|
11
|
+
};
|
|
12
|
+
const RUNTIME_DIGESTS = {
|
|
13
|
+
aarch64: "00cbdfcf917cc6c0ff6d3347d59e0ca1f7f45a6df1a428a0d6d8a78664d87444",
|
|
14
|
+
x86_64: "2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d",
|
|
15
|
+
};
|
|
16
|
+
const digestFor = (digests, arch, subject) => {
|
|
17
|
+
const digest = digests[arch];
|
|
18
|
+
if (digest === undefined) {
|
|
19
|
+
throw new Error(`${subject} has no pinned build for ${arch}`);
|
|
20
|
+
}
|
|
21
|
+
return digest;
|
|
22
|
+
};
|
|
23
|
+
const resolveAppimageTooling = async (arch) => {
|
|
24
|
+
const dir = cacheDir(["appimage", `${APPIMAGETOOL_VERSION}-${RUNTIME_VERSION}`]);
|
|
25
|
+
const tool = await downloadFile({
|
|
26
|
+
url: `${APPIMAGETOOL_URL}/appimagetool-${arch}.AppImage`,
|
|
27
|
+
dest: join(dir, `appimagetool-${arch}`),
|
|
28
|
+
label: `appimagetool ${APPIMAGETOOL_VERSION}`,
|
|
29
|
+
sha256: digestFor(APPIMAGETOOL_DIGESTS, arch, "appimagetool"),
|
|
30
|
+
mode: EXECUTABLE_MODE,
|
|
31
|
+
});
|
|
32
|
+
const runtime = await downloadFile({
|
|
33
|
+
url: `${RUNTIME_URL}/runtime-${arch}`,
|
|
34
|
+
dest: join(dir, `runtime-${arch}`),
|
|
35
|
+
label: `the AppImage runtime ${RUNTIME_VERSION}`,
|
|
36
|
+
sha256: digestFor(RUNTIME_DIGESTS, arch, "the AppImage runtime"),
|
|
37
|
+
mode: EXECUTABLE_MODE,
|
|
38
|
+
});
|
|
39
|
+
return { tool, runtime };
|
|
40
|
+
};
|
|
41
|
+
export { resolveAppimageTooling };
|
|
42
|
+
//# sourceMappingURL=appimagetool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appimagetool.js","sourceRoot":"","sources":["../../../src/deploy/vendored/appimagetool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAOxD,MAAM,oBAAoB,GAAG,OAAO,CAAC;AACrC,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,MAAM,gBAAgB,GAAG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AAI,EAAE,CAAC;QAClC,KAAK,EAAE,wBAAwB,eAAe,EAAE;QAChD,MAAM,EAAE,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,sBAAsB,CAAC;QAChE,IAAI,EAAE,eAAe;KACxB,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import { join } from \"node:path\";\nimport { cacheDir, downloadFile } from \"../download.js\";\n\ntype AppimageTooling = {\n tool: string;\n runtime: string;\n};\n\nconst APPIMAGETOOL_VERSION = \"1.9.1\";\nconst RUNTIME_VERSION = \"20251108\";\nconst APPIMAGETOOL_URL = `https://github.com/AppImage/appimagetool/releases/download/${APPIMAGETOOL_VERSION}`;\nconst RUNTIME_URL = `https://github.com/AppImage/type2-runtime/releases/download/${RUNTIME_VERSION}`;\nconst EXECUTABLE_MODE = 0o755;\n\nconst APPIMAGETOOL_DIGESTS: Record<string, string> = {\n aarch64: \"f0837e7448a0c1e4e650a93bb3e85802546e60654ef287576f46c71c126a9158\",\n x86_64: \"ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0\",\n};\n\nconst RUNTIME_DIGESTS: Record<string, string> = {\n aarch64: \"00cbdfcf917cc6c0ff6d3347d59e0ca1f7f45a6df1a428a0d6d8a78664d87444\",\n x86_64: \"2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d\",\n};\n\nconst digestFor = (digests: Record<string, string>, arch: string, subject: string): string => {\n const digest = digests[arch];\n\n if (digest === undefined) {\n throw new Error(`${subject} has no pinned build for ${arch}`);\n }\n\n return digest;\n};\n\nconst resolveAppimageTooling = async (arch: string): Promise<AppimageTooling> => {\n const dir = cacheDir([\"appimage\", `${APPIMAGETOOL_VERSION}-${RUNTIME_VERSION}`]);\n\n const tool = await downloadFile({\n url: `${APPIMAGETOOL_URL}/appimagetool-${arch}.AppImage`,\n dest: join(dir, `appimagetool-${arch}`),\n label: `appimagetool ${APPIMAGETOOL_VERSION}`,\n sha256: digestFor(APPIMAGETOOL_DIGESTS, arch, \"appimagetool\"),\n mode: EXECUTABLE_MODE,\n });\n\n const runtime = await downloadFile({\n url: `${RUNTIME_URL}/runtime-${arch}`,\n dest: join(dir, `runtime-${arch}`),\n label: `the AppImage runtime ${RUNTIME_VERSION}`,\n sha256: digestFor(RUNTIME_DIGESTS, arch, \"the AppImage runtime\"),\n mode: EXECUTABLE_MODE,\n });\n\n return { tool, runtime };\n};\n\nexport { resolveAppimageTooling };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nfpm.d.ts","sourceRoot":"","sources":["../../../src/deploy/vendored/nfpm.ts"],"names":[],"mappings":"AAkEA,QAAA,MAAM,WAAW,QAAa,OAAO,CAAC,MAAM,CAU3C,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
|