@gtkx/cli 1.0.0 → 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 +1 -1
- package/dist/builder.d.ts +1 -1
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +20 -3
- package/dist/builder.js.map +1 -1
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/freshness.js +2 -2
- 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 +24 -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 +4 -4
- 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/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 -6
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner.d.ts +8 -4
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +334 -66
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/supervisor.d.ts +1 -2
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +1 -1
- 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/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/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 +2 -1
- package/dist/internal/run-cli-tool.d.ts.map +1 -1
- package/dist/internal/run-cli-tool.js +15 -6
- package/dist/internal/run-cli-tool.js.map +1 -1
- 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/serialize-widget.d.ts +2 -1
- package/dist/mcp/serialize-widget.d.ts.map +1 -1
- package/dist/mcp/serialize-widget.js +1 -1
- 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/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/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-extensions.d.ts +2 -1
- 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/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/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/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.map +1 -1
- package/dist/vite-plugins/resources.js +30 -29
- 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.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.map +1 -1
- package/dist/vite-plugins/worker.js +3 -1
- package/dist/vite-plugins/worker.js.map +1 -1
- package/env.d.ts +106 -25
- package/package.json +20 -13
- package/src/builder.ts +22 -4
- package/src/cli.ts +7 -2
- package/src/codegen/freshness.ts +2 -2
- 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 +4 -4
- 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/failure-tracker.ts +92 -0
- package/src/dev/missing-import.ts +32 -0
- package/src/dev/runner-deps.ts +34 -6
- package/src/dev/runner.ts +506 -102
- package/src/dev/supervisor.ts +0 -3
- package/src/dev/vite-dev-server.ts +54 -3
- package/src/internal/entry-arg.ts +25 -11
- package/src/internal/module-loads.ts +32 -0
- package/src/internal/prepare-project.ts +23 -0
- package/src/internal/run-cli-tool.ts +22 -6
- package/src/internal/staging-dir.ts +57 -2
- package/src/mcp/serialize-widget.ts +3 -2
- package/src/mcp/testing-loader.ts +19 -4
- package/src/refresh-runtime.ts +48 -2
- package/src/settings/schema.ts +0 -1
- 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/esm-extension.ts +4 -0
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +1 -1
- package/src/vite-plugins/index.ts +4 -0
- package/src/vite-plugins/resource-shared.ts +2 -0
- package/src/vite-plugins/resources.ts +33 -33
- package/src/vite-plugins/self-contained.ts +352 -0
- package/src/vite-plugins/settings.ts +21 -48
- package/src/vite-plugins/store-links.ts +25 -0
- package/src/vite-plugins/undeclared-library.ts +74 -12
- package/src/vite-plugins/worker.ts +4 -1
- package/dist/internal.d.ts +0 -3
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js +0 -3
- package/dist/internal.js.map +0 -1
- package/src/internal.ts +0 -2
package/env.d.ts
CHANGED
|
@@ -1,107 +1,167 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="@gtkx/react/env" />
|
|
3
3
|
|
|
4
|
-
declare module "
|
|
4
|
+
declare module "#data/*.aac" {
|
|
5
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
6
|
+
const resourceUri: string;
|
|
5
7
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
6
8
|
export const path: string;
|
|
9
|
+
export default resourceUri;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
declare module "
|
|
12
|
+
declare module "#data/*.avif" {
|
|
13
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
14
|
+
const resourceUri: string;
|
|
10
15
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
11
16
|
export const path: string;
|
|
17
|
+
export default resourceUri;
|
|
12
18
|
}
|
|
13
19
|
|
|
14
|
-
declare module "
|
|
20
|
+
declare module "#data/*.data" {
|
|
21
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
22
|
+
const resourceUri: string;
|
|
15
23
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
16
24
|
export const path: string;
|
|
25
|
+
export default resourceUri;
|
|
17
26
|
}
|
|
18
27
|
|
|
19
|
-
declare module "
|
|
28
|
+
declare module "#data/*.eot" {
|
|
29
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
30
|
+
const resourceUri: string;
|
|
20
31
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
21
32
|
export const path: string;
|
|
33
|
+
export default resourceUri;
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
declare module "
|
|
36
|
+
declare module "#data/*.flac" {
|
|
37
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
38
|
+
const resourceUri: string;
|
|
25
39
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
26
40
|
export const path: string;
|
|
41
|
+
export default resourceUri;
|
|
27
42
|
}
|
|
28
43
|
|
|
29
|
-
declare module "
|
|
44
|
+
declare module "#data/*.gif" {
|
|
45
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
46
|
+
const resourceUri: string;
|
|
30
47
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
31
48
|
export const path: string;
|
|
49
|
+
export default resourceUri;
|
|
32
50
|
}
|
|
33
51
|
|
|
34
|
-
declare module "
|
|
52
|
+
declare module "#data/*.gpa" {
|
|
53
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
54
|
+
const resourceUri: string;
|
|
35
55
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
36
56
|
export const path: string;
|
|
57
|
+
export default resourceUri;
|
|
37
58
|
}
|
|
38
59
|
|
|
39
|
-
declare module "
|
|
60
|
+
declare module "#data/*.ico" {
|
|
61
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
62
|
+
const resourceUri: string;
|
|
40
63
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
41
64
|
export const path: string;
|
|
65
|
+
export default resourceUri;
|
|
42
66
|
}
|
|
43
67
|
|
|
44
|
-
declare module "
|
|
68
|
+
declare module "#data/*.jpeg" {
|
|
69
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
70
|
+
const resourceUri: string;
|
|
45
71
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
46
72
|
export const path: string;
|
|
73
|
+
export default resourceUri;
|
|
47
74
|
}
|
|
48
75
|
|
|
49
|
-
declare module "
|
|
76
|
+
declare module "#data/*.jpg" {
|
|
77
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
78
|
+
const resourceUri: string;
|
|
50
79
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
51
80
|
export const path: string;
|
|
81
|
+
export default resourceUri;
|
|
52
82
|
}
|
|
53
83
|
|
|
54
|
-
declare module "
|
|
84
|
+
declare module "#data/*.mp3" {
|
|
85
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
86
|
+
const resourceUri: string;
|
|
55
87
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
56
88
|
export const path: string;
|
|
89
|
+
export default resourceUri;
|
|
57
90
|
}
|
|
58
91
|
|
|
59
|
-
declare module "
|
|
92
|
+
declare module "#data/*.mp4" {
|
|
93
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
94
|
+
const resourceUri: string;
|
|
60
95
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
61
96
|
export const path: string;
|
|
97
|
+
export default resourceUri;
|
|
62
98
|
}
|
|
63
99
|
|
|
64
|
-
declare module "
|
|
100
|
+
declare module "#data/*.ogg" {
|
|
101
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
102
|
+
const resourceUri: string;
|
|
65
103
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
66
104
|
export const path: string;
|
|
105
|
+
export default resourceUri;
|
|
67
106
|
}
|
|
68
107
|
|
|
69
|
-
declare module "
|
|
108
|
+
declare module "#data/*.otf" {
|
|
109
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
110
|
+
const resourceUri: string;
|
|
70
111
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
71
112
|
export const path: string;
|
|
113
|
+
export default resourceUri;
|
|
72
114
|
}
|
|
73
115
|
|
|
74
|
-
declare module "
|
|
116
|
+
declare module "#data/*.png" {
|
|
117
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
118
|
+
const resourceUri: string;
|
|
75
119
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
76
120
|
export const path: string;
|
|
121
|
+
export default resourceUri;
|
|
77
122
|
}
|
|
78
123
|
|
|
79
|
-
declare module "
|
|
124
|
+
declare module "#data/*.svg" {
|
|
125
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
126
|
+
const resourceUri: string;
|
|
80
127
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
81
128
|
export const path: string;
|
|
129
|
+
export default resourceUri;
|
|
82
130
|
}
|
|
83
131
|
|
|
84
|
-
declare module "
|
|
132
|
+
declare module "#data/*.ttf" {
|
|
133
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
134
|
+
const resourceUri: string;
|
|
85
135
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
86
136
|
export const path: string;
|
|
137
|
+
export default resourceUri;
|
|
87
138
|
}
|
|
88
139
|
|
|
89
|
-
declare module "
|
|
140
|
+
declare module "#data/*.wav" {
|
|
141
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
142
|
+
const resourceUri: string;
|
|
90
143
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
91
144
|
export const path: string;
|
|
145
|
+
export default resourceUri;
|
|
92
146
|
}
|
|
93
147
|
|
|
94
|
-
declare module "
|
|
148
|
+
declare module "#data/*.webm" {
|
|
149
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
150
|
+
const resourceUri: string;
|
|
95
151
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
96
152
|
export const path: string;
|
|
153
|
+
export default resourceUri;
|
|
97
154
|
}
|
|
98
155
|
|
|
99
|
-
declare module "
|
|
156
|
+
declare module "#data/*.webp" {
|
|
157
|
+
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
158
|
+
const resourceUri: string;
|
|
100
159
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
101
160
|
export const path: string;
|
|
161
|
+
export default resourceUri;
|
|
102
162
|
}
|
|
103
163
|
|
|
104
|
-
declare module "
|
|
164
|
+
declare module "#data/*.woff" {
|
|
105
165
|
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
106
166
|
const resourceUri: string;
|
|
107
167
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
@@ -109,7 +169,7 @@ declare module "*.data" {
|
|
|
109
169
|
export default resourceUri;
|
|
110
170
|
}
|
|
111
171
|
|
|
112
|
-
declare module "
|
|
172
|
+
declare module "#data/*.woff2" {
|
|
113
173
|
/** `resource://` URI of the bundled asset, accepted anywhere GTK takes a URI. */
|
|
114
174
|
const resourceUri: string;
|
|
115
175
|
/** GResource path of the bundled asset, for use with the `Gio.resources*` lookup functions. */
|
|
@@ -117,8 +177,29 @@ declare module "*.gpa" {
|
|
|
117
177
|
export default resourceUri;
|
|
118
178
|
}
|
|
119
179
|
|
|
180
|
+
declare module "*.data" {
|
|
181
|
+
/**
|
|
182
|
+
* URL of the emitted asset: a dev server URL under `gtkx dev`, an absolute filesystem path once built.
|
|
183
|
+
* Import it under `#data/` instead for a GResource path and a `resource://` URI.
|
|
184
|
+
*/
|
|
185
|
+
const assetUrl: string;
|
|
186
|
+
export default assetUrl;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare module "*.gpa" {
|
|
190
|
+
/**
|
|
191
|
+
* URL of the emitted asset: a dev server URL under `gtkx dev`, an absolute filesystem path once built.
|
|
192
|
+
* Import it under `#data/` instead for a GResource path and a `resource://` URI.
|
|
193
|
+
*/
|
|
194
|
+
const assetUrl: string;
|
|
195
|
+
export default assetUrl;
|
|
196
|
+
}
|
|
197
|
+
|
|
120
198
|
declare module "*.css?url" {
|
|
121
|
-
/**
|
|
122
|
-
|
|
123
|
-
|
|
199
|
+
/**
|
|
200
|
+
* URL of the emitted stylesheet, imported without installing it on the default display: a dev server URL
|
|
201
|
+
* under `gtkx dev`, an absolute filesystem path once built.
|
|
202
|
+
*/
|
|
203
|
+
const styleSheetUrl: string;
|
|
204
|
+
export default styleSheetUrl;
|
|
124
205
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gtkx/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Command-line tool and Vite plugin stack that scaffolds, develops, builds, and documents GTKX applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gtkx",
|
|
@@ -30,10 +30,6 @@
|
|
|
30
30
|
"type": "module",
|
|
31
31
|
"exports": {
|
|
32
32
|
"./env": "./env.d.ts",
|
|
33
|
-
"./internal": {
|
|
34
|
-
"types": "./dist/internal.d.ts",
|
|
35
|
-
"default": "./dist/internal.js"
|
|
36
|
-
},
|
|
37
33
|
"./package.json": "./package.json",
|
|
38
34
|
"./refresh-runtime": {
|
|
39
35
|
"types": "./dist/refresh-runtime.d.ts",
|
|
@@ -54,6 +50,16 @@
|
|
|
54
50
|
"env.d.ts",
|
|
55
51
|
"src"
|
|
56
52
|
],
|
|
53
|
+
"nx": {
|
|
54
|
+
"targets": {
|
|
55
|
+
"lint": {
|
|
56
|
+
"options": {
|
|
57
|
+
"cwd": ".",
|
|
58
|
+
"command": "eslint {projectRoot}"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
57
63
|
"engines": {
|
|
58
64
|
"node": ">=24"
|
|
59
65
|
},
|
|
@@ -66,19 +72,20 @@
|
|
|
66
72
|
"fast-xml-parser": "^5.10.1",
|
|
67
73
|
"react-refresh": "^0.18.0",
|
|
68
74
|
"vite": "^8.2.1",
|
|
69
|
-
"
|
|
70
|
-
"@gtkx/codegen": "1.
|
|
71
|
-
"@gtkx/
|
|
72
|
-
"@gtkx/
|
|
73
|
-
"@gtkx/
|
|
74
|
-
"@gtkx/
|
|
75
|
-
"create-gtkx": "1.
|
|
75
|
+
"yaml": "^2.9.0",
|
|
76
|
+
"@gtkx/codegen": "1.1.0",
|
|
77
|
+
"@gtkx/runtime": "1.1.0",
|
|
78
|
+
"@gtkx/mcp": "1.1.0",
|
|
79
|
+
"@gtkx/config": "1.1.0",
|
|
80
|
+
"@gtkx/utils": "1.1.0",
|
|
81
|
+
"create-gtkx": "1.1.0",
|
|
82
|
+
"@gtkx/vitest": "1.1.0"
|
|
76
83
|
},
|
|
77
84
|
"devDependencies": {
|
|
78
85
|
"@types/babel__core": "^7.20.5",
|
|
79
86
|
"@types/react-refresh": "^0.14.7",
|
|
80
87
|
"vitest": "^4.1.10",
|
|
81
|
-
"@gtkx/testing": "1.
|
|
88
|
+
"@gtkx/testing": "1.1.0"
|
|
82
89
|
},
|
|
83
90
|
"peerDependencies": {
|
|
84
91
|
"react": "^19"
|
package/src/builder.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { join, posix } from "node:path";
|
|
1
2
|
import { type InlineConfig, mergeConfig, build as viteBuild } from "vite";
|
|
2
3
|
import { gtkxBuiltUrl } from "./vite-plugins/built-url.js";
|
|
4
|
+
import { BUNDLE_FILENAME, ESM_EXTENSION } from "./vite-plugins/esm-extension.js";
|
|
3
5
|
import { gtkxVitePlugins } from "./vite-plugins/index.js";
|
|
4
6
|
import { gtkxNative } from "./vite-plugins/native.js";
|
|
7
|
+
import { gtkxSelfContained } from "./vite-plugins/self-contained.js";
|
|
5
8
|
import { gtkxWorker } from "./vite-plugins/worker.js";
|
|
6
9
|
|
|
7
10
|
type BuildOptions = {
|
|
@@ -11,11 +14,15 @@ type BuildOptions = {
|
|
|
11
14
|
};
|
|
12
15
|
|
|
13
16
|
const BUILD_MODE = "production";
|
|
17
|
+
const CHUNK_STEM = "[name]-[hash]";
|
|
18
|
+
const DEFAULT_OUT_DIR = "dist";
|
|
19
|
+
const DEFAULT_ASSETS_DIR = "assets";
|
|
20
|
+
const ENTRY_FILE_NAMES = BUNDLE_FILENAME;
|
|
14
21
|
|
|
15
22
|
const buildDefaults: InlineConfig = {
|
|
16
23
|
build: {
|
|
17
24
|
ssrEmitAssets: true,
|
|
18
|
-
outDir:
|
|
25
|
+
outDir: DEFAULT_OUT_DIR,
|
|
19
26
|
minify: true,
|
|
20
27
|
cssMinify: false,
|
|
21
28
|
},
|
|
@@ -24,18 +31,27 @@ const buildDefaults: InlineConfig = {
|
|
|
24
31
|
},
|
|
25
32
|
};
|
|
26
33
|
|
|
27
|
-
const build = async (options: BuildOptions): Promise<
|
|
34
|
+
const build = async (options: BuildOptions): Promise<string> => {
|
|
28
35
|
const { entry, assetBase, vite: viteConfig } = options;
|
|
29
36
|
const root = viteConfig?.root ?? process.cwd();
|
|
37
|
+
const assetsDir = viteConfig?.build?.assetsDir ?? DEFAULT_ASSETS_DIR;
|
|
30
38
|
|
|
31
39
|
const forced: InlineConfig = {
|
|
32
|
-
plugins: [
|
|
40
|
+
plugins: [
|
|
41
|
+
...gtkxVitePlugins(BUILD_MODE),
|
|
42
|
+
gtkxWorker(),
|
|
43
|
+
gtkxBuiltUrl(assetBase),
|
|
44
|
+
gtkxNative(root),
|
|
45
|
+
gtkxSelfContained(),
|
|
46
|
+
],
|
|
33
47
|
build: {
|
|
34
48
|
ssr: entry,
|
|
35
49
|
assetsInlineLimit: 0,
|
|
36
50
|
rolldownOptions: {
|
|
37
51
|
output: {
|
|
38
|
-
entryFileNames:
|
|
52
|
+
entryFileNames: ENTRY_FILE_NAMES,
|
|
53
|
+
chunkFileNames: posix.join(assetsDir, CHUNK_STEM + ESM_EXTENSION),
|
|
54
|
+
keepNames: true,
|
|
39
55
|
},
|
|
40
56
|
},
|
|
41
57
|
},
|
|
@@ -43,6 +59,8 @@ const build = async (options: BuildOptions): Promise<void> => {
|
|
|
43
59
|
|
|
44
60
|
const merged: InlineConfig = mergeConfig(mergeConfig(buildDefaults, viteConfig ?? {}), forced);
|
|
45
61
|
await viteBuild({ ...merged, ssr: { ...merged.ssr, noExternal: true } });
|
|
62
|
+
|
|
63
|
+
return join(merged.build?.outDir ?? DEFAULT_OUT_DIR, ENTRY_FILE_NAMES);
|
|
46
64
|
};
|
|
47
65
|
|
|
48
66
|
export { build };
|
package/src/cli.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { packageVersion } from "@gtkx/utils";
|
|
2
1
|
import { defineCommand, runMain } from "citty";
|
|
2
|
+
import packageManifest from "../package.json" with { type: "json" };
|
|
3
3
|
import { splitApplicationArgs } from "./internal/application-args.js";
|
|
4
4
|
import { withErrorBoundary } from "./internal/errors.js";
|
|
5
5
|
|
|
6
|
-
const version =
|
|
6
|
+
const version = packageManifest.version;
|
|
7
7
|
const { cliArgs } = splitApplicationArgs(process.argv.slice(2));
|
|
8
8
|
|
|
9
9
|
const main = defineCommand({
|
|
@@ -23,6 +23,11 @@ const main = defineCommand({
|
|
|
23
23
|
|
|
24
24
|
return withErrorBoundary(build);
|
|
25
25
|
},
|
|
26
|
+
deploy: async () => {
|
|
27
|
+
const { deploy } = await import("./commands/deploy.js");
|
|
28
|
+
|
|
29
|
+
return withErrorBoundary(deploy);
|
|
30
|
+
},
|
|
26
31
|
codegen: async () => {
|
|
27
32
|
const { codegen } = await import("./commands/codegen.js");
|
|
28
33
|
|
package/src/codegen/freshness.ts
CHANGED
|
@@ -30,7 +30,7 @@ const namespaceBarrelPath = (giStoreDir: string, library: string): string => {
|
|
|
30
30
|
const hasManifest = (storeDir: string): boolean => existsSync(join(storeDir, "package.json"));
|
|
31
31
|
|
|
32
32
|
const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
|
|
33
|
-
if (!
|
|
33
|
+
if (!hasManifest(store.giStoreDir)) {
|
|
34
34
|
return true;
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -42,7 +42,7 @@ const isReactStoreStale = (store: CodegenStore): boolean => {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
if (!
|
|
45
|
+
if (!hasManifest(store.jsxStoreDir)) {
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
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,20 +208,15 @@ const getRunOptions = ({ root, mode, inputs, resolved }: RunOptionsInput): RunCo
|
|
|
200
208
|
return { cwd: root, mode, inputs, resolved };
|
|
201
209
|
};
|
|
202
210
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
cwd: string,
|
|
206
|
-
options: { shouldAnnounce?: boolean; mode?: string } = {},
|
|
207
|
-
): Promise<boolean> => {
|
|
208
|
-
if (options.shouldAnnounce && process.env.GTKX_DISABLE_PREFLIGHT === "1") {
|
|
209
|
-
return false;
|
|
210
|
-
}
|
|
211
|
+
const isPreflightSkipped = (options: EnsureGeneratedOptions): boolean =>
|
|
212
|
+
options.shouldAnnounce === true && process.env.GTKX_DISABLE_PREFLIGHT === "1";
|
|
211
213
|
|
|
212
|
-
|
|
213
|
-
|
|
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);
|
|
214
217
|
|
|
215
218
|
if (context.config.codegen === false) {
|
|
216
|
-
|
|
219
|
+
removeShadowingStores(context.root);
|
|
217
220
|
|
|
218
221
|
return false;
|
|
219
222
|
}
|
|
@@ -226,6 +229,16 @@ const ensureGenerated = async (
|
|
|
226
229
|
return result.isRegenerated;
|
|
227
230
|
};
|
|
228
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
|
+
|
|
229
242
|
const resolveConfigWatch = async (
|
|
230
243
|
cwd: string,
|
|
231
244
|
mode?: string,
|
|
@@ -245,6 +258,7 @@ export {
|
|
|
245
258
|
isCodegenDisabled,
|
|
246
259
|
syncSchemaEnv,
|
|
247
260
|
ensureGenerated,
|
|
261
|
+
ensureGeneratedIn,
|
|
248
262
|
resolveConfigWatch,
|
|
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 CodegenStore };
|
|
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 };
|