@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/settings/render.ts
CHANGED
|
@@ -9,7 +9,6 @@ type NamedSchema = {
|
|
|
9
9
|
type EnvAssetDeclarations = {
|
|
10
10
|
blocked: string[];
|
|
11
11
|
icons: string[];
|
|
12
|
-
legacy: string[];
|
|
13
12
|
resources: string[];
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -209,15 +208,6 @@ const renderIconModule = (specifier: string): string => [
|
|
|
209
208
|
"}",
|
|
210
209
|
].join("\n");
|
|
211
210
|
|
|
212
|
-
const renderLegacyAssetModule = (specifier: string): string => [
|
|
213
|
-
`declare module ${toJsStringLiteral(specifier)} {`,
|
|
214
|
-
" const resourceUri: string;",
|
|
215
|
-
" const path: string;",
|
|
216
|
-
" export { path };",
|
|
217
|
-
" export default resourceUri;",
|
|
218
|
-
"}",
|
|
219
|
-
].join("\n");
|
|
220
|
-
|
|
221
211
|
const renderBlockedAssetModule = (specifier: string): string => [
|
|
222
212
|
`declare module ${toJsStringLiteral(specifier)} {`,
|
|
223
213
|
" const assetImportRequiresResourceOrUrlQuery: {",
|
|
@@ -232,7 +222,7 @@ const renderEnvModule = (
|
|
|
232
222
|
assetDeclarations?: EnvAssetDeclarations,
|
|
233
223
|
options: EnvModuleOptions = {},
|
|
234
224
|
): string => {
|
|
235
|
-
const assets = assetDeclarations ?? { blocked: [], icons: [],
|
|
225
|
+
const assets = assetDeclarations ?? { blocked: [], icons: [], resources: [] };
|
|
236
226
|
const usedNames: Set<string> = new Set();
|
|
237
227
|
|
|
238
228
|
const schemas = files
|
|
@@ -241,7 +231,6 @@ const renderEnvModule = (
|
|
|
241
231
|
|
|
242
232
|
const blocked = assets.blocked.map((specifier) => renderBlockedAssetModule(specifier));
|
|
243
233
|
const icons = assets.icons.map((specifier) => renderIconModule(specifier));
|
|
244
|
-
const legacy = assets.legacy.map((specifier) => renderLegacyAssetModule(specifier));
|
|
245
234
|
const resources = assets.resources.map((specifier) => renderResourceModule(specifier));
|
|
246
235
|
const references = (options.references ?? []).map((path) => `/// <reference path=${JSON.stringify(path)} />`);
|
|
247
236
|
|
|
@@ -250,7 +239,6 @@ const renderEnvModule = (
|
|
|
250
239
|
...references,
|
|
251
240
|
...blocked,
|
|
252
241
|
...icons,
|
|
253
|
-
...legacy,
|
|
254
242
|
...resources,
|
|
255
243
|
...schemas,
|
|
256
244
|
].join("\n\n")}\n`;
|
package/src/settings/schema.ts
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import { sortStrings, warn } from "@gtkx/utils";
|
|
1
|
+
import { isPathInside, sortStrings, toPosixPath, warn } from "@gtkx/utils";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
import {
|
|
4
4
|
copyFileSync,
|
|
5
|
-
type Dirent,
|
|
6
5
|
existsSync,
|
|
7
6
|
mkdirSync,
|
|
8
7
|
mkdtempSync,
|
|
9
|
-
readdirSync,
|
|
10
8
|
readFileSync,
|
|
11
9
|
realpathSync,
|
|
12
10
|
writeFileSync,
|
|
13
11
|
} from "node:fs";
|
|
14
12
|
import { tmpdir } from "node:os";
|
|
15
|
-
import { basename, dirname,
|
|
13
|
+
import { basename, dirname, join, relative, resolve } from "node:path";
|
|
14
|
+
import type { SourceImport } from "../internal/source-imports.js";
|
|
16
15
|
import { I18N_TYPES_FILENAME, i18nTypesPath } from "../i18n/types.js";
|
|
17
|
-
import {
|
|
18
|
-
import { discoverSourceImports, type SourceImport } from "../internal/source-imports.js";
|
|
16
|
+
import { discoverProjectImports } from "../internal/import-scan.js";
|
|
19
17
|
import { removeTempDir } from "../internal/staging-dir.js";
|
|
20
18
|
import {
|
|
21
19
|
isBareRelativeAsset,
|
|
22
|
-
isDataAsset,
|
|
23
20
|
parseIconSpecifier,
|
|
24
21
|
parseResourceSpecifier,
|
|
25
22
|
} from "../vite-plugins/asset-specifier.js";
|
|
@@ -34,7 +31,6 @@ type SchemaEnvResult = {
|
|
|
34
31
|
|
|
35
32
|
const SCHEMA_SUFFIX = ".gschema.xml";
|
|
36
33
|
const STAGED_NAME_LENGTH = 16;
|
|
37
|
-
const SOURCE_DIR = "src";
|
|
38
34
|
const RESOURCE_QUERY = "?resource=";
|
|
39
35
|
const ICON_QUERY = "?icon=";
|
|
40
36
|
|
|
@@ -57,35 +53,22 @@ const stageSchema = (dir: string, filePath: string): void => {
|
|
|
57
53
|
copyFileSync(filePath, join(dir, stagedSchemaName(filePath)));
|
|
58
54
|
};
|
|
59
55
|
|
|
60
|
-
const toForwardSlashes = (value: string): string => value.replaceAll(/[/\\]/g, "/");
|
|
61
|
-
|
|
62
56
|
const projectRelativeSchemaPath = (root: string, filePath: string): string | null => {
|
|
63
|
-
let
|
|
57
|
+
let projectRoot: string;
|
|
58
|
+
let path: string;
|
|
64
59
|
|
|
65
60
|
try {
|
|
66
|
-
|
|
61
|
+
projectRoot = realpathSync(root);
|
|
62
|
+
path = realpathSync(filePath);
|
|
67
63
|
} catch {
|
|
68
64
|
return null;
|
|
69
65
|
}
|
|
70
66
|
|
|
71
|
-
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return toForwardSlashes(rel);
|
|
67
|
+
return isPathInside(projectRoot, path) ? toPosixPath(relative(projectRoot, path)) : null;
|
|
76
68
|
};
|
|
77
69
|
|
|
78
|
-
const getModuleSpecifier = (dataDirAbs: string, filePath: string): string =>
|
|
79
|
-
`${DATA_IMPORT_PREFIX}/${toForwardSlashes(relative(dataDirAbs, filePath))}`;
|
|
80
|
-
|
|
81
70
|
const getRelativeModuleSpecifier = (filePath: string): string => `*/${basename(filePath)}`;
|
|
82
71
|
|
|
83
|
-
const sourceDirFor = (root: string): string => {
|
|
84
|
-
const sourceDir = join(root, SOURCE_DIR);
|
|
85
|
-
|
|
86
|
-
return existsSync(sourceDir) ? sourceDir : root;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
72
|
const isRelativeImport = (source: string): boolean => source.startsWith("./") || source.startsWith("../");
|
|
90
73
|
|
|
91
74
|
const schemaFileFor = ({ importer, source }: SourceImport): string | null =>
|
|
@@ -99,9 +82,6 @@ const findImportedSchemaFiles = (imports: SourceImport[]): string[] => {
|
|
|
99
82
|
return sortStrings(new Set(files));
|
|
100
83
|
};
|
|
101
84
|
|
|
102
|
-
const legacyAssetSpecifier = (source: string): string | null =>
|
|
103
|
-
isDataAsset(source) ? source : null;
|
|
104
|
-
|
|
105
85
|
const blockedAssetSpecifier = (source: string): string | null => {
|
|
106
86
|
if (!isBareRelativeAsset(source)) {
|
|
107
87
|
return null;
|
|
@@ -159,21 +139,15 @@ const iconModuleSpecifier = (source: string): string | null => {
|
|
|
159
139
|
|
|
160
140
|
const findAssetModuleSpecifiers = (
|
|
161
141
|
imports: SourceImport[],
|
|
162
|
-
|
|
163
|
-
): { blocked: string[]; icons: string[]; legacy: string[]; resources: string[] } => {
|
|
142
|
+
): { blocked: string[]; icons: string[]; resources: string[] } => {
|
|
164
143
|
const collect = (getSpecifier: (source: string) => string | null): string[] =>
|
|
165
144
|
sortStrings(new Set(imports.map((entry) => getSpecifier(entry.source)).filter((value) => value !== null)));
|
|
166
145
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
resources: collect(resourceModuleSpecifier),
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return { blocked: [], icons: [], legacy: collect(legacyAssetSpecifier), resources: [] };
|
|
146
|
+
return {
|
|
147
|
+
blocked: collect(blockedAssetSpecifier),
|
|
148
|
+
icons: collect(iconModuleSpecifier),
|
|
149
|
+
resources: collect(resourceModuleSpecifier),
|
|
150
|
+
};
|
|
177
151
|
};
|
|
178
152
|
|
|
179
153
|
const canonicalPath = (path: string): string => {
|
|
@@ -203,41 +177,10 @@ const assertUniqueSchemaBasenames = (schemaFiles: string[]): void => {
|
|
|
203
177
|
}
|
|
204
178
|
};
|
|
205
179
|
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
return [];
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
const isSchemaFile = (entry: Dirent): boolean => entry.isFile() && entry.name.endsWith(SCHEMA_SUFFIX);
|
|
215
|
-
|
|
216
|
-
const collectSchemaFiles = (dir: string, found: string[]): void => {
|
|
217
|
-
for (const entry of readVisibleEntries(dir)) {
|
|
218
|
-
const full = join(dir, entry.name);
|
|
219
|
-
|
|
220
|
-
if (entry.isDirectory()) {
|
|
221
|
-
collectSchemaFiles(full, found);
|
|
222
|
-
} else if (isSchemaFile(entry)) {
|
|
223
|
-
found.push(full);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
const findSchemaFiles = (dataDir: string): string[] => {
|
|
229
|
-
const found: string[] = [];
|
|
230
|
-
collectSchemaFiles(dataDir, found);
|
|
231
|
-
|
|
232
|
-
return sortStrings(found);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
const stageAndCompileProjectSchemas = (root: string, dataDir: string | null): string | null => {
|
|
236
|
-
const imports = discoverSourceImports(sourceDirFor(root));
|
|
237
|
-
const imported = findImportedSchemaFiles(imports);
|
|
238
|
-
assertUniqueSchemaBasenames(imported);
|
|
239
|
-
const legacy = dataDir === null ? [] : findSchemaFiles(join(root, dataDir));
|
|
240
|
-
const schemaFiles = sortStrings(new Set([...legacy, ...imported]));
|
|
180
|
+
const stageAndCompileProjectSchemas = (root: string): string | null => {
|
|
181
|
+
const imports = discoverProjectImports(root);
|
|
182
|
+
const schemaFiles = findImportedSchemaFiles(imports);
|
|
183
|
+
assertUniqueSchemaBasenames(schemaFiles);
|
|
241
184
|
|
|
242
185
|
if (schemaFiles.length === 0) {
|
|
243
186
|
return null;
|
|
@@ -307,25 +250,14 @@ const didWriteChanges = (path: string, content: string): boolean => {
|
|
|
307
250
|
return true;
|
|
308
251
|
};
|
|
309
252
|
|
|
310
|
-
const emitSchemaEnv = (
|
|
311
|
-
rootDir
|
|
312
|
-
dataDir: string | null,
|
|
313
|
-
isV2ResourceImports = false,
|
|
314
|
-
): SchemaEnvResult => {
|
|
315
|
-
const dataDirAbs = dataDir === null ? null : join(rootDir, dataDir);
|
|
316
|
-
const legacyFiles = dataDirAbs === null ? [] : findSchemaFiles(dataDirAbs);
|
|
317
|
-
const imports = discoverSourceImports(sourceDirFor(rootDir));
|
|
318
|
-
|
|
319
|
-
const legacy = dataDirAbs === null
|
|
320
|
-
? []
|
|
321
|
-
: parseProjectSchemas(legacyFiles, (filePath) => getModuleSpecifier(dataDirAbs, filePath));
|
|
322
|
-
|
|
253
|
+
const emitSchemaEnv = (rootDir: string): SchemaEnvResult => {
|
|
254
|
+
const imports = discoverProjectImports(rootDir);
|
|
323
255
|
const importedFiles = findImportedSchemaFiles(imports);
|
|
324
256
|
assertUniqueSchemaBasenames(importedFiles);
|
|
325
257
|
const imported = parseProjectSchemas(importedFiles, getRelativeModuleSpecifier);
|
|
326
|
-
const assets = findAssetModuleSpecifiers(imports
|
|
258
|
+
const assets = findAssetModuleSpecifiers(imports);
|
|
327
259
|
const references = existsSync(i18nTypesPath(rootDir)) ? [`./${I18N_TYPES_FILENAME}`] : [];
|
|
328
|
-
const content = renderEnvModule(
|
|
260
|
+
const content = renderEnvModule(imported, assets, { references });
|
|
329
261
|
const path = schemaEnvPath(rootDir);
|
|
330
262
|
const isWritten = didWriteChanges(path, content);
|
|
331
263
|
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ParseResult, Plugin, UserConfig } from "vite";
|
|
3
|
-
import { createConfigLoader, resolveFuture } from "@gtkx/config/internal";
|
|
1
|
+
import type { ParseResult, Plugin } from "vite";
|
|
4
2
|
import { parseSync } from "vite";
|
|
5
|
-
import { sourceLanguage } from "../internal/source-imports.js";
|
|
3
|
+
import { SOURCE_ID_RE, sourceLanguage } from "../internal/source-imports.js";
|
|
6
4
|
import { ASSET_MENTION_RE } from "./asset-extensions.js";
|
|
7
5
|
import {
|
|
8
|
-
DATA_PREFIX,
|
|
9
6
|
isAssetSpecifier,
|
|
10
|
-
isDataAsset,
|
|
11
7
|
isUrlSpecifier,
|
|
8
|
+
parseFontSpecifier,
|
|
12
9
|
parseIconSpecifier,
|
|
13
10
|
parseResourceSpecifier,
|
|
14
11
|
} from "./asset-specifier.js";
|
|
@@ -21,18 +18,14 @@ type ExportStatement = ParsedModule["staticExports"][number];
|
|
|
21
18
|
type ExportEntry = ExportStatement["entries"][number];
|
|
22
19
|
type BindingEntry = { importName: { name: string | null }; isType: boolean };
|
|
23
20
|
type NamedBinding = { name: string; source: string };
|
|
24
|
-
type PluginState = { isV2: boolean };
|
|
25
21
|
|
|
26
22
|
const NODE_MODULES = /(?:^|\/)node_modules\//;
|
|
23
|
+
const NODE_MODULES_ID_RE = /^[^?]*(?:^|\/)node_modules\//;
|
|
27
24
|
const VIRTUAL_PREFIX = "\0";
|
|
25
|
+
const VIRTUAL_ID_RE = /^\0/;
|
|
26
|
+
const URL_QUERY = "?url";
|
|
28
27
|
const DEFAULT_BINDING = "default";
|
|
29
28
|
const RESOURCE_BINDING = JSON.stringify(RESOURCE_PATH_EXPORT);
|
|
30
|
-
const DATA_IMPORT_EXAMPLE = `"${DATA_PREFIX}<path>"`;
|
|
31
|
-
const URL_FALLBACK = ", or import the default for the asset URL.";
|
|
32
|
-
|
|
33
|
-
const BUNDLE_ADVICE =
|
|
34
|
-
`An asset staged into the GResource bundle exports ${RESOURCE_BINDING} and a "resource://" default, and ` +
|
|
35
|
-
"nothing else.";
|
|
36
29
|
|
|
37
30
|
const QUERY_ADVICE =
|
|
38
31
|
`A URL asset exports only its default filesystem path; import the default instead of ${RESOURCE_BINDING}.`;
|
|
@@ -42,10 +35,11 @@ const RESOURCE_ADVICE =
|
|
|
42
35
|
|
|
43
36
|
const ICON_ADVICE = "An icon asset exports only its default icon-theme name, and nothing else.";
|
|
44
37
|
|
|
38
|
+
const FONT_ADVICE = "A font asset exports only its default font family name, and nothing else.";
|
|
39
|
+
|
|
45
40
|
const RELATIVE_ADVICE =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`${DATA_IMPORT_EXAMPLE}${URL_FALLBACK}`;
|
|
41
|
+
"Add ?resource for a GResource, ?icon for a themed icon, ?font for a bundled font, or ?url for an " +
|
|
42
|
+
"emitted file.";
|
|
49
43
|
|
|
50
44
|
const boundName = (entry: BindingEntry): string | null => {
|
|
51
45
|
const { name } = entry.importName;
|
|
@@ -78,50 +72,50 @@ const bindings = (parsed: ParsedModule): NamedBinding[] => [
|
|
|
78
72
|
...parsed.staticExports.flatMap((statement) => exportBindings(statement)),
|
|
79
73
|
];
|
|
80
74
|
|
|
81
|
-
const isBacked = ({ name, source }: NamedBinding
|
|
75
|
+
const isBacked = ({ name, source }: NamedBinding): boolean => {
|
|
82
76
|
if (name !== RESOURCE_PATH_EXPORT) {
|
|
83
77
|
return false;
|
|
84
78
|
}
|
|
85
79
|
|
|
86
|
-
return
|
|
80
|
+
return parseResourceSpecifier(source) !== null;
|
|
87
81
|
};
|
|
88
82
|
|
|
89
83
|
const isCheckedSpecifier = (source: string): boolean => isAssetSpecifier(source) || isUrlSpecifier(source);
|
|
90
84
|
|
|
91
|
-
const unbackedBinding = (parsed: ParsedModule
|
|
92
|
-
bindings(parsed).find((binding) => isCheckedSpecifier(binding.source) && !isBacked(binding
|
|
85
|
+
const unbackedBinding = (parsed: ParsedModule): NamedBinding | undefined =>
|
|
86
|
+
bindings(parsed).find((binding) => isCheckedSpecifier(binding.source) && !isBacked(binding));
|
|
93
87
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
const adviceFor = (source: string): string => {
|
|
89
|
+
if (parseResourceSpecifier(source) !== null) {
|
|
90
|
+
return RESOURCE_ADVICE;
|
|
91
|
+
}
|
|
98
92
|
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
if (parseIconSpecifier(source) !== null) {
|
|
94
|
+
return ICON_ADVICE;
|
|
95
|
+
}
|
|
101
96
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return isV2 ? v2BundleAdvice(source) : BUNDLE_ADVICE;
|
|
97
|
+
if (parseFontSpecifier(source) !== null) {
|
|
98
|
+
return FONT_ADVICE;
|
|
105
99
|
}
|
|
106
100
|
|
|
107
101
|
if (isUrlSpecifier(source)) {
|
|
108
102
|
return QUERY_ADVICE;
|
|
109
103
|
}
|
|
110
104
|
|
|
111
|
-
return
|
|
105
|
+
return RELATIVE_ADVICE;
|
|
112
106
|
};
|
|
113
107
|
|
|
114
|
-
const unbackedBindingError = (path: string, binding: NamedBinding
|
|
108
|
+
const unbackedBindingError = (path: string, binding: NamedBinding): Error =>
|
|
115
109
|
new Error(
|
|
116
110
|
`${path}: ${JSON.stringify(binding.source)} does not export ${JSON.stringify(binding.name)}, which ` +
|
|
117
111
|
"gtkx build rejects and gtkx dev would bind as undefined. " +
|
|
118
|
-
|
|
112
|
+
adviceFor(binding.source),
|
|
119
113
|
);
|
|
120
114
|
|
|
121
115
|
const isCheckedSource = (path: string): boolean => !path.startsWith(VIRTUAL_PREFIX) && !NODE_MODULES.test(path);
|
|
122
|
-
const hasCheckedAssetMention = (code: string): boolean => ASSET_MENTION_RE.test(code) || code.includes(
|
|
116
|
+
const hasCheckedAssetMention = (code: string): boolean => ASSET_MENTION_RE.test(code) || code.includes(URL_QUERY);
|
|
123
117
|
|
|
124
|
-
const checkAssetImports = (code: string, id: string
|
|
118
|
+
const checkAssetImports = (code: string, id: string): void => {
|
|
125
119
|
const path = stripQuery(id);
|
|
126
120
|
const lang = sourceLanguage(path);
|
|
127
121
|
|
|
@@ -135,27 +129,27 @@ const checkAssetImports = (code: string, id: string, isV2: boolean): void => {
|
|
|
135
129
|
return;
|
|
136
130
|
}
|
|
137
131
|
|
|
138
|
-
const binding = unbackedBinding(parsed.module
|
|
132
|
+
const binding = unbackedBinding(parsed.module);
|
|
139
133
|
|
|
140
134
|
if (binding !== undefined) {
|
|
141
|
-
throw unbackedBindingError(path, binding
|
|
135
|
+
throw unbackedBindingError(path, binding);
|
|
142
136
|
}
|
|
143
137
|
};
|
|
144
138
|
|
|
145
|
-
function gtkxAssetImports(
|
|
146
|
-
const state: PluginState = { isV2: false };
|
|
147
|
-
|
|
139
|
+
function gtkxAssetImports(): Plugin {
|
|
148
140
|
return {
|
|
149
141
|
name: "gtkx:asset-imports",
|
|
150
142
|
enforce: "pre",
|
|
151
143
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
144
|
+
transform: {
|
|
145
|
+
filter: {
|
|
146
|
+
id: { include: SOURCE_ID_RE, exclude: [VIRTUAL_ID_RE, NODE_MODULES_ID_RE] },
|
|
147
|
+
code: { include: [ASSET_MENTION_RE, URL_QUERY] },
|
|
148
|
+
},
|
|
156
149
|
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
handler(code, id) {
|
|
151
|
+
checkAssetImports(code, id);
|
|
152
|
+
},
|
|
159
153
|
},
|
|
160
154
|
};
|
|
161
155
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { DATA_IMPORT_PREFIX } from "../internal/data-dir.js";
|
|
2
1
|
import { ASSET_PATH_RE, ASSET_RE } from "./asset-extensions.js";
|
|
3
2
|
import { stripQuery } from "./strip-query.js";
|
|
4
3
|
|
|
@@ -12,10 +11,14 @@ type IconSpecifier = {
|
|
|
12
11
|
iconName: string | null;
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
type FontSpecifier = {
|
|
15
|
+
assetSource: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
16
18
|
const RELATIVE_PREFIX_RE = /^\.\.?(?:\/|$)/;
|
|
17
19
|
const RESOURCE_QUERY_RE = /^resource(?:=([^&#]+))?$/;
|
|
18
20
|
const ICON_QUERY_RE = /^icon(?:=([^&#]+))?$/;
|
|
21
|
+
const FONT_QUERY_RE = /^font$/;
|
|
19
22
|
const URL_QUERY_RE = /(?:^|&)url(?:&|$)/;
|
|
20
23
|
|
|
21
24
|
const getQuery = (source: string): string | null => {
|
|
@@ -25,7 +28,6 @@ const getQuery = (source: string): string | null => {
|
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
const isAssetSpecifier = (source: string): boolean => ASSET_PATH_RE.test(source);
|
|
28
|
-
const isDataAsset = (source: string): boolean => source.startsWith(DATA_PREFIX) && ASSET_RE.test(source);
|
|
29
31
|
|
|
30
32
|
const isBareRelativeAsset = (source: string): boolean =>
|
|
31
33
|
getQuery(source) === null && RELATIVE_PREFIX_RE.test(source) && ASSET_RE.test(source);
|
|
@@ -64,6 +66,17 @@ const parseIconSpecifier = (source: string): IconSpecifier | null => {
|
|
|
64
66
|
return { assetSource, iconName: match[1] ?? null };
|
|
65
67
|
};
|
|
66
68
|
|
|
69
|
+
const parseFontSpecifier = (source: string): FontSpecifier | null => {
|
|
70
|
+
const query = getQuery(source);
|
|
71
|
+
const assetSource = stripQuery(source);
|
|
72
|
+
|
|
73
|
+
if (query === null || !ASSET_RE.test(assetSource) || !FONT_QUERY_RE.test(query)) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return { assetSource };
|
|
78
|
+
};
|
|
79
|
+
|
|
67
80
|
const isUrlSpecifier = (source: string): boolean => {
|
|
68
81
|
const query = getQuery(source);
|
|
69
82
|
|
|
@@ -71,11 +84,10 @@ const isUrlSpecifier = (source: string): boolean => {
|
|
|
71
84
|
};
|
|
72
85
|
|
|
73
86
|
export {
|
|
74
|
-
DATA_PREFIX,
|
|
75
87
|
isAssetSpecifier,
|
|
76
88
|
isBareRelativeAsset,
|
|
77
|
-
isDataAsset,
|
|
78
89
|
isUrlSpecifier,
|
|
90
|
+
parseFontSpecifier,
|
|
79
91
|
parseIconSpecifier,
|
|
80
92
|
parseResourceSpecifier,
|
|
81
93
|
};
|
|
@@ -21,6 +21,11 @@ type ManifestState = {
|
|
|
21
21
|
outDir: string;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
type BuildConfigIdentity = {
|
|
25
|
+
configFile: string;
|
|
26
|
+
configDigest: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
24
29
|
const PACKAGE_MANIFEST_FILENAME = "package.json";
|
|
25
30
|
const DEFAULT_OUT_DIR = "dist";
|
|
26
31
|
const JSON_INDENT = 4;
|
|
@@ -73,7 +78,7 @@ const packagesFor = (outDir: string, ids: string[]): RecordedPackage[] => {
|
|
|
73
78
|
|
|
74
79
|
const renderManifest = (manifest: BuildManifest): string => `${JSON.stringify(manifest, null, JSON_INDENT)}\n`;
|
|
75
80
|
|
|
76
|
-
function gtkxBuildManifest(root: string, collector: BuildManifestCollector): Plugin {
|
|
81
|
+
function gtkxBuildManifest(root: string, collector: BuildManifestCollector, identity: BuildConfigIdentity): Plugin {
|
|
77
82
|
const state: ManifestState = { outDir: join(root, DEFAULT_OUT_DIR) };
|
|
78
83
|
|
|
79
84
|
return {
|
|
@@ -90,6 +95,7 @@ function gtkxBuildManifest(root: string, collector: BuildManifestCollector): Plu
|
|
|
90
95
|
const manifest: BuildManifest = {
|
|
91
96
|
generator: BUILD_MANIFEST_GENERATOR,
|
|
92
97
|
formatVersion: BUILD_MANIFEST_FORMAT_VERSION,
|
|
98
|
+
...identity,
|
|
93
99
|
schemas: collector.schemas,
|
|
94
100
|
packages: packagesFor(state.outDir, ids),
|
|
95
101
|
};
|
|
@@ -68,8 +68,12 @@ function gtkxBuiltUrl(): Plugin {
|
|
|
68
68
|
state.isBuild = config.command === "build";
|
|
69
69
|
},
|
|
70
70
|
|
|
71
|
-
load
|
|
72
|
-
|
|
71
|
+
load: {
|
|
72
|
+
filter: { id: URL_QUERY_RE },
|
|
73
|
+
|
|
74
|
+
handler(id) {
|
|
75
|
+
return loadDevFileUrl(this, state, id);
|
|
76
|
+
},
|
|
73
77
|
},
|
|
74
78
|
};
|
|
75
79
|
}
|
package/src/vite-plugins/css.ts
CHANGED
|
@@ -4,10 +4,12 @@ import { createVirtualNamespace } from "./virtual-module.js";
|
|
|
4
4
|
|
|
5
5
|
type CssResolveContext = Parameters<typeof resolveToVirtual>[0];
|
|
6
6
|
type CssResolveRequest = Parameters<typeof resolveToVirtual>[1];
|
|
7
|
+
type CssLoadContext = { addWatchFile: (file: string) => void };
|
|
7
8
|
|
|
8
9
|
const CSS_RE = /\.css$/i;
|
|
9
10
|
const INJECT_SUFFIX = "?inject";
|
|
10
11
|
const VIRTUAL_PREFIX = "\0gtkx-css:";
|
|
12
|
+
const VIRTUAL_ID_RE = new RegExp(`^${VIRTUAL_PREFIX}`);
|
|
11
13
|
const { isVirtual, fromVirtualId, resolveToVirtual } = createVirtualNamespace(VIRTUAL_PREFIX);
|
|
12
14
|
|
|
13
15
|
const resolveCssId = async (ctx: CssResolveContext, request: CssResolveRequest): Promise<string | undefined> => {
|
|
@@ -24,13 +26,14 @@ const resolveCssId = async (ctx: CssResolveContext, request: CssResolveRequest):
|
|
|
24
26
|
return virtualId + INJECT_SUFFIX;
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
const loadInjectedCss = (id: string): string | undefined => {
|
|
29
|
+
const loadInjectedCss = (ctx: CssLoadContext, id: string): string | undefined => {
|
|
28
30
|
if (!isVirtual(id) || !id.endsWith(INJECT_SUFFIX)) {
|
|
29
31
|
return;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
const filePath = fromVirtualId(id.slice(0, -INJECT_SUFFIX.length));
|
|
33
35
|
const content = readFileSync(filePath, "utf8");
|
|
36
|
+
ctx.addWatchFile(filePath);
|
|
34
37
|
|
|
35
38
|
return ["import { injectGlobal } from \"@gtkx/css\";", `injectGlobal(${JSON.stringify(content)});`].join("\n");
|
|
36
39
|
};
|
|
@@ -40,12 +43,20 @@ function gtkxCss(): Plugin {
|
|
|
40
43
|
name: "gtkx:css",
|
|
41
44
|
enforce: "pre",
|
|
42
45
|
|
|
43
|
-
resolveId
|
|
44
|
-
|
|
46
|
+
resolveId: {
|
|
47
|
+
filter: { id: CSS_RE },
|
|
48
|
+
|
|
49
|
+
handler(source, importer, options) {
|
|
50
|
+
return resolveCssId(this, { source, importer, options });
|
|
51
|
+
},
|
|
45
52
|
},
|
|
46
53
|
|
|
47
|
-
load
|
|
48
|
-
|
|
54
|
+
load: {
|
|
55
|
+
filter: { id: VIRTUAL_ID_RE },
|
|
56
|
+
|
|
57
|
+
handler(id) {
|
|
58
|
+
return loadInjectedCss(this, id);
|
|
59
|
+
},
|
|
49
60
|
},
|
|
50
61
|
};
|
|
51
62
|
}
|
|
@@ -3,11 +3,11 @@ import { ensureGenerated } from "../codegen/run-codegen.js";
|
|
|
3
3
|
|
|
4
4
|
const TEST_MODE = "test";
|
|
5
5
|
|
|
6
|
-
const gtkxEnsureStore = (): Plugin => ({
|
|
6
|
+
const gtkxEnsureStore = (configFile?: string): Plugin => ({
|
|
7
7
|
name: "gtkx:ensure-store",
|
|
8
8
|
|
|
9
9
|
async config() {
|
|
10
|
-
await ensureGenerated(process.cwd(), { shouldAnnounce: true, mode: TEST_MODE });
|
|
10
|
+
await ensureGenerated(process.cwd(), { shouldAnnounce: true, mode: TEST_MODE, configFile });
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
13
|
|
|
@@ -3,6 +3,8 @@ const REFRESH_SIG = "$RefreshSig$";
|
|
|
3
3
|
const REFRESH_RUNTIME_SPECIFIER = "@gtkx/cli/refresh-runtime";
|
|
4
4
|
const REFRESH_INCLUDE = /\.[tj]sx?$/;
|
|
5
5
|
const REFRESH_EXCLUDE = /node_modules|[/\\]dist[/\\]|[/\\]\.gtkx[/\\]/;
|
|
6
|
+
const REFRESH_ID_FILTER = { include: REFRESH_INCLUDE, exclude: REFRESH_EXCLUDE };
|
|
7
|
+
const REFRESH_RUNTIME_ID_RE = new RegExp(`^${REFRESH_RUNTIME_SPECIFIER}$`);
|
|
6
8
|
|
|
7
9
|
const shouldTransformForRefresh = (
|
|
8
10
|
id: string,
|
|
@@ -23,4 +25,11 @@ const shouldTransformForRefresh = (
|
|
|
23
25
|
return true;
|
|
24
26
|
};
|
|
25
27
|
|
|
26
|
-
export {
|
|
28
|
+
export {
|
|
29
|
+
REFRESH_ID_FILTER,
|
|
30
|
+
REFRESH_REG,
|
|
31
|
+
REFRESH_RUNTIME_ID_RE,
|
|
32
|
+
REFRESH_RUNTIME_SPECIFIER,
|
|
33
|
+
REFRESH_SIG,
|
|
34
|
+
shouldTransformForRefresh,
|
|
35
|
+
};
|