@gtkx/cli 2.0.0-beta.1 → 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 +43 -40
- 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 +5 -1
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts.map +1 -1
- package/dist/codegen/reference.js +1 -0
- package/dist/codegen/reference.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +6 -3
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +42 -18
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +3 -1
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js +7 -4
- 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 +1 -0
- 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/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/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/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/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 +46 -5
- 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 +15 -4
- 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 +2 -1
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +4 -2
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +121 -12
- package/dist/deploy/settings/paths.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 +13 -2
- package/dist/deploy/targets/flatpak-source.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 +10 -3
- 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/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 +10 -7
- package/dist/i18n/catalogs.js.map +1 -1
- package/dist/i18n/source-messages.d.ts +3 -1
- package/dist/i18n/source-messages.d.ts.map +1 -1
- package/dist/i18n/source-messages.js +973 -9
- package/dist/i18n/source-messages.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 +5 -4
- 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-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 +31 -11
- 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/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +3 -8
- 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.map +1 -1
- package/dist/vite-plugins/asset-imports.js +20 -6
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/asset-specifier.d.ts +5 -1
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
- package/dist/vite-plugins/asset-specifier.js +10 -1
- 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 +74 -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 +17 -3
- 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 +9 -6
- 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 +4 -4
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +25 -14
- 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 +18 -15
- 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 -13
- 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 +18 -13
- 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 +5 -1
- package/src/codegen/reference.ts +1 -0
- package/src/codegen/run-codegen.ts +51 -21
- package/src/codegen/store-resolver.ts +9 -4
- 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 +1 -0
- package/src/deploy/depends.ts +30 -3
- package/src/deploy/download.ts +33 -24
- package/src/deploy/freedesktop/metainfo.ts +73 -21
- package/src/deploy/freedesktop/validate.ts +80 -15
- 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/sonames.ts +17 -0
- package/src/deploy/notices/node-runtime.ts +2 -2
- package/src/deploy/payload/launcher.ts +20 -1
- package/src/deploy/payload/stage.ts +76 -5
- package/src/deploy/run-deploy.ts +227 -72
- package/src/deploy/settings/arch.ts +40 -8
- package/src/deploy/settings/build-manifest.ts +28 -3
- package/src/deploy/settings/extra-files.ts +30 -4
- package/src/deploy/settings/index.ts +7 -2
- package/src/deploy/settings/libraries.ts +2 -1
- package/src/deploy/settings/paths.ts +80 -13
- package/src/deploy/targets/appimage.ts +1 -0
- package/src/deploy/targets/flatpak-pnpm.ts +4 -4
- package/src/deploy/targets/flatpak-source.ts +15 -2
- 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 +12 -3
- package/src/dev/runner.ts +37 -7
- 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 +21 -8
- package/src/i18n/source-messages.ts +1446 -29
- 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 +10 -4
- 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-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 +57 -12
- 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/schema.ts +4 -10
- package/src/vite-plugins/asset-extensions.ts +2 -0
- package/src/vite-plugins/asset-imports.ts +23 -5
- package/src/vite-plugins/asset-specifier.ts +17 -0
- 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 +122 -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 +34 -9
- 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 +11 -5
- package/src/vite-plugins/self-contained.ts +184 -185
- package/src/vite-plugins/settings-worker-env.ts +4 -4
- package/src/vite-plugins/settings.ts +36 -16
- package/src/vite-plugins/store-links.ts +10 -5
- package/src/vite-plugins/undeclared-library.ts +19 -15
- package/src/vite-plugins/worker.ts +31 -15
- package/src/vitest-plugin.ts +12 -8
package/src/deploy/run-deploy.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { loadConfig } from "@gtkx/config";
|
|
1
|
+
import { type Config, loadConfig } from "@gtkx/config";
|
|
2
2
|
import { info, warn } from "@gtkx/utils";
|
|
3
3
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join, relative } from "node:path";
|
|
5
5
|
import type {
|
|
6
|
+
DeployArchName,
|
|
6
7
|
DeployArtifact,
|
|
8
|
+
DeployConfig,
|
|
7
9
|
DeployManifest,
|
|
8
10
|
DeployPayload,
|
|
9
11
|
DeploySettings,
|
|
@@ -22,19 +24,23 @@ import {
|
|
|
22
24
|
synchronizeCatalogs,
|
|
23
25
|
} from "../i18n/catalogs.js";
|
|
24
26
|
import { extractSourceCatalogTo } from "../i18n/source-messages.js";
|
|
27
|
+
import { prepareBuildOutDir, resolveBuildOutDir } from "../internal/build-output.js";
|
|
25
28
|
import { discoverSourceFiles } from "../internal/source-imports.js";
|
|
26
29
|
import { renderDesktopEntry } from "./freedesktop/desktop-entry.js";
|
|
27
30
|
import { extractMetadataMessages, localizeMetadata } from "./freedesktop/localize.js";
|
|
28
31
|
import { renderMetainfo } from "./freedesktop/metainfo.js";
|
|
29
32
|
import { renderMimePackage } from "./freedesktop/mime-package.js";
|
|
30
33
|
import { validateDesktopEntry, validateMetainfo } from "./freedesktop/validate.js";
|
|
31
|
-
import {
|
|
34
|
+
import { resolveStagedAddon } from "./native-addon.js";
|
|
35
|
+
import { assertPortableRuntimeSource, resolveNodeRuntime } from "./node-runtime/index.js";
|
|
32
36
|
import { collectNotices } from "./notices/collect.js";
|
|
33
37
|
import { type StagedMetadata, stageOverlays, stagePayload } from "./payload/stage.js";
|
|
34
38
|
import { DEFAULT_TARGETS, parseTargetList, targetsFor } from "./registry.js";
|
|
39
|
+
import { archesFor, hostArchName, isHostArch, parseArchList } from "./settings/arch.js";
|
|
35
40
|
import { readBuildManifest } from "./settings/build-manifest.js";
|
|
36
41
|
import { resolveDeploySettings } from "./settings/index.js";
|
|
37
42
|
import { readPackageManifest } from "./settings/package-manifest.js";
|
|
43
|
+
import { prepareDeployOutDir } from "./settings/paths.js";
|
|
38
44
|
import { missingDeployError } from "./settings/starter.js";
|
|
39
45
|
import { finishArgsFor, hasDisplaySocket, runtimeLabelFor } from "./targets/flatpak-manifest.js";
|
|
40
46
|
import { detectPackageManager } from "./targets/flatpak-sources.js";
|
|
@@ -58,20 +64,56 @@ import {
|
|
|
58
64
|
type DeployOptions = {
|
|
59
65
|
entry: string;
|
|
60
66
|
cwd: string;
|
|
67
|
+
configFile?: string | undefined;
|
|
61
68
|
targets?: string | undefined;
|
|
69
|
+
arches?: string | undefined;
|
|
62
70
|
outDir?: string | undefined;
|
|
63
71
|
shouldPrintManifests: boolean;
|
|
64
72
|
shouldSkipBuild: boolean;
|
|
65
73
|
};
|
|
66
74
|
|
|
67
|
-
type
|
|
75
|
+
type LoadedDeployConfig = {
|
|
76
|
+
config: Config;
|
|
77
|
+
configFile: string;
|
|
78
|
+
root: string;
|
|
79
|
+
deploy: DeployConfig;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
type DeployPlan = {
|
|
83
|
+
loaded: LoadedDeployConfig;
|
|
68
84
|
targets: DeployTarget[];
|
|
69
|
-
|
|
85
|
+
arches: [DeployArchName, ...DeployArchName[]];
|
|
70
86
|
project: CatalogProject | null;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
type PreflightRequest = {
|
|
90
|
+
plan: DeployPlan;
|
|
91
|
+
settings: DeploySettings;
|
|
71
92
|
shouldPrintManifests: boolean;
|
|
72
93
|
shouldSkipBuild: boolean;
|
|
73
94
|
};
|
|
74
95
|
|
|
96
|
+
type BuildApplicationRequest = {
|
|
97
|
+
options: DeployOptions;
|
|
98
|
+
plan: DeployPlan;
|
|
99
|
+
settings: DeploySettings;
|
|
100
|
+
buildOutDir: string | null;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
type BuildPayloadRequest = {
|
|
104
|
+
options: DeployOptions;
|
|
105
|
+
plan: DeployPlan;
|
|
106
|
+
settings: DeploySettings;
|
|
107
|
+
metadata: StagedMetadata;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
type ArchRunRequest = {
|
|
111
|
+
options: DeployOptions;
|
|
112
|
+
plan: DeployPlan;
|
|
113
|
+
arch: DeployArchName;
|
|
114
|
+
metadata: StagedMetadata;
|
|
115
|
+
};
|
|
116
|
+
|
|
75
117
|
const BUILD_MODE = "production";
|
|
76
118
|
const BYTES_PER_MIB = 1024 * 1024;
|
|
77
119
|
const WEBKIT_LIBRARY = "WebKit-6.0";
|
|
@@ -212,17 +254,28 @@ const sourceModeTools = (targets: DeployTarget[], settings: DeploySettings): Dep
|
|
|
212
254
|
const isNodeRequired = (targets: DeployTarget[], settings: DeploySettings): boolean =>
|
|
213
255
|
!(settings.deploy.flatpak?.mode === "source" && targets.every((target) => target.name === FLATPAK_TARGET));
|
|
214
256
|
|
|
215
|
-
const
|
|
216
|
-
|
|
257
|
+
const archiveToolsFor = (settings: DeploySettings): DeployTool[] =>
|
|
258
|
+
(settings.deploy.node?.source ?? "download") === "download" ? [TAR] : [];
|
|
259
|
+
|
|
260
|
+
const stripToolsFor = (settings: DeploySettings, arches: DeployArchName[]): DeployTool[] => {
|
|
261
|
+
if (settings.deploy.node?.shouldStrip === false) {
|
|
217
262
|
return [];
|
|
218
263
|
}
|
|
219
264
|
|
|
220
|
-
|
|
221
|
-
|
|
265
|
+
return arches.some((arch) => isHostArch(arch)) ? [STRIP] : [];
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
const runtimeToolsFor = (targets: DeployTarget[], settings: DeploySettings, arches: DeployArchName[]): DeployTool[] => {
|
|
269
|
+
if (!isNodeRequired(targets, settings)) {
|
|
270
|
+
return [];
|
|
271
|
+
}
|
|
222
272
|
|
|
223
|
-
return
|
|
273
|
+
return [...archiveToolsFor(settings), ...stripToolsFor(settings, arches)];
|
|
224
274
|
};
|
|
225
275
|
|
|
276
|
+
const crossBuildToolsFor = (arches: DeployArchName[]): DeployTool[] =>
|
|
277
|
+
arches.every((arch) => isHostArch(arch)) ? [] : [TAR];
|
|
278
|
+
|
|
226
279
|
const mutableCatalogTools = (project: CatalogProject): DeployTool[] => {
|
|
227
280
|
if (project.catalogs.length === 0) {
|
|
228
281
|
return [MSGGREP, XGETTEXT];
|
|
@@ -249,47 +302,107 @@ const catalogTools = (project: CatalogProject | null, shouldSkipBuild: boolean):
|
|
|
249
302
|
return project.catalogs.length === 0 ? [] : [MSGFMT];
|
|
250
303
|
};
|
|
251
304
|
|
|
252
|
-
const preflight = ({
|
|
253
|
-
targets,
|
|
254
|
-
|
|
255
|
-
project,
|
|
256
|
-
shouldPrintManifests,
|
|
257
|
-
shouldSkipBuild,
|
|
258
|
-
}: PreflightRequest): void => {
|
|
305
|
+
const preflight = ({ plan, settings, shouldPrintManifests, shouldSkipBuild }: PreflightRequest): void => {
|
|
306
|
+
const { targets, arches, project } = plan;
|
|
307
|
+
|
|
259
308
|
const packagerTools = shouldPrintManifests
|
|
260
309
|
? []
|
|
261
|
-
: [...runtimeToolsFor(targets, settings), ...targets.flatMap((target) => target.tools)];
|
|
310
|
+
: [...runtimeToolsFor(targets, settings, arches), ...targets.flatMap((target) => target.tools)];
|
|
262
311
|
|
|
263
312
|
const required = [
|
|
264
313
|
DESKTOP_FILE_VALIDATE,
|
|
265
314
|
APPSTREAMCLI,
|
|
315
|
+
...crossBuildToolsFor(arches),
|
|
266
316
|
...catalogTools(project, shouldSkipBuild),
|
|
267
317
|
...sourceModeTools(targets, settings),
|
|
268
318
|
];
|
|
269
319
|
|
|
270
320
|
const report = probeTools([...required, ...packagerTools]);
|
|
271
321
|
assertTools(report);
|
|
322
|
+
|
|
323
|
+
if (isNodeRequired(targets, settings)) {
|
|
324
|
+
assertPortableRuntimeSource(settings);
|
|
325
|
+
}
|
|
326
|
+
|
|
272
327
|
warnMissingOptional(report);
|
|
273
328
|
warnFlatpakPermissions(targets, settings);
|
|
274
329
|
warnLibraryMinimums(targets, settings);
|
|
275
330
|
};
|
|
276
331
|
|
|
277
|
-
const
|
|
332
|
+
const hostOnlyNames = (targets: DeployTarget[]): string[] =>
|
|
333
|
+
targets.filter((target) => target.isHostOnly).map((target) => target.name);
|
|
334
|
+
|
|
335
|
+
const assertCrossBuild = (plan: DeployPlan): void => {
|
|
336
|
+
const foreign = plan.arches.filter((arch) => !isHostArch(arch));
|
|
337
|
+
|
|
338
|
+
if (foreign.length === 0) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const hostOnly = hostOnlyNames(plan.targets);
|
|
343
|
+
|
|
344
|
+
if (hostOnly.length > 0) {
|
|
345
|
+
throw new Error(
|
|
346
|
+
`Cannot build ${hostOnly.join(" and ")} for ${foreign.join(" and ")}: those targets package with ` +
|
|
347
|
+
`tooling that only runs on ${hostArchName()}. Deploy them in a separate run without --arch.`,
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if ((plan.loaded.deploy.node?.source ?? "download") !== "download") {
|
|
352
|
+
throw new Error(
|
|
353
|
+
'Cannot deploy for another architecture with a `deploy.node.source` other than "download": ' +
|
|
354
|
+
`a host or path runtime is always ${hostArchName()}.`,
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
const resolveTargetNames = (options: DeployOptions, deploy: DeployConfig): string[] => {
|
|
278
360
|
if (options.targets !== undefined) {
|
|
279
361
|
return parseTargetList(options.targets);
|
|
280
362
|
}
|
|
281
363
|
|
|
282
|
-
return
|
|
364
|
+
return deploy.targets ?? DEFAULT_TARGETS;
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
const resolveArchNames = (options: DeployOptions, deploy: DeployConfig): string[] => {
|
|
368
|
+
if (options.arches !== undefined) {
|
|
369
|
+
return parseArchList(options.arches);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return deploy.architectures ?? [hostArchName()];
|
|
283
373
|
};
|
|
284
374
|
|
|
285
|
-
const
|
|
286
|
-
const { config, root } = await loadConfig(options.cwd, {
|
|
375
|
+
const loadDeployConfig = async (options: DeployOptions): Promise<LoadedDeployConfig> => {
|
|
376
|
+
const { config, configFile, root } = await loadConfig(options.cwd, {
|
|
377
|
+
mode: BUILD_MODE,
|
|
378
|
+
configFile: options.configFile,
|
|
379
|
+
});
|
|
287
380
|
|
|
288
381
|
if (config.deploy === undefined) {
|
|
289
382
|
throw missingDeployError(config.applicationId, readPackageManifest(root));
|
|
290
383
|
}
|
|
291
384
|
|
|
292
|
-
return
|
|
385
|
+
return { config, configFile, root, deploy: config.deploy };
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
const settingsFor = (plan: DeployPlan, options: DeployOptions, arch: DeployArchName): DeploySettings =>
|
|
389
|
+
resolveDeploySettings({
|
|
390
|
+
root: plan.loaded.root,
|
|
391
|
+
config: plan.loaded.config,
|
|
392
|
+
configFile: plan.loaded.configFile,
|
|
393
|
+
outDirOverride: options.outDir,
|
|
394
|
+
arch,
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
const planDeploy = async (options: DeployOptions): Promise<DeployPlan> => {
|
|
398
|
+
const loaded = await loadDeployConfig(options);
|
|
399
|
+
|
|
400
|
+
return {
|
|
401
|
+
loaded,
|
|
402
|
+
targets: targetsFor(resolveTargetNames(options, loaded.deploy)),
|
|
403
|
+
arches: archesFor(resolveArchNames(options, loaded.deploy)),
|
|
404
|
+
project: resolveCatalogProject(loaded.root, loaded.config.applicationId),
|
|
405
|
+
};
|
|
293
406
|
};
|
|
294
407
|
|
|
295
408
|
const synchronizeMetadataCatalogs = async (
|
|
@@ -318,41 +431,57 @@ const synchronizeMetadataCatalogs = async (
|
|
|
318
431
|
}
|
|
319
432
|
};
|
|
320
433
|
|
|
321
|
-
const
|
|
322
|
-
options
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
): Promise<
|
|
434
|
+
const buildApplication = async ({
|
|
435
|
+
options,
|
|
436
|
+
plan,
|
|
437
|
+
settings,
|
|
438
|
+
buildOutDir,
|
|
439
|
+
}: BuildApplicationRequest): Promise<StagedMetadata> => {
|
|
327
440
|
const templates = renderMetadata(settings);
|
|
328
441
|
|
|
329
|
-
if (
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
entry: options.entry,
|
|
334
|
-
vite: { root: options.cwd },
|
|
335
|
-
});
|
|
442
|
+
if (buildOutDir === null) {
|
|
443
|
+
if (plan.project !== null) {
|
|
444
|
+
compileCatalogs(plan.project, join(settings.paths.dist, LOCALE_DIRNAME));
|
|
445
|
+
}
|
|
336
446
|
|
|
337
|
-
|
|
338
|
-
} else if (project !== null) {
|
|
339
|
-
compileCatalogs(project, join(settings.paths.dist, LOCALE_DIRNAME));
|
|
447
|
+
return localizeMetadata(templates, plan.project);
|
|
340
448
|
}
|
|
341
449
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
450
|
+
info(`Building ${options.entry}`);
|
|
451
|
+
using preparedOutput = prepareBuildOutDir(settings.paths.root, buildOutDir);
|
|
452
|
+
|
|
453
|
+
await buildApp({
|
|
454
|
+
entry: options.entry,
|
|
455
|
+
configFile: options.configFile,
|
|
456
|
+
vite: { root: options.cwd, build: { outDir: preparedOutput.path, emptyOutDir: false } },
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
preparedOutput.commit();
|
|
460
|
+
await synchronizeMetadataCatalogs(settings, templates, plan.project);
|
|
461
|
+
|
|
462
|
+
return localizeMetadata(templates, plan.project);
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
const buildArchPayload = async ({
|
|
466
|
+
options,
|
|
467
|
+
plan,
|
|
468
|
+
settings,
|
|
469
|
+
metadata,
|
|
470
|
+
}: BuildPayloadRequest): Promise<DeployPayload> => {
|
|
471
|
+
validateMetadata(settings, metadata, isFlathubSubmission(settings, plan.targets));
|
|
472
|
+
const buildManifest = readBuildManifest(settings, plan.loaded);
|
|
345
473
|
|
|
346
474
|
const builtSettings: DeploySettings = {
|
|
347
475
|
...settings,
|
|
348
476
|
paths: { ...settings.paths, schemaFiles: buildManifest.schemaFiles },
|
|
349
477
|
};
|
|
350
478
|
|
|
351
|
-
const node = options.shouldPrintManifests || !isNodeRequired(targets, builtSettings)
|
|
479
|
+
const node = options.shouldPrintManifests || !isNodeRequired(plan.targets, builtSettings)
|
|
352
480
|
? null
|
|
353
481
|
: await resolveNodeRuntime(builtSettings);
|
|
354
482
|
|
|
355
|
-
const
|
|
483
|
+
const addon = await resolveStagedAddon(builtSettings);
|
|
484
|
+
const stage = stagePayload({ settings: builtSettings, node, addon, metadata });
|
|
356
485
|
info(`Staged ${String(stage.length)} files into ${displayPath(builtSettings, builtSettings.paths.stage)}`);
|
|
357
486
|
const notices = collectNotices({ settings: builtSettings, node, packages: buildManifest.packages });
|
|
358
487
|
|
|
@@ -404,50 +533,76 @@ const packTargets = async (
|
|
|
404
533
|
return artifacts;
|
|
405
534
|
};
|
|
406
535
|
|
|
407
|
-
const announce = (settings: DeploySettings,
|
|
408
|
-
const names = targets.map((target) => target.name).join(", ");
|
|
536
|
+
const announce = (settings: DeploySettings, plan: DeployPlan): void => {
|
|
537
|
+
const names = plan.targets.map((target) => target.name).join(", ");
|
|
409
538
|
const version = `${settings.versions.packageVersion}-${settings.versions.debRevision}`;
|
|
410
|
-
|
|
539
|
+
const arches = plan.arches.join(", ");
|
|
540
|
+
info(`Deploying ${settings.name} ${version} as ${settings.binaryName} (${arches}) to ${names}`);
|
|
411
541
|
};
|
|
412
542
|
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
543
|
+
const deployArch = async (request: ArchRunRequest): Promise<DeployArtifact[]> => {
|
|
544
|
+
const { options, plan, arch, metadata } = request;
|
|
545
|
+
const settings = settingsFor(plan, options, arch);
|
|
546
|
+
const payload = await buildArchPayload({ options, plan, settings, metadata });
|
|
547
|
+
const rendered = renderTargetManifests(plan.targets, payload);
|
|
418
548
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
});
|
|
549
|
+
if (options.shouldPrintManifests) {
|
|
550
|
+
const count = rendered.values().toArray().flat().length;
|
|
551
|
+
info(`Wrote ${String(count)} manifests for ${arch}, 0 packages built`);
|
|
552
|
+
|
|
553
|
+
return [];
|
|
554
|
+
}
|
|
426
555
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
shouldAnnounce: true,
|
|
430
|
-
mode: BUILD_MODE,
|
|
431
|
-
});
|
|
556
|
+
return await packTargets(rendered, payload);
|
|
557
|
+
};
|
|
432
558
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
559
|
+
const regenerate = async (options: DeployOptions, plan: DeployPlan): Promise<DeployPlan> => {
|
|
560
|
+
if (options.shouldSkipBuild) {
|
|
561
|
+
return plan;
|
|
436
562
|
}
|
|
437
563
|
|
|
438
|
-
|
|
439
|
-
|
|
564
|
+
await ensureGenerated(options.cwd, {
|
|
565
|
+
shouldAnnounce: true,
|
|
566
|
+
mode: BUILD_MODE,
|
|
567
|
+
configFile: options.configFile,
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
return await planDeploy(options);
|
|
571
|
+
};
|
|
440
572
|
|
|
573
|
+
const finish = (options: DeployOptions, settings: DeploySettings, artifacts: DeployArtifact[]): void => {
|
|
441
574
|
if (options.shouldPrintManifests) {
|
|
442
|
-
const count = rendered.values().toArray().flat().length;
|
|
443
|
-
info(`Wrote ${String(count)} manifests, 0 packages built`);
|
|
444
|
-
|
|
445
575
|
return;
|
|
446
576
|
}
|
|
447
577
|
|
|
448
|
-
const artifacts = await packTargets(rendered, payload);
|
|
449
578
|
const output = displayPath(settings, settings.paths.output);
|
|
450
579
|
info(`Deploy complete: ${String(artifacts.length)} artifacts in ${output}`);
|
|
451
580
|
};
|
|
452
581
|
|
|
582
|
+
const runDeploy = async (options: DeployOptions): Promise<void> => {
|
|
583
|
+
const planned = await planDeploy(options);
|
|
584
|
+
assertCrossBuild(planned);
|
|
585
|
+
announce(settingsFor(planned, options, planned.arches[0]), planned);
|
|
586
|
+
|
|
587
|
+
preflight({
|
|
588
|
+
plan: planned,
|
|
589
|
+
settings: settingsFor(planned, options, planned.arches[0]),
|
|
590
|
+
shouldPrintManifests: options.shouldPrintManifests,
|
|
591
|
+
shouldSkipBuild: options.shouldSkipBuild,
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
const plan = await regenerate(options, planned);
|
|
595
|
+
const settings = settingsFor(plan, options, plan.arches[0]);
|
|
596
|
+
const buildOutDir = options.shouldSkipBuild ? null : resolveBuildOutDir(settings.paths.root, settings.paths.dist);
|
|
597
|
+
prepareDeployOutDir(settings.paths.root, settings.paths.outDir);
|
|
598
|
+
const metadata = await buildApplication({ options, plan, settings, buildOutDir });
|
|
599
|
+
const artifacts: DeployArtifact[] = [];
|
|
600
|
+
|
|
601
|
+
for (const arch of plan.arches) {
|
|
602
|
+
artifacts.push(...await deployArch({ options, plan, arch, metadata }));
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
finish(options, settings, artifacts);
|
|
606
|
+
};
|
|
607
|
+
|
|
453
608
|
export { runDeploy };
|
|
@@ -1,18 +1,50 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { sortStrings } from "@gtkx/utils";
|
|
2
|
+
import type { DeployArch, DeployArchName } from "../types.js";
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
+
const EM_X86_64 = 62;
|
|
5
|
+
const EM_AARCH64 = 183;
|
|
6
|
+
|
|
7
|
+
const ARCH_TABLE: Record<DeployArchName, DeployArch> = {
|
|
4
8
|
arm64: { deb: "arm64", rpm: "aarch64", flatpak: "aarch64", appimage: "aarch64", node: "arm64" },
|
|
5
9
|
x64: { deb: "amd64", rpm: "x86_64", flatpak: "x86_64", appimage: "x86_64", node: "x64" },
|
|
6
10
|
};
|
|
7
11
|
|
|
8
|
-
const
|
|
9
|
-
|
|
12
|
+
const ELF_MACHINE_TABLE: Record<DeployArchName, number> = {
|
|
13
|
+
arm64: EM_AARCH64,
|
|
14
|
+
x64: EM_X86_64,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const KNOWN_ARCH_NAMES = sortStrings(Object.keys(ARCH_TABLE)).join(", ");
|
|
18
|
+
|
|
19
|
+
const isArchName = (name: string): name is DeployArchName => Object.hasOwn(ARCH_TABLE, name);
|
|
20
|
+
|
|
21
|
+
const assertKnownArch = (name: string): DeployArchName => {
|
|
22
|
+
if (!isArchName(name)) {
|
|
23
|
+
throw new Error(`Cannot deploy for ${name}: only ${KNOWN_ARCH_NAMES} are supported`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return name;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const resolveArch = (name: DeployArchName): DeployArch => ARCH_TABLE[name];
|
|
30
|
+
|
|
31
|
+
const hostArchName = (): DeployArchName => assertKnownArch(process.arch);
|
|
32
|
+
|
|
33
|
+
const isHostArch = (name: DeployArchName): boolean => name === hostArchName();
|
|
34
|
+
|
|
35
|
+
const elfMachineFor = (name: DeployArchName): number => ELF_MACHINE_TABLE[name];
|
|
36
|
+
|
|
37
|
+
const parseArchList = (value: string): string[] => value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
38
|
+
|
|
39
|
+
const archesFor = (names: string[]): [DeployArchName, ...DeployArchName[]] => {
|
|
40
|
+
const requested = sortStrings(new Set(names.map((name) => assertKnownArch(name.trim()))));
|
|
41
|
+
const [first, ...rest] = requested.map((name) => assertKnownArch(name));
|
|
10
42
|
|
|
11
|
-
if (
|
|
12
|
-
throw new Error(`Cannot deploy
|
|
43
|
+
if (first === undefined) {
|
|
44
|
+
throw new Error(`Cannot deploy without an architecture; choose from ${KNOWN_ARCH_NAMES}`);
|
|
13
45
|
}
|
|
14
46
|
|
|
15
|
-
return
|
|
47
|
+
return [first, ...rest];
|
|
16
48
|
};
|
|
17
49
|
|
|
18
|
-
export { resolveArch };
|
|
50
|
+
export { archesFor, elfMachineFor, hostArchName, isHostArch, KNOWN_ARCH_NAMES, parseArchList, resolveArch };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Config } from "@gtkx/config";
|
|
2
|
+
import { isPathInside, isRecord, sortStrings, toPosixPath } from "@gtkx/utils";
|
|
2
3
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
|
-
import { isAbsolute, join, resolve } from "node:path";
|
|
4
|
+
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
4
5
|
import type { DeploySettings } from "../types.js";
|
|
5
6
|
import {
|
|
6
7
|
BUILD_MANIFEST_FILENAME,
|
|
7
8
|
BUILD_MANIFEST_FORMAT_VERSION,
|
|
8
9
|
BUILD_MANIFEST_GENERATOR,
|
|
9
10
|
type BuildManifest,
|
|
11
|
+
configDigest,
|
|
10
12
|
type RecordedPackage,
|
|
11
13
|
} from "../../internal/build-manifest.js";
|
|
12
14
|
import {
|
|
@@ -20,6 +22,11 @@ type ResolvedBuildManifest = {
|
|
|
20
22
|
schemaFiles: string[];
|
|
21
23
|
};
|
|
22
24
|
|
|
25
|
+
type ExpectedBuildConfig = {
|
|
26
|
+
config: Config;
|
|
27
|
+
configFile: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
23
30
|
const invalidManifest = (path: string): Error =>
|
|
24
31
|
new Error(`Cannot deploy: ${path} is not a valid GTKX build manifest. Run \`gtkx build\` again.`);
|
|
25
32
|
|
|
@@ -51,6 +58,8 @@ const parseBuildManifest = (value: unknown, path: string): BuildManifest => {
|
|
|
51
58
|
!isRecord(value) ||
|
|
52
59
|
value.generator !== BUILD_MANIFEST_GENERATOR ||
|
|
53
60
|
value.formatVersion !== BUILD_MANIFEST_FORMAT_VERSION ||
|
|
61
|
+
typeof value.configFile !== "string" ||
|
|
62
|
+
typeof value.configDigest !== "string" ||
|
|
54
63
|
!Array.isArray(value.schemas) ||
|
|
55
64
|
!Array.isArray(value.packages)
|
|
56
65
|
) {
|
|
@@ -62,6 +71,8 @@ const parseBuildManifest = (value: unknown, path: string): BuildManifest => {
|
|
|
62
71
|
return {
|
|
63
72
|
generator: BUILD_MANIFEST_GENERATOR,
|
|
64
73
|
formatVersion: BUILD_MANIFEST_FORMAT_VERSION,
|
|
74
|
+
configFile: value.configFile,
|
|
75
|
+
configDigest: value.configDigest,
|
|
65
76
|
schemas: recordedSchemas(value.schemas, path),
|
|
66
77
|
packages: packages.map((entry) => recordedPackage(entry, path)),
|
|
67
78
|
};
|
|
@@ -91,7 +102,20 @@ const resolveRecordedSchema = (root: string, manifestPath: string, entry: string
|
|
|
91
102
|
return filePath;
|
|
92
103
|
};
|
|
93
104
|
|
|
94
|
-
const
|
|
105
|
+
const assertBuildConfig = (
|
|
106
|
+
settings: DeploySettings,
|
|
107
|
+
manifestPath: string,
|
|
108
|
+
manifest: BuildManifest,
|
|
109
|
+
expected: ExpectedBuildConfig,
|
|
110
|
+
): void => {
|
|
111
|
+
const expectedFile = toPosixPath(relative(settings.paths.root, expected.configFile));
|
|
112
|
+
|
|
113
|
+
if (manifest.configFile !== expectedFile || manifest.configDigest !== configDigest(expected.config)) {
|
|
114
|
+
throw new Error(`Cannot deploy: ${manifestPath} was built from a different GTKX configuration.`);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const readBuildManifest = (settings: DeploySettings, expected: ExpectedBuildConfig): ResolvedBuildManifest => {
|
|
95
119
|
const manifestPath = join(settings.paths.dist, BUILD_MANIFEST_FILENAME);
|
|
96
120
|
|
|
97
121
|
if (!existsSync(manifestPath)) {
|
|
@@ -100,6 +124,7 @@ const readBuildManifest = (settings: DeploySettings): ResolvedBuildManifest => {
|
|
|
100
124
|
|
|
101
125
|
const parsed: unknown = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
102
126
|
const manifest = parseBuildManifest(parsed, manifestPath);
|
|
127
|
+
assertBuildConfig(settings, manifestPath, manifest, expected);
|
|
103
128
|
const files = manifest.schemas.map((entry) => resolveRecordedSchema(settings.paths.root, manifestPath, entry));
|
|
104
129
|
const unique = sortStrings(new Set(files));
|
|
105
130
|
assertUniqueSchemaBasenames(unique);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
import { normalize, resolve } from "node:path";
|
|
1
3
|
import type { DeployConfig, DeployExtraFile } from "../types.js";
|
|
2
4
|
|
|
3
5
|
type ExtraFiles = NonNullable<DeployConfig["extraFiles"]>;
|
|
@@ -5,17 +7,41 @@ type ExtraFileEntry = NonNullable<ExtraFiles[string]>;
|
|
|
5
7
|
|
|
6
8
|
const OCTAL_RADIX = 8;
|
|
7
9
|
|
|
10
|
+
const assertSourceFile = (root: string, file: DeployExtraFile): void => {
|
|
11
|
+
const source = resolve(root, file.source);
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
if (statSync(source).isFile()) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
} catch {
|
|
18
|
+
throw new Error(`Cannot install "${file.destination}": its source file "${file.source}" does not exist`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
throw new Error(`Cannot install "${file.destination}": its source "${file.source}" is not a file`);
|
|
22
|
+
};
|
|
23
|
+
|
|
8
24
|
const resolveExtraFile = (destination: string, entry: ExtraFileEntry): DeployExtraFile => {
|
|
25
|
+
const normalizedDestination = normalize(destination);
|
|
26
|
+
|
|
9
27
|
if (typeof entry === "string") {
|
|
10
|
-
return { destination, source: entry, mode: null };
|
|
28
|
+
return { destination: normalizedDestination, source: entry, mode: null };
|
|
11
29
|
}
|
|
12
30
|
|
|
13
31
|
const mode = entry.mode === undefined ? null : Number.parseInt(entry.mode, OCTAL_RADIX);
|
|
14
32
|
|
|
15
|
-
return { destination, source: entry.source, mode };
|
|
33
|
+
return { destination: normalizedDestination, source: entry.source, mode };
|
|
16
34
|
};
|
|
17
35
|
|
|
18
|
-
const resolveExtraFiles = (deploy: DeployConfig): DeployExtraFile[] =>
|
|
19
|
-
Object.entries(deploy.extraFiles ?? {})
|
|
36
|
+
const resolveExtraFiles = (root: string, deploy: DeployConfig): DeployExtraFile[] => {
|
|
37
|
+
const files = Object.entries(deploy.extraFiles ?? {})
|
|
38
|
+
.map(([destination, entry]) => resolveExtraFile(destination, entry));
|
|
39
|
+
|
|
40
|
+
for (const file of files) {
|
|
41
|
+
assertSourceFile(root, file);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return files;
|
|
45
|
+
};
|
|
20
46
|
|
|
21
47
|
export { resolveExtraFiles };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Config } from "@gtkx/config";
|
|
2
2
|
import type {
|
|
3
|
+
DeployArchName,
|
|
3
4
|
DeployConfig,
|
|
4
5
|
DeployDesktopAction,
|
|
5
6
|
DeployDeveloper,
|
|
@@ -31,6 +32,8 @@ import { resolveVersions } from "./version.js";
|
|
|
31
32
|
type SettingsRequest = {
|
|
32
33
|
root: string;
|
|
33
34
|
config: Config;
|
|
35
|
+
configFile: string;
|
|
36
|
+
arch: DeployArchName;
|
|
34
37
|
outDirOverride?: string | undefined;
|
|
35
38
|
now?: Date | undefined;
|
|
36
39
|
};
|
|
@@ -174,18 +177,20 @@ const resolveDeploySettings = (request: SettingsRequest): DeploySettings => {
|
|
|
174
177
|
const deploy = core.identity.deploy;
|
|
175
178
|
|
|
176
179
|
return {
|
|
180
|
+
configFile: request.configFile,
|
|
177
181
|
...identitySlice(core),
|
|
178
182
|
...metadataSlice(request.root, core),
|
|
179
183
|
...desktopSlice(deploy),
|
|
180
|
-
extraFiles: resolveExtraFiles(deploy),
|
|
184
|
+
extraFiles: resolveExtraFiles(request.root, deploy),
|
|
181
185
|
versions: core.versions,
|
|
182
|
-
arch: resolveArch(),
|
|
186
|
+
arch: resolveArch(request.arch),
|
|
183
187
|
paths: resolvePaths({
|
|
184
188
|
root: request.root,
|
|
185
189
|
deploy,
|
|
186
190
|
applicationIcon: request.config.applicationIcon,
|
|
187
191
|
applicationId: request.config.applicationId,
|
|
188
192
|
outDirOverride: request.outDirOverride,
|
|
193
|
+
arch: request.arch,
|
|
189
194
|
}),
|
|
190
195
|
...resolveLibraries(request.root, request.config),
|
|
191
196
|
deploy,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
readGeneratedLibraries,
|
|
6
6
|
resolveStore,
|
|
7
7
|
} from "@gtkx/codegen";
|
|
8
|
+
import { resolveBoundLibraries } from "@gtkx/codegen/internal";
|
|
8
9
|
|
|
9
10
|
type ResolvedLibraries = {
|
|
10
11
|
libraries: string[];
|
|
@@ -21,7 +22,7 @@ const generatedLibraries = (root: string): GeneratedLibraries | null => {
|
|
|
21
22
|
|
|
22
23
|
const resolveLibraries = (root: string, config: Config): ResolvedLibraries => {
|
|
23
24
|
const generated = generatedLibraries(root);
|
|
24
|
-
const libraries = generated?.libraries ?? expandLibraries(config.libraries);
|
|
25
|
+
const libraries = resolveBoundLibraries(generated?.libraries ?? expandLibraries(config.libraries));
|
|
25
26
|
const deploy = config.deploy ?? {};
|
|
26
27
|
|
|
27
28
|
return {
|