@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
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { MINIMUM_NODE_VERSION } from "@gtkx/config/internal";
|
|
2
|
+
import { info, tryResolveExecutable, warn } from "@gtkx/utils";
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { chmodSync, copyFileSync, existsSync, mkdirSync, statSync } from "node:fs";
|
|
3
5
|
import { join, resolve } from "node:path";
|
|
4
|
-
import type { DeploySettings, NodeRuntime } from "../types.js";
|
|
6
|
+
import type { DeployConfig, DeploySettings, NodeRuntime } from "../types.js";
|
|
5
7
|
import { runCliTool } from "../../internal/run-cli-tool.js";
|
|
8
|
+
import { elfMachineFor, hostArchName } from "../settings/arch.js";
|
|
6
9
|
import { downloadNode } from "./download.js";
|
|
7
|
-
import { readElfInfo } from "./elf.js";
|
|
10
|
+
import { type ElfInfo, readElfInfo, readOptionalElfInfo } from "./elf.js";
|
|
8
11
|
import { assertPortableNode } from "./guard.js";
|
|
9
12
|
import { licenseBesideNode } from "./license.js";
|
|
10
13
|
|
|
@@ -13,13 +16,92 @@ type StagedRuntime = {
|
|
|
13
16
|
licenseFile: string | null;
|
|
14
17
|
};
|
|
15
18
|
|
|
19
|
+
type NodeSource = "download" | "host" | "path";
|
|
20
|
+
|
|
16
21
|
const BYTES_PER_MIB = 1024 * 1024;
|
|
17
22
|
const EXECUTABLE_MODE = 0o755;
|
|
18
23
|
const NODE_FILENAME = "node";
|
|
24
|
+
const NODE_VERSION_PATTERN = /^v?(\d+)\.(\d+)\.(\d+)$/;
|
|
25
|
+
const VERSION_PROBE_TIMEOUT_MS = 10_000;
|
|
26
|
+
const VERSION_PROBE_MAX_BUFFER = 1024;
|
|
27
|
+
|
|
28
|
+
const nodeSourceFor = (settings: DeploySettings): NodeSource => settings.deploy.node?.source ?? "download";
|
|
29
|
+
|
|
30
|
+
const parseNodeVersion = (value: string, subject: string): { parts: number[]; version: string } => {
|
|
31
|
+
const match = NODE_VERSION_PATTERN.exec(value.trim());
|
|
32
|
+
|
|
33
|
+
if (match === null) {
|
|
34
|
+
throw new Error(`Cannot determine the Node.js version for ${subject}: expected a version such as 26.7.0`);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const parts = match.slice(1).map(Number);
|
|
38
|
+
|
|
39
|
+
return { parts, version: parts.map(String).join(".") };
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const compareVersions = (left: number[], right: number[]): number => {
|
|
43
|
+
for (let index = 0; index < Math.max(left.length, right.length); index += 1) {
|
|
44
|
+
const difference = (left[index] ?? 0) - (right[index] ?? 0);
|
|
45
|
+
|
|
46
|
+
if (difference !== 0) {
|
|
47
|
+
return difference;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return 0;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const supportedNodeVersion = (value: string, subject: string): string => {
|
|
55
|
+
const parsed = parseNodeVersion(value, subject);
|
|
56
|
+
const minimum = parseNodeVersion(MINIMUM_NODE_VERSION, "GTKX");
|
|
57
|
+
|
|
58
|
+
if (compareVersions(parsed.parts, minimum.parts) < 0) {
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Cannot bundle Node.js ${parsed.version} for ${subject}: GTKX requires ${MINIMUM_NODE_VERSION} or newer`,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return parsed.version;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const probeNodeVersion = (path: string): string => {
|
|
68
|
+
try {
|
|
69
|
+
const output = execFileSync(path, ["--version"], {
|
|
70
|
+
encoding: "utf8",
|
|
71
|
+
env: { ...process.env, NODE_OPTIONS: "" },
|
|
72
|
+
maxBuffer: VERSION_PROBE_MAX_BUFFER,
|
|
73
|
+
timeout: VERSION_PROBE_TIMEOUT_MS,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
return supportedNodeVersion(output, path);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
if (error instanceof Error && error.message.startsWith("Cannot bundle Node.js")) {
|
|
79
|
+
throw error;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
throw new Error(`Cannot determine the Node.js version from ${path}`, { cause: error });
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const assertExpectedVersion = (configured: string | undefined, actual: string, source: NodeSource): string => {
|
|
87
|
+
if (configured === undefined) {
|
|
88
|
+
return actual;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const expected = parseNodeVersion(configured, `deploy.node.source: "${source}"`).version;
|
|
92
|
+
|
|
93
|
+
if (expected !== actual) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`The Node.js runtime from deploy.node.source "${source}" is ${actual}, not the configured ${expected}`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return actual;
|
|
100
|
+
};
|
|
19
101
|
|
|
20
102
|
const sourcePathFor = (settings: DeploySettings): string => {
|
|
21
103
|
const node = settings.deploy.node ?? {};
|
|
22
|
-
const source =
|
|
104
|
+
const source = nodeSourceFor(settings);
|
|
23
105
|
|
|
24
106
|
if (source === "host") {
|
|
25
107
|
return process.execPath;
|
|
@@ -32,6 +114,36 @@ const sourcePathFor = (settings: DeploySettings): string => {
|
|
|
32
114
|
return resolve(settings.paths.root, node.path);
|
|
33
115
|
};
|
|
34
116
|
|
|
117
|
+
const assertPortableRuntimeSource = (settings: DeploySettings): void => {
|
|
118
|
+
const source = nodeSourceFor(settings);
|
|
119
|
+
|
|
120
|
+
if (source === "download") {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const sourcePath = sourcePathFor(settings);
|
|
125
|
+
const elf = existsSync(sourcePath) ? readOptionalElfInfo(sourcePath) : null;
|
|
126
|
+
|
|
127
|
+
if (elf !== null) {
|
|
128
|
+
assertPortableNode(elf, source);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const resolveNodeVersion = (settings: DeploySettings): string => {
|
|
133
|
+
const node = settings.deploy.node ?? {};
|
|
134
|
+
const source = nodeSourceFor(settings);
|
|
135
|
+
|
|
136
|
+
if (source === "download") {
|
|
137
|
+
return supportedNodeVersion(node.version ?? MINIMUM_NODE_VERSION, 'deploy.node.source: "download"');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const actual = source === "host"
|
|
141
|
+
? supportedNodeVersion(process.versions.node, 'deploy.node.source: "host"')
|
|
142
|
+
: probeNodeVersion(sourcePathFor(settings));
|
|
143
|
+
|
|
144
|
+
return assertExpectedVersion(node.version, actual, source);
|
|
145
|
+
};
|
|
146
|
+
|
|
35
147
|
const didStripBinary = (path: string): boolean => {
|
|
36
148
|
if (tryResolveExecutable("strip") === undefined) {
|
|
37
149
|
return false;
|
|
@@ -60,27 +172,51 @@ const stageDownloadedNode = async (settings: DeploySettings, version: string): P
|
|
|
60
172
|
return downloaded;
|
|
61
173
|
};
|
|
62
174
|
|
|
63
|
-
const stageFromSource = async (
|
|
175
|
+
const stageFromSource = async (
|
|
176
|
+
settings: DeploySettings,
|
|
177
|
+
version: string,
|
|
178
|
+
source: NodeSource,
|
|
179
|
+
): Promise<StagedRuntime> => {
|
|
64
180
|
if (source === "download") {
|
|
65
181
|
return stageDownloadedNode(settings, version);
|
|
66
182
|
}
|
|
67
183
|
|
|
68
184
|
const sourcePath = sourcePathFor(settings);
|
|
69
|
-
assertPortableNode(readElfInfo(sourcePath), source);
|
|
70
185
|
|
|
71
186
|
return { path: stageNode(settings, sourcePath), licenseFile: licenseBesideNode(sourcePath) };
|
|
72
187
|
};
|
|
73
188
|
|
|
189
|
+
type DeployNodeConfig = NonNullable<DeployConfig["node"]>;
|
|
190
|
+
|
|
191
|
+
const shouldStripRuntime = (settings: DeploySettings, node: DeployNodeConfig, elf: ElfInfo): boolean => {
|
|
192
|
+
if (node.shouldStrip === false) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (elf.machine === elfMachineFor(hostArchName())) {
|
|
197
|
+
return true;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
warn(
|
|
201
|
+
`Skipping \`strip\` on the bundled Node.js: it was built for ${settings.arch.node} and \`strip\` reads ` +
|
|
202
|
+
`only ${hostArchName()}. The ${settings.arch.node} packages carry an unstripped runtime.`,
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
return false;
|
|
206
|
+
};
|
|
207
|
+
|
|
74
208
|
const resolveNodeRuntime = async (settings: DeploySettings): Promise<NodeRuntime> => {
|
|
75
209
|
const node = settings.deploy.node ?? {};
|
|
76
|
-
const source =
|
|
77
|
-
const version =
|
|
210
|
+
const source = nodeSourceFor(settings);
|
|
211
|
+
const version = resolveNodeVersion(settings);
|
|
78
212
|
const staged = await stageFromSource(settings, version, source);
|
|
79
|
-
const isStripped = node.shouldStrip === false ? false : didStripBinary(staged.path);
|
|
80
213
|
const elf = readElfInfo(staged.path);
|
|
81
|
-
|
|
214
|
+
assertPortableNode(elf, source);
|
|
215
|
+
const isStripped = shouldStripRuntime(settings, node, elf) && didStripBinary(staged.path);
|
|
216
|
+
const glibcMinimum = elf.glibcMinimum ?? "unknown";
|
|
217
|
+
info(`Bundled Node.js v${version} (${megabytes(staged.path)} MiB, runtime glibc >= ${glibcMinimum})`);
|
|
82
218
|
|
|
83
219
|
return { ...staged, version, glibcMinimum: elf.glibcMinimum, isStripped };
|
|
84
220
|
};
|
|
85
221
|
|
|
86
|
-
export { resolveNodeRuntime, sourcePathFor };
|
|
222
|
+
export { assertPortableRuntimeSource, resolveNodeRuntime, resolveNodeVersion, sourcePathFor };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const GLIBC_SONAMES = [
|
|
2
|
+
"ld-linux-aarch64.so.1",
|
|
3
|
+
"ld-linux-x86-64.so.2",
|
|
4
|
+
"libc.so.6",
|
|
5
|
+
"libdl.so.2",
|
|
6
|
+
"libm.so.6",
|
|
7
|
+
"libpthread.so.0",
|
|
8
|
+
"librt.so.1",
|
|
9
|
+
] as const;
|
|
10
|
+
|
|
11
|
+
const PACKAGED_SONAMES = ["libatomic.so.1", "libgcc_s.so.1", "libstdc++.so.6"] as const;
|
|
12
|
+
|
|
13
|
+
type PackagedSoname = (typeof PACKAGED_SONAMES)[number];
|
|
14
|
+
|
|
15
|
+
const RUNTIME_SONAMES: Set<string> = new Set([...GLIBC_SONAMES, ...PACKAGED_SONAMES]);
|
|
16
|
+
|
|
17
|
+
export { PACKAGED_SONAMES, type PackagedSoname, RUNTIME_SONAMES };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { warn } from "@gtkx/utils";
|
|
2
2
|
import type { DeploySettings, NodeRuntime, NoticeSection } from "../types.js";
|
|
3
|
-
import { sourcePathFor } from "../node-runtime/index.js";
|
|
3
|
+
import { resolveNodeVersion, sourcePathFor } from "../node-runtime/index.js";
|
|
4
4
|
import { licenseBesideNode } from "../node-runtime/license.js";
|
|
5
5
|
import { NODE_FILENAME } from "../payload/launcher.js";
|
|
6
6
|
import { nodeLicenseDestination } from "../payload/stage.js";
|
|
@@ -32,7 +32,7 @@ const MISSING_LICENSE =
|
|
|
32
32
|
const isSourceMode = (settings: DeploySettings): boolean => settings.deploy.flatpak?.mode === "source";
|
|
33
33
|
|
|
34
34
|
const versionFor = (settings: DeploySettings, node: NodeRuntime | null): string =>
|
|
35
|
-
node?.version ?? settings
|
|
35
|
+
node?.version ?? resolveNodeVersion(settings);
|
|
36
36
|
|
|
37
37
|
const licenseFileFor = (settings: DeploySettings, node: NodeRuntime | null): string | null => {
|
|
38
38
|
if (node !== null) {
|
|
@@ -2,6 +2,8 @@ import type { DeploySettings } from "../types.js";
|
|
|
2
2
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
3
3
|
|
|
4
4
|
const NODE_FILENAME = "node";
|
|
5
|
+
const SHELL_SINGLE_QUOTE = "'";
|
|
6
|
+
const SHELL_SINGLE_QUOTE_ESCAPE = "'\"'\"'";
|
|
5
7
|
|
|
6
8
|
const compileCacheLines = (binaryName: string): string[] => [
|
|
7
9
|
"cache_home=${XDG_CACHE_HOME:-${HOME:-/tmp}/.cache}",
|
|
@@ -9,6 +11,22 @@ const compileCacheLines = (binaryName: string): string[] => [
|
|
|
9
11
|
"export NODE_COMPILE_CACHE",
|
|
10
12
|
];
|
|
11
13
|
|
|
14
|
+
const shellQuote = (value: string): string =>
|
|
15
|
+
SHELL_SINGLE_QUOTE + value.split(SHELL_SINGLE_QUOTE).join(SHELL_SINGLE_QUOTE_ESCAPE) + SHELL_SINGLE_QUOTE;
|
|
16
|
+
|
|
17
|
+
const launcherEnvLines = (settings: DeploySettings): string[] =>
|
|
18
|
+
Object.entries(settings.deploy.launcherEnv ?? {})
|
|
19
|
+
.toSorted(([left], [right]) => left.localeCompare(right))
|
|
20
|
+
.map(([name, value]) => `export ${name}=${shellQuote(value)}`);
|
|
21
|
+
|
|
22
|
+
const launcherCommand = (settings: DeploySettings, libDir: string): string =>
|
|
23
|
+
[
|
|
24
|
+
`"${libDir}/${NODE_FILENAME}"`,
|
|
25
|
+
...(settings.deploy.nodeFlags ?? []).map((flag) => shellQuote(flag)),
|
|
26
|
+
`"${libDir}/${BUNDLE_FILENAME}"`,
|
|
27
|
+
'"$@"',
|
|
28
|
+
].join(" ");
|
|
29
|
+
|
|
12
30
|
const renderLauncher = (settings: DeploySettings): string => {
|
|
13
31
|
const libDir = `$prefix/lib/${settings.binaryName}`;
|
|
14
32
|
const shouldUseCompileCache = settings.deploy.node?.shouldUseCompileCache !== false;
|
|
@@ -21,7 +39,8 @@ const renderLauncher = (settings: DeploySettings): string => {
|
|
|
21
39
|
'GTKX_LOCALE_DIR="$prefix/share/locale"',
|
|
22
40
|
"export GTKX_LOCALE_DIR",
|
|
23
41
|
...(shouldUseCompileCache ? compileCacheLines(settings.binaryName) : []),
|
|
24
|
-
|
|
42
|
+
...launcherEnvLines(settings),
|
|
43
|
+
`exec ${launcherCommand(settings, libDir)}`,
|
|
25
44
|
"",
|
|
26
45
|
].join("\n");
|
|
27
46
|
};
|
|
@@ -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 type { DeploySettings, DeployTargetName, NodeRuntime, NoticeSection, StagedFile } from "../types.js";
|
|
@@ -8,7 +8,10 @@ import { listFilesRecursive } from "../../internal/list-files.js";
|
|
|
8
8
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
9
9
|
import { renderCopyright } from "../freedesktop/copyright.js";
|
|
10
10
|
import { renderDbusService } from "../freedesktop/dbus-service.js";
|
|
11
|
+
import { BINDING_FILENAME } from "../native-addon.js";
|
|
12
|
+
import { readOptionalElfInfo } from "../node-runtime/elf.js";
|
|
11
13
|
import { renderNotices } from "../notices/render.js";
|
|
14
|
+
import { elfMachineFor } from "../settings/arch.js";
|
|
12
15
|
import { copyInto, EXECUTABLE_MODE, executableModeFor, writeInto } from "./copy-tree.js";
|
|
13
16
|
import { stageIcons } from "./icons.js";
|
|
14
17
|
import { NODE_FILENAME, renderLauncher } from "./launcher.js";
|
|
@@ -17,6 +20,7 @@ import { stageSchemas } from "./schemas.js";
|
|
|
17
20
|
type StageRequest = {
|
|
18
21
|
settings: DeploySettings;
|
|
19
22
|
node: NodeRuntime | null;
|
|
23
|
+
addon: string | null;
|
|
20
24
|
metadata: StagedMetadata;
|
|
21
25
|
};
|
|
22
26
|
|
|
@@ -67,6 +71,29 @@ const stageRuntimeFiles = (settings: DeploySettings, root: string): StagedFile[]
|
|
|
67
71
|
.map((file) => copyInto(root, join(libDirFor(settings), file.rel), file.absPath));
|
|
68
72
|
};
|
|
69
73
|
|
|
74
|
+
const stageAddon = (settings: DeploySettings, root: string, addon: string | null): StagedFile[] =>
|
|
75
|
+
addon === null ? [] : [copyInto(root, join(libDirFor(settings), BINDING_FILENAME), addon)];
|
|
76
|
+
|
|
77
|
+
const architectureMismatch = (settings: DeploySettings, file: StagedFile): Error =>
|
|
78
|
+
new Error(
|
|
79
|
+
`Cannot deploy ${file.rel} for ${settings.arch.node}: it was built for another architecture. ` +
|
|
80
|
+
"Run `gtkx build` again, or drop --skip-build.",
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
const assertStagedArchitecture = (settings: DeploySettings, staged: StagedFile[]): void => {
|
|
84
|
+
const expected = elfMachineFor(settings.arch.node);
|
|
85
|
+
const lib = libDirFor(settings);
|
|
86
|
+
const checked = new Set([join(lib, BINDING_FILENAME), join(lib, NODE_FILENAME)]);
|
|
87
|
+
|
|
88
|
+
const binaries = staged.filter((entry) => checked.has(entry.rel));
|
|
89
|
+
|
|
90
|
+
for (const file of binaries) {
|
|
91
|
+
if (readOptionalElfInfo(file.abs)?.machine !== expected) {
|
|
92
|
+
throw architectureMismatch(settings, file);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
70
97
|
const stageCatalogs = (settings: DeploySettings, root: string): StagedFile[] =>
|
|
71
98
|
listFilesRecursive(join(settings.paths.dist, LOCALE_DIRNAME))
|
|
72
99
|
.map((file) => copyInto(root, join(SHARE_LOCALE, file.rel), file.absPath));
|
|
@@ -82,9 +109,48 @@ const stageMetadata = (settings: DeploySettings, root: string, metadata: StagedM
|
|
|
82
109
|
: [writeInto(root, join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`), metadata.mimePackage)]),
|
|
83
110
|
];
|
|
84
111
|
|
|
85
|
-
const
|
|
112
|
+
const generatedMetadataKind = (
|
|
113
|
+
settings: DeploySettings,
|
|
114
|
+
metadata: StagedMetadata,
|
|
115
|
+
destination: string,
|
|
116
|
+
): string | null => {
|
|
117
|
+
if (destination === join(SHARE_APPLICATIONS, `${settings.applicationId}.desktop`)) {
|
|
118
|
+
return "desktop entry";
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (destination === join(SHARE_METAINFO, `${settings.applicationId}.metainfo.xml`)) {
|
|
122
|
+
return "metainfo";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (
|
|
126
|
+
metadata.mimePackage !== null &&
|
|
127
|
+
destination === join(SHARE_MIME_PACKAGES, `${settings.applicationId}.xml`)
|
|
128
|
+
) {
|
|
129
|
+
return "MIME package";
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return null;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const warnMetadataCollision = (
|
|
136
|
+
settings: DeploySettings,
|
|
137
|
+
metadata: StagedMetadata,
|
|
138
|
+
file: DeploySettings["extraFiles"][number],
|
|
139
|
+
): void => {
|
|
140
|
+
const kind = generatedMetadataKind(settings, metadata, file.destination);
|
|
141
|
+
|
|
142
|
+
if (kind !== null) {
|
|
143
|
+
warn(
|
|
144
|
+
`extraFiles source "${file.source}" targeting "${file.destination}" is overridden by the ` +
|
|
145
|
+
`GTKX-generated ${kind}`,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const stageExtraFiles = (settings: DeploySettings, root: string, metadata: StagedMetadata): StagedFile[] =>
|
|
86
151
|
settings.extraFiles.map((file) => {
|
|
87
152
|
const source = resolve(settings.paths.root, file.source);
|
|
153
|
+
warnMetadataCollision(settings, metadata, file);
|
|
88
154
|
|
|
89
155
|
return copyInto(root, file.destination, source, file.mode ?? executableModeFor(source));
|
|
90
156
|
});
|
|
@@ -99,20 +165,25 @@ const byRelativePath = (files: StagedFile[]): StagedFile[] => {
|
|
|
99
165
|
return sortStringsBy(latest.values(), (file) => file.rel);
|
|
100
166
|
};
|
|
101
167
|
|
|
102
|
-
const stagePayload = ({ settings, node, metadata }: StageRequest): StagedFile[] => {
|
|
168
|
+
const stagePayload = ({ settings, node, addon, metadata }: StageRequest): StagedFile[] => {
|
|
103
169
|
const root = settings.paths.stage;
|
|
104
170
|
rmSync(root, { recursive: true, force: true, maxRetries: 5 });
|
|
105
171
|
|
|
106
|
-
|
|
172
|
+
const staged = byRelativePath([
|
|
107
173
|
writeInto(root, join("bin", settings.binaryName), renderLauncher(settings), EXECUTABLE_MODE),
|
|
108
174
|
...stageNodeBinary(settings, root, node),
|
|
109
175
|
...stageRuntimeFiles(settings, root),
|
|
176
|
+
...stageAddon(settings, root, addon),
|
|
110
177
|
...stageCatalogs(settings, root),
|
|
178
|
+
...stageExtraFiles(settings, root, metadata),
|
|
111
179
|
...stageMetadata(settings, root, metadata),
|
|
112
180
|
...stageIcons(settings, root),
|
|
113
181
|
...stageSchemas(settings, root),
|
|
114
|
-
...stageExtraFiles(settings, root),
|
|
115
182
|
]);
|
|
183
|
+
|
|
184
|
+
assertStagedArchitecture(settings, staged);
|
|
185
|
+
|
|
186
|
+
return staged;
|
|
116
187
|
};
|
|
117
188
|
|
|
118
189
|
const withoutDbusActivation = (desktopEntry: string): string =>
|