@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/codegen/freshness.ts
CHANGED
|
@@ -1,53 +1,106 @@
|
|
|
1
1
|
import type { Config } from "@gtkx/config";
|
|
2
2
|
import { resolveGirPath, resolveLibraries } from "@gtkx/codegen";
|
|
3
|
-
import {
|
|
4
|
-
import { existsSync } from "node:fs";
|
|
5
|
-
import { join } from "node:path";
|
|
3
|
+
import { resolveBoundLibraries } from "@gtkx/codegen/internal";
|
|
4
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
+
import { basename, dirname, join } from "node:path";
|
|
6
6
|
import { type CodegenStore, resolveCodegenStore } from "./store-resolver.js";
|
|
7
7
|
|
|
8
|
+
type ExportTarget = string | { [condition: string]: ExportTarget };
|
|
9
|
+
type StoreExports = Record<string, ExportTarget>;
|
|
10
|
+
|
|
8
11
|
type CodegenInputs = {
|
|
9
12
|
girPath: string[];
|
|
10
13
|
libraries: string[];
|
|
11
14
|
store: CodegenStore;
|
|
12
15
|
};
|
|
13
16
|
|
|
14
|
-
const
|
|
17
|
+
const PACKAGE_EXPORT = "./package.json";
|
|
18
|
+
const JSX_REQUIRED_EXPORTS = [PACKAGE_EXPORT, "./metadata", "./gtk", "./adw"];
|
|
15
19
|
|
|
16
20
|
const resolveCodegenInputs = (cwd: string, config: Config): CodegenInputs => {
|
|
17
21
|
const girPath = resolveGirPath(config.girPath);
|
|
18
|
-
const libraries = resolveLibraries(config.libraries
|
|
22
|
+
const libraries = resolveLibraries(config.libraries);
|
|
19
23
|
const store = resolveCodegenStore(cwd);
|
|
20
24
|
|
|
21
25
|
return { girPath, libraries, store };
|
|
22
26
|
};
|
|
23
27
|
|
|
24
|
-
const
|
|
28
|
+
const namespaceExport = (library: string): string => {
|
|
25
29
|
const separator = library.indexOf("-");
|
|
26
30
|
const namespace = (separator === -1 ? library : library.slice(0, separator)).toLowerCase();
|
|
27
31
|
|
|
28
|
-
return
|
|
32
|
+
return `./${namespace}`;
|
|
29
33
|
};
|
|
30
34
|
|
|
31
|
-
const
|
|
35
|
+
const targetFiles = (target: ExportTarget): string[] =>
|
|
36
|
+
typeof target === "string" ? [target] : Object.values(target).flatMap((nested) => targetFiles(nested));
|
|
32
37
|
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
return
|
|
38
|
+
const indexExtension = (target: string): string | undefined => {
|
|
39
|
+
if (target.endsWith("/index.d.ts")) {
|
|
40
|
+
return ".d.ts";
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
return
|
|
43
|
+
return target.endsWith("/index.js") ? ".js" : undefined;
|
|
39
44
|
};
|
|
40
45
|
|
|
41
|
-
const
|
|
42
|
-
|
|
46
|
+
const implementationFile = (target: string): string | undefined => {
|
|
47
|
+
const extension = indexExtension(target);
|
|
48
|
+
|
|
49
|
+
if (extension === undefined) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const directory = dirname(target);
|
|
54
|
+
|
|
55
|
+
return join(directory, `${basename(directory)}${extension}`);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const generatedFiles = (exports: StoreExports): string[] =>
|
|
59
|
+
Object.values(exports)
|
|
60
|
+
.flatMap((target) => targetFiles(target))
|
|
61
|
+
.flatMap((target) => {
|
|
62
|
+
const implementation = implementationFile(target);
|
|
63
|
+
|
|
64
|
+
return implementation === undefined ? [target] : [target, implementation];
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const hasStoreExports = (storeDir: string, required: string[], forbidden: string[] = []): boolean => {
|
|
68
|
+
const manifestPath = join(storeDir, "package.json");
|
|
69
|
+
|
|
70
|
+
if (!existsSync(manifestPath)) {
|
|
43
71
|
return false;
|
|
44
72
|
}
|
|
45
73
|
|
|
46
|
-
|
|
47
|
-
|
|
74
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8")) as {
|
|
75
|
+
exports?: StoreExports;
|
|
76
|
+
};
|
|
77
|
+
const exports = manifest.exports;
|
|
78
|
+
|
|
79
|
+
if (exports === undefined || required.some((key) => !Object.hasOwn(exports, key)) ||
|
|
80
|
+
forbidden.some((key) => Object.hasOwn(exports, key))) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const files = generatedFiles(exports);
|
|
85
|
+
|
|
86
|
+
return files.length > 0 && files.every((file) => existsSync(join(storeDir, file)));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const isGiStoreStale = (store: CodegenStore, libraries: string[]): boolean => {
|
|
90
|
+
const required = [
|
|
91
|
+
PACKAGE_EXPORT,
|
|
92
|
+
...resolveBoundLibraries(libraries).map((library) => namespaceExport(library)),
|
|
93
|
+
];
|
|
94
|
+
|
|
95
|
+
return !hasStoreExports(store.giStoreDir, required);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const isReactStoreStale = (store: CodegenStore): boolean => {
|
|
99
|
+
if (store.react === null) {
|
|
100
|
+
return false;
|
|
48
101
|
}
|
|
49
102
|
|
|
50
|
-
return
|
|
103
|
+
return !hasStoreExports(store.jsxStoreDir, JSX_REQUIRED_EXPORTS, ["."]);
|
|
51
104
|
};
|
|
52
105
|
|
|
53
106
|
const isCodegenStale = (inputs: CodegenInputs): boolean => {
|
package/src/codegen/reference.ts
CHANGED
|
@@ -22,8 +22,6 @@ type ReferenceResult = {
|
|
|
22
22
|
const REFERENCE_PATH = ".gtkx/reference";
|
|
23
23
|
const SKIPPED: ReferenceResult = { isRegenerated: false, elements: 0, namespaces: 0 };
|
|
24
24
|
|
|
25
|
-
const resolveReferenceDir = (root: string): string => join(root, ".gtkx", "reference");
|
|
26
|
-
|
|
27
25
|
const writeReference = async (options: WriteReferenceOptions): Promise<ReferenceResult> => {
|
|
28
26
|
const { root, config, girPath, libraries } = options;
|
|
29
27
|
|
|
@@ -36,17 +34,13 @@ const writeReference = async (options: WriteReferenceOptions): Promise<Reference
|
|
|
36
34
|
const { isRegenerated, namespaces } = writeDocs({
|
|
37
35
|
libraries,
|
|
38
36
|
girPath,
|
|
39
|
-
outDir:
|
|
37
|
+
outDir: join(root, REFERENCE_PATH),
|
|
40
38
|
basePath: REFERENCE_PATH,
|
|
41
39
|
linkStyle: "file",
|
|
42
40
|
props: builtin.props,
|
|
41
|
+
acceptedChildTypes: builtin.acceptedChildTypes,
|
|
43
42
|
omittedProps: mergeOmittedProps(builtin.omittedProps, resolveOmittedProps(config.elements)),
|
|
44
43
|
isForced: options.isForced === true,
|
|
45
|
-
isByteArrayTyped: config.future?.v2ByteArrays === true,
|
|
46
|
-
isValueUnwrapped: config.future?.v2ValueReturns === true,
|
|
47
|
-
isFinishTrimmed: config.future?.v2FinishResults === true,
|
|
48
|
-
isInoutInPlace: config.future?.v2InoutReturns === true,
|
|
49
|
-
isTreeShaken: config.future?.v2TreeShaking === true,
|
|
50
44
|
});
|
|
51
45
|
|
|
52
46
|
return {
|
package/src/codegen/report.ts
CHANGED
|
@@ -3,27 +3,11 @@ import { REFERENCE_PATH } from "./reference.js";
|
|
|
3
3
|
|
|
4
4
|
const PREFIX = "codegen: ";
|
|
5
5
|
|
|
6
|
-
const contextDetails = (result: RunCodegenResult): string[] =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (result.libraries) {
|
|
14
|
-
details.push(`libraries=${result.libraries.join(", ")}`);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (result.girPath) {
|
|
18
|
-
details.push(`girPath=${result.girPath.join(":")}`);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (result.future && result.future.length > 0) {
|
|
22
|
-
details.push(`future=${result.future.join(", ")}`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return details;
|
|
26
|
-
};
|
|
6
|
+
const contextDetails = (result: RunCodegenResult): string[] => [
|
|
7
|
+
`config=${result.configFile}`,
|
|
8
|
+
`libraries=${result.libraries.join(", ")}`,
|
|
9
|
+
`girPath=${result.girPath.join(":")}`,
|
|
10
|
+
];
|
|
27
11
|
|
|
28
12
|
const referenceDetails = (result: RunCodegenResult): string[] => {
|
|
29
13
|
if (result.reference?.isRegenerated !== true) {
|
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import { runCodegen as runCodegenCore } from "@gtkx/codegen";
|
|
2
|
-
import {
|
|
3
|
-
getShadowingStorePaths,
|
|
4
|
-
LIBRARIES_WILDCARD,
|
|
5
|
-
redundantLibraries,
|
|
6
|
-
sweepProjectStaging,
|
|
7
|
-
} from "@gtkx/codegen/internal";
|
|
2
|
+
import { getShadowingStorePaths, sweepProjectStaging } from "@gtkx/codegen/internal";
|
|
8
3
|
import { type Config, loadConfig } from "@gtkx/config";
|
|
9
4
|
import {
|
|
5
|
+
configDependenciesFor,
|
|
10
6
|
isAgentRulesEnabled,
|
|
11
|
-
type ResolvedFuture,
|
|
12
7
|
resolveElementComponents,
|
|
13
8
|
resolveElementProps,
|
|
14
|
-
resolveFuture,
|
|
15
9
|
resolveLazyElements,
|
|
16
10
|
resolveOmittedProps,
|
|
17
|
-
unknownFutureKeys,
|
|
18
11
|
} from "@gtkx/config/internal";
|
|
19
|
-
import { info
|
|
12
|
+
import { info } from "@gtkx/utils";
|
|
20
13
|
import { existsSync, rmSync } from "node:fs";
|
|
21
|
-
import { join, resolve } from "node:path";
|
|
14
|
+
import { join, relative, resolve } from "node:path";
|
|
22
15
|
import { resolveCatalogProject, synchronizeCatalogs } from "../i18n/catalogs.js";
|
|
23
16
|
import { extractSourceCatalog } from "../i18n/source-messages.js";
|
|
24
|
-
import { emitI18nTypes } from "../i18n/types.js";
|
|
17
|
+
import { clearI18nTypes, emitI18nTypes } from "../i18n/types.js";
|
|
25
18
|
import { upsertAgentRules } from "../internal/agent-rules.js";
|
|
26
|
-
import { resolveDataDir } from "../internal/data-dir.js";
|
|
27
19
|
import { discoverSourceFiles } from "../internal/source-imports.js";
|
|
28
20
|
import { emitSchemaEnv } from "../settings/schema.js";
|
|
21
|
+
import { resolveConfigDependencies } from "./config-dependencies.js";
|
|
29
22
|
import { type CodegenInputs, isCodegenStale, resolveCodegenInputs } from "./freshness.js";
|
|
30
23
|
import { type ReferenceResult, writeReference } from "./reference.js";
|
|
31
24
|
import { type CodegenContext, type CodegenStore, resolveCodegenContext } from "./store-resolver.js";
|
|
@@ -33,6 +26,7 @@ import { type CodegenContext, type CodegenStore, resolveCodegenContext } from ".
|
|
|
33
26
|
type RunCodegenOptions = {
|
|
34
27
|
cwd?: string;
|
|
35
28
|
mode?: string | undefined;
|
|
29
|
+
configFile?: string | undefined;
|
|
36
30
|
isForced?: boolean;
|
|
37
31
|
inputs?: CodegenInputs;
|
|
38
32
|
resolved?: LoadedConfig;
|
|
@@ -48,12 +42,10 @@ type RunCodegenResult = {
|
|
|
48
42
|
isRegenerated: boolean;
|
|
49
43
|
namespaces: number;
|
|
50
44
|
intrinsicElements: number;
|
|
51
|
-
notices: string[];
|
|
52
45
|
duration: number;
|
|
53
|
-
girPath
|
|
54
|
-
configFile
|
|
55
|
-
libraries
|
|
56
|
-
future?: string[] | undefined;
|
|
46
|
+
girPath: string[];
|
|
47
|
+
configFile: string;
|
|
48
|
+
libraries: string[];
|
|
57
49
|
reference?: ReferenceResult | undefined;
|
|
58
50
|
};
|
|
59
51
|
|
|
@@ -62,7 +54,6 @@ type CodegenOptionsInput = {
|
|
|
62
54
|
libraries: string[];
|
|
63
55
|
girPath: string[];
|
|
64
56
|
elements: Config["elements"];
|
|
65
|
-
future: ResolvedFuture;
|
|
66
57
|
};
|
|
67
58
|
|
|
68
59
|
type PreparedCodegen = CodegenInputs & { isForced: boolean };
|
|
@@ -70,17 +61,10 @@ type PreparedCodegen = CodegenInputs & { isForced: boolean };
|
|
|
70
61
|
type EnsureGeneratedOptions = {
|
|
71
62
|
shouldAnnounce?: boolean;
|
|
72
63
|
mode?: string;
|
|
64
|
+
configFile?: string | undefined;
|
|
73
65
|
shouldPreserveI18nMetadata?: boolean | undefined;
|
|
74
66
|
};
|
|
75
67
|
|
|
76
|
-
type RunOptionsInput = {
|
|
77
|
-
root: string;
|
|
78
|
-
mode: string | undefined;
|
|
79
|
-
inputs: CodegenInputs | null;
|
|
80
|
-
resolved: LoadedConfig;
|
|
81
|
-
shouldPreserveI18nMetadata: boolean | undefined;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
68
|
const GIR_PATH_MISSING_MESSAGE =
|
|
85
69
|
"No GIR search paths available. Install gobject-introspection " +
|
|
86
70
|
"(Linux: `sudo dnf install gobject-introspection-devel` or `sudo apt install libgirepository1.0-dev`), " +
|
|
@@ -97,18 +81,14 @@ const removeShadowingStores = (cwd: string): void => {
|
|
|
97
81
|
removeStores(getShadowingStorePaths(cwd));
|
|
98
82
|
};
|
|
99
83
|
|
|
100
|
-
const codegenOptions = ({ store, libraries, girPath, elements
|
|
84
|
+
const codegenOptions = ({ store, libraries, girPath, elements }: CodegenOptionsInput) => ({
|
|
101
85
|
libraries,
|
|
102
86
|
girPath,
|
|
103
|
-
isByteArrayTyped: future.isByteArrayTyped,
|
|
104
|
-
isValueUnwrapped: future.isValueUnwrapped,
|
|
105
|
-
isFinishTrimmed: future.isFinishTrimmed,
|
|
106
|
-
isInoutInPlace: future.isInoutInPlace,
|
|
107
|
-
isTreeShaken: future.isTreeShaken,
|
|
108
87
|
gi: {
|
|
109
88
|
storeDir: store.giStoreDir,
|
|
110
89
|
linkDir: store.giLinkDir,
|
|
111
90
|
version: store.runtimeVersion,
|
|
91
|
+
owner: store.owner,
|
|
112
92
|
},
|
|
113
93
|
jsx:
|
|
114
94
|
store.react === null
|
|
@@ -117,94 +97,24 @@ const codegenOptions = ({ store, libraries, girPath, elements, future }: Codegen
|
|
|
117
97
|
storeDir: store.jsxStoreDir,
|
|
118
98
|
linkDir: store.jsxLinkDir,
|
|
119
99
|
version: store.react.version,
|
|
100
|
+
owner: store.owner,
|
|
120
101
|
},
|
|
121
|
-
reactSubexports: store.react?.subexports ?? [],
|
|
122
102
|
userComponents: resolveElementComponents(elements),
|
|
123
103
|
userProps: resolveElementProps(elements),
|
|
124
104
|
userLazyElements: resolveLazyElements(elements),
|
|
125
105
|
userOmittedProps: resolveOmittedProps(elements),
|
|
126
106
|
});
|
|
127
107
|
|
|
128
|
-
const
|
|
129
|
-
const unknown: Set<string> = new Set(unknownFutureKeys(config.future));
|
|
130
|
-
|
|
131
|
-
return Object.entries(config.future ?? {})
|
|
132
|
-
.filter(([name, value]) => value === true && !unknown.has(name))
|
|
133
|
-
.map(([name]) => name);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const disabledCodegenResult = (configFile: string, notices: string[]): RunCodegenResult => ({
|
|
108
|
+
const disabledCodegenResult = (configFile: string): RunCodegenResult => ({
|
|
137
109
|
isRegenerated: false,
|
|
138
110
|
namespaces: 0,
|
|
139
111
|
intrinsicElements: 0,
|
|
140
|
-
notices,
|
|
141
112
|
duration: 0,
|
|
142
113
|
girPath: [],
|
|
143
114
|
configFile,
|
|
144
115
|
libraries: [],
|
|
145
116
|
});
|
|
146
117
|
|
|
147
|
-
const warnNotices = (notices: string[]): void => {
|
|
148
|
-
for (const notice of notices) {
|
|
149
|
-
warn(notice);
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const unknownFutureNotice = (keys: string[]): string[] => {
|
|
154
|
-
if (keys.length === 0) {
|
|
155
|
-
return [];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
return [
|
|
159
|
-
`gtkx.config.ts: \`future\` has no ${keys.join(", ")} flag, so the key is ignored. Check it against ` +
|
|
160
|
-
"the flags the configuration guide lists.",
|
|
161
|
-
];
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const redundantLibraryNotice = (entries: string[]): string[] => {
|
|
165
|
-
if (entries.length === 0) {
|
|
166
|
-
return [];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return [
|
|
170
|
-
`gtkx.config.ts: \`future.v2DefaultLibraries\` binds ${entries.join(", ")} on its own, so naming them ` +
|
|
171
|
-
"in `libraries` changes nothing. Drop them; naming them becomes a configuration error in GTKX 2.0.",
|
|
172
|
-
];
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
const wildcardLibrariesNotice = (libraries: Config["libraries"]): string[] => {
|
|
176
|
-
if (libraries !== LIBRARIES_WILDCARD) {
|
|
177
|
-
return [];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return [
|
|
181
|
-
'gtkx.config.ts: `libraries: "*"` binds whatever the build host happens to have installed, so the ' +
|
|
182
|
-
"store changes with the machine. Instead, list the libraries the project needs; the wildcard is " +
|
|
183
|
-
"removed in GTKX 2.0.",
|
|
184
|
-
];
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const configNotices = (config: Config, future: ResolvedFuture): string[] => [
|
|
188
|
-
...unknownFutureNotice(unknownFutureKeys(config.future)),
|
|
189
|
-
...wildcardLibrariesNotice(config.libraries),
|
|
190
|
-
...redundantLibraryNotice(redundantLibraries(config.libraries, future.isAdwaitaDefault)),
|
|
191
|
-
];
|
|
192
|
-
|
|
193
|
-
const regeneratedStorePaths = (store: CodegenStore): string[] => {
|
|
194
|
-
if (store.react === null) {
|
|
195
|
-
return [store.giStoreDir, store.giLinkDir];
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return [store.giStoreDir, store.giLinkDir, store.jsxStoreDir, store.jsxLinkDir];
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
const clearGeneratedStores = (store: CodegenStore): void => {
|
|
202
|
-
removeStores(regeneratedStorePaths(store));
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
const resolveLoadedConfig = async (options: RunCodegenOptions, cwd: string): Promise<LoadedConfig> =>
|
|
206
|
-
options.resolved ?? (await loadConfig(cwd, { mode: options.mode }));
|
|
207
|
-
|
|
208
118
|
const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config): PreparedCodegen => {
|
|
209
119
|
const { girPath, libraries, store } = options.inputs ?? resolveCodegenInputs(cwd, config);
|
|
210
120
|
|
|
@@ -219,55 +129,44 @@ const prepareCodegen = (options: RunCodegenOptions, cwd: string, config: Config)
|
|
|
219
129
|
|
|
220
130
|
const runCodegen = async (options: RunCodegenOptions = {}): Promise<RunCodegenResult> => {
|
|
221
131
|
const cwd = options.cwd ?? process.cwd();
|
|
222
|
-
const { config, configFile } = await
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
132
|
+
const { config, configFile } = options.resolved ?? (await loadConfig(cwd, {
|
|
133
|
+
mode: options.mode,
|
|
134
|
+
configFile: options.configFile,
|
|
135
|
+
}));
|
|
226
136
|
await syncI18n(cwd, config.applicationId, options.shouldPreserveI18nMetadata);
|
|
227
|
-
|
|
137
|
+
emitSchemaEnv(cwd);
|
|
228
138
|
|
|
229
139
|
if (config.codegen === false) {
|
|
230
140
|
removeShadowingStores(cwd);
|
|
231
141
|
|
|
232
|
-
return disabledCodegenResult(configFile
|
|
142
|
+
return disabledCodegenResult(configFile);
|
|
233
143
|
}
|
|
234
144
|
|
|
235
145
|
const { girPath, libraries, store, isForced } = prepareCodegen(options, cwd, config);
|
|
236
146
|
|
|
237
|
-
if (options.isForced) {
|
|
238
|
-
clearGeneratedStores(store);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
147
|
const result = await runCodegenCore({
|
|
242
|
-
...codegenOptions({ store, libraries, girPath, elements: config.elements
|
|
148
|
+
...codegenOptions({ store, libraries, girPath, elements: config.elements }),
|
|
243
149
|
isForced,
|
|
244
150
|
});
|
|
245
151
|
|
|
246
|
-
warnNotices(result.notices);
|
|
247
|
-
const notices = [...configured, ...result.notices];
|
|
248
152
|
const reference = await writeReference({ root: cwd, config, girPath, libraries, isForced });
|
|
249
|
-
|
|
153
|
+
|
|
154
|
+
if (isAgentRulesEnabled(config)) {
|
|
155
|
+
upsertAgentRules(cwd);
|
|
156
|
+
}
|
|
250
157
|
|
|
251
158
|
return {
|
|
252
159
|
isRegenerated: result.isRegenerated,
|
|
253
160
|
namespaces: result.namespaces,
|
|
254
161
|
intrinsicElements: result.intrinsicElements,
|
|
255
|
-
notices,
|
|
256
162
|
duration: result.duration,
|
|
257
163
|
girPath,
|
|
258
164
|
configFile,
|
|
259
165
|
libraries,
|
|
260
|
-
future: enabledFutureFlags(config),
|
|
261
166
|
reference,
|
|
262
167
|
};
|
|
263
168
|
};
|
|
264
169
|
|
|
265
|
-
const syncAgentRules = (root: string, config: Config): void => {
|
|
266
|
-
if (isAgentRulesEnabled(config)) {
|
|
267
|
-
upsertAgentRules(root);
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
|
|
271
170
|
const syncI18n = async (
|
|
272
171
|
root: string,
|
|
273
172
|
applicationId: string,
|
|
@@ -276,21 +175,21 @@ const syncI18n = async (
|
|
|
276
175
|
const project = resolveCatalogProject(root, applicationId);
|
|
277
176
|
|
|
278
177
|
if (project === null) {
|
|
279
|
-
|
|
178
|
+
clearI18nTypes(root);
|
|
280
179
|
|
|
281
180
|
return;
|
|
282
181
|
}
|
|
283
182
|
|
|
284
183
|
const srcDir = join(root, "src");
|
|
285
184
|
const sourceFiles = discoverSourceFiles(existsSync(srcDir) ? srcDir : root);
|
|
286
|
-
|
|
185
|
+
await extractSourceCatalog(project, sourceFiles, shouldPreserveMetadataMessages);
|
|
287
186
|
synchronizeCatalogs(project);
|
|
288
|
-
emitI18nTypes(root
|
|
187
|
+
await emitI18nTypes(root);
|
|
289
188
|
};
|
|
290
189
|
|
|
291
|
-
const isCodegenDisabled = async (cwd: string, mode?: string): Promise<boolean> => {
|
|
190
|
+
const isCodegenDisabled = async (cwd: string, mode?: string, configFile?: string): Promise<boolean> => {
|
|
292
191
|
try {
|
|
293
|
-
const { config } = await loadConfig(cwd, { mode });
|
|
192
|
+
const { config } = await loadConfig(cwd, { mode, configFile });
|
|
294
193
|
|
|
295
194
|
return config.codegen === false;
|
|
296
195
|
} catch {
|
|
@@ -298,11 +197,6 @@ const isCodegenDisabled = async (cwd: string, mode?: string): Promise<boolean> =
|
|
|
298
197
|
}
|
|
299
198
|
};
|
|
300
199
|
|
|
301
|
-
const syncSchemaEnv = (cwd: string, isV2ResourceImports = false): void => {
|
|
302
|
-
const dataDir = isV2ResourceImports ? null : resolveDataDir(cwd);
|
|
303
|
-
emitSchemaEnv(cwd, dataDir, isV2ResourceImports);
|
|
304
|
-
};
|
|
305
|
-
|
|
306
200
|
const resolveInputsOrNull = (cwd: string, config: Config): CodegenInputs | null => {
|
|
307
201
|
try {
|
|
308
202
|
return resolveCodegenInputs(cwd, config);
|
|
@@ -321,20 +215,6 @@ const maybeAnnounceStale = (shouldAnnounce: boolean | undefined, inputs: Codegen
|
|
|
321
215
|
}
|
|
322
216
|
};
|
|
323
217
|
|
|
324
|
-
const getRunOptions = ({
|
|
325
|
-
root,
|
|
326
|
-
mode,
|
|
327
|
-
inputs,
|
|
328
|
-
resolved,
|
|
329
|
-
shouldPreserveI18nMetadata,
|
|
330
|
-
}: RunOptionsInput): RunCodegenOptions => {
|
|
331
|
-
if (inputs === null) {
|
|
332
|
-
return { cwd: root, mode, resolved, shouldPreserveI18nMetadata };
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return { cwd: root, mode, inputs, resolved, shouldPreserveI18nMetadata };
|
|
336
|
-
};
|
|
337
|
-
|
|
338
218
|
const isPreflightSkipped = (options: EnsureGeneratedOptions): boolean =>
|
|
339
219
|
options.shouldAnnounce === true && process.env.GTKX_DISABLE_PREFLIGHT === "1";
|
|
340
220
|
|
|
@@ -355,13 +235,13 @@ const generate = async (context: CodegenContext, options: EnsureGeneratedOptions
|
|
|
355
235
|
maybeAnnounceStale(options.shouldAnnounce, inputs);
|
|
356
236
|
const resolved = { config: context.config, configFile: context.configFile };
|
|
357
237
|
|
|
358
|
-
const result = await runCodegen(
|
|
359
|
-
|
|
238
|
+
const result = await runCodegen({
|
|
239
|
+
cwd: context.root,
|
|
360
240
|
mode: options.mode,
|
|
361
|
-
inputs,
|
|
362
241
|
resolved,
|
|
363
242
|
shouldPreserveI18nMetadata: options.shouldPreserveI18nMetadata,
|
|
364
|
-
|
|
243
|
+
...(inputs !== null && { inputs }),
|
|
244
|
+
});
|
|
365
245
|
|
|
366
246
|
return result.isRegenerated;
|
|
367
247
|
};
|
|
@@ -374,18 +254,51 @@ const ensureGeneratedIn = async (
|
|
|
374
254
|
|
|
375
255
|
/* eslint-disable-next-line unicorn/consistent-boolean-name -- the boolean reports whether codegen ran */
|
|
376
256
|
const ensureGenerated = async (cwd: string, options: EnsureGeneratedOptions = {}): Promise<boolean> =>
|
|
377
|
-
isPreflightSkipped(options)
|
|
257
|
+
isPreflightSkipped(options)
|
|
258
|
+
? false
|
|
259
|
+
: generate(await resolveCodegenContext(cwd, options.mode, options.configFile), options);
|
|
378
260
|
|
|
379
261
|
const resolveConfigWatch = async (
|
|
380
262
|
cwd: string,
|
|
381
263
|
mode?: string,
|
|
382
|
-
|
|
383
|
-
|
|
264
|
+
configFile?: string,
|
|
265
|
+
initialDependencies: string[] = [],
|
|
266
|
+
): Promise<{ paths: string[]; resolvePaths: () => string[]; regenerate: () => Promise<string[]> }> => {
|
|
267
|
+
let selectedConfigFile: string;
|
|
268
|
+
|
|
269
|
+
if (configFile === undefined) {
|
|
270
|
+
const loaded = await loadConfig(cwd, { mode });
|
|
271
|
+
selectedConfigFile = loaded.configFile;
|
|
272
|
+
} else {
|
|
273
|
+
selectedConfigFile = resolve(cwd, configFile);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
let knownDependencies = initialDependencies;
|
|
277
|
+
const selectedConfigName = relative(cwd, selectedConfigFile);
|
|
278
|
+
const resolvePaths = (): string[] => [
|
|
279
|
+
...new Set(
|
|
280
|
+
[selectedConfigFile, ...knownDependencies]
|
|
281
|
+
.flatMap((path) => resolveConfigDependencies(path, selectedConfigName, cwd)),
|
|
282
|
+
),
|
|
283
|
+
];
|
|
384
284
|
|
|
385
285
|
return {
|
|
386
|
-
paths:
|
|
286
|
+
paths: resolvePaths(),
|
|
287
|
+
resolvePaths,
|
|
387
288
|
regenerate: async () => {
|
|
388
|
-
|
|
289
|
+
let loaded: Awaited<ReturnType<typeof loadConfig>>;
|
|
290
|
+
|
|
291
|
+
try {
|
|
292
|
+
loaded = await loadConfig(cwd, { mode, configFile: selectedConfigFile });
|
|
293
|
+
} catch (error) {
|
|
294
|
+
knownDependencies = [...new Set([...knownDependencies, ...configDependenciesFor(error)])];
|
|
295
|
+
throw error;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
knownDependencies = configDependenciesFor(loaded);
|
|
299
|
+
await runCodegen({ cwd, mode, resolved: loaded });
|
|
300
|
+
|
|
301
|
+
return resolvePaths();
|
|
389
302
|
},
|
|
390
303
|
};
|
|
391
304
|
};
|