@gtkx/cli 1.6.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -44
- package/bin/gtkx-dev-runner.js +5 -1
- package/bin/gtkx.js +5 -1
- package/dist/builder.d.ts +1 -0
- package/dist/builder.d.ts.map +1 -1
- package/dist/builder.js +44 -12
- package/dist/builder.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +14 -2
- package/dist/cli.js.map +1 -1
- package/dist/codegen/config-dependencies.d.ts +3 -0
- package/dist/codegen/config-dependencies.d.ts.map +1 -0
- package/dist/codegen/config-dependencies.js +355 -0
- package/dist/codegen/config-dependencies.js.map +1 -0
- package/dist/codegen/freshness.d.ts.map +1 -1
- package/dist/codegen/freshness.js +49 -16
- package/dist/codegen/freshness.js.map +1 -1
- package/dist/codegen/reference.d.ts.map +1 -1
- package/dist/codegen/reference.js +2 -7
- package/dist/codegen/reference.js.map +1 -1
- package/dist/codegen/report.d.ts.map +1 -1
- package/dist/codegen/report.js +5 -16
- package/dist/codegen/report.js.map +1 -1
- package/dist/codegen/run-codegen.d.ts +9 -8
- package/dist/codegen/run-codegen.d.ts.map +1 -1
- package/dist/codegen/run-codegen.js +60 -113
- package/dist/codegen/run-codegen.js.map +1 -1
- package/dist/codegen/store-resolver.d.ts +3 -2
- package/dist/codegen/store-resolver.d.ts.map +1 -1
- package/dist/codegen/store-resolver.js +14 -20
- package/dist/codegen/store-resolver.js.map +1 -1
- package/dist/commands/build.d.ts +5 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +83 -10
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cleanup.d.ts +9 -0
- package/dist/commands/cleanup.d.ts.map +1 -0
- package/dist/commands/cleanup.js +42 -0
- package/dist/commands/cleanup.js.map +1 -0
- package/dist/commands/codegen.d.ts +1 -0
- package/dist/commands/codegen.d.ts.map +1 -1
- package/dist/commands/codegen.js +6 -5
- package/dist/commands/codegen.js.map +1 -1
- package/dist/commands/deploy.d.ts +5 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +10 -2
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +9 -0
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +31 -4
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +6 -15
- package/dist/commands/docs.js.map +1 -1
- package/dist/deploy/depends.d.ts.map +1 -1
- package/dist/deploy/depends.js +24 -2
- package/dist/deploy/depends.js.map +1 -1
- package/dist/deploy/download.d.ts +7 -3
- package/dist/deploy/download.d.ts.map +1 -1
- package/dist/deploy/download.js +19 -20
- package/dist/deploy/download.js.map +1 -1
- package/dist/deploy/freedesktop/copyright.d.ts.map +1 -1
- package/dist/deploy/freedesktop/copyright.js +2 -13
- package/dist/deploy/freedesktop/copyright.js.map +1 -1
- package/dist/deploy/freedesktop/metainfo.d.ts.map +1 -1
- package/dist/deploy/freedesktop/metainfo.js +41 -2
- package/dist/deploy/freedesktop/metainfo.js.map +1 -1
- package/dist/deploy/freedesktop/validate.d.ts.map +1 -1
- package/dist/deploy/freedesktop/validate.js +58 -14
- package/dist/deploy/freedesktop/validate.js.map +1 -1
- package/dist/deploy/freedesktop/xml.d.ts.map +1 -1
- package/dist/deploy/freedesktop/xml.js +21 -25
- package/dist/deploy/freedesktop/xml.js.map +1 -1
- package/dist/deploy/native-addon.d.ts +5 -0
- package/dist/deploy/native-addon.d.ts.map +1 -0
- package/dist/deploy/native-addon.js +134 -0
- package/dist/deploy/native-addon.js.map +1 -0
- package/dist/deploy/nfpm/config.d.ts +3 -2
- package/dist/deploy/nfpm/config.d.ts.map +1 -1
- package/dist/deploy/nfpm/config.js +7 -4
- package/dist/deploy/nfpm/config.js.map +1 -1
- package/dist/deploy/nfpm/contents.d.ts.map +1 -1
- package/dist/deploy/nfpm/contents.js +8 -0
- package/dist/deploy/nfpm/contents.js.map +1 -1
- package/dist/deploy/node-runtime/download.js +2 -2
- package/dist/deploy/node-runtime/download.js.map +1 -1
- package/dist/deploy/node-runtime/elf.d.ts +4 -1
- package/dist/deploy/node-runtime/elf.d.ts.map +1 -1
- package/dist/deploy/node-runtime/elf.js +34 -5
- package/dist/deploy/node-runtime/elf.js.map +1 -1
- package/dist/deploy/node-runtime/guard.d.ts.map +1 -1
- package/dist/deploy/node-runtime/guard.js +7 -14
- package/dist/deploy/node-runtime/guard.js.map +1 -1
- package/dist/deploy/node-runtime/index.d.ts +3 -1
- package/dist/deploy/node-runtime/index.d.ts.map +1 -1
- package/dist/deploy/node-runtime/index.js +103 -10
- package/dist/deploy/node-runtime/index.js.map +1 -1
- package/dist/deploy/node-runtime/license.d.ts.map +1 -1
- package/dist/deploy/node-runtime/license.js +2 -9
- package/dist/deploy/node-runtime/license.js.map +1 -1
- package/dist/deploy/node-runtime/sonames.d.ts +5 -0
- package/dist/deploy/node-runtime/sonames.d.ts.map +1 -0
- package/dist/deploy/node-runtime/sonames.js +13 -0
- package/dist/deploy/node-runtime/sonames.js.map +1 -0
- package/dist/deploy/notices/node-runtime.js +2 -2
- package/dist/deploy/notices/node-runtime.js.map +1 -1
- package/dist/deploy/notices/packages.d.ts.map +1 -1
- package/dist/deploy/notices/packages.js +3 -10
- package/dist/deploy/notices/packages.js.map +1 -1
- package/dist/deploy/payload/copy-tree.d.ts.map +1 -1
- package/dist/deploy/payload/copy-tree.js +3 -3
- package/dist/deploy/payload/copy-tree.js.map +1 -1
- package/dist/deploy/payload/launcher.d.ts.map +1 -1
- package/dist/deploy/payload/launcher.js +14 -1
- package/dist/deploy/payload/launcher.js.map +1 -1
- package/dist/deploy/payload/stage.d.ts +2 -1
- package/dist/deploy/payload/stage.d.ts.map +1 -1
- package/dist/deploy/payload/stage.js +47 -8
- package/dist/deploy/payload/stage.js.map +1 -1
- package/dist/deploy/run-deploy.d.ts +2 -0
- package/dist/deploy/run-deploy.d.ts.map +1 -1
- package/dist/deploy/run-deploy.js +197 -52
- package/dist/deploy/run-deploy.js.map +1 -1
- package/dist/deploy/settings/arch.d.ts +9 -3
- package/dist/deploy/settings/arch.d.ts.map +1 -1
- package/dist/deploy/settings/arch.js +27 -6
- package/dist/deploy/settings/arch.js.map +1 -1
- package/dist/deploy/settings/build-manifest.d.ts +6 -1
- package/dist/deploy/settings/build-manifest.d.ts.map +1 -1
- package/dist/deploy/settings/build-manifest.js +17 -17
- package/dist/deploy/settings/build-manifest.js.map +1 -1
- package/dist/deploy/settings/extra-files.d.ts +1 -1
- package/dist/deploy/settings/extra-files.d.ts.map +1 -1
- package/dist/deploy/settings/extra-files.js +25 -3
- package/dist/deploy/settings/extra-files.js.map +1 -1
- package/dist/deploy/settings/index.d.ts +3 -1
- package/dist/deploy/settings/index.d.ts.map +1 -1
- package/dist/deploy/settings/index.js +4 -2
- package/dist/deploy/settings/index.js.map +1 -1
- package/dist/deploy/settings/libraries.d.ts.map +1 -1
- package/dist/deploy/settings/libraries.js +3 -19
- package/dist/deploy/settings/libraries.js.map +1 -1
- package/dist/deploy/settings/paths.d.ts +4 -3
- package/dist/deploy/settings/paths.d.ts.map +1 -1
- package/dist/deploy/settings/paths.js +118 -19
- package/dist/deploy/settings/paths.js.map +1 -1
- package/dist/deploy/settings/screenshots.d.ts.map +1 -1
- package/dist/deploy/settings/screenshots.js +6 -31
- package/dist/deploy/settings/screenshots.js.map +1 -1
- package/dist/deploy/targets/appimage.d.ts.map +1 -1
- package/dist/deploy/targets/appimage.js +1 -0
- package/dist/deploy/targets/appimage.js.map +1 -1
- package/dist/deploy/targets/flatpak-pnpm.js +4 -4
- package/dist/deploy/targets/flatpak-pnpm.js.map +1 -1
- package/dist/deploy/targets/flatpak-source.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak-source.js +17 -6
- package/dist/deploy/targets/flatpak-source.js.map +1 -1
- package/dist/deploy/targets/flatpak-sources.js +1 -1
- package/dist/deploy/targets/flatpak-sources.js.map +1 -1
- package/dist/deploy/targets/flatpak.d.ts.map +1 -1
- package/dist/deploy/targets/flatpak.js +1 -0
- package/dist/deploy/targets/flatpak.js.map +1 -1
- package/dist/deploy/targets/nfpm-target.d.ts.map +1 -1
- package/dist/deploy/targets/nfpm-target.js +13 -7
- package/dist/deploy/targets/nfpm-target.js.map +1 -1
- package/dist/deploy/types.d.ts +5 -2
- package/dist/deploy/types.d.ts.map +1 -1
- package/dist/deploy/types.js.map +1 -1
- package/dist/deploy/vendored/appimagetool.js +2 -2
- package/dist/deploy/vendored/appimagetool.js.map +1 -1
- package/dist/deploy/vendored/nfpm.js +1 -1
- package/dist/deploy/vendored/nfpm.js.map +1 -1
- package/dist/dev/catalog-writes.d.ts +8 -0
- package/dist/dev/catalog-writes.d.ts.map +1 -0
- package/dist/dev/catalog-writes.js +26 -0
- package/dist/dev/catalog-writes.js.map +1 -0
- package/dist/dev/entry-env.d.ts +2 -1
- package/dist/dev/entry-env.d.ts.map +1 -1
- package/dist/dev/entry-env.js +2 -1
- package/dist/dev/entry-env.js.map +1 -1
- package/dist/dev/font-dir.d.ts +3 -0
- package/dist/dev/font-dir.d.ts.map +1 -0
- package/dist/dev/font-dir.js +9 -0
- package/dist/dev/font-dir.js.map +1 -0
- package/dist/dev/headless.d.ts +3 -0
- package/dist/dev/headless.d.ts.map +1 -0
- package/dist/dev/headless.js +35 -0
- package/dist/dev/headless.js.map +1 -0
- package/dist/dev/runner-deps.d.ts +1 -1
- package/dist/dev/runner-deps.d.ts.map +1 -1
- package/dist/dev/runner-deps.js +12 -7
- package/dist/dev/runner-deps.js.map +1 -1
- package/dist/dev/runner-main.d.ts.map +1 -1
- package/dist/dev/runner-main.js +11 -5
- package/dist/dev/runner-main.js.map +1 -1
- package/dist/dev/runner.d.ts +2 -0
- package/dist/dev/runner.d.ts.map +1 -1
- package/dist/dev/runner.js +26 -7
- package/dist/dev/runner.js.map +1 -1
- package/dist/dev/schema-dir.d.ts +1 -1
- package/dist/dev/schema-dir.d.ts.map +1 -1
- package/dist/dev/schema-dir.js +2 -4
- package/dist/dev/schema-dir.js.map +1 -1
- package/dist/dev/supervisor.d.ts +3 -1
- package/dist/dev/supervisor.d.ts.map +1 -1
- package/dist/dev/supervisor.js +132 -29
- package/dist/dev/supervisor.js.map +1 -1
- package/dist/dev/vite-dev-server.d.ts +1 -1
- package/dist/dev/vite-dev-server.d.ts.map +1 -1
- package/dist/dev/vite-dev-server.js +14 -2
- package/dist/dev/vite-dev-server.js.map +1 -1
- package/dist/dev/watch-ignore.d.ts +3 -0
- package/dist/dev/watch-ignore.d.ts.map +1 -0
- package/dist/dev/watch-ignore.js +11 -0
- package/dist/dev/watch-ignore.js.map +1 -0
- package/dist/i18n/catalogs.d.ts +6 -2
- package/dist/i18n/catalogs.d.ts.map +1 -1
- package/dist/i18n/catalogs.js +12 -8
- package/dist/i18n/catalogs.js.map +1 -1
- package/dist/i18n/metadata-templates.d.ts.map +1 -1
- package/dist/i18n/metadata-templates.js +2 -1
- package/dist/i18n/metadata-templates.js.map +1 -1
- package/dist/i18n/source-messages.d.ts +5 -21
- package/dist/i18n/source-messages.d.ts.map +1 -1
- package/dist/i18n/source-messages.js +1037 -92
- package/dist/i18n/source-messages.js.map +1 -1
- package/dist/i18n/types.d.ts +6 -7
- package/dist/i18n/types.d.ts.map +1 -1
- package/dist/i18n/types.js +83 -96
- package/dist/i18n/types.js.map +1 -1
- package/dist/internal/agent-rules.d.ts.map +1 -1
- package/dist/internal/agent-rules.js +7 -2
- package/dist/internal/agent-rules.js.map +1 -1
- package/dist/internal/banner.d.ts +4 -2
- package/dist/internal/banner.d.ts.map +1 -1
- package/dist/internal/banner.js +19 -5
- package/dist/internal/banner.js.map +1 -1
- package/dist/internal/build-manifest.d.ts +5 -2
- package/dist/internal/build-manifest.d.ts.map +1 -1
- package/dist/internal/build-manifest.js +15 -2
- package/dist/internal/build-manifest.js.map +1 -1
- package/dist/internal/build-output.d.ts +8 -0
- package/dist/internal/build-output.d.ts.map +1 -0
- package/dist/internal/build-output.js +116 -0
- package/dist/internal/build-output.js.map +1 -0
- package/dist/internal/cache-root.d.ts +3 -0
- package/dist/internal/cache-root.d.ts.map +1 -0
- package/dist/internal/cache-root.js +9 -0
- package/dist/internal/cache-root.js.map +1 -0
- package/dist/internal/compile-cache-store.d.ts +4 -0
- package/dist/internal/compile-cache-store.d.ts.map +1 -0
- package/dist/internal/compile-cache-store.js +41 -0
- package/dist/internal/compile-cache-store.js.map +1 -0
- package/dist/internal/compile-cache.d.ts +4 -0
- package/dist/internal/compile-cache.d.ts.map +1 -0
- package/dist/internal/compile-cache.js +16 -0
- package/dist/internal/compile-cache.js.map +1 -0
- package/dist/internal/deploy-out-dir.d.ts +4 -0
- package/dist/internal/deploy-out-dir.d.ts.map +1 -0
- package/dist/internal/deploy-out-dir.js +5 -0
- package/dist/internal/deploy-out-dir.js.map +1 -0
- package/dist/internal/docs-elements.d.ts +1 -0
- package/dist/internal/docs-elements.d.ts.map +1 -1
- package/dist/internal/docs-elements.js +6 -5
- package/dist/internal/docs-elements.js.map +1 -1
- package/dist/internal/entry-arg.d.ts +4 -1
- package/dist/internal/entry-arg.d.ts.map +1 -1
- package/dist/internal/entry-arg.js +7 -1
- package/dist/internal/entry-arg.js.map +1 -1
- package/dist/internal/errors.d.ts +2 -1
- package/dist/internal/errors.d.ts.map +1 -1
- package/dist/internal/errors.js +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/font-path.d.ts +4 -0
- package/dist/internal/font-path.d.ts.map +1 -0
- package/dist/internal/font-path.js +12 -0
- package/dist/internal/font-path.js.map +1 -0
- package/dist/internal/font-staging.d.ts +6 -0
- package/dist/internal/font-staging.d.ts.map +1 -0
- package/dist/internal/font-staging.js +94 -0
- package/dist/internal/font-staging.js.map +1 -0
- package/dist/internal/icon-path.d.ts.map +1 -1
- package/dist/internal/icon-path.js +5 -16
- package/dist/internal/icon-path.js.map +1 -1
- package/dist/internal/icon-staging.d.ts +3 -0
- package/dist/internal/icon-staging.d.ts.map +1 -0
- package/dist/internal/icon-staging.js +40 -0
- package/dist/internal/icon-staging.js.map +1 -0
- package/dist/internal/import-scan.d.ts +4 -0
- package/dist/internal/import-scan.d.ts.map +1 -0
- package/dist/internal/import-scan.js +138 -0
- package/dist/internal/import-scan.js.map +1 -0
- package/dist/internal/module-hash.d.ts +3 -0
- package/dist/internal/module-hash.d.ts.map +1 -0
- package/dist/internal/module-hash.js +19 -0
- package/dist/internal/module-hash.js.map +1 -0
- package/dist/internal/output-directory.d.ts +15 -0
- package/dist/internal/output-directory.d.ts.map +1 -0
- package/dist/internal/output-directory.js +490 -0
- package/dist/internal/output-directory.js.map +1 -0
- package/dist/internal/parent-process.d.ts +12 -0
- package/dist/internal/parent-process.d.ts.map +1 -0
- package/dist/internal/parent-process.js +74 -0
- package/dist/internal/parent-process.js.map +1 -0
- package/dist/internal/prepare-project.d.ts +3 -0
- package/dist/internal/prepare-project.d.ts.map +1 -1
- package/dist/internal/prepare-project.js +9 -3
- package/dist/internal/prepare-project.js.map +1 -1
- package/dist/internal/react-compiler-cache.d.ts +13 -0
- package/dist/internal/react-compiler-cache.d.ts.map +1 -0
- package/dist/internal/react-compiler-cache.js +182 -0
- package/dist/internal/react-compiler-cache.js.map +1 -0
- package/dist/internal/source-imports.d.ts +7 -2
- package/dist/internal/source-imports.d.ts.map +1 -1
- package/dist/internal/source-imports.js +38 -49
- package/dist/internal/source-imports.js.map +1 -1
- package/dist/internal/staging-file.d.ts +5 -0
- package/dist/internal/staging-file.d.ts.map +1 -0
- package/dist/internal/staging-file.js +35 -0
- package/dist/internal/staging-file.js.map +1 -0
- package/dist/internal/xdg-banner.d.ts +4 -0
- package/dist/internal/xdg-banner.d.ts.map +1 -0
- package/dist/internal/xdg-banner.js +11 -0
- package/dist/internal/xdg-banner.js.map +1 -0
- package/dist/internal/xdg-data-dirs.d.ts +2 -1
- package/dist/internal/xdg-data-dirs.d.ts.map +1 -1
- package/dist/internal/xdg-data-dirs.js +1 -1
- package/dist/internal/xdg-data-dirs.js.map +1 -1
- package/dist/mcp/client.js +2 -2
- package/dist/mcp/client.js.map +1 -1
- package/dist/settings/render.d.ts +0 -1
- package/dist/settings/render.d.ts.map +1 -1
- package/dist/settings/render.js +1 -11
- package/dist/settings/render.js.map +1 -1
- package/dist/settings/schema.d.ts +2 -2
- package/dist/settings/schema.d.ts.map +1 -1
- package/dist/settings/schema.js +24 -70
- package/dist/settings/schema.js.map +1 -1
- package/dist/vite-plugins/asset-extensions.d.ts.map +1 -1
- package/dist/vite-plugins/asset-extensions.js +2 -0
- package/dist/vite-plugins/asset-extensions.js.map +1 -1
- package/dist/vite-plugins/asset-imports.d.ts +1 -2
- package/dist/vite-plugins/asset-imports.d.ts.map +1 -1
- package/dist/vite-plugins/asset-imports.js +36 -35
- package/dist/vite-plugins/asset-imports.js.map +1 -1
- package/dist/vite-plugins/asset-specifier.d.ts +5 -3
- package/dist/vite-plugins/asset-specifier.d.ts.map +1 -1
- package/dist/vite-plugins/asset-specifier.js +10 -4
- package/dist/vite-plugins/asset-specifier.js.map +1 -1
- package/dist/vite-plugins/build-manifest.d.ts +5 -1
- package/dist/vite-plugins/build-manifest.d.ts.map +1 -1
- package/dist/vite-plugins/build-manifest.js +2 -1
- package/dist/vite-plugins/build-manifest.js.map +1 -1
- package/dist/vite-plugins/built-url.d.ts.map +1 -1
- package/dist/vite-plugins/built-url.js +5 -2
- package/dist/vite-plugins/built-url.js.map +1 -1
- package/dist/vite-plugins/css.d.ts.map +1 -1
- package/dist/vite-plugins/css.js +13 -5
- package/dist/vite-plugins/css.js.map +1 -1
- package/dist/vite-plugins/ensure-store.d.ts +1 -1
- package/dist/vite-plugins/ensure-store.d.ts.map +1 -1
- package/dist/vite-plugins/ensure-store.js +2 -2
- package/dist/vite-plugins/ensure-store.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts +6 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js +3 -1
- package/dist/vite-plugins/fast-refresh/refresh-filter.js.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.d.ts.map +1 -1
- package/dist/vite-plugins/fast-refresh/swc-refresh.js +23 -14
- package/dist/vite-plugins/fast-refresh/swc-refresh.js.map +1 -1
- package/dist/vite-plugins/font-name.d.ts +3 -0
- package/dist/vite-plugins/font-name.d.ts.map +1 -0
- package/dist/vite-plugins/font-name.js +406 -0
- package/dist/vite-plugins/font-name.js.map +1 -0
- package/dist/vite-plugins/font-worker-env.d.ts +4 -0
- package/dist/vite-plugins/font-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/font-worker-env.js +19 -0
- package/dist/vite-plugins/font-worker-env.js.map +1 -0
- package/dist/vite-plugins/font.d.ts +4 -0
- package/dist/vite-plugins/font.d.ts.map +1 -0
- package/dist/vite-plugins/font.js +111 -0
- package/dist/vite-plugins/font.js.map +1 -0
- package/dist/vite-plugins/i18n.d.ts +11 -2
- package/dist/vite-plugins/i18n.d.ts.map +1 -1
- package/dist/vite-plugins/i18n.js +75 -8
- package/dist/vite-plugins/i18n.js.map +1 -1
- package/dist/vite-plugins/icon-worker-env.d.ts +4 -0
- package/dist/vite-plugins/icon-worker-env.d.ts.map +1 -0
- package/dist/vite-plugins/icon-worker-env.js +23 -0
- package/dist/vite-plugins/icon-worker-env.js.map +1 -0
- package/dist/vite-plugins/icons.d.ts.map +1 -1
- package/dist/vite-plugins/icons.js +4 -9
- package/dist/vite-plugins/icons.js.map +1 -1
- package/dist/vite-plugins/index.d.ts +10 -1
- package/dist/vite-plugins/index.d.ts.map +1 -1
- package/dist/vite-plugins/index.js +19 -7
- package/dist/vite-plugins/index.js.map +1 -1
- package/dist/vite-plugins/native.d.ts.map +1 -1
- package/dist/vite-plugins/native.js +0 -4
- package/dist/vite-plugins/native.js.map +1 -1
- package/dist/vite-plugins/react-compiler.d.ts.map +1 -1
- package/dist/vite-plugins/react-compiler.js +57 -18
- package/dist/vite-plugins/react-compiler.js.map +1 -1
- package/dist/vite-plugins/resource-shared.d.ts +3 -1
- package/dist/vite-plugins/resource-shared.d.ts.map +1 -1
- package/dist/vite-plugins/resource-shared.js +3 -1
- package/dist/vite-plugins/resource-shared.js.map +1 -1
- package/dist/vite-plugins/resources.d.ts.map +1 -1
- package/dist/vite-plugins/resources.js +40 -102
- package/dist/vite-plugins/resources.js.map +1 -1
- package/dist/vite-plugins/self-contained.d.ts.map +1 -1
- package/dist/vite-plugins/self-contained.js +159 -158
- package/dist/vite-plugins/self-contained.js.map +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts +1 -1
- package/dist/vite-plugins/settings-worker-env.d.ts.map +1 -1
- package/dist/vite-plugins/settings-worker-env.js +5 -7
- package/dist/vite-plugins/settings-worker-env.js.map +1 -1
- package/dist/vite-plugins/settings.d.ts +1 -2
- package/dist/vite-plugins/settings.d.ts.map +1 -1
- package/dist/vite-plugins/settings.js +32 -27
- package/dist/vite-plugins/settings.js.map +1 -1
- package/dist/vite-plugins/store-links.d.ts.map +1 -1
- package/dist/vite-plugins/store-links.js +9 -5
- package/dist/vite-plugins/store-links.js.map +1 -1
- package/dist/vite-plugins/undeclared-library.d.ts.map +1 -1
- package/dist/vite-plugins/undeclared-library.js +25 -25
- package/dist/vite-plugins/undeclared-library.js.map +1 -1
- package/dist/vite-plugins/worker.d.ts.map +1 -1
- package/dist/vite-plugins/worker.js +21 -14
- package/dist/vite-plugins/worker.js.map +1 -1
- package/dist/vitest-plugin.d.ts +4 -3
- package/dist/vitest-plugin.d.ts.map +1 -1
- package/dist/vitest-plugin.js +12 -8
- package/dist/vitest-plugin.js.map +1 -1
- package/env.d.ts +9 -0
- package/package.json +28 -17
- package/src/builder.ts +45 -12
- package/src/cli.ts +15 -2
- package/src/codegen/config-dependencies.ts +470 -0
- package/src/codegen/freshness.ts +70 -17
- package/src/codegen/reference.ts +2 -8
- package/src/codegen/report.ts +5 -21
- package/src/codegen/run-codegen.ts +73 -160
- package/src/codegen/store-resolver.ts +16 -27
- package/src/commands/build.ts +13 -2
- package/src/commands/cleanup.ts +48 -0
- package/src/commands/codegen.ts +6 -5
- package/src/commands/deploy.ts +10 -2
- package/src/commands/dev.ts +45 -4
- package/src/commands/docs.ts +6 -17
- package/src/deploy/depends.ts +30 -3
- package/src/deploy/download.ts +33 -24
- package/src/deploy/freedesktop/copyright.ts +2 -14
- package/src/deploy/freedesktop/metainfo.ts +73 -21
- package/src/deploy/freedesktop/validate.ts +80 -15
- package/src/deploy/freedesktop/xml.ts +24 -32
- package/src/deploy/native-addon.ts +183 -0
- package/src/deploy/nfpm/config.ts +13 -4
- package/src/deploy/nfpm/contents.ts +8 -0
- package/src/deploy/node-runtime/download.ts +2 -2
- package/src/deploy/node-runtime/elf.ts +46 -5
- package/src/deploy/node-runtime/guard.ts +10 -14
- package/src/deploy/node-runtime/index.ts +148 -12
- package/src/deploy/node-runtime/license.ts +2 -8
- package/src/deploy/node-runtime/sonames.ts +17 -0
- package/src/deploy/notices/node-runtime.ts +2 -2
- package/src/deploy/notices/packages.ts +3 -11
- package/src/deploy/payload/copy-tree.ts +3 -4
- package/src/deploy/payload/launcher.ts +20 -1
- package/src/deploy/payload/stage.ts +78 -11
- package/src/deploy/run-deploy.ts +227 -72
- package/src/deploy/settings/arch.ts +40 -8
- package/src/deploy/settings/build-manifest.ts +30 -17
- package/src/deploy/settings/extra-files.ts +30 -4
- package/src/deploy/settings/index.ts +7 -2
- package/src/deploy/settings/libraries.ts +2 -22
- package/src/deploy/settings/paths.ts +78 -21
- package/src/deploy/settings/screenshots.ts +8 -46
- package/src/deploy/targets/appimage.ts +1 -0
- package/src/deploy/targets/flatpak-pnpm.ts +4 -4
- package/src/deploy/targets/flatpak-source.ts +19 -6
- package/src/deploy/targets/flatpak-sources.ts +1 -1
- package/src/deploy/targets/flatpak.ts +1 -0
- package/src/deploy/targets/nfpm-target.ts +14 -6
- package/src/deploy/types.ts +5 -1
- package/src/deploy/vendored/appimagetool.ts +2 -2
- package/src/deploy/vendored/nfpm.ts +1 -1
- package/src/dev/catalog-writes.ts +35 -0
- package/src/dev/entry-env.ts +2 -1
- package/src/dev/font-dir.ts +11 -0
- package/src/dev/headless.ts +40 -0
- package/src/dev/runner-deps.ts +20 -7
- package/src/dev/runner-main.ts +13 -5
- package/src/dev/runner.ts +37 -7
- package/src/dev/schema-dir.ts +2 -4
- package/src/dev/supervisor.ts +183 -32
- package/src/dev/vite-dev-server.ts +20 -2
- package/src/dev/watch-ignore.ts +16 -0
- package/src/i18n/catalogs.ts +23 -9
- package/src/i18n/metadata-templates.ts +2 -1
- package/src/i18n/source-messages.ts +1641 -262
- package/src/i18n/types.ts +97 -131
- package/src/internal/agent-rules.ts +7 -2
- package/src/internal/banner.ts +27 -6
- package/src/internal/build-manifest.ts +25 -1
- package/src/internal/build-output.ts +171 -0
- package/src/internal/cache-root.ts +12 -0
- package/src/internal/compile-cache-store.ts +50 -0
- package/src/internal/compile-cache.ts +20 -0
- package/src/internal/deploy-out-dir.ts +8 -0
- package/src/internal/docs-elements.ts +11 -5
- package/src/internal/entry-arg.ts +8 -1
- package/src/internal/errors.ts +1 -1
- package/src/internal/font-path.ts +15 -0
- package/src/internal/font-staging.ts +131 -0
- package/src/internal/icon-path.ts +6 -19
- package/src/internal/icon-staging.ts +58 -0
- package/src/internal/import-scan.ts +206 -0
- package/src/internal/module-hash.ts +22 -0
- package/src/internal/output-directory.ts +699 -0
- package/src/internal/parent-process.ts +110 -0
- package/src/internal/prepare-project.ts +11 -5
- package/src/internal/react-compiler-cache.ts +246 -0
- package/src/internal/source-imports.ts +64 -55
- package/src/internal/staging-file.ts +42 -0
- package/src/internal/xdg-banner.ts +13 -0
- package/src/internal/xdg-data-dirs.ts +1 -1
- package/src/mcp/client.ts +2 -2
- package/src/settings/render.ts +1 -13
- package/src/settings/schema.ts +23 -91
- package/src/vite-plugins/asset-extensions.ts +2 -0
- package/src/vite-plugins/asset-imports.ts +39 -45
- package/src/vite-plugins/asset-specifier.ts +17 -5
- package/src/vite-plugins/build-manifest.ts +7 -1
- package/src/vite-plugins/built-url.ts +6 -2
- package/src/vite-plugins/css.ts +16 -5
- package/src/vite-plugins/ensure-store.ts +2 -2
- package/src/vite-plugins/fast-refresh/refresh-filter.ts +10 -1
- package/src/vite-plugins/fast-refresh/swc-refresh.ts +33 -14
- package/src/vite-plugins/font-name.ts +582 -0
- package/src/vite-plugins/font-worker-env.ts +25 -0
- package/src/vite-plugins/font.ts +180 -0
- package/src/vite-plugins/i18n.ts +123 -11
- package/src/vite-plugins/icon-worker-env.ts +36 -0
- package/src/vite-plugins/icons.ts +4 -10
- package/src/vite-plugins/index.ts +36 -13
- package/src/vite-plugins/native.ts +0 -5
- package/src/vite-plugins/react-compiler.ts +83 -19
- package/src/vite-plugins/resource-shared.ts +4 -0
- package/src/vite-plugins/resources.ts +47 -144
- package/src/vite-plugins/self-contained.ts +184 -185
- package/src/vite-plugins/settings-worker-env.ts +5 -7
- package/src/vite-plugins/settings.ts +44 -33
- package/src/vite-plugins/store-links.ts +10 -5
- package/src/vite-plugins/undeclared-library.ts +30 -32
- package/src/vite-plugins/worker.ts +31 -16
- package/src/vitest-plugin.ts +12 -8
- package/dist/i18n/binding-extractor.d.ts +0 -30
- package/dist/i18n/binding-extractor.d.ts.map +0 -1
- package/dist/i18n/binding-extractor.js +0 -1324
- package/dist/i18n/binding-extractor.js.map +0 -1
- package/dist/i18n/extractor-plugin.d.ts +0 -8
- package/dist/i18n/extractor-plugin.d.ts.map +0 -1
- package/dist/i18n/extractor-plugin.js +0 -247
- package/dist/i18n/extractor-plugin.js.map +0 -1
- package/dist/internal/data-dir.d.ts +0 -4
- package/dist/internal/data-dir.d.ts.map +0 -1
- package/dist/internal/data-dir.js +0 -52
- package/dist/internal/data-dir.js.map +0 -1
- package/dist/vite-plugins/animated.d.ts +0 -5
- package/dist/vite-plugins/animated.d.ts.map +0 -1
- package/dist/vite-plugins/animated.js +0 -325
- package/dist/vite-plugins/animated.js.map +0 -1
- package/src/i18n/binding-extractor.ts +0 -1969
- package/src/i18n/extractor-plugin.ts +0 -413
- package/src/internal/data-dir.ts +0 -70
- package/src/vite-plugins/animated.ts +0 -486
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Plugin, UserConfig } from "vite";
|
|
2
2
|
import { ensureStoreLinks } from "@gtkx/codegen/internal";
|
|
3
|
+
import { viteProjectRoot } from "@gtkx/config/internal";
|
|
3
4
|
|
|
4
5
|
const GENERATED_MODULE_PREFIX = /^@gtkx\/(?:gi\/|jsx(?:\/|$))/;
|
|
5
6
|
|
|
@@ -11,13 +12,17 @@ function gtkxStoreLinks(): Plugin {
|
|
|
11
12
|
enforce: "pre",
|
|
12
13
|
|
|
13
14
|
config(config: UserConfig) {
|
|
14
|
-
state.root = config
|
|
15
|
+
state.root = viteProjectRoot(config);
|
|
15
16
|
},
|
|
16
17
|
|
|
17
|
-
resolveId
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
resolveId: {
|
|
19
|
+
filter: { id: GENERATED_MODULE_PREFIX },
|
|
20
|
+
|
|
21
|
+
handler(source) {
|
|
22
|
+
if (GENERATED_MODULE_PREFIX.test(source)) {
|
|
23
|
+
ensureStoreLinks(state.root);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
21
26
|
},
|
|
22
27
|
};
|
|
23
28
|
}
|
|
@@ -2,7 +2,7 @@ import type { StoreOptions } from "@gtkx/codegen";
|
|
|
2
2
|
import type { ConfigLoader } from "@gtkx/config";
|
|
3
3
|
import type { Plugin, UserConfig } from "vite";
|
|
4
4
|
import { discoverGirNamespaces, resolveGirPath, resolveStore } from "@gtkx/codegen";
|
|
5
|
-
import { createConfigLoader } from "@gtkx/config/internal";
|
|
5
|
+
import { createConfigLoader, viteProjectRoot } from "@gtkx/config/internal";
|
|
6
6
|
import { existsSync, readFileSync } from "node:fs";
|
|
7
7
|
import { join } from "node:path";
|
|
8
8
|
|
|
@@ -15,11 +15,12 @@ type PluginState = {
|
|
|
15
15
|
type GeneratedModule = {
|
|
16
16
|
source: string;
|
|
17
17
|
kind: string;
|
|
18
|
-
namespace: string
|
|
18
|
+
namespace: string;
|
|
19
19
|
importer: string;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const GENERATED_MODULE_PATTERN = /^@gtkx\/(gi|jsx)\/([a-z0-9]+)$/;
|
|
23
|
+
const DEFAULT_LIBRARY_NAMESPACES: Set<string> = new Set(["adw", "gtk"]);
|
|
23
24
|
|
|
24
25
|
const girSearchPaths = async (state: PluginState): Promise<string[]> => {
|
|
25
26
|
if (state.girPath === null) {
|
|
@@ -36,10 +37,6 @@ const findGirIdentifier = (girPath: string[], namespace: string): string | undef
|
|
|
36
37
|
discoverGirNamespaces(girPath).find((identifier) => getNamespace(identifier) === namespace);
|
|
37
38
|
|
|
38
39
|
const parseGeneratedModule = (source: string, importer: string | undefined): GeneratedModule | null => {
|
|
39
|
-
if (source === "@gtkx/jsx") {
|
|
40
|
-
return { source, kind: "jsx", namespace: null, importer: importer ?? "the project's sources" };
|
|
41
|
-
}
|
|
42
|
-
|
|
43
40
|
const matched = GENERATED_MODULE_PATTERN.exec(source);
|
|
44
41
|
const kind = matched?.[1];
|
|
45
42
|
const namespace = matched?.[2];
|
|
@@ -74,7 +71,7 @@ const hasStoreModule = (storeDir: string, exportKey: string): boolean => {
|
|
|
74
71
|
};
|
|
75
72
|
|
|
76
73
|
const unreachableStoreError = (generated: GeneratedModule, options: StoreOptions): Error => {
|
|
77
|
-
const provided =
|
|
74
|
+
const provided = `"${generated.namespace}"`;
|
|
78
75
|
|
|
79
76
|
return new Error(
|
|
80
77
|
`Cannot resolve "${generated.source}": the generated store in ${options.storeDir} does provide ` +
|
|
@@ -84,21 +81,22 @@ const unreachableStoreError = (generated: GeneratedModule, options: StoreOptions
|
|
|
84
81
|
);
|
|
85
82
|
};
|
|
86
83
|
|
|
87
|
-
const missingIndexError = (generated: GeneratedModule): Error =>
|
|
88
|
-
new Error(
|
|
89
|
-
`Cannot resolve "${generated.source}": the binding store has no index module. ` +
|
|
90
|
-
"Run gtkx codegen to regenerate the store.",
|
|
91
|
-
);
|
|
92
|
-
|
|
93
84
|
const undeclaredLibraryError = (source: string, namespace: string, girPath: string[]): Error => {
|
|
94
85
|
const identifier = findGirIdentifier(girPath, namespace);
|
|
95
86
|
|
|
96
87
|
if (identifier === undefined) {
|
|
97
88
|
return new Error(
|
|
98
89
|
`Cannot resolve "${source}": the binding store has no "${namespace}" module, and no ` +
|
|
99
|
-
`GIR data for it was found in [${girPath.join(", ")}]. If "${namespace}" is a library, ` +
|
|
100
|
-
"
|
|
101
|
-
"gtkx.config.ts. Otherwise run gtkx codegen to regenerate the store.",
|
|
90
|
+
`GIR data for it was found in [${girPath.join(", ")}]. If "${namespace}" is a library, install ` +
|
|
91
|
+
"its gobject-introspection data package. Adw-1 is bound by default and pulls in Gtk-4.0; add only other " +
|
|
92
|
+
"GIR identifiers to `libraries` in gtkx.config.ts. Otherwise run gtkx codegen to regenerate the store.",
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (DEFAULT_LIBRARY_NAMESPACES.has(namespace)) {
|
|
97
|
+
return new Error(
|
|
98
|
+
`Cannot resolve "${source}": the "${identifier}" bindings have not been generated. ` +
|
|
99
|
+
"The Adwaita and GTK namespaces are generated implicitly; run gtkx dev or gtkx build again.",
|
|
102
100
|
);
|
|
103
101
|
}
|
|
104
102
|
|
|
@@ -110,16 +108,12 @@ const undeclaredLibraryError = (source: string, namespace: string, girPath: stri
|
|
|
110
108
|
|
|
111
109
|
const unresolvedModuleError = async (state: PluginState, generated: GeneratedModule): Promise<Error> => {
|
|
112
110
|
const options = getStoreOptions(state.root, generated.kind);
|
|
113
|
-
const exportKey =
|
|
111
|
+
const exportKey = `./${generated.namespace}`;
|
|
114
112
|
|
|
115
113
|
if (options !== null && hasStoreModule(options.storeDir, exportKey)) {
|
|
116
114
|
return unreachableStoreError(generated, options);
|
|
117
115
|
}
|
|
118
116
|
|
|
119
|
-
if (generated.namespace === null) {
|
|
120
|
-
return missingIndexError(generated);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
117
|
return undeclaredLibraryError(generated.source, generated.namespace, await girSearchPaths(state));
|
|
124
118
|
};
|
|
125
119
|
|
|
@@ -135,23 +129,27 @@ function gtkxUndeclaredLibrary(loadConfig: ConfigLoader = createConfigLoader()):
|
|
|
135
129
|
enforce: "pre",
|
|
136
130
|
|
|
137
131
|
config(config: UserConfig) {
|
|
138
|
-
state.root = config
|
|
132
|
+
state.root = viteProjectRoot(config);
|
|
139
133
|
},
|
|
140
134
|
|
|
141
|
-
|
|
142
|
-
|
|
135
|
+
resolveId: {
|
|
136
|
+
filter: { id: GENERATED_MODULE_PATTERN },
|
|
137
|
+
|
|
138
|
+
async handler(source, importer, options) {
|
|
139
|
+
const generated = parseGeneratedModule(source, importer);
|
|
143
140
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
if (generated === null) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
147
144
|
|
|
148
|
-
|
|
145
|
+
const resolved = await this.resolve(source, importer, { ...options, skipSelf: true });
|
|
149
146
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
if (resolved !== null) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
153
150
|
|
|
154
|
-
|
|
151
|
+
throw await unresolvedModuleError(state, generated);
|
|
152
|
+
},
|
|
155
153
|
},
|
|
156
154
|
};
|
|
157
155
|
}
|
|
@@ -7,12 +7,17 @@ import { stripQuery } from "./strip-query.js";
|
|
|
7
7
|
type WorkerReplacement = {
|
|
8
8
|
start: number;
|
|
9
9
|
end: number;
|
|
10
|
-
|
|
10
|
+
referenceId: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type WorkerReferences = {
|
|
14
|
+
byModule: Map<string, string>;
|
|
15
|
+
claimed: Set<string>;
|
|
11
16
|
};
|
|
12
17
|
|
|
13
18
|
type EmitContext = {
|
|
14
19
|
context: Rollup.PluginContext;
|
|
15
|
-
|
|
20
|
+
references: WorkerReferences;
|
|
16
21
|
};
|
|
17
22
|
|
|
18
23
|
type SourceRange = {
|
|
@@ -56,7 +61,6 @@ const NON_CODE = new RegExp(
|
|
|
56
61
|
const WORKER_DIR = "workers";
|
|
57
62
|
|
|
58
63
|
const SUGGESTED_EXTENSIONS: Record<string, string[]> = {
|
|
59
|
-
".cjs": [".cts"],
|
|
60
64
|
".js": [".ts", ".tsx"],
|
|
61
65
|
".jsx": [".tsx"],
|
|
62
66
|
".mjs": [".mts"],
|
|
@@ -84,10 +88,12 @@ const isWorkerConstruction = (code: string, matchIndex: number): boolean =>
|
|
|
84
88
|
|
|
85
89
|
const hasWorkerCandidate = (code: string): boolean => code.includes("import.meta.url") && code.includes("Worker");
|
|
86
90
|
|
|
87
|
-
const
|
|
88
|
-
|
|
91
|
+
const workerUrlReference = (referenceId: string): string => `import.meta.ROLLUP_FILE_URL_${referenceId}`;
|
|
92
|
+
|
|
93
|
+
const workerUrlExpression = (relativePath: string): string => {
|
|
94
|
+
const specifier = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
89
95
|
|
|
90
|
-
return `new URL(${specifier}, import.meta.url)`;
|
|
96
|
+
return `new URL(${JSON.stringify(specifier)}, import.meta.url)`;
|
|
91
97
|
};
|
|
92
98
|
|
|
93
99
|
const inlineWorkerExample = (specifier: string): string =>
|
|
@@ -126,17 +132,22 @@ const suggestionFor = async (emit: EmitContext, scan: ScanContext, specifier: st
|
|
|
126
132
|
};
|
|
127
133
|
|
|
128
134
|
const claimWorker = (emit: EmitContext, resolvedId: string): string => {
|
|
129
|
-
const existing = emit.
|
|
135
|
+
const existing = emit.references.byModule.get(resolvedId);
|
|
130
136
|
|
|
131
137
|
if (existing !== undefined) {
|
|
132
138
|
return existing;
|
|
133
139
|
}
|
|
134
140
|
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
const referenceId = emit.context.emitFile({
|
|
142
|
+
type: "chunk",
|
|
143
|
+
id: resolvedId,
|
|
144
|
+
fileName: workerFileName(resolvedId),
|
|
145
|
+
});
|
|
138
146
|
|
|
139
|
-
|
|
147
|
+
emit.references.byModule.set(resolvedId, referenceId);
|
|
148
|
+
emit.references.claimed.add(referenceId);
|
|
149
|
+
|
|
150
|
+
return referenceId;
|
|
140
151
|
};
|
|
141
152
|
|
|
142
153
|
const isRewritableUrl = (scan: ScanContext, match: RegExpExecArray): boolean =>
|
|
@@ -159,7 +170,7 @@ const replacementFor = async (
|
|
|
159
170
|
throw unresolvedWorkerError(scan, specifier, await suggestionFor(emit, scan, specifier));
|
|
160
171
|
}
|
|
161
172
|
|
|
162
|
-
return { start: match.index, end: match.index + match[0].length,
|
|
173
|
+
return { start: match.index, end: match.index + match[0].length, referenceId: claimWorker(emit, resolved.id) };
|
|
163
174
|
};
|
|
164
175
|
|
|
165
176
|
const collectReplacements = async (emit: EmitContext, scan: ScanContext): Promise<WorkerReplacement[]> => {
|
|
@@ -197,8 +208,8 @@ const applyReplacements = (code: string, replacements: WorkerReplacement[]): str
|
|
|
197
208
|
let output = "";
|
|
198
209
|
let cursor = 0;
|
|
199
210
|
|
|
200
|
-
for (const { start, end,
|
|
201
|
-
output += code.slice(cursor, start) +
|
|
211
|
+
for (const { start, end, referenceId } of replacements) {
|
|
212
|
+
output += code.slice(cursor, start) + workerUrlReference(referenceId);
|
|
202
213
|
cursor = end;
|
|
203
214
|
}
|
|
204
215
|
|
|
@@ -223,14 +234,18 @@ const transformWorkerUrls = async (emit: EmitContext, code: string, id: string):
|
|
|
223
234
|
};
|
|
224
235
|
|
|
225
236
|
function gtkxWorker(): Plugin {
|
|
226
|
-
const
|
|
237
|
+
const references: WorkerReferences = { byModule: new Map(), claimed: new Set() };
|
|
227
238
|
|
|
228
239
|
return {
|
|
229
240
|
name: "gtkx:worker",
|
|
230
241
|
apply: "build",
|
|
231
242
|
|
|
232
243
|
transform(code, id) {
|
|
233
|
-
return transformWorkerUrls({ context: this,
|
|
244
|
+
return transformWorkerUrls({ context: this, references }, code, id);
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
resolveFileUrl({ referenceId, relativePath }) {
|
|
248
|
+
return references.claimed.has(referenceId) ? workerUrlExpression(relativePath) : null;
|
|
234
249
|
},
|
|
235
250
|
};
|
|
236
251
|
}
|
package/src/vitest-plugin.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
-
import gtkxVitest from "@gtkx/vitest";
|
|
2
|
+
import gtkxVitest, { type PluginOptions } from "@gtkx/vitest";
|
|
3
3
|
import { gtkxEnsureStore } from "./vite-plugins/ensure-store.js";
|
|
4
|
+
import { gtkxFontWorkerEnv } from "./vite-plugins/font-worker-env.js";
|
|
5
|
+
import { gtkxIconWorkerEnv } from "./vite-plugins/icon-worker-env.js";
|
|
4
6
|
import { gtkxVitePlugins } from "./vite-plugins/index.js";
|
|
5
7
|
import { gtkxSettingsWorkerEnv } from "./vite-plugins/settings-worker-env.js";
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Vite plugin stack for testing a GTKX application: the generated bindings the tests import,
|
|
9
|
-
* the plugins the app is built with, the project's compiled GSettings schemas
|
|
10
|
-
* test worker, and a headless display per worker.
|
|
11
|
+
* the plugins the app is built with, the project's compiled GSettings schemas and its configured
|
|
12
|
+
* application icon exposed to every test worker, and a headless display per worker.
|
|
11
13
|
*
|
|
12
14
|
* @returns The plugins to spread into a Vitest config.
|
|
13
15
|
*/
|
|
14
|
-
const gtkx = (): Plugin[] => [
|
|
15
|
-
gtkxEnsureStore(),
|
|
16
|
-
...gtkxVitePlugins(),
|
|
17
|
-
gtkxSettingsWorkerEnv(),
|
|
18
|
-
|
|
16
|
+
const gtkx = (options: PluginOptions = {}): Plugin[] => [
|
|
17
|
+
gtkxEnsureStore(options.configFile),
|
|
18
|
+
...gtkxVitePlugins({ configFile: options.configFile }),
|
|
19
|
+
gtkxSettingsWorkerEnv(options.configFile),
|
|
20
|
+
gtkxFontWorkerEnv(options.configFile),
|
|
21
|
+
gtkxIconWorkerEnv(options.configFile),
|
|
22
|
+
gtkxVitest(options),
|
|
19
23
|
];
|
|
20
24
|
|
|
21
25
|
export default gtkx;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
type ScopeInfo = {
|
|
2
|
-
defaultNs?: string;
|
|
3
|
-
keyPrefix?: string;
|
|
4
|
-
namespaces?: string[];
|
|
5
|
-
};
|
|
6
|
-
type ExtractedCall = {
|
|
7
|
-
info: ScopeInfo;
|
|
8
|
-
key: string;
|
|
9
|
-
};
|
|
10
|
-
type ExtractedMessage = {
|
|
11
|
-
defaultValue: string;
|
|
12
|
-
explicitDefault: boolean;
|
|
13
|
-
key: string;
|
|
14
|
-
location: {
|
|
15
|
-
column?: number;
|
|
16
|
-
file: string;
|
|
17
|
-
line?: number;
|
|
18
|
-
};
|
|
19
|
-
ns?: string;
|
|
20
|
-
};
|
|
21
|
-
type BindingExtraction = {
|
|
22
|
-
blockedGetFixedT: Set<string>;
|
|
23
|
-
calls: Map<string, ExtractedCall>;
|
|
24
|
-
errors: string[];
|
|
25
|
-
messages: ExtractedMessage[];
|
|
26
|
-
trans: Map<string, ScopeInfo | null>;
|
|
27
|
-
};
|
|
28
|
-
declare const extractBindings: (code: string, path: string) => Promise<BindingExtraction>;
|
|
29
|
-
export { type BindingExtraction, type ScopeInfo, extractBindings };
|
|
30
|
-
//# sourceMappingURL=binding-extractor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"binding-extractor.d.ts","sourceRoot":"","sources":["../../src/i18n/binding-extractor.ts"],"names":[],"mappings":"AAgBA,KAAK,SAAS,GAAG;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAiBF,KAAK,aAAa,GAAG;IACjB,IAAI,EAAE,SAAS,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,EAAE,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACrB,gBAAgB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC;CACxC,CAAC;AAslBF,QAAA,MAAM,eAAe,GAAU,MAAM,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,iBAAiB,CA6BpF,CAAC;AAiwCF,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,eAAe,EAAE,CAAC"}
|