@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/dist/i18n/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQ1C,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEhD,MAAM,UAAU,GAAG,CAAC,MAAgB,EAAU,EAAE,CAC5C,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,YAAY,GAAG,CAAC,OAAsB,EAAU,EAAE,CACpD,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC;AAEpE,MAAM,gBAAgB,GAAG,CAAC,MAAgB,EAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAElH,MAAM,YAAY,GAAG,CAAC,OAAsB,EAAU,EAAE;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACjF,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G,eAAe,EAAE;QACpB,sBAAsB;QACtB,EAAE;QACF,+BAA+B;QAC/B,qCAAqC;QACrC,GAAG,cAAc,CAAC,QAAQ,CAAC;QAC3B,OAAO;QACP,GAAG;QACH,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAEzG,MAAM,cAAc,GAAG,CAAC,IAAY,EAAiB,EAAE;IACnD,IAAI,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,QAAyB,EAAE,SAAS,GAAG,IAAI,EAAmB,EAAE;IACjG,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IAErD,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC;QACnC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtC,CAAC;IAED,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9C,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE7B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACrC,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport type { SourceMessage } from \"./source-messages.js\";\n\ntype I18nTypesResult = {\n isWritten: boolean;\n path: string;\n};\n\nconst I18N_TYPES_FILENAME = \"i18n.d.ts\";\nconst INTERPOLATION_PATTERN = /\\{\\{[^{}]+\\}\\}/u;\n\nconst stringType = (values: string[]): string =>\n [...new Set(values)].map((value) => JSON.stringify(value)).join(\" | \");\n\nconst contextField = (context: string | null): string =>\n context === null ? \"\" : ` context: ${JSON.stringify(context)};`;\n\nconst hasInterpolation = (values: string[]): boolean => values.some((value) => INTERPOLATION_PATTERN.test(value));\n\nconst pointVariant = (message: SourceMessage): string => {\n const isRequired = message.context !== null || hasInterpolation([message.msgid]);\n const isInterpolated = hasInterpolation([message.msgid]);\n\n return (\n `{${contextField(message.context)} interpolated: ${String(isInterpolated)}; kind: \"point\"; ` +\n `required: ${String(isRequired)}; value: ${JSON.stringify(message.msgid)} }`\n );\n};\n\nconst defaultVariant = (message: SourceMessage): string => {\n const values = [message.singular];\n const isInterpolated = hasInterpolation(values);\n const isRequired = message.context !== null || isInterpolated;\n\n return (\n `{${contextField(message.context)} defaultValue: ${JSON.stringify(message.singular)}; ` +\n `interpolated: ${String(isInterpolated)}; kind: \"default\"; required: ${String(isRequired)}; ` +\n `value: ${stringType(values)} }`\n );\n};\n\nconst requirePlural = (message: SourceMessage): string => {\n if (message.plural === null) {\n throw new Error(\"Plural translation metadata requires a plural source string\");\n }\n\n return message.plural;\n};\n\nconst pluralVariant = (message: SourceMessage): string => {\n const plural = requirePlural(message);\n const values = [message.singular, plural];\n const isInterpolated = hasInterpolation(values);\n\n return (\n `{${contextField(message.context)} defaultValue: ${JSON.stringify(plural)}; ` +\n `interpolated: ${String(isInterpolated)}; kind: \"plural\"; required: true; ` +\n `value: ${stringType(values)} }`\n );\n};\n\nconst pluralDefaultsVariant = (message: SourceMessage): string => {\n const plural = requirePlural(message);\n const values = [message.singular, plural];\n const isInterpolated = hasInterpolation(values);\n\n return (\n `{${contextField(message.context)} defaultValueOne: ${JSON.stringify(message.singular)}; ` +\n `defaultValueOther: ${JSON.stringify(plural)}; interpolated: ${String(isInterpolated)}; ` +\n `kind: \"pluralDefaults\"; required: true; value: ${stringType(values)} }`\n );\n};\n\nconst variantsFor = (message: SourceMessage): string[] => {\n if (message.kind === \"plural\") {\n return [pluralVariant(message)];\n }\n\n if (message.kind === \"pluralDefaults\") {\n return [pluralDefaultsVariant(message)];\n }\n\n return message.kind === \"default\" ? [defaultVariant(message)] : [pointVariant(message)];\n};\n\nconst renderRegistry = (messages: SourceMessage[]): string[] => {\n const entries: Map<string, Set<string>> = new Map();\n\n for (const message of messages) {\n const variants = entries.get(message.msgid) ?? new Set<string>();\n\n for (const variant of variantsFor(message)) {\n variants.add(variant);\n }\n\n entries.set(message.msgid, variants);\n }\n\n return [...entries]\n .toSorted(([left], [right]) => left.localeCompare(right))\n .map(([msgid, variants]) => ` ${JSON.stringify(msgid)}: ${[...variants].join(\" | \")};`);\n};\n\nconst generatedHeader = (): string[] => [\n \"/**\",\n \" * Translation declarations generated by GTKX. Regenerated by\",\n \" * `gtkx codegen`, `gtkx dev`, and `gtkx build`; do not edit.\",\n \" */\",\n];\n\nconst renderI18nTypes = (messages: SourceMessage[], isEnabled = true): string => {\n if (!isEnabled) {\n return [...generatedHeader(), \"export {};\", \"\"].join(\"\\n\");\n }\n\n return [\n ...generatedHeader(),\n 'import \"@gtkx/i18n\";',\n \"\",\n 'declare module \"@gtkx/i18n\" {',\n \" interface TranslationRegistry {\",\n ...renderRegistry(messages),\n \" }\",\n \"}\",\n \"\",\n ].join(\"\\n\");\n};\n\nconst i18nTypesPath = (root: string): string => join(root, \"node_modules\", \".gtkx\", I18N_TYPES_FILENAME);\n\nconst readFileOrNull = (path: string): string | null => {\n try {\n return readFileSync(path, \"utf8\");\n } catch {\n return null;\n }\n};\n\nconst emitI18nTypes = (root: string, messages: SourceMessage[], isEnabled = true): I18nTypesResult => {\n const path = i18nTypesPath(root);\n const content = renderI18nTypes(messages, isEnabled);\n\n if (readFileOrNull(path) === content) {\n return { isWritten: false, path };\n }\n\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, content);\n\n return { isWritten: true, path };\n};\n\nexport { I18N_TYPES_FILENAME, emitI18nTypes, i18nTypesPath };\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/i18n/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,MAAM,iBAAiB,GAAG,aAAa,CAAC;AACxC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD,MAAM,YAAY,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AACnF,MAAM,eAAe,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AACnF,MAAM,aAAa,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,mBAAmB,CAAC,CAAC;AAC9F,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,uBAAuB,CAAC,CAAC;AAEtG,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAQ,EAAE;IAC9C,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACpE,CAAC,CAAC;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AC,aAAa,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,GAChB,CAAC","sourcesContent":["import type { I18nextToolkitConfig, Logger, Plugin } from \"i18next-cli\";\nimport { runTypesGenerator } from \"i18next-cli\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\n\nconst CONTEXT_SEPARATOR = \"\\u{4}\";\nconst DEFAULT_NAMESPACE = \"translation\";\nconst I18N_TYPES_FILENAME = \"i18n.d.ts\";\nconst I18N_RESOURCES_FILENAME = \"i18n-resources.d.ts\";\n\nconst generatedDir = (root: string): string => join(root, \"node_modules\", \".gtkx\");\nconst i18nResourceDir = (root: string): string => join(generatedDir(root), \"i18n\");\nconst i18nTypesPath = (root: string): string => join(generatedDir(root), I18N_TYPES_FILENAME);\nconst i18nResourcesPath = (root: string): string => join(generatedDir(root), I18N_RESOURCES_FILENAME);\n\nconst clearI18nResources = (root: string): void => {\n rmSync(i18nResourceDir(root), { force: true, recursive: true });\n};\n\nconst i18nToolkitConfig = (\n root: string,\n sourceFiles: string[],\n plugins: Plugin[] = [],\n): I18nextToolkitConfig => ({\n locales: [\"en\"],\n plugins,\n extract: {\n contextSeparator: CONTEXT_SEPARATOR,\n defaultNS: DEFAULT_NAMESPACE,\n disablePlurals: false,\n extractFromComments: false,\n functions: [\"t\"],\n generateBasePluralForms: false,\n input: sourceFiles,\n keySeparator: \".\",\n nsSeparator: false,\n output: join(i18nResourceDir(root), \"{{language}}\", \"{{namespace}}.json\"),\n pluralSeparator: \"_\",\n primaryLanguage: \"en\",\n removeUnusedKeys: true,\n transComponents: [\"Trans\", \"TransWithoutContext\"],\n useTranslationNames: [\"useTranslation\"],\n warnOnConflicts: \"error\",\n },\n types: {\n input: join(i18nResourceDir(root), \"en\", \"*.json\"),\n output: i18nTypesPath(root),\n resourcesFile: i18nResourcesPath(root),\n },\n});\n\nconst declarations = (): string => `import type Resources from \"./i18n-resources.js\";\n\ndeclare module \"@gtkx/i18n\" {\n interface I18nResources extends Resources {}\n}\n`;\n\nconst writeChanged = (path: string, content: string): void => {\n let current: string | null;\n\n try {\n current = readFileSync(path, \"utf8\");\n } catch {\n current = null;\n }\n\n if (current === content) {\n return;\n }\n\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, content);\n};\n\nconst typegenLogger = (): { errors: string[]; logger: Logger } => {\n const errors: string[] = [];\n\n return {\n errors,\n logger: {\n error(value) {\n errors.push(String(value));\n },\n info() {\n return;\n },\n warn() {\n return;\n },\n },\n };\n};\n\nconst emitI18nTypes = async (root: string): Promise<void> => {\n const typesPath = i18nTypesPath(root);\n const resourcesPath = i18nResourcesPath(root);\n writeChanged(typesPath, declarations());\n const { errors, logger } = typegenLogger();\n await runTypesGenerator(i18nToolkitConfig(root, []), { logger, quiet: true });\n\n if (errors.length > 0 || !existsSync(typesPath) || !existsSync(resourcesPath)) {\n throw new Error(errors.join(\"\\n\") || \"i18next type generation did not produce its outputs\");\n }\n};\n\nconst clearI18nTypes = (root: string): void => {\n rmSync(i18nTypesPath(root), { force: true });\n rmSync(i18nResourcesPath(root), { force: true });\n clearI18nResources(root);\n};\n\nexport {\n I18N_TYPES_FILENAME,\n clearI18nResources,\n clearI18nTypes,\n emitI18nTypes,\n i18nToolkitConfig,\n i18nTypesPath,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-rules.d.ts","sourceRoot":"","sources":["../../src/internal/agent-rules.ts"],"names":[],"mappings":"AAIA,KAAK,gBAAgB,GAAG;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-rules.d.ts","sourceRoot":"","sources":["../../src/internal/agent-rules.ts"],"names":[],"mappings":"AAIA,KAAK,gBAAgB,GAAG;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAoHF,QAAA,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,gBAcxC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -11,9 +11,13 @@ const TOP_LEVEL_HEADING = /^# /m;
|
|
|
11
11
|
const rulesBody = (heading) => [
|
|
12
12
|
`${heading} GTKX`,
|
|
13
13
|
"",
|
|
14
|
-
"
|
|
15
|
-
"GJS, and almost none of it is valid here. Check the rules below against what you are
|
|
14
|
+
"GTKX applications are Adwaita-first, with GTK4 underneath. Most GNOME UI code in your training data is C, " +
|
|
15
|
+
"PyGObject, Vala or GJS, and almost none of it is valid here. Check the rules below against what you are " +
|
|
16
|
+
"about to write.",
|
|
16
17
|
"",
|
|
18
|
+
"- Start application shells with `AdwApplication` and `AdwApplicationWindow`. Freeform windows normally use " +
|
|
19
|
+
"`AdwToolbarView` and `AdwHeaderBar`; navigation containers own their Adwaita chrome. Prefer Adwaita for " +
|
|
20
|
+
"structure, navigation, dialogs, rows, and adaptive patterns; use GTK4 for lower-level primitives.",
|
|
17
21
|
"- Children are JSX, never `.append()`, `pack_start()`, `set_child()` or `add()`.",
|
|
18
22
|
'- Signals are props: `onClicked`, not `widget.connect("clicked", ...)`.',
|
|
19
23
|
"- Props are camelCase: `marginTop`, not `margin-top` or `margin_top`.",
|
|
@@ -30,6 +34,7 @@ const rulesBody = (heading) => [
|
|
|
30
34
|
"| --- | --- |",
|
|
31
35
|
"| `gtkx dev` | Run the app with fast refresh |",
|
|
32
36
|
"| `gtkx codegen` | Regenerate bindings and this reference |",
|
|
37
|
+
"| `gtkx cleanup` | Remove stale headless runtime and compile cache directories |",
|
|
33
38
|
"| `tsc --noEmit` | Typecheck |",
|
|
34
39
|
"| `vitest run` | Run the tests |",
|
|
35
40
|
"",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-rules.js","sourceRoot":"","sources":["../../src/internal/agent-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,eAAe,GAAG,IAAI,eAAe,IAAI,CAAC;AAChD,MAAM,YAAY,GAAG,iCAAiC,CAAC;AACvD,MAAM,UAAU,GAAG,+BAA+B,CAAC;AACnD,MAAM,aAAa,GAAG,sEAAsE,CAAC;AAC7F,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,CAAC,OAAe,EAAY,EAAE,CAAC;IAC7C,GAAG,OAAO,OAAO;IACjB,EAAE;IACF,
|
|
1
|
+
{"version":3,"file":"agent-rules.js","sourceRoot":"","sources":["../../src/internal/agent-rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAOzD,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,eAAe,GAAG,WAAW,CAAC;AACpC,MAAM,eAAe,GAAG,IAAI,eAAe,IAAI,CAAC;AAChD,MAAM,YAAY,GAAG,iCAAiC,CAAC;AACvD,MAAM,UAAU,GAAG,+BAA+B,CAAC;AACnD,MAAM,aAA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AAE,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC;AAClD,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC","sourcesContent":["import { readFileSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { REFERENCE_PATH } from \"../codegen/reference.js\";\n\ntype AgentRulesResult = {\n isWritten: boolean;\n files: string[];\n};\n\nconst AGENTS_FILENAME = \"AGENTS.md\";\nconst CLAUDE_FILENAME = \"CLAUDE.md\";\nconst CLAUDE_CONTENTS = `@${AGENTS_FILENAME}\\n`;\nconst BEGIN_MARKER = \"<!-- BEGIN:gtkx-agent-rules -->\";\nconst END_MARKER = \"<!-- END:gtkx-agent-rules -->\";\nconst BLOCK_PATTERN = /<!-- BEGIN:gtkx-agent-rules -->[\\s\\S]*?<!-- END:gtkx-agent-rules -->/;\nconst TOP_LEVEL_HEADING = /^# /m;\n\nconst rulesBody = (heading: string): string[] => [\n `${heading} GTKX`,\n \"\",\n \"GTKX applications are Adwaita-first, with GTK4 underneath. Most GNOME UI code in your training data is C, \" +\n \"PyGObject, Vala or GJS, and almost none of it is valid here. Check the rules below against what you are \" +\n \"about to write.\",\n \"\",\n \"- Start application shells with `AdwApplication` and `AdwApplicationWindow`. Freeform windows normally use \" +\n \"`AdwToolbarView` and `AdwHeaderBar`; navigation containers own their Adwaita chrome. Prefer Adwaita for \" +\n \"structure, navigation, dialogs, rows, and adaptive patterns; use GTK4 for lower-level primitives.\",\n \"- Children are JSX, never `.append()`, `pack_start()`, `set_child()` or `add()`.\",\n '- Signals are props: `onClicked`, not `widget.connect(\"clicked\", ...)`.',\n \"- Props are camelCase: `marginTop`, not `margin-top` or `margin_top`.\",\n \"- There is no `Gtk.Template`, no `.ui` XML, and no `GtkBuilder`. The JSX tree is the definition.\",\n \"- Elements come from `@gtkx/jsx/<namespace>` and classes, enums and functions from \" +\n \"`@gtkx/gi/<namespace>`. Both are generated for this project by `gtkx codegen`, not installed from npm, \" +\n \"so they match the GIR libraries this project declares.\",\n \"\",\n `Read \\`${REFERENCE_PATH}/index.md\\` before writing widget code. It is generated from this project's own ` +\n \"GIR libraries and is the authority on which props, signals and methods exist. Do not infer a prop from \" +\n \"another toolkit, from a C function name, or from a similar element.\",\n \"\",\n \"| Command | What it does |\",\n \"| --- | --- |\",\n \"| `gtkx dev` | Run the app with fast refresh |\",\n \"| `gtkx codegen` | Regenerate bindings and this reference |\",\n \"| `gtkx cleanup` | Remove stale headless runtime and compile cache directories |\",\n \"| `tsc --noEmit` | Typecheck |\",\n \"| `vitest run` | Run the tests |\",\n \"\",\n \"Never call UI work done without looking at the running app. With `gtkx dev` up, the gtkx MCP server \" +\n \"exposes the live widget tree, queries, clicks and screenshots; use them to confirm the change landed.\",\n \"\",\n \"This block is written by `gtkx codegen`. Anything outside the markers is yours and is left alone, and \" +\n \"committing the block with your work keeps the tree clean.\",\n];\n\nconst renderBlock = (heading: string): string =>\n [BEGIN_MARKER, \"\", ...rulesBody(heading), \"\", END_MARKER].join(\"\\n\");\n\nconst headingFor = (contents: string): string => (TOP_LEVEL_HEADING.test(contents) ? \"##\" : \"#\");\nconst withTrailingNewline = (contents: string): string => (contents.endsWith(\"\\n\") ? contents : `${contents}\\n`);\n\nconst appendBlock = (contents: string, block: string): string => {\n if (contents.trim() === \"\") {\n return `${block}\\n`;\n }\n\n return `${withTrailingNewline(contents)}\\n${block}\\n`;\n};\n\nconst replaceBlock = (contents: string, block: string): string => {\n const match = BLOCK_PATTERN.exec(contents);\n\n if (match === null) {\n return appendBlock(contents, block);\n }\n\n return contents.slice(0, match.index) + block + contents.slice(match.index + match[0].length);\n};\n\nconst nextContents = (contents: string): string => {\n const heading = headingFor(contents.replace(BLOCK_PATTERN, \"\"));\n\n return replaceBlock(contents, renderBlock(heading));\n};\n\nconst errorCode = (error: unknown): string | undefined =>\n error instanceof Error ? (error as NodeJS.ErrnoException).code : undefined;\n\nconst readOrUndefined = (path: string): string | undefined => {\n try {\n return readFileSync(path, \"utf8\");\n } catch (error) {\n if (errorCode(error) === \"ENOENT\") {\n return undefined;\n }\n\n throw error;\n }\n};\n\nconst hasWritten = (path: string, contents: string): boolean => {\n if (readOrUndefined(path) === contents) {\n return false;\n }\n\n writeFileSync(path, contents);\n\n return true;\n};\n\nconst hasWrittenClaudeImport = (root: string): boolean => {\n try {\n writeFileSync(join(root, CLAUDE_FILENAME), CLAUDE_CONTENTS, { flag: \"wx\" });\n\n return true;\n } catch (error) {\n if (errorCode(error) === \"EEXIST\") {\n return false;\n }\n\n throw error;\n }\n};\n\nconst upsertAgentRules = (root: string): AgentRulesResult => {\n const agentsPath = join(root, AGENTS_FILENAME);\n const existing = readOrUndefined(agentsPath) ?? \"\";\n const files: string[] = [];\n\n if (hasWritten(agentsPath, nextContents(existing))) {\n files.push(AGENTS_FILENAME);\n }\n\n if (hasWrittenClaudeImport(root)) {\n files.push(CLAUDE_FILENAME);\n }\n\n return { isWritten: files.length > 0, files };\n};\n\nexport { upsertAgentRules };\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Rollup } from "vite";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Banner = string | Rollup.AddonFunction;
|
|
3
|
+
declare const prependBanner: (options: Rollup.OutputOptions, banner: Banner) => Rollup.OutputOptions;
|
|
4
|
+
declare const outputRootUrlExpression: (chunk: Rollup.RenderedChunk) => string;
|
|
5
|
+
export { outputRootUrlExpression, prependBanner };
|
|
4
6
|
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/internal/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../src/internal/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC,KAAK,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC;AAK5C,QAAA,MAAM,aAAa,GAAI,SAAS,MAAM,CAAC,aAAa,EAAE,QAAQ,MAAM,KAAG,MAAM,CAAC,aAgB7E,CAAC;AAEF,QAAA,MAAM,uBAAuB,GAAI,OAAO,MAAM,CAAC,aAAa,KAAG,MAK9D,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/internal/banner.js
CHANGED
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
import { posix } from "node:path";
|
|
2
|
+
const renderBanner = async (banner, chunk) => typeof banner === "function" ? banner(chunk) : banner;
|
|
1
3
|
const prependBanner = (options, banner) => {
|
|
2
4
|
const existing = options.banner;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
return {
|
|
6
|
+
...options,
|
|
7
|
+
banner: async (chunk) => {
|
|
8
|
+
const prefix = await renderBanner(banner, chunk);
|
|
9
|
+
const suffix = existing === undefined ? "" : await renderBanner(existing, chunk);
|
|
10
|
+
if (prefix.length === 0) {
|
|
11
|
+
return suffix;
|
|
12
|
+
}
|
|
13
|
+
return suffix.length === 0 ? prefix : `${prefix}\n${suffix}`;
|
|
14
|
+
},
|
|
15
|
+
};
|
|
7
16
|
};
|
|
8
|
-
|
|
17
|
+
const outputRootUrlExpression = (chunk) => {
|
|
18
|
+
const relativeRoot = posix.relative(posix.dirname(chunk.fileName), ".");
|
|
19
|
+
const specifier = relativeRoot.length === 0 ? "./" : `${relativeRoot}/`;
|
|
20
|
+
return `decodeURIComponent(new URL(${JSON.stringify(specifier)}, import.meta.url).pathname)`;
|
|
21
|
+
};
|
|
22
|
+
export { outputRootUrlExpression, prependBanner };
|
|
9
23
|
//# sourceMappingURL=banner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../src/internal/banner.ts"],"names":[],"mappings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GAAG,CAAC;IAExE,OAAO,8BAA8B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,8BAA8B,CAAC;AACjG,CAAC,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,CAAC","sourcesContent":["import type { Rollup } from \"vite\";\nimport { posix } from \"node:path\";\n\ntype Banner = string | Rollup.AddonFunction;\n\nconst renderBanner = async (banner: Banner, chunk: Rollup.RenderedChunk): Promise<string> =>\n typeof banner === \"function\" ? banner(chunk) : banner;\n\nconst prependBanner = (options: Rollup.OutputOptions, banner: Banner): Rollup.OutputOptions => {\n const existing = options.banner;\n\n return {\n ...options,\n banner: async (chunk) => {\n const prefix = await renderBanner(banner, chunk);\n const suffix = existing === undefined ? \"\" : await renderBanner(existing, chunk);\n\n if (prefix.length === 0) {\n return suffix;\n }\n\n return suffix.length === 0 ? prefix : `${prefix}\\n${suffix}`;\n },\n };\n};\n\nconst outputRootUrlExpression = (chunk: Rollup.RenderedChunk): string => {\n const relativeRoot = posix.relative(posix.dirname(chunk.fileName), \".\");\n const specifier = relativeRoot.length === 0 ? \"./\" : `${relativeRoot}/`;\n\n return `decodeURIComponent(new URL(${JSON.stringify(specifier)}, import.meta.url).pathname)`;\n};\n\nexport { outputRootUrlExpression, prependBanner };\n"]}
|
|
@@ -6,6 +6,8 @@ type RecordedPackage = {
|
|
|
6
6
|
type BuildManifest = {
|
|
7
7
|
generator: typeof BUILD_MANIFEST_GENERATOR;
|
|
8
8
|
formatVersion: typeof BUILD_MANIFEST_FORMAT_VERSION;
|
|
9
|
+
configFile: string;
|
|
10
|
+
configDigest: string;
|
|
9
11
|
schemas: string[];
|
|
10
12
|
packages: RecordedPackage[];
|
|
11
13
|
};
|
|
@@ -14,7 +16,8 @@ type BuildManifestCollector = {
|
|
|
14
16
|
};
|
|
15
17
|
declare const BUILD_MANIFEST_FILENAME = "gtkx-schemas.json";
|
|
16
18
|
declare const BUILD_MANIFEST_GENERATOR = "gtkx-build";
|
|
17
|
-
declare const BUILD_MANIFEST_FORMAT_VERSION =
|
|
19
|
+
declare const BUILD_MANIFEST_FORMAT_VERSION = 2;
|
|
20
|
+
declare const configDigest: (config: unknown) => string;
|
|
18
21
|
declare const createBuildManifestCollector: () => BuildManifestCollector;
|
|
19
|
-
export { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_FORMAT_VERSION, BUILD_MANIFEST_GENERATOR, createBuildManifestCollector, type BuildManifest, type BuildManifestCollector, type RecordedPackage, };
|
|
22
|
+
export { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_FORMAT_VERSION, BUILD_MANIFEST_GENERATOR, configDigest, createBuildManifestCollector, type BuildManifest, type BuildManifestCollector, type RecordedPackage, };
|
|
20
23
|
//# sourceMappingURL=build-manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/build-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-manifest.d.ts","sourceRoot":"","sources":["../../src/internal/build-manifest.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,aAAa,GAAG;IACjB,SAAS,EAAE,OAAO,wBAAwB,CAAC;IAC3C,aAAa,EAAE,OAAO,6BAA6B,CAAC;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAEF,KAAK,sBAAsB,GAAG;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,uBAAuB,sBAAsB,CAAC;AACpD,QAAA,MAAM,wBAAwB,eAAe,CAAC;AAC9C,QAAA,MAAM,6BAA6B,IAAI,CAAC;AAkBxC,QAAA,MAAM,YAAY,GAAI,QAAQ,OAAO,KAAG,MAC8C,CAAC;AAEvF,QAAA,MAAM,4BAA4B,QAAO,sBAA2C,CAAC;AAErF,OAAO,EACH,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,EAC5B,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACvB,CAAC"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
1
2
|
const BUILD_MANIFEST_FILENAME = "gtkx-schemas.json";
|
|
2
3
|
const BUILD_MANIFEST_GENERATOR = "gtkx-build";
|
|
3
|
-
const BUILD_MANIFEST_FORMAT_VERSION =
|
|
4
|
+
const BUILD_MANIFEST_FORMAT_VERSION = 2;
|
|
5
|
+
const canonicalConfig = (value) => {
|
|
6
|
+
if (Array.isArray(value)) {
|
|
7
|
+
return value.map((entry) => canonicalConfig(entry));
|
|
8
|
+
}
|
|
9
|
+
if (typeof value !== "object" || value === null) {
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
return Object.fromEntries(Object.entries(value)
|
|
13
|
+
.toSorted(([left], [right]) => left.localeCompare(right))
|
|
14
|
+
.map(([key, entry]) => [key, canonicalConfig(entry)]));
|
|
15
|
+
};
|
|
16
|
+
const configDigest = (config) => createHash("sha256").update(JSON.stringify(canonicalConfig(config))).digest("hex");
|
|
4
17
|
const createBuildManifestCollector = () => ({ schemas: [] });
|
|
5
|
-
export { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_FORMAT_VERSION, BUILD_MANIFEST_GENERATOR, createBuildManifestCollector, };
|
|
18
|
+
export { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_FORMAT_VERSION, BUILD_MANIFEST_GENERATOR, configDigest, createBuildManifestCollector, };
|
|
6
19
|
//# sourceMappingURL=build-manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-manifest.js","sourceRoot":"","sources":["../../src/internal/build-manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-manifest.js","sourceRoot":"","sources":["../../src/internal/build-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAqBzC,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AACpD,MAAM,wBAAwB,GAAG,YAAY,CAAC;AAC9C,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,MAAM,eAAe,GAAG,CAAC,KAAc,EAAW,EAAE;IAChD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC,WAAW,CACrB,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;SAChB,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACxD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5D,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,MAAe,EAAU,EAAE,CAC7C,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAEvF,MAAM,4BAA4B,GAAG,GAA2B,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AAErF,OAAO,EACH,uBAAuB,EACvB,6BAA6B,EAC7B,wBAAwB,EACxB,YAAY,EACZ,4BAA4B,GAI/B,CAAC","sourcesContent":["import { createHash } from \"node:crypto\";\n\ntype RecordedPackage = {\n name: string;\n version: string | null;\n dir: string;\n};\n\ntype BuildManifest = {\n generator: typeof BUILD_MANIFEST_GENERATOR;\n formatVersion: typeof BUILD_MANIFEST_FORMAT_VERSION;\n configFile: string;\n configDigest: string;\n schemas: string[];\n packages: RecordedPackage[];\n};\n\ntype BuildManifestCollector = {\n schemas: string[];\n};\n\nconst BUILD_MANIFEST_FILENAME = \"gtkx-schemas.json\";\nconst BUILD_MANIFEST_GENERATOR = \"gtkx-build\";\nconst BUILD_MANIFEST_FORMAT_VERSION = 2;\n\nconst canonicalConfig = (value: unknown): unknown => {\n if (Array.isArray(value)) {\n return value.map((entry) => canonicalConfig(entry));\n }\n\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n\n return Object.fromEntries(\n Object.entries(value)\n .toSorted(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, canonicalConfig(entry)]),\n );\n};\n\nconst configDigest = (config: unknown): string =>\n createHash(\"sha256\").update(JSON.stringify(canonicalConfig(config))).digest(\"hex\");\n\nconst createBuildManifestCollector = (): BuildManifestCollector => ({ schemas: [] });\n\nexport {\n BUILD_MANIFEST_FILENAME,\n BUILD_MANIFEST_FORMAT_VERSION,\n BUILD_MANIFEST_GENERATOR,\n configDigest,\n createBuildManifestCollector,\n type BuildManifest,\n type BuildManifestCollector,\n type RecordedPackage,\n};\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type PreparedBuildOutDir = Disposable & {
|
|
2
|
+
commit: () => void;
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
declare const resolveBuildOutDir: (root: string, configured?: string) => string;
|
|
6
|
+
declare const prepareBuildOutDir: (root: string, outDir: string) => PreparedBuildOutDir;
|
|
7
|
+
export { prepareBuildOutDir, resolveBuildOutDir };
|
|
8
|
+
//# sourceMappingURL=build-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-output.d.ts","sourceRoot":"","sources":["../../src/internal/build-output.ts"],"names":[],"mappings":"AAgBA,KAAK,mBAAmB,GAAG,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAwH7E,QAAA,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,aAAa,MAAM,KAAG,MAW/D,CAAC;AAEF,QAAA,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,QAAQ,MAAM,KAAG,mBAmB1D,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { isPathInside, isRecord } from "@gtkx/utils";
|
|
2
|
+
import { lstatSync, readdirSync } from "node:fs";
|
|
3
|
+
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { BUILD_MANIFEST_FILENAME, BUILD_MANIFEST_GENERATOR, } from "./build-manifest.js";
|
|
5
|
+
import { prepareOutputDirectory, readRegularFile, } from "./output-directory.js";
|
|
6
|
+
const DEFAULT_BUILD_OUT_DIR = "dist";
|
|
7
|
+
const PRESERVED_BUILD_ENTRIES = new Set([".git"]);
|
|
8
|
+
const hasSymlinkComponent = (root, target) => {
|
|
9
|
+
let current = root;
|
|
10
|
+
for (const segment of relative(root, target).split(sep)) {
|
|
11
|
+
current = join(current, segment);
|
|
12
|
+
if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
const isGtkxBuildDirectory = (path) => {
|
|
19
|
+
const manifest = join(path, BUILD_MANIFEST_FILENAME);
|
|
20
|
+
const contents = readRegularFile(manifest);
|
|
21
|
+
try {
|
|
22
|
+
const parsed = contents === null ? null : JSON.parse(contents);
|
|
23
|
+
return isRecord(parsed) && parsed.generator === BUILD_MANIFEST_GENERATOR;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const isReusableBuildDirectory = (path) => {
|
|
30
|
+
const stats = lstatSync(path, { throwIfNoEntry: false });
|
|
31
|
+
if (stats === undefined) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return stats.isDirectory() && (readdirSync(path).length === 0 || isGtkxBuildDirectory(path));
|
|
35
|
+
};
|
|
36
|
+
const outputName = (root, path) => relative(root, path) || ".";
|
|
37
|
+
const gtkxBuildAncestor = (root, outDir) => {
|
|
38
|
+
let ancestor = dirname(outDir);
|
|
39
|
+
while (isPathInside(root, ancestor)) {
|
|
40
|
+
if (isGtkxBuildDirectory(ancestor)) {
|
|
41
|
+
return ancestor;
|
|
42
|
+
}
|
|
43
|
+
ancestor = dirname(ancestor);
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
};
|
|
47
|
+
const childDirectories = (parent) => readdirSync(parent, { withFileTypes: true })
|
|
48
|
+
.filter((entry) => entry.isDirectory())
|
|
49
|
+
.map((entry) => join(parent, entry.name));
|
|
50
|
+
const gtkxBuildDescendant = (root) => {
|
|
51
|
+
const pending = childDirectories(root);
|
|
52
|
+
while (pending.length > 0) {
|
|
53
|
+
const path = pending.pop();
|
|
54
|
+
if (path === undefined) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
if (isGtkxBuildDirectory(path)) {
|
|
58
|
+
return path;
|
|
59
|
+
}
|
|
60
|
+
pending.push(...childDirectories(path));
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
};
|
|
64
|
+
const assertSafeBuildLocation = (root, outDir) => {
|
|
65
|
+
if (!isPathInside(root, outDir)) {
|
|
66
|
+
throw new Error(`Build output ${outDir} must be below the project root ${root}`);
|
|
67
|
+
}
|
|
68
|
+
if (hasSymlinkComponent(root, outDir)) {
|
|
69
|
+
throw new Error(`Build output ${outputName(root, outDir)} passes through a symbolic link`);
|
|
70
|
+
}
|
|
71
|
+
const ancestor = gtkxBuildAncestor(root, outDir);
|
|
72
|
+
if (ancestor !== null) {
|
|
73
|
+
throw new Error(`Build output ${outputName(root, outDir)} is nested inside the earlier GTKX build ` +
|
|
74
|
+
outputName(root, ancestor));
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const nonReusableBuildOutputError = (root, outDir) => {
|
|
78
|
+
const stats = lstatSync(outDir, { throwIfNoEntry: false });
|
|
79
|
+
if (stats?.isDirectory() !== true) {
|
|
80
|
+
return new Error(`Build output ${outputName(root, outDir)} exists and is not a directory`);
|
|
81
|
+
}
|
|
82
|
+
const descendant = gtkxBuildDescendant(outDir);
|
|
83
|
+
if (descendant !== null) {
|
|
84
|
+
return new Error(`Build output ${outputName(root, outDir)} contains the earlier GTKX build ` +
|
|
85
|
+
outputName(root, descendant));
|
|
86
|
+
}
|
|
87
|
+
return new Error(`Build output ${outputName(root, outDir)} is nonempty and is not an earlier GTKX build`);
|
|
88
|
+
};
|
|
89
|
+
const resolveBuildOutDir = (root, configured) => {
|
|
90
|
+
const selected = configured ?? DEFAULT_BUILD_OUT_DIR;
|
|
91
|
+
const outDir = resolve(root, selected);
|
|
92
|
+
assertSafeBuildLocation(root, outDir);
|
|
93
|
+
if (!isReusableBuildDirectory(outDir)) {
|
|
94
|
+
throw nonReusableBuildOutputError(root, outDir);
|
|
95
|
+
}
|
|
96
|
+
return outDir;
|
|
97
|
+
};
|
|
98
|
+
const prepareBuildOutDir = (root, outDir) => {
|
|
99
|
+
assertSafeBuildLocation(root, outDir);
|
|
100
|
+
const prepared = prepareOutputDirectory(root, outDir, isReusableBuildDirectory);
|
|
101
|
+
if (prepared.status === "unsafe") {
|
|
102
|
+
throw new Error(`Build output ${outputName(root, outDir)} became unsafe while preparing it`);
|
|
103
|
+
}
|
|
104
|
+
const transaction = prepared.transaction;
|
|
105
|
+
return {
|
|
106
|
+
path: transaction.path,
|
|
107
|
+
commit: () => {
|
|
108
|
+
transaction.commit(PRESERVED_BUILD_ENTRIES, isGtkxBuildDirectory);
|
|
109
|
+
},
|
|
110
|
+
[Symbol.dispose]: () => {
|
|
111
|
+
transaction[Symbol.dispose]();
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export { prepareBuildOutDir, resolveBuildOutDir };
|
|
116
|
+
//# sourceMappingURL=build-output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-output.js","sourceRoot":"","sources":["../../src/internal/build-output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EACH,uBAAuB,EACvB,wBAAwB,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEH,sBAAsB,EACtB,eAAe,GAClB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAIvE,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,MAAc,EAAW,EAAE;IAClE,IAAI,OAAO,GAAG,IAAI,CAAC;IAEnB,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACtD,OAAO,GAAG,IAA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B,EAAE,CAAC","sourcesContent":["import { isPathInside, isRecord } from \"@gtkx/utils\";\nimport { lstatSync, readdirSync } from \"node:fs\";\nimport { dirname, join, relative, resolve, sep } from \"node:path\";\nimport {\n BUILD_MANIFEST_FILENAME,\n BUILD_MANIFEST_GENERATOR,\n} from \"./build-manifest.js\";\nimport {\n type OutputDirectoryTransaction,\n prepareOutputDirectory,\n readRegularFile,\n} from \"./output-directory.js\";\n\nconst DEFAULT_BUILD_OUT_DIR = \"dist\";\nconst PRESERVED_BUILD_ENTRIES: ReadonlySet<string> = new Set([\".git\"]);\n\ntype PreparedBuildOutDir = Disposable & { commit: () => void; path: string };\n\nconst hasSymlinkComponent = (root: string, target: string): boolean => {\n let current = root;\n\n for (const segment of relative(root, target).split(sep)) {\n current = join(current, segment);\n\n if (lstatSync(current, { throwIfNoEntry: false })?.isSymbolicLink() === true) {\n return true;\n }\n }\n\n return false;\n};\n\nconst isGtkxBuildDirectory = (path: string): boolean => {\n const manifest = join(path, BUILD_MANIFEST_FILENAME);\n const contents = readRegularFile(manifest);\n\n try {\n const parsed: unknown = contents === null ? null : JSON.parse(contents);\n\n return isRecord(parsed) && parsed.generator === BUILD_MANIFEST_GENERATOR;\n } catch {\n return false;\n }\n};\n\nconst isReusableBuildDirectory = (path: string): boolean => {\n const stats = lstatSync(path, { throwIfNoEntry: false });\n\n if (stats === undefined) {\n return true;\n }\n\n return stats.isDirectory() && (readdirSync(path).length === 0 || isGtkxBuildDirectory(path));\n};\n\nconst outputName = (root: string, path: string): string => relative(root, path) || \".\";\n\nconst gtkxBuildAncestor = (root: string, outDir: string): string | null => {\n let ancestor = dirname(outDir);\n\n while (isPathInside(root, ancestor)) {\n if (isGtkxBuildDirectory(ancestor)) {\n return ancestor;\n }\n\n ancestor = dirname(ancestor);\n }\n\n return null;\n};\n\nconst childDirectories = (parent: string): string[] =>\n readdirSync(parent, { withFileTypes: true })\n .filter((entry) => entry.isDirectory())\n .map((entry) => join(parent, entry.name));\n\nconst gtkxBuildDescendant = (root: string): string | null => {\n const pending = childDirectories(root);\n\n while (pending.length > 0) {\n const path = pending.pop();\n\n if (path === undefined) {\n return null;\n }\n\n if (isGtkxBuildDirectory(path)) {\n return path;\n }\n\n pending.push(...childDirectories(path));\n }\n\n return null;\n};\n\nconst assertSafeBuildLocation = (root: string, outDir: string): void => {\n if (!isPathInside(root, outDir)) {\n throw new Error(`Build output ${outDir} must be below the project root ${root}`);\n }\n\n if (hasSymlinkComponent(root, outDir)) {\n throw new Error(`Build output ${outputName(root, outDir)} passes through a symbolic link`);\n }\n\n const ancestor = gtkxBuildAncestor(root, outDir);\n\n if (ancestor !== null) {\n throw new Error(\n `Build output ${outputName(root, outDir)} is nested inside the earlier GTKX build ` +\n outputName(root, ancestor),\n );\n }\n};\n\nconst nonReusableBuildOutputError = (root: string, outDir: string): Error => {\n const stats = lstatSync(outDir, { throwIfNoEntry: false });\n\n if (stats?.isDirectory() !== true) {\n return new Error(`Build output ${outputName(root, outDir)} exists and is not a directory`);\n }\n\n const descendant = gtkxBuildDescendant(outDir);\n\n if (descendant !== null) {\n return new Error(\n `Build output ${outputName(root, outDir)} contains the earlier GTKX build ` +\n outputName(root, descendant),\n );\n }\n\n return new Error(\n `Build output ${outputName(root, outDir)} is nonempty and is not an earlier GTKX build`,\n );\n};\n\nconst resolveBuildOutDir = (root: string, configured?: string): string => {\n const selected = configured ?? DEFAULT_BUILD_OUT_DIR;\n const outDir = resolve(root, selected);\n\n assertSafeBuildLocation(root, outDir);\n\n if (!isReusableBuildDirectory(outDir)) {\n throw nonReusableBuildOutputError(root, outDir);\n }\n\n return outDir;\n};\n\nconst prepareBuildOutDir = (root: string, outDir: string): PreparedBuildOutDir => {\n assertSafeBuildLocation(root, outDir);\n const prepared = prepareOutputDirectory(root, outDir, isReusableBuildDirectory);\n\n if (prepared.status === \"unsafe\") {\n throw new Error(`Build output ${outputName(root, outDir)} became unsafe while preparing it`);\n }\n\n const transaction: OutputDirectoryTransaction = prepared.transaction;\n\n return {\n path: transaction.path,\n commit: () => {\n transaction.commit(PRESERVED_BUILD_ENTRIES, isGtkxBuildDirectory);\n },\n [Symbol.dispose]: () => {\n transaction[Symbol.dispose]();\n },\n };\n};\n\nexport { prepareBuildOutDir, resolveBuildOutDir };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-root.d.ts","sourceRoot":"","sources":["../../src/internal/cache-root.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,SAAS,QAAO,MAIrB,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
const CACHE_NAMESPACE = "gtkx";
|
|
4
|
+
const cacheRoot = () => {
|
|
5
|
+
const base = process.env.XDG_CACHE_HOME;
|
|
6
|
+
return join(base !== undefined && base.length > 0 ? base : join(homedir(), ".cache"), CACHE_NAMESPACE);
|
|
7
|
+
};
|
|
8
|
+
export { cacheRoot };
|
|
9
|
+
//# sourceMappingURL=cache-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-root.js","sourceRoot":"","sources":["../../src/internal/cache-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,eAAe,GAAG,MAAM,CAAC;AAE/B,MAAM,SAAS,GAAG,GAAW,EAAE;IAC3B,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAExC,OAAO,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC;AAC3G,CAAC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\n\nconst CACHE_NAMESPACE = \"gtkx\";\n\nconst cacheRoot = (): string => {\n const base = process.env.XDG_CACHE_HOME;\n\n return join(base !== undefined && base.length > 0 ? base : join(homedir(), \".cache\"), CACHE_NAMESPACE);\n};\n\nexport { cacheRoot };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-cache-store.d.ts","sourceRoot":"","sources":["../../src/internal/compile-cache-store.ts"],"names":[],"mappings":"AAqBA,QAAA,MAAM,sBAAsB,QAAO,MAAM,EAWxC,CAAC;AAEF,QAAA,MAAM,sBAAsB,GAAI,YAAY,MAAM,EAAE,KAAG,MAAM,EAa5D,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readdirSync, rmSync } from "node:fs";
|
|
2
|
+
import * as nodeModule from "node:module";
|
|
3
|
+
import { basename, join } from "node:path";
|
|
4
|
+
import { cacheRoot } from "./cache-root.js";
|
|
5
|
+
import { COMPILE_CACHE_SEGMENT } from "./compile-cache.js";
|
|
6
|
+
const RUNTIME_PREFIX = `v${process.versions.node}-${process.arch}-`;
|
|
7
|
+
const currentNamespace = () => {
|
|
8
|
+
if (typeof nodeModule.getCompileCacheDir !== "function") {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const dir = nodeModule.getCompileCacheDir();
|
|
12
|
+
return dir === undefined ? undefined : basename(dir);
|
|
13
|
+
};
|
|
14
|
+
const isStale = (name, namespace) => namespace === undefined ? !name.startsWith(RUNTIME_PREFIX) : name !== namespace;
|
|
15
|
+
const findStaleCompileCaches = () => {
|
|
16
|
+
const namespace = currentNamespace();
|
|
17
|
+
const dir = join(cacheRoot(), COMPILE_CACHE_SEGMENT);
|
|
18
|
+
try {
|
|
19
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
20
|
+
.filter((entry) => entry.isDirectory() && isStale(entry.name, namespace))
|
|
21
|
+
.map((entry) => join(dir, entry.name));
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const reapStaleCompileCaches = (candidates) => {
|
|
28
|
+
const removed = [];
|
|
29
|
+
for (const candidate of candidates) {
|
|
30
|
+
try {
|
|
31
|
+
rmSync(candidate, { recursive: true, force: true });
|
|
32
|
+
removed.push(candidate);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return removed;
|
|
39
|
+
};
|
|
40
|
+
export { findStaleCompileCaches, reapStaleCompileCaches };
|
|
41
|
+
//# sourceMappingURL=compile-cache-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-cache-store.js","sourceRoot":"","sources":["../../src/internal/compile-cache-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,cAAc,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,GAAG,CAAC;AAEpE,MAAM,gBAAgB,GAAG,GAAuB,EAAE;IAC9C,IAAI,OAAO,UAAU,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;QACtD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,GAAG,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;IAE5C,OAAO,GAAG,KAAK,SAA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O,CAAC;AACnB,CAAC,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC","sourcesContent":["import { readdirSync, rmSync } from \"node:fs\";\nimport * as nodeModule from \"node:module\";\nimport { basename, join } from \"node:path\";\nimport { cacheRoot } from \"./cache-root.js\";\nimport { COMPILE_CACHE_SEGMENT } from \"./compile-cache.js\";\n\nconst RUNTIME_PREFIX = `v${process.versions.node}-${process.arch}-`;\n\nconst currentNamespace = (): string | undefined => {\n if (typeof nodeModule.getCompileCacheDir !== \"function\") {\n return undefined;\n }\n\n const dir = nodeModule.getCompileCacheDir();\n\n return dir === undefined ? undefined : basename(dir);\n};\n\nconst isStale = (name: string, namespace: string | undefined): boolean =>\n namespace === undefined ? !name.startsWith(RUNTIME_PREFIX) : name !== namespace;\n\nconst findStaleCompileCaches = (): string[] => {\n const namespace = currentNamespace();\n const dir = join(cacheRoot(), COMPILE_CACHE_SEGMENT);\n\n try {\n return readdirSync(dir, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && isStale(entry.name, namespace))\n .map((entry) => join(dir, entry.name));\n } catch {\n return [];\n }\n};\n\nconst reapStaleCompileCaches = (candidates: string[]): string[] => {\n const removed: string[] = [];\n\n for (const candidate of candidates) {\n try {\n rmSync(candidate, { recursive: true, force: true });\n removed.push(candidate);\n } catch {\n continue;\n }\n }\n\n return removed;\n};\n\nexport { findStaleCompileCaches, reapStaleCompileCaches };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-cache.d.ts","sourceRoot":"","sources":["../../src/internal/compile-cache.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,qBAAqB,kBAAkB,CAAC;AAG9C,QAAA,MAAM,2BAA2B,QAAO,IAUvC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as nodeModule from "node:module";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { cacheRoot } from "./cache-root.js";
|
|
4
|
+
const COMPILE_CACHE_SEGMENT = "compile-cache";
|
|
5
|
+
const DISABLE_COMPILE_CACHE_ENV = "GTKX_DISABLE_COMPILE_CACHE";
|
|
6
|
+
const enableToolchainCompileCache = () => {
|
|
7
|
+
if (process.env[DISABLE_COMPILE_CACHE_ENV] === "1") {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (typeof nodeModule.enableCompileCache !== "function") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
nodeModule.enableCompileCache(join(cacheRoot(), COMPILE_CACHE_SEGMENT));
|
|
14
|
+
};
|
|
15
|
+
export { COMPILE_CACHE_SEGMENT, enableToolchainCompileCache };
|
|
16
|
+
//# sourceMappingURL=compile-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-cache.js","sourceRoot":"","sources":["../../src/internal/compile-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAC9C,MAAM,yBAAyB,GAAG,4BAA4B,CAAC;AAE/D,MAAM,2BAA2B,GAAG,GAAS,EAAE;IAC3C,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,KAAK,GAAG,EAAE,CAAC;QACjD,OAAO;IACX,CAAC;IAED,IAAI,OAAO,UAAU,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;QACtD,OAAO;IACX,CAAC;IAED,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,CAAC","sourcesContent":["import * as nodeModule from \"node:module\";\nimport { join } from \"node:path\";\nimport { cacheRoot } from \"./cache-root.js\";\n\nconst COMPILE_CACHE_SEGMENT = \"compile-cache\";\nconst DISABLE_COMPILE_CACHE_ENV = \"GTKX_DISABLE_COMPILE_CACHE\";\n\nconst enableToolchainCompileCache = (): void => {\n if (process.env[DISABLE_COMPILE_CACHE_ENV] === \"1\") {\n return;\n }\n\n if (typeof nodeModule.enableCompileCache !== \"function\") {\n return;\n }\n\n nodeModule.enableCompileCache(join(cacheRoot(), COMPILE_CACHE_SEGMENT));\n};\n\nexport { COMPILE_CACHE_SEGMENT, enableToolchainCompileCache };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-out-dir.d.ts","sourceRoot":"","sources":["../../src/internal/deploy-out-dir.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,sBAAsB,UAAU,CAAC;AAEvC,QAAA,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,YAAY,MAAM,GAAG,SAAS,KAAG,MACjB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
const DEFAULT_DEPLOY_OUT_DIR = "build";
|
|
3
|
+
const deployOutDirFor = (root, configured) => resolve(root, configured ?? DEFAULT_DEPLOY_OUT_DIR);
|
|
4
|
+
export { DEFAULT_DEPLOY_OUT_DIR, deployOutDirFor };
|
|
5
|
+
//# sourceMappingURL=deploy-out-dir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-out-dir.js","sourceRoot":"","sources":["../../src/internal/deploy-out-dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAE,UAA8B,EAAU,EAAE,CAC7E,OAAO,CAAC,IAAI,EAAE,UAAU,IAAI,sBAAsB,CAAC,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import { resolve } from \"node:path\";\n\nconst DEFAULT_DEPLOY_OUT_DIR = \"build\";\n\nconst deployOutDirFor = (root: string, configured: string | undefined): string =>\n resolve(root, configured ?? DEFAULT_DEPLOY_OUT_DIR);\n\nexport { DEFAULT_DEPLOY_OUT_DIR, deployOutDirFor };\n"]}
|
|
@@ -2,6 +2,7 @@ import { type ElementProps, type OmittedProps } from "@gtkx/codegen";
|
|
|
2
2
|
type DocsElements = {
|
|
3
3
|
props: ElementProps;
|
|
4
4
|
omittedProps: OmittedProps;
|
|
5
|
+
acceptedChildTypes: Record<string, string[]>;
|
|
5
6
|
};
|
|
6
7
|
declare const resolveDocsElements: (cwd: string) => Promise<DocsElements>;
|
|
7
8
|
export { resolveDocsElements };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-elements.d.ts","sourceRoot":"","sources":["../../src/internal/docs-elements.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"docs-elements.d.ts","sourceRoot":"","sources":["../../src/internal/docs-elements.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,YAAY,EACjB,KAAK,YAAY,EAEpB,MAAM,eAAe,CAAC;AAIvB,KAAK,YAAY,GAAG;IAChB,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAChD,CAAC;AAEF,QAAA,MAAM,mBAAmB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,YAAY,CAUpE,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveStore, } from "@gtkx/codegen";
|
|
2
|
+
import { readBuiltinElementsForDocs } from "@gtkx/codegen/internal";
|
|
2
3
|
import { existsSync } from "node:fs";
|
|
3
4
|
const resolveDocsElements = async (cwd) => {
|
|
4
|
-
const { gi
|
|
5
|
+
const { gi } = resolveStore(cwd);
|
|
5
6
|
if (!existsSync(gi.storeDir)) {
|
|
6
|
-
return { props: {}, omittedProps: {} };
|
|
7
|
+
return { props: {}, omittedProps: {}, acceptedChildTypes: {} };
|
|
7
8
|
}
|
|
8
|
-
const { props, omittedProps } = await
|
|
9
|
-
return { props, omittedProps };
|
|
9
|
+
const { props, omittedProps, acceptedChildTypes } = await readBuiltinElementsForDocs();
|
|
10
|
+
return { props, omittedProps, acceptedChildTypes };
|
|
10
11
|
};
|
|
11
12
|
export { resolveDocsElements };
|
|
12
13
|
//# sourceMappingURL=docs-elements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs-elements.js","sourceRoot":"","sources":["../../src/internal/docs-elements.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"docs-elements.js","sourceRoot":"","sources":["../../src/internal/docs-elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,MAAM,mBAAmB,GAAG,KAAK,EAAE,GAAW,EAAyB,EAAE;IACrE,MAAM,EAAE,EAAE,EAAE,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAEjC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC;IACnE,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,MAAM,0BAA0B,EAAE,CAAC;IAEvF,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AACvD,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import {\n type ElementProps,\n type OmittedProps,\n resolveStore,\n} from \"@gtkx/codegen\";\nimport { readBuiltinElementsForDocs } from \"@gtkx/codegen/internal\";\nimport { existsSync } from \"node:fs\";\n\ntype DocsElements = {\n props: ElementProps;\n omittedProps: OmittedProps;\n acceptedChildTypes: Record<string, string[]>;\n};\n\nconst resolveDocsElements = async (cwd: string): Promise<DocsElements> => {\n const { gi } = resolveStore(cwd);\n\n if (!existsSync(gi.storeDir)) {\n return { props: {}, omittedProps: {}, acceptedChildTypes: {} };\n }\n\n const { props, omittedProps, acceptedChildTypes } = await readBuiltinElementsForDocs();\n\n return { props, omittedProps, acceptedChildTypes };\n};\n\nexport { resolveDocsElements };\n"]}
|
|
@@ -2,6 +2,9 @@ import type { PositionalArgDef, StringArgDef } from "citty";
|
|
|
2
2
|
declare const cwdArg: {
|
|
3
3
|
cwd: StringArgDef;
|
|
4
4
|
};
|
|
5
|
+
declare const configArg: {
|
|
6
|
+
config: StringArgDef;
|
|
7
|
+
};
|
|
5
8
|
declare const entryArg: {
|
|
6
9
|
entry: PositionalArgDef;
|
|
7
10
|
cwd: StringArgDef;
|
|
@@ -10,5 +13,5 @@ declare const resolveCwd: (args: {
|
|
|
10
13
|
cwd?: string;
|
|
11
14
|
}) => string;
|
|
12
15
|
declare const resolveEntry: (cwd: string, entry: string | undefined) => string;
|
|
13
|
-
export { cwdArg, entryArg, resolveCwd, resolveEntry };
|
|
16
|
+
export { configArg, cwdArg, entryArg, resolveCwd, resolveEntry };
|
|
14
17
|
//# sourceMappingURL=entry-arg.d.ts.map
|