@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,9 +1,11 @@
|
|
|
1
1
|
import type { Config } from "@gtkx/config";
|
|
2
2
|
import { isPathInside } from "@gtkx/utils";
|
|
3
|
-
import { statSync } from "node:fs";
|
|
4
|
-
import { join, resolve } from "node:path";
|
|
5
|
-
import type { DeployConfig, DeployPaths } from "../types.js";
|
|
3
|
+
import { lstatSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join, relative, resolve, sep } from "node:path";
|
|
5
|
+
import type { DeployArchName, DeployConfig, DeployPaths } from "../types.js";
|
|
6
|
+
import { DEFAULT_DEPLOY_OUT_DIR } from "../../internal/deploy-out-dir.js";
|
|
6
7
|
import { resolveApplicationIcon } from "../../internal/icon-path.js";
|
|
8
|
+
import { prepareOutputDirectory, readRegularFile } from "../../internal/output-directory.js";
|
|
7
9
|
|
|
8
10
|
type PathsRequest = {
|
|
9
11
|
root: string;
|
|
@@ -11,23 +13,87 @@ type PathsRequest = {
|
|
|
11
13
|
applicationIcon: Config["applicationIcon"];
|
|
12
14
|
applicationId: Config["applicationId"];
|
|
13
15
|
outDirOverride: string | undefined;
|
|
16
|
+
arch: DeployArchName;
|
|
14
17
|
};
|
|
15
18
|
|
|
16
|
-
const DEFAULT_OUT_DIR = "build";
|
|
17
19
|
const DIST_DIR = "dist";
|
|
20
|
+
const DEPLOY_MARKER_FILENAME = ".gtkx-deploy.json";
|
|
21
|
+
const DEPLOY_MARKER = `${JSON.stringify({ generator: "gtkx-deploy", formatVersion: 1 })}\n`;
|
|
18
22
|
const LICENSE_CANDIDATES = ["LICENSE", "LICENSE.md", "LICENSE.txt", "COPYING", "COPYING.md"];
|
|
19
23
|
|
|
24
|
+
const hasSymlinkComponent = (root: string, target: string): boolean => {
|
|
25
|
+
let current = root;
|
|
26
|
+
|
|
27
|
+
for (const segment of relative(root, target).split(sep)) {
|
|
28
|
+
current = join(current, segment);
|
|
29
|
+
|
|
30
|
+
if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const isDeployMarker = (path: string): boolean => {
|
|
39
|
+
return readRegularFile(path) === DEPLOY_MARKER;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const isReusableDeployDirectory = (path: string): boolean => {
|
|
43
|
+
const entry = lstatSync(path, { throwIfNoEntry: false });
|
|
44
|
+
|
|
45
|
+
if (entry === undefined) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return entry.isDirectory() &&
|
|
50
|
+
(readdirSync(path).length === 0 || isDeployMarker(join(path, DEPLOY_MARKER_FILENAME)));
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const deployOutputError = (root: string, configured: string): Error =>
|
|
54
|
+
new Error(
|
|
55
|
+
`Cannot use "${configured}" as the deploy output directory: choose an empty directory or an ` +
|
|
56
|
+
`earlier GTKX deploy directory below ${root}`,
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const assertSafeDeployOutDir = (root: string, outDir: string, configured: string): void => {
|
|
60
|
+
const dist = join(root, DIST_DIR);
|
|
61
|
+
|
|
62
|
+
if (
|
|
63
|
+
outDir === dist ||
|
|
64
|
+
!isPathInside(root, outDir) ||
|
|
65
|
+
isPathInside(dist, outDir) ||
|
|
66
|
+
hasSymlinkComponent(root, outDir)
|
|
67
|
+
) {
|
|
68
|
+
throw deployOutputError(root, configured);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
20
72
|
const resolveOutDir = ({ root, deploy, outDirOverride }: PathsRequest): string => {
|
|
21
|
-
const configured = outDirOverride ?? deploy.outDir ??
|
|
73
|
+
const configured = outDirOverride ?? deploy.outDir ?? DEFAULT_DEPLOY_OUT_DIR;
|
|
22
74
|
const outDir = resolve(root, configured);
|
|
75
|
+
assertSafeDeployOutDir(root, outDir, configured);
|
|
23
76
|
|
|
24
|
-
if (!
|
|
25
|
-
throw
|
|
77
|
+
if (!isReusableDeployDirectory(outDir)) {
|
|
78
|
+
throw deployOutputError(root, configured);
|
|
26
79
|
}
|
|
27
80
|
|
|
28
81
|
return outDir;
|
|
29
82
|
};
|
|
30
83
|
|
|
84
|
+
const prepareDeployOutDir = (root: string, outDir: string): void => {
|
|
85
|
+
assertSafeDeployOutDir(root, outDir, outDir);
|
|
86
|
+
const prepared = prepareOutputDirectory(root, outDir, isReusableDeployDirectory);
|
|
87
|
+
|
|
88
|
+
if (prepared.status === "unsafe") {
|
|
89
|
+
throw deployOutputError(root, outDir);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
using transaction = prepared.transaction;
|
|
93
|
+
transaction.commit();
|
|
94
|
+
writeFileSync(join(outDir, DEPLOY_MARKER_FILENAME), DEPLOY_MARKER, { flag: "wx" });
|
|
95
|
+
};
|
|
96
|
+
|
|
31
97
|
const existingFile = (path: string): string | null =>
|
|
32
98
|
statSync(path, { throwIfNoEntry: false })?.isFile() === true ? path : null;
|
|
33
99
|
|
|
@@ -48,16 +114,17 @@ const resolveLicenseFile = (root: string, configured: string | undefined): strin
|
|
|
48
114
|
const resolvePaths = (request: PathsRequest): DeployPaths => {
|
|
49
115
|
const { root, deploy } = request;
|
|
50
116
|
const outDir = resolveOutDir(request);
|
|
117
|
+
const archDir = join(outDir, request.arch);
|
|
51
118
|
|
|
52
119
|
return {
|
|
53
120
|
root,
|
|
54
121
|
dist: join(root, DIST_DIR),
|
|
55
122
|
outDir,
|
|
56
|
-
metadata: join(
|
|
57
|
-
runtime: join(
|
|
58
|
-
stage: join(
|
|
59
|
-
overlay: join(
|
|
60
|
-
targets: join(
|
|
123
|
+
metadata: join(archDir, "metadata"),
|
|
124
|
+
runtime: join(archDir, "runtime"),
|
|
125
|
+
stage: join(archDir, "stage"),
|
|
126
|
+
overlay: join(archDir, "overlay"),
|
|
127
|
+
targets: join(archDir, "targets"),
|
|
61
128
|
output: join(outDir, "out"),
|
|
62
129
|
applicationIcon: resolveApplicationIcon(root, request.applicationId, request.applicationIcon),
|
|
63
130
|
licenseFile: resolveLicenseFile(root, deploy.licenseFile),
|
|
@@ -65,4 +132,4 @@ const resolvePaths = (request: PathsRequest): DeployPaths => {
|
|
|
65
132
|
};
|
|
66
133
|
};
|
|
67
134
|
|
|
68
|
-
export { resolvePaths };
|
|
135
|
+
export { prepareDeployOutDir, resolvePaths };
|
|
@@ -29,6 +29,7 @@ const EXTRACT_AND_RUN = "APPIMAGE_EXTRACT_AND_RUN";
|
|
|
29
29
|
const appimageTarget: DeployTarget = {
|
|
30
30
|
name: "appimage",
|
|
31
31
|
prefix: PREFIX,
|
|
32
|
+
isHostOnly: true,
|
|
32
33
|
tools: [FILE_TOOL],
|
|
33
34
|
render: (payload) => renderManifests(payload),
|
|
34
35
|
pack: (payload) => packAppImage(payload),
|
|
@@ -9,12 +9,12 @@ type PnpmPin = {
|
|
|
9
9
|
sha512: string;
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const PNPM_VERSION = "11.
|
|
12
|
+
const PNPM_VERSION = "11.26.0";
|
|
13
13
|
const PNPM_MAJOR = 11;
|
|
14
|
-
const PNPM_MINOR =
|
|
14
|
+
const PNPM_MINOR = 26;
|
|
15
15
|
|
|
16
|
-
const PNPM_SHA512 = "
|
|
17
|
-
"
|
|
16
|
+
const PNPM_SHA512 = "fc0e2bf890b9f983611f1ab68c0637bce914390653699f83c1a78b005ed25f2c81e77920c8" +
|
|
17
|
+
"fd8eee2ecf0b58b28cdcb00a84d97f69bcf7c56b2f344710238664";
|
|
18
18
|
|
|
19
19
|
const PNPM_DIR = "flatpak-pnpm";
|
|
20
20
|
const PNPM_COMMAND = "pnpm";
|
|
@@ -3,6 +3,7 @@ import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
|
3
3
|
import { posix, relative, resolve } from "node:path";
|
|
4
4
|
import type { DeployPayload, DeploySettings } from "../types.js";
|
|
5
5
|
import { LOCALE_DIRNAME } from "../../i18n/catalogs.js";
|
|
6
|
+
import { FONTS_DIR } from "../../internal/font-path.js";
|
|
6
7
|
import { listFilesRecursive } from "../../internal/list-files.js";
|
|
7
8
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
8
9
|
import { renderDbusService } from "../freedesktop/dbus-service.js";
|
|
@@ -68,6 +69,7 @@ const runtimeInstallCommands = (settings: DeploySettings, nodeExtensionPath: str
|
|
|
68
69
|
"test ! -f dist/gschemas.compiled || " +
|
|
69
70
|
installCommand("dist/gschemas.compiled", `${lib}/gschemas.compiled`, "m644"),
|
|
70
71
|
`test ! -d dist/assets || cp -a dist/assets ${lib}/assets`,
|
|
72
|
+
`test ! -d dist/${FONTS_DIR} || cp -a dist/${FONTS_DIR} ${lib}/${FONTS_DIR}`,
|
|
71
73
|
`test ! -d dist/${LOCALE_DIRNAME} || { mkdir -p ${locale} && cp -a dist/${LOCALE_DIRNAME}/. ${locale}/; }`,
|
|
72
74
|
installCommand(LAUNCHER_FILENAME, `${DESTINATION}/bin/${settings.binaryName}`, "m755"),
|
|
73
75
|
];
|
|
@@ -244,6 +246,17 @@ const appendPathFor = (settings: DeploySettings, pin: PnpmPin | null, nodeExtens
|
|
|
244
246
|
? `${nodeExtensionPath}/bin`
|
|
245
247
|
: `${pnpmPathFor(moduleDirFor(settings))}:${nodeExtensionPath}/bin`;
|
|
246
248
|
|
|
249
|
+
const sourceBuildCommand = (settings: DeploySettings): string => {
|
|
250
|
+
const configFile = projectRelative(settings, settings.configFile);
|
|
251
|
+
assertInsideProject(settings, {
|
|
252
|
+
destination: "the Flatpak build configuration",
|
|
253
|
+
source: configFile,
|
|
254
|
+
resolved: settings.configFile,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
return `npx gtkx build --config ${pathArgument(configFile)}`;
|
|
258
|
+
};
|
|
259
|
+
|
|
247
260
|
const flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {
|
|
248
261
|
const settings = payload.settings;
|
|
249
262
|
const manager = detectPackageManager(settings);
|
|
@@ -271,14 +284,14 @@ const flatpakSourceModule = (payload: DeployPayload): FlatpakModule => {
|
|
|
271
284
|
],
|
|
272
285
|
"build-commands": [
|
|
273
286
|
installCommandFor(settings, manager),
|
|
274
|
-
|
|
287
|
+
sourceBuildCommand(settings),
|
|
275
288
|
...runtimeInstallCommands(settings, nodeExtensionPath),
|
|
289
|
+
...extraFileInstallCommands(settings),
|
|
276
290
|
...metadataInstallCommands(settings),
|
|
277
291
|
...schemaInstallCommands(settings),
|
|
278
292
|
...iconInstallCommands(settings),
|
|
279
293
|
...licenseInstallCommands(settings),
|
|
280
294
|
...noticesInstallCommands(settings),
|
|
281
|
-
...extraFileInstallCommands(settings),
|
|
282
295
|
...(settings.deploy.flatpak?.buildCommands ?? []),
|
|
283
296
|
...validationCommands(settings),
|
|
284
297
|
],
|
|
@@ -21,6 +21,7 @@ const BUILDER_REF = "org.flatpak.Builder";
|
|
|
21
21
|
const flatpakTarget: DeployTarget = {
|
|
22
22
|
name: "flatpak",
|
|
23
23
|
prefix: PREFIX,
|
|
24
|
+
isHostOnly: true,
|
|
24
25
|
tools: [FLATPAK, FLATPAK_BUILDER, DESKTOP_FILE_VALIDATE, APPSTREAMCLI],
|
|
25
26
|
render: (payload) => renderManifests(payload),
|
|
26
27
|
pack: (payload) => Promise.try(() => packFlatpak(payload)),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { info } from "@gtkx/utils";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
import { stringify } from "yaml";
|
|
3
4
|
import type { DeployArtifact, DeployManifest, DeployPayload, DeployTarget } from "../types.js";
|
|
4
|
-
import { type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
|
|
5
|
+
import { glibcMinimumForPackage, type NfpmPackager, renderNfpmConfig } from "../nfpm/config.js";
|
|
5
6
|
import { packWithNfpm } from "../nfpm/pack.js";
|
|
6
7
|
import { TAR } from "../tools.js";
|
|
7
8
|
|
|
@@ -11,12 +12,18 @@ const PREFIX = "/usr";
|
|
|
11
12
|
const manifestPathFor = (payload: DeployPayload, packager: NfpmPackager): string =>
|
|
12
13
|
join(payload.settings.paths.targets, packager, MANIFEST_FILENAME);
|
|
13
14
|
|
|
14
|
-
const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] =>
|
|
15
|
-
|
|
15
|
+
const renderManifests = (payload: DeployPayload, packager: NfpmPackager): DeployManifest[] => {
|
|
16
|
+
const glibcMinimum = glibcMinimumForPackage(payload, packager);
|
|
17
|
+
|
|
18
|
+
if (glibcMinimum !== null) {
|
|
19
|
+
info(`${packager} package requires glibc >= ${glibcMinimum}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return [{
|
|
16
23
|
path: manifestPathFor(payload, packager),
|
|
17
|
-
contents: stringify(renderNfpmConfig(payload, packager), { lineWidth: 0 }),
|
|
18
|
-
}
|
|
19
|
-
|
|
24
|
+
contents: stringify(renderNfpmConfig(payload, packager, glibcMinimum), { lineWidth: 0 }),
|
|
25
|
+
}];
|
|
26
|
+
};
|
|
20
27
|
|
|
21
28
|
const packPackage = async (payload: DeployPayload, packager: NfpmPackager): Promise<DeployArtifact[]> => [
|
|
22
29
|
await packWithNfpm(payload, packager, manifestPathFor(payload, packager)),
|
|
@@ -25,6 +32,7 @@ const packPackage = async (payload: DeployPayload, packager: NfpmPackager): Prom
|
|
|
25
32
|
const nfpmTarget = (packager: NfpmPackager): DeployTarget => ({
|
|
26
33
|
name: packager,
|
|
27
34
|
prefix: PREFIX,
|
|
35
|
+
isHostOnly: false,
|
|
28
36
|
tools: [TAR],
|
|
29
37
|
render: (payload) => renderManifests(payload, packager),
|
|
30
38
|
pack: (payload) => packPackage(payload, packager),
|
package/src/deploy/types.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Config } from "@gtkx/config";
|
|
|
2
2
|
import type { ResolvedApplicationIcon } from "../internal/icon-path.js";
|
|
3
3
|
|
|
4
4
|
type DeployConfig = NonNullable<Config["deploy"]>;
|
|
5
|
+
type DeployArchName = NonNullable<DeployConfig["architectures"]>[number];
|
|
5
6
|
type DeployTargetName = NonNullable<DeployConfig["targets"]>[number];
|
|
6
7
|
type PackageFamily = "arch" | "debian" | "fedora" | "suse" | "unknown";
|
|
7
8
|
|
|
@@ -94,7 +95,7 @@ type DeployArch = {
|
|
|
94
95
|
rpm: string;
|
|
95
96
|
flatpak: string;
|
|
96
97
|
appimage: string;
|
|
97
|
-
node:
|
|
98
|
+
node: DeployArchName;
|
|
98
99
|
};
|
|
99
100
|
|
|
100
101
|
type DeployPaths = {
|
|
@@ -114,6 +115,7 @@ type DeployPaths = {
|
|
|
114
115
|
|
|
115
116
|
type DeploySettings = {
|
|
116
117
|
applicationId: string;
|
|
118
|
+
configFile: string;
|
|
117
119
|
binaryName: string;
|
|
118
120
|
name: string;
|
|
119
121
|
genericName: string | null;
|
|
@@ -169,6 +171,7 @@ type DeployArtifact = {
|
|
|
169
171
|
type DeployTarget = {
|
|
170
172
|
name: DeployTargetName;
|
|
171
173
|
prefix: string;
|
|
174
|
+
isHostOnly: boolean;
|
|
172
175
|
tools: DeployTool[];
|
|
173
176
|
render: (payload: DeployPayload) => DeployManifest[];
|
|
174
177
|
pack: (payload: DeployPayload, manifests: DeployManifest[]) => Promise<DeployArtifact[]>;
|
|
@@ -176,6 +179,7 @@ type DeployTarget = {
|
|
|
176
179
|
|
|
177
180
|
export type {
|
|
178
181
|
DeployArch,
|
|
182
|
+
DeployArchName,
|
|
179
183
|
DeployArtifact,
|
|
180
184
|
DeployConfig,
|
|
181
185
|
DeployDesktopAction,
|
|
@@ -39,7 +39,7 @@ const resolveAppimageTooling = async (arch: string): Promise<AppimageTooling> =>
|
|
|
39
39
|
url: `${APPIMAGETOOL_URL}/appimagetool-${arch}.AppImage`,
|
|
40
40
|
dest: join(dir, `appimagetool-${arch}`),
|
|
41
41
|
label: `appimagetool ${APPIMAGETOOL_VERSION}`,
|
|
42
|
-
|
|
42
|
+
digest: digestFor(APPIMAGETOOL_DIGESTS, arch, "appimagetool"),
|
|
43
43
|
mode: EXECUTABLE_MODE,
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -47,7 +47,7 @@ const resolveAppimageTooling = async (arch: string): Promise<AppimageTooling> =>
|
|
|
47
47
|
url: `${RUNTIME_URL}/runtime-${arch}`,
|
|
48
48
|
dest: join(dir, `runtime-${arch}`),
|
|
49
49
|
label: `the AppImage runtime ${RUNTIME_VERSION}`,
|
|
50
|
-
|
|
50
|
+
digest: digestFor(RUNTIME_DIGESTS, arch, "the AppImage runtime"),
|
|
51
51
|
mode: EXECUTABLE_MODE,
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -56,7 +56,7 @@ const downloadNfpm = async (dir: string, binary: string): Promise<string> => {
|
|
|
56
56
|
url: `${NFPM_BASE_URL}/${assetName}`,
|
|
57
57
|
dest: join(dir, assetName),
|
|
58
58
|
label: `nfpm ${NFPM_VERSION}`,
|
|
59
|
-
|
|
59
|
+
digest: digestFor(process.arch),
|
|
60
60
|
});
|
|
61
61
|
|
|
62
62
|
extractNfpm(archive, binary);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import type { WrittenCatalog } from "../i18n/catalogs.js";
|
|
4
|
+
|
|
5
|
+
type CatalogWrites = {
|
|
6
|
+
record: (catalogs: WrittenCatalog[]) => void;
|
|
7
|
+
hasWritten: (path: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const hasContent = (path: string, content: Buffer): boolean => {
|
|
11
|
+
try {
|
|
12
|
+
return readFileSync(path).equals(content);
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const createCatalogWrites = (): CatalogWrites => {
|
|
19
|
+
const contents: Map<string, Buffer> = new Map();
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
record: (catalogs) => {
|
|
23
|
+
for (const catalog of catalogs) {
|
|
24
|
+
contents.set(resolve(catalog.path), catalog.content);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
hasWritten: (path) => {
|
|
28
|
+
const content = contents.get(resolve(path));
|
|
29
|
+
|
|
30
|
+
return content !== undefined && hasContent(path, content);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { type CatalogWrites, createCatalogWrites };
|
package/src/dev/entry-env.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { stageProjectFonts } from "../internal/font-staging.js";
|
|
2
|
+
import { prependXdgDataDir } from "../internal/xdg-data-dirs.js";
|
|
3
|
+
|
|
4
|
+
const prepareDevFontDir = (root: string): string => {
|
|
5
|
+
const shareDir = stageProjectFonts(root);
|
|
6
|
+
process.env.XDG_DATA_DIRS = prependXdgDataDir(shareDir, process.env.XDG_DATA_DIRS);
|
|
7
|
+
|
|
8
|
+
return shareDir;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { prepareDevFontDir };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { MCP_SOCKET_PATH_ENV, resolveMcpSocketPath } from "@gtkx/mcp/internal";
|
|
2
|
+
import { resolveHeadlessOptions, startHeadlessDisplay } from "@gtkx/vitest/headless";
|
|
3
|
+
|
|
4
|
+
const restoreEnvironment = (name: string, value: string | undefined): void => {
|
|
5
|
+
if (value === undefined) {
|
|
6
|
+
Reflect.deleteProperty(process.env, name);
|
|
7
|
+
} else {
|
|
8
|
+
process.env[name] = value;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const startHeadlessDevDisplay = async (size?: string): Promise<() => void> => {
|
|
13
|
+
const previousSocketPath = process.env[MCP_SOCKET_PATH_ENV];
|
|
14
|
+
process.env[MCP_SOCKET_PATH_ENV] = resolveMcpSocketPath();
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const stopDisplay = await startHeadlessDisplay(resolveHeadlessOptions({ ...(size !== undefined && { size }) }));
|
|
18
|
+
let isStopped = false;
|
|
19
|
+
|
|
20
|
+
const stop = (): void => {
|
|
21
|
+
if (isStopped) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
isStopped = true;
|
|
26
|
+
process.removeListener("exit", stop);
|
|
27
|
+
stopDisplay();
|
|
28
|
+
restoreEnvironment(MCP_SOCKET_PATH_ENV, previousSocketPath);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
process.once("exit", stop);
|
|
32
|
+
|
|
33
|
+
return stop;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
restoreEnvironment(MCP_SOCKET_PATH_ENV, previousSocketPath);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export { startHeadlessDevDisplay };
|
package/src/dev/runner-deps.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { isRefreshBoundary, performRefresh, staleExportName } from "../refresh-r
|
|
|
17
17
|
import { gtkxFastRefresh } from "../vite-plugins/fast-refresh/swc-refresh.js";
|
|
18
18
|
import { gtkxVitePlugins } from "../vite-plugins/index.js";
|
|
19
19
|
import { gtkxReactDomPrebundle } from "../vite-plugins/react-dom-prebundle.js";
|
|
20
|
+
import { type CatalogWrites, createCatalogWrites } from "./catalog-writes.js";
|
|
20
21
|
|
|
21
22
|
const DEV_MODE = "development";
|
|
22
23
|
const APPLICATION_POLL_INTERVAL_MS = 50;
|
|
@@ -43,11 +44,22 @@ const waitForApplicationId = async (timeoutMs: number, shouldKeepWaiting: () =>
|
|
|
43
44
|
|
|
44
45
|
const readFileRevision = (path: string): Promise<string> => readFile(path, "utf8");
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
+
const devPlugins = (configFile: string, catalogWrites: CatalogWrites): DevRunnerDeps["plugins"] =>
|
|
48
|
+
(entryPath) => [
|
|
49
|
+
...gtkxVitePlugins({ mode: DEV_MODE, entryPath, configFile, onCatalogsWritten: catalogWrites.record }),
|
|
50
|
+
...gtkxFastRefresh(),
|
|
51
|
+
gtkxReactDomPrebundle(),
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const createDevRunnerDeps = (
|
|
55
|
+
configFile: string,
|
|
56
|
+
deployOutDir: string | undefined,
|
|
57
|
+
catalogWrites: CatalogWrites,
|
|
58
|
+
): DevRunnerDeps => ({
|
|
47
59
|
createServer,
|
|
48
60
|
waitForApplicationId,
|
|
49
61
|
getConfiguredApplicationId: async (root: string) => {
|
|
50
|
-
const loaded = await loadConfig(root, { mode: DEV_MODE });
|
|
62
|
+
const loaded = await loadConfig(root, { mode: DEV_MODE, configFile });
|
|
51
63
|
|
|
52
64
|
return loaded.config.applicationId;
|
|
53
65
|
},
|
|
@@ -86,13 +98,14 @@ const defaultDevRunnerDeps = (): DevRunnerDeps => ({
|
|
|
86
98
|
isRefreshBoundary,
|
|
87
99
|
staleExportName,
|
|
88
100
|
readFileRevision,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
gtkxReactDomPrebundle(),
|
|
93
|
-
],
|
|
101
|
+
hasWrittenCatalog: catalogWrites.hasWritten,
|
|
102
|
+
deployOutDir,
|
|
103
|
+
plugins: devPlugins(configFile, catalogWrites),
|
|
94
104
|
log: info,
|
|
95
105
|
exit: (code: number): never => process.exit(code),
|
|
96
106
|
});
|
|
97
107
|
|
|
108
|
+
const defaultDevRunnerDeps = (configFile: string, deployOutDir: string | undefined): DevRunnerDeps =>
|
|
109
|
+
createDevRunnerDeps(configFile, deployOutDir, createCatalogWrites());
|
|
110
|
+
|
|
98
111
|
export { defaultDevRunnerDeps };
|
package/src/dev/runner-main.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { loadConfig } from "@gtkx/config";
|
|
2
2
|
import { error } from "@gtkx/utils";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
-
import { DEV_ENTRY_ENV } from "./entry-env.js";
|
|
4
|
+
import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
|
|
5
|
+
import { prepareDevFontDir } from "./font-dir.js";
|
|
5
6
|
import { prepareDevIconDir } from "./icon-dir.js";
|
|
6
7
|
import { prepareDevLocaleDir } from "./locale-dir.js";
|
|
7
8
|
import { createDevRunner } from "./runner.js";
|
|
@@ -22,13 +23,21 @@ const main = async (): Promise<void> => {
|
|
|
22
23
|
process.exit(1);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
const
|
|
26
|
+
const configFile = process.env[DEV_CONFIG_ENV];
|
|
27
|
+
|
|
28
|
+
if (!configFile) {
|
|
29
|
+
error(`Missing ${DEV_CONFIG_ENV}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { config, root } = await loadConfig(cwd, { mode: "development", configFile });
|
|
26
34
|
prepareDevLocaleDir(root, config.applicationId);
|
|
27
35
|
prepareDevSchemaDir(root);
|
|
28
36
|
prepareDevIconDir(root, config.applicationId, config.applicationIcon);
|
|
37
|
+
prepareDevFontDir(root);
|
|
29
38
|
const entryPath = resolve(cwd, entryArg);
|
|
30
39
|
const { defaultDevRunnerDeps } = await import("./runner-deps.js");
|
|
31
|
-
const runner = createDevRunner(defaultDevRunnerDeps());
|
|
40
|
+
const runner = createDevRunner(defaultDevRunnerDeps(configFile, config.deploy?.outDir));
|
|
32
41
|
await runner.run(entryPath);
|
|
33
42
|
};
|
|
34
43
|
|
package/src/dev/runner.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ApplicationInstance } from "@gtkx/runtime/internal";
|
|
|
2
2
|
import type { InlineConfig, Plugin } from "vite";
|
|
3
3
|
import { error, warn } from "@gtkx/utils";
|
|
4
4
|
import { isCatalogSource } from "../i18n/catalogs.js";
|
|
5
|
+
import { hasUnstagedFontImport } from "../internal/font-staging.js";
|
|
5
6
|
import { loadModuleExclusively, withExclusiveLoad } from "../internal/module-loads.js";
|
|
6
7
|
import { createChangeQueue, type WatchedChange } from "./change-queue.js";
|
|
7
8
|
import { createFailureTracker, type FailureTracker } from "./failure-tracker.js";
|
|
@@ -33,6 +34,8 @@ type DevRunnerDeps = {
|
|
|
33
34
|
isRefreshBoundary(module: Record<string, unknown>): boolean;
|
|
34
35
|
staleExportName(previous: Record<string, unknown>, current: Record<string, unknown>): string | null;
|
|
35
36
|
readFileRevision(path: string): Promise<string>;
|
|
37
|
+
hasWrittenCatalog(path: string): boolean;
|
|
38
|
+
deployOutDir: string | undefined;
|
|
36
39
|
plugins(entryPath: string): Plugin[];
|
|
37
40
|
log(message: string): void;
|
|
38
41
|
exit(code: number): never;
|
|
@@ -370,21 +373,46 @@ const restartForServerConfig = async (session: DevSession, changedPath: string):
|
|
|
370
373
|
await requestRestart(session);
|
|
371
374
|
};
|
|
372
375
|
|
|
373
|
-
const
|
|
374
|
-
|
|
376
|
+
const restartForFont = async (session: DevSession, changedPath: string): Promise<void> => {
|
|
377
|
+
session.deps.log(`Font import added: ${changedPath}`);
|
|
378
|
+
await requestRestart(session);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const restartForCatalog = async (session: DevSession, changedPath: string): Promise<void> => {
|
|
382
|
+
if (session.deps.hasWrittenCatalog(changedPath)) {
|
|
375
383
|
return;
|
|
376
384
|
}
|
|
377
385
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
session.deps.log(`Translation catalog changed: ${changedPath}`);
|
|
387
|
+
await requestRestart(session);
|
|
388
|
+
};
|
|
381
389
|
|
|
382
|
-
|
|
390
|
+
const didRestartForChange = async (session: DevSession, change: WatchedChange): Promise<boolean> => {
|
|
391
|
+
const { root } = session.server.config;
|
|
392
|
+
|
|
393
|
+
if (isCatalogSource(root, change.path)) {
|
|
394
|
+
await restartForCatalog(session, change.path);
|
|
395
|
+
|
|
396
|
+
return true;
|
|
383
397
|
}
|
|
384
398
|
|
|
385
399
|
if (isServerConfigFile(session.server.config, change.path)) {
|
|
386
400
|
await restartForServerConfig(session, change.path);
|
|
387
401
|
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (change.event !== "unlink" && hasUnstagedFontImport(root, change.path)) {
|
|
406
|
+
await restartForFont(session, change.path);
|
|
407
|
+
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return false;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
const applyChange = async (session: DevSession, change: WatchedChange): Promise<void> => {
|
|
415
|
+
if (session.controller.isShuttingDown() || await didRestartForChange(session, change)) {
|
|
388
416
|
return;
|
|
389
417
|
}
|
|
390
418
|
|
|
@@ -610,7 +638,9 @@ const createSession = (server: DevServer, deps: DevRunnerDeps): DevSession => {
|
|
|
610
638
|
|
|
611
639
|
const createDevRunner = (deps: DevRunnerDeps): DevRunner => ({
|
|
612
640
|
async run(entryPath: string): Promise<void> {
|
|
613
|
-
const server = await deps.createServer(
|
|
641
|
+
const server = await deps.createServer(
|
|
642
|
+
createDevServerConfig(process.cwd(), deps.deployOutDir, deps.plugins(entryPath)),
|
|
643
|
+
);
|
|
614
644
|
const session = createSession(server, deps);
|
|
615
645
|
deps.installShutdownHandlers(onShutdownSignal(session));
|
|
616
646
|
|