@gtkx/cli 1.6.0 → 2.0.0-beta.10
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 +47 -44
- package/bin/gtkx-dev-runner.js +5 -1
- package/bin/gtkx.js +5 -1
- package/dist/builder.d.ts +1 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +44 -12
- package/dist/builder.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/config-dependencies.d.ts +3 -0
- package/dist/codegen/config-dependencies.d.ts.map +1 -0
- package/dist/codegen/config-dependencies.js +355 -0
- package/dist/codegen/config-dependencies.js.map +1 -0
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +49 -16
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts.map +1 -1
- package/dist/codegen/reference.js +2 -7
- package/dist/codegen/reference.js.map +1 -1
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +5 -16
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +9 -8
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +60 -113
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +3 -2
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js +14 -20
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts +5 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +83 -10
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cleanup.d.ts +9 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +42 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/codegen.d.ts +1 -0
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +6 -5
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +10 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +31 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +6 -15
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts.map +1 -1
- package/dist/deploy/depends.js +24 -2
- package/dist/deploy/depends.js.map +1 -1
- package/dist/deploy/download.d.ts +7 -3
- package/dist/deploy/download.d.ts.map +1 -1
- package/dist/deploy/download.js +19 -20
- package/dist/deploy/download.js.map +1 -1
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
- package/dist/deploy/freedesktop/copyright.js +2 -13
- package/dist/deploy/freedesktop/copyright.js.map +1 -1
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
- package/dist/deploy/freedesktop/metainfo.js +41 -2
- package/dist/deploy/freedesktop/metainfo.js.map +1 -1
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
- package/dist/deploy/freedesktop/validate.js +58 -14
- package/dist/deploy/freedesktop/validate.js.map +1 -1
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
- package/dist/deploy/freedesktop/xml.js +21 -25
- package/dist/deploy/freedesktop/xml.js.map +1 -1
- package/dist/deploy/native-addon.d.ts +5 -0
- package/dist/deploy/native-addon.d.ts.map +1 -0
- package/dist/deploy/native-addon.js +134 -0
- package/dist/deploy/native-addon.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +3 -2
- package/dist/deploy/nfpm/config.d.ts.map +1 -1
- package/dist/deploy/nfpm/config.js +7 -4
- package/dist/deploy/nfpm/config.js.map +1 -1
- package/dist/deploy/nfpm/contents.d.ts.map +1 -1
- package/dist/deploy/nfpm/contents.js +8 -0
- package/dist/deploy/nfpm/contents.js.map +1 -1
- package/dist/deploy/node-runtime/download.js +2 -2
- package/dist/deploy/node-runtime/download.js.map +1 -1
- package/dist/deploy/node-runtime/elf.d.ts +4 -1
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
- package/dist/deploy/node-runtime/elf.js +34 -5
- package/dist/deploy/node-runtime/elf.js.map +1 -1
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
- package/dist/deploy/node-runtime/guard.js +7 -14
- package/dist/deploy/node-runtime/guard.js.map +1 -1
- package/dist/deploy/node-runtime/index.d.ts +3 -1
- package/dist/deploy/node-runtime/index.d.ts.map +1 -1
- package/dist/deploy/node-runtime/index.js +103 -10
- package/dist/deploy/node-runtime/index.js.map +1 -1
- package/dist/deploy/node-runtime/license.d.ts.map +1 -1
- package/dist/deploy/node-runtime/license.js +2 -9
- package/dist/deploy/node-runtime/license.js.map +1 -1
- package/dist/deploy/node-runtime/sonames.d.ts +5 -0
- package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
- package/dist/deploy/node-runtime/sonames.js +13 -0
- package/dist/deploy/node-runtime/sonames.js.map +1 -0
- package/dist/deploy/notices/node-runtime.js +2 -2
- package/dist/deploy/notices/node-runtime.js.map +1 -1
- package/dist/deploy/notices/packages.d.ts.map +1 -1
- package/dist/deploy/notices/packages.js +3 -10
- package/dist/deploy/notices/packages.js.map +1 -1
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
- package/dist/deploy/payload/copy-tree.js +3 -3
- package/dist/deploy/payload/copy-tree.js.map +1 -1
- package/dist/deploy/payload/launcher.d.ts.map +1 -1
- package/dist/deploy/payload/launcher.js +14 -1
- package/dist/deploy/payload/launcher.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +2 -1
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +47 -8
- package/dist/deploy/payload/stage.js.map +1 -1
- package/dist/deploy/run-deploy.d.ts +2 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -1
- package/dist/deploy/run-deploy.js +197 -52
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/arch.d.ts +9 -3
- package/dist/deploy/settings/arch.d.ts.map +1 -1
- package/dist/deploy/settings/arch.js +27 -6
- package/dist/deploy/settings/arch.js.map +1 -1
- package/dist/deploy/settings/build-manifest.d.ts +6 -1
- package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
- package/dist/deploy/settings/build-manifest.js +17 -17
- package/dist/deploy/settings/build-manifest.js.map +1 -1
- package/dist/deploy/settings/extra-files.d.ts +1 -1
- package/dist/deploy/settings/extra-files.d.ts.map +1 -1
- package/dist/deploy/settings/extra-files.js +25 -3
- package/dist/deploy/settings/extra-files.js.map +1 -1
- package/dist/deploy/settings/index.d.ts +3 -1
- package/dist/deploy/settings/index.d.ts.map +1 -1
- package/dist/deploy/settings/index.js +4 -2
- package/dist/deploy/settings/index.js.map +1 -1
- package/dist/deploy/settings/libraries.d.ts.map +1 -1
- package/dist/deploy/settings/libraries.js +3 -19
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +4 -3
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +118 -19
- package/dist/deploy/settings/paths.js.map +1 -1
- package/dist/deploy/settings/screenshots.d.ts.map +1 -1
- package/dist/deploy/settings/screenshots.js +6 -31
- package/dist/deploy/settings/screenshots.js.map +1 -1
- package/dist/deploy/targets/appimage.d.ts.map +1 -1
- package/dist/deploy/targets/appimage.js +1 -0
- package/dist/deploy/targets/appimage.js.map +1 -1
- package/dist/deploy/targets/flatpak-pnpm.js +4 -4
- package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +17 -6
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/targets/flatpak-sources.js +1 -1
- package/dist/deploy/targets/flatpak-sources.js.map +1 -1
- package/dist/deploy/targets/flatpak.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak.js +1 -0
- package/dist/deploy/targets/flatpak.js.map +1 -1
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
- package/dist/deploy/targets/nfpm-target.js +13 -7
- package/dist/deploy/targets/nfpm-target.js.map +1 -1
- package/dist/deploy/types.d.ts +5 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/types.js.map +1 -1
- package/dist/deploy/vendored/appimagetool.js +2 -2
- package/dist/deploy/vendored/appimagetool.js.map +1 -1
- package/dist/deploy/vendored/nfpm.js +1 -1
- package/dist/deploy/vendored/nfpm.js.map +1 -1
- package/dist/dev/catalog-writes.d.ts +8 -0
- package/dist/dev/catalog-writes.d.ts.map +1 -0
- package/dist/dev/catalog-writes.js +26 -0
- package/dist/dev/catalog-writes.js.map +1 -0
- package/dist/dev/entry-env.d.ts +2 -1
- package/dist/dev/entry-env.d.ts.map +1 -1
- package/dist/dev/entry-env.js +2 -1
- package/dist/dev/entry-env.js.map +1 -1
- package/dist/dev/font-dir.d.ts +3 -0
- package/dist/dev/font-dir.d.ts.map +1 -0
- package/dist/dev/font-dir.js +9 -0
- package/dist/dev/font-dir.js.map +1 -0
- package/dist/dev/headless.d.ts +3 -0
- package/dist/dev/headless.d.ts.map +1 -0
- package/dist/dev/headless.js +35 -0
- package/dist/dev/headless.js.map +1 -0
- package/dist/dev/runner-deps.d.ts +1 -1
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +12 -7
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner-main.d.ts.map +1 -1
- package/dist/dev/runner-main.js +11 -5
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts +2 -0
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +26 -7
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/schema-dir.d.ts +1 -1
- package/dist/dev/schema-dir.d.ts.map +1 -1
- package/dist/dev/schema-dir.js +2 -4
- package/dist/dev/schema-dir.js.map +1 -1
- package/dist/dev/supervisor.d.ts +3 -1
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +132 -29
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +1 -1
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +14 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/dev/watch-ignore.d.ts +3 -0
- package/dist/dev/watch-ignore.d.ts.map +1 -0
- package/dist/dev/watch-ignore.js +11 -0
- package/dist/dev/watch-ignore.js.map +1 -0
- package/dist/i18n/catalogs.d.ts +6 -2
- package/dist/i18n/catalogs.d.ts.map +1 -1
- package/dist/i18n/catalogs.js +12 -8
- package/dist/i18n/catalogs.js.map +1 -1
- package/dist/i18n/metadata-templates.d.ts.map +1 -1
- package/dist/i18n/metadata-templates.js +2 -1
- package/dist/i18n/metadata-templates.js.map +1 -1
- package/dist/i18n/source-messages.d.ts +5 -21
- package/dist/i18n/source-messages.d.ts.map +1 -1
- package/dist/i18n/source-messages.js +1037 -92
- package/dist/i18n/source-messages.js.map +1 -1
- package/dist/i18n/types.d.ts +6 -7
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/i18n/types.js +83 -96
- package/dist/i18n/types.js.map +1 -1
- package/dist/internal/agent-rules.d.ts.map +1 -1
- package/dist/internal/agent-rules.js +7 -2
- package/dist/internal/agent-rules.js.map +1 -1
- package/dist/internal/banner.d.ts +4 -2
- package/dist/internal/banner.d.ts.map +1 -1
- package/dist/internal/banner.js +19 -5
- package/dist/internal/banner.js.map +1 -1
- package/dist/internal/build-manifest.d.ts +5 -2
- package/dist/internal/build-manifest.d.ts.map +1 -1
- package/dist/internal/build-manifest.js +15 -2
- package/dist/internal/build-manifest.js.map +1 -1
- package/dist/internal/build-output.d.ts +8 -0
- package/dist/internal/build-output.d.ts.map +1 -0
- package/dist/internal/build-output.js +116 -0
- package/dist/internal/build-output.js.map +1 -0
- package/dist/internal/cache-root.d.ts +3 -0
- package/dist/internal/cache-root.d.ts.map +1 -0
- package/dist/internal/cache-root.js +9 -0
- package/dist/internal/cache-root.js.map +1 -0
- package/dist/internal/compile-cache-store.d.ts +4 -0
- package/dist/internal/compile-cache-store.d.ts.map +1 -0
- package/dist/internal/compile-cache-store.js +41 -0
- package/dist/internal/compile-cache-store.js.map +1 -0
- package/dist/internal/compile-cache.d.ts +4 -0
- package/dist/internal/compile-cache.d.ts.map +1 -0
- package/dist/internal/compile-cache.js +16 -0
- package/dist/internal/compile-cache.js.map +1 -0
- package/dist/internal/deploy-out-dir.d.ts +4 -0
- package/dist/internal/deploy-out-dir.d.ts.map +1 -0
- package/dist/internal/deploy-out-dir.js +5 -0
- package/dist/internal/deploy-out-dir.js.map +1 -0
- package/dist/internal/docs-elements.d.ts +1 -0
- package/dist/internal/docs-elements.d.ts.map +1 -1
- package/dist/internal/docs-elements.js +6 -5
- package/dist/internal/docs-elements.js.map +1 -1
- package/dist/internal/entry-arg.d.ts +4 -1
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +7 -1
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/errors.d.ts +2 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/font-path.d.ts +4 -0
- package/dist/internal/font-path.d.ts.map +1 -0
- package/dist/internal/font-path.js +12 -0
- package/dist/internal/font-path.js.map +1 -0
- package/dist/internal/font-staging.d.ts +6 -0
- package/dist/internal/font-staging.d.ts.map +1 -0
- package/dist/internal/font-staging.js +94 -0
- package/dist/internal/font-staging.js.map +1 -0
- package/dist/internal/icon-path.d.ts.map +1 -1
- package/dist/internal/icon-path.js +5 -16
- package/dist/internal/icon-path.js.map +1 -1
- package/dist/internal/icon-staging.d.ts +3 -0
- package/dist/internal/icon-staging.d.ts.map +1 -0
- package/dist/internal/icon-staging.js +40 -0
- package/dist/internal/icon-staging.js.map +1 -0
- package/dist/internal/import-scan.d.ts +4 -0
- package/dist/internal/import-scan.d.ts.map +1 -0
- package/dist/internal/import-scan.js +138 -0
- package/dist/internal/import-scan.js.map +1 -0
- package/dist/internal/module-hash.d.ts +3 -0
- package/dist/internal/module-hash.d.ts.map +1 -0
- package/dist/internal/module-hash.js +19 -0
- package/dist/internal/module-hash.js.map +1 -0
- package/dist/internal/output-directory.d.ts +15 -0
- package/dist/internal/output-directory.d.ts.map +1 -0
- package/dist/internal/output-directory.js +490 -0
- package/dist/internal/output-directory.js.map +1 -0
- package/dist/internal/parent-process.d.ts +12 -0
- package/dist/internal/parent-process.d.ts.map +1 -0
- package/dist/internal/parent-process.js +74 -0
- package/dist/internal/parent-process.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +3 -0
- package/dist/internal/prepare-project.d.ts.map +1 -1
- package/dist/internal/prepare-project.js +9 -3
- package/dist/internal/prepare-project.js.map +1 -1
- package/dist/internal/react-compiler-cache.d.ts +13 -0
- package/dist/internal/react-compiler-cache.d.ts.map +1 -0
- package/dist/internal/react-compiler-cache.js +182 -0
- package/dist/internal/react-compiler-cache.js.map +1 -0
- package/dist/internal/source-imports.d.ts +7 -2
- package/dist/internal/source-imports.d.ts.map +1 -1
- package/dist/internal/source-imports.js +38 -49
- package/dist/internal/source-imports.js.map +1 -1
- package/dist/internal/staging-file.d.ts +5 -0
- package/dist/internal/staging-file.d.ts.map +1 -0
- package/dist/internal/staging-file.js +35 -0
- package/dist/internal/staging-file.js.map +1 -0
- package/dist/internal/xdg-banner.d.ts +4 -0
- package/dist/internal/xdg-banner.d.ts.map +1 -0
- package/dist/internal/xdg-banner.js +11 -0
- package/dist/internal/xdg-banner.js.map +1 -0
- package/dist/internal/xdg-data-dirs.d.ts +2 -1
- package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
- package/dist/internal/xdg-data-dirs.js +1 -1
- package/dist/internal/xdg-data-dirs.js.map +1 -1
- package/dist/mcp/client.js +2 -2
- package/dist/mcp/client.js.map +1 -1
- package/dist/settings/render.d.ts +0 -1
- package/dist/settings/render.d.ts.map +1 -1
- package/dist/settings/render.js +1 -11
- package/dist/settings/render.js.map +1 -1
- package/dist/settings/schema.d.ts +2 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +24 -70
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -0
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +1 -2
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
- package/dist/vite-plugins/asset-imports.js +36 -35
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/asset-specifier.d.ts +5 -3
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
- package/dist/vite-plugins/asset-specifier.js +10 -4
- package/dist/vite-plugins/asset-specifier.js.map +1 -1
- package/dist/vite-plugins/build-manifest.d.ts +5 -1
- package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
- package/dist/vite-plugins/build-manifest.js +2 -1
- package/dist/vite-plugins/build-manifest.js.map +1 -1
- package/dist/vite-plugins/built-url.d.ts.map +1 -1
- package/dist/vite-plugins/built-url.js +5 -2
- package/dist/vite-plugins/built-url.js.map +1 -1
- package/dist/vite-plugins/css.d.ts.map +1 -1
- package/dist/vite-plugins/css.js +13 -5
- package/dist/vite-plugins/css.js.map +1 -1
- package/dist/vite-plugins/ensure-store.d.ts +1 -1
- package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
- package/dist/vite-plugins/ensure-store.js +2 -2
- package/dist/vite-plugins/ensure-store.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/font-name.d.ts +3 -0
- package/dist/vite-plugins/font-name.d.ts.map +1 -0
- package/dist/vite-plugins/font-name.js +406 -0
- package/dist/vite-plugins/font-name.js.map +1 -0
- package/dist/vite-plugins/font-worker-env.d.ts +4 -0
- package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/font-worker-env.js +19 -0
- package/dist/vite-plugins/font-worker-env.js.map +1 -0
- package/dist/vite-plugins/font.d.ts +4 -0
- package/dist/vite-plugins/font.d.ts.map +1 -0
- package/dist/vite-plugins/font.js +111 -0
- package/dist/vite-plugins/font.js.map +1 -0
- package/dist/vite-plugins/i18n.d.ts +11 -2
- package/dist/vite-plugins/i18n.d.ts.map +1 -1
- package/dist/vite-plugins/i18n.js +75 -8
- package/dist/vite-plugins/i18n.js.map +1 -1
- package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
- package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/icon-worker-env.js +23 -0
- package/dist/vite-plugins/icon-worker-env.js.map +1 -0
- package/dist/vite-plugins/icons.d.ts.map +1 -1
- package/dist/vite-plugins/icons.js +4 -9
- package/dist/vite-plugins/icons.js.map +1 -1
- package/dist/vite-plugins/index.d.ts +10 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +19 -7
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/native.d.ts.map +1 -1
- package/dist/vite-plugins/native.js +0 -4
- package/dist/vite-plugins/native.js.map +1 -1
- package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
- package/dist/vite-plugins/react-compiler.js +57 -18
- package/dist/vite-plugins/react-compiler.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +3 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +3 -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 +40 -102
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts.map +1 -1
- package/dist/vite-plugins/self-contained.js +159 -158
- package/dist/vite-plugins/self-contained.js.map +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
- package/dist/vite-plugins/settings-worker-env.js +5 -7
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts +1 -2
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +32 -27
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts.map +1 -1
- package/dist/vite-plugins/store-links.js +9 -5
- package/dist/vite-plugins/store-links.js.map +1 -1
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +25 -25
- 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 +21 -14
- package/dist/vite-plugins/worker.js.map +1 -1
- package/dist/vitest-plugin.d.ts +4 -3
- package/dist/vitest-plugin.d.ts.map +1 -1
- package/dist/vitest-plugin.js +12 -8
- package/dist/vitest-plugin.js.map +1 -1
- package/env.d.ts +9 -0
- package/package.json +28 -17
- package/src/builder.ts +45 -12
- package/src/cli.ts +15 -2
- package/src/codegen/config-dependencies.ts +470 -0
- package/src/codegen/freshness.ts +70 -17
- package/src/codegen/reference.ts +2 -8
- package/src/codegen/report.ts +5 -21
- package/src/codegen/run-codegen.ts +73 -160
- package/src/codegen/store-resolver.ts +16 -27
- package/src/commands/build.ts +13 -2
- package/src/commands/cleanup.ts +48 -0
- package/src/commands/codegen.ts +6 -5
- package/src/commands/deploy.ts +10 -2
- package/src/commands/dev.ts +45 -4
- package/src/commands/docs.ts +6 -17
- package/src/deploy/depends.ts +30 -3
- package/src/deploy/download.ts +33 -24
- package/src/deploy/freedesktop/copyright.ts +2 -14
- package/src/deploy/freedesktop/metainfo.ts +73 -21
- package/src/deploy/freedesktop/validate.ts +80 -15
- package/src/deploy/freedesktop/xml.ts +24 -32
- package/src/deploy/native-addon.ts +183 -0
- package/src/deploy/nfpm/config.ts +13 -4
- package/src/deploy/nfpm/contents.ts +8 -0
- package/src/deploy/node-runtime/download.ts +2 -2
- package/src/deploy/node-runtime/elf.ts +46 -5
- package/src/deploy/node-runtime/guard.ts +10 -14
- package/src/deploy/node-runtime/index.ts +148 -12
- package/src/deploy/node-runtime/license.ts +2 -8
- package/src/deploy/node-runtime/sonames.ts +17 -0
- package/src/deploy/notices/node-runtime.ts +2 -2
- package/src/deploy/notices/packages.ts +3 -11
- package/src/deploy/payload/copy-tree.ts +3 -4
- package/src/deploy/payload/launcher.ts +20 -1
- package/src/deploy/payload/stage.ts +78 -11
- package/src/deploy/run-deploy.ts +227 -72
- package/src/deploy/settings/arch.ts +40 -8
- package/src/deploy/settings/build-manifest.ts +30 -17
- package/src/deploy/settings/extra-files.ts +30 -4
- package/src/deploy/settings/index.ts +7 -2
- package/src/deploy/settings/libraries.ts +2 -22
- package/src/deploy/settings/paths.ts +78 -21
- package/src/deploy/settings/screenshots.ts +8 -46
- package/src/deploy/targets/appimage.ts +1 -0
- package/src/deploy/targets/flatpak-pnpm.ts +4 -4
- package/src/deploy/targets/flatpak-source.ts +19 -6
- package/src/deploy/targets/flatpak-sources.ts +1 -1
- package/src/deploy/targets/flatpak.ts +1 -0
- package/src/deploy/targets/nfpm-target.ts +14 -6
- package/src/deploy/types.ts +5 -1
- package/src/deploy/vendored/appimagetool.ts +2 -2
- package/src/deploy/vendored/nfpm.ts +1 -1
- package/src/dev/catalog-writes.ts +35 -0
- package/src/dev/entry-env.ts +2 -1
- package/src/dev/font-dir.ts +11 -0
- package/src/dev/headless.ts +40 -0
- package/src/dev/runner-deps.ts +20 -7
- package/src/dev/runner-main.ts +13 -5
- package/src/dev/runner.ts +37 -7
- package/src/dev/schema-dir.ts +2 -4
- package/src/dev/supervisor.ts +183 -32
- package/src/dev/vite-dev-server.ts +20 -2
- package/src/dev/watch-ignore.ts +16 -0
- package/src/i18n/catalogs.ts +23 -9
- package/src/i18n/metadata-templates.ts +2 -1
- package/src/i18n/source-messages.ts +1641 -262
- package/src/i18n/types.ts +97 -131
- package/src/internal/agent-rules.ts +7 -2
- package/src/internal/banner.ts +27 -6
- package/src/internal/build-manifest.ts +25 -1
- package/src/internal/build-output.ts +171 -0
- package/src/internal/cache-root.ts +12 -0
- package/src/internal/compile-cache-store.ts +50 -0
- package/src/internal/compile-cache.ts +20 -0
- package/src/internal/deploy-out-dir.ts +8 -0
- package/src/internal/docs-elements.ts +11 -5
- package/src/internal/entry-arg.ts +8 -1
- package/src/internal/errors.ts +1 -1
- package/src/internal/font-path.ts +15 -0
- package/src/internal/font-staging.ts +131 -0
- package/src/internal/icon-path.ts +6 -19
- package/src/internal/icon-staging.ts +58 -0
- package/src/internal/import-scan.ts +206 -0
- package/src/internal/module-hash.ts +22 -0
- package/src/internal/output-directory.ts +699 -0
- package/src/internal/parent-process.ts +110 -0
- package/src/internal/prepare-project.ts +11 -5
- package/src/internal/react-compiler-cache.ts +246 -0
- package/src/internal/source-imports.ts +64 -55
- package/src/internal/staging-file.ts +42 -0
- package/src/internal/xdg-banner.ts +13 -0
- package/src/internal/xdg-data-dirs.ts +1 -1
- package/src/mcp/client.ts +2 -2
- package/src/settings/render.ts +1 -13
- package/src/settings/schema.ts +23 -91
- package/src/vite-plugins/asset-extensions.ts +2 -0
- package/src/vite-plugins/asset-imports.ts +39 -45
- package/src/vite-plugins/asset-specifier.ts +17 -5
- package/src/vite-plugins/build-manifest.ts +7 -1
- package/src/vite-plugins/built-url.ts +6 -2
- package/src/vite-plugins/css.ts +16 -5
- package/src/vite-plugins/ensure-store.ts +2 -2
- package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
- package/src/vite-plugins/font-name.ts +582 -0
- package/src/vite-plugins/font-worker-env.ts +25 -0
- package/src/vite-plugins/font.ts +180 -0
- package/src/vite-plugins/i18n.ts +123 -11
- package/src/vite-plugins/icon-worker-env.ts +36 -0
- package/src/vite-plugins/icons.ts +4 -10
- package/src/vite-plugins/index.ts +36 -13
- package/src/vite-plugins/native.ts +0 -5
- package/src/vite-plugins/react-compiler.ts +83 -19
- package/src/vite-plugins/resource-shared.ts +4 -0
- package/src/vite-plugins/resources.ts +47 -144
- package/src/vite-plugins/self-contained.ts +184 -185
- package/src/vite-plugins/settings-worker-env.ts +5 -7
- package/src/vite-plugins/settings.ts +44 -33
- package/src/vite-plugins/store-links.ts +10 -5
- package/src/vite-plugins/undeclared-library.ts +30 -32
- package/src/vite-plugins/worker.ts +31 -16
- package/src/vitest-plugin.ts +12 -8
- package/dist/i18n/binding-extractor.d.ts +0 -30
- package/dist/i18n/binding-extractor.d.ts.map +0 -1
- package/dist/i18n/binding-extractor.js +0 -1324
- package/dist/i18n/binding-extractor.js.map +0 -1
- package/dist/i18n/extractor-plugin.d.ts +0 -8
- package/dist/i18n/extractor-plugin.d.ts.map +0 -1
- package/dist/i18n/extractor-plugin.js +0 -247
- package/dist/i18n/extractor-plugin.js.map +0 -1
- package/dist/internal/data-dir.d.ts +0 -4
- package/dist/internal/data-dir.d.ts.map +0 -1
- package/dist/internal/data-dir.js +0 -52
- package/dist/internal/data-dir.js.map +0 -1
- package/dist/vite-plugins/animated.d.ts +0 -5
- package/dist/vite-plugins/animated.d.ts.map +0 -1
- package/dist/vite-plugins/animated.js +0 -325
- package/dist/vite-plugins/animated.js.map +0 -1
- package/src/i18n/binding-extractor.ts +0 -1969
- package/src/i18n/extractor-plugin.ts +0 -413
- package/src/internal/data-dir.ts +0 -70
- package/src/vite-plugins/animated.ts +0 -486
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,IAAI,eAAe,EAEnC,sBAAsB,EACtB,
|
|
1
|
+
{"version":3,"file":"libraries.js","sourceRoot":"","sources":["../../../src/deploy/settings/libraries.ts"],"names":[],"mappings":"AACA,OAAO,EACH,gBAAgB,IAAI,eAAe,EAEnC,sBAAsB,EACtB,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAA6B,EAAE;IACnE,IAAI,CAAC;QACD,OAAO,sBAAsB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAAE,MAAc,EAAqB,EAAE;IACzE,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,qBAAqB,CAAC,SAAS,EAAE,SAAS,IAAI,eAAe,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;IACnG,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;IAEnC,OAAO;QACH,SAAS;QACT,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,EAAE;KAC9D,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import type { Config } from \"@gtkx/config\";\nimport {\n resolveLibraries as expandLibraries,\n type GeneratedLibraries,\n readGeneratedLibraries,\n resolveStore,\n} from \"@gtkx/codegen\";\nimport { resolveBoundLibraries } from \"@gtkx/codegen/internal\";\n\ntype ResolvedLibraries = {\n libraries: string[];\n minimumLibraryVersions: Record<string, string>;\n};\n\nconst generatedLibraries = (root: string): GeneratedLibraries | null => {\n try {\n return readGeneratedLibraries(resolveStore(root).gi.storeDir);\n } catch {\n return null;\n }\n};\n\nconst resolveLibraries = (root: string, config: Config): ResolvedLibraries => {\n const generated = generatedLibraries(root);\n const libraries = resolveBoundLibraries(generated?.libraries ?? expandLibraries(config.libraries));\n const deploy = config.deploy ?? {};\n\n return {\n libraries,\n minimumLibraryVersions: deploy.minimumLibraryVersions ?? {},\n };\n};\n\nexport { resolveLibraries };\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { Config } from "@gtkx/config";
|
|
2
|
-
import type { DeployConfig, DeployPaths } from "../types.js";
|
|
2
|
+
import type { DeployArchName, DeployConfig, DeployPaths } from "../types.js";
|
|
3
3
|
type PathsRequest = {
|
|
4
4
|
root: string;
|
|
5
5
|
deploy: DeployConfig;
|
|
6
6
|
applicationIcon: Config["applicationIcon"];
|
|
7
7
|
applicationId: Config["applicationId"];
|
|
8
8
|
outDirOverride: string | undefined;
|
|
9
|
+
arch: DeployArchName;
|
|
9
10
|
};
|
|
10
|
-
declare const
|
|
11
|
+
declare const prepareDeployOutDir: (root: string, outDir: string) => void;
|
|
11
12
|
declare const resolvePaths: (request: PathsRequest) => DeployPaths;
|
|
12
|
-
export {
|
|
13
|
+
export { prepareDeployOutDir, resolvePaths };
|
|
13
14
|
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK7E,KAAK,YAAY,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAC3C,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC;IACvC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,IAAI,EAAE,cAAc,CAAC;CACxB,CAAC;AAmEF,QAAA,MAAM,mBAAmB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,IAW3D,CAAC;AAmBF,QAAA,MAAM,YAAY,GAAI,SAAS,YAAY,KAAG,WAmB7C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,29 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
53
|
+
import { isPathInside } from "@gtkx/utils";
|
|
54
|
+
import { lstatSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
55
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
56
|
+
import { DEFAULT_DEPLOY_OUT_DIR } from "../../internal/deploy-out-dir.js";
|
|
3
57
|
import { resolveApplicationIcon } from "../../internal/icon-path.js";
|
|
4
|
-
|
|
58
|
+
import { prepareOutputDirectory, readRegularFile } from "../../internal/output-directory.js";
|
|
5
59
|
const DIST_DIR = "dist";
|
|
60
|
+
const DEPLOY_MARKER_FILENAME = ".gtkx-deploy.json";
|
|
61
|
+
const DEPLOY_MARKER = `${JSON.stringify({ generator: "gtkx-deploy", formatVersion: 1 })}\n`;
|
|
6
62
|
const LICENSE_CANDIDATES = ["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING", "COPYING.md"];
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
63
|
+
const hasSymlinkComponent = (root, target) => {
|
|
64
|
+
let current = root;
|
|
65
|
+
for (const segment of relative(root, target).split(sep)) {
|
|
66
|
+
current = join(current, segment);
|
|
67
|
+
if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
};
|
|
73
|
+
const isDeployMarker = (path) => {
|
|
74
|
+
return readRegularFile(path) === DEPLOY_MARKER;
|
|
75
|
+
};
|
|
76
|
+
const isReusableDeployDirectory = (path) => {
|
|
77
|
+
const entry = lstatSync(path, { throwIfNoEntry: false });
|
|
78
|
+
if (entry === undefined) {
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return entry.isDirectory() &&
|
|
82
|
+
(readdirSync(path).length === 0 || isDeployMarker(join(path, DEPLOY_MARKER_FILENAME)));
|
|
83
|
+
};
|
|
84
|
+
const deployOutputError = (root, configured) => new Error(`Cannot use "${configured}" as the deploy output directory: choose an empty directory or an ` +
|
|
85
|
+
`earlier GTKX deploy directory below ${root}`);
|
|
86
|
+
const assertSafeDeployOutDir = (root, outDir, configured) => {
|
|
87
|
+
const dist = join(root, DIST_DIR);
|
|
88
|
+
if (outDir === dist ||
|
|
89
|
+
!isPathInside(root, outDir) ||
|
|
90
|
+
isPathInside(dist, outDir) ||
|
|
91
|
+
hasSymlinkComponent(root, outDir)) {
|
|
92
|
+
throw deployOutputError(root, configured);
|
|
93
|
+
}
|
|
10
94
|
};
|
|
11
95
|
const resolveOutDir = ({ root, deploy, outDirOverride }) => {
|
|
12
|
-
const configured = outDirOverride ?? deploy.outDir ??
|
|
96
|
+
const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_DEPLOY_OUT_DIR;
|
|
13
97
|
const outDir = resolve(root, configured);
|
|
14
|
-
|
|
15
|
-
|
|
98
|
+
assertSafeDeployOutDir(root, outDir, configured);
|
|
99
|
+
if (!isReusableDeployDirectory(outDir)) {
|
|
100
|
+
throw deployOutputError(root, configured);
|
|
16
101
|
}
|
|
17
102
|
return outDir;
|
|
18
103
|
};
|
|
19
|
-
const
|
|
104
|
+
const prepareDeployOutDir = (root, outDir) => {
|
|
105
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
20
106
|
try {
|
|
21
|
-
|
|
107
|
+
assertSafeDeployOutDir(root, outDir, outDir);
|
|
108
|
+
const prepared = prepareOutputDirectory(root, outDir, isReusableDeployDirectory);
|
|
109
|
+
if (prepared.status === "unsafe") {
|
|
110
|
+
throw deployOutputError(root, outDir);
|
|
111
|
+
}
|
|
112
|
+
const transaction = __addDisposableResource(env_1, prepared.transaction, false);
|
|
113
|
+
transaction.commit();
|
|
114
|
+
writeFileSync(join(outDir, DEPLOY_MARKER_FILENAME), DEPLOY_MARKER, { flag: "wx" });
|
|
115
|
+
}
|
|
116
|
+
catch (e_1) {
|
|
117
|
+
env_1.error = e_1;
|
|
118
|
+
env_1.hasError = true;
|
|
22
119
|
}
|
|
23
|
-
|
|
24
|
-
|
|
120
|
+
finally {
|
|
121
|
+
__disposeResources(env_1);
|
|
25
122
|
}
|
|
26
123
|
};
|
|
124
|
+
const existingFile = (path) => statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
|
|
27
125
|
const resolveLicenseFile = (root, configured) => {
|
|
28
126
|
if (configured !== undefined) {
|
|
29
127
|
const path = resolve(root, configured);
|
|
@@ -37,20 +135,21 @@ const resolveLicenseFile = (root, configured) => {
|
|
|
37
135
|
const resolvePaths = (request) => {
|
|
38
136
|
const { root, deploy } = request;
|
|
39
137
|
const outDir = resolveOutDir(request);
|
|
138
|
+
const archDir = join(outDir, request.arch);
|
|
40
139
|
return {
|
|
41
140
|
root,
|
|
42
141
|
dist: join(root, DIST_DIR),
|
|
43
142
|
outDir,
|
|
44
|
-
metadata: join(
|
|
45
|
-
runtime: join(
|
|
46
|
-
stage: join(
|
|
47
|
-
overlay: join(
|
|
48
|
-
targets: join(
|
|
143
|
+
metadata: join(archDir, "metadata"),
|
|
144
|
+
runtime: join(archDir, "runtime"),
|
|
145
|
+
stage: join(archDir, "stage"),
|
|
146
|
+
overlay: join(archDir, "overlay"),
|
|
147
|
+
targets: join(archDir, "targets"),
|
|
49
148
|
output: join(outDir, "out"),
|
|
50
149
|
applicationIcon: resolveApplicationIcon(root, request.applicationId, request.applicationIcon),
|
|
51
150
|
licenseFile: resolveLicenseFile(root, deploy.licenseFile),
|
|
52
151
|
schemaFiles: [],
|
|
53
152
|
};
|
|
54
153
|
};
|
|
55
|
-
export {
|
|
154
|
+
export { prepareDeployOutDir, resolvePaths };
|
|
56
155
|
//# sourceMappingURL=paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../src/deploy/settings/paths.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,E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@gtkx/config\";\nimport { isPathInside } from \"@gtkx/utils\";\nimport { lstatSync, readdirSync, statSync, writeFileSync } from \"node:fs\";\nimport { join, relative, resolve, sep } from \"node:path\";\nimport type { DeployArchName, DeployConfig, DeployPaths } from \"../types.js\";\nimport { DEFAULT_DEPLOY_OUT_DIR } from \"../../internal/deploy-out-dir.js\";\nimport { resolveApplicationIcon } from \"../../internal/icon-path.js\";\nimport { prepareOutputDirectory, readRegularFile } from \"../../internal/output-directory.js\";\n\ntype PathsRequest = {\n root: string;\n deploy: DeployConfig;\n applicationIcon: Config[\"applicationIcon\"];\n applicationId: Config[\"applicationId\"];\n outDirOverride: string | undefined;\n arch: DeployArchName;\n};\n\nconst DIST_DIR = \"dist\";\nconst DEPLOY_MARKER_FILENAME = \".gtkx-deploy.json\";\nconst DEPLOY_MARKER = `${JSON.stringify({ generator: \"gtkx-deploy\", formatVersion: 1 })}\\n`;\nconst LICENSE_CANDIDATES = [\"LICENSE\", \"LICENSE.md\", \"LICENSE.txt\", \"COPYING\", \"COPYING.md\"];\n\nconst hasSymlinkComponent = (root: string, target: string): boolean => {\n let current = root;\n\n for (const segment of relative(root, target).split(sep)) {\n current = join(current, segment);\n\n if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isDeployMarker = (path: string): boolean => {\n return readRegularFile(path) === DEPLOY_MARKER;\n};\n\nconst isReusableDeployDirectory = (path: string): boolean => {\n const entry = lstatSync(path, { throwIfNoEntry: false });\n\n if (entry === undefined) {\n return true;\n }\n\n return entry.isDirectory() &&\n (readdirSync(path).length === 0 || isDeployMarker(join(path, DEPLOY_MARKER_FILENAME)));\n};\n\nconst deployOutputError = (root: string, configured: string): Error =>\n new Error(\n `Cannot use \"${configured}\" as the deploy output directory: choose an empty directory or an ` +\n `earlier GTKX deploy directory below ${root}`,\n );\n\nconst assertSafeDeployOutDir = (root: string, outDir: string, configured: string): void => {\n const dist = join(root, DIST_DIR);\n\n if (\n outDir === dist ||\n !isPathInside(root, outDir) ||\n isPathInside(dist, outDir) ||\n hasSymlinkComponent(root, outDir)\n ) {\n throw deployOutputError(root, configured);\n }\n};\n\nconst resolveOutDir = ({ root, deploy, outDirOverride }: PathsRequest): string => {\n const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_DEPLOY_OUT_DIR;\n const outDir = resolve(root, configured);\n assertSafeDeployOutDir(root, outDir, configured);\n\n if (!isReusableDeployDirectory(outDir)) {\n throw deployOutputError(root, configured);\n }\n\n return outDir;\n};\n\nconst prepareDeployOutDir = (root: string, outDir: string): void => {\n assertSafeDeployOutDir(root, outDir, outDir);\n const prepared = prepareOutputDirectory(root, outDir, isReusableDeployDirectory);\n\n if (prepared.status === \"unsafe\") {\n throw deployOutputError(root, outDir);\n }\n\n using transaction = prepared.transaction;\n transaction.commit();\n writeFileSync(join(outDir, DEPLOY_MARKER_FILENAME), DEPLOY_MARKER, { flag: \"wx\" });\n};\n\nconst existingFile = (path: string): string | null =>\n statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;\n\nconst resolveLicenseFile = (root: string, configured: string | undefined): string | null => {\n if (configured !== undefined) {\n const path = resolve(root, configured);\n\n if (existingFile(path) === null) {\n throw new Error(`Cannot read the license file \"${configured}\": no such file under ${root}`);\n }\n\n return path;\n }\n\n return LICENSE_CANDIDATES.map((name) => existingFile(join(root, name))).find((path) => path !== null) ?? null;\n};\n\nconst resolvePaths = (request: PathsRequest): DeployPaths => {\n const { root, deploy } = request;\n const outDir = resolveOutDir(request);\n const archDir = join(outDir, request.arch);\n\n return {\n root,\n dist: join(root, DIST_DIR),\n outDir,\n metadata: join(archDir, \"metadata\"),\n runtime: join(archDir, \"runtime\"),\n stage: join(archDir, \"stage\"),\n overlay: join(archDir, \"overlay\"),\n targets: join(archDir, \"targets\"),\n output: join(outDir, \"out\"),\n applicationIcon: resolveApplicationIcon(root, request.applicationId, request.applicationIcon),\n licenseFile: resolveLicenseFile(root, deploy.licenseFile),\n schemaFiles: [],\n };\n};\n\nexport { prepareDeployOutDir, resolvePaths };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/screenshots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screenshots.d.ts","sourceRoot":"","sources":["../../../src/deploy/settings/screenshots.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGlE,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACxB,CAAC;AA8DF,QAAA,MAAM,kBAAkB,GAAI,SAAS,iBAAiB,KAAG,gBAAgB,EAexE,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -1,35 +1,13 @@
|
|
|
1
|
+
import hostedGitInfo from "hosted-git-info";
|
|
1
2
|
import { gitRemoteUrl, runGit } from "../git.js";
|
|
2
3
|
const DEFAULT_BRANCH = "main";
|
|
3
|
-
const GIT_SUFFIX = ".git";
|
|
4
|
-
const PORTED_HOST = /^([^/]*):\d+(?=\/|$)/;
|
|
5
|
-
const SCHEME_SEPARATOR = "://";
|
|
6
4
|
const TRAILING_SLASH = "/";
|
|
7
|
-
const RAW_BASE_BY_HOST = {
|
|
8
|
-
"github.com": (owner, repo, branch) => `https://raw.githubusercontent.com/${owner}/${repo}/${branch}`,
|
|
9
|
-
"gitlab.com": (owner, repo, branch) => `https://gitlab.com/${owner}/${repo}/-/raw/${branch}`,
|
|
10
|
-
};
|
|
11
5
|
const readRepositoryPrefix = (root) => trimTrailingSlash(runGit(root, ["rev-parse", "--show-prefix"]) ?? "");
|
|
12
6
|
const trimTrailingSlash = (value) => value.endsWith(TRAILING_SLASH) ? trimTrailingSlash(value.slice(0, -1)) : value;
|
|
13
7
|
const trimLeadingSlash = (value) => {
|
|
14
8
|
const withoutDot = value.startsWith("./") ? value.slice(2) : value;
|
|
15
9
|
return withoutDot.startsWith(TRAILING_SLASH) ? withoutDot.slice(1) : withoutDot;
|
|
16
10
|
};
|
|
17
|
-
const afterMarker = (value, marker) => {
|
|
18
|
-
const index = value.indexOf(marker);
|
|
19
|
-
return index === -1 ? value : value.slice(index + marker.length);
|
|
20
|
-
};
|
|
21
|
-
const normalizeLocation = (trimmed) => {
|
|
22
|
-
const location = afterMarker(afterMarker(trimmed, SCHEME_SEPARATOR), "@");
|
|
23
|
-
return trimmed.includes(SCHEME_SEPARATOR) ? location.replace(PORTED_HOST, "$1") : location.replace(":", "/");
|
|
24
|
-
};
|
|
25
|
-
const parseRemote = (remote) => {
|
|
26
|
-
const trimmed = remote.endsWith(GIT_SUFFIX) ? remote.slice(0, -GIT_SUFFIX.length) : remote;
|
|
27
|
-
const [host, owner, repo, ...extra] = normalizeLocation(trimmed).split("/");
|
|
28
|
-
if (repo === undefined || extra.length > 0) {
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
return { host: host ?? "", owner: owner ?? "", repo };
|
|
32
|
-
};
|
|
33
11
|
const readDefaultBranch = (root) => {
|
|
34
12
|
const head = runGit(root, ["symbolic-ref", "--short", "refs/remotes/origin/HEAD"]);
|
|
35
13
|
if (head === null || head.length === 0) {
|
|
@@ -38,22 +16,19 @@ const readDefaultBranch = (root) => {
|
|
|
38
16
|
const separator = head.indexOf(TRAILING_SLASH);
|
|
39
17
|
return separator === -1 ? head : head.slice(separator + 1);
|
|
40
18
|
};
|
|
41
|
-
const baseForRemote = (
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
19
|
+
const baseForRemote = (root, remote) => {
|
|
20
|
+
const repository = hostedGitInfo.fromUrl(remote);
|
|
21
|
+
if (repository === undefined || (repository.type !== "github" && repository.type !== "gitlab")) {
|
|
44
22
|
return null;
|
|
45
23
|
}
|
|
46
|
-
|
|
47
|
-
return build === undefined ? null : build(parts.owner, parts.repo, branch);
|
|
24
|
+
return trimTrailingSlash(repository.file(readRepositoryPrefix(root), { committish: readDefaultBranch(root) }));
|
|
48
25
|
};
|
|
49
26
|
const resolveScreenshotBaseUrl = ({ root, deploy }) => {
|
|
50
27
|
if (deploy.screenshotBaseUrl !== undefined) {
|
|
51
28
|
return trimTrailingSlash(deploy.screenshotBaseUrl);
|
|
52
29
|
}
|
|
53
30
|
const remote = gitRemoteUrl(root);
|
|
54
|
-
|
|
55
|
-
const prefix = base === null ? "" : readRepositoryPrefix(root);
|
|
56
|
-
return base === null || prefix.length === 0 ? base : `${base}/${prefix}`;
|
|
31
|
+
return remote === null ? null : baseForRemote(root, remote);
|
|
57
32
|
};
|
|
58
33
|
const urlForScreenshot = (file, baseUrl) => {
|
|
59
34
|
if (baseUrl === null) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../src/deploy/settings/screenshots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screenshots.js","sourceRoot":"","sources":["../../../src/deploy/settings/screenshots.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOjD,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAU,EAAE,CAClD,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAE1E,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAU,EAAE,CAChD,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAEnF,MAA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CAAC,GAAG,IAAI,gBAAgB,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,OAAO,CAAC;QAC7D,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;QAC9B,SAAS,EAAE,KAAK,KAAK,YAAY;KACpC,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import hostedGitInfo from \"hosted-git-info\";\nimport type { DeployConfig, DeployScreenshot } from \"../types.js\";\nimport { gitRemoteUrl, runGit } from \"../git.js\";\n\ntype ScreenshotRequest = {\n root: string;\n deploy: DeployConfig;\n};\n\nconst DEFAULT_BRANCH = \"main\";\nconst TRAILING_SLASH = \"/\";\n\nconst readRepositoryPrefix = (root: string): string =>\n trimTrailingSlash(runGit(root, [\"rev-parse\", \"--show-prefix\"]) ?? \"\");\n\nconst trimTrailingSlash = (value: string): string =>\n value.endsWith(TRAILING_SLASH) ? trimTrailingSlash(value.slice(0, -1)) : value;\n\nconst trimLeadingSlash = (value: string): string => {\n const withoutDot = value.startsWith(\"./\") ? value.slice(2) : value;\n\n return withoutDot.startsWith(TRAILING_SLASH) ? withoutDot.slice(1) : withoutDot;\n};\n\nconst readDefaultBranch = (root: string): string => {\n const head = runGit(root, [\"symbolic-ref\", \"--short\", \"refs/remotes/origin/HEAD\"]);\n\n if (head === null || head.length === 0) {\n return DEFAULT_BRANCH;\n }\n\n const separator = head.indexOf(TRAILING_SLASH);\n\n return separator === -1 ? head : head.slice(separator + 1);\n};\n\nconst baseForRemote = (root: string, remote: string): string | null => {\n const repository = hostedGitInfo.fromUrl(remote);\n\n if (repository === undefined || (repository.type !== \"github\" && repository.type !== \"gitlab\")) {\n return null;\n }\n\n return trimTrailingSlash(\n repository.file(readRepositoryPrefix(root), { committish: readDefaultBranch(root) }),\n );\n};\n\nconst resolveScreenshotBaseUrl = ({ root, deploy }: ScreenshotRequest): string | null => {\n if (deploy.screenshotBaseUrl !== undefined) {\n return trimTrailingSlash(deploy.screenshotBaseUrl);\n }\n\n const remote = gitRemoteUrl(root);\n\n return remote === null ? null : baseForRemote(root, remote);\n};\n\nconst urlForScreenshot = (file: string, baseUrl: string | null): string => {\n if (baseUrl === null) {\n throw new Error(\n `Cannot turn the screenshot \"${file}\" into a URL: a software center fetches screenshots over the ` +\n \"network. Set `deploy.screenshotBaseUrl`, or give the screenshot an absolute `url`.\",\n );\n }\n\n return `${baseUrl}/${trimLeadingSlash(file)}`;\n};\n\nconst resolveScreenshots = (request: ScreenshotRequest): DeployScreenshot[] => {\n const configured = request.deploy.screenshots ?? [];\n\n if (configured.length === 0) {\n return [];\n }\n\n const baseUrl = resolveScreenshotBaseUrl(request);\n const defaultIndex = configured.findIndex((entry) => entry.isDefault === true);\n\n return configured.map((entry, index) => ({\n url: entry.url ?? urlForScreenshot(entry.file ?? \"\", baseUrl),\n caption: entry.caption ?? null,\n isDefault: index === defaultIndex,\n }));\n};\n\nexport { resolveScreenshots };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appimage.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/appimage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKR,YAAY,EAEf,MAAM,aAAa,CAAC;AAmBrB,QAAA,MAAM,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"appimage.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/appimage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAKR,YAAY,EAEf,MAAM,aAAa,CAAC;AAmBrB,QAAA,MAAM,cAAc,EAAE,YAOrB,CAAC;AA0HF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appimage.js","sourceRoot":"","sources":["../../../src/deploy/targets/appimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AA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AAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { existsSync, mkdirSync, rmSync, statSync } from \"node:fs\";\nimport { basename, join } from \"node:path\";\nimport type {\n DeployArtifact,\n DeployManifest,\n DeployPayload,\n DeploySettings,\n DeployTarget,\n StagedFile,\n} from \"../types.js\";\nimport { runCliTool } from \"../../internal/run-cli-tool.js\";\nimport { copyInto, copyTree, EXECUTABLE_MODE, writeInto } from \"../payload/copy-tree.js\";\nimport { type ApplicationIconVariant, classifyApplicationIcon } from \"../payload/icons.js\";\nimport { FILE_TOOL } from \"../tools.js\";\nimport { resolveAppimageTooling } from \"../vendored/appimagetool.js\";\n\ntype RankedIcon = {\n file: StagedFile;\n variant: ApplicationIconVariant;\n};\n\nconst PREFIX = \"/usr\";\nconst TARGET_DIR = \"appimage\";\nconst APPRUN_FILENAME = \"AppRun\";\nconst APPDIR_NAME = \"AppDir\";\nconst USR_DIR = \"usr\";\nconst EXTRACT_AND_RUN = \"APPIMAGE_EXTRACT_AND_RUN\";\n\nconst appimageTarget: DeployTarget = {\n name: \"appimage\",\n prefix: PREFIX,\n tools: [FILE_TOOL],\n render: (payload) => renderManifests(payload),\n pack: (payload) => packAppImage(payload),\n};\n\nconst appimageDir = (settings: DeploySettings): string => join(settings.paths.targets, TARGET_DIR);\nconst appDirFor = (settings: DeploySettings): string => join(appimageDir(settings), APPDIR_NAME);\nconst appRunPathFor = (settings: DeploySettings): string => join(appimageDir(settings), APPRUN_FILENAME);\n\nconst renderAppRun = (settings: DeploySettings): string =>\n [\n \"#!/bin/sh\",\n \"set -e\",\n 'here=$(dirname \"$(readlink -f \"$0\")\")',\n 'XDG_DATA_DIRS=\"$here/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}\"',\n \"export XDG_DATA_DIRS\",\n `exec \"$here/usr/bin/${settings.binaryName}\" \"$@\"`,\n \"\",\n ].join(\"\\n\");\n\nconst renderManifests = (payload: DeployPayload): DeployManifest[] => [\n { path: appRunPathFor(payload.settings), contents: renderAppRun(payload.settings) },\n];\n\nconst rankedIcon = (applicationId: string, file: StagedFile): RankedIcon | null => {\n const variant = classifyApplicationIcon(applicationId, file.rel);\n\n return variant === null ? null : { file, variant };\n};\n\nconst isLargerIcon = (candidate: RankedIcon, best: RankedIcon): boolean =>\n candidate.variant.scalable === best.variant.scalable\n ? candidate.variant.effectivePixels > best.variant.effectivePixels\n : candidate.variant.scalable;\n\nconst largerIcon = (best: RankedIcon | undefined, candidate: RankedIcon): RankedIcon =>\n best === undefined || isLargerIcon(candidate, best) ? candidate : best;\n\nconst largestIcon = (applicationId: string, files: StagedFile[]): StagedFile | undefined => {\n let best: RankedIcon | undefined;\n\n for (const file of files) {\n const candidate = rankedIcon(applicationId, file);\n\n if (candidate === null) {\n continue;\n }\n\n best = largerIcon(best, candidate);\n }\n\n return best?.file;\n};\n\nconst rootIconFor = (payload: DeployPayload): { rel: string; abs: string } => {\n const { applicationId } = payload.settings;\n const icon = largestIcon(applicationId, payload.stage);\n\n if (icon === undefined) {\n throw new Error(`Cannot build an AppImage without a ${applicationId} icon in the staged icon tree`);\n }\n\n return { rel: basename(icon.rel), abs: icon.abs };\n};\n\nconst buildAppDir = (payload: DeployPayload): string => {\n const settings = payload.settings;\n const appDir = appDirFor(settings);\n rmSync(appDir, { recursive: true, force: true, maxRetries: 5 });\n copyTree(appDir, USR_DIR, settings.paths.stage);\n copyTree(appDir, USR_DIR, join(settings.paths.overlay, TARGET_DIR));\n writeInto(appDir, APPRUN_FILENAME, renderAppRun(settings), EXECUTABLE_MODE);\n\n copyInto(appDir, `${settings.applicationId}.desktop`, join(appDir, USR_DIR, \"share/applications\",\n `${settings.applicationId}.desktop`));\n\n const icon = rootIconFor(payload);\n copyInto(appDir, icon.rel, icon.abs);\n\n return appDir;\n};\n\nconst artifactNameFor = (settings: DeploySettings): string =>\n settings.deploy.appimage?.fileName ??\n `${settings.name.replaceAll(\" \", \"_\")}-${settings.versions.packageVersion}-${settings.arch.appimage}.AppImage`;\n\nconst toolArgsFor = (settings: DeploySettings, runtime: string, appDir: string, target: string): string[] => {\n const appimage = settings.deploy.appimage ?? {};\n const signing = settings.deploy.signing?.appimage;\n\n return [\n \"--no-appstream\",\n \"--runtime-file\",\n appimage.runtimeFile ?? runtime,\n ...(appimage.compression === undefined ? [] : [\"--comp\", appimage.compression]),\n ...(appimage.updateInformation === undefined ? [] : [\"-u\", appimage.updateInformation]),\n ...(signing === undefined ? [] : [\"-s\", \"--sign-key\", signing.gpgKeyId]),\n appDir,\n target,\n ];\n};\n\nconst packAppImage = async (payload: DeployPayload): Promise<DeployArtifact[]> => {\n const settings = payload.settings;\n const tooling = await resolveAppimageTooling(settings.arch.appimage);\n const appDir = buildAppDir(payload);\n const output = settings.paths.output;\n mkdirSync(output, { recursive: true });\n const target = join(output, artifactNameFor(settings));\n\n runCliTool({\n tool: tooling.tool,\n args: toolArgsFor(settings, tooling.runtime, appDir, target),\n target: \"the AppImage\",\n shouldStream: true,\n options: { env: { ...process.env, ARCH: settings.arch.appimage, [EXTRACT_AND_RUN]: \"1\" } },\n });\n\n if (!existsSync(target)) {\n throw new Error(`appimagetool reported success but wrote no AppImage at ${target}`);\n }\n\n return [{ path: target, size: statSync(target).size }];\n};\n\nexport { appimageTarget };\n"]}
|
|
1
|
+
{"version":3,"file":"appimage.js","sourceRoot":"","sources":["../../../src/deploy/targets/appimage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAS3C,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE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O,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { existsSync, mkdirSync, rmSync, statSync } from \"node:fs\";\nimport { basename, join } from \"node:path\";\nimport type {\n DeployArtifact,\n DeployManifest,\n DeployPayload,\n DeploySettings,\n DeployTarget,\n StagedFile,\n} from \"../types.js\";\nimport { runCliTool } from \"../../internal/run-cli-tool.js\";\nimport { copyInto, copyTree, EXECUTABLE_MODE, writeInto } from \"../payload/copy-tree.js\";\nimport { type ApplicationIconVariant, classifyApplicationIcon } from \"../payload/icons.js\";\nimport { FILE_TOOL } from \"../tools.js\";\nimport { resolveAppimageTooling } from \"../vendored/appimagetool.js\";\n\ntype RankedIcon = {\n file: StagedFile;\n variant: ApplicationIconVariant;\n};\n\nconst PREFIX = \"/usr\";\nconst TARGET_DIR = \"appimage\";\nconst APPRUN_FILENAME = \"AppRun\";\nconst APPDIR_NAME = \"AppDir\";\nconst USR_DIR = \"usr\";\nconst EXTRACT_AND_RUN = \"APPIMAGE_EXTRACT_AND_RUN\";\n\nconst appimageTarget: DeployTarget = {\n name: \"appimage\",\n prefix: PREFIX,\n isHostOnly: true,\n tools: [FILE_TOOL],\n render: (payload) => renderManifests(payload),\n pack: (payload) => packAppImage(payload),\n};\n\nconst appimageDir = (settings: DeploySettings): string => join(settings.paths.targets, TARGET_DIR);\nconst appDirFor = (settings: DeploySettings): string => join(appimageDir(settings), APPDIR_NAME);\nconst appRunPathFor = (settings: DeploySettings): string => join(appimageDir(settings), APPRUN_FILENAME);\n\nconst renderAppRun = (settings: DeploySettings): string =>\n [\n \"#!/bin/sh\",\n \"set -e\",\n 'here=$(dirname \"$(readlink -f \"$0\")\")',\n 'XDG_DATA_DIRS=\"$here/usr/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}\"',\n \"export XDG_DATA_DIRS\",\n `exec \"$here/usr/bin/${settings.binaryName}\" \"$@\"`,\n \"\",\n ].join(\"\\n\");\n\nconst renderManifests = (payload: DeployPayload): DeployManifest[] => [\n { path: appRunPathFor(payload.settings), contents: renderAppRun(payload.settings) },\n];\n\nconst rankedIcon = (applicationId: string, file: StagedFile): RankedIcon | null => {\n const variant = classifyApplicationIcon(applicationId, file.rel);\n\n return variant === null ? null : { file, variant };\n};\n\nconst isLargerIcon = (candidate: RankedIcon, best: RankedIcon): boolean =>\n candidate.variant.scalable === best.variant.scalable\n ? candidate.variant.effectivePixels > best.variant.effectivePixels\n : candidate.variant.scalable;\n\nconst largerIcon = (best: RankedIcon | undefined, candidate: RankedIcon): RankedIcon =>\n best === undefined || isLargerIcon(candidate, best) ? candidate : best;\n\nconst largestIcon = (applicationId: string, files: StagedFile[]): StagedFile | undefined => {\n let best: RankedIcon | undefined;\n\n for (const file of files) {\n const candidate = rankedIcon(applicationId, file);\n\n if (candidate === null) {\n continue;\n }\n\n best = largerIcon(best, candidate);\n }\n\n return best?.file;\n};\n\nconst rootIconFor = (payload: DeployPayload): { rel: string; abs: string } => {\n const { applicationId } = payload.settings;\n const icon = largestIcon(applicationId, payload.stage);\n\n if (icon === undefined) {\n throw new Error(`Cannot build an AppImage without a ${applicationId} icon in the staged icon tree`);\n }\n\n return { rel: basename(icon.rel), abs: icon.abs };\n};\n\nconst buildAppDir = (payload: DeployPayload): string => {\n const settings = payload.settings;\n const appDir = appDirFor(settings);\n rmSync(appDir, { recursive: true, force: true, maxRetries: 5 });\n copyTree(appDir, USR_DIR, settings.paths.stage);\n copyTree(appDir, USR_DIR, join(settings.paths.overlay, TARGET_DIR));\n writeInto(appDir, APPRUN_FILENAME, renderAppRun(settings), EXECUTABLE_MODE);\n\n copyInto(appDir, `${settings.applicationId}.desktop`, join(appDir, USR_DIR, \"share/applications\",\n `${settings.applicationId}.desktop`));\n\n const icon = rootIconFor(payload);\n copyInto(appDir, icon.rel, icon.abs);\n\n return appDir;\n};\n\nconst artifactNameFor = (settings: DeploySettings): string =>\n settings.deploy.appimage?.fileName ??\n `${settings.name.replaceAll(\" \", \"_\")}-${settings.versions.packageVersion}-${settings.arch.appimage}.AppImage`;\n\nconst toolArgsFor = (settings: DeploySettings, runtime: string, appDir: string, target: string): string[] => {\n const appimage = settings.deploy.appimage ?? {};\n const signing = settings.deploy.signing?.appimage;\n\n return [\n \"--no-appstream\",\n \"--runtime-file\",\n appimage.runtimeFile ?? runtime,\n ...(appimage.compression === undefined ? [] : [\"--comp\", appimage.compression]),\n ...(appimage.updateInformation === undefined ? [] : [\"-u\", appimage.updateInformation]),\n ...(signing === undefined ? [] : [\"-s\", \"--sign-key\", signing.gpgKeyId]),\n appDir,\n target,\n ];\n};\n\nconst packAppImage = async (payload: DeployPayload): Promise<DeployArtifact[]> => {\n const settings = payload.settings;\n const tooling = await resolveAppimageTooling(settings.arch.appimage);\n const appDir = buildAppDir(payload);\n const output = settings.paths.output;\n mkdirSync(output, { recursive: true });\n const target = join(output, artifactNameFor(settings));\n\n runCliTool({\n tool: tooling.tool,\n args: toolArgsFor(settings, tooling.runtime, appDir, target),\n target: \"the AppImage\",\n shouldStream: true,\n options: { env: { ...process.env, ARCH: settings.arch.appimage, [EXTRACT_AND_RUN]: \"1\" } },\n });\n\n if (!existsSync(target)) {\n throw new Error(`appimagetool reported success but wrote no AppImage at ${target}`);\n }\n\n return [{ path: target, size: statSync(target).size }];\n};\n\nexport { appimageTarget };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readPackageManifest } from "../settings/package-manifest.js";
|
|
2
|
-
const PNPM_VERSION = "11.
|
|
2
|
+
const PNPM_VERSION = "11.26.0";
|
|
3
3
|
const PNPM_MAJOR = 11;
|
|
4
|
-
const PNPM_MINOR =
|
|
5
|
-
const PNPM_SHA512 = "
|
|
6
|
-
"
|
|
4
|
+
const PNPM_MINOR = 26;
|
|
5
|
+
const PNPM_SHA512 = "fc0e2bf890b9f983611f1ab68c0637bce914390653699f83c1a78b005ed25f2c81e77920c8" +
|
|
6
|
+
"fd8eee2ecf0b58b28cdcb00a84d97f69bcf7c56b2f344710238664";
|
|
7
7
|
const PNPM_DIR = "flatpak-pnpm";
|
|
8
8
|
const PNPM_COMMAND = "pnpm";
|
|
9
9
|
const PNPM_PREFIX = "pnpm@";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpak-pnpm.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-pnpm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"flatpak-pnpm.js","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-pnpm.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE,MAAM,YAAY,GAAG,SAAS,CAAC;AAC/B,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,WAAW,GAAG,4EAA4E;IAC5F,wDAAwD,CAAC;AAE7D,MAAM,QAAQ,GAAG,cAAc,CAAC;AAChC,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,WAAW,GAAG,OAAO,CAAC;AAC5B,MAAM,gBAAgB,GAAG,yCAAyC,CAAC;AACnE,MAAM,YAAY,GAAG,0CAA0C,CAAC;AAChE,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,SAAS,GAAG,KAAK,CAAC;AACxB,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAE/B,MAAM,WAAW,GAAY;IACzB,OAAO,EAAE,YAAY;IACrB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,UAAU;IACjB,MAAM,E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} from \"./flatpak-prebuilt.js\";\nimport { readPackageManifest } from \"../settings/package-manifest.js\";\n\ntype PnpmPin = {\n version: string;\n major: number;\n minor: number;\n sha512: string;\n};\n\nconst PNPM_VERSION = \"11.26.0\";\nconst PNPM_MAJOR = 11;\nconst PNPM_MINOR = 26;\n\nconst PNPM_SHA512 = \"fc0e2bf890b9f983611f1ab68c0637bce914390653699f83c1a78b005ed25f2c81e77920c8\" +\n \"fd8eee2ecf0b58b28cdcb00a84d97f69bcf7c56b2f344710238664\";\n\nconst PNPM_DIR = \"flatpak-pnpm\";\nconst PNPM_COMMAND = \"pnpm\";\nconst PNPM_PREFIX = \"pnpm@\";\nconst PNPM_TARBALL_URL = \"https://registry.npmjs.org/pnpm/-/pnpm-\";\nconst PNPM_INSTALL = \"pnpm install --offline --frozen-lockfile\";\nconst TRUST_LOCKFILE = \"--trust-lockfile\";\nconst STORE_V10 = \"v10\";\nconst STORE_V11 = \"v11\";\nconst STORE_V10_MAJOR = 10;\nconst STORE_V11_MAJOR = 11;\nconst TRUST_LOCKFILE_MINOR = 3;\n\nconst DEFAULT_PIN: PnpmPin = {\n version: PNPM_VERSION,\n major: PNPM_MAJOR,\n minor: PNPM_MINOR,\n sha512: PNPM_SHA512,\n};\n\nconst PNPM_PIN_FIELD =\n /^pnpm@(?<version>(?<major>\\d+)\\.(?<minor>\\d+)\\.\\d+)\\+sha512\\.(?<sha512>[\\da-f]{128})$/;\n\nconst pinFromGroups = (groups: Record<string, string | undefined>): PnpmPin | null => {\n const { major, minor, sha512, version } = groups;\n\n if (major === undefined || minor === undefined || sha512 === undefined || version === undefined) {\n return null;\n }\n\n return { version, major: Number(major), minor: Number(minor), sha512 };\n};\n\nconst isSupportedPin = (pin: PnpmPin): boolean =>\n pin.major === STORE_V10_MAJOR || (pin.major === STORE_V11_MAJOR && pin.minor >= TRUST_LOCKFILE_MINOR);\n\nconst resolvePnpmPin = (settings: DeploySettings): PnpmPin => {\n const field = readPackageManifest(settings.paths.root).packageManager;\n\n if (field === null) {\n return DEFAULT_PIN;\n }\n\n if (!field.startsWith(PNPM_PREFIX)) {\n throw new Error(\n `Cannot vendor pnpm for the Flathub sandbox: \"packageManager\" is \"${field}\" but the offline install ` +\n \"resolves from a pnpm lockfile. Run `corepack use pnpm@<version>` to pin it to pnpm, or point \" +\n \"`deploy.flatpak.packageManager` at the manager whose lockfile the build should install from.\",\n );\n }\n\n const pin = pinFromGroups(PNPM_PIN_FIELD.exec(field)?.groups ?? {});\n\n if (pin === null) {\n throw new Error(\n `Cannot vendor pnpm for the Flathub sandbox: \"packageManager\" is \"${field}\", which carries no sha512 ` +\n \"integrity digest, and every source in a Flathub build has to be hash-pinned. Run \" +\n \"`corepack use pnpm@<version>` to rewrite it with its digest.\",\n );\n }\n\n if (!isSupportedPin(pin)) {\n throw new Error(\n `Cannot vendor pnpm ${pin.version} for the Flathub sandbox: the offline install runs on pnpm 10, or on ` +\n \"pnpm 11 from 11.3.0 on, where `--trust-lockfile` exists. Earlier pnpm 11 releases reach the registry \" +\n 'during the supply-chain check and the sandbox has no network. Pin \"packageManager\" to one of those.',\n );\n }\n\n return pin;\n};\n\nconst pnpmPathFor = (moduleDir: string): string => `${moduleDir}/${PNPM_DIR}`;\n\nconst pnpmSources = (pin: PnpmPin, moduleDir: string): FlatpakModule[] => [\n { type: \"archive\", url: `${PNPM_TARBALL_URL}${pin.version}.tgz`, sha512: pin.sha512, dest: PNPM_DIR },\n {\n type: \"script\",\n dest: PNPM_DIR,\n \"dest-filename\": PNPM_COMMAND,\n commands: [`exec node ${pnpmPathFor(moduleDir)}/bin/pnpm.cjs \"$@\"`],\n },\n];\n\nconst pnpmInstallCommand = (pin: PnpmPin): string =>\n pin.major === STORE_V11_MAJOR ? `${PNPM_INSTALL} ${TRUST_LOCKFILE}` : PNPM_INSTALL;\n\nconst pnpmStoreVersionFor = (pin: PnpmPin): string =>\n pin.major === STORE_V10_MAJOR ? STORE_V10 : STORE_V11;\n\nexport {\n pnpmInstallCommand,\n pnpmPathFor,\n type PnpmPin,\n pnpmSources,\n pnpmStoreVersionFor,\n resolvePnpmPin,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpak-source.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-source.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flatpak-source.d.ts","sourceRoot":"","sources":["../../../src/deploy/targets/flatpak-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAajE,OAAO,EAAe,KAAK,aAAa,EAA2C,MAAM,uBAAuB,CAAC;AAmPjH,QAAA,MAAM,mBAAmB,GAAI,SAAS,aAAa,KAAG,aAwCrD,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { isPathInside, toPosixPath } from "@gtkx/utils";
|
|
1
2
|
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
2
3
|
import { posix, relative, resolve } from "node:path";
|
|
3
4
|
import { LOCALE_DIRNAME } from "../../i18n/catalogs.js";
|
|
5
|
+
import { FONTS_DIR } from "../../internal/font-path.js";
|
|
4
6
|
import { listFilesRecursive } from "../../internal/list-files.js";
|
|
5
7
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
6
8
|
import { renderDbusService } from "../freedesktop/dbus-service.js";
|
|
@@ -10,7 +12,6 @@ import { executableModeFor } from "../payload/copy-tree.js";
|
|
|
10
12
|
import { iconPathFor } from "../payload/icons.js";
|
|
11
13
|
import { renderLauncher } from "../payload/launcher.js";
|
|
12
14
|
import { licenseDestination, nodeLicenseDestination, NOTICES_FILENAME, noticesDestination } from "../payload/stage.js";
|
|
13
|
-
import { isInside } from "../settings/paths.js";
|
|
14
15
|
import { pnpmPathFor, pnpmSources } from "./flatpak-pnpm.js";
|
|
15
16
|
import { DESTINATION, postInstallCommands, validationCommands } from "./flatpak-prebuilt.js";
|
|
16
17
|
import { detectPackageManager, GENERATED_SOURCES, installCommandFor, nodeExtensionPathFor, pnpmPinFor, resolveGitSource, } from "./flatpak-sources.js";
|
|
@@ -27,7 +28,7 @@ const inlineSource = (fileName, contents) => ({
|
|
|
27
28
|
"dest-filename": fileName,
|
|
28
29
|
contents,
|
|
29
30
|
});
|
|
30
|
-
const projectRelative = (settings, path) => relative(settings.paths.root, path)
|
|
31
|
+
const projectRelative = (settings, path) => toPosixPath(relative(settings.paths.root, path));
|
|
31
32
|
const shellArgument = (value) => PLAIN_ARGUMENT.test(value) ? value : `'${value.split("'").join(QUOTE_ESCAPE)}'`;
|
|
32
33
|
const pathArgument = (value) => shellArgument(value.startsWith("-") ? `./${value}` : value);
|
|
33
34
|
const installCommand = (source, destination, mode) => `install -D${mode} ${pathArgument(source)} ${destination}`;
|
|
@@ -42,6 +43,7 @@ const runtimeInstallCommands = (settings, nodeExtensionPath) => {
|
|
|
42
43
|
"test ! -f dist/gschemas.compiled || " +
|
|
43
44
|
installCommand("dist/gschemas.compiled", `${lib}/gschemas.compiled`, "m644"),
|
|
44
45
|
`test ! -d dist/assets || cp -a dist/assets ${lib}/assets`,
|
|
46
|
+
`test ! -d dist/${FONTS_DIR} || cp -a dist/${FONTS_DIR} ${lib}/${FONTS_DIR}`,
|
|
45
47
|
`test ! -d dist/${LOCALE_DIRNAME} || { mkdir -p ${locale} && cp -a dist/${LOCALE_DIRNAME}/. ${locale}/; }`,
|
|
46
48
|
installCommand(LAUNCHER_FILENAME, `${DESTINATION}/bin/${settings.binaryName}`, "m755"),
|
|
47
49
|
];
|
|
@@ -85,7 +87,7 @@ const schemaInstallCommands = (settings) => settings.paths.schemaFiles.map((file
|
|
|
85
87
|
assertInsideProject(settings, { destination, source, resolved: file });
|
|
86
88
|
return installCommand(source, destination, "m644");
|
|
87
89
|
});
|
|
88
|
-
const iconInstallCommand = (settings, source, rel) => installCommand(projectRelative(settings, source), `${DESTINATION}/share/icons/${shellArgument(rel
|
|
90
|
+
const iconInstallCommand = (settings, source, rel) => installCommand(projectRelative(settings, source), `${DESTINATION}/share/icons/${shellArgument(toPosixPath(rel))}`, "m644");
|
|
89
91
|
const iconInstallCommands = (settings) => {
|
|
90
92
|
const source = settings.paths.applicationIcon;
|
|
91
93
|
if (source.kind === "file") {
|
|
@@ -99,7 +101,7 @@ const iconInstallCommands = (settings) => {
|
|
|
99
101
|
const assertInsideProject = (settings, installed) => {
|
|
100
102
|
const { resolved } = installed;
|
|
101
103
|
const target = existsSync(resolved) ? realpathSync(resolved) : resolved;
|
|
102
|
-
if (
|
|
104
|
+
if (isPathInside(settings.paths.root, target)) {
|
|
103
105
|
return;
|
|
104
106
|
}
|
|
105
107
|
throw new Error(`Cannot install "${installed.destination}" from "${installed.source}": a source-mode manifest builds from ` +
|
|
@@ -143,6 +145,15 @@ const offlineEnvFor = (manager, settings) => {
|
|
|
143
145
|
const appendPathFor = (settings, pin, nodeExtensionPath) => pin === null
|
|
144
146
|
? `${nodeExtensionPath}/bin`
|
|
145
147
|
: `${pnpmPathFor(moduleDirFor(settings))}:${nodeExtensionPath}/bin`;
|
|
148
|
+
const sourceBuildCommand = (settings) => {
|
|
149
|
+
const configFile = projectRelative(settings, settings.configFile);
|
|
150
|
+
assertInsideProject(settings, {
|
|
151
|
+
destination: "the Flatpak build configuration",
|
|
152
|
+
source: configFile,
|
|
153
|
+
resolved: settings.configFile,
|
|
154
|
+
});
|
|
155
|
+
return `npx gtkx build --config ${pathArgument(configFile)}`;
|
|
156
|
+
};
|
|
146
157
|
const flatpakSourceModule = (payload) => {
|
|
147
158
|
const settings = payload.settings;
|
|
148
159
|
const manager = detectPackageManager(settings);
|
|
@@ -169,14 +180,14 @@ const flatpakSourceModule = (payload) => {
|
|
|
169
180
|
],
|
|
170
181
|
"build-commands": [
|
|
171
182
|
installCommandFor(settings, manager),
|
|
172
|
-
|
|
183
|
+
sourceBuildCommand(settings),
|
|
173
184
|
...runtimeInstallCommands(settings, nodeExtensionPath),
|
|
185
|
+
...extraFileInstallCommands(settings),
|
|
174
186
|
...metadataInstallCommands(settings),
|
|
175
187
|
...schemaInstallCommands(settings),
|
|
176
188
|
...iconInstallCommands(settings),
|
|
177
189
|
...licenseInstallCommands(settings),
|
|
178
190
|
...noticesInstallCommands(settings),
|
|
179
|
-
...extraFileInstallCommands(settings),
|
|
180
191
|
...(settings.deploy.flatpak?.buildCommands ?? []),
|
|
181
192
|
...validationCommands(settings),
|
|
182
193
|
],
|