@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,4 +1,4 @@
|
|
|
1
|
-
import { sortStringsBy } from "@gtkx/utils";
|
|
1
|
+
import { sortStringsBy, warn } from "@gtkx/utils";
|
|
2
2
|
import { existsSync, rmSync } from "node:fs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { LOCALE_DIRNAME } from "../../i18n/catalogs.js";
|
|
@@ -7,13 +7,15 @@ import { listFilesRecursive } from "../../internal/list-files.js";
|
|
|
7
7
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
8
8
|
import { renderCopyright } from "../freedesktop/copyright.js";
|
|
9
9
|
import { renderDbusService } from "../freedesktop/dbus-service.js";
|
|
10
|
+
import { BINDING_FILENAME } from "../native-addon.js";
|
|
11
|
+
import { readOptionalElfInfo } from "../node-runtime/elf.js";
|
|
10
12
|
import { renderNotices } from "../notices/render.js";
|
|
13
|
+
import { elfMachineFor } from "../settings/arch.js";
|
|
11
14
|
import { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from "./copy-tree.js";
|
|
12
15
|
import { stageIcons } from "./icons.js";
|
|
13
16
|
import { NODE_FILENAME, renderLauncher } from "./launcher.js";
|
|
14
17
|
import { stageSchemas } from "./schemas.js";
|
|
15
18
|
const DIST_ICONS_DIR = "icons";
|
|
16
|
-
const LEGACY_PACKAGES_MANIFEST_FILENAME = "gtkx-packages.json";
|
|
17
19
|
const NOTICES_FILENAME = "THIRD-PARTY-NOTICES";
|
|
18
20
|
const NODE_LICENSE_FILENAME = "LICENSE";
|
|
19
21
|
const SHARE_APPLICATIONS = "share/applications";
|
|
@@ -34,7 +36,6 @@ const licenseDirFor = (settings) => `${SHARE_LICENSES}/${settings.binaryName}`;
|
|
|
34
36
|
const licenseDestination = (settings) => `${licenseDirFor(settings)}/LICENSE`;
|
|
35
37
|
const noticesDestination = (settings) => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;
|
|
36
38
|
const isIconAsset = (rel) => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);
|
|
37
|
-
const isBuildMetadata = (rel) => rel === BUILD_MANIFEST_FILENAME || rel === LEGACY_PACKAGES_MANIFEST_FILENAME;
|
|
38
39
|
const isLocaleAsset = (rel) => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);
|
|
39
40
|
const nodeLicenseDestination = (settings) => `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;
|
|
40
41
|
const stageRuntimeFiles = (settings, root) => {
|
|
@@ -43,9 +44,23 @@ const stageRuntimeFiles = (settings, root) => {
|
|
|
43
44
|
throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \`gtkx build\` first.`);
|
|
44
45
|
}
|
|
45
46
|
return listFilesRecursive(dist)
|
|
46
|
-
.filter((file) => !isIconAsset(file.rel) &&
|
|
47
|
+
.filter((file) => !isIconAsset(file.rel) && file.rel !== BUILD_MANIFEST_FILENAME && !isLocaleAsset(file.rel))
|
|
47
48
|
.map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));
|
|
48
49
|
};
|
|
50
|
+
const stageAddon = (settings, root, addon) => addon === null ? [] : [copyInto(root, join(libDirFor(settings), BINDING_FILENAME), addon)];
|
|
51
|
+
const architectureMismatch = (settings, file) => new Error(`Cannot deploy ${file.rel} for ${settings.arch.node}: it was built for another architecture. ` +
|
|
52
|
+
"Run `gtkx build` again, or drop --skip-build.");
|
|
53
|
+
const assertStagedArchitecture = (settings, staged) => {
|
|
54
|
+
const expected = elfMachineFor(settings.arch.node);
|
|
55
|
+
const lib = libDirFor(settings);
|
|
56
|
+
const checked = new Set([join(lib, BINDING_FILENAME), join(lib, NODE_FILENAME)]);
|
|
57
|
+
const binaries = staged.filter((entry) => checked.has(entry.rel));
|
|
58
|
+
for (const file of binaries) {
|
|
59
|
+
if (readOptionalElfInfo(file.abs)?.machine !== expected) {
|
|
60
|
+
throw architectureMismatch(settings, file);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
49
64
|
const stageCatalogs = (settings, root) => listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))
|
|
50
65
|
.map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));
|
|
51
66
|
const stageNodeBinary = (settings, root, node) => node === null ? [] : [copyInto(root, join(libDirFor(settings), NODE_FILENAME), node.path, EXECUTABLE_MODE)];
|
|
@@ -56,8 +71,29 @@ const stageMetadata = (settings, root, metadata) => [
|
|
|
56
71
|
? []
|
|
57
72
|
: [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),
|
|
58
73
|
];
|
|
59
|
-
const
|
|
74
|
+
const generatedMetadataKind = (settings, metadata, destination) => {
|
|
75
|
+
if (destination === join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`)) {
|
|
76
|
+
return "desktop entry";
|
|
77
|
+
}
|
|
78
|
+
if (destination === join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`)) {
|
|
79
|
+
return "metainfo";
|
|
80
|
+
}
|
|
81
|
+
if (metadata.mimePackage !== null &&
|
|
82
|
+
destination === join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`)) {
|
|
83
|
+
return "MIME package";
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
};
|
|
87
|
+
const warnMetadataCollision = (settings, metadata, file) => {
|
|
88
|
+
const kind = generatedMetadataKind(settings, metadata, file.destination);
|
|
89
|
+
if (kind !== null) {
|
|
90
|
+
warn(`extraFiles source "${file.source}" targeting "${file.destination}" is overridden by the ` +
|
|
91
|
+
`GTKX-generated ${kind}`);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
const stageExtraFiles = (settings, root, metadata) => settings.extraFiles.map((file) => {
|
|
60
95
|
const source = resolve(settings.paths.root, file.source);
|
|
96
|
+
warnMetadataCollision(settings, metadata, file);
|
|
61
97
|
return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));
|
|
62
98
|
});
|
|
63
99
|
const byRelativePath = (files) => {
|
|
@@ -67,19 +103,22 @@ const byRelativePath = (files) => {
|
|
|
67
103
|
}
|
|
68
104
|
return sortStringsBy(latest.values(), (file) => file.rel);
|
|
69
105
|
};
|
|
70
|
-
const stagePayload = ({ settings, node, metadata }) => {
|
|
106
|
+
const stagePayload = ({ settings, node, addon, metadata }) => {
|
|
71
107
|
const root = settings.paths.stage;
|
|
72
108
|
rmSync(root, { recursive: true, force: true, maxRetries: 5 });
|
|
73
|
-
|
|
109
|
+
const staged = byRelativePath([
|
|
74
110
|
writeInto(root, join("bin", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),
|
|
75
111
|
...stageNodeBinary(settings, root, node),
|
|
76
112
|
...stageRuntimeFiles(settings, root),
|
|
113
|
+
...stageAddon(settings, root, addon),
|
|
77
114
|
...stageCatalogs(settings, root),
|
|
115
|
+
...stageExtraFiles(settings, root, metadata),
|
|
78
116
|
...stageMetadata(settings, root, metadata),
|
|
79
117
|
...stageIcons(settings, root),
|
|
80
118
|
...stageSchemas(settings, root),
|
|
81
|
-
...stageExtraFiles(settings, root),
|
|
82
119
|
]);
|
|
120
|
+
assertStagedArchitecture(settings, staged);
|
|
121
|
+
return staged;
|
|
83
122
|
};
|
|
84
123
|
const withoutDbusActivation = (desktopEntry) => desktopEntry
|
|
85
124
|
.split("\n")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.js","sourceRoot":"","sources":["../../../src/deploy/payload/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AA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C5F,SAAS,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,QAAwB,EACxB,OAAwB,EACxB,QAAwB,EACc,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC/D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IACrD,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC7D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;CACxD,CAAC,CAAC;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAElB,aAAa,EACb,YAAY,GACf,CAAC","sourcesContent":["import { sortStringsBy } from \"@gtkx/utils\";\nimport { existsSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { DeploySettings, DeployTargetName, NodeRuntime, NoticeSection, StagedFile } from \"../types.js\";\nimport { LOCALE_DIRNAME } from \"../../i18n/catalogs.js\";\nimport { BUILD_MANIFEST_FILENAME } from \"../../internal/build-manifest.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderCopyright } from \"../freedesktop/copyright.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { renderNotices } from \"../notices/render.js\";\nimport { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from \"./copy-tree.js\";\nimport { stageIcons } from \"./icons.js\";\nimport { NODE_FILENAME, renderLauncher } from \"./launcher.js\";\nimport { stageSchemas } from \"./schemas.js\";\n\ntype StageRequest = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n metadata: StagedMetadata;\n};\n\ntype StagedMetadata = {\n desktopEntry: string;\n metainfo: string;\n mimePackage: string | null;\n};\n\nconst DIST_ICONS_DIR = \"icons\";\nconst LEGACY_PACKAGES_MANIFEST_FILENAME = \"gtkx-packages.json\";\nconst NOTICES_FILENAME = \"THIRD-PARTY-NOTICES\";\nconst NODE_LICENSE_FILENAME = \"LICENSE\";\nconst SHARE_APPLICATIONS = \"share/applications\";\nconst SHARE_METAINFO = \"share/metainfo\";\nconst SHARE_MIME_PACKAGES = \"share/mime/packages\";\nconst SHARE_DOC = \"share/doc\";\nconst SHARE_LICENSES = \"share/licenses\";\nconst SHARE_DBUS_SERVICES = \"share/dbus-1/services\";\nconst SHARE_LOCALE = `share/${LOCALE_DIRNAME}`;\n\nconst PREFIX_FOR: Record<DeployTargetName, string> = {\n appimage: \"/usr\",\n deb: \"/usr\",\n flatpak: \"/app\",\n rpm: \"/usr\",\n};\n\nconst libDirFor = (settings: DeploySettings): string => `lib/${settings.binaryName}`;\nconst licenseDirFor = (settings: DeploySettings): string => `${SHARE_LICENSES}/${settings.binaryName}`;\nconst licenseDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/LICENSE`;\nconst noticesDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;\nconst isIconAsset = (rel: string): boolean => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);\n\nconst isBuildMetadata = (rel: string): boolean =>\n rel === BUILD_MANIFEST_FILENAME || rel === LEGACY_PACKAGES_MANIFEST_FILENAME;\n\nconst isLocaleAsset = (rel: string): boolean => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);\n\nconst nodeLicenseDestination = (settings: DeploySettings): string =>\n `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;\n\nconst stageRuntimeFiles = (settings: DeploySettings, root: string): StagedFile[] => {\n const dist = settings.paths.dist;\n\n if (!existsSync(join(dist, BUNDLE_FILENAME))) {\n throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \\`gtkx build\\` first.`);\n }\n\n return listFilesRecursive(dist)\n .filter((file) => !isIconAsset(file.rel) && !isBuildMetadata(file.rel) && !isLocaleAsset(file.rel))\n .map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));\n};\n\nconst stageCatalogs = (settings: DeploySettings, root: string): StagedFile[] =>\n listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))\n .map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));\n\nconst stageNodeBinary = (settings: DeploySettings, root: string, node: NodeRuntime | null): StagedFile[] =>\n node === null ? [] : [copyInto(root, join(libDirFor(settings), NODE_FILENAME), node.path, EXECUTABLE_MODE)];\n\nconst stageMetadata = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] => [\n writeInto(root, join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`), metadata.desktopEntry),\n writeInto(root, join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`), metadata.metainfo),\n ...(metadata.mimePackage === null\n ? []\n : [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),\n];\n\nconst stageExtraFiles = (settings: DeploySettings, root: string): StagedFile[] =>\n settings.extraFiles.map((file) => {\n const source = resolve(settings.paths.root, file.source);\n\n return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));\n });\n\nconst byRelativePath = (files: StagedFile[]): StagedFile[] => {\n const latest: Map<string, StagedFile> = new Map();\n\n for (const file of files) {\n latest.set(file.rel, file);\n }\n\n return sortStringsBy(latest.values(), (file) => file.rel);\n};\n\nconst stagePayload = ({ settings, node, metadata }: StageRequest): StagedFile[] => {\n const root = settings.paths.stage;\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n\n return byRelativePath([\n writeInto(root, join(\"bin\", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),\n ...stageNodeBinary(settings, root, node),\n ...stageRuntimeFiles(settings, root),\n ...stageCatalogs(settings, root),\n ...stageMetadata(settings, root, metadata),\n ...stageIcons(settings, root),\n ...stageSchemas(settings, root),\n ...stageExtraFiles(settings, root),\n ]);\n};\n\nconst withoutDbusActivation = (desktopEntry: string): string =>\n desktopEntry\n .split(\"\\n\")\n .filter((line) => line !== \"DBusActivatable=true\")\n .join(\"\\n\");\n\nconst stageActivation = (\n settings: DeploySettings,\n root: string,\n target: DeployTargetName,\n metadata: StagedMetadata,\n): StagedFile[] => {\n if (!settings.isDbusActivatable) {\n return [];\n }\n\n if (target === \"appimage\") {\n return [writeInto(\n root,\n join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`),\n withoutDbusActivation(metadata.desktopEntry),\n )];\n }\n\n return [writeInto(\n root,\n join(SHARE_DBUS_SERVICES, `${settings.applicationId}.service`),\n renderDbusService(settings, PREFIX_FOR[target]),\n )];\n};\n\nconst stageOverlay = (\n settings: DeploySettings,\n target: DeployTargetName,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): StagedFile[] => {\n const root = join(settings.paths.overlay, target);\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n const licenseFile = settings.paths.licenseFile;\n const activation = stageActivation(settings, root, target, metadata);\n\n if (target === \"deb\") {\n return [\n ...activation,\n writeInto(root, join(SHARE_DOC, settings.binaryName, \"copyright\"), renderCopyright(settings, notices)),\n ];\n }\n\n return [\n ...activation,\n ...(licenseFile === null ? [] : [copyInto(root, licenseDestination(settings), licenseFile)]),\n writeInto(root, noticesDestination(settings), renderNotices(settings, notices)),\n ];\n};\n\nconst stageOverlays = (\n settings: DeploySettings,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): Record<DeployTargetName, StagedFile[]> => ({\n appimage: stageOverlay(settings, \"appimage\", notices, metadata),\n deb: stageOverlay(settings, \"deb\", notices, metadata),\n flatpak: stageOverlay(settings, \"flatpak\", notices, metadata),\n rpm: stageOverlay(settings, \"rpm\", notices, metadata),\n});\n\nexport {\n licenseDestination,\n nodeLicenseDestination,\n NOTICES_FILENAME,\n noticesDestination,\n type StagedMetadata,\n stageOverlays,\n stagePayload,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"stage.js","sourceRoot":"","sources":["../../../src/deploy/payload/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAe5C,MAAM,cAAc,GAAG,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EAAE,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACzG,CAAC;IACN,CAAC;IAED,OAAO;QACH,GAAG,UAAU;QACb,GAAG,CAAC,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;QAC5F,SAAS,CAAC,IAAI,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;KAClF,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAClB,QAAwB,EACxB,OAAwB,EACxB,QAAwB,EACc,EAAE,CAAC,CAAC;IAC1C,QAAQ,EAAE,YAAY,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC/D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;IACrD,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;IAC7D,GAAG,EAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC;CACxD,CAAC,CAAC;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,kBAAkB,EAElB,aAAa,EACb,YAAY,GACf,CAAC","sourcesContent":["import { sortStringsBy, warn } from \"@gtkx/utils\";\nimport { existsSync, rmSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport type { DeploySettings, DeployTargetName, NodeRuntime, NoticeSection, StagedFile } from \"../types.js\";\nimport { LOCALE_DIRNAME } from \"../../i18n/catalogs.js\";\nimport { BUILD_MANIFEST_FILENAME } from \"../../internal/build-manifest.js\";\nimport { listFilesRecursive } from \"../../internal/list-files.js\";\nimport { BUNDLE_FILENAME } from \"../../vite-plugins/esm-extension.js\";\nimport { renderCopyright } from \"../freedesktop/copyright.js\";\nimport { renderDbusService } from \"../freedesktop/dbus-service.js\";\nimport { BINDING_FILENAME } from \"../native-addon.js\";\nimport { readOptionalElfInfo } from \"../node-runtime/elf.js\";\nimport { renderNotices } from \"../notices/render.js\";\nimport { elfMachineFor } from \"../settings/arch.js\";\nimport { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from \"./copy-tree.js\";\nimport { stageIcons } from \"./icons.js\";\nimport { NODE_FILENAME, renderLauncher } from \"./launcher.js\";\nimport { stageSchemas } from \"./schemas.js\";\n\ntype StageRequest = {\n settings: DeploySettings;\n node: NodeRuntime | null;\n addon: string | null;\n metadata: StagedMetadata;\n};\n\ntype StagedMetadata = {\n desktopEntry: string;\n metainfo: string;\n mimePackage: string | null;\n};\n\nconst DIST_ICONS_DIR = \"icons\";\nconst NOTICES_FILENAME = \"THIRD-PARTY-NOTICES\";\nconst NODE_LICENSE_FILENAME = \"LICENSE\";\nconst SHARE_APPLICATIONS = \"share/applications\";\nconst SHARE_METAINFO = \"share/metainfo\";\nconst SHARE_MIME_PACKAGES = \"share/mime/packages\";\nconst SHARE_DOC = \"share/doc\";\nconst SHARE_LICENSES = \"share/licenses\";\nconst SHARE_DBUS_SERVICES = \"share/dbus-1/services\";\nconst SHARE_LOCALE = `share/${LOCALE_DIRNAME}`;\n\nconst PREFIX_FOR: Record<DeployTargetName, string> = {\n appimage: \"/usr\",\n deb: \"/usr\",\n flatpak: \"/app\",\n rpm: \"/usr\",\n};\n\nconst libDirFor = (settings: DeploySettings): string => `lib/${settings.binaryName}`;\nconst licenseDirFor = (settings: DeploySettings): string => `${SHARE_LICENSES}/${settings.binaryName}`;\nconst licenseDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/LICENSE`;\nconst noticesDestination = (settings: DeploySettings): string => `${licenseDirFor(settings)}/${NOTICES_FILENAME}`;\nconst isIconAsset = (rel: string): boolean => rel === DIST_ICONS_DIR || rel.startsWith(`${DIST_ICONS_DIR}/`);\nconst isLocaleAsset = (rel: string): boolean => rel === LOCALE_DIRNAME || rel.startsWith(`${LOCALE_DIRNAME}/`);\n\nconst nodeLicenseDestination = (settings: DeploySettings): string =>\n `${licenseDirFor(settings)}/${NODE_FILENAME}/${NODE_LICENSE_FILENAME}`;\n\nconst stageRuntimeFiles = (settings: DeploySettings, root: string): StagedFile[] => {\n const dist = settings.paths.dist;\n\n if (!existsSync(join(dist, BUNDLE_FILENAME))) {\n throw new Error(`Cannot deploy: ${join(dist, BUNDLE_FILENAME)} is missing. Run \\`gtkx build\\` first.`);\n }\n\n return listFilesRecursive(dist)\n .filter((file) =>\n !isIconAsset(file.rel) && file.rel !== BUILD_MANIFEST_FILENAME && !isLocaleAsset(file.rel))\n .map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));\n};\n\nconst stageAddon = (settings: DeploySettings, root: string, addon: string | null): StagedFile[] =>\n addon === null ? [] : [copyInto(root, join(libDirFor(settings), BINDING_FILENAME), addon)];\n\nconst architectureMismatch = (settings: DeploySettings, file: StagedFile): Error =>\n new Error(\n `Cannot deploy ${file.rel} for ${settings.arch.node}: it was built for another architecture. ` +\n \"Run `gtkx build` again, or drop --skip-build.\",\n );\n\nconst assertStagedArchitecture = (settings: DeploySettings, staged: StagedFile[]): void => {\n const expected = elfMachineFor(settings.arch.node);\n const lib = libDirFor(settings);\n const checked = new Set([join(lib, BINDING_FILENAME), join(lib, NODE_FILENAME)]);\n\n const binaries = staged.filter((entry) => checked.has(entry.rel));\n\n for (const file of binaries) {\n if (readOptionalElfInfo(file.abs)?.machine !== expected) {\n throw architectureMismatch(settings, file);\n }\n }\n};\n\nconst stageCatalogs = (settings: DeploySettings, root: string): StagedFile[] =>\n listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))\n .map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));\n\nconst stageNodeBinary = (settings: DeploySettings, root: string, node: NodeRuntime | null): StagedFile[] =>\n node === null ? [] : [copyInto(root, join(libDirFor(settings), NODE_FILENAME), node.path, EXECUTABLE_MODE)];\n\nconst stageMetadata = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] => [\n writeInto(root, join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`), metadata.desktopEntry),\n writeInto(root, join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`), metadata.metainfo),\n ...(metadata.mimePackage === null\n ? []\n : [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),\n];\n\nconst generatedMetadataKind = (\n settings: DeploySettings,\n metadata: StagedMetadata,\n destination: string,\n): string | null => {\n if (destination === join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`)) {\n return \"desktop entry\";\n }\n\n if (destination === join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`)) {\n return \"metainfo\";\n }\n\n if (\n metadata.mimePackage !== null &&\n destination === join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`)\n ) {\n return \"MIME package\";\n }\n\n return null;\n};\n\nconst warnMetadataCollision = (\n settings: DeploySettings,\n metadata: StagedMetadata,\n file: DeploySettings[\"extraFiles\"][number],\n): void => {\n const kind = generatedMetadataKind(settings, metadata, file.destination);\n\n if (kind !== null) {\n warn(\n `extraFiles source \"${file.source}\" targeting \"${file.destination}\" is overridden by the ` +\n `GTKX-generated ${kind}`,\n );\n }\n};\n\nconst stageExtraFiles = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] =>\n settings.extraFiles.map((file) => {\n const source = resolve(settings.paths.root, file.source);\n warnMetadataCollision(settings, metadata, file);\n\n return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));\n });\n\nconst byRelativePath = (files: StagedFile[]): StagedFile[] => {\n const latest: Map<string, StagedFile> = new Map();\n\n for (const file of files) {\n latest.set(file.rel, file);\n }\n\n return sortStringsBy(latest.values(), (file) => file.rel);\n};\n\nconst stagePayload = ({ settings, node, addon, metadata }: StageRequest): StagedFile[] => {\n const root = settings.paths.stage;\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n\n const staged = byRelativePath([\n writeInto(root, join(\"bin\", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),\n ...stageNodeBinary(settings, root, node),\n ...stageRuntimeFiles(settings, root),\n ...stageAddon(settings, root, addon),\n ...stageCatalogs(settings, root),\n ...stageExtraFiles(settings, root, metadata),\n ...stageMetadata(settings, root, metadata),\n ...stageIcons(settings, root),\n ...stageSchemas(settings, root),\n ]);\n\n assertStagedArchitecture(settings, staged);\n\n return staged;\n};\n\nconst withoutDbusActivation = (desktopEntry: string): string =>\n desktopEntry\n .split(\"\\n\")\n .filter((line) => line !== \"DBusActivatable=true\")\n .join(\"\\n\");\n\nconst stageActivation = (\n settings: DeploySettings,\n root: string,\n target: DeployTargetName,\n metadata: StagedMetadata,\n): StagedFile[] => {\n if (!settings.isDbusActivatable) {\n return [];\n }\n\n if (target === \"appimage\") {\n return [writeInto(\n root,\n join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`),\n withoutDbusActivation(metadata.desktopEntry),\n )];\n }\n\n return [writeInto(\n root,\n join(SHARE_DBUS_SERVICES, `${settings.applicationId}.service`),\n renderDbusService(settings, PREFIX_FOR[target]),\n )];\n};\n\nconst stageOverlay = (\n settings: DeploySettings,\n target: DeployTargetName,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): StagedFile[] => {\n const root = join(settings.paths.overlay, target);\n rmSync(root, { recursive: true, force: true, maxRetries: 5 });\n const licenseFile = settings.paths.licenseFile;\n const activation = stageActivation(settings, root, target, metadata);\n\n if (target === \"deb\") {\n return [\n ...activation,\n writeInto(root, join(SHARE_DOC, settings.binaryName, \"copyright\"), renderCopyright(settings, notices)),\n ];\n }\n\n return [\n ...activation,\n ...(licenseFile === null ? [] : [copyInto(root, licenseDestination(settings), licenseFile)]),\n writeInto(root, noticesDestination(settings), renderNotices(settings, notices)),\n ];\n};\n\nconst stageOverlays = (\n settings: DeploySettings,\n notices: NoticeSection[],\n metadata: StagedMetadata,\n): Record<DeployTargetName, StagedFile[]> => ({\n appimage: stageOverlay(settings, \"appimage\", notices, metadata),\n deb: stageOverlay(settings, \"deb\", notices, metadata),\n flatpak: stageOverlay(settings, \"flatpak\", notices, metadata),\n rpm: stageOverlay(settings, \"rpm\", notices, metadata),\n});\n\nexport {\n licenseDestination,\n nodeLicenseDestination,\n NOTICES_FILENAME,\n noticesDestination,\n type StagedMetadata,\n stageOverlays,\n stagePayload,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-deploy.d.ts","sourceRoot":"","sources":["../../src/deploy/run-deploy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-deploy.d.ts","sourceRoot":"","sources":["../../src/deploy/run-deploy.ts"],"names":[],"mappings":"AA+DA,KAAK,aAAa,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AA6fF,QAAA,MAAM,SAAS,GAAU,SAAS,aAAa,KAAG,OAAO,CAAC,IAAI,CAwB7D,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,3 +1,55 @@
|
|
|
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
|
+
});
|
|
1
53
|
import { loadConfig } from "@gtkx/config";
|
|
2
54
|
import { info, warn } from "@gtkx/utils";
|
|
3
55
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -7,19 +59,23 @@ import { ensureGenerated } from "../codegen/run-codegen.js";
|
|
|
7
59
|
import { replaceCatalogTemplate } from "../i18n/catalog-template.js";
|
|
8
60
|
import { compileCatalogs, LOCALE_DIRNAME, requiresCatalogInitialization, resolveCatalogProject, synchronizeCatalogs, } from "../i18n/catalogs.js";
|
|
9
61
|
import { extractSourceCatalogTo } from "../i18n/source-messages.js";
|
|
62
|
+
import { prepareBuildOutDir, resolveBuildOutDir } from "../internal/build-output.js";
|
|
10
63
|
import { discoverSourceFiles } from "../internal/source-imports.js";
|
|
11
64
|
import { renderDesktopEntry } from "./freedesktop/desktop-entry.js";
|
|
12
65
|
import { extractMetadataMessages, localizeMetadata } from "./freedesktop/localize.js";
|
|
13
66
|
import { renderMetainfo } from "./freedesktop/metainfo.js";
|
|
14
67
|
import { renderMimePackage } from "./freedesktop/mime-package.js";
|
|
15
68
|
import { validateDesktopEntry, validateMetainfo } from "./freedesktop/validate.js";
|
|
16
|
-
import {
|
|
69
|
+
import { resolveStagedAddon } from "./native-addon.js";
|
|
70
|
+
import { assertPortableRuntimeSource, resolveNodeRuntime } from "./node-runtime/index.js";
|
|
17
71
|
import { collectNotices } from "./notices/collect.js";
|
|
18
72
|
import { stageOverlays, stagePayload } from "./payload/stage.js";
|
|
19
73
|
import { DEFAULT_TARGETS, parseTargetList, targetsFor } from "./registry.js";
|
|
74
|
+
import { archesFor, hostArchName, isHostArch, parseArchList } from "./settings/arch.js";
|
|
20
75
|
import { readBuildManifest } from "./settings/build-manifest.js";
|
|
21
76
|
import { resolveDeploySettings } from "./settings/index.js";
|
|
22
77
|
import { readPackageManifest } from "./settings/package-manifest.js";
|
|
78
|
+
import { prepareDeployOutDir } from "./settings/paths.js";
|
|
23
79
|
import { missingDeployError } from "./settings/starter.js";
|
|
24
80
|
import { finishArgsFor, hasDisplaySocket, runtimeLabelFor } from "./targets/flatpak-manifest.js";
|
|
25
81
|
import { detectPackageManager } from "./targets/flatpak-sources.js";
|
|
@@ -122,14 +178,20 @@ const sourceModeTools = (targets, settings) => {
|
|
|
122
178
|
return detectPackageManager(settings) === "pnpm" ? [FLATPAK_NODE_GENERATOR_PNPM] : [FLATPAK_NODE_GENERATOR];
|
|
123
179
|
};
|
|
124
180
|
const isNodeRequired = (targets, settings) => !(settings.deploy.flatpak?.mode === "source" && targets.every((target) => target.name === FLATPAK_TARGET));
|
|
125
|
-
const
|
|
181
|
+
const archiveToolsFor = (settings) => (settings.deploy.node?.source ?? "download") === "download" ? [TAR] : [];
|
|
182
|
+
const stripToolsFor = (settings, arches) => {
|
|
183
|
+
if (settings.deploy.node?.shouldStrip === false) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
return arches.some((arch) => isHostArch(arch)) ? [STRIP] : [];
|
|
187
|
+
};
|
|
188
|
+
const runtimeToolsFor = (targets, settings, arches) => {
|
|
126
189
|
if (!isNodeRequired(targets, settings)) {
|
|
127
190
|
return [];
|
|
128
191
|
}
|
|
129
|
-
|
|
130
|
-
const archiveTools = (node.source ?? "download") === "download" ? [TAR] : [];
|
|
131
|
-
return node.shouldStrip === false ? archiveTools : [...archiveTools, STRIP];
|
|
192
|
+
return [...archiveToolsFor(settings), ...stripToolsFor(settings, arches)];
|
|
132
193
|
};
|
|
194
|
+
const crossBuildToolsFor = (arches) => arches.every((arch) => isHostArch(arch)) ? [] : [TAR];
|
|
133
195
|
const mutableCatalogTools = (project) => {
|
|
134
196
|
if (project.catalogs.length === 0) {
|
|
135
197
|
return [MSGGREP, XGETTEXT];
|
|
@@ -151,34 +213,80 @@ const catalogTools = (project, shouldSkipBuild) => {
|
|
|
151
213
|
}
|
|
152
214
|
return project.catalogs.length === 0 ? [] : [MSGFMT];
|
|
153
215
|
};
|
|
154
|
-
const preflight = ({
|
|
216
|
+
const preflight = ({ plan, settings, shouldPrintManifests, shouldSkipBuild }) => {
|
|
217
|
+
const { targets, arches, project } = plan;
|
|
155
218
|
const packagerTools = shouldPrintManifests
|
|
156
219
|
? []
|
|
157
|
-
: [...runtimeToolsFor(targets, settings), ...targets.flatMap((target) => target.tools)];
|
|
220
|
+
: [...runtimeToolsFor(targets, settings, arches), ...targets.flatMap((target) => target.tools)];
|
|
158
221
|
const required = [
|
|
159
222
|
DESKTOP_FILE_VALIDATE,
|
|
160
223
|
APPSTREAMCLI,
|
|
224
|
+
...crossBuildToolsFor(arches),
|
|
161
225
|
...catalogTools(project, shouldSkipBuild),
|
|
162
226
|
...sourceModeTools(targets, settings),
|
|
163
227
|
];
|
|
164
228
|
const report = probeTools([...required, ...packagerTools]);
|
|
165
229
|
assertTools(report);
|
|
230
|
+
if (isNodeRequired(targets, settings)) {
|
|
231
|
+
assertPortableRuntimeSource(settings);
|
|
232
|
+
}
|
|
166
233
|
warnMissingOptional(report);
|
|
167
234
|
warnFlatpakPermissions(targets, settings);
|
|
168
235
|
warnLibraryMinimums(targets, settings);
|
|
169
236
|
};
|
|
170
|
-
const
|
|
237
|
+
const hostOnlyNames = (targets) => targets.filter((target) => target.isHostOnly).map((target) => target.name);
|
|
238
|
+
const assertCrossBuild = (plan) => {
|
|
239
|
+
const foreign = plan.arches.filter((arch) => !isHostArch(arch));
|
|
240
|
+
if (foreign.length === 0) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const hostOnly = hostOnlyNames(plan.targets);
|
|
244
|
+
if (hostOnly.length > 0) {
|
|
245
|
+
throw new Error(`Cannot build ${hostOnly.join(" and ")} for ${foreign.join(" and ")}: those targets package with ` +
|
|
246
|
+
`tooling that only runs on ${hostArchName()}. Deploy them in a separate run without --arch.`);
|
|
247
|
+
}
|
|
248
|
+
if ((plan.loaded.deploy.node?.source ?? "download") !== "download") {
|
|
249
|
+
throw new Error('Cannot deploy for another architecture with a `deploy.node.source` other than "download": ' +
|
|
250
|
+
`a host or path runtime is always ${hostArchName()}.`);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const resolveTargetNames = (options, deploy) => {
|
|
171
254
|
if (options.targets !== undefined) {
|
|
172
255
|
return parseTargetList(options.targets);
|
|
173
256
|
}
|
|
174
|
-
return
|
|
257
|
+
return deploy.targets ?? DEFAULT_TARGETS;
|
|
175
258
|
};
|
|
176
|
-
const
|
|
177
|
-
|
|
259
|
+
const resolveArchNames = (options, deploy) => {
|
|
260
|
+
if (options.arches !== undefined) {
|
|
261
|
+
return parseArchList(options.arches);
|
|
262
|
+
}
|
|
263
|
+
return deploy.architectures ?? [hostArchName()];
|
|
264
|
+
};
|
|
265
|
+
const loadDeployConfig = async (options) => {
|
|
266
|
+
const { config, configFile, root } = await loadConfig(options.cwd, {
|
|
267
|
+
mode: BUILD_MODE,
|
|
268
|
+
configFile: options.configFile,
|
|
269
|
+
});
|
|
178
270
|
if (config.deploy === undefined) {
|
|
179
271
|
throw missingDeployError(config.applicationId, readPackageManifest(root));
|
|
180
272
|
}
|
|
181
|
-
return
|
|
273
|
+
return { config, configFile, root, deploy: config.deploy };
|
|
274
|
+
};
|
|
275
|
+
const settingsFor = (plan, options, arch) => resolveDeploySettings({
|
|
276
|
+
root: plan.loaded.root,
|
|
277
|
+
config: plan.loaded.config,
|
|
278
|
+
configFile: plan.loaded.configFile,
|
|
279
|
+
outDirOverride: options.outDir,
|
|
280
|
+
arch,
|
|
281
|
+
});
|
|
282
|
+
const planDeploy = async (options) => {
|
|
283
|
+
const loaded = await loadDeployConfig(options);
|
|
284
|
+
return {
|
|
285
|
+
loaded,
|
|
286
|
+
targets: targetsFor(resolveTargetNames(options, loaded.deploy)),
|
|
287
|
+
arches: archesFor(resolveArchNames(options, loaded.deploy)),
|
|
288
|
+
project: resolveCatalogProject(loaded.root, loaded.config.applicationId),
|
|
289
|
+
};
|
|
182
290
|
};
|
|
183
291
|
const synchronizeMetadataCatalogs = async (settings, templates, project) => {
|
|
184
292
|
if (project === null) {
|
|
@@ -200,30 +308,47 @@ const synchronizeMetadataCatalogs = async (settings, templates, project) => {
|
|
|
200
308
|
rmSync(stagingDir, { recursive: true, force: true });
|
|
201
309
|
}
|
|
202
310
|
};
|
|
203
|
-
const
|
|
204
|
-
const
|
|
205
|
-
|
|
311
|
+
const buildApplication = async ({ options, plan, settings, buildOutDir, }) => {
|
|
312
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
313
|
+
try {
|
|
314
|
+
const templates = renderMetadata(settings);
|
|
315
|
+
if (buildOutDir === null) {
|
|
316
|
+
if (plan.project !== null) {
|
|
317
|
+
compileCatalogs(plan.project, join(settings.paths.dist, LOCALE_DIRNAME));
|
|
318
|
+
}
|
|
319
|
+
return localizeMetadata(templates, plan.project);
|
|
320
|
+
}
|
|
206
321
|
info(`Building ${options.entry}`);
|
|
322
|
+
const preparedOutput = __addDisposableResource(env_1, prepareBuildOutDir(settings.paths.root, buildOutDir), false);
|
|
207
323
|
await buildApp({
|
|
208
324
|
entry: options.entry,
|
|
209
|
-
|
|
325
|
+
configFile: options.configFile,
|
|
326
|
+
vite: { root: options.cwd, build: { outDir: preparedOutput.path, emptyOutDir: false } },
|
|
210
327
|
});
|
|
211
|
-
|
|
328
|
+
preparedOutput.commit();
|
|
329
|
+
await synchronizeMetadataCatalogs(settings, templates, plan.project);
|
|
330
|
+
return localizeMetadata(templates, plan.project);
|
|
212
331
|
}
|
|
213
|
-
|
|
214
|
-
|
|
332
|
+
catch (e_1) {
|
|
333
|
+
env_1.error = e_1;
|
|
334
|
+
env_1.hasError = true;
|
|
335
|
+
}
|
|
336
|
+
finally {
|
|
337
|
+
__disposeResources(env_1);
|
|
215
338
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
339
|
+
};
|
|
340
|
+
const buildArchPayload = async ({ options, plan, settings, metadata, }) => {
|
|
341
|
+
validateMetadata(settings, metadata, isFlathubSubmission(settings, plan.targets));
|
|
342
|
+
const buildManifest = readBuildManifest(settings, plan.loaded);
|
|
219
343
|
const builtSettings = {
|
|
220
344
|
...settings,
|
|
221
345
|
paths: { ...settings.paths, schemaFiles: buildManifest.schemaFiles },
|
|
222
346
|
};
|
|
223
|
-
const node = options.shouldPrintManifests || !isNodeRequired(targets, builtSettings)
|
|
347
|
+
const node = options.shouldPrintManifests || !isNodeRequired(plan.targets, builtSettings)
|
|
224
348
|
? null
|
|
225
349
|
: await resolveNodeRuntime(builtSettings);
|
|
226
|
-
const
|
|
350
|
+
const addon = await resolveStagedAddon(builtSettings);
|
|
351
|
+
const stage = stagePayload({ settings: builtSettings, node, addon, metadata });
|
|
227
352
|
info(`Staged ${String(stage.length)} files into ${displayPath(builtSettings, builtSettings.paths.stage)}`);
|
|
228
353
|
const notices = collectNotices({ settings: builtSettings, node, packages: buildManifest.packages });
|
|
229
354
|
return {
|
|
@@ -257,42 +382,62 @@ const packTargets = async (rendered, payload) => {
|
|
|
257
382
|
}
|
|
258
383
|
return artifacts;
|
|
259
384
|
};
|
|
260
|
-
const announce = (settings,
|
|
261
|
-
const names = targets.map((target) => target.name).join(", ");
|
|
385
|
+
const announce = (settings, plan) => {
|
|
386
|
+
const names = plan.targets.map((target) => target.name).join(", ");
|
|
262
387
|
const version = `${settings.versions.packageVersion}-${settings.versions.debRevision}`;
|
|
263
|
-
|
|
388
|
+
const arches = plan.arches.join(", ");
|
|
389
|
+
info(`Deploying ${settings.name} ${version} as ${settings.binaryName} (${arches}) to ${names}`);
|
|
264
390
|
};
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
preflight({
|
|
271
|
-
targets,
|
|
272
|
-
settings,
|
|
273
|
-
project,
|
|
274
|
-
shouldPrintManifests: options.shouldPrintManifests,
|
|
275
|
-
shouldSkipBuild: options.shouldSkipBuild,
|
|
276
|
-
});
|
|
277
|
-
if (!options.shouldSkipBuild) {
|
|
278
|
-
await ensureGenerated(options.cwd, {
|
|
279
|
-
shouldAnnounce: true,
|
|
280
|
-
mode: BUILD_MODE,
|
|
281
|
-
});
|
|
282
|
-
settings = await loadSettings(options);
|
|
283
|
-
project = resolveCatalogProject(settings.paths.root, settings.applicationId);
|
|
284
|
-
targets = targetsFor(resolveTargetNames(options, settings));
|
|
285
|
-
}
|
|
286
|
-
const payload = await buildPayload(options, settings, targets, project);
|
|
287
|
-
const rendered = renderTargetManifests(targets, payload);
|
|
391
|
+
const deployArch = async (request) => {
|
|
392
|
+
const { options, plan, arch, metadata } = request;
|
|
393
|
+
const settings = settingsFor(plan, options, arch);
|
|
394
|
+
const payload = await buildArchPayload({ options, plan, settings, metadata });
|
|
395
|
+
const rendered = renderTargetManifests(plan.targets, payload);
|
|
288
396
|
if (options.shouldPrintManifests) {
|
|
289
397
|
const count = rendered.values().toArray().flat().length;
|
|
290
|
-
info(`Wrote ${String(count)} manifests, 0 packages built`);
|
|
398
|
+
info(`Wrote ${String(count)} manifests for ${arch}, 0 packages built`);
|
|
399
|
+
return [];
|
|
400
|
+
}
|
|
401
|
+
return await packTargets(rendered, payload);
|
|
402
|
+
};
|
|
403
|
+
const regenerate = async (options, plan) => {
|
|
404
|
+
if (options.shouldSkipBuild) {
|
|
405
|
+
return plan;
|
|
406
|
+
}
|
|
407
|
+
await ensureGenerated(options.cwd, {
|
|
408
|
+
shouldAnnounce: true,
|
|
409
|
+
mode: BUILD_MODE,
|
|
410
|
+
configFile: options.configFile,
|
|
411
|
+
});
|
|
412
|
+
return await planDeploy(options);
|
|
413
|
+
};
|
|
414
|
+
const finish = (options, settings, artifacts) => {
|
|
415
|
+
if (options.shouldPrintManifests) {
|
|
291
416
|
return;
|
|
292
417
|
}
|
|
293
|
-
const artifacts = await packTargets(rendered, payload);
|
|
294
418
|
const output = displayPath(settings, settings.paths.output);
|
|
295
419
|
info(`Deploy complete: ${String(artifacts.length)} artifacts in ${output}`);
|
|
296
420
|
};
|
|
421
|
+
const runDeploy = async (options) => {
|
|
422
|
+
const planned = await planDeploy(options);
|
|
423
|
+
assertCrossBuild(planned);
|
|
424
|
+
announce(settingsFor(planned, options, planned.arches[0]), planned);
|
|
425
|
+
preflight({
|
|
426
|
+
plan: planned,
|
|
427
|
+
settings: settingsFor(planned, options, planned.arches[0]),
|
|
428
|
+
shouldPrintManifests: options.shouldPrintManifests,
|
|
429
|
+
shouldSkipBuild: options.shouldSkipBuild,
|
|
430
|
+
});
|
|
431
|
+
const plan = await regenerate(options, planned);
|
|
432
|
+
const settings = settingsFor(plan, options, plan.arches[0]);
|
|
433
|
+
const buildOutDir = options.shouldSkipBuild ? null : resolveBuildOutDir(settings.paths.root, settings.paths.dist);
|
|
434
|
+
prepareDeployOutDir(settings.paths.root, settings.paths.outDir);
|
|
435
|
+
const metadata = await buildApplication({ options, plan, settings, buildOutDir });
|
|
436
|
+
const artifacts = [];
|
|
437
|
+
for (const arch of plan.arches) {
|
|
438
|
+
artifacts.push(...await deployArch({ options, plan, arch, metadata }));
|
|
439
|
+
}
|
|
440
|
+
finish(options, settings, artifacts);
|
|
441
|
+
};
|
|
297
442
|
export { runDeploy };
|
|
298
443
|
//# sourceMappingURL=run-deploy.js.map
|