@gtkx/cli 1.0.0-rc.4 → 1.1.0
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 +5 -5
- package/dist/builder.d.ts +2 -2
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +21 -3
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +9 -3
- package/dist/cli.js.map +1 -1
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +2 -4
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +8 -5
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +25 -19
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +1 -1
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +5 -6
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +11 -1
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +22 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +44 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +7 -5
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts +2 -2
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +27 -4
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts +8 -0
- package/dist/deploy/depends.d.ts.map +1 -0
- package/dist/deploy/depends.js +27 -0
- package/dist/deploy/depends.js.map +1 -0
- package/dist/deploy/download.d.ts +20 -0
- package/dist/deploy/download.d.ts.map +1 -0
- package/dist/deploy/download.js +98 -0
- package/dist/deploy/download.js.map +1 -0
- package/dist/deploy/freedesktop/copyright.d.ts +4 -0
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -0
- package/dist/deploy/freedesktop/copyright.js +33 -0
- package/dist/deploy/freedesktop/copyright.js.map +1 -0
- package/dist/deploy/freedesktop/dbus-service.d.ts +4 -0
- package/dist/deploy/freedesktop/dbus-service.d.ts.map +1 -0
- package/dist/deploy/freedesktop/dbus-service.js +15 -0
- package/dist/deploy/freedesktop/dbus-service.js.map +1 -0
- package/dist/deploy/freedesktop/desktop-entry.d.ts +4 -0
- package/dist/deploy/freedesktop/desktop-entry.d.ts.map +1 -0
- package/dist/deploy/freedesktop/desktop-entry.js +73 -0
- package/dist/deploy/freedesktop/desktop-entry.js.map +1 -0
- package/dist/deploy/freedesktop/ini.d.ts +7 -0
- package/dist/deploy/freedesktop/ini.d.ts.map +1 -0
- package/dist/deploy/freedesktop/ini.js +22 -0
- package/dist/deploy/freedesktop/ini.js.map +1 -0
- package/dist/deploy/freedesktop/metainfo-sections.d.ts +13 -0
- package/dist/deploy/freedesktop/metainfo-sections.d.ts.map +1 -0
- package/dist/deploy/freedesktop/metainfo-sections.js +73 -0
- package/dist/deploy/freedesktop/metainfo-sections.js.map +1 -0
- package/dist/deploy/freedesktop/metainfo.d.ts +4 -0
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -0
- package/dist/deploy/freedesktop/metainfo.js +29 -0
- package/dist/deploy/freedesktop/metainfo.js.map +1 -0
- package/dist/deploy/freedesktop/mime-package.d.ts +4 -0
- package/dist/deploy/freedesktop/mime-package.d.ts.map +1 -0
- package/dist/deploy/freedesktop/mime-package.js +16 -0
- package/dist/deploy/freedesktop/mime-package.js.map +1 -0
- package/dist/deploy/freedesktop/validate.d.ts +4 -0
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -0
- package/dist/deploy/freedesktop/validate.js +81 -0
- package/dist/deploy/freedesktop/validate.js.map +1 -0
- package/dist/deploy/freedesktop/xml.d.ts +11 -0
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -0
- package/dist/deploy/freedesktop/xml.js +33 -0
- package/dist/deploy/freedesktop/xml.js.map +1 -0
- package/dist/deploy/git.d.ts +4 -0
- package/dist/deploy/git.d.ts.map +1 -0
- package/dist/deploy/git.js +17 -0
- package/dist/deploy/git.js.map +1 -0
- package/dist/deploy/install-hints.d.ts +5 -0
- package/dist/deploy/install-hints.d.ts.map +1 -0
- package/dist/deploy/install-hints.js +85 -0
- package/dist/deploy/install-hints.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +8 -0
- package/dist/deploy/nfpm/config.d.ts.map +1 -0
- package/dist/deploy/nfpm/config.js +119 -0
- package/dist/deploy/nfpm/config.js.map +1 -0
- package/dist/deploy/nfpm/contents.d.ts +12 -0
- package/dist/deploy/nfpm/contents.d.ts.map +1 -0
- package/dist/deploy/nfpm/contents.js +48 -0
- package/dist/deploy/nfpm/contents.js.map +1 -0
- package/dist/deploy/nfpm/description.d.ts +5 -0
- package/dist/deploy/nfpm/description.d.ts.map +1 -0
- package/dist/deploy/nfpm/description.js +5 -0
- package/dist/deploy/nfpm/description.js.map +1 -0
- package/dist/deploy/nfpm/optional.d.ts +5 -0
- package/dist/deploy/nfpm/optional.d.ts.map +1 -0
- package/dist/deploy/nfpm/optional.js +4 -0
- package/dist/deploy/nfpm/optional.js.map +1 -0
- package/dist/deploy/nfpm/pack.d.ts +5 -0
- package/dist/deploy/nfpm/pack.d.ts.map +1 -0
- package/dist/deploy/nfpm/pack.js +32 -0
- package/dist/deploy/nfpm/pack.js.map +1 -0
- package/dist/deploy/node-runtime/download.d.ts +3 -0
- package/dist/deploy/node-runtime/download.d.ts.map +1 -0
- package/dist/deploy/node-runtime/download.js +39 -0
- package/dist/deploy/node-runtime/download.js.map +1 -0
- package/dist/deploy/node-runtime/elf.d.ts +7 -0
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -0
- package/dist/deploy/node-runtime/elf.js +100 -0
- package/dist/deploy/node-runtime/elf.js.map +1 -0
- package/dist/deploy/node-runtime/guard.d.ts +4 -0
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -0
- package/dist/deploy/node-runtime/guard.js +22 -0
- package/dist/deploy/node-runtime/guard.js.map +1 -0
- package/dist/deploy/node-runtime/index.d.ts +4 -0
- package/dist/deploy/node-runtime/index.d.ts.map +1 -0
- package/dist/deploy/node-runtime/index.js +61 -0
- package/dist/deploy/node-runtime/index.js.map +1 -0
- package/dist/deploy/payload/copy-tree.d.ts +7 -0
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -0
- package/dist/deploy/payload/copy-tree.js +36 -0
- package/dist/deploy/payload/copy-tree.js.map +1 -0
- package/dist/deploy/payload/icons.d.ts +6 -0
- package/dist/deploy/payload/icons.d.ts.map +1 -0
- package/dist/deploy/payload/icons.js +53 -0
- package/dist/deploy/payload/icons.js.map +1 -0
- package/dist/deploy/payload/launcher.d.ts +5 -0
- package/dist/deploy/payload/launcher.d.ts.map +1 -0
- package/dist/deploy/payload/launcher.js +22 -0
- package/dist/deploy/payload/launcher.js.map +1 -0
- package/dist/deploy/payload/schemas.d.ts +4 -0
- package/dist/deploy/payload/schemas.d.ts.map +1 -0
- package/dist/deploy/payload/schemas.js +17 -0
- package/dist/deploy/payload/schemas.js.map +1 -0
- package/dist/deploy/payload/stage.d.ts +15 -0
- package/dist/deploy/payload/stage.d.ts.map +1 -0
- package/dist/deploy/payload/stage.js +100 -0
- package/dist/deploy/payload/stage.js.map +1 -0
- package/dist/deploy/registry.d.ts +7 -0
- package/dist/deploy/registry.d.ts.map +1 -0
- package/dist/deploy/registry.js +30 -0
- package/dist/deploy/registry.js.map +1 -0
- package/dist/deploy/run-deploy.d.ts +11 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -0
- package/dist/deploy/run-deploy.js +153 -0
- package/dist/deploy/run-deploy.js.map +1 -0
- package/dist/deploy/settings/arch.d.ts +4 -0
- package/dist/deploy/settings/arch.d.ts.map +1 -0
- package/dist/deploy/settings/arch.js +13 -0
- package/dist/deploy/settings/arch.js.map +1 -0
- package/dist/deploy/settings/categories.d.ts +4 -0
- package/dist/deploy/settings/categories.d.ts.map +1 -0
- package/dist/deploy/settings/categories.js +29 -0
- package/dist/deploy/settings/categories.js.map +1 -0
- package/dist/deploy/settings/exec.d.ts +6 -0
- package/dist/deploy/settings/exec.d.ts.map +1 -0
- package/dist/deploy/settings/exec.js +20 -0
- package/dist/deploy/settings/exec.js.map +1 -0
- package/dist/deploy/settings/identity.d.ts +18 -0
- package/dist/deploy/settings/identity.d.ts.map +1 -0
- package/dist/deploy/settings/identity.js +73 -0
- package/dist/deploy/settings/identity.js.map +1 -0
- package/dist/deploy/settings/index.d.ts +11 -0
- package/dist/deploy/settings/index.d.ts.map +1 -0
- package/dist/deploy/settings/index.js +103 -0
- package/dist/deploy/settings/index.js.map +1 -0
- package/dist/deploy/settings/package-manifest.d.ts +15 -0
- package/dist/deploy/settings/package-manifest.d.ts.map +1 -0
- package/dist/deploy/settings/package-manifest.js +41 -0
- package/dist/deploy/settings/package-manifest.js.map +1 -0
- package/dist/deploy/settings/paths.d.ts +9 -0
- package/dist/deploy/settings/paths.d.ts.map +1 -0
- package/dist/deploy/settings/paths.js +82 -0
- package/dist/deploy/settings/paths.js.map +1 -0
- package/dist/deploy/settings/screenshots.d.ts +8 -0
- package/dist/deploy/settings/screenshots.d.ts.map +1 -0
- package/dist/deploy/settings/screenshots.js +79 -0
- package/dist/deploy/settings/screenshots.js.map +1 -0
- package/dist/deploy/settings/starter.d.ts +4 -0
- package/dist/deploy/settings/starter.d.ts.map +1 -0
- package/dist/deploy/settings/starter.js +28 -0
- package/dist/deploy/settings/starter.js.map +1 -0
- package/dist/deploy/settings/version.d.ts +9 -0
- package/dist/deploy/settings/version.d.ts.map +1 -0
- package/dist/deploy/settings/version.js +37 -0
- package/dist/deploy/settings/version.js.map +1 -0
- package/dist/deploy/targets/appimage.d.ts +4 -0
- package/dist/deploy/targets/appimage.d.ts.map +1 -0
- package/dist/deploy/targets/appimage.js +105 -0
- package/dist/deploy/targets/appimage.js.map +1 -0
- package/dist/deploy/targets/deb.d.ts +4 -0
- package/dist/deploy/targets/deb.d.ts.map +1 -0
- package/dist/deploy/targets/deb.js +4 -0
- package/dist/deploy/targets/deb.js.map +1 -0
- package/dist/deploy/targets/flatpak-manifest.d.ts +6 -0
- package/dist/deploy/targets/flatpak-manifest.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-manifest.js +48 -0
- package/dist/deploy/targets/flatpak-manifest.js.map +1 -0
- package/dist/deploy/targets/flatpak-prebuilt.d.ts +8 -0
- package/dist/deploy/targets/flatpak-prebuilt.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-prebuilt.js +43 -0
- package/dist/deploy/targets/flatpak-prebuilt.js.map +1 -0
- package/dist/deploy/targets/flatpak-source.d.ts +5 -0
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-source.js +110 -0
- package/dist/deploy/targets/flatpak-source.js.map +1 -0
- package/dist/deploy/targets/flatpak-sources.d.ts +17 -0
- package/dist/deploy/targets/flatpak-sources.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak-sources.js +108 -0
- package/dist/deploy/targets/flatpak-sources.js.map +1 -0
- package/dist/deploy/targets/flatpak.d.ts +4 -0
- package/dist/deploy/targets/flatpak.d.ts.map +1 -0
- package/dist/deploy/targets/flatpak.js +112 -0
- package/dist/deploy/targets/flatpak.js.map +1 -0
- package/dist/deploy/targets/nfpm-target.d.ts +5 -0
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -0
- package/dist/deploy/targets/nfpm-target.js +26 -0
- package/dist/deploy/targets/nfpm-target.js.map +1 -0
- package/dist/deploy/targets/rpm.d.ts +4 -0
- package/dist/deploy/targets/rpm.d.ts.map +1 -0
- package/dist/deploy/targets/rpm.js +4 -0
- package/dist/deploy/targets/rpm.js.map +1 -0
- package/dist/deploy/tools.d.ts +18 -0
- package/dist/deploy/tools.d.ts.map +1 -0
- package/dist/deploy/tools.js +92 -0
- package/dist/deploy/tools.js.map +1 -0
- package/dist/deploy/types.d.ts +140 -0
- package/dist/deploy/types.d.ts.map +1 -0
- package/dist/deploy/types.js +2 -0
- package/dist/deploy/types.js.map +1 -0
- package/dist/deploy/vendored/appimagetool.d.ts +7 -0
- package/dist/deploy/vendored/appimagetool.d.ts.map +1 -0
- package/dist/deploy/vendored/appimagetool.js +42 -0
- package/dist/deploy/vendored/appimagetool.js.map +1 -0
- package/dist/deploy/vendored/nfpm.d.ts +3 -0
- package/dist/deploy/vendored/nfpm.d.ts.map +1 -0
- package/dist/deploy/vendored/nfpm.js +60 -0
- package/dist/deploy/vendored/nfpm.js.map +1 -0
- package/dist/dev/change-queue.d.ts +11 -0
- package/dist/dev/change-queue.d.ts.map +1 -0
- package/dist/dev/change-queue.js +34 -0
- package/dist/dev/change-queue.js.map +1 -0
- package/dist/dev/entry-env.d.ts +3 -0
- package/dist/dev/entry-env.d.ts.map +1 -0
- package/dist/dev/entry-env.js +3 -0
- package/dist/dev/entry-env.js.map +1 -0
- package/dist/dev/failure-tracker.d.ts +10 -0
- package/dist/dev/failure-tracker.d.ts.map +1 -0
- package/dist/dev/failure-tracker.js +61 -0
- package/dist/dev/failure-tracker.js.map +1 -0
- package/dist/dev/missing-import.d.ts +4 -0
- package/dist/dev/missing-import.d.ts.map +1 -0
- package/dist/dev/missing-import.js +23 -0
- package/dist/dev/missing-import.js.map +1 -0
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +25 -5
- 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 +3 -3
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts +8 -3
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +343 -65
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/supervisor.d.ts +10 -4
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +23 -4
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +13 -2
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +30 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/internal/application-args.d.ts +6 -0
- package/dist/internal/application-args.d.ts.map +1 -0
- package/dist/internal/application-args.js +10 -0
- package/dist/internal/application-args.js.map +1 -0
- package/dist/internal/entry-arg.d.ts +1 -7
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +18 -11
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/errors.d.ts +1 -2
- 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/module-loads.d.ts +7 -0
- package/dist/internal/module-loads.d.ts.map +1 -0
- package/dist/internal/module-loads.js +21 -0
- package/dist/internal/module-loads.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +16 -0
- package/dist/internal/prepare-project.d.ts.map +1 -0
- package/dist/internal/prepare-project.js +15 -0
- package/dist/internal/prepare-project.js.map +1 -0
- package/dist/internal/run-cli-tool.d.ts +11 -0
- package/dist/internal/run-cli-tool.d.ts.map +1 -0
- package/dist/internal/run-cli-tool.js +24 -0
- package/dist/internal/run-cli-tool.js.map +1 -0
- package/dist/internal/staging-dir.d.ts +8 -1
- package/dist/internal/staging-dir.d.ts.map +1 -1
- package/dist/internal/staging-dir.js +38 -2
- package/dist/internal/staging-dir.js.map +1 -1
- package/dist/mcp/client.d.ts +1 -1
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js.map +1 -1
- package/dist/mcp/handlers.d.ts +1 -1
- package/dist/mcp/handlers.d.ts.map +1 -1
- package/dist/mcp/handlers.js +78 -41
- package/dist/mcp/handlers.js.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/serialize-widget.d.ts +4 -3
- package/dist/mcp/serialize-widget.d.ts.map +1 -1
- package/dist/mcp/serialize-widget.js +47 -17
- package/dist/mcp/serialize-widget.js.map +1 -1
- package/dist/mcp/testing-loader.d.ts +5 -2
- package/dist/mcp/testing-loader.d.ts.map +1 -1
- package/dist/mcp/testing-loader.js +7 -3
- package/dist/mcp/testing-loader.js.map +1 -1
- package/dist/mcp/widget-properties.d.ts +6 -0
- package/dist/mcp/widget-properties.d.ts.map +1 -0
- package/dist/mcp/widget-properties.js +102 -0
- package/dist/mcp/widget-properties.js.map +1 -0
- package/dist/refresh-runtime.d.ts +2 -1
- package/dist/refresh-runtime.d.ts.map +1 -1
- package/dist/refresh-runtime.js +32 -2
- package/dist/refresh-runtime.js.map +1 -1
- package/dist/settings/compile.d.ts.map +1 -1
- package/dist/settings/compile.js +8 -12
- package/dist/settings/compile.js.map +1 -1
- package/dist/settings/schema.d.ts +1 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +1 -1
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-emitter.d.ts +9 -0
- package/dist/vite-plugins/asset-emitter.d.ts.map +1 -0
- package/dist/vite-plugins/asset-emitter.js +2 -0
- package/dist/vite-plugins/asset-emitter.js.map +1 -0
- package/dist/vite-plugins/asset-extensions.d.ts +2 -2
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -1
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +4 -0
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -0
- package/dist/vite-plugins/asset-imports.js +88 -0
- package/dist/vite-plugins/asset-imports.js.map +1 -0
- package/dist/vite-plugins/asset-specifier.d.ts +5 -0
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -0
- package/dist/vite-plugins/asset-specifier.js +7 -0
- package/dist/vite-plugins/asset-specifier.js.map +1 -0
- package/dist/vite-plugins/built-url.d.ts.map +1 -1
- package/dist/vite-plugins/built-url.js +14 -10
- package/dist/vite-plugins/built-url.js.map +1 -1
- package/dist/vite-plugins/ensure-store.d.ts +4 -0
- package/dist/vite-plugins/ensure-store.d.ts.map +1 -0
- package/dist/vite-plugins/ensure-store.js +10 -0
- package/dist/vite-plugins/ensure-store.js.map +1 -0
- package/dist/vite-plugins/esm-extension.d.ts +4 -0
- package/dist/vite-plugins/esm-extension.d.ts.map +1 -0
- package/dist/vite-plugins/esm-extension.js +4 -0
- package/dist/vite-plugins/esm-extension.js.map +1 -0
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts +1 -3
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/icons.d.ts.map +1 -1
- package/dist/vite-plugins/icons.js.map +1 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +4 -0
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/react-compiler.d.ts +1 -1
- package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
- package/dist/vite-plugins/react-compiler.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +2 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +2 -1
- package/dist/vite-plugins/resource-shared.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +36 -44
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts +4 -0
- package/dist/vite-plugins/self-contained.d.ts.map +1 -0
- package/dist/vite-plugins/self-contained.js +244 -0
- package/dist/vite-plugins/self-contained.js.map +1 -0
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +19 -40
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts +4 -0
- package/dist/vite-plugins/store-links.d.ts.map +1 -0
- package/dist/vite-plugins/store-links.js +19 -0
- package/dist/vite-plugins/store-links.js.map +1 -0
- package/dist/vite-plugins/undeclared-library.d.ts +1 -1
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +51 -12
- package/dist/vite-plugins/undeclared-library.js.map +1 -1
- package/dist/vite-plugins/worker.d.ts +4 -0
- package/dist/vite-plugins/worker.d.ts.map +1 -0
- package/dist/vite-plugins/worker.js +138 -0
- package/dist/vite-plugins/worker.js.map +1 -0
- package/dist/vitest-plugin.d.ts +7 -0
- package/dist/vitest-plugin.d.ts.map +1 -1
- package/dist/vitest-plugin.js +14 -1
- package/dist/vitest-plugin.js.map +1 -1
- package/env.d.ts +106 -25
- package/package.json +23 -12
- package/src/builder.ts +24 -5
- package/src/cli.ts +10 -3
- package/src/codegen/freshness.ts +2 -4
- package/src/codegen/run-codegen.ts +37 -23
- package/src/codegen/store-resolver.ts +1 -1
- package/src/commands/build.ts +5 -6
- package/src/commands/codegen.ts +14 -1
- package/src/commands/deploy.ts +47 -0
- package/src/commands/dev.ts +7 -5
- package/src/commands/docs.ts +39 -4
- package/src/deploy/depends.ts +42 -0
- package/src/deploy/download.ts +148 -0
- package/src/deploy/freedesktop/copyright.ts +41 -0
- package/src/deploy/freedesktop/dbus-service.ts +19 -0
- package/src/deploy/freedesktop/desktop-entry.ts +102 -0
- package/src/deploy/freedesktop/ini.ts +39 -0
- package/src/deploy/freedesktop/metainfo-sections.ts +116 -0
- package/src/deploy/freedesktop/metainfo.ts +46 -0
- package/src/deploy/freedesktop/mime-package.ts +28 -0
- package/src/deploy/freedesktop/validate.ts +124 -0
- package/src/deploy/freedesktop/xml.ts +53 -0
- package/src/deploy/git.ts +20 -0
- package/src/deploy/install-hints.ts +108 -0
- package/src/deploy/nfpm/config.ts +153 -0
- package/src/deploy/nfpm/contents.ts +69 -0
- package/src/deploy/nfpm/description.ts +11 -0
- package/src/deploy/nfpm/optional.ts +8 -0
- package/src/deploy/nfpm/pack.ts +44 -0
- package/src/deploy/node-runtime/download.ts +48 -0
- package/src/deploy/node-runtime/elf.ts +145 -0
- package/src/deploy/node-runtime/guard.ts +29 -0
- package/src/deploy/node-runtime/index.ts +80 -0
- package/src/deploy/payload/copy-tree.ts +51 -0
- package/src/deploy/payload/icons.ts +80 -0
- package/src/deploy/payload/launcher.ts +27 -0
- package/src/deploy/payload/schemas.ts +27 -0
- package/src/deploy/payload/stage.ts +145 -0
- package/src/deploy/registry.ts +40 -0
- package/src/deploy/run-deploy.ts +235 -0
- package/src/deploy/settings/arch.ts +18 -0
- package/src/deploy/settings/categories.ts +39 -0
- package/src/deploy/settings/exec.ts +29 -0
- package/src/deploy/settings/identity.ts +133 -0
- package/src/deploy/settings/index.ts +189 -0
- package/src/deploy/settings/package-manifest.ts +66 -0
- package/src/deploy/settings/paths.ts +115 -0
- package/src/deploy/settings/screenshots.ts +125 -0
- package/src/deploy/settings/starter.ts +41 -0
- package/src/deploy/settings/version.ts +59 -0
- package/src/deploy/targets/appimage.ts +140 -0
- package/src/deploy/targets/deb.ts +6 -0
- package/src/deploy/targets/flatpak-manifest.ts +61 -0
- package/src/deploy/targets/flatpak-prebuilt.ts +59 -0
- package/src/deploy/targets/flatpak-source.ts +168 -0
- package/src/deploy/targets/flatpak-sources.ts +171 -0
- package/src/deploy/targets/flatpak.ts +143 -0
- package/src/deploy/targets/nfpm-target.ts +33 -0
- package/src/deploy/targets/rpm.ts +6 -0
- package/src/deploy/tools.ts +135 -0
- package/src/deploy/types.ts +174 -0
- package/src/deploy/vendored/appimagetool.ts +57 -0
- package/src/deploy/vendored/nfpm.ts +79 -0
- package/src/dev/change-queue.ts +59 -0
- package/src/dev/entry-env.ts +3 -0
- package/src/dev/failure-tracker.ts +92 -0
- package/src/dev/missing-import.ts +32 -0
- package/src/dev/runner-deps.ts +34 -5
- package/src/dev/runner-main.ts +3 -4
- package/src/dev/runner.ts +524 -89
- package/src/dev/supervisor.ts +51 -11
- package/src/dev/vite-dev-server.ts +54 -3
- package/src/internal/application-args.ts +13 -0
- package/src/internal/entry-arg.ts +25 -11
- package/src/internal/errors.ts +1 -1
- package/src/internal/module-loads.ts +32 -0
- package/src/internal/prepare-project.ts +23 -0
- package/src/internal/run-cli-tool.ts +38 -0
- package/src/internal/staging-dir.ts +57 -2
- package/src/mcp/client.ts +1 -1
- package/src/mcp/handlers.ts +123 -56
- package/src/mcp/index.ts +1 -0
- package/src/mcp/serialize-widget.ts +73 -22
- package/src/mcp/testing-loader.ts +19 -4
- package/src/mcp/widget-properties.ts +153 -0
- package/src/refresh-runtime.ts +48 -2
- package/src/settings/compile.ts +8 -11
- package/src/settings/schema.ts +0 -1
- package/src/vite-plugins/asset-emitter.ts +5 -0
- package/src/vite-plugins/asset-extensions.ts +2 -1
- package/src/vite-plugins/asset-imports.ts +134 -0
- package/src/vite-plugins/asset-specifier.ts +9 -0
- package/src/vite-plugins/built-url.ts +19 -13
- package/src/vite-plugins/ensure-store.ts +14 -0
- package/src/vite-plugins/esm-extension.ts +4 -0
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +1 -1
- package/src/vite-plugins/icons.ts +2 -5
- package/src/vite-plugins/index.ts +4 -0
- package/src/vite-plugins/react-compiler.ts +2 -1
- package/src/vite-plugins/resource-shared.ts +2 -0
- package/src/vite-plugins/resources.ts +43 -52
- package/src/vite-plugins/self-contained.ts +352 -0
- package/src/vite-plugins/settings.ts +23 -50
- package/src/vite-plugins/store-links.ts +25 -0
- package/src/vite-plugins/undeclared-library.ts +75 -13
- package/src/vite-plugins/worker.ts +238 -0
- package/src/vitest-plugin.ts +15 -1
- package/dist/internal/resolve-cli-tool.d.ts +0 -3
- package/dist/internal/resolve-cli-tool.d.ts.map +0 -1
- package/dist/internal/resolve-cli-tool.js +0 -27
- package/dist/internal/resolve-cli-tool.js.map +0 -1
- package/src/internal/resolve-cli-tool.ts +0 -37
package/src/cli.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { packageVersion } from "@gtkx/utils";
|
|
2
1
|
import { defineCommand, runMain } from "citty";
|
|
2
|
+
import packageManifest from "../package.json" with { type: "json" };
|
|
3
|
+
import { splitApplicationArgs } from "./internal/application-args.js";
|
|
3
4
|
import { withErrorBoundary } from "./internal/errors.js";
|
|
4
5
|
|
|
5
|
-
const version =
|
|
6
|
+
const version = packageManifest.version;
|
|
7
|
+
const { cliArgs } = splitApplicationArgs(process.argv.slice(2));
|
|
6
8
|
|
|
7
9
|
const main = defineCommand({
|
|
8
10
|
meta: {
|
|
@@ -21,6 +23,11 @@ const main = defineCommand({
|
|
|
21
23
|
|
|
22
24
|
return withErrorBoundary(build);
|
|
23
25
|
},
|
|
26
|
+
deploy: async () => {
|
|
27
|
+
const { deploy } = await import("./commands/deploy.js");
|
|
28
|
+
|
|
29
|
+
return withErrorBoundary(deploy);
|
|
30
|
+
},
|
|
24
31
|
codegen: async () => {
|
|
25
32
|
const { codegen } = await import("./commands/codegen.js");
|
|
26
33
|
|
|
@@ -39,4 +46,4 @@ const main = defineCommand({
|
|
|
39
46
|
},
|
|
40
47
|
});
|
|
41
48
|
|
|
42
|
-
await runMain(main);
|
|
49
|
+
await runMain(main, { rawArgs: cliArgs });
|
package/src/codegen/freshness.ts
CHANGED
|
@@ -27,12 +27,10 @@ const namespaceBarrelPath = (giStoreDir: string, library: string): string => {
|
|
|
27
27
|
return join(giStoreDir, namespace, "index.js");
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
// The manifest is what makes the store resolvable as a package, and npm's prune of a generated store
|
|
31
|
-
// removes the link while leaving the directory behind, so both have to be checked.
|
|
32
30
|
const hasManifest = (storeDir: string): boolean => existsSync(join(storeDir, "package.json"));
|
|
33
31
|
|
|
34
32
|
const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
|
|
35
|
-
if (!
|
|
33
|
+
if (!hasManifest(store.giStoreDir)) {
|
|
36
34
|
return true;
|
|
37
35
|
}
|
|
38
36
|
|
|
@@ -44,7 +42,7 @@ const isReactStoreStale = (store: CodegenStore): boolean => {
|
|
|
44
42
|
return false;
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
if (!
|
|
45
|
+
if (!hasManifest(store.jsxStoreDir)) {
|
|
48
46
|
return true;
|
|
49
47
|
}
|
|
50
48
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { runCodegen as runCodegenCore } from "@gtkx/codegen";
|
|
2
|
+
import { getShadowingStorePaths, sweepProjectStaging } from "@gtkx/codegen/internal";
|
|
2
3
|
import { type Config, loadConfig } from "@gtkx/config";
|
|
3
4
|
import {
|
|
4
5
|
resolveElementComponents,
|
|
@@ -12,7 +13,7 @@ import { resolve } from "node:path";
|
|
|
12
13
|
import { resolveDataDir } from "../internal/data-dir.js";
|
|
13
14
|
import { emitSchemaEnv } from "../settings/schema.js";
|
|
14
15
|
import { type CodegenInputs, isCodegenStale, resolveCodegenInputs } from "./freshness.js";
|
|
15
|
-
import { type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
|
|
16
|
+
import { type CodegenContext, type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
|
|
16
17
|
|
|
17
18
|
type RunCodegenOptions = {
|
|
18
19
|
cwd?: string;
|
|
@@ -45,6 +46,7 @@ type CodegenOptionsInput = {
|
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
type PreparedCodegen = CodegenInputs & { isForced: boolean };
|
|
49
|
+
type EnsureGeneratedOptions = { shouldAnnounce?: boolean; mode?: string };
|
|
48
50
|
|
|
49
51
|
type RunOptionsInput = {
|
|
50
52
|
root: string;
|
|
@@ -58,17 +60,17 @@ const GIR_PATH_MISSING_MESSAGE =
|
|
|
58
60
|
"(Linux: `sudo dnf install gobject-introspection-devel` or `sudo apt install libgirepository1.0-dev`), " +
|
|
59
61
|
"or set `girPath` in gtkx.config.ts.";
|
|
60
62
|
|
|
61
|
-
const
|
|
62
|
-
for (const path of
|
|
63
|
-
resolve(cwd, "node_modules/.gtkx/gi"),
|
|
64
|
-
resolve(cwd, "node_modules/.gtkx/jsx"),
|
|
65
|
-
resolve(cwd, "node_modules/@gtkx/gi"),
|
|
66
|
-
resolve(cwd, "node_modules/@gtkx/jsx"),
|
|
67
|
-
]) {
|
|
63
|
+
const removeStores = (paths: string[]): void => {
|
|
64
|
+
for (const path of paths) {
|
|
68
65
|
rmSync(path, { recursive: true, force: true });
|
|
69
66
|
}
|
|
70
67
|
};
|
|
71
68
|
|
|
69
|
+
const removeShadowingStores = (cwd: string): void => {
|
|
70
|
+
sweepProjectStaging(cwd);
|
|
71
|
+
removeStores(getShadowingStorePaths(cwd));
|
|
72
|
+
};
|
|
73
|
+
|
|
72
74
|
const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsInput) => ({
|
|
73
75
|
libraries,
|
|
74
76
|
girPath,
|
|
@@ -102,10 +104,16 @@ const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
|
|
|
102
104
|
libraries: [],
|
|
103
105
|
});
|
|
104
106
|
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
107
|
+
const regeneratedStorePaths = (store: CodegenStore): string[] => {
|
|
108
|
+
if (store.react === null) {
|
|
109
|
+
return [store.giStoreDir, store.giLinkDir];
|
|
108
110
|
}
|
|
111
|
+
|
|
112
|
+
return [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir];
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const clearGeneratedStores = (store: CodegenStore): void => {
|
|
116
|
+
removeStores(regeneratedStorePaths(store));
|
|
109
117
|
};
|
|
110
118
|
|
|
111
119
|
const resolveLoadedConfig = async (options: RunCodegenOptions, cwd: string): Promise<LoadedConfig> =>
|
|
@@ -128,7 +136,7 @@ const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenRe
|
|
|
128
136
|
const { config, configFile } = await resolveLoadedConfig(options, cwd);
|
|
129
137
|
|
|
130
138
|
if (config.codegen === false) {
|
|
131
|
-
|
|
139
|
+
removeShadowingStores(cwd);
|
|
132
140
|
|
|
133
141
|
return disabledCodegenResult(configFile);
|
|
134
142
|
}
|
|
@@ -200,19 +208,15 @@ const getRunOptions = ({ root, mode, inputs, resolved }: RunOptionsInput): RunCo
|
|
|
200
208
|
return { cwd: root, mode, inputs, resolved };
|
|
201
209
|
};
|
|
202
210
|
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
options: { shouldAnnounce?: boolean; mode?: string } = {},
|
|
206
|
-
): Promise<boolean> => {
|
|
207
|
-
if (options.shouldAnnounce && process.env.GTKX_DISABLE_PREFLIGHT === "1") {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
211
|
+
const isPreflightSkipped = (options: EnsureGeneratedOptions): boolean =>
|
|
212
|
+
options.shouldAnnounce === true && process.env.GTKX_DISABLE_PREFLIGHT === "1";
|
|
210
213
|
|
|
211
|
-
|
|
212
|
-
|
|
214
|
+
/* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
|
|
215
|
+
const generate = async (context: CodegenContext, options: EnsureGeneratedOptions): Promise<boolean> => {
|
|
216
|
+
syncSchemaEnv(context.root);
|
|
213
217
|
|
|
214
218
|
if (context.config.codegen === false) {
|
|
215
|
-
|
|
219
|
+
removeShadowingStores(context.root);
|
|
216
220
|
|
|
217
221
|
return false;
|
|
218
222
|
}
|
|
@@ -225,6 +229,16 @@ const ensureGenerated = async (
|
|
|
225
229
|
return result.isRegenerated;
|
|
226
230
|
};
|
|
227
231
|
|
|
232
|
+
/* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
|
|
233
|
+
const ensureGeneratedIn = async (
|
|
234
|
+
context: CodegenContext,
|
|
235
|
+
options: EnsureGeneratedOptions = {},
|
|
236
|
+
): Promise<boolean> => (isPreflightSkipped(options) ? false : generate(context, options));
|
|
237
|
+
|
|
238
|
+
/* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
|
|
239
|
+
const ensureGenerated = async (cwd: string, options: EnsureGeneratedOptions = {}): Promise<boolean> =>
|
|
240
|
+
isPreflightSkipped(options) ? false : generate(await resolveCodegenContext(cwd, options.mode), options);
|
|
241
|
+
|
|
228
242
|
const resolveConfigWatch = async (
|
|
229
243
|
cwd: string,
|
|
230
244
|
mode?: string,
|
|
@@ -244,7 +258,7 @@ export {
|
|
|
244
258
|
isCodegenDisabled,
|
|
245
259
|
syncSchemaEnv,
|
|
246
260
|
ensureGenerated,
|
|
261
|
+
ensureGeneratedIn,
|
|
247
262
|
resolveConfigWatch,
|
|
248
|
-
type RunCodegenOptions,
|
|
249
263
|
type RunCodegenResult,
|
|
250
264
|
};
|
|
@@ -83,4 +83,4 @@ const resolveCodegenContext = async (cwd: string, mode?: string): Promise<Codege
|
|
|
83
83
|
return { root: cwd, config, configFile };
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
export { resolveCodegenStore, resolveCodegenContext, type
|
|
86
|
+
export { resolveCodegenStore, resolveCodegenContext, type CodegenContext, type CodegenStore };
|
package/src/commands/build.ts
CHANGED
|
@@ -1,8 +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 {
|
|
5
|
-
import {
|
|
4
|
+
import { entryArg } from "../internal/entry-arg.js";
|
|
5
|
+
import { prepareProject } from "../internal/prepare-project.js";
|
|
6
6
|
|
|
7
7
|
const BUILD_MODE = "production";
|
|
8
8
|
|
|
@@ -19,11 +19,10 @@ const build = defineCommand({
|
|
|
19
19
|
},
|
|
20
20
|
},
|
|
21
21
|
async run({ args }) {
|
|
22
|
-
const { cwd, entry } =
|
|
22
|
+
const { cwd, entry } = await prepareProject(args, BUILD_MODE);
|
|
23
23
|
info(`Building ${entry}`);
|
|
24
|
-
await ensureGenerated(cwd, { shouldAnnounce: true, mode: BUILD_MODE });
|
|
25
24
|
|
|
26
|
-
await buildApp({
|
|
25
|
+
const bundlePath = await buildApp({
|
|
27
26
|
entry,
|
|
28
27
|
assetBase: args["asset-base"],
|
|
29
28
|
vite: {
|
|
@@ -31,7 +30,7 @@ const build = defineCommand({
|
|
|
31
30
|
},
|
|
32
31
|
});
|
|
33
32
|
|
|
34
|
-
info(
|
|
33
|
+
info(`Build complete: ${bundlePath}`);
|
|
35
34
|
},
|
|
36
35
|
});
|
|
37
36
|
|
package/src/commands/codegen.ts
CHANGED
|
@@ -4,6 +4,11 @@ import { formatCodegenResult } from "../codegen/report.js";
|
|
|
4
4
|
import { ensureGenerated, isCodegenDisabled, runCodegen, syncSchemaEnv } from "../codegen/run-codegen.js";
|
|
5
5
|
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
6
6
|
|
|
7
|
+
const FORCED_WHILE_DISABLED_MESSAGE =
|
|
8
|
+
"codegen is disabled for this project, so --force has no store to regenerate here. " +
|
|
9
|
+
"Remove `codegen: false` from gtkx.config.ts, or run `gtkx codegen --force` where the installed " +
|
|
10
|
+
"binding store is generated.";
|
|
11
|
+
|
|
7
12
|
const codegen = defineCommand({
|
|
8
13
|
meta: {
|
|
9
14
|
name: "codegen",
|
|
@@ -19,8 +24,10 @@ const codegen = defineCommand({
|
|
|
19
24
|
},
|
|
20
25
|
async run({ args }) {
|
|
21
26
|
const cwd = resolveCwd(args);
|
|
27
|
+
const isDisabled = await isCodegenDisabled(cwd);
|
|
28
|
+
checkForce(isDisabled, args.force);
|
|
22
29
|
|
|
23
|
-
if (
|
|
30
|
+
if (isDisabled) {
|
|
24
31
|
await runCodegen({ cwd });
|
|
25
32
|
syncSchemaEnv(cwd);
|
|
26
33
|
info("codegen: disabled for this project; reusing an installed binding store");
|
|
@@ -46,4 +53,10 @@ const codegen = defineCommand({
|
|
|
46
53
|
},
|
|
47
54
|
});
|
|
48
55
|
|
|
56
|
+
const checkForce = (isDisabled: boolean, isForced: boolean): void => {
|
|
57
|
+
if (isDisabled && isForced) {
|
|
58
|
+
throw new Error(FORCED_WHILE_DISABLED_MESSAGE);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
49
62
|
export { codegen };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { KNOWN_NAMES } from "../deploy/registry.js";
|
|
3
|
+
import { runDeploy } from "../deploy/run-deploy.js";
|
|
4
|
+
import { entryArg } from "../internal/entry-arg.js";
|
|
5
|
+
import { resolveProject } from "../internal/prepare-project.js";
|
|
6
|
+
|
|
7
|
+
const DEPLOY_MODE = "production";
|
|
8
|
+
|
|
9
|
+
const deploy = defineCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "deploy",
|
|
12
|
+
description: "Package the application for distribution",
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
...entryArg,
|
|
16
|
+
target: {
|
|
17
|
+
type: "string",
|
|
18
|
+
description: `Comma-separated package formats to build (${KNOWN_NAMES})`,
|
|
19
|
+
},
|
|
20
|
+
out: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Output directory relative to the project root (default: build)",
|
|
23
|
+
},
|
|
24
|
+
"print-manifests": {
|
|
25
|
+
type: "boolean",
|
|
26
|
+
description: "Write the generated manifests and metadata, then stop without packaging",
|
|
27
|
+
},
|
|
28
|
+
"skip-build": {
|
|
29
|
+
type: "boolean",
|
|
30
|
+
description: "Package what is already in dist/ instead of rebuilding",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
async run({ args }) {
|
|
34
|
+
const { cwd, entry } = await resolveProject(args, DEPLOY_MODE);
|
|
35
|
+
|
|
36
|
+
await runDeploy({
|
|
37
|
+
entry,
|
|
38
|
+
cwd,
|
|
39
|
+
targets: args.target,
|
|
40
|
+
outDir: args.out,
|
|
41
|
+
shouldPrintManifests: args["print-manifests"] === true,
|
|
42
|
+
shouldSkipBuild: args["skip-build"] === true,
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export { deploy };
|
package/src/commands/dev.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveConfigWatch } from "../codegen/run-codegen.js";
|
|
3
3
|
import { type DevWatch, runDevSupervisor } from "../dev/supervisor.js";
|
|
4
|
-
import {
|
|
4
|
+
import { splitApplicationArgs } from "../internal/application-args.js";
|
|
5
|
+
import { entryArg } from "../internal/entry-arg.js";
|
|
6
|
+
import { prepareProject } from "../internal/prepare-project.js";
|
|
5
7
|
|
|
6
8
|
const DEV_MODE = "development";
|
|
7
9
|
|
|
@@ -14,10 +16,10 @@ const dev = defineCommand({
|
|
|
14
16
|
...entryArg,
|
|
15
17
|
},
|
|
16
18
|
async run({ args }) {
|
|
17
|
-
const { cwd, entry: entryPath } =
|
|
18
|
-
await ensureGenerated(cwd, { shouldAnnounce: true, mode: DEV_MODE });
|
|
19
|
+
const { cwd, entry: entryPath } = await prepareProject(args, DEV_MODE);
|
|
19
20
|
const watch: DevWatch | undefined = await resolveConfigWatch(cwd, DEV_MODE);
|
|
20
|
-
|
|
21
|
+
const { applicationArgs } = splitApplicationArgs(process.argv.slice(2));
|
|
22
|
+
await runDevSupervisor({ entryPath, cwd, args: applicationArgs, watch });
|
|
21
23
|
},
|
|
22
24
|
});
|
|
23
25
|
|
package/src/commands/docs.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { resolveOmittedProps } from "@gtkx/config/internal";
|
|
|
13
13
|
import { info } from "@gtkx/utils";
|
|
14
14
|
import { defineCommand } from "citty";
|
|
15
15
|
import { existsSync } from "node:fs";
|
|
16
|
-
import { resolve } from "node:path";
|
|
16
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
17
17
|
import { cwdArg, resolveCwd } from "../internal/entry-arg.js";
|
|
18
18
|
|
|
19
19
|
const docs = defineCommand({
|
|
@@ -25,7 +25,9 @@ const docs = defineCommand({
|
|
|
25
25
|
args: {
|
|
26
26
|
out: {
|
|
27
27
|
type: "string",
|
|
28
|
-
description:
|
|
28
|
+
description:
|
|
29
|
+
"Output directory for the generated markdown pages, below the project root. It must be empty " +
|
|
30
|
+
"or hold an earlier `gtkx docs` run, whose pages are replaced",
|
|
29
31
|
default: "docs/reference",
|
|
30
32
|
},
|
|
31
33
|
"base-path": {
|
|
@@ -35,7 +37,9 @@ const docs = defineCommand({
|
|
|
35
37
|
},
|
|
36
38
|
force: {
|
|
37
39
|
type: "boolean",
|
|
38
|
-
description:
|
|
40
|
+
description:
|
|
41
|
+
"Regenerate even when the pages are up to date with the GIR libraries, the base path, " +
|
|
42
|
+
"and the element props the project configures",
|
|
39
43
|
default: false,
|
|
40
44
|
},
|
|
41
45
|
...cwdArg,
|
|
@@ -63,7 +67,7 @@ const docs = defineCommand({
|
|
|
63
67
|
|
|
64
68
|
const libraries = resolveLibraries(config.libraries, girPath);
|
|
65
69
|
const startedAt = Date.now();
|
|
66
|
-
const outDir =
|
|
70
|
+
const outDir = resolveOutDir(cwd, args.out);
|
|
67
71
|
const builtin = await resolveDocsElements(cwd);
|
|
68
72
|
|
|
69
73
|
const { isRegenerated, namespaces } = writeDocs({
|
|
@@ -91,6 +95,37 @@ const docs = defineCommand({
|
|
|
91
95
|
},
|
|
92
96
|
});
|
|
93
97
|
|
|
98
|
+
const isBelow = (parent: string, child: string): boolean => {
|
|
99
|
+
const path = relative(parent, child);
|
|
100
|
+
|
|
101
|
+
return path !== "" && path !== ".." && !path.startsWith(`..${sep}`) && !isAbsolute(path);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const outDirReason = (cwd: string, out: string, outDir: string): string => {
|
|
105
|
+
if (out.trim() === "") {
|
|
106
|
+
return "it was empty, which names the project root itself";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (outDir === cwd) {
|
|
110
|
+
return "it names the project root itself";
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return `${outDir} is outside it`;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const resolveOutDir = (cwd: string, out: string): string => {
|
|
117
|
+
const outDir = out.trim() === "" ? cwd : resolve(cwd, out);
|
|
118
|
+
|
|
119
|
+
if (isBelow(cwd, outDir)) {
|
|
120
|
+
return outDir;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
throw new Error(
|
|
124
|
+
`--out must name a directory below the project root ${cwd}, and ${outDirReason(cwd, out, outDir)}. ` +
|
|
125
|
+
"Pass a path such as --out=docs/reference.",
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
|
|
94
129
|
const resolveDocsElements = async (cwd: string): Promise<{ props: ElementProps; omittedProps: OmittedProps }> => {
|
|
95
130
|
const { gi, reactSubexports } = resolveStore(cwd);
|
|
96
131
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { DeployConfig } from "./types.js";
|
|
2
|
+
|
|
3
|
+
type Relations = {
|
|
4
|
+
deb: string[];
|
|
5
|
+
rpm: string[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const GLES_SONAME = "libGLESv2.so.2()(64bit)";
|
|
9
|
+
|
|
10
|
+
const BASE_DEPENDS: Relations = {
|
|
11
|
+
deb: ["hicolor-icon-theme", "adwaita-icon-theme", "gsettings-desktop-schemas"],
|
|
12
|
+
rpm: ["hicolor-icon-theme", "adwaita-icon-theme", "gsettings-desktop-schemas"],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DEPENDS_BY_LIBRARY: Record<string, Relations> = {
|
|
16
|
+
"Adw-1": { deb: ["libadwaita-1-0"], rpm: ["libadwaita"] },
|
|
17
|
+
"Gtk-4.0": { deb: ["libgtk-4-1"], rpm: ["gtk4", GLES_SONAME] },
|
|
18
|
+
"GtkSource-5": { deb: ["libgtksourceview-5-0"], rpm: ["gtksourceview5"] },
|
|
19
|
+
"WebKit-6.0": { deb: ["libwebkitgtk-6.0-4"], rpm: ["webkitgtk6.0"] },
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const libraryDepends = (libraries: string[]): Relations => ({
|
|
23
|
+
deb: libraries.flatMap((library) => DEPENDS_BY_LIBRARY[library]?.deb ?? []),
|
|
24
|
+
rpm: libraries.flatMap((library) => DEPENDS_BY_LIBRARY[library]?.rpm ?? []),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const glibcDepends = (glibcFloor: string | null): Relations =>
|
|
28
|
+
glibcFloor === null ? { deb: [], rpm: [] } : { deb: [`libc6 (>= ${glibcFloor})`], rpm: [`glibc >= ${glibcFloor}`] };
|
|
29
|
+
|
|
30
|
+
const dedupe = (entries: string[]): string[] => [...new Set(entries)];
|
|
31
|
+
|
|
32
|
+
const resolveDepends = (deploy: DeployConfig, libraries: string[], glibcFloor: string | null): Relations => {
|
|
33
|
+
const fromLibraries = libraryDepends(libraries);
|
|
34
|
+
const fromGlibc = glibcDepends(glibcFloor);
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
deb: dedupe([...fromLibraries.deb, ...BASE_DEPENDS.deb, ...fromGlibc.deb, ...(deploy.depends?.deb ?? [])]),
|
|
38
|
+
rpm: dedupe([...fromLibraries.rpm, ...BASE_DEPENDS.rpm, ...fromGlibc.rpm, ...(deploy.depends?.rpm ?? [])]),
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export { resolveDepends };
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { info, warn } from "@gtkx/utils";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
|
|
7
|
+
type DigestRequest = {
|
|
8
|
+
url: string;
|
|
9
|
+
dest: string;
|
|
10
|
+
assetName: string;
|
|
11
|
+
subject: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type DownloadRequest = {
|
|
15
|
+
url: string;
|
|
16
|
+
dest: string;
|
|
17
|
+
label: string;
|
|
18
|
+
sha256: string;
|
|
19
|
+
freshSha256?: (() => Promise<string>) | undefined;
|
|
20
|
+
mode?: number | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const CACHE_NAMESPACE = "gtkx";
|
|
24
|
+
const DIGEST_PATTERN = /^[\da-f]{64}$/;
|
|
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);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const cacheDir = (segments: string[]): string => {
|
|
33
|
+
const dir = join(cacheRoot(), ...segments);
|
|
34
|
+
mkdirSync(dir, { recursive: true });
|
|
35
|
+
|
|
36
|
+
return dir;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getDigest = (contents: Buffer): string => createHash("sha256").update(contents).digest("hex");
|
|
40
|
+
|
|
41
|
+
const assertDigest = (url: string, contents: Buffer, expected: string): void => {
|
|
42
|
+
const actual = getDigest(contents);
|
|
43
|
+
|
|
44
|
+
if (actual !== expected) {
|
|
45
|
+
throw new Error(`Checksum mismatch for ${url}\n expected ${expected}\n received ${actual}`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const fetchBytes = async (url: string): Promise<Buffer> => {
|
|
50
|
+
const response = await fetch(url);
|
|
51
|
+
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
throw new Error(`Cannot download ${url}: HTTP ${String(response.status)} ${response.statusText}`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return Buffer.from(await response.arrayBuffer());
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const fetchText = async (url: string): Promise<string> => {
|
|
60
|
+
const bytes = await fetchBytes(url);
|
|
61
|
+
|
|
62
|
+
return bytes.toString("utf8");
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const readCachedDigest = (dest: string): string | undefined => {
|
|
66
|
+
try {
|
|
67
|
+
const cached = readFileSync(dest, "utf8").trim();
|
|
68
|
+
|
|
69
|
+
return DIGEST_PATTERN.test(cached) ? cached : undefined;
|
|
70
|
+
} catch {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const writeAtomically = (dest: string, contents: string): void => {
|
|
76
|
+
const staging = `${dest}.partial`;
|
|
77
|
+
writeFileSync(staging, contents);
|
|
78
|
+
renameSync(staging, dest);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const publishedDigest = async (request: DigestRequest): Promise<string> => {
|
|
82
|
+
const checksums = await fetchText(request.url);
|
|
83
|
+
const digest = digestFromChecksums(checksums, request.assetName, request.subject);
|
|
84
|
+
|
|
85
|
+
if (!DIGEST_PATTERN.test(digest)) {
|
|
86
|
+
throw new Error(`${request.subject} published a malformed checksum for ${request.assetName}: "${digest}"`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
writeAtomically(request.dest, digest);
|
|
90
|
+
|
|
91
|
+
return digest;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const cachedDigest = async (request: DigestRequest): Promise<string> => {
|
|
95
|
+
const cached = readCachedDigest(request.dest);
|
|
96
|
+
|
|
97
|
+
return cached ?? publishedDigest(request);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const isCacheUsable = (dest: string, sha256: string): boolean => {
|
|
101
|
+
if (!existsSync(dest)) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (getDigest(readFileSync(dest)) === sha256) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
warn(`Discarding the cached ${dest}: its checksum no longer matches`);
|
|
110
|
+
|
|
111
|
+
return false;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const downloadFile = async (request: DownloadRequest): Promise<string> => {
|
|
115
|
+
const { url, dest, label, sha256, mode } = request;
|
|
116
|
+
|
|
117
|
+
if (isCacheUsable(dest, sha256)) {
|
|
118
|
+
return dest;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
info(`Downloading ${label}`);
|
|
122
|
+
const expected = request.freshSha256 === undefined ? sha256 : await request.freshSha256();
|
|
123
|
+
const contents = await fetchBytes(url);
|
|
124
|
+
assertDigest(url, contents, expected);
|
|
125
|
+
const staging = `${dest}.partial`;
|
|
126
|
+
writeFileSync(staging, contents);
|
|
127
|
+
|
|
128
|
+
if (mode !== undefined) {
|
|
129
|
+
chmodSync(staging, mode);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
renameSync(staging, dest);
|
|
133
|
+
|
|
134
|
+
return dest;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
const digestFromChecksums = (checksums: string, assetName: string, subject: string): string => {
|
|
138
|
+
const line = checksums.split("\n").find((entry) => entry.trim().endsWith(` ${assetName}`));
|
|
139
|
+
const digest = line?.trim().split(/\s+/, 1)[0];
|
|
140
|
+
|
|
141
|
+
if (digest === undefined) {
|
|
142
|
+
throw new Error(`${subject} publishes no checksum for ${assetName}`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
return digest;
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export { cacheDir, cachedDigest, type DigestRequest, downloadFile, publishedDigest };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import type { DeploySettings } from "../types.js";
|
|
3
|
+
|
|
4
|
+
const FORMAT_URL = "https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/";
|
|
5
|
+
const CONTINUATION_BLANK = " .";
|
|
6
|
+
|
|
7
|
+
const indentLicenseBody = (body: string): string[] =>
|
|
8
|
+
body
|
|
9
|
+
.split("\n")
|
|
10
|
+
.map((line) => (line.trim().length === 0 ? CONTINUATION_BLANK : ` ${line}`));
|
|
11
|
+
|
|
12
|
+
const licenseBody = (licenseFile: string | null): string[] => {
|
|
13
|
+
if (licenseFile === null) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
return indentLicenseBody(readFileSync(licenseFile, "utf8").trimEnd());
|
|
19
|
+
} catch {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const headerLines = (settings: DeploySettings): string[] => [
|
|
25
|
+
`Format: ${FORMAT_URL}`,
|
|
26
|
+
`Upstream-Name: ${settings.name}`,
|
|
27
|
+
...(settings.homepage === null ? [] : [`Source: ${settings.homepage}`]),
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const renderCopyright = (settings: DeploySettings): string =>
|
|
31
|
+
[
|
|
32
|
+
...headerLines(settings),
|
|
33
|
+
"",
|
|
34
|
+
"Files: *",
|
|
35
|
+
`Copyright: ${settings.copyright}`,
|
|
36
|
+
`License: ${settings.license}`,
|
|
37
|
+
...licenseBody(settings.paths.licenseFile),
|
|
38
|
+
"",
|
|
39
|
+
].join("\n");
|
|
40
|
+
|
|
41
|
+
export { renderCopyright };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
import type { DeploySettings } from "../types.js";
|
|
3
|
+
import { renderIni } from "./ini.js";
|
|
4
|
+
|
|
5
|
+
const SERVICE_GROUP = "D-BUS Service";
|
|
6
|
+
const SERVICE_FLAG = "--gapplication-service";
|
|
7
|
+
|
|
8
|
+
const renderDbusService = (settings: DeploySettings, prefix: string): string =>
|
|
9
|
+
renderIni([
|
|
10
|
+
{
|
|
11
|
+
name: SERVICE_GROUP,
|
|
12
|
+
entries: [
|
|
13
|
+
["Name", settings.applicationId],
|
|
14
|
+
["Exec", `${posix.join(prefix, "bin", settings.binaryName)} ${SERVICE_FLAG}`],
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
export { renderDbusService };
|