@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
|
@@ -2,6 +2,7 @@ import { runCodegen as runCodegenCore } from "@gtkx/codegen";
|
|
|
2
2
|
import { getShadowingStorePaths, sweepProjectStaging } from "@gtkx/codegen/internal";
|
|
3
3
|
import { type Config, loadConfig } from "@gtkx/config";
|
|
4
4
|
import {
|
|
5
|
+
configDependenciesFor,
|
|
5
6
|
isAgentRulesEnabled,
|
|
6
7
|
resolveElementComponents,
|
|
7
8
|
resolveElementProps,
|
|
@@ -10,13 +11,14 @@ import {
|
|
|
10
11
|
} from "@gtkx/config/internal";
|
|
11
12
|
import { info } from "@gtkx/utils";
|
|
12
13
|
import { existsSync, rmSync } from "node:fs";
|
|
13
|
-
import { join, resolve } from "node:path";
|
|
14
|
+
import { join, relative, resolve } from "node:path";
|
|
14
15
|
import { resolveCatalogProject, synchronizeCatalogs } from "../i18n/catalogs.js";
|
|
15
16
|
import { extractSourceCatalog } from "../i18n/source-messages.js";
|
|
16
17
|
import { clearI18nTypes, emitI18nTypes } from "../i18n/types.js";
|
|
17
18
|
import { upsertAgentRules } from "../internal/agent-rules.js";
|
|
18
19
|
import { discoverSourceFiles } from "../internal/source-imports.js";
|
|
19
20
|
import { emitSchemaEnv } from "../settings/schema.js";
|
|
21
|
+
import { resolveConfigDependencies } from "./config-dependencies.js";
|
|
20
22
|
import { type CodegenInputs, isCodegenStale, resolveCodegenInputs } from "./freshness.js";
|
|
21
23
|
import { type ReferenceResult, writeReference } from "./reference.js";
|
|
22
24
|
import { type CodegenContext, type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
|
|
@@ -24,6 +26,7 @@ import { type CodegenContext, type CodegenStore, resolveCodegenContext } from ".
|
|
|
24
26
|
type RunCodegenOptions = {
|
|
25
27
|
cwd?: string;
|
|
26
28
|
mode?: string | undefined;
|
|
29
|
+
configFile?: string | undefined;
|
|
27
30
|
isForced?: boolean;
|
|
28
31
|
inputs?: CodegenInputs;
|
|
29
32
|
resolved?: LoadedConfig;
|
|
@@ -58,6 +61,7 @@ type PreparedCodegen = CodegenInputs & { isForced: boolean };
|
|
|
58
61
|
type EnsureGeneratedOptions = {
|
|
59
62
|
shouldAnnounce?: boolean;
|
|
60
63
|
mode?: string;
|
|
64
|
+
configFile?: string | undefined;
|
|
61
65
|
shouldPreserveI18nMetadata?: boolean | undefined;
|
|
62
66
|
};
|
|
63
67
|
|
|
@@ -84,6 +88,7 @@ const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsI
|
|
|
84
88
|
storeDir: store.giStoreDir,
|
|
85
89
|
linkDir: store.giLinkDir,
|
|
86
90
|
version: store.runtimeVersion,
|
|
91
|
+
owner: store.owner,
|
|
87
92
|
},
|
|
88
93
|
jsx:
|
|
89
94
|
store.react === null
|
|
@@ -92,6 +97,7 @@ const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsI
|
|
|
92
97
|
storeDir: store.jsxStoreDir,
|
|
93
98
|
linkDir: store.jsxLinkDir,
|
|
94
99
|
version: store.react.version,
|
|
100
|
+
owner: store.owner,
|
|
95
101
|
},
|
|
96
102
|
userComponents: resolveElementComponents(elements),
|
|
97
103
|
userProps: resolveElementProps(elements),
|
|
@@ -109,14 +115,6 @@ const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
|
|
|
109
115
|
libraries: [],
|
|
110
116
|
});
|
|
111
117
|
|
|
112
|
-
const clearGeneratedStores = (store: CodegenStore): void => {
|
|
113
|
-
removeStores(
|
|
114
|
-
store.react === null
|
|
115
|
-
? [store.giStoreDir, store.giLinkDir]
|
|
116
|
-
: [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir],
|
|
117
|
-
);
|
|
118
|
-
};
|
|
119
|
-
|
|
120
118
|
const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config): PreparedCodegen => {
|
|
121
119
|
const { girPath, libraries, store } = options.inputs ?? resolveCodegenInputs(cwd, config);
|
|
122
120
|
|
|
@@ -131,7 +129,10 @@ const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config)
|
|
|
131
129
|
|
|
132
130
|
const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenResult> => {
|
|
133
131
|
const cwd = options.cwd ?? process.cwd();
|
|
134
|
-
const { config, configFile } = options.resolved ?? (await loadConfig(cwd, {
|
|
132
|
+
const { config, configFile } = options.resolved ?? (await loadConfig(cwd, {
|
|
133
|
+
mode: options.mode,
|
|
134
|
+
configFile: options.configFile,
|
|
135
|
+
}));
|
|
135
136
|
await syncI18n(cwd, config.applicationId, options.shouldPreserveI18nMetadata);
|
|
136
137
|
emitSchemaEnv(cwd);
|
|
137
138
|
|
|
@@ -143,10 +144,6 @@ const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenRe
|
|
|
143
144
|
|
|
144
145
|
const { girPath, libraries, store, isForced } = prepareCodegen(options, cwd, config);
|
|
145
146
|
|
|
146
|
-
if (options.isForced) {
|
|
147
|
-
clearGeneratedStores(store);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
147
|
const result = await runCodegenCore({
|
|
151
148
|
...codegenOptions({ store, libraries, girPath, elements: config.elements }),
|
|
152
149
|
isForced,
|
|
@@ -190,9 +187,9 @@ const syncI18n = async (
|
|
|
190
187
|
await emitI18nTypes(root);
|
|
191
188
|
};
|
|
192
189
|
|
|
193
|
-
const isCodegenDisabled = async (cwd: string, mode?: string): Promise<boolean> => {
|
|
190
|
+
const isCodegenDisabled = async (cwd: string, mode?: string, configFile?: string): Promise<boolean> => {
|
|
194
191
|
try {
|
|
195
|
-
const { config } = await loadConfig(cwd, { mode });
|
|
192
|
+
const { config } = await loadConfig(cwd, { mode, configFile });
|
|
196
193
|
|
|
197
194
|
return config.codegen === false;
|
|
198
195
|
} catch {
|
|
@@ -257,18 +254,51 @@ const ensureGeneratedIn = async (
|
|
|
257
254
|
|
|
258
255
|
/* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
|
|
259
256
|
const ensureGenerated = async (cwd: string, options: EnsureGeneratedOptions = {}): Promise<boolean> =>
|
|
260
|
-
isPreflightSkipped(options)
|
|
257
|
+
isPreflightSkipped(options)
|
|
258
|
+
? false
|
|
259
|
+
: generate(await resolveCodegenContext(cwd, options.mode, options.configFile), options);
|
|
261
260
|
|
|
262
261
|
const resolveConfigWatch = async (
|
|
263
262
|
cwd: string,
|
|
264
263
|
mode?: string,
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
configFile?: string,
|
|
265
|
+
initialDependencies: string[] = [],
|
|
266
|
+
): Promise<{ paths: string[]; resolvePaths: () => string[]; regenerate: () => Promise<string[]> }> => {
|
|
267
|
+
let selectedConfigFile: string;
|
|
268
|
+
|
|
269
|
+
if (configFile === undefined) {
|
|
270
|
+
const loaded = await loadConfig(cwd, { mode });
|
|
271
|
+
selectedConfigFile = loaded.configFile;
|
|
272
|
+
} else {
|
|
273
|
+
selectedConfigFile = resolve(cwd, configFile);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
let knownDependencies = initialDependencies;
|
|
277
|
+
const selectedConfigName = relative(cwd, selectedConfigFile);
|
|
278
|
+
const resolvePaths = (): string[] => [
|
|
279
|
+
...new Set(
|
|
280
|
+
[selectedConfigFile, ...knownDependencies]
|
|
281
|
+
.flatMap((path) => resolveConfigDependencies(path, selectedConfigName, cwd)),
|
|
282
|
+
),
|
|
283
|
+
];
|
|
267
284
|
|
|
268
285
|
return {
|
|
269
|
-
paths:
|
|
286
|
+
paths: resolvePaths(),
|
|
287
|
+
resolvePaths,
|
|
270
288
|
regenerate: async () => {
|
|
271
|
-
|
|
289
|
+
let loaded: Awaited<ReturnType<typeof loadConfig>>;
|
|
290
|
+
|
|
291
|
+
try {
|
|
292
|
+
loaded = await loadConfig(cwd, { mode, configFile: selectedConfigFile });
|
|
293
|
+
} catch (error) {
|
|
294
|
+
knownDependencies = [...new Set([...knownDependencies, ...configDependenciesFor(error)])];
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
knownDependencies = configDependenciesFor(loaded);
|
|
299
|
+
await runCodegen({ cwd, mode, resolved: loaded });
|
|
300
|
+
|
|
301
|
+
return resolvePaths();
|
|
272
302
|
},
|
|
273
303
|
};
|
|
274
304
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolveStore } from "@gtkx/codegen";
|
|
2
2
|
import { type Config, loadConfig } from "@gtkx/config";
|
|
3
|
-
import {
|
|
3
|
+
import { configDependenciesFor } from "@gtkx/config/internal";
|
|
4
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
4
5
|
import { createRequire } from "node:module";
|
|
5
6
|
import { dirname, join } from "node:path";
|
|
6
7
|
import { pathToFileURL } from "node:url";
|
|
@@ -11,6 +12,7 @@ type CodegenStore = {
|
|
|
11
12
|
jsxStoreDir: string;
|
|
12
13
|
jsxLinkDir: string;
|
|
13
14
|
runtimeVersion: string;
|
|
15
|
+
owner: string;
|
|
14
16
|
react: CodegenReactPackage | null;
|
|
15
17
|
};
|
|
16
18
|
|
|
@@ -22,6 +24,7 @@ type CodegenContext = {
|
|
|
22
24
|
root: string;
|
|
23
25
|
config: Config;
|
|
24
26
|
configFile: string;
|
|
27
|
+
configDependencies: string[];
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
const hasPackage = (require: NodeJS.Require, dir: string, packageName: string): boolean => {
|
|
@@ -54,6 +57,7 @@ const resolveCodegenStore = (dir: string): CodegenStore => {
|
|
|
54
57
|
jsxStoreDir: store.jsx?.storeDir ?? siblingStore(store.gi.storeDir),
|
|
55
58
|
jsxLinkDir: store.jsx?.linkDir ?? siblingStore(store.gi.linkDir),
|
|
56
59
|
runtimeVersion: store.gi.version,
|
|
60
|
+
owner: store.gi.owner ?? realpathSync(dir),
|
|
57
61
|
react:
|
|
58
62
|
hasReactRuntime && store.jsx !== null
|
|
59
63
|
? { version: store.jsx.version }
|
|
@@ -61,10 +65,11 @@ const resolveCodegenStore = (dir: string): CodegenStore => {
|
|
|
61
65
|
};
|
|
62
66
|
};
|
|
63
67
|
|
|
64
|
-
const resolveCodegenContext = async (cwd: string, mode?: string): Promise<CodegenContext> => {
|
|
65
|
-
const
|
|
68
|
+
const resolveCodegenContext = async (cwd: string, mode?: string, selectedConfig?: string): Promise<CodegenContext> => {
|
|
69
|
+
const loaded = await loadConfig(cwd, { mode, configFile: selectedConfig });
|
|
70
|
+
const { config, configFile } = loaded;
|
|
66
71
|
|
|
67
|
-
return { root: cwd, config, configFile };
|
|
72
|
+
return { root: cwd, config, configFile, configDependencies: configDependenciesFor(loaded) };
|
|
68
73
|
};
|
|
69
74
|
|
|
70
75
|
export { resolveCodegenStore, resolveCodegenContext, type CodegenContext, type CodegenStore };
|
package/src/commands/build.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { info } from "@gtkx/utils";
|
|
2
2
|
import { defineCommand } from "citty";
|
|
3
3
|
import { build as buildApp } from "../builder.js";
|
|
4
|
-
import {
|
|
4
|
+
import { prepareBuildOutDir, resolveBuildOutDir } from "../internal/build-output.js";
|
|
5
|
+
import { configArg, entryArg } from "../internal/entry-arg.js";
|
|
5
6
|
import { prepareProject } from "../internal/prepare-project.js";
|
|
6
7
|
|
|
7
8
|
const BUILD_MODE = "production";
|
|
@@ -13,18 +14,28 @@ const build = defineCommand({
|
|
|
13
14
|
},
|
|
14
15
|
args: {
|
|
15
16
|
...entryArg,
|
|
17
|
+
...configArg,
|
|
18
|
+
out: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Output directory below the project root (default: dist)",
|
|
21
|
+
},
|
|
16
22
|
},
|
|
17
23
|
async run({ args }) {
|
|
18
|
-
const { cwd, entry } = await prepareProject(args, BUILD_MODE);
|
|
24
|
+
const { cwd, entry, configFile } = await prepareProject(args, BUILD_MODE);
|
|
25
|
+
const outDir = resolveBuildOutDir(cwd, args.out);
|
|
26
|
+
using preparedOutput = prepareBuildOutDir(cwd, outDir);
|
|
19
27
|
info(`Building ${entry}`);
|
|
20
28
|
|
|
21
29
|
const bundlePath = await buildApp({
|
|
22
30
|
entry,
|
|
31
|
+
configFile,
|
|
23
32
|
vite: {
|
|
24
33
|
root: cwd,
|
|
34
|
+
build: { outDir: preparedOutput.path, emptyOutDir: false },
|
|
25
35
|
},
|
|
26
36
|
});
|
|
27
37
|
|
|
38
|
+
preparedOutput.commit();
|
|
28
39
|
info(`Build complete: ${bundlePath}`);
|
|
29
40
|
},
|
|
30
41
|
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { info } from "@gtkx/utils";
|
|
2
|
+
import { findStaleHeadlessDisplays, reapStaleHeadlessDisplays } from "@gtkx/vitest/headless";
|
|
3
|
+
import { defineCommand } from "citty";
|
|
4
|
+
import { findStaleCompileCaches, reapStaleCompileCaches } from "../internal/compile-cache-store.js";
|
|
5
|
+
import { cwdArg } from "../internal/entry-arg.js";
|
|
6
|
+
|
|
7
|
+
const DISPLAY_LABEL = "stale headless runtime directories";
|
|
8
|
+
const COMPILE_CACHE_LABEL = "stale compile cache directories";
|
|
9
|
+
|
|
10
|
+
const report = (paths: string[]): void => {
|
|
11
|
+
for (const path of paths) {
|
|
12
|
+
info(`cleanup: ${path}`);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const cleanup = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "cleanup",
|
|
19
|
+
description: "Remove stale GTKX headless runtime and compile cache directories",
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
"dry-run": {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
description: "List stale directories without removing them",
|
|
25
|
+
},
|
|
26
|
+
...cwdArg,
|
|
27
|
+
},
|
|
28
|
+
run({ args }) {
|
|
29
|
+
const displays = findStaleHeadlessDisplays();
|
|
30
|
+
const compileCaches = findStaleCompileCaches();
|
|
31
|
+
report(displays.map((candidate) => candidate.runtimeDir));
|
|
32
|
+
report(compileCaches);
|
|
33
|
+
|
|
34
|
+
if (args["dry-run"] === true) {
|
|
35
|
+
info(`cleanup: found ${String(displays.length)} ${DISPLAY_LABEL}`);
|
|
36
|
+
info(`cleanup: found ${String(compileCaches.length)} ${COMPILE_CACHE_LABEL}`);
|
|
37
|
+
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const removedDisplays = reapStaleHeadlessDisplays(displays);
|
|
42
|
+
const removedCaches = reapStaleCompileCaches(compileCaches);
|
|
43
|
+
info(`cleanup: removed ${String(removedDisplays.length)} ${DISPLAY_LABEL}`);
|
|
44
|
+
info(`cleanup: removed ${String(removedCaches.length)} ${COMPILE_CACHE_LABEL}`);
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { cleanup };
|
package/src/commands/codegen.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { info } from "@gtkx/utils";
|
|
|
2
2
|
import { defineCommand } from "citty";
|
|
3
3
|
import { formatCodegenResult } from "../codegen/report.js";
|
|
4
4
|
import { ensureGenerated, isCodegenDisabled, runCodegen } from "../codegen/run-codegen.js";
|
|
5
|
-
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
5
|
+
import { configArg, cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
6
6
|
|
|
7
7
|
const FORCED_WHILE_DISABLED_MESSAGE =
|
|
8
8
|
"codegen is disabled for this project, so --force has no store to regenerate here. " +
|
|
@@ -20,29 +20,30 @@ const codegen = defineCommand({
|
|
|
20
20
|
description: "Wipe the generated store and regenerate unconditionally (recover a corrupted store)",
|
|
21
21
|
default: false,
|
|
22
22
|
},
|
|
23
|
+
...configArg,
|
|
23
24
|
...cwdArg,
|
|
24
25
|
},
|
|
25
26
|
async run({ args }) {
|
|
26
27
|
const cwd = resolveCwd(args);
|
|
27
|
-
const isDisabled = await isCodegenDisabled(cwd);
|
|
28
|
+
const isDisabled = await isCodegenDisabled(cwd, undefined, args.config);
|
|
28
29
|
checkForce(isDisabled, args.force);
|
|
29
30
|
|
|
30
31
|
if (isDisabled) {
|
|
31
|
-
await runCodegen({ cwd });
|
|
32
|
+
await runCodegen({ cwd, configFile: args.config });
|
|
32
33
|
info("codegen: disabled for this project; reusing an installed binding store");
|
|
33
34
|
|
|
34
35
|
return;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
if (!args.force) {
|
|
38
|
-
const isRan = await ensureGenerated(cwd);
|
|
39
|
+
const isRan = await ensureGenerated(cwd, { configFile: args.config });
|
|
39
40
|
info(isRan ? "codegen: regenerated stale bindings" : "codegen: bindings up to date");
|
|
40
41
|
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const startedAt = Date.now();
|
|
45
|
-
const result = await runCodegen({ cwd, isForced: true });
|
|
46
|
+
const result = await runCodegen({ cwd, configFile: args.config, isForced: true });
|
|
46
47
|
const lines = formatCodegenResult(result, Date.now() - startedAt);
|
|
47
48
|
|
|
48
49
|
for (const line of lines) {
|
package/src/commands/deploy.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { KNOWN_NAMES } from "../deploy/registry.js";
|
|
3
3
|
import { runDeploy } from "../deploy/run-deploy.js";
|
|
4
|
-
import {
|
|
4
|
+
import { KNOWN_ARCH_NAMES } from "../deploy/settings/arch.js";
|
|
5
|
+
import { configArg, entryArg } from "../internal/entry-arg.js";
|
|
5
6
|
import { resolveProject } from "../internal/prepare-project.js";
|
|
6
7
|
|
|
7
8
|
const DEPLOY_MODE = "production";
|
|
@@ -13,10 +14,15 @@ const deploy = defineCommand({
|
|
|
13
14
|
},
|
|
14
15
|
args: {
|
|
15
16
|
...entryArg,
|
|
17
|
+
...configArg,
|
|
16
18
|
target: {
|
|
17
19
|
type: "string",
|
|
18
20
|
description: `Comma-separated package formats to build (${KNOWN_NAMES})`,
|
|
19
21
|
},
|
|
22
|
+
arch: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: `Comma-separated architectures to build (${KNOWN_ARCH_NAMES}; default: the host)`,
|
|
25
|
+
},
|
|
20
26
|
out: {
|
|
21
27
|
type: "string",
|
|
22
28
|
description: "Output directory relative to the project root (default: build)",
|
|
@@ -31,12 +37,14 @@ const deploy = defineCommand({
|
|
|
31
37
|
},
|
|
32
38
|
},
|
|
33
39
|
async run({ args }) {
|
|
34
|
-
const { cwd, entry } = await resolveProject(args, DEPLOY_MODE);
|
|
40
|
+
const { cwd, entry, configFile } = await resolveProject(args, DEPLOY_MODE);
|
|
35
41
|
|
|
36
42
|
await runDeploy({
|
|
37
43
|
entry,
|
|
38
44
|
cwd,
|
|
45
|
+
configFile,
|
|
39
46
|
targets: args.target,
|
|
47
|
+
arches: args.arch,
|
|
40
48
|
outDir: args.out,
|
|
41
49
|
shouldPrintManifests: args["print-manifests"] === true,
|
|
42
50
|
shouldSkipBuild: args["skip-build"] === true,
|
package/src/commands/dev.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { armParentDeath } from "@gtkx/native/internal";
|
|
2
|
+
import { reapStaleHeadlessDisplaysAtStartup } from "@gtkx/vitest/headless";
|
|
1
3
|
import { defineCommand } from "citty";
|
|
2
4
|
import { resolveConfigWatch } from "../codegen/run-codegen.js";
|
|
5
|
+
import { startHeadlessDevDisplay } from "../dev/headless.js";
|
|
3
6
|
import { type DevWatch, runDevSupervisor } from "../dev/supervisor.js";
|
|
4
7
|
import { splitApplicationArgs } from "../internal/application-args.js";
|
|
5
|
-
import { entryArg } from "../internal/entry-arg.js";
|
|
8
|
+
import { configArg, entryArg } from "../internal/entry-arg.js";
|
|
9
|
+
import { getInitialProcessGroupOwner, initialParentId } from "../internal/parent-process.js";
|
|
6
10
|
import { prepareProject } from "../internal/prepare-project.js";
|
|
7
11
|
|
|
8
12
|
const DEV_MODE = "development";
|
|
@@ -14,12 +18,49 @@ const dev = defineCommand({
|
|
|
14
18
|
},
|
|
15
19
|
args: {
|
|
16
20
|
...entryArg,
|
|
21
|
+
...configArg,
|
|
22
|
+
headless: {
|
|
23
|
+
type: "boolean",
|
|
24
|
+
description: "Run on an isolated headless Wayland display",
|
|
25
|
+
},
|
|
26
|
+
size: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Headless display size as WIDTHxHEIGHT",
|
|
29
|
+
},
|
|
17
30
|
},
|
|
18
31
|
async run({ args }) {
|
|
19
|
-
|
|
20
|
-
const
|
|
32
|
+
reapStaleHeadlessDisplaysAtStartup();
|
|
33
|
+
const initialProcessGroupOwner = getInitialProcessGroupOwner();
|
|
34
|
+
|
|
35
|
+
if (
|
|
36
|
+
!armParentDeath(
|
|
37
|
+
initialParentId,
|
|
38
|
+
initialProcessGroupOwner?.pid,
|
|
39
|
+
initialProcessGroupOwner?.startTime,
|
|
40
|
+
)
|
|
41
|
+
) {
|
|
42
|
+
throw new Error("The process that launched gtkx dev exited during startup");
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (args.size !== undefined && !args.headless) {
|
|
46
|
+
throw new Error("--size requires --headless");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { cwd, entry: entryPath, configFile, configDependencies } = await prepareProject(args, DEV_MODE);
|
|
50
|
+
const watch: DevWatch | undefined = await resolveConfigWatch(
|
|
51
|
+
cwd,
|
|
52
|
+
DEV_MODE,
|
|
53
|
+
configFile,
|
|
54
|
+
configDependencies,
|
|
55
|
+
);
|
|
21
56
|
const { applicationArgs } = splitApplicationArgs(process.argv.slice(2));
|
|
22
|
-
|
|
57
|
+
const stopHeadless = args.headless ? await startHeadlessDevDisplay(args.size) : undefined;
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
await runDevSupervisor({ entryPath, cwd, configFile, args: applicationArgs, watch });
|
|
61
|
+
} finally {
|
|
62
|
+
stopHeadless?.();
|
|
63
|
+
}
|
|
23
64
|
},
|
|
24
65
|
});
|
|
25
66
|
|
package/src/commands/docs.ts
CHANGED
|
@@ -68,6 +68,7 @@ const docs = defineCommand({
|
|
|
68
68
|
outDir,
|
|
69
69
|
basePath: args["base-path"],
|
|
70
70
|
props: builtin.props,
|
|
71
|
+
acceptedChildTypes: builtin.acceptedChildTypes,
|
|
71
72
|
omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
|
|
72
73
|
isForced: args.force,
|
|
73
74
|
});
|
package/src/deploy/depends.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { DeploySettings } from "./types.js";
|
|
2
|
+
import { PACKAGED_SONAMES, type PackagedSoname } from "./node-runtime/sonames.js";
|
|
2
3
|
|
|
3
4
|
type Relations = {
|
|
4
5
|
deb: string[];
|
|
5
6
|
rpm: string[];
|
|
6
7
|
};
|
|
7
8
|
|
|
8
|
-
type
|
|
9
|
+
type PackageNames = {
|
|
9
10
|
deb: string;
|
|
10
11
|
rpm: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type LibraryPackages = PackageNames & {
|
|
11
15
|
extra: Relations;
|
|
12
16
|
};
|
|
13
17
|
|
|
@@ -25,6 +29,17 @@ const DEPENDS_BY_LIBRARY: Record<string, LibraryPackages> = {
|
|
|
25
29
|
"Gtk-4.0": { deb: "libgtk-4-1", rpm: "gtk4", extra: { deb: [], rpm: [GLES_SONAME] } },
|
|
26
30
|
};
|
|
27
31
|
|
|
32
|
+
const RUNTIME_PACKAGES: Record<PackagedSoname, PackageNames> = {
|
|
33
|
+
"libatomic.so.1": { deb: "libatomic1", rpm: `libatomic.so.1${SONAME_SUFFIX}` },
|
|
34
|
+
"libgcc_s.so.1": { deb: "libgcc-s1", rpm: `libgcc_s.so.1${SONAME_SUFFIX}` },
|
|
35
|
+
"libstdc++.so.6": { deb: "libstdc++6", rpm: `libstdc++.so.6${SONAME_SUFFIX}` },
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const RUNTIME_DEPENDS: Relations = {
|
|
39
|
+
deb: PACKAGED_SONAMES.map((soname) => RUNTIME_PACKAGES[soname].deb),
|
|
40
|
+
rpm: PACKAGED_SONAMES.map((soname) => RUNTIME_PACKAGES[soname].rpm),
|
|
41
|
+
};
|
|
42
|
+
|
|
28
43
|
const debRelation = (name: string, minimum: string | undefined): string =>
|
|
29
44
|
minimum === undefined ? name : `${name} (>= ${minimum})`;
|
|
30
45
|
|
|
@@ -63,8 +78,20 @@ const resolveDepends = (settings: DeploySettings, glibcMinimum: string | null):
|
|
|
63
78
|
const extra = settings.deploy.depends ?? {};
|
|
64
79
|
|
|
65
80
|
return {
|
|
66
|
-
deb: dedupe([
|
|
67
|
-
|
|
81
|
+
deb: dedupe([
|
|
82
|
+
...fromLibraries.deb,
|
|
83
|
+
...BASE_DEPENDS.deb,
|
|
84
|
+
...fromGlibc.deb,
|
|
85
|
+
...RUNTIME_DEPENDS.deb,
|
|
86
|
+
...(extra.deb ?? []),
|
|
87
|
+
]),
|
|
88
|
+
rpm: dedupe([
|
|
89
|
+
...fromLibraries.rpm,
|
|
90
|
+
...BASE_DEPENDS.rpm,
|
|
91
|
+
...fromGlibc.rpm,
|
|
92
|
+
...RUNTIME_DEPENDS.rpm,
|
|
93
|
+
...(extra.rpm ?? []),
|
|
94
|
+
]),
|
|
68
95
|
};
|
|
69
96
|
};
|
|
70
97
|
|
package/src/deploy/download.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { info, warn } from "@gtkx/utils";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
4
|
import { join } from "node:path";
|
|
5
|
+
import { cacheRoot } from "../internal/cache-root.js";
|
|
6
6
|
|
|
7
7
|
type DigestRequest = {
|
|
8
8
|
url: string;
|
|
@@ -11,22 +11,21 @@ type DigestRequest = {
|
|
|
11
11
|
subject: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
type DigestAlgorithm = "sha256" | "sha512";
|
|
15
|
+
|
|
14
16
|
type DownloadRequest = {
|
|
15
17
|
url: string;
|
|
16
18
|
dest: string;
|
|
17
19
|
label: string;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
digest: string;
|
|
21
|
+
algorithm?: DigestAlgorithm | undefined;
|
|
22
|
+
freshDigest?: (() => Promise<string>) | undefined;
|
|
20
23
|
mode?: number | undefined;
|
|
21
24
|
};
|
|
22
25
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const cacheRoot = (): string => {
|
|
27
|
-
const base = process.env.XDG_CACHE_HOME;
|
|
28
|
-
|
|
29
|
-
return join(base !== undefined && base.length > 0 ? base : join(homedir(), ".cache"), CACHE_NAMESPACE);
|
|
26
|
+
const DIGEST_PATTERN: Record<DigestAlgorithm, RegExp> = {
|
|
27
|
+
sha256: /^[\da-f]{64}$/,
|
|
28
|
+
sha512: /^[\da-f]{128}$/,
|
|
30
29
|
};
|
|
31
30
|
|
|
32
31
|
const cacheDir = (segments: string[]): string => {
|
|
@@ -36,10 +35,11 @@ const cacheDir = (segments: string[]): string => {
|
|
|
36
35
|
return dir;
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
const getDigest = (contents: Buffer): string =>
|
|
38
|
+
const getDigest = (contents: Buffer, algorithm: DigestAlgorithm): string =>
|
|
39
|
+
createHash(algorithm).update(contents).digest("hex");
|
|
40
40
|
|
|
41
|
-
const assertDigest = (url: string, contents: Buffer, expected: string): void => {
|
|
42
|
-
const actual = getDigest(contents);
|
|
41
|
+
const assertDigest = (url: string, contents: Buffer, expected: string, algorithm: DigestAlgorithm): void => {
|
|
42
|
+
const actual = getDigest(contents, algorithm);
|
|
43
43
|
|
|
44
44
|
if (actual !== expected) {
|
|
45
45
|
throw new Error(`Checksum mismatch for ${url}\n expected ${expected}\n received ${actual}`);
|
|
@@ -62,11 +62,11 @@ const fetchText = async (url: string): Promise<string> => {
|
|
|
62
62
|
return bytes.toString("utf8");
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
-
const readCachedDigest = (dest: string): string | undefined => {
|
|
65
|
+
const readCachedDigest = (dest: string, algorithm: DigestAlgorithm): string | undefined => {
|
|
66
66
|
try {
|
|
67
67
|
const cached = readFileSync(dest, "utf8").trim();
|
|
68
68
|
|
|
69
|
-
return DIGEST_PATTERN.test(cached) ? cached : undefined;
|
|
69
|
+
return DIGEST_PATTERN[algorithm].test(cached) ? cached : undefined;
|
|
70
70
|
} catch {
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
@@ -82,7 +82,7 @@ const publishedDigest = async (request: DigestRequest): Promise<string> => {
|
|
|
82
82
|
const checksums = await fetchText(request.url);
|
|
83
83
|
const digest = digestFromChecksums(checksums, request.assetName, request.subject);
|
|
84
84
|
|
|
85
|
-
if (!DIGEST_PATTERN.test(digest)) {
|
|
85
|
+
if (!DIGEST_PATTERN.sha256.test(digest)) {
|
|
86
86
|
throw new Error(`${request.subject} published a malformed checksum for ${request.assetName}: "${digest}"`);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -92,17 +92,17 @@ const publishedDigest = async (request: DigestRequest): Promise<string> => {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
const cachedDigest = async (request: DigestRequest): Promise<string> => {
|
|
95
|
-
const cached = readCachedDigest(request.dest);
|
|
95
|
+
const cached = readCachedDigest(request.dest, "sha256");
|
|
96
96
|
|
|
97
97
|
return cached ?? publishedDigest(request);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const isCacheUsable = (dest: string,
|
|
100
|
+
const isCacheUsable = (dest: string, digest: string, algorithm: DigestAlgorithm): boolean => {
|
|
101
101
|
if (!existsSync(dest)) {
|
|
102
102
|
return false;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
if (getDigest(readFileSync(dest)) ===
|
|
105
|
+
if (getDigest(readFileSync(dest), algorithm) === digest) {
|
|
106
106
|
return true;
|
|
107
107
|
}
|
|
108
108
|
|
|
@@ -112,16 +112,17 @@ const isCacheUsable = (dest: string, sha256: string): boolean => {
|
|
|
112
112
|
};
|
|
113
113
|
|
|
114
114
|
const downloadFile = async (request: DownloadRequest): Promise<string> => {
|
|
115
|
-
const { url, dest, label,
|
|
115
|
+
const { url, dest, label, digest, mode } = request;
|
|
116
|
+
const algorithm = request.algorithm ?? "sha256";
|
|
116
117
|
|
|
117
|
-
if (isCacheUsable(dest,
|
|
118
|
+
if (isCacheUsable(dest, digest, algorithm)) {
|
|
118
119
|
return dest;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
info(`Downloading ${label}`);
|
|
122
|
-
const expected = request.
|
|
123
|
+
const expected = request.freshDigest === undefined ? digest : await request.freshDigest();
|
|
123
124
|
const contents = await fetchBytes(url);
|
|
124
|
-
assertDigest(url, contents, expected);
|
|
125
|
+
assertDigest(url, contents, expected, algorithm);
|
|
125
126
|
const staging = `${dest}.partial`;
|
|
126
127
|
writeFileSync(staging, contents);
|
|
127
128
|
|
|
@@ -145,4 +146,12 @@ const digestFromChecksums = (checksums: string, assetName: string, subject: stri
|
|
|
145
146
|
return digest;
|
|
146
147
|
};
|
|
147
148
|
|
|
148
|
-
export {
|
|
149
|
+
export {
|
|
150
|
+
cacheDir,
|
|
151
|
+
cachedDigest,
|
|
152
|
+
type DigestRequest,
|
|
153
|
+
downloadFile,
|
|
154
|
+
publishedDigest,
|
|
155
|
+
readCachedDigest,
|
|
156
|
+
writeAtomically,
|
|
157
|
+
};
|