@gtkx/cli 1.6.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -44
- package/bin/gtkx-dev-runner.js +5 -1
- package/bin/gtkx.js +5 -1
- package/dist/builder.d.ts +1 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +44 -12
- package/dist/builder.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/config-dependencies.d.ts +3 -0
- package/dist/codegen/config-dependencies.d.ts.map +1 -0
- package/dist/codegen/config-dependencies.js +355 -0
- package/dist/codegen/config-dependencies.js.map +1 -0
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +49 -16
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts.map +1 -1
- package/dist/codegen/reference.js +2 -7
- package/dist/codegen/reference.js.map +1 -1
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +5 -16
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +9 -8
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +60 -113
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +3 -2
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js +14 -20
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts +5 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +83 -10
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cleanup.d.ts +9 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +42 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/codegen.d.ts +1 -0
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +6 -5
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +10 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +31 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +6 -15
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts.map +1 -1
- package/dist/deploy/depends.js +24 -2
- package/dist/deploy/depends.js.map +1 -1
- package/dist/deploy/download.d.ts +7 -3
- package/dist/deploy/download.d.ts.map +1 -1
- package/dist/deploy/download.js +19 -20
- package/dist/deploy/download.js.map +1 -1
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
- package/dist/deploy/freedesktop/copyright.js +2 -13
- package/dist/deploy/freedesktop/copyright.js.map +1 -1
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
- package/dist/deploy/freedesktop/metainfo.js +41 -2
- package/dist/deploy/freedesktop/metainfo.js.map +1 -1
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
- package/dist/deploy/freedesktop/validate.js +58 -14
- package/dist/deploy/freedesktop/validate.js.map +1 -1
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
- package/dist/deploy/freedesktop/xml.js +21 -25
- package/dist/deploy/freedesktop/xml.js.map +1 -1
- package/dist/deploy/native-addon.d.ts +5 -0
- package/dist/deploy/native-addon.d.ts.map +1 -0
- package/dist/deploy/native-addon.js +134 -0
- package/dist/deploy/native-addon.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +3 -2
- package/dist/deploy/nfpm/config.d.ts.map +1 -1
- package/dist/deploy/nfpm/config.js +7 -4
- package/dist/deploy/nfpm/config.js.map +1 -1
- package/dist/deploy/nfpm/contents.d.ts.map +1 -1
- package/dist/deploy/nfpm/contents.js +8 -0
- package/dist/deploy/nfpm/contents.js.map +1 -1
- package/dist/deploy/node-runtime/download.js +2 -2
- package/dist/deploy/node-runtime/download.js.map +1 -1
- package/dist/deploy/node-runtime/elf.d.ts +4 -1
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
- package/dist/deploy/node-runtime/elf.js +34 -5
- package/dist/deploy/node-runtime/elf.js.map +1 -1
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
- package/dist/deploy/node-runtime/guard.js +7 -14
- package/dist/deploy/node-runtime/guard.js.map +1 -1
- package/dist/deploy/node-runtime/index.d.ts +3 -1
- package/dist/deploy/node-runtime/index.d.ts.map +1 -1
- package/dist/deploy/node-runtime/index.js +103 -10
- package/dist/deploy/node-runtime/index.js.map +1 -1
- package/dist/deploy/node-runtime/license.d.ts.map +1 -1
- package/dist/deploy/node-runtime/license.js +2 -9
- package/dist/deploy/node-runtime/license.js.map +1 -1
- package/dist/deploy/node-runtime/sonames.d.ts +5 -0
- package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
- package/dist/deploy/node-runtime/sonames.js +13 -0
- package/dist/deploy/node-runtime/sonames.js.map +1 -0
- package/dist/deploy/notices/node-runtime.js +2 -2
- package/dist/deploy/notices/node-runtime.js.map +1 -1
- package/dist/deploy/notices/packages.d.ts.map +1 -1
- package/dist/deploy/notices/packages.js +3 -10
- package/dist/deploy/notices/packages.js.map +1 -1
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
- package/dist/deploy/payload/copy-tree.js +3 -3
- package/dist/deploy/payload/copy-tree.js.map +1 -1
- package/dist/deploy/payload/launcher.d.ts.map +1 -1
- package/dist/deploy/payload/launcher.js +14 -1
- package/dist/deploy/payload/launcher.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +2 -1
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +47 -8
- package/dist/deploy/payload/stage.js.map +1 -1
- package/dist/deploy/run-deploy.d.ts +2 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -1
- package/dist/deploy/run-deploy.js +197 -52
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/arch.d.ts +9 -3
- package/dist/deploy/settings/arch.d.ts.map +1 -1
- package/dist/deploy/settings/arch.js +27 -6
- package/dist/deploy/settings/arch.js.map +1 -1
- package/dist/deploy/settings/build-manifest.d.ts +6 -1
- package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
- package/dist/deploy/settings/build-manifest.js +17 -17
- package/dist/deploy/settings/build-manifest.js.map +1 -1
- package/dist/deploy/settings/extra-files.d.ts +1 -1
- package/dist/deploy/settings/extra-files.d.ts.map +1 -1
- package/dist/deploy/settings/extra-files.js +25 -3
- package/dist/deploy/settings/extra-files.js.map +1 -1
- package/dist/deploy/settings/index.d.ts +3 -1
- package/dist/deploy/settings/index.d.ts.map +1 -1
- package/dist/deploy/settings/index.js +4 -2
- package/dist/deploy/settings/index.js.map +1 -1
- package/dist/deploy/settings/libraries.d.ts.map +1 -1
- package/dist/deploy/settings/libraries.js +3 -19
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +4 -3
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +118 -19
- package/dist/deploy/settings/paths.js.map +1 -1
- package/dist/deploy/settings/screenshots.d.ts.map +1 -1
- package/dist/deploy/settings/screenshots.js +6 -31
- package/dist/deploy/settings/screenshots.js.map +1 -1
- package/dist/deploy/targets/appimage.d.ts.map +1 -1
- package/dist/deploy/targets/appimage.js +1 -0
- package/dist/deploy/targets/appimage.js.map +1 -1
- package/dist/deploy/targets/flatpak-pnpm.js +4 -4
- package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +17 -6
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/targets/flatpak-sources.js +1 -1
- package/dist/deploy/targets/flatpak-sources.js.map +1 -1
- package/dist/deploy/targets/flatpak.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak.js +1 -0
- package/dist/deploy/targets/flatpak.js.map +1 -1
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
- package/dist/deploy/targets/nfpm-target.js +13 -7
- package/dist/deploy/targets/nfpm-target.js.map +1 -1
- package/dist/deploy/types.d.ts +5 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/types.js.map +1 -1
- package/dist/deploy/vendored/appimagetool.js +2 -2
- package/dist/deploy/vendored/appimagetool.js.map +1 -1
- package/dist/deploy/vendored/nfpm.js +1 -1
- package/dist/deploy/vendored/nfpm.js.map +1 -1
- package/dist/dev/catalog-writes.d.ts +8 -0
- package/dist/dev/catalog-writes.d.ts.map +1 -0
- package/dist/dev/catalog-writes.js +26 -0
- package/dist/dev/catalog-writes.js.map +1 -0
- package/dist/dev/entry-env.d.ts +2 -1
- package/dist/dev/entry-env.d.ts.map +1 -1
- package/dist/dev/entry-env.js +2 -1
- package/dist/dev/entry-env.js.map +1 -1
- package/dist/dev/font-dir.d.ts +3 -0
- package/dist/dev/font-dir.d.ts.map +1 -0
- package/dist/dev/font-dir.js +9 -0
- package/dist/dev/font-dir.js.map +1 -0
- package/dist/dev/headless.d.ts +3 -0
- package/dist/dev/headless.d.ts.map +1 -0
- package/dist/dev/headless.js +35 -0
- package/dist/dev/headless.js.map +1 -0
- package/dist/dev/runner-deps.d.ts +1 -1
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +12 -7
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner-main.d.ts.map +1 -1
- package/dist/dev/runner-main.js +11 -5
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts +2 -0
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +26 -7
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/schema-dir.d.ts +1 -1
- package/dist/dev/schema-dir.d.ts.map +1 -1
- package/dist/dev/schema-dir.js +2 -4
- package/dist/dev/schema-dir.js.map +1 -1
- package/dist/dev/supervisor.d.ts +3 -1
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +132 -29
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +1 -1
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +14 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/dev/watch-ignore.d.ts +3 -0
- package/dist/dev/watch-ignore.d.ts.map +1 -0
- package/dist/dev/watch-ignore.js +11 -0
- package/dist/dev/watch-ignore.js.map +1 -0
- package/dist/i18n/catalogs.d.ts +6 -2
- package/dist/i18n/catalogs.d.ts.map +1 -1
- package/dist/i18n/catalogs.js +12 -8
- package/dist/i18n/catalogs.js.map +1 -1
- package/dist/i18n/metadata-templates.d.ts.map +1 -1
- package/dist/i18n/metadata-templates.js +2 -1
- package/dist/i18n/metadata-templates.js.map +1 -1
- package/dist/i18n/source-messages.d.ts +5 -21
- package/dist/i18n/source-messages.d.ts.map +1 -1
- package/dist/i18n/source-messages.js +1037 -92
- package/dist/i18n/source-messages.js.map +1 -1
- package/dist/i18n/types.d.ts +6 -7
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/i18n/types.js +83 -96
- package/dist/i18n/types.js.map +1 -1
- package/dist/internal/agent-rules.d.ts.map +1 -1
- package/dist/internal/agent-rules.js +7 -2
- package/dist/internal/agent-rules.js.map +1 -1
- package/dist/internal/banner.d.ts +4 -2
- package/dist/internal/banner.d.ts.map +1 -1
- package/dist/internal/banner.js +19 -5
- package/dist/internal/banner.js.map +1 -1
- package/dist/internal/build-manifest.d.ts +5 -2
- package/dist/internal/build-manifest.d.ts.map +1 -1
- package/dist/internal/build-manifest.js +15 -2
- package/dist/internal/build-manifest.js.map +1 -1
- package/dist/internal/build-output.d.ts +8 -0
- package/dist/internal/build-output.d.ts.map +1 -0
- package/dist/internal/build-output.js +116 -0
- package/dist/internal/build-output.js.map +1 -0
- package/dist/internal/cache-root.d.ts +3 -0
- package/dist/internal/cache-root.d.ts.map +1 -0
- package/dist/internal/cache-root.js +9 -0
- package/dist/internal/cache-root.js.map +1 -0
- package/dist/internal/compile-cache-store.d.ts +4 -0
- package/dist/internal/compile-cache-store.d.ts.map +1 -0
- package/dist/internal/compile-cache-store.js +41 -0
- package/dist/internal/compile-cache-store.js.map +1 -0
- package/dist/internal/compile-cache.d.ts +4 -0
- package/dist/internal/compile-cache.d.ts.map +1 -0
- package/dist/internal/compile-cache.js +16 -0
- package/dist/internal/compile-cache.js.map +1 -0
- package/dist/internal/deploy-out-dir.d.ts +4 -0
- package/dist/internal/deploy-out-dir.d.ts.map +1 -0
- package/dist/internal/deploy-out-dir.js +5 -0
- package/dist/internal/deploy-out-dir.js.map +1 -0
- package/dist/internal/docs-elements.d.ts +1 -0
- package/dist/internal/docs-elements.d.ts.map +1 -1
- package/dist/internal/docs-elements.js +6 -5
- package/dist/internal/docs-elements.js.map +1 -1
- package/dist/internal/entry-arg.d.ts +4 -1
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +7 -1
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/errors.d.ts +2 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/font-path.d.ts +4 -0
- package/dist/internal/font-path.d.ts.map +1 -0
- package/dist/internal/font-path.js +12 -0
- package/dist/internal/font-path.js.map +1 -0
- package/dist/internal/font-staging.d.ts +6 -0
- package/dist/internal/font-staging.d.ts.map +1 -0
- package/dist/internal/font-staging.js +94 -0
- package/dist/internal/font-staging.js.map +1 -0
- package/dist/internal/icon-path.d.ts.map +1 -1
- package/dist/internal/icon-path.js +5 -16
- package/dist/internal/icon-path.js.map +1 -1
- package/dist/internal/icon-staging.d.ts +3 -0
- package/dist/internal/icon-staging.d.ts.map +1 -0
- package/dist/internal/icon-staging.js +40 -0
- package/dist/internal/icon-staging.js.map +1 -0
- package/dist/internal/import-scan.d.ts +4 -0
- package/dist/internal/import-scan.d.ts.map +1 -0
- package/dist/internal/import-scan.js +138 -0
- package/dist/internal/import-scan.js.map +1 -0
- package/dist/internal/module-hash.d.ts +3 -0
- package/dist/internal/module-hash.d.ts.map +1 -0
- package/dist/internal/module-hash.js +19 -0
- package/dist/internal/module-hash.js.map +1 -0
- package/dist/internal/output-directory.d.ts +15 -0
- package/dist/internal/output-directory.d.ts.map +1 -0
- package/dist/internal/output-directory.js +490 -0
- package/dist/internal/output-directory.js.map +1 -0
- package/dist/internal/parent-process.d.ts +12 -0
- package/dist/internal/parent-process.d.ts.map +1 -0
- package/dist/internal/parent-process.js +74 -0
- package/dist/internal/parent-process.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +3 -0
- package/dist/internal/prepare-project.d.ts.map +1 -1
- package/dist/internal/prepare-project.js +9 -3
- package/dist/internal/prepare-project.js.map +1 -1
- package/dist/internal/react-compiler-cache.d.ts +13 -0
- package/dist/internal/react-compiler-cache.d.ts.map +1 -0
- package/dist/internal/react-compiler-cache.js +182 -0
- package/dist/internal/react-compiler-cache.js.map +1 -0
- package/dist/internal/source-imports.d.ts +7 -2
- package/dist/internal/source-imports.d.ts.map +1 -1
- package/dist/internal/source-imports.js +38 -49
- package/dist/internal/source-imports.js.map +1 -1
- package/dist/internal/staging-file.d.ts +5 -0
- package/dist/internal/staging-file.d.ts.map +1 -0
- package/dist/internal/staging-file.js +35 -0
- package/dist/internal/staging-file.js.map +1 -0
- package/dist/internal/xdg-banner.d.ts +4 -0
- package/dist/internal/xdg-banner.d.ts.map +1 -0
- package/dist/internal/xdg-banner.js +11 -0
- package/dist/internal/xdg-banner.js.map +1 -0
- package/dist/internal/xdg-data-dirs.d.ts +2 -1
- package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
- package/dist/internal/xdg-data-dirs.js +1 -1
- package/dist/internal/xdg-data-dirs.js.map +1 -1
- package/dist/mcp/client.js +2 -2
- package/dist/mcp/client.js.map +1 -1
- package/dist/settings/render.d.ts +0 -1
- package/dist/settings/render.d.ts.map +1 -1
- package/dist/settings/render.js +1 -11
- package/dist/settings/render.js.map +1 -1
- package/dist/settings/schema.d.ts +2 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +24 -70
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -0
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +1 -2
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
- package/dist/vite-plugins/asset-imports.js +36 -35
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/asset-specifier.d.ts +5 -3
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
- package/dist/vite-plugins/asset-specifier.js +10 -4
- package/dist/vite-plugins/asset-specifier.js.map +1 -1
- package/dist/vite-plugins/build-manifest.d.ts +5 -1
- package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
- package/dist/vite-plugins/build-manifest.js +2 -1
- package/dist/vite-plugins/build-manifest.js.map +1 -1
- package/dist/vite-plugins/built-url.d.ts.map +1 -1
- package/dist/vite-plugins/built-url.js +5 -2
- package/dist/vite-plugins/built-url.js.map +1 -1
- package/dist/vite-plugins/css.d.ts.map +1 -1
- package/dist/vite-plugins/css.js +13 -5
- package/dist/vite-plugins/css.js.map +1 -1
- package/dist/vite-plugins/ensure-store.d.ts +1 -1
- package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
- package/dist/vite-plugins/ensure-store.js +2 -2
- package/dist/vite-plugins/ensure-store.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/font-name.d.ts +3 -0
- package/dist/vite-plugins/font-name.d.ts.map +1 -0
- package/dist/vite-plugins/font-name.js +406 -0
- package/dist/vite-plugins/font-name.js.map +1 -0
- package/dist/vite-plugins/font-worker-env.d.ts +4 -0
- package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/font-worker-env.js +19 -0
- package/dist/vite-plugins/font-worker-env.js.map +1 -0
- package/dist/vite-plugins/font.d.ts +4 -0
- package/dist/vite-plugins/font.d.ts.map +1 -0
- package/dist/vite-plugins/font.js +111 -0
- package/dist/vite-plugins/font.js.map +1 -0
- package/dist/vite-plugins/i18n.d.ts +11 -2
- package/dist/vite-plugins/i18n.d.ts.map +1 -1
- package/dist/vite-plugins/i18n.js +75 -8
- package/dist/vite-plugins/i18n.js.map +1 -1
- package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
- package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/icon-worker-env.js +23 -0
- package/dist/vite-plugins/icon-worker-env.js.map +1 -0
- package/dist/vite-plugins/icons.d.ts.map +1 -1
- package/dist/vite-plugins/icons.js +4 -9
- package/dist/vite-plugins/icons.js.map +1 -1
- package/dist/vite-plugins/index.d.ts +10 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +19 -7
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/native.d.ts.map +1 -1
- package/dist/vite-plugins/native.js +0 -4
- package/dist/vite-plugins/native.js.map +1 -1
- package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
- package/dist/vite-plugins/react-compiler.js +57 -18
- package/dist/vite-plugins/react-compiler.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +3 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +3 -1
- package/dist/vite-plugins/resource-shared.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +40 -102
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts.map +1 -1
- package/dist/vite-plugins/self-contained.js +159 -158
- package/dist/vite-plugins/self-contained.js.map +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
- package/dist/vite-plugins/settings-worker-env.js +5 -7
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts +1 -2
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +32 -27
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts.map +1 -1
- package/dist/vite-plugins/store-links.js +9 -5
- package/dist/vite-plugins/store-links.js.map +1 -1
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +25 -25
- package/dist/vite-plugins/undeclared-library.js.map +1 -1
- package/dist/vite-plugins/worker.d.ts.map +1 -1
- package/dist/vite-plugins/worker.js +21 -14
- package/dist/vite-plugins/worker.js.map +1 -1
- package/dist/vitest-plugin.d.ts +4 -3
- package/dist/vitest-plugin.d.ts.map +1 -1
- package/dist/vitest-plugin.js +12 -8
- package/dist/vitest-plugin.js.map +1 -1
- package/env.d.ts +9 -0
- package/package.json +28 -17
- package/src/builder.ts +45 -12
- package/src/cli.ts +15 -2
- package/src/codegen/config-dependencies.ts +470 -0
- package/src/codegen/freshness.ts +70 -17
- package/src/codegen/reference.ts +2 -8
- package/src/codegen/report.ts +5 -21
- package/src/codegen/run-codegen.ts +73 -160
- package/src/codegen/store-resolver.ts +16 -27
- package/src/commands/build.ts +13 -2
- package/src/commands/cleanup.ts +48 -0
- package/src/commands/codegen.ts +6 -5
- package/src/commands/deploy.ts +10 -2
- package/src/commands/dev.ts +45 -4
- package/src/commands/docs.ts +6 -17
- package/src/deploy/depends.ts +30 -3
- package/src/deploy/download.ts +33 -24
- package/src/deploy/freedesktop/copyright.ts +2 -14
- package/src/deploy/freedesktop/metainfo.ts +73 -21
- package/src/deploy/freedesktop/validate.ts +80 -15
- package/src/deploy/freedesktop/xml.ts +24 -32
- package/src/deploy/native-addon.ts +183 -0
- package/src/deploy/nfpm/config.ts +13 -4
- package/src/deploy/nfpm/contents.ts +8 -0
- package/src/deploy/node-runtime/download.ts +2 -2
- package/src/deploy/node-runtime/elf.ts +46 -5
- package/src/deploy/node-runtime/guard.ts +10 -14
- package/src/deploy/node-runtime/index.ts +148 -12
- package/src/deploy/node-runtime/license.ts +2 -8
- package/src/deploy/node-runtime/sonames.ts +17 -0
- package/src/deploy/notices/node-runtime.ts +2 -2
- package/src/deploy/notices/packages.ts +3 -11
- package/src/deploy/payload/copy-tree.ts +3 -4
- package/src/deploy/payload/launcher.ts +20 -1
- package/src/deploy/payload/stage.ts +78 -11
- package/src/deploy/run-deploy.ts +227 -72
- package/src/deploy/settings/arch.ts +40 -8
- package/src/deploy/settings/build-manifest.ts +30 -17
- package/src/deploy/settings/extra-files.ts +30 -4
- package/src/deploy/settings/index.ts +7 -2
- package/src/deploy/settings/libraries.ts +2 -22
- package/src/deploy/settings/paths.ts +78 -21
- package/src/deploy/settings/screenshots.ts +8 -46
- package/src/deploy/targets/appimage.ts +1 -0
- package/src/deploy/targets/flatpak-pnpm.ts +4 -4
- package/src/deploy/targets/flatpak-source.ts +19 -6
- package/src/deploy/targets/flatpak-sources.ts +1 -1
- package/src/deploy/targets/flatpak.ts +1 -0
- package/src/deploy/targets/nfpm-target.ts +14 -6
- package/src/deploy/types.ts +5 -1
- package/src/deploy/vendored/appimagetool.ts +2 -2
- package/src/deploy/vendored/nfpm.ts +1 -1
- package/src/dev/catalog-writes.ts +35 -0
- package/src/dev/entry-env.ts +2 -1
- package/src/dev/font-dir.ts +11 -0
- package/src/dev/headless.ts +40 -0
- package/src/dev/runner-deps.ts +20 -7
- package/src/dev/runner-main.ts +13 -5
- package/src/dev/runner.ts +37 -7
- package/src/dev/schema-dir.ts +2 -4
- package/src/dev/supervisor.ts +183 -32
- package/src/dev/vite-dev-server.ts +20 -2
- package/src/dev/watch-ignore.ts +16 -0
- package/src/i18n/catalogs.ts +23 -9
- package/src/i18n/metadata-templates.ts +2 -1
- package/src/i18n/source-messages.ts +1641 -262
- package/src/i18n/types.ts +97 -131
- package/src/internal/agent-rules.ts +7 -2
- package/src/internal/banner.ts +27 -6
- package/src/internal/build-manifest.ts +25 -1
- package/src/internal/build-output.ts +171 -0
- package/src/internal/cache-root.ts +12 -0
- package/src/internal/compile-cache-store.ts +50 -0
- package/src/internal/compile-cache.ts +20 -0
- package/src/internal/deploy-out-dir.ts +8 -0
- package/src/internal/docs-elements.ts +11 -5
- package/src/internal/entry-arg.ts +8 -1
- package/src/internal/errors.ts +1 -1
- package/src/internal/font-path.ts +15 -0
- package/src/internal/font-staging.ts +131 -0
- package/src/internal/icon-path.ts +6 -19
- package/src/internal/icon-staging.ts +58 -0
- package/src/internal/import-scan.ts +206 -0
- package/src/internal/module-hash.ts +22 -0
- package/src/internal/output-directory.ts +699 -0
- package/src/internal/parent-process.ts +110 -0
- package/src/internal/prepare-project.ts +11 -5
- package/src/internal/react-compiler-cache.ts +246 -0
- package/src/internal/source-imports.ts +64 -55
- package/src/internal/staging-file.ts +42 -0
- package/src/internal/xdg-banner.ts +13 -0
- package/src/internal/xdg-data-dirs.ts +1 -1
- package/src/mcp/client.ts +2 -2
- package/src/settings/render.ts +1 -13
- package/src/settings/schema.ts +23 -91
- package/src/vite-plugins/asset-extensions.ts +2 -0
- package/src/vite-plugins/asset-imports.ts +39 -45
- package/src/vite-plugins/asset-specifier.ts +17 -5
- package/src/vite-plugins/build-manifest.ts +7 -1
- package/src/vite-plugins/built-url.ts +6 -2
- package/src/vite-plugins/css.ts +16 -5
- package/src/vite-plugins/ensure-store.ts +2 -2
- package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
- package/src/vite-plugins/font-name.ts +582 -0
- package/src/vite-plugins/font-worker-env.ts +25 -0
- package/src/vite-plugins/font.ts +180 -0
- package/src/vite-plugins/i18n.ts +123 -11
- package/src/vite-plugins/icon-worker-env.ts +36 -0
- package/src/vite-plugins/icons.ts +4 -10
- package/src/vite-plugins/index.ts +36 -13
- package/src/vite-plugins/native.ts +0 -5
- package/src/vite-plugins/react-compiler.ts +83 -19
- package/src/vite-plugins/resource-shared.ts +4 -0
- package/src/vite-plugins/resources.ts +47 -144
- package/src/vite-plugins/self-contained.ts +184 -185
- package/src/vite-plugins/settings-worker-env.ts +5 -7
- package/src/vite-plugins/settings.ts +44 -33
- package/src/vite-plugins/store-links.ts +10 -5
- package/src/vite-plugins/undeclared-library.ts +30 -32
- package/src/vite-plugins/worker.ts +31 -16
- package/src/vitest-plugin.ts +12 -8
- package/dist/i18n/binding-extractor.d.ts +0 -30
- package/dist/i18n/binding-extractor.d.ts.map +0 -1
- package/dist/i18n/binding-extractor.js +0 -1324
- package/dist/i18n/binding-extractor.js.map +0 -1
- package/dist/i18n/extractor-plugin.d.ts +0 -8
- package/dist/i18n/extractor-plugin.d.ts.map +0 -1
- package/dist/i18n/extractor-plugin.js +0 -247
- package/dist/i18n/extractor-plugin.js.map +0 -1
- package/dist/internal/data-dir.d.ts +0 -4
- package/dist/internal/data-dir.d.ts.map +0 -1
- package/dist/internal/data-dir.js +0 -52
- package/dist/internal/data-dir.js.map +0 -1
- package/dist/vite-plugins/animated.d.ts +0 -5
- package/dist/vite-plugins/animated.d.ts.map +0 -1
- package/dist/vite-plugins/animated.js +0 -325
- package/dist/vite-plugins/animated.js.map +0 -1
- package/src/i18n/binding-extractor.ts +0 -1969
- package/src/i18n/extractor-plugin.ts +0 -413
- package/src/internal/data-dir.ts +0 -70
- package/src/vite-plugins/animated.ts +0 -486
|
@@ -1,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,44 +12,30 @@ 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
|
|
|
17
19
|
type CodegenReactPackage = {
|
|
18
20
|
version: string;
|
|
19
|
-
subexports: string[];
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
type ResolvedPackage = { dir: string; version: string };
|
|
23
|
-
|
|
24
23
|
type CodegenContext = {
|
|
25
24
|
root: string;
|
|
26
25
|
config: Config;
|
|
27
26
|
configFile: string;
|
|
27
|
+
configDependencies: string[];
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
const parsed = JSON.parse(readFileSync(packageJsonPath, "utf8")) as { version?: string };
|
|
32
|
-
|
|
33
|
-
return parsed.version ?? "0.0.0";
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const resolvePackage = (require: NodeJS.Require, dir: string, packageName: string): ResolvedPackage | null => {
|
|
30
|
+
const hasPackage = (require: NodeJS.Require, dir: string, packageName: string): boolean => {
|
|
37
31
|
try {
|
|
38
|
-
|
|
32
|
+
require.resolve(`${packageName}/package.json`);
|
|
39
33
|
|
|
40
|
-
return
|
|
34
|
+
return true;
|
|
41
35
|
} catch {
|
|
42
36
|
const unscoped = packageName.replace(/^@[^/]+\//, "");
|
|
43
|
-
const workspacePkg = join(dir, "packages", unscoped, "package.json");
|
|
44
|
-
|
|
45
|
-
if (!existsSync(workspacePkg)) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const real = realpathSync(workspacePkg);
|
|
50
37
|
|
|
51
|
-
return
|
|
38
|
+
return existsSync(join(dir, "packages", unscoped, "package.json"));
|
|
52
39
|
}
|
|
53
40
|
};
|
|
54
41
|
|
|
@@ -57,12 +44,12 @@ const siblingStore = (giDir: string): string => join(dirname(giDir), "jsx");
|
|
|
57
44
|
const resolveCodegenStore = (dir: string): CodegenStore => {
|
|
58
45
|
const require = createRequire(pathToFileURL(join(dir, "__gtkx_resolver__.js")).href);
|
|
59
46
|
|
|
60
|
-
if (
|
|
47
|
+
if (!hasPackage(require, dir, "@gtkx/native")) {
|
|
61
48
|
throw new Error("Cannot resolve @gtkx/native from the project; is it installed?");
|
|
62
49
|
}
|
|
63
50
|
|
|
64
51
|
const store = resolveStore(dir);
|
|
65
|
-
const hasReactRuntime =
|
|
52
|
+
const hasReactRuntime = hasPackage(require, dir, "react");
|
|
66
53
|
|
|
67
54
|
return {
|
|
68
55
|
giStoreDir: store.gi.storeDir,
|
|
@@ -70,17 +57,19 @@ const resolveCodegenStore = (dir: string): CodegenStore => {
|
|
|
70
57
|
jsxStoreDir: store.jsx?.storeDir ?? siblingStore(store.gi.storeDir),
|
|
71
58
|
jsxLinkDir: store.jsx?.linkDir ?? siblingStore(store.gi.linkDir),
|
|
72
59
|
runtimeVersion: store.gi.version,
|
|
60
|
+
owner: store.gi.owner ?? realpathSync(dir),
|
|
73
61
|
react:
|
|
74
62
|
hasReactRuntime && store.jsx !== null
|
|
75
|
-
? { version: store.jsx.version
|
|
63
|
+
? { version: store.jsx.version }
|
|
76
64
|
: null,
|
|
77
65
|
};
|
|
78
66
|
};
|
|
79
67
|
|
|
80
|
-
const resolveCodegenContext = async (cwd: string, mode?: string): Promise<CodegenContext> => {
|
|
81
|
-
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;
|
|
82
71
|
|
|
83
|
-
return { root: cwd, config, configFile };
|
|
72
|
+
return { root: cwd, config, configFile, configDependencies: configDependenciesFor(loaded) };
|
|
84
73
|
};
|
|
85
74
|
|
|
86
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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mergeOmittedProps, resolveGirPath, resolveLibraries } from "@gtkx/codegen";
|
|
2
2
|
import { writeDocs } from "@gtkx/codegen/internal";
|
|
3
3
|
import { loadConfig } from "@gtkx/config";
|
|
4
|
-
import {
|
|
5
|
-
import { info } from "@gtkx/utils";
|
|
4
|
+
import { resolveOmittedProps } from "@gtkx/config/internal";
|
|
5
|
+
import { info, isPathInside } from "@gtkx/utils";
|
|
6
6
|
import { defineCommand } from "citty";
|
|
7
|
-
import {
|
|
7
|
+
import { resolve } from "node:path";
|
|
8
8
|
import { resolveDocsElements } from "../internal/docs-elements.js";
|
|
9
9
|
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
10
10
|
|
|
@@ -57,8 +57,7 @@ const docs = defineCommand({
|
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
const
|
|
61
|
-
const libraries = resolveLibraries(config.libraries, girPath, future.isAdwaitaDefault);
|
|
60
|
+
const libraries = resolveLibraries(config.libraries);
|
|
62
61
|
const startedAt = Date.now();
|
|
63
62
|
const outDir = resolveOutDir(cwd, args.out);
|
|
64
63
|
const builtin = await resolveDocsElements(cwd);
|
|
@@ -69,13 +68,9 @@ const docs = defineCommand({
|
|
|
69
68
|
outDir,
|
|
70
69
|
basePath: args["base-path"],
|
|
71
70
|
props: builtin.props,
|
|
71
|
+
acceptedChildTypes: builtin.acceptedChildTypes,
|
|
72
72
|
omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
|
|
73
73
|
isForced: args.force,
|
|
74
|
-
isByteArrayTyped: future.isByteArrayTyped,
|
|
75
|
-
isValueUnwrapped: future.isValueUnwrapped,
|
|
76
|
-
isFinishTrimmed: future.isFinishTrimmed,
|
|
77
|
-
isInoutInPlace: future.isInoutInPlace,
|
|
78
|
-
isTreeShaken: future.isTreeShaken,
|
|
79
74
|
});
|
|
80
75
|
|
|
81
76
|
if (!isRegenerated) {
|
|
@@ -93,12 +88,6 @@ const docs = defineCommand({
|
|
|
93
88
|
},
|
|
94
89
|
});
|
|
95
90
|
|
|
96
|
-
const isBelow = (parent: string, child: string): boolean => {
|
|
97
|
-
const path = relative(parent, child);
|
|
98
|
-
|
|
99
|
-
return path !== "" && path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
100
|
-
};
|
|
101
|
-
|
|
102
91
|
const outDirReason = (cwd: string, out: string, outDir: string): string => {
|
|
103
92
|
if (out.trim() === "") {
|
|
104
93
|
return "it was empty, which names the project root itself";
|
|
@@ -114,7 +103,7 @@ const outDirReason = (cwd: string, out: string, outDir: string): string => {
|
|
|
114
103
|
const resolveOutDir = (cwd: string, out: string): string => {
|
|
115
104
|
const outDir = out.trim() === "" ? cwd : resolve(cwd, out);
|
|
116
105
|
|
|
117
|
-
if (
|
|
106
|
+
if (isPathInside(cwd, outDir)) {
|
|
118
107
|
return outDir;
|
|
119
108
|
}
|
|
120
109
|
|
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
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
1
|
import type { DeploySettings, Notice, NoticeSection } from "../types.js";
|
|
3
2
|
import { BUNDLE_FILENAME } from "../../vite-plugins/esm-extension.js";
|
|
3
|
+
import { readLicenseText } from "../notices/text.js";
|
|
4
4
|
|
|
5
5
|
type FileStanza = {
|
|
6
6
|
settings: DeploySettings;
|
|
@@ -30,18 +30,6 @@ const foldedField = (name: string, lines: string[]): string[] => {
|
|
|
30
30
|
return first === undefined ? [] : [`${name}: ${first}`, ...rest.map((line) => indentLine(line))];
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
const licenseText = (licenseFile: string | null): string | null => {
|
|
34
|
-
if (licenseFile === null) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
try {
|
|
39
|
-
return readFileSync(licenseFile, "utf8").trimEnd();
|
|
40
|
-
} catch {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
33
|
const shortName = (license: string): string =>
|
|
46
34
|
license
|
|
47
35
|
.replaceAll(SPDX_GROUPING, " ")
|
|
@@ -159,7 +147,7 @@ const applicationStanza = (settings: DeploySettings, text: string | null): strin
|
|
|
159
147
|
];
|
|
160
148
|
|
|
161
149
|
const renderCopyright = (settings: DeploySettings, sections: NoticeSection[]): string => {
|
|
162
|
-
const own =
|
|
150
|
+
const own = settings.paths.licenseFile === null ? null : readLicenseText(settings.paths.licenseFile);
|
|
163
151
|
const reproduced: Set<string> = new Set(own === null ? [] : [own]);
|
|
164
152
|
|
|
165
153
|
const stanzas = filePatterns(sections).flatMap((files) =>
|