@gtkx/cli 1.6.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -44
- package/bin/gtkx-dev-runner.js +5 -1
- package/bin/gtkx.js +5 -1
- package/dist/builder.d.ts +1 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +44 -12
- package/dist/builder.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/config-dependencies.d.ts +3 -0
- package/dist/codegen/config-dependencies.d.ts.map +1 -0
- package/dist/codegen/config-dependencies.js +355 -0
- package/dist/codegen/config-dependencies.js.map +1 -0
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +49 -16
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts.map +1 -1
- package/dist/codegen/reference.js +2 -7
- package/dist/codegen/reference.js.map +1 -1
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +5 -16
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +9 -8
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +60 -113
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +3 -2
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js +14 -20
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts +5 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +83 -10
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cleanup.d.ts +9 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +42 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/codegen.d.ts +1 -0
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +6 -5
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +10 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +31 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +6 -15
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts.map +1 -1
- package/dist/deploy/depends.js +24 -2
- package/dist/deploy/depends.js.map +1 -1
- package/dist/deploy/download.d.ts +7 -3
- package/dist/deploy/download.d.ts.map +1 -1
- package/dist/deploy/download.js +19 -20
- package/dist/deploy/download.js.map +1 -1
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
- package/dist/deploy/freedesktop/copyright.js +2 -13
- package/dist/deploy/freedesktop/copyright.js.map +1 -1
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
- package/dist/deploy/freedesktop/metainfo.js +41 -2
- package/dist/deploy/freedesktop/metainfo.js.map +1 -1
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
- package/dist/deploy/freedesktop/validate.js +58 -14
- package/dist/deploy/freedesktop/validate.js.map +1 -1
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
- package/dist/deploy/freedesktop/xml.js +21 -25
- package/dist/deploy/freedesktop/xml.js.map +1 -1
- package/dist/deploy/native-addon.d.ts +5 -0
- package/dist/deploy/native-addon.d.ts.map +1 -0
- package/dist/deploy/native-addon.js +134 -0
- package/dist/deploy/native-addon.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +3 -2
- package/dist/deploy/nfpm/config.d.ts.map +1 -1
- package/dist/deploy/nfpm/config.js +7 -4
- package/dist/deploy/nfpm/config.js.map +1 -1
- package/dist/deploy/nfpm/contents.d.ts.map +1 -1
- package/dist/deploy/nfpm/contents.js +8 -0
- package/dist/deploy/nfpm/contents.js.map +1 -1
- package/dist/deploy/node-runtime/download.js +2 -2
- package/dist/deploy/node-runtime/download.js.map +1 -1
- package/dist/deploy/node-runtime/elf.d.ts +4 -1
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
- package/dist/deploy/node-runtime/elf.js +34 -5
- package/dist/deploy/node-runtime/elf.js.map +1 -1
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
- package/dist/deploy/node-runtime/guard.js +7 -14
- package/dist/deploy/node-runtime/guard.js.map +1 -1
- package/dist/deploy/node-runtime/index.d.ts +3 -1
- package/dist/deploy/node-runtime/index.d.ts.map +1 -1
- package/dist/deploy/node-runtime/index.js +103 -10
- package/dist/deploy/node-runtime/index.js.map +1 -1
- package/dist/deploy/node-runtime/license.d.ts.map +1 -1
- package/dist/deploy/node-runtime/license.js +2 -9
- package/dist/deploy/node-runtime/license.js.map +1 -1
- package/dist/deploy/node-runtime/sonames.d.ts +5 -0
- package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
- package/dist/deploy/node-runtime/sonames.js +13 -0
- package/dist/deploy/node-runtime/sonames.js.map +1 -0
- package/dist/deploy/notices/node-runtime.js +2 -2
- package/dist/deploy/notices/node-runtime.js.map +1 -1
- package/dist/deploy/notices/packages.d.ts.map +1 -1
- package/dist/deploy/notices/packages.js +3 -10
- package/dist/deploy/notices/packages.js.map +1 -1
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
- package/dist/deploy/payload/copy-tree.js +3 -3
- package/dist/deploy/payload/copy-tree.js.map +1 -1
- package/dist/deploy/payload/launcher.d.ts.map +1 -1
- package/dist/deploy/payload/launcher.js +14 -1
- package/dist/deploy/payload/launcher.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +2 -1
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +47 -8
- package/dist/deploy/payload/stage.js.map +1 -1
- package/dist/deploy/run-deploy.d.ts +2 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -1
- package/dist/deploy/run-deploy.js +197 -52
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/arch.d.ts +9 -3
- package/dist/deploy/settings/arch.d.ts.map +1 -1
- package/dist/deploy/settings/arch.js +27 -6
- package/dist/deploy/settings/arch.js.map +1 -1
- package/dist/deploy/settings/build-manifest.d.ts +6 -1
- package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
- package/dist/deploy/settings/build-manifest.js +17 -17
- package/dist/deploy/settings/build-manifest.js.map +1 -1
- package/dist/deploy/settings/extra-files.d.ts +1 -1
- package/dist/deploy/settings/extra-files.d.ts.map +1 -1
- package/dist/deploy/settings/extra-files.js +25 -3
- package/dist/deploy/settings/extra-files.js.map +1 -1
- package/dist/deploy/settings/index.d.ts +3 -1
- package/dist/deploy/settings/index.d.ts.map +1 -1
- package/dist/deploy/settings/index.js +4 -2
- package/dist/deploy/settings/index.js.map +1 -1
- package/dist/deploy/settings/libraries.d.ts.map +1 -1
- package/dist/deploy/settings/libraries.js +3 -19
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +4 -3
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +118 -19
- package/dist/deploy/settings/paths.js.map +1 -1
- package/dist/deploy/settings/screenshots.d.ts.map +1 -1
- package/dist/deploy/settings/screenshots.js +6 -31
- package/dist/deploy/settings/screenshots.js.map +1 -1
- package/dist/deploy/targets/appimage.d.ts.map +1 -1
- package/dist/deploy/targets/appimage.js +1 -0
- package/dist/deploy/targets/appimage.js.map +1 -1
- package/dist/deploy/targets/flatpak-pnpm.js +4 -4
- package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +17 -6
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/targets/flatpak-sources.js +1 -1
- package/dist/deploy/targets/flatpak-sources.js.map +1 -1
- package/dist/deploy/targets/flatpak.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak.js +1 -0
- package/dist/deploy/targets/flatpak.js.map +1 -1
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
- package/dist/deploy/targets/nfpm-target.js +13 -7
- package/dist/deploy/targets/nfpm-target.js.map +1 -1
- package/dist/deploy/types.d.ts +5 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/types.js.map +1 -1
- package/dist/deploy/vendored/appimagetool.js +2 -2
- package/dist/deploy/vendored/appimagetool.js.map +1 -1
- package/dist/deploy/vendored/nfpm.js +1 -1
- package/dist/deploy/vendored/nfpm.js.map +1 -1
- package/dist/dev/catalog-writes.d.ts +8 -0
- package/dist/dev/catalog-writes.d.ts.map +1 -0
- package/dist/dev/catalog-writes.js +26 -0
- package/dist/dev/catalog-writes.js.map +1 -0
- package/dist/dev/entry-env.d.ts +2 -1
- package/dist/dev/entry-env.d.ts.map +1 -1
- package/dist/dev/entry-env.js +2 -1
- package/dist/dev/entry-env.js.map +1 -1
- package/dist/dev/font-dir.d.ts +3 -0
- package/dist/dev/font-dir.d.ts.map +1 -0
- package/dist/dev/font-dir.js +9 -0
- package/dist/dev/font-dir.js.map +1 -0
- package/dist/dev/headless.d.ts +3 -0
- package/dist/dev/headless.d.ts.map +1 -0
- package/dist/dev/headless.js +35 -0
- package/dist/dev/headless.js.map +1 -0
- package/dist/dev/runner-deps.d.ts +1 -1
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +12 -7
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner-main.d.ts.map +1 -1
- package/dist/dev/runner-main.js +11 -5
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts +2 -0
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +26 -7
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/schema-dir.d.ts +1 -1
- package/dist/dev/schema-dir.d.ts.map +1 -1
- package/dist/dev/schema-dir.js +2 -4
- package/dist/dev/schema-dir.js.map +1 -1
- package/dist/dev/supervisor.d.ts +3 -1
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +132 -29
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +1 -1
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +14 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/dev/watch-ignore.d.ts +3 -0
- package/dist/dev/watch-ignore.d.ts.map +1 -0
- package/dist/dev/watch-ignore.js +11 -0
- package/dist/dev/watch-ignore.js.map +1 -0
- package/dist/i18n/catalogs.d.ts +6 -2
- package/dist/i18n/catalogs.d.ts.map +1 -1
- package/dist/i18n/catalogs.js +12 -8
- package/dist/i18n/catalogs.js.map +1 -1
- package/dist/i18n/metadata-templates.d.ts.map +1 -1
- package/dist/i18n/metadata-templates.js +2 -1
- package/dist/i18n/metadata-templates.js.map +1 -1
- package/dist/i18n/source-messages.d.ts +5 -21
- package/dist/i18n/source-messages.d.ts.map +1 -1
- package/dist/i18n/source-messages.js +1037 -92
- package/dist/i18n/source-messages.js.map +1 -1
- package/dist/i18n/types.d.ts +6 -7
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/i18n/types.js +83 -96
- package/dist/i18n/types.js.map +1 -1
- package/dist/internal/agent-rules.d.ts.map +1 -1
- package/dist/internal/agent-rules.js +7 -2
- package/dist/internal/agent-rules.js.map +1 -1
- package/dist/internal/banner.d.ts +4 -2
- package/dist/internal/banner.d.ts.map +1 -1
- package/dist/internal/banner.js +19 -5
- package/dist/internal/banner.js.map +1 -1
- package/dist/internal/build-manifest.d.ts +5 -2
- package/dist/internal/build-manifest.d.ts.map +1 -1
- package/dist/internal/build-manifest.js +15 -2
- package/dist/internal/build-manifest.js.map +1 -1
- package/dist/internal/build-output.d.ts +8 -0
- package/dist/internal/build-output.d.ts.map +1 -0
- package/dist/internal/build-output.js +116 -0
- package/dist/internal/build-output.js.map +1 -0
- package/dist/internal/cache-root.d.ts +3 -0
- package/dist/internal/cache-root.d.ts.map +1 -0
- package/dist/internal/cache-root.js +9 -0
- package/dist/internal/cache-root.js.map +1 -0
- package/dist/internal/compile-cache-store.d.ts +4 -0
- package/dist/internal/compile-cache-store.d.ts.map +1 -0
- package/dist/internal/compile-cache-store.js +41 -0
- package/dist/internal/compile-cache-store.js.map +1 -0
- package/dist/internal/compile-cache.d.ts +4 -0
- package/dist/internal/compile-cache.d.ts.map +1 -0
- package/dist/internal/compile-cache.js +16 -0
- package/dist/internal/compile-cache.js.map +1 -0
- package/dist/internal/deploy-out-dir.d.ts +4 -0
- package/dist/internal/deploy-out-dir.d.ts.map +1 -0
- package/dist/internal/deploy-out-dir.js +5 -0
- package/dist/internal/deploy-out-dir.js.map +1 -0
- package/dist/internal/docs-elements.d.ts +1 -0
- package/dist/internal/docs-elements.d.ts.map +1 -1
- package/dist/internal/docs-elements.js +6 -5
- package/dist/internal/docs-elements.js.map +1 -1
- package/dist/internal/entry-arg.d.ts +4 -1
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +7 -1
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/errors.d.ts +2 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/font-path.d.ts +4 -0
- package/dist/internal/font-path.d.ts.map +1 -0
- package/dist/internal/font-path.js +12 -0
- package/dist/internal/font-path.js.map +1 -0
- package/dist/internal/font-staging.d.ts +6 -0
- package/dist/internal/font-staging.d.ts.map +1 -0
- package/dist/internal/font-staging.js +94 -0
- package/dist/internal/font-staging.js.map +1 -0
- package/dist/internal/icon-path.d.ts.map +1 -1
- package/dist/internal/icon-path.js +5 -16
- package/dist/internal/icon-path.js.map +1 -1
- package/dist/internal/icon-staging.d.ts +3 -0
- package/dist/internal/icon-staging.d.ts.map +1 -0
- package/dist/internal/icon-staging.js +40 -0
- package/dist/internal/icon-staging.js.map +1 -0
- package/dist/internal/import-scan.d.ts +4 -0
- package/dist/internal/import-scan.d.ts.map +1 -0
- package/dist/internal/import-scan.js +138 -0
- package/dist/internal/import-scan.js.map +1 -0
- package/dist/internal/module-hash.d.ts +3 -0
- package/dist/internal/module-hash.d.ts.map +1 -0
- package/dist/internal/module-hash.js +19 -0
- package/dist/internal/module-hash.js.map +1 -0
- package/dist/internal/output-directory.d.ts +15 -0
- package/dist/internal/output-directory.d.ts.map +1 -0
- package/dist/internal/output-directory.js +490 -0
- package/dist/internal/output-directory.js.map +1 -0
- package/dist/internal/parent-process.d.ts +12 -0
- package/dist/internal/parent-process.d.ts.map +1 -0
- package/dist/internal/parent-process.js +74 -0
- package/dist/internal/parent-process.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +3 -0
- package/dist/internal/prepare-project.d.ts.map +1 -1
- package/dist/internal/prepare-project.js +9 -3
- package/dist/internal/prepare-project.js.map +1 -1
- package/dist/internal/react-compiler-cache.d.ts +13 -0
- package/dist/internal/react-compiler-cache.d.ts.map +1 -0
- package/dist/internal/react-compiler-cache.js +182 -0
- package/dist/internal/react-compiler-cache.js.map +1 -0
- package/dist/internal/source-imports.d.ts +7 -2
- package/dist/internal/source-imports.d.ts.map +1 -1
- package/dist/internal/source-imports.js +38 -49
- package/dist/internal/source-imports.js.map +1 -1
- package/dist/internal/staging-file.d.ts +5 -0
- package/dist/internal/staging-file.d.ts.map +1 -0
- package/dist/internal/staging-file.js +35 -0
- package/dist/internal/staging-file.js.map +1 -0
- package/dist/internal/xdg-banner.d.ts +4 -0
- package/dist/internal/xdg-banner.d.ts.map +1 -0
- package/dist/internal/xdg-banner.js +11 -0
- package/dist/internal/xdg-banner.js.map +1 -0
- package/dist/internal/xdg-data-dirs.d.ts +2 -1
- package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
- package/dist/internal/xdg-data-dirs.js +1 -1
- package/dist/internal/xdg-data-dirs.js.map +1 -1
- package/dist/mcp/client.js +2 -2
- package/dist/mcp/client.js.map +1 -1
- package/dist/settings/render.d.ts +0 -1
- package/dist/settings/render.d.ts.map +1 -1
- package/dist/settings/render.js +1 -11
- package/dist/settings/render.js.map +1 -1
- package/dist/settings/schema.d.ts +2 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +24 -70
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -0
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +1 -2
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
- package/dist/vite-plugins/asset-imports.js +36 -35
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/asset-specifier.d.ts +5 -3
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
- package/dist/vite-plugins/asset-specifier.js +10 -4
- package/dist/vite-plugins/asset-specifier.js.map +1 -1
- package/dist/vite-plugins/build-manifest.d.ts +5 -1
- package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
- package/dist/vite-plugins/build-manifest.js +2 -1
- package/dist/vite-plugins/build-manifest.js.map +1 -1
- package/dist/vite-plugins/built-url.d.ts.map +1 -1
- package/dist/vite-plugins/built-url.js +5 -2
- package/dist/vite-plugins/built-url.js.map +1 -1
- package/dist/vite-plugins/css.d.ts.map +1 -1
- package/dist/vite-plugins/css.js +13 -5
- package/dist/vite-plugins/css.js.map +1 -1
- package/dist/vite-plugins/ensure-store.d.ts +1 -1
- package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
- package/dist/vite-plugins/ensure-store.js +2 -2
- package/dist/vite-plugins/ensure-store.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/font-name.d.ts +3 -0
- package/dist/vite-plugins/font-name.d.ts.map +1 -0
- package/dist/vite-plugins/font-name.js +406 -0
- package/dist/vite-plugins/font-name.js.map +1 -0
- package/dist/vite-plugins/font-worker-env.d.ts +4 -0
- package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/font-worker-env.js +19 -0
- package/dist/vite-plugins/font-worker-env.js.map +1 -0
- package/dist/vite-plugins/font.d.ts +4 -0
- package/dist/vite-plugins/font.d.ts.map +1 -0
- package/dist/vite-plugins/font.js +111 -0
- package/dist/vite-plugins/font.js.map +1 -0
- package/dist/vite-plugins/i18n.d.ts +11 -2
- package/dist/vite-plugins/i18n.d.ts.map +1 -1
- package/dist/vite-plugins/i18n.js +75 -8
- package/dist/vite-plugins/i18n.js.map +1 -1
- package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
- package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/icon-worker-env.js +23 -0
- package/dist/vite-plugins/icon-worker-env.js.map +1 -0
- package/dist/vite-plugins/icons.d.ts.map +1 -1
- package/dist/vite-plugins/icons.js +4 -9
- package/dist/vite-plugins/icons.js.map +1 -1
- package/dist/vite-plugins/index.d.ts +10 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +19 -7
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/native.d.ts.map +1 -1
- package/dist/vite-plugins/native.js +0 -4
- package/dist/vite-plugins/native.js.map +1 -1
- package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
- package/dist/vite-plugins/react-compiler.js +57 -18
- package/dist/vite-plugins/react-compiler.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +3 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +3 -1
- package/dist/vite-plugins/resource-shared.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +40 -102
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts.map +1 -1
- package/dist/vite-plugins/self-contained.js +159 -158
- package/dist/vite-plugins/self-contained.js.map +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
- package/dist/vite-plugins/settings-worker-env.js +5 -7
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts +1 -2
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +32 -27
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts.map +1 -1
- package/dist/vite-plugins/store-links.js +9 -5
- package/dist/vite-plugins/store-links.js.map +1 -1
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +25 -25
- package/dist/vite-plugins/undeclared-library.js.map +1 -1
- package/dist/vite-plugins/worker.d.ts.map +1 -1
- package/dist/vite-plugins/worker.js +21 -14
- package/dist/vite-plugins/worker.js.map +1 -1
- package/dist/vitest-plugin.d.ts +4 -3
- package/dist/vitest-plugin.d.ts.map +1 -1
- package/dist/vitest-plugin.js +12 -8
- package/dist/vitest-plugin.js.map +1 -1
- package/env.d.ts +9 -0
- package/package.json +28 -17
- package/src/builder.ts +45 -12
- package/src/cli.ts +15 -2
- package/src/codegen/config-dependencies.ts +470 -0
- package/src/codegen/freshness.ts +70 -17
- package/src/codegen/reference.ts +2 -8
- package/src/codegen/report.ts +5 -21
- package/src/codegen/run-codegen.ts +73 -160
- package/src/codegen/store-resolver.ts +16 -27
- package/src/commands/build.ts +13 -2
- package/src/commands/cleanup.ts +48 -0
- package/src/commands/codegen.ts +6 -5
- package/src/commands/deploy.ts +10 -2
- package/src/commands/dev.ts +45 -4
- package/src/commands/docs.ts +6 -17
- package/src/deploy/depends.ts +30 -3
- package/src/deploy/download.ts +33 -24
- package/src/deploy/freedesktop/copyright.ts +2 -14
- package/src/deploy/freedesktop/metainfo.ts +73 -21
- package/src/deploy/freedesktop/validate.ts +80 -15
- package/src/deploy/freedesktop/xml.ts +24 -32
- package/src/deploy/native-addon.ts +183 -0
- package/src/deploy/nfpm/config.ts +13 -4
- package/src/deploy/nfpm/contents.ts +8 -0
- package/src/deploy/node-runtime/download.ts +2 -2
- package/src/deploy/node-runtime/elf.ts +46 -5
- package/src/deploy/node-runtime/guard.ts +10 -14
- package/src/deploy/node-runtime/index.ts +148 -12
- package/src/deploy/node-runtime/license.ts +2 -8
- package/src/deploy/node-runtime/sonames.ts +17 -0
- package/src/deploy/notices/node-runtime.ts +2 -2
- package/src/deploy/notices/packages.ts +3 -11
- package/src/deploy/payload/copy-tree.ts +3 -4
- package/src/deploy/payload/launcher.ts +20 -1
- package/src/deploy/payload/stage.ts +78 -11
- package/src/deploy/run-deploy.ts +227 -72
- package/src/deploy/settings/arch.ts +40 -8
- package/src/deploy/settings/build-manifest.ts +30 -17
- package/src/deploy/settings/extra-files.ts +30 -4
- package/src/deploy/settings/index.ts +7 -2
- package/src/deploy/settings/libraries.ts +2 -22
- package/src/deploy/settings/paths.ts +78 -21
- package/src/deploy/settings/screenshots.ts +8 -46
- package/src/deploy/targets/appimage.ts +1 -0
- package/src/deploy/targets/flatpak-pnpm.ts +4 -4
- package/src/deploy/targets/flatpak-source.ts +19 -6
- package/src/deploy/targets/flatpak-sources.ts +1 -1
- package/src/deploy/targets/flatpak.ts +1 -0
- package/src/deploy/targets/nfpm-target.ts +14 -6
- package/src/deploy/types.ts +5 -1
- package/src/deploy/vendored/appimagetool.ts +2 -2
- package/src/deploy/vendored/nfpm.ts +1 -1
- package/src/dev/catalog-writes.ts +35 -0
- package/src/dev/entry-env.ts +2 -1
- package/src/dev/font-dir.ts +11 -0
- package/src/dev/headless.ts +40 -0
- package/src/dev/runner-deps.ts +20 -7
- package/src/dev/runner-main.ts +13 -5
- package/src/dev/runner.ts +37 -7
- package/src/dev/schema-dir.ts +2 -4
- package/src/dev/supervisor.ts +183 -32
- package/src/dev/vite-dev-server.ts +20 -2
- package/src/dev/watch-ignore.ts +16 -0
- package/src/i18n/catalogs.ts +23 -9
- package/src/i18n/metadata-templates.ts +2 -1
- package/src/i18n/source-messages.ts +1641 -262
- package/src/i18n/types.ts +97 -131
- package/src/internal/agent-rules.ts +7 -2
- package/src/internal/banner.ts +27 -6
- package/src/internal/build-manifest.ts +25 -1
- package/src/internal/build-output.ts +171 -0
- package/src/internal/cache-root.ts +12 -0
- package/src/internal/compile-cache-store.ts +50 -0
- package/src/internal/compile-cache.ts +20 -0
- package/src/internal/deploy-out-dir.ts +8 -0
- package/src/internal/docs-elements.ts +11 -5
- package/src/internal/entry-arg.ts +8 -1
- package/src/internal/errors.ts +1 -1
- package/src/internal/font-path.ts +15 -0
- package/src/internal/font-staging.ts +131 -0
- package/src/internal/icon-path.ts +6 -19
- package/src/internal/icon-staging.ts +58 -0
- package/src/internal/import-scan.ts +206 -0
- package/src/internal/module-hash.ts +22 -0
- package/src/internal/output-directory.ts +699 -0
- package/src/internal/parent-process.ts +110 -0
- package/src/internal/prepare-project.ts +11 -5
- package/src/internal/react-compiler-cache.ts +246 -0
- package/src/internal/source-imports.ts +64 -55
- package/src/internal/staging-file.ts +42 -0
- package/src/internal/xdg-banner.ts +13 -0
- package/src/internal/xdg-data-dirs.ts +1 -1
- package/src/mcp/client.ts +2 -2
- package/src/settings/render.ts +1 -13
- package/src/settings/schema.ts +23 -91
- package/src/vite-plugins/asset-extensions.ts +2 -0
- package/src/vite-plugins/asset-imports.ts +39 -45
- package/src/vite-plugins/asset-specifier.ts +17 -5
- package/src/vite-plugins/build-manifest.ts +7 -1
- package/src/vite-plugins/built-url.ts +6 -2
- package/src/vite-plugins/css.ts +16 -5
- package/src/vite-plugins/ensure-store.ts +2 -2
- package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
- package/src/vite-plugins/font-name.ts +582 -0
- package/src/vite-plugins/font-worker-env.ts +25 -0
- package/src/vite-plugins/font.ts +180 -0
- package/src/vite-plugins/i18n.ts +123 -11
- package/src/vite-plugins/icon-worker-env.ts +36 -0
- package/src/vite-plugins/icons.ts +4 -10
- package/src/vite-plugins/index.ts +36 -13
- package/src/vite-plugins/native.ts +0 -5
- package/src/vite-plugins/react-compiler.ts +83 -19
- package/src/vite-plugins/resource-shared.ts +4 -0
- package/src/vite-plugins/resources.ts +47 -144
- package/src/vite-plugins/self-contained.ts +184 -185
- package/src/vite-plugins/settings-worker-env.ts +5 -7
- package/src/vite-plugins/settings.ts +44 -33
- package/src/vite-plugins/store-links.ts +10 -5
- package/src/vite-plugins/undeclared-library.ts +30 -32
- package/src/vite-plugins/worker.ts +31 -16
- package/src/vitest-plugin.ts +12 -8
- package/dist/i18n/binding-extractor.d.ts +0 -30
- package/dist/i18n/binding-extractor.d.ts.map +0 -1
- package/dist/i18n/binding-extractor.js +0 -1324
- package/dist/i18n/binding-extractor.js.map +0 -1
- package/dist/i18n/extractor-plugin.d.ts +0 -8
- package/dist/i18n/extractor-plugin.d.ts.map +0 -1
- package/dist/i18n/extractor-plugin.js +0 -247
- package/dist/i18n/extractor-plugin.js.map +0 -1
- package/dist/internal/data-dir.d.ts +0 -4
- package/dist/internal/data-dir.d.ts.map +0 -1
- package/dist/internal/data-dir.js +0 -52
- package/dist/internal/data-dir.js.map +0 -1
- package/dist/vite-plugins/animated.d.ts +0 -5
- package/dist/vite-plugins/animated.d.ts.map +0 -1
- package/dist/vite-plugins/animated.js +0 -325
- package/dist/vite-plugins/animated.js.map +0 -1
- package/src/i18n/binding-extractor.ts +0 -1969
- package/src/i18n/extractor-plugin.ts +0 -413
- package/src/internal/data-dir.ts +0 -70
- package/src/vite-plugins/animated.ts +0 -486
package/src/dev/runner-deps.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { isRefreshBoundary, performRefresh, staleExportName } from "../refresh-r
|
|
|
17
17
|
import { gtkxFastRefresh } from "../vite-plugins/fast-refresh/swc-refresh.js";
|
|
18
18
|
import { gtkxVitePlugins } from "../vite-plugins/index.js";
|
|
19
19
|
import { gtkxReactDomPrebundle } from "../vite-plugins/react-dom-prebundle.js";
|
|
20
|
+
import { type CatalogWrites, createCatalogWrites } from "./catalog-writes.js";
|
|
20
21
|
|
|
21
22
|
const DEV_MODE = "development";
|
|
22
23
|
const APPLICATION_POLL_INTERVAL_MS = 50;
|
|
@@ -43,11 +44,22 @@ const waitForApplicationId = async (timeoutMs: number, shouldKeepWaiting: () =>
|
|
|
43
44
|
|
|
44
45
|
const readFileRevision = (path: string): Promise<string> => readFile(path, "utf8");
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
+
const devPlugins = (configFile: string, catalogWrites: CatalogWrites): DevRunnerDeps["plugins"] =>
|
|
48
|
+
(entryPath) => [
|
|
49
|
+
...gtkxVitePlugins({ mode: DEV_MODE, entryPath, configFile, onCatalogsWritten: catalogWrites.record }),
|
|
50
|
+
...gtkxFastRefresh(),
|
|
51
|
+
gtkxReactDomPrebundle(),
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
const createDevRunnerDeps = (
|
|
55
|
+
configFile: string,
|
|
56
|
+
deployOutDir: string | undefined,
|
|
57
|
+
catalogWrites: CatalogWrites,
|
|
58
|
+
): DevRunnerDeps => ({
|
|
47
59
|
createServer,
|
|
48
60
|
waitForApplicationId,
|
|
49
61
|
getConfiguredApplicationId: async (root: string) => {
|
|
50
|
-
const loaded = await loadConfig(root, { mode: DEV_MODE });
|
|
62
|
+
const loaded = await loadConfig(root, { mode: DEV_MODE, configFile });
|
|
51
63
|
|
|
52
64
|
return loaded.config.applicationId;
|
|
53
65
|
},
|
|
@@ -86,13 +98,14 @@ const defaultDevRunnerDeps = (): DevRunnerDeps => ({
|
|
|
86
98
|
isRefreshBoundary,
|
|
87
99
|
staleExportName,
|
|
88
100
|
readFileRevision,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
gtkxReactDomPrebundle(),
|
|
93
|
-
],
|
|
101
|
+
hasWrittenCatalog: catalogWrites.hasWritten,
|
|
102
|
+
deployOutDir,
|
|
103
|
+
plugins: devPlugins(configFile, catalogWrites),
|
|
94
104
|
log: info,
|
|
95
105
|
exit: (code: number): never => process.exit(code),
|
|
96
106
|
});
|
|
97
107
|
|
|
108
|
+
const defaultDevRunnerDeps = (configFile: string, deployOutDir: string | undefined): DevRunnerDeps =>
|
|
109
|
+
createDevRunnerDeps(configFile, deployOutDir, createCatalogWrites());
|
|
110
|
+
|
|
98
111
|
export { defaultDevRunnerDeps };
|
package/src/dev/runner-main.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { loadConfig } from "@gtkx/config";
|
|
2
|
-
import { resolveFuture } from "@gtkx/config/internal";
|
|
3
2
|
import { error } from "@gtkx/utils";
|
|
4
3
|
import { resolve } from "node:path";
|
|
5
|
-
import { DEV_ENTRY_ENV } from "./entry-env.js";
|
|
4
|
+
import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
|
|
5
|
+
import { prepareDevFontDir } from "./font-dir.js";
|
|
6
6
|
import { prepareDevIconDir } from "./icon-dir.js";
|
|
7
7
|
import { prepareDevLocaleDir } from "./locale-dir.js";
|
|
8
8
|
import { createDevRunner } from "./runner.js";
|
|
@@ -23,13 +23,21 @@ const main = async (): Promise<void> => {
|
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const configFile = process.env[DEV_CONFIG_ENV];
|
|
27
|
+
|
|
28
|
+
if (!configFile) {
|
|
29
|
+
error(`Missing ${DEV_CONFIG_ENV}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const { config, root } = await loadConfig(cwd, { mode: "development", configFile });
|
|
27
34
|
prepareDevLocaleDir(root, config.applicationId);
|
|
28
|
-
prepareDevSchemaDir(root
|
|
35
|
+
prepareDevSchemaDir(root);
|
|
29
36
|
prepareDevIconDir(root, config.applicationId, config.applicationIcon);
|
|
37
|
+
prepareDevFontDir(root);
|
|
30
38
|
const entryPath = resolve(cwd, entryArg);
|
|
31
39
|
const { defaultDevRunnerDeps } = await import("./runner-deps.js");
|
|
32
|
-
const runner = createDevRunner(defaultDevRunnerDeps());
|
|
40
|
+
const runner = createDevRunner(defaultDevRunnerDeps(configFile, config.deploy?.outDir));
|
|
33
41
|
await runner.run(entryPath);
|
|
34
42
|
};
|
|
35
43
|
|
package/src/dev/runner.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ApplicationInstance } from "@gtkx/runtime/internal";
|
|
|
2
2
|
import type { InlineConfig, Plugin } from "vite";
|
|
3
3
|
import { error, warn } from "@gtkx/utils";
|
|
4
4
|
import { isCatalogSource } from "../i18n/catalogs.js";
|
|
5
|
+
import { hasUnstagedFontImport } from "../internal/font-staging.js";
|
|
5
6
|
import { loadModuleExclusively, withExclusiveLoad } from "../internal/module-loads.js";
|
|
6
7
|
import { createChangeQueue, type WatchedChange } from "./change-queue.js";
|
|
7
8
|
import { createFailureTracker, type FailureTracker } from "./failure-tracker.js";
|
|
@@ -33,6 +34,8 @@ type DevRunnerDeps = {
|
|
|
33
34
|
isRefreshBoundary(module: Record<string, unknown>): boolean;
|
|
34
35
|
staleExportName(previous: Record<string, unknown>, current: Record<string, unknown>): string | null;
|
|
35
36
|
readFileRevision(path: string): Promise<string>;
|
|
37
|
+
hasWrittenCatalog(path: string): boolean;
|
|
38
|
+
deployOutDir: string | undefined;
|
|
36
39
|
plugins(entryPath: string): Plugin[];
|
|
37
40
|
log(message: string): void;
|
|
38
41
|
exit(code: number): never;
|
|
@@ -370,21 +373,46 @@ const restartForServerConfig = async (session: DevSession, changedPath: string):
|
|
|
370
373
|
await requestRestart(session);
|
|
371
374
|
};
|
|
372
375
|
|
|
373
|
-
const
|
|
374
|
-
|
|
376
|
+
const restartForFont = async (session: DevSession, changedPath: string): Promise<void> => {
|
|
377
|
+
session.deps.log(`Font import added: ${changedPath}`);
|
|
378
|
+
await requestRestart(session);
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
const restartForCatalog = async (session: DevSession, changedPath: string): Promise<void> => {
|
|
382
|
+
if (session.deps.hasWrittenCatalog(changedPath)) {
|
|
375
383
|
return;
|
|
376
384
|
}
|
|
377
385
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
386
|
+
session.deps.log(`Translation catalog changed: ${changedPath}`);
|
|
387
|
+
await requestRestart(session);
|
|
388
|
+
};
|
|
381
389
|
|
|
382
|
-
|
|
390
|
+
const didRestartForChange = async (session: DevSession, change: WatchedChange): Promise<boolean> => {
|
|
391
|
+
const { root } = session.server.config;
|
|
392
|
+
|
|
393
|
+
if (isCatalogSource(root, change.path)) {
|
|
394
|
+
await restartForCatalog(session, change.path);
|
|
395
|
+
|
|
396
|
+
return true;
|
|
383
397
|
}
|
|
384
398
|
|
|
385
399
|
if (isServerConfigFile(session.server.config, change.path)) {
|
|
386
400
|
await restartForServerConfig(session, change.path);
|
|
387
401
|
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (change.event !== "unlink" && hasUnstagedFontImport(root, change.path)) {
|
|
406
|
+
await restartForFont(session, change.path);
|
|
407
|
+
|
|
408
|
+
return true;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
return false;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
const applyChange = async (session: DevSession, change: WatchedChange): Promise<void> => {
|
|
415
|
+
if (session.controller.isShuttingDown() || await didRestartForChange(session, change)) {
|
|
388
416
|
return;
|
|
389
417
|
}
|
|
390
418
|
|
|
@@ -610,7 +638,9 @@ const createSession = (server: DevServer, deps: DevRunnerDeps): DevSession => {
|
|
|
610
638
|
|
|
611
639
|
const createDevRunner = (deps: DevRunnerDeps): DevRunner => ({
|
|
612
640
|
async run(entryPath: string): Promise<void> {
|
|
613
|
-
const server = await deps.createServer(
|
|
641
|
+
const server = await deps.createServer(
|
|
642
|
+
createDevServerConfig(process.cwd(), deps.deployOutDir, deps.plugins(entryPath)),
|
|
643
|
+
);
|
|
614
644
|
const session = createSession(server, deps);
|
|
615
645
|
deps.installShutdownHandlers(onShutdownSignal(session));
|
|
616
646
|
|
package/src/dev/schema-dir.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { resolveDataDir } from "../internal/data-dir.js";
|
|
2
1
|
import { prependSchemaDir, stageAndCompileProjectSchemas } from "../settings/schema.js";
|
|
3
2
|
|
|
4
|
-
const prepareDevSchemaDir = (root: string
|
|
5
|
-
const
|
|
6
|
-
const dir = stageAndCompileProjectSchemas(root, dataDir);
|
|
3
|
+
const prepareDevSchemaDir = (root: string): string | null => {
|
|
4
|
+
const dir = stageAndCompileProjectSchemas(root);
|
|
7
5
|
|
|
8
6
|
if (dir === null) {
|
|
9
7
|
return null;
|
package/src/dev/supervisor.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { error, exitCodeForSignal, info, installGracefulShutdown } from "@gtkx/utils";
|
|
2
2
|
import { fork as nodeFork } from "node:child_process";
|
|
3
|
-
import { type FSWatcher, watch as watchFs } from "node:fs";
|
|
4
|
-
import { basename, dirname } from "node:path";
|
|
3
|
+
import { type FSWatcher, statSync, watch as watchFs } from "node:fs";
|
|
4
|
+
import { basename, dirname, join, relative } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import { DEV_ENTRY_ENV } from "./entry-env.js";
|
|
6
|
+
import { DEV_CONFIG_ENV, DEV_ENTRY_ENV } from "./entry-env.js";
|
|
7
7
|
|
|
8
8
|
type SupervisedChild = {
|
|
9
9
|
killed: boolean;
|
|
@@ -18,25 +18,31 @@ type ForkRunner = (modulePath: string, args: string[], env: NodeJS.ProcessEnv, c
|
|
|
18
18
|
|
|
19
19
|
type DevWatch = {
|
|
20
20
|
paths: string[];
|
|
21
|
-
|
|
21
|
+
resolvePaths: () => string[];
|
|
22
|
+
regenerate: () => Promise<string[]>;
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
type SupervisorState = {
|
|
25
26
|
runnerPath: string;
|
|
26
27
|
entryPath: string;
|
|
28
|
+
configFile: string;
|
|
27
29
|
cwd: string;
|
|
28
30
|
args: string[];
|
|
29
31
|
watch: DevWatch | undefined;
|
|
30
32
|
watchers: FSWatcher[];
|
|
33
|
+
changedPaths: Set<string>;
|
|
34
|
+
restartTimer: DebounceTimer;
|
|
31
35
|
fork: ForkRunner;
|
|
32
36
|
child: SupervisedChild | null;
|
|
33
37
|
isShuttingDown: boolean;
|
|
34
38
|
isRestarting: boolean;
|
|
39
|
+
isRestartPending: boolean;
|
|
35
40
|
capturedChildExit: number | undefined;
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
type DevSupervisorOptions = {
|
|
39
44
|
entryPath: string;
|
|
45
|
+
configFile: string;
|
|
40
46
|
cwd: string;
|
|
41
47
|
args?: string[] | undefined;
|
|
42
48
|
watch?: DevWatch | undefined;
|
|
@@ -128,7 +134,7 @@ const launch = (state: SupervisorState): void => {
|
|
|
128
134
|
const child = state.fork(
|
|
129
135
|
state.runnerPath,
|
|
130
136
|
state.args,
|
|
131
|
-
{ ...process.env, [DEV_ENTRY_ENV]: state.entryPath },
|
|
137
|
+
{ ...process.env, [DEV_CONFIG_ENV]: state.configFile, [DEV_ENTRY_ENV]: state.entryPath },
|
|
132
138
|
state.cwd,
|
|
133
139
|
);
|
|
134
140
|
|
|
@@ -139,39 +145,94 @@ const launch = (state: SupervisorState): void => {
|
|
|
139
145
|
});
|
|
140
146
|
};
|
|
141
147
|
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
const relaunchAfterExit = (state: SupervisorState): void => {
|
|
148
|
+
const runPendingRestart = (state: SupervisorState): void => {
|
|
145
149
|
state.isRestarting = false;
|
|
146
150
|
|
|
151
|
+
if (!state.isRestartPending || state.isShuttingDown) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
state.isRestartPending = false;
|
|
156
|
+
void restart(state);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const relaunchAfterExit = (state: SupervisorState): void => {
|
|
147
160
|
if (state.isShuttingDown) {
|
|
161
|
+
state.isRestarting = false;
|
|
162
|
+
|
|
148
163
|
return;
|
|
149
164
|
}
|
|
150
165
|
|
|
151
166
|
info("Restarting dev runner...");
|
|
152
167
|
launch(state);
|
|
168
|
+
runPendingRestart(state);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const isSupervisorShuttingDown = (state: SupervisorState): boolean => state.isShuttingDown;
|
|
172
|
+
|
|
173
|
+
const reconcileConfigWatchers = (
|
|
174
|
+
state: SupervisorState,
|
|
175
|
+
paths: string[],
|
|
176
|
+
previous: ReadonlyMap<string, string | null>,
|
|
177
|
+
): void => {
|
|
178
|
+
const changed = changedWatchPaths(previous, paths);
|
|
179
|
+
|
|
180
|
+
closeWatchers(state);
|
|
181
|
+
|
|
182
|
+
if (state.watch !== undefined) {
|
|
183
|
+
state.watch.paths = paths;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (state.isShuttingDown) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
installConfigWatchers(state);
|
|
191
|
+
|
|
192
|
+
if (changed.length > 0 && !state.isRestartPending) {
|
|
193
|
+
scheduleRestart(state, changed);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const consumeChangedPaths = (state: SupervisorState): string => {
|
|
198
|
+
const changed = [...state.changedPaths].map((path) => relative(state.cwd, path));
|
|
199
|
+
state.changedPaths.clear();
|
|
200
|
+
|
|
201
|
+
return changed.length === 0 ? basename(state.configFile) : changed.join(", ");
|
|
153
202
|
};
|
|
154
203
|
|
|
155
204
|
const restart = async (state: SupervisorState): Promise<void> => {
|
|
156
205
|
const watch = state.watch;
|
|
157
206
|
|
|
158
|
-
if (watch === undefined ||
|
|
207
|
+
if (watch === undefined || state.isShuttingDown) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (state.isRestarting) {
|
|
212
|
+
state.isRestartPending = true;
|
|
213
|
+
|
|
159
214
|
return;
|
|
160
215
|
}
|
|
161
216
|
|
|
162
217
|
state.isRestarting = true;
|
|
163
|
-
info(
|
|
218
|
+
info(`${consumeChangedPaths(state)} changed; regenerating bindings...`);
|
|
219
|
+
closeWatchers(state);
|
|
220
|
+
watch.paths = watch.resolvePaths();
|
|
221
|
+
const previous = snapshotWatchPaths(watch.paths);
|
|
222
|
+
installConfigWatchers(state);
|
|
164
223
|
|
|
165
224
|
try {
|
|
166
|
-
await watch.regenerate();
|
|
225
|
+
const paths = await watch.regenerate();
|
|
226
|
+
reconcileConfigWatchers(state, paths, previous);
|
|
167
227
|
} catch (error_) {
|
|
228
|
+
reconcileConfigWatchers(state, watch.resolvePaths(), previous);
|
|
168
229
|
error("Codegen failed; keeping the current dev runner. Fix the error and save again.", error_);
|
|
169
|
-
state
|
|
230
|
+
runPendingRestart(state);
|
|
170
231
|
|
|
171
232
|
return;
|
|
172
233
|
}
|
|
173
234
|
|
|
174
|
-
if (state
|
|
235
|
+
if (isSupervisorShuttingDown(state)) {
|
|
175
236
|
state.isRestarting = false;
|
|
176
237
|
|
|
177
238
|
return;
|
|
@@ -180,8 +241,8 @@ const restart = async (state: SupervisorState): Promise<void> => {
|
|
|
180
241
|
const current = state.child;
|
|
181
242
|
|
|
182
243
|
if (current === null) {
|
|
183
|
-
state.isRestarting = false;
|
|
184
244
|
launch(state);
|
|
245
|
+
runPendingRestart(state);
|
|
185
246
|
|
|
186
247
|
return;
|
|
187
248
|
}
|
|
@@ -193,29 +254,103 @@ const restart = async (state: SupervisorState): Promise<void> => {
|
|
|
193
254
|
forwardSignal(current, "SIGTERM");
|
|
194
255
|
};
|
|
195
256
|
|
|
196
|
-
const scheduleRestart = (state: SupervisorState,
|
|
257
|
+
const scheduleRestart = (state: SupervisorState, changedPaths: string[] = []): void => {
|
|
258
|
+
const timer = state.restartTimer;
|
|
259
|
+
|
|
260
|
+
for (const path of changedPaths) {
|
|
261
|
+
state.changedPaths.add(path);
|
|
262
|
+
}
|
|
263
|
+
|
|
197
264
|
if (timer.handle !== null) {
|
|
198
265
|
clearTimeout(timer.handle);
|
|
199
266
|
}
|
|
200
267
|
|
|
201
|
-
timer.handle = setTimeout(() =>
|
|
268
|
+
timer.handle = setTimeout(() => {
|
|
269
|
+
timer.handle = null;
|
|
270
|
+
void restart(state);
|
|
271
|
+
}, CONFIG_DEBOUNCE_MS);
|
|
202
272
|
};
|
|
203
273
|
|
|
204
|
-
const
|
|
274
|
+
const watchedChangePath = (
|
|
275
|
+
state: SupervisorState,
|
|
276
|
+
directory: string,
|
|
277
|
+
names: Set<string>,
|
|
278
|
+
filename: string | Buffer | null,
|
|
279
|
+
): string | undefined => {
|
|
205
280
|
if (filename === null || state.isShuttingDown) {
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const name = basename(filename.toString());
|
|
285
|
+
|
|
286
|
+
return names.has(name) ? join(directory, name) : undefined;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
const isDirectory = (path: string): boolean => {
|
|
290
|
+
try {
|
|
291
|
+
return statSync(path, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
292
|
+
} catch {
|
|
206
293
|
return false;
|
|
207
294
|
}
|
|
295
|
+
};
|
|
208
296
|
|
|
209
|
-
|
|
297
|
+
const nearestWatchTarget = (path: string): { directory: string; name: string } => {
|
|
298
|
+
let directory = dirname(path);
|
|
299
|
+
let name = basename(path);
|
|
300
|
+
|
|
301
|
+
while (!isDirectory(directory)) {
|
|
302
|
+
const parent = dirname(directory);
|
|
303
|
+
|
|
304
|
+
if (parent === directory) {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
name = basename(directory);
|
|
309
|
+
directory = parent;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return { directory, name };
|
|
210
313
|
};
|
|
211
314
|
|
|
315
|
+
const watchTargets = (paths: string[]): Set<string> =>
|
|
316
|
+
new Set(paths.flatMap((path) => {
|
|
317
|
+
const { directory, name } = nearestWatchTarget(path);
|
|
318
|
+
|
|
319
|
+
return [path, join(directory, name)];
|
|
320
|
+
}));
|
|
321
|
+
|
|
322
|
+
const watchPathState = (path: string): string | null => {
|
|
323
|
+
try {
|
|
324
|
+
const stat = statSync(path, { bigint: true, throwIfNoEntry: false });
|
|
325
|
+
|
|
326
|
+
return stat === undefined
|
|
327
|
+
? null
|
|
328
|
+
: [stat.dev, stat.ino, stat.mode, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
329
|
+
} catch {
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const snapshotWatchPaths = (paths: string[]): Map<string, string | null> =>
|
|
335
|
+
new Map([...watchTargets(paths)].map((path) => [path, watchPathState(path)]));
|
|
336
|
+
|
|
337
|
+
const changedWatchPaths = (
|
|
338
|
+
previous: ReadonlyMap<string, string | null>,
|
|
339
|
+
paths: string[],
|
|
340
|
+
): string[] =>
|
|
341
|
+
[...watchTargets(paths)].filter((path) => {
|
|
342
|
+
const current = watchPathState(path);
|
|
343
|
+
|
|
344
|
+
return previous.has(path) ? previous.get(path) !== current : current !== null;
|
|
345
|
+
});
|
|
346
|
+
|
|
212
347
|
const groupWatchNamesByDirectory = (paths: string[]): Map<string, Set<string>> => {
|
|
213
348
|
const namesByDirectory: Map<string, Set<string>> = new Map();
|
|
214
349
|
|
|
215
350
|
for (const path of paths) {
|
|
216
|
-
const directory =
|
|
351
|
+
const { directory, name } = nearestWatchTarget(path);
|
|
217
352
|
const names = namesByDirectory.get(directory) ?? new Set<string>();
|
|
218
|
-
names.add(
|
|
353
|
+
names.add(name);
|
|
219
354
|
namesByDirectory.set(directory, names);
|
|
220
355
|
}
|
|
221
356
|
|
|
@@ -226,16 +361,23 @@ const watchConfigDirectory = (
|
|
|
226
361
|
state: SupervisorState,
|
|
227
362
|
directory: string,
|
|
228
363
|
names: Set<string>,
|
|
229
|
-
timer: DebounceTimer,
|
|
230
364
|
): void => {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
365
|
+
try {
|
|
366
|
+
const watcher = watchFs(directory, (_event, filename) => {
|
|
367
|
+
const changed = watchedChangePath(state, directory, names, filename);
|
|
368
|
+
|
|
369
|
+
if (changed !== undefined) {
|
|
370
|
+
scheduleRestart(state, [changed]);
|
|
371
|
+
}
|
|
372
|
+
});
|
|
236
373
|
|
|
237
|
-
|
|
238
|
-
|
|
374
|
+
watcher.on("error", (cause) => {
|
|
375
|
+
error(`Configuration watch failed for ${directory}`, cause);
|
|
376
|
+
});
|
|
377
|
+
state.watchers.push(watcher);
|
|
378
|
+
} catch (error_) {
|
|
379
|
+
error(`Configuration watch failed for ${directory}`, error_);
|
|
380
|
+
}
|
|
239
381
|
};
|
|
240
382
|
|
|
241
383
|
const installConfigWatchers = (state: SupervisorState): void => {
|
|
@@ -245,10 +387,8 @@ const installConfigWatchers = (state: SupervisorState): void => {
|
|
|
245
387
|
return;
|
|
246
388
|
}
|
|
247
389
|
|
|
248
|
-
const timer: DebounceTimer = { handle: null };
|
|
249
|
-
|
|
250
390
|
for (const [directory, names] of groupWatchNamesByDirectory(watch.paths)) {
|
|
251
|
-
watchConfigDirectory(state, directory, names
|
|
391
|
+
watchConfigDirectory(state, directory, names);
|
|
252
392
|
}
|
|
253
393
|
};
|
|
254
394
|
|
|
@@ -256,6 +396,8 @@ const closeWatchers = (state: SupervisorState): void => {
|
|
|
256
396
|
for (const watcher of state.watchers) {
|
|
257
397
|
watcher.close();
|
|
258
398
|
}
|
|
399
|
+
|
|
400
|
+
state.watchers = [];
|
|
259
401
|
};
|
|
260
402
|
|
|
261
403
|
const shutdownOnSignal = (state: SupervisorState, signal: NodeJS.Signals): Promise<void> =>
|
|
@@ -263,6 +405,11 @@ const shutdownOnSignal = (state: SupervisorState, signal: NodeJS.Signals): Promi
|
|
|
263
405
|
state.isShuttingDown = true;
|
|
264
406
|
closeWatchers(state);
|
|
265
407
|
|
|
408
|
+
if (state.restartTimer.handle !== null) {
|
|
409
|
+
clearTimeout(state.restartTimer.handle);
|
|
410
|
+
state.restartTimer.handle = null;
|
|
411
|
+
}
|
|
412
|
+
|
|
266
413
|
if (!state.child) {
|
|
267
414
|
resolve();
|
|
268
415
|
|
|
@@ -286,19 +433,23 @@ const installShutdown = (state: SupervisorState): void => {
|
|
|
286
433
|
};
|
|
287
434
|
|
|
288
435
|
const runDevSupervisor = async (options: DevSupervisorOptions): Promise<never> => {
|
|
289
|
-
const { entryPath, cwd, args = [], watch, fork = defaultForkRunner } = options;
|
|
436
|
+
const { entryPath, configFile, cwd, args = [], watch, fork = defaultForkRunner } = options;
|
|
290
437
|
|
|
291
438
|
const state: SupervisorState = {
|
|
292
439
|
runnerPath: fileURLToPath(DEV_RUNNER_URL),
|
|
293
440
|
entryPath,
|
|
441
|
+
configFile,
|
|
294
442
|
cwd,
|
|
295
443
|
args,
|
|
296
444
|
watch,
|
|
297
445
|
watchers: [],
|
|
446
|
+
changedPaths: new Set(),
|
|
447
|
+
restartTimer: { handle: null },
|
|
298
448
|
fork,
|
|
299
449
|
child: null,
|
|
300
450
|
isShuttingDown: false,
|
|
301
451
|
isRestarting: false,
|
|
452
|
+
isRestartPending: false,
|
|
302
453
|
capturedChildExit: undefined,
|
|
303
454
|
};
|
|
304
455
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { InlineConfig, Plugin } from "vite";
|
|
2
|
+
import { warn } from "@gtkx/utils";
|
|
2
3
|
import { join } from "node:path";
|
|
4
|
+
import { createWatchIgnore } from "./watch-ignore.js";
|
|
3
5
|
|
|
4
6
|
type DevServerModule = object;
|
|
5
7
|
type DevServerWatchEvent = "add" | "change" | "unlink";
|
|
@@ -59,13 +61,29 @@ const isServerConfigFile = (config: DevServerConfig, changedPath: string): boole
|
|
|
59
61
|
return envFilesForMode(config).includes(changedPath);
|
|
60
62
|
};
|
|
61
63
|
|
|
62
|
-
const
|
|
64
|
+
const watchErrorPlugin = (): Plugin => ({
|
|
65
|
+
name: "gtkx:watch-errors",
|
|
66
|
+
enforce: "pre",
|
|
67
|
+
|
|
68
|
+
configureServer(server) {
|
|
69
|
+
server.watcher.on("error", (cause) => {
|
|
70
|
+
warn("File watch error; the dev server keeps watching.", cause);
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const createDevServerConfig = (
|
|
76
|
+
root: string,
|
|
77
|
+
deployOutDir: string | undefined,
|
|
78
|
+
plugins: Plugin[],
|
|
79
|
+
): InlineConfig => ({
|
|
63
80
|
root,
|
|
64
81
|
appType: "custom",
|
|
65
|
-
plugins,
|
|
82
|
+
plugins: [watchErrorPlugin(), ...plugins],
|
|
66
83
|
server: {
|
|
67
84
|
middlewareMode: true,
|
|
68
85
|
watch: {
|
|
86
|
+
ignored: createWatchIgnore(root, deployOutDir),
|
|
69
87
|
awaitWriteFinish: {
|
|
70
88
|
stabilityThreshold: WRITE_STABILITY_THRESHOLD_MS,
|
|
71
89
|
pollInterval: WRITE_POLL_INTERVAL_MS,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isPathInside, isPathWithin } from "@gtkx/utils";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { deployOutDirFor } from "../internal/deploy-out-dir.js";
|
|
4
|
+
|
|
5
|
+
const REFERENCE_DIR = ".gtkx";
|
|
6
|
+
|
|
7
|
+
const createWatchIgnore = (root: string, deployOutDir: string | undefined): ((path: string) => boolean) => {
|
|
8
|
+
const projectRoot = resolve(root);
|
|
9
|
+
const generated = [deployOutDirFor(projectRoot, deployOutDir), resolve(projectRoot, REFERENCE_DIR)].filter(
|
|
10
|
+
(directory) => isPathInside(projectRoot, directory),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
return (path) => generated.some((directory) => isPathWithin(directory, resolve(path)));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { createWatchIgnore };
|
package/src/i18n/catalogs.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPathInside } from "@gtkx/utils";
|
|
1
2
|
import {
|
|
2
3
|
chmodSync,
|
|
3
4
|
existsSync,
|
|
@@ -27,11 +28,17 @@ type CatalogProject = {
|
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
type PreparedCatalog = {
|
|
31
|
+
content: Buffer;
|
|
30
32
|
isChanged: boolean;
|
|
31
33
|
output: string;
|
|
32
34
|
target: string;
|
|
33
35
|
};
|
|
34
36
|
|
|
37
|
+
type WrittenCatalog = {
|
|
38
|
+
content: Buffer;
|
|
39
|
+
path: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
35
42
|
const PO_DIRNAME = "po";
|
|
36
43
|
const LOCALE_DIRNAME = "locale";
|
|
37
44
|
const LINGUAS_FILENAME = "LINGUAS";
|
|
@@ -132,6 +139,7 @@ const initializeCatalog = (catalog: Catalog, template: string, output: string):
|
|
|
132
139
|
`--input=${template}`,
|
|
133
140
|
`--output-file=${output}`,
|
|
134
141
|
],
|
|
142
|
+
options: { stdio: "pipe" },
|
|
135
143
|
target: catalog.path,
|
|
136
144
|
});
|
|
137
145
|
};
|
|
@@ -163,16 +171,25 @@ const prepareCatalog = (
|
|
|
163
171
|
initializeCatalog(catalog, template, output);
|
|
164
172
|
}
|
|
165
173
|
|
|
174
|
+
const content = readFileSync(output);
|
|
175
|
+
|
|
166
176
|
return {
|
|
167
|
-
|
|
177
|
+
content,
|
|
178
|
+
isChanged: !isExisting || !content.equals(readFileSync(catalog.path)),
|
|
168
179
|
output,
|
|
169
180
|
target: catalog.path,
|
|
170
181
|
};
|
|
171
182
|
};
|
|
172
183
|
|
|
173
|
-
const
|
|
184
|
+
const replaceCatalog = (catalog: PreparedCatalog): WrittenCatalog => {
|
|
185
|
+
renameSync(catalog.output, catalog.target);
|
|
186
|
+
|
|
187
|
+
return { content: catalog.content, path: catalog.target };
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
const synchronizeCatalogs = (project: CatalogProject): WrittenCatalog[] => {
|
|
174
191
|
if (project.catalogs.length === 0) {
|
|
175
|
-
return;
|
|
192
|
+
return [];
|
|
176
193
|
}
|
|
177
194
|
|
|
178
195
|
const template = join(project.poDir, `${project.domain}.pot`);
|
|
@@ -183,11 +200,7 @@ const synchronizeCatalogs = (project: CatalogProject): void => {
|
|
|
183
200
|
const merged = project.catalogs.map((catalog, index) =>
|
|
184
201
|
prepareCatalog(catalog, index, template, stagingDir));
|
|
185
202
|
|
|
186
|
-
|
|
187
|
-
if (catalog.isChanged) {
|
|
188
|
-
renameSync(catalog.output, catalog.target);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
203
|
+
return merged.filter((catalog) => catalog.isChanged).map((catalog) => replaceCatalog(catalog));
|
|
191
204
|
} finally {
|
|
192
205
|
rmSync(stagingDir, { recursive: true, force: true });
|
|
193
206
|
}
|
|
@@ -198,7 +211,7 @@ const isCatalogSource = (root: string, path: string): boolean => {
|
|
|
198
211
|
const sourcePath = isAbsolute(path) ? resolve(path) : resolve(projectRoot, path);
|
|
199
212
|
const poPath = relative(join(projectRoot, PO_DIRNAME), sourcePath);
|
|
200
213
|
|
|
201
|
-
if (
|
|
214
|
+
if (!isPathInside(join(projectRoot, PO_DIRNAME), sourcePath)) {
|
|
202
215
|
return false;
|
|
203
216
|
}
|
|
204
217
|
|
|
@@ -213,4 +226,5 @@ export {
|
|
|
213
226
|
requiresCatalogInitialization,
|
|
214
227
|
resolveCatalogProject,
|
|
215
228
|
synchronizeCatalogs,
|
|
229
|
+
type WrittenCatalog,
|
|
216
230
|
};
|