From fb816a8b13b0247504200a417a2c183d83301160 Mon Sep 17 00:00:00 2001 From: MarioCadenas Date: Mon, 17 Aug 2026 12:27:48 +0200 Subject: [PATCH] chore: migrate from Biome to oxlint + oxfmt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace @biomejs/biome with the oxc (VoidZero) toolchain: oxlint for linting and oxfmt for formatting + import sorting. - Add .oxlintrc.json / .oxfmtrc.json (migrated from biome.json) - Rewrite lint/format/check scripts and lint-staged for oxlint + oxfmt - Rename tools/format-with-biome.ts -> format-generated.ts (calls oxfmt) - Translate live biome-ignore suppressions to oxlint-disable; drop 64 dead noExplicitAny suppressions (rule was already off) - Reorganize imports repo-wide via oxfmt sortImports Parity notes: - oxc does not lint/format CSS (Biome did) — accepted loss - oxlint correctness rules stricter than Biome's former bar are disabled with a documented follow-up to tighten later Signed-off-by: MarioCadenas --- .oxfmtrc.json | 37 ++ .oxlintrc.json | 81 +++ CLAUDE.md | 16 +- apps/clean-app/eslint.config.js | 2 +- apps/clean-app/src/App.tsx | 4 +- apps/clean-app/src/main.tsx | 1 + apps/dev-playground/client/eslint.config.js | 2 +- .../components/analytics/databricks-logo.tsx | 3 +- .../src/components/analytics/filter-bar.tsx | 1 + .../components/analytics/summary-cards.tsx | 4 +- .../analytics/untagged-apps-table.tsx | 1 + .../components/lakebase/ActivityLogsPanel.tsx | 1 + .../components/lakebase/OboProductsPanel.tsx | 1 + .../src/components/lakebase/OrdersPanel.tsx | 1 + .../src/components/lakebase/TasksPanel.tsx | 1 + .../reconnect/connection-status.tsx | 1 + .../components/actionable-card.tsx | 1 + .../components/active-filters.tsx | 1 + .../components/agent-sidebar.tsx | 1 + .../components/approval-card.tsx | 1 + .../components/chat-drawer.tsx | 2 +- .../smart-dashboard/components/fare-chart.tsx | 1 + .../components/focusable-chart.tsx | 1 + .../components/hourly-heatmap.tsx | 1 + .../components/inspector-toggle.tsx | 1 + .../smart-dashboard/components/kpi-cards.tsx | 1 + .../components/saved-views-panel.tsx | 7 +- .../components/stream-inspector.tsx | 4 +- .../components/top-zones-chart.tsx | 1 + .../smart-dashboard/components/trip-chart.tsx | 1 + .../hooks/use-action-dispatcher.ts | 1 + .../smart-dashboard/hooks/use-agent-stream.ts | 1 + .../hooks/use-stream-inspector.ts | 1 + .../client/src/lib/utils/filter-utils.ts | 1 + apps/dev-playground/client/src/main.tsx | 2 + .../client/src/routes/__root.tsx | 1 + .../client/src/routes/agent.route.tsx | 1 - .../client/src/routes/ai-search.route.tsx | 1 + .../client/src/routes/analytics.route.tsx | 1 + .../src/routes/arrow-analytics.route.tsx | 1 + .../src/routes/data-visualization.route.tsx | 1 + .../client/src/routes/index.tsx | 1 + .../client/src/routes/lakebase.route.tsx | 1 + .../client/src/routes/metric-views.route.tsx | 1 + .../client/src/routes/reconnect.route.tsx | 1 + .../src/routes/smart-dashboard.route.tsx | 1 + .../client/src/routes/type-safety.route.tsx | 1 + apps/dev-playground/client/tailwind.config.ts | 1 + apps/dev-playground/client/vite.config.ts | 1 + apps/dev-playground/server/index.ts | 1 + .../server/lakebase-examples-plugin.ts | 1 + .../lakebase-examples/sequelize-example.ts | 8 +- .../tests/arrow-analytics.spec.ts | 1 + .../tests/data-visualization.spec.ts | 1 + apps/dev-playground/tests/reconnect.spec.ts | 1 + apps/dev-playground/tests/sql-helpers.spec.ts | 1 + apps/dev-playground/tests/telemetry.spec.ts | 1 + apps/dev-playground/tests/utils/test-utils.ts | 1 + biome.json | 92 --- docs/docusaurus.config.ts | 1 + docs/scripts/build-appkit-ui-styles.ts | 1 + docs/sidebars.ts | 1 + .../components/DocExample/IframePreview.tsx | 1 + docs/src/components/DocExample/index.tsx | 1 + .../src/components/HomepageFeatures/index.tsx | 2 + package.json | 31 +- .../src/js/arrow/arrow-client.test.ts | 1 + .../appkit-ui/src/js/arrow/arrow-client.ts | 1 + packages/appkit-ui/src/js/config.test.ts | 1 + .../appkit-ui/src/js/format/index.test.ts | 1 + .../src/js/metric-filter/index.test.ts | 1 + .../src/react/charts/__tests__/base.test.tsx | 1 + .../react/charts/__tests__/normalize.test.ts | 1 + .../react/charts/__tests__/options.test.ts | 1 + .../src/react/charts/__tests__/theme.test.ts | 1 + .../src/react/charts/__tests__/types.test.ts | 1 + .../src/react/charts/__tests__/utils.test.ts | 1 + .../appkit-ui/src/react/charts/area/index.tsx | 1 + .../appkit-ui/src/react/charts/bar/index.tsx | 1 + packages/appkit-ui/src/react/charts/base.tsx | 15 +- .../src/react/charts/heatmap/index.tsx | 1 + packages/appkit-ui/src/react/charts/index.ts | 6 +- .../appkit-ui/src/react/charts/line/index.tsx | 1 + .../appkit-ui/src/react/charts/normalize.ts | 2 + .../appkit-ui/src/react/charts/pie/index.tsx | 1 + .../src/react/charts/radar/index.tsx | 1 + .../src/react/charts/scatter/index.tsx | 1 + packages/appkit-ui/src/react/charts/theme.ts | 1 + .../appkit-ui/src/react/charts/wrapper.tsx | 1 + .../src/react/file-browser/directory-list.tsx | 7 +- .../react/file-browser/file-breadcrumb.tsx | 6 +- .../src/react/file-browser/file-entry.tsx | 7 +- .../react/file-browser/file-preview-panel.tsx | 7 +- .../react/file-browser/new-folder-input.tsx | 7 +- .../__tests__/genie-chart-inference.test.ts | 1 + .../__tests__/genie-query-transform.test.ts | 1 + .../src/react/genie/genie-chat-input.tsx | 1 + .../react/genie/genie-chat-message-list.tsx | 2 +- .../src/react/genie/genie-chat-message.tsx | 1 + .../react/genie/genie-query-visualization.tsx | 2 +- .../src/react/genie/use-genie-chat.ts | 2 + .../hooks/__tests__/analytics-sse.test.ts | 1 + .../__tests__/use-analytics-query.test.ts | 8 - .../__tests__/use-metric-view.types.test.ts | 1 + .../hooks/__tests__/use-plugin-config.test.ts | 2 + packages/appkit-ui/src/react/hooks/types.ts | 161 +++--- .../src/react/hooks/use-agent-chat.ts | 1 + .../src/react/hooks/use-ai-search-query.ts | 2 +- .../src/react/hooks/use-analytics-query.ts | 2 + .../hooks/use-analytics-warehouse-status.ts | 1 + .../src/react/hooks/use-chart-data.ts | 1 + .../src/react/hooks/use-metric-view.ts | 2 + .../src/react/hooks/use-plugin-config.ts | 1 + .../src/react/hooks/use-serving-invoke.ts | 1 + .../src/react/hooks/use-serving-stream.ts | 2 + .../appkit-ui/src/react/lib/format.test.ts | 1 + .../src/react/resource-status-indicator.tsx | 4 +- .../appkit-ui/src/react/styles/globals.css | 3 - .../appkit-ui/src/react/table/data-table.tsx | 1 + .../src/react/table/table-wrapper.tsx | 1 + .../src/react/ui-variants/variants.tsx | 1 + .../appkit/skills/appkit-ui-variants/SKILL.md | 2 +- packages/appkit/src/agents/databricks.ts | 1 + packages/appkit/src/agents/supervisor-api.ts | 1 + .../src/agents/tests/databricks.test.ts | 1 + .../src/agents/tests/supervisor-api.test.ts | 1 + packages/appkit/src/app/index.ts | 1 + packages/appkit/src/app/tests/app.test.ts | 1 + .../src/app/tests/read-config-file.test.ts | 2 + packages/appkit/src/cache/index.ts | 2 + packages/appkit/src/cache/storage/memory.ts | 1 + .../appkit/src/cache/storage/persistent.ts | 2 + .../src/cache/tests/cache-manager.test.ts | 1 + .../appkit/src/cache/tests/memory.test.ts | 1 + .../appkit/src/cache/tests/persistent.test.ts | 1 + .../appkit/src/connectors/files/client.ts | 2 + .../src/connectors/files/tests/client.test.ts | 1 + .../connectors/files/tests/defaults.test.ts | 1 + .../src/connectors/genie/poll-waiter.test.ts | 1 + .../src/connectors/genie/tests/client.test.ts | 1 + .../appkit/src/connectors/lakebase/index.ts | 1 + .../src/connectors/lakebase/pool-manager.ts | 1 + .../src/connectors/lakebase/routing-pool.ts | 1 + .../lakebase/tests/routing-pool.test.ts | 16 +- packages/appkit/src/connectors/mcp/client.ts | 1 + packages/appkit/src/connectors/mcp/index.ts | 5 +- .../src/connectors/mcp/tests/client.test.ts | 1 + .../connectors/mcp/tests/host-policy.test.ts | 1 + .../connectors/serving/tests/client.test.ts | 1 + .../src/connectors/sql-warehouse/client.ts | 1 + .../sql-warehouse/tests/arrow-schema.test.ts | 1 + .../sql-warehouse/tests/client.test.ts | 1 + .../src/connectors/tests/context.test.ts | 1 + .../connectors/tests/sql-warehouse.test.ts | 1 + packages/appkit/src/context/client-options.ts | 1 + .../appkit/src/context/execution-context.ts | 1 + .../appkit/src/context/service-context.ts | 1 + .../src/context/tests/service-context.test.ts | 1 + .../tests/user-agent-wire.integration.test.ts | 2 + .../appkit/src/core/agent/build-toolkit.ts | 1 + packages/appkit/src/core/agent/index.ts | 6 +- packages/appkit/src/core/agent/load-agents.ts | 2 + packages/appkit/src/core/agent/run-agent.ts | 2 + .../core/agent/tests/build-toolkit.test.ts | 1 + .../tests/consume-adapter-stream.test.ts | 1 + .../src/core/agent/tests/create-agent.test.ts | 2 +- .../src/core/agent/tests/define-tool.test.ts | 1 + .../core/agent/tests/function-tool.test.ts | 1 + .../src/core/agent/tests/hosted-tools.test.ts | 1 + .../src/core/agent/tests/load-agents.test.ts | 2 + .../agent/tests/mcp-server-helper.test.ts | 1 + .../core/agent/tests/normalize-result.test.ts | 1 + .../src/core/agent/tests/run-agent.test.ts | 17 +- .../src/core/agent/tests/sql-policy.test.ts | 1 + .../core/agent/tests/system-prompt.test.ts | 1 + .../appkit/src/core/agent/tests/tool.test.ts | 1 + .../core/agent/tests/toolkit-options.test.ts | 1 + .../appkit/src/core/agent/toolkit-resolver.ts | 1 + .../src/core/agent/tools/define-tool.ts | 1 + packages/appkit/src/core/agent/tools/tool.ts | 1 + packages/appkit/src/core/agent/types.ts | 1 + packages/appkit/src/core/appkit.ts | 1 + packages/appkit/src/core/lifecycle-manager.ts | 1 + packages/appkit/src/core/plugin-context.ts | 1 + .../core/tests/appkit-as-user-exports.test.ts | 2 + .../appkit/src/core/tests/databricks.test.ts | 6 +- .../src/core/tests/plugin-context.test.ts | 1 + .../appkit/src/database/contract/registry.ts | 2 +- .../contract/tests/column-info.test.ts | 1 + .../database/contract/tests/registry.test.ts | 1 + .../src/database/contract/tests/wire.test.ts | 1 + .../schema-builder/engine/relations.ts | 1 + .../database/schema-builder/engine/tables.ts | 3 +- .../schema-builder/tests/columns.test.ts | 1 + .../tests/define-schema.test.ts | 1 + .../tests/engine-relations.test.ts | 1 + .../database/schema-builder/tests/fk.test.ts | 1 + .../schema-builder/tests/private.test.ts | 1 + .../schema-builder/tests/relations.test.ts | 1 + .../schema-builder/tests/validators.test.ts | 1 + .../src/database/schema-builder/validators.ts | 1 + packages/appkit/src/errors/configuration.ts | 1 + .../appkit/src/errors/tests/errors.test.ts | 1 + .../tests/appkit-log.test.ts | 1 + .../internal-telemetry/tests/config.test.ts | 1 + .../internal-telemetry/tests/reporter.test.ts | 1 + packages/appkit/src/logging/logger.ts | 2 + .../logging/tests/logger-with-event.test.ts | 1 + .../appkit/src/logging/tests/logger.test.ts | 1 + .../appkit/src/logging/tests/sampling.test.ts | 1 + .../logging/tests/wide-event-emitter.test.ts | 1 + .../src/logging/tests/wide-event.test.ts | 1 + .../appkit/src/logging/wide-event-emitter.ts | 1 + packages/appkit/src/plugin/dev-reader.ts | 2 + .../appkit/src/plugin/interceptors/cache.ts | 1 + .../appkit/src/plugin/interceptors/retry.ts | 1 + .../src/plugin/interceptors/telemetry.ts | 1 + packages/appkit/src/plugin/plugin.ts | 4 +- .../src/plugin/tests/asUser-proxy.test.ts | 1 + .../appkit/src/plugin/tests/cache.test.ts | 1 + .../src/plugin/tests/dev-reader.test.ts | 1 + .../appkit/src/plugin/tests/plugin.test.ts | 6 +- .../appkit/src/plugin/tests/retry.test.ts | 1 + .../appkit/src/plugin/tests/timeout.test.ts | 1 + packages/appkit/src/plugins/agents/agents.ts | 4 +- .../src/plugins/agents/event-translator.ts | 1 + .../agents/tests/agents-plugin.test.ts | 16 +- .../agents/tests/approval-config.test.ts | 1 + .../agents/tests/approval-route.test.ts | 1 + .../agents/tests/dispatch-tool-call.test.ts | 15 +- .../plugins/agents/tests/dos-limits.test.ts | 16 +- .../agents/tests/event-channel.test.ts | 1 + .../agents/tests/event-translator.test.ts | 1 + .../agents/tests/route-handler-errors.test.ts | 23 +- .../plugins/agents/tests/thread-store.test.ts | 1 + .../agents/tests/tool-approval-gate.test.ts | 1 + .../appkit/src/plugins/agents/thread-store.ts | 1 + .../appkit/src/plugins/ai-search/ai-search.ts | 4 +- .../plugins/ai-search/tests/ai-search.test.ts | 1 + .../appkit/src/plugins/analytics/analytics.ts | 3 +- .../appkit/src/plugins/analytics/mv/cache.ts | 1 + .../src/plugins/analytics/mv/constants.ts | 1 + .../src/plugins/analytics/mv/formatters.ts | 1 + .../src/plugins/analytics/mv/metadata.ts | 1 + .../src/plugins/analytics/mv/registry.ts | 1 + .../src/plugins/analytics/mv/schemas.ts | 1 + .../appkit/src/plugins/analytics/query.ts | 2 + .../src/plugins/analytics/result-delivery.ts | 1 + .../tests/analytics.integration.test.ts | 2 + .../plugins/analytics/tests/analytics.test.ts | 1 + .../tests/arrow-delivery.integration.test.ts | 1 + .../plugins/analytics/tests/metric.test.ts | 2 + .../src/plugins/analytics/tests/query.test.ts | 1 + .../analytics/tests/result-delivery.test.ts | 1 + .../src/plugins/analytics/tests/types.test.ts | 1 + packages/appkit/src/plugins/files/helpers.ts | 2 +- packages/appkit/src/plugins/files/plugin.ts | 4 +- .../src/plugins/files/tests/_test-helpers.ts | 2 + .../src/plugins/files/tests/delete.test.ts | 1 + .../files/tests/download-endpoint.test.ts | 1 + .../files/tests/error-handling.test.ts | 1 + .../src/plugins/files/tests/helpers.test.ts | 1 + .../src/plugins/files/tests/mkdir.test.ts | 1 + .../files/tests/path-validation.test.ts | 1 + .../files/tests/plugin.integration.test.ts | 2 + .../src/plugins/files/tests/plugin.test.ts | 2 + .../src/plugins/files/tests/policy.test.ts | 1 + .../plugins/files/tests/raw-endpoint.test.ts | 1 + .../src/plugins/files/tests/shutdown.test.ts | 1 + .../src/plugins/files/tests/upload.test.ts | 1 + .../plugins/files/tests/volume-config.test.ts | 1 + packages/appkit/src/plugins/files/types.ts | 1 + packages/appkit/src/plugins/genie/genie.ts | 4 +- .../src/plugins/genie/tests/genie.test.ts | 1 + packages/appkit/src/plugins/jobs/plugin.ts | 4 +- .../src/plugins/jobs/tests/plugin.test.ts | 1 + packages/appkit/src/plugins/jobs/types.ts | 1 + .../appkit/src/plugins/lakebase/lakebase.ts | 9 +- .../tests/lakebase-agent-tool.test.ts | 31 +- packages/appkit/src/plugins/lakebase/types.ts | 1 + .../appkit/src/plugins/server/base-server.ts | 1 + .../plugins/server/client-config-sanitizer.ts | 3 +- packages/appkit/src/plugins/server/index.ts | 4 +- .../server/react-source-loc-vite-plugin.ts | 1 + .../remote-tunnel/remote-tunnel-controller.ts | 2 + .../remote-tunnel/remote-tunnel-manager.ts | 2 + .../src/plugins/server/static-server.ts | 2 + .../server/tests/error-middleware.test.ts | 1 + .../react-source-loc-vite-plugin.test.ts | 2 + .../server/tests/remote-tunnel-gate.test.ts | 1 + .../tests/request-metrics-middleware.test.ts | 1 + .../server/tests/server.integration.test.ts | 2 + .../src/plugins/server/tests/server.test.ts | 3 + .../server/tests/static-server.test.ts | 3 + packages/appkit/src/plugins/server/utils.ts | 1 + .../src/plugins/server/vite-dev-server.ts | 2 + .../src/plugins/serving/schema-filter.ts | 1 + .../appkit/src/plugins/serving/serving.ts | 4 +- .../serving/tests/schema-filter.test.ts | 1 + .../src/plugins/serving/tests/serving.test.ts | 2 + .../src/plugins/serving/tests/types.test.ts | 1 + packages/appkit/src/plugins/serving/types.ts | 2 +- .../appkit/src/plugins/ui-variants/index.ts | 1 + .../appkit/src/registry/manifest-loader.ts | 1 + .../appkit/src/registry/resource-registry.ts | 1 + .../src/registry/tests/integration.test.ts | 1 + .../registry/tests/manifest-loader.test.ts | 1 + .../registry/tests/resource-registry.test.ts | 1 + packages/appkit/src/registry/types.ts | 6 +- packages/appkit/src/stream/sse-writer.ts | 1 + packages/appkit/src/stream/stream-manager.ts | 2 + .../tests/arrow-stream-processor.test.ts | 1 + .../src/stream/tests/sse-reader.test.ts | 1 + .../src/stream/tests/stream-registry.test.ts | 1 + .../appkit/src/stream/tests/stream.test.ts | 1 + packages/appkit/src/stream/types.ts | 1 + packages/appkit/src/telemetry/index.ts | 11 +- .../appkit/src/telemetry/instrumentations.ts | 1 + .../appkit/src/telemetry/telemetry-manager.ts | 1 + .../src/telemetry/telemetry-provider.ts | 1 + .../appkit/src/telemetry/tests/config.test.ts | 1 + .../telemetry/tests/plugin-telemetry.test.ts | 1 + .../tests/telemetry-interceptor.test.ts | 1 + .../telemetry/tests/telemetry-manager.test.ts | 6 +- .../appkit/src/telemetry/trace-sampler.ts | 1 + packages/appkit/src/type-generator/cache.ts | 1 + packages/appkit/src/type-generator/index.ts | 2 + .../appkit/src/type-generator/migration.ts | 2 + .../src/type-generator/mv-registry/config.ts | 1 + .../src/type-generator/query-registry.ts | 2 + .../src/type-generator/serving/cache.ts | 1 + .../src/type-generator/serving/generator.ts | 2 + .../serving/server-file-extractor.ts | 2 + .../serving/tests/cache.test.ts | 2 + .../serving/tests/converter.test.ts | 1 + .../serving/tests/fetcher.test.ts | 1 + .../serving/tests/generator.test.ts | 2 + .../tests/server-file-extractor.test.ts | 2 + .../src/type-generator/serving/vite-plugin.ts | 2 + .../src/type-generator/tests/errors.test.ts | 1 + .../src/type-generator/tests/expand.test.ts | 1 + .../src/type-generator/tests/index.test.ts | 4 +- .../type-generator/tests/migration.test.ts | 2 + .../type-generator/tests/mv-registry.test.ts | 2 + .../type-generator/tests/preflight.test.ts | 1 + .../tests/statement-result.test.ts | 2 + .../tests/sync-metric-views-types.test.ts | 2 + .../tests/unreachable-warehouse-gate.test.ts | 1 + .../type-generator/tests/vite-plugin.test.ts | 2 + .../tests/warehouse-status.test.ts | 1 + .../appkit/src/type-generator/vite-plugin.ts | 2 + .../src/utils/tests/vite-config-merge.test.ts | 1 + .../src/__tests__/credentials.test.ts | 1 + .../lakebase/src/__tests__/logger.test.ts | 1 + packages/lakebase/src/__tests__/pool.test.ts | 1 + packages/lakebase/src/config.ts | 1 + packages/lakebase/src/credentials.ts | 1 + packages/lakebase/src/index.ts | 5 +- packages/lakebase/src/pool-config.ts | 1 + packages/lakebase/src/pool.ts | 1 + packages/lakebase/src/telemetry.ts | 1 + packages/lakebase/src/token-refresh.ts | 1 + .../shared/src/cli/commands/codemod/index.ts | 1 + .../cli/commands/codemod/on-plugins-ready.ts | 1 + .../codemod/tests/on-plugins-ready.test.ts | 2 + packages/shared/src/cli/commands/docs.ts | 1 + .../src/cli/commands/doctor/bundle.test.ts | 2 + .../shared/src/cli/commands/doctor/bundle.ts | 2 + .../commands/doctor/checks-existence.test.ts | 1 + .../cli/commands/doctor/checks-wiring.test.ts | 1 + .../src/cli/commands/doctor/checks.test.ts | 1 + .../src/cli/commands/doctor/index.test.ts | 2 + .../shared/src/cli/commands/doctor/index.ts | 2 + .../src/cli/commands/doctor/report.test.ts | 3 +- .../shared/src/cli/commands/doctor/report.ts | 1 + .../commands/doctor/resolve-targets.test.ts | 2 + .../cli/commands/doctor/resolve-targets.ts | 1 + .../src/cli/commands/doctor/run.test.ts | 2 + .../shared/src/cli/commands/doctor/run.ts | 1 + .../src/cli/commands/doctor/utils.test.ts | 1 + .../src/cli/commands/generate-types.test.ts | 1 + .../shared/src/cli/commands/generate-types.ts | 2 + packages/shared/src/cli/commands/lint.test.ts | 1 + packages/shared/src/cli/commands/lint.ts | 1 + .../plugin/add-resource/add-resource.ts | 2 + .../cli/commands/plugin/create/create.test.ts | 1 + .../src/cli/commands/plugin/create/create.ts | 2 + .../commands/plugin/create/prompt-resource.ts | 1 + .../plugin/create/resource-defaults.test.ts | 1 + .../commands/plugin/create/scaffold.test.ts | 2 + .../cli/commands/plugin/create/scaffold.ts | 1 + .../shared/src/cli/commands/plugin/index.ts | 1 + .../src/cli/commands/plugin/list/list.test.ts | 2 + .../src/cli/commands/plugin/list/list.ts | 2 + .../commands/plugin/manifest-resolve.test.ts | 2 + .../commands/plugin/promote/promote.test.ts | 2 + .../cli/commands/plugin/promote/promote.ts | 2 + .../src/cli/commands/plugin/sync/sync.test.ts | 2 + .../src/cli/commands/plugin/sync/sync.ts | 2 + .../plugin/validate/validate-manifest.test.ts | 1 + .../plugin/validate/validate-manifest.ts | 1 + .../cli/commands/plugin/validate/validate.ts | 2 + .../src/cli/commands/registry/add.test.ts | 2 + .../shared/src/cli/commands/registry/add.ts | 2 + .../src/cli/commands/registry/client.test.ts | 1 + .../src/cli/commands/registry/client.ts | 1 + .../cli/commands/registry/config-plan.test.ts | 2 +- .../commands/registry/config-writer.test.ts | 3 +- .../cli/commands/registry/config-writer.ts | 2 + .../commands/registry/env-reconcile.test.ts | 1 + .../cli/commands/registry/env-reconcile.ts | 1 + .../cli/commands/registry/env-writer.test.ts | 2 + .../src/cli/commands/registry/env-writer.ts | 2 + .../shared/src/cli/commands/registry/index.ts | 1 + .../shared/src/cli/commands/registry/info.ts | 2 + .../shared/src/cli/commands/registry/list.ts | 2 + .../commands/registry/requirements.test.ts | 1 + .../src/cli/commands/registry/requirements.ts | 2 + .../commands/registry/server-register.test.ts | 2 + .../cli/commands/registry/server-register.ts | 2 + .../registry/workspace-picker.test.ts | 1 + .../cli/commands/registry/workspace-picker.ts | 1 + packages/shared/src/cli/commands/setup.ts | 1 + .../src/cli/commands/spawn-lock.test.ts | 2 + packages/shared/src/cli/index.ts | 2 + packages/shared/src/plugin.ts | 46 +- packages/shared/src/schemas/manifest.ts | 1 + .../shared/src/schemas/metric-fqn.test.ts | 1 + packages/shared/src/schemas/metric-fqn.ts | 2 +- .../src/schemas/metric-metadata-bundle.ts | 1 + .../shared/src/schemas/metric-source.test.ts | 1 + packages/shared/src/schemas/metric-source.ts | 1 + .../shared/src/sql/tests/sql-helpers.test.ts | 1 + packages/shared/src/sse/analytics.test.ts | 1 + packages/shared/src/sse/analytics.ts | 1 + packages/shared/src/workspace-client/index.ts | 8 +- .../shared/src/workspace-client/legacy.ts | 2 +- packages/shared/src/workspace-client/types.ts | 7 +- pnpm-lock.yaml | 537 ++++++++++++++---- tools/bundle-size.ts | 6 +- tools/format-generated.ts | 21 + tools/format-with-biome.ts | 22 - tools/generate-component-mdx.ts | 1 + tools/generate-json-schema.ts | 6 +- tools/generate-plugin-doc-banners.ts | 1 + tools/generate-plugin-entries.ts | 9 +- tools/generate-registry-types.ts | 5 +- tools/playground/deploy-playground.ts | 1 + .../prepared-files/client-viteconfig.ts | 1 + tools/prepare-template-artifact.ts | 2 +- tools/test-helpers.ts | 6 +- vitest.config.ts | 1 + 452 files changed, 1357 insertions(+), 566 deletions(-) create mode 100644 .oxfmtrc.json create mode 100644 .oxlintrc.json delete mode 100644 biome.json create mode 100644 tools/format-generated.ts delete mode 100644 tools/format-with-biome.ts diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 000000000..e4311a400 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,37 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "useTabs": false, + "tabWidth": 2, + "printWidth": 80, + "singleQuote": false, + "jsxSingleQuote": false, + "quoteProps": "as-needed", + "trailingComma": "all", + "semi": true, + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "sortPackageJson": false, + "sortImports": true, + "sortTailwindcss": false, + "ignorePatterns": [ + "**/*.md", + "**/*.mdx", + "**/*.html", + "**/*.yaml", + "**/*.yml", + "**/dist", + "**/tmp", + "**/*.d.ts", + "**/build", + "**/coverage", + "packages/appkit-ui/src/react/ui", + "**/routeTree.gen.ts", + "docs/.docusaurus", + "**/*.gen.css", + "**/*.gen.ts", + "**/typedoc-sidebar.ts", + "**/template", + "**/appkit-types/metric-views.ts" + ] +} diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 000000000..e45ab67fc --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,81 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": ["typescript", "react", "jsx-a11y", "unicorn", "oxc"], + "categories": { + "correctness": "error" + }, + "rules": { + "typescript/no-explicit-any": "off", + "unicorn/no-static-only-class": "off", + "react/no-danger": "off", + "typescript/no-non-null-assertion": "error", + "typescript/no-empty-object-type": "error", + "no-control-regex": "error", + "jsx-a11y/click-events-have-key-events": "error", + "jsx-a11y/no-static-element-interactions": "error", + "no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } + ], + "no-restricted-imports": [ + "error", + { + "patterns": [ + { + "group": [ + "@databricks/sdk-experimental", + "@databricks/sdk-experimental/**" + ], + "message": "Import the Databricks SDK only through the wrapper in packages/shared/src/workspace-client. Add a re-export there if you need a new symbol." + } + ] + } + ], + // Stricter than Biome's former bar; the flagged sites are pre-existing, + // working code (Biome's CI was green over them). Disabled to keep the + // tooling swap behavior-preserving. Re-enable and fix in a follow-up to + // tighten the lint bar. + "react/no-array-index-key": "off", + "react/exhaustive-deps": "off", + "no-unsafe-optional-chaining": "off", + "typescript/no-this-alias": "off", + "oxc/only-used-in-recursion": "off", + "unicorn/no-useless-fallback-in-spread": "off", + "unicorn/no-useless-spread": "off", + "unicorn/no-new-array": "off", + "unicorn/no-empty-file": "off", + "unicorn/prefer-string-starts-ends-with": "off", + "jsx-a11y/prefer-tag-over-role": "off", + "jsx-a11y/control-has-associated-label": "off" + }, + "overrides": [ + { + "files": [ + "packages/shared/src/workspace-client/**", + "packages/lakebase/**" + ], + "rules": { + "no-restricted-imports": "off" + } + } + ], + "ignorePatterns": [ + "**/dist", + "**/tmp", + "**/*.d.ts", + "**/build", + "**/coverage", + "packages/appkit-ui/src/react/ui", + "**/routeTree.gen.ts", + "docs/.docusaurus", + "**/*.gen.css", + "**/*.gen.ts", + "**/typedoc-sidebar.ts", + "**/template", + "**/appkit-types/metric-views.ts" + ] +} diff --git a/CLAUDE.md b/CLAUDE.md index 8e400e492..31e4f8a20 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -100,12 +100,12 @@ pnpm test:watch # Run tests in watch mode ### Code Quality ```bash -pnpm lint # Lint with Biome +pnpm lint # Lint with oxlint pnpm lint:fix # Lint and auto-fix -pnpm format # Format with Biome +pnpm format # Format with oxfmt pnpm format:check # Check formatting -pnpm check # Run Biome check (lint + format) -pnpm check:fix # Auto-fix with Biome +pnpm check # Run oxlint + oxfmt --check (lint + format) +pnpm check:fix # Auto-fix lint (oxlint --fix) and format (oxfmt) pnpm typecheck # TypeScript type checking across all packages ``` @@ -305,11 +305,13 @@ The frontend uses `rolldown-vite@7.1.14`, a performance-optimized Vite fork. - `@vitejs/plugin-react` - React Fast Refresh - `@tanstack/router-plugin` - File-based routing with auto code-splitting -### Formatter/Linter: Biome +### Linter: oxlint / Formatter: oxfmt -Biome is used instead of ESLint/Prettier for faster performance: +The oxc (VoidZero) toolchain is used instead of ESLint/Prettier for faster performance: +- `oxlint` for linting (config in `.oxlintrc.json`) +- `oxfmt` for formatting + import sorting (config in `.oxfmtrc.json`) - Lint-staged integration via husky -- Configured in `biome.json` (if present) +- Note: oxc does not lint/format CSS ## Working with the Monorepo diff --git a/apps/clean-app/eslint.config.js b/apps/clean-app/eslint.config.js index 17f0c8f29..2cb2bd282 100644 --- a/apps/clean-app/eslint.config.js +++ b/apps/clean-app/eslint.config.js @@ -1,7 +1,7 @@ import js from "@eslint/js"; -import { defineConfig, globalIgnores } from "eslint/config"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; +import { defineConfig, globalIgnores } from "eslint/config"; import globals from "globals"; import tseslint from "typescript-eslint"; diff --git a/apps/clean-app/src/App.tsx b/apps/clean-app/src/App.tsx index 545723691..b0c01ef70 100644 --- a/apps/clean-app/src/App.tsx +++ b/apps/clean-app/src/App.tsx @@ -1,6 +1,8 @@ -import { useState } from "react"; import viteLogo from "/vite.svg"; +import { useState } from "react"; + import reactLogo from "./assets/react.svg"; + import "./App.css"; function App() { diff --git a/apps/clean-app/src/main.tsx b/apps/clean-app/src/main.tsx index 6cfe4419f..fc32d0b3f 100644 --- a/apps/clean-app/src/main.tsx +++ b/apps/clean-app/src/main.tsx @@ -1,5 +1,6 @@ import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; + import "./index.css"; import App from "./App.tsx"; diff --git a/apps/dev-playground/client/eslint.config.js b/apps/dev-playground/client/eslint.config.js index fe3c545cb..7db4419e6 100644 --- a/apps/dev-playground/client/eslint.config.js +++ b/apps/dev-playground/client/eslint.config.js @@ -1,7 +1,7 @@ import js from "@eslint/js"; -import { defineConfig, globalIgnores } from "eslint/config"; import reactHooks from "eslint-plugin-react-hooks"; import reactRefresh from "eslint-plugin-react-refresh"; +import { defineConfig, globalIgnores } from "eslint/config"; import globals from "globals"; import tseslint from "typescript-eslint"; diff --git a/apps/dev-playground/client/src/components/analytics/databricks-logo.tsx b/apps/dev-playground/client/src/components/analytics/databricks-logo.tsx index 64cce6f32..8b45aabb6 100644 --- a/apps/dev-playground/client/src/components/analytics/databricks-logo.tsx +++ b/apps/dev-playground/client/src/components/analytics/databricks-logo.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; -import databricksLogo from "@/assets/databricks-logo.svg"; + import databricksLogoWhite from "@/assets/databricks-logo-white.svg"; +import databricksLogo from "@/assets/databricks-logo.svg"; function useDarkMode() { const [isDark, setIsDark] = useState(() => { diff --git a/apps/dev-playground/client/src/components/analytics/filter-bar.tsx b/apps/dev-playground/client/src/components/analytics/filter-bar.tsx index b63466364..901be9685 100644 --- a/apps/dev-playground/client/src/components/analytics/filter-bar.tsx +++ b/apps/dev-playground/client/src/components/analytics/filter-bar.tsx @@ -7,6 +7,7 @@ import { SelectTrigger, SelectValue, } from "@databricks/appkit-ui/react"; + import type { Aggregation, DashboardFilters } from "@/lib/types"; interface FilterBarProps { diff --git a/apps/dev-playground/client/src/components/analytics/summary-cards.tsx b/apps/dev-playground/client/src/components/analytics/summary-cards.tsx index 82f428f32..42a9cf2de 100644 --- a/apps/dev-playground/client/src/components/analytics/summary-cards.tsx +++ b/apps/dev-playground/client/src/components/analytics/summary-cards.tsx @@ -5,6 +5,7 @@ import { CardTitle, Skeleton, } from "@databricks/appkit-ui/react"; + import type { Aggregation, DashboardFilters } from "@/lib/types"; interface SummaryCardsProps { @@ -78,7 +79,8 @@ export function SummaryCards({

{metrics.forecasted > 0 && metrics.total > 0 ? `+${( - ((metrics.forecasted - metrics.total) / metrics.total) * 100 + ((metrics.forecasted - metrics.total) / metrics.total) * + 100 ).toFixed(0)}% vs current period` : "Next period"}

diff --git a/apps/dev-playground/client/src/components/analytics/untagged-apps-table.tsx b/apps/dev-playground/client/src/components/analytics/untagged-apps-table.tsx index a44569c04..0e2e83451 100644 --- a/apps/dev-playground/client/src/components/analytics/untagged-apps-table.tsx +++ b/apps/dev-playground/client/src/components/analytics/untagged-apps-table.tsx @@ -5,6 +5,7 @@ import { CardHeader, CardTitle, } from "@databricks/appkit-ui/react"; + import { AppsDataTable } from "@/components/apps-data-table"; interface UntaggedApp { diff --git a/apps/dev-playground/client/src/components/lakebase/ActivityLogsPanel.tsx b/apps/dev-playground/client/src/components/lakebase/ActivityLogsPanel.tsx index 6d64f8b77..af01507f0 100644 --- a/apps/dev-playground/client/src/components/lakebase/ActivityLogsPanel.tsx +++ b/apps/dev-playground/client/src/components/lakebase/ActivityLogsPanel.tsx @@ -10,6 +10,7 @@ import { } from "@databricks/appkit-ui/react"; import { Activity, Loader2 } from "lucide-react"; import { useId, useState } from "react"; + import { useLakebaseData, useLakebasePost } from "@/hooks/use-lakebase-data"; interface ActivityLog { diff --git a/apps/dev-playground/client/src/components/lakebase/OboProductsPanel.tsx b/apps/dev-playground/client/src/components/lakebase/OboProductsPanel.tsx index e56dacb40..87904e58b 100644 --- a/apps/dev-playground/client/src/components/lakebase/OboProductsPanel.tsx +++ b/apps/dev-playground/client/src/components/lakebase/OboProductsPanel.tsx @@ -10,6 +10,7 @@ import { } from "@databricks/appkit-ui/react"; import { Loader2, Package, ShieldCheck } from "lucide-react"; import { useId, useState } from "react"; + import { useLakebaseData, useLakebasePost } from "@/hooks/use-lakebase-data"; interface Product { diff --git a/apps/dev-playground/client/src/components/lakebase/OrdersPanel.tsx b/apps/dev-playground/client/src/components/lakebase/OrdersPanel.tsx index 8d82e4958..72eb908d5 100644 --- a/apps/dev-playground/client/src/components/lakebase/OrdersPanel.tsx +++ b/apps/dev-playground/client/src/components/lakebase/OrdersPanel.tsx @@ -17,6 +17,7 @@ import { Truck, } from "lucide-react"; import { useId, useState } from "react"; + import { useLakebaseData, useLakebasePatch, diff --git a/apps/dev-playground/client/src/components/lakebase/TasksPanel.tsx b/apps/dev-playground/client/src/components/lakebase/TasksPanel.tsx index 9eb8c6572..355878a04 100644 --- a/apps/dev-playground/client/src/components/lakebase/TasksPanel.tsx +++ b/apps/dev-playground/client/src/components/lakebase/TasksPanel.tsx @@ -11,6 +11,7 @@ import { } from "@databricks/appkit-ui/react"; import { CheckCircle, Circle, ListTodo, Loader2 } from "lucide-react"; import { useId, useState } from "react"; + import { useLakebaseData, useLakebasePatch, diff --git a/apps/dev-playground/client/src/components/reconnect/connection-status.tsx b/apps/dev-playground/client/src/components/reconnect/connection-status.tsx index 7187d5aac..e50222993 100644 --- a/apps/dev-playground/client/src/components/reconnect/connection-status.tsx +++ b/apps/dev-playground/client/src/components/reconnect/connection-status.tsx @@ -7,6 +7,7 @@ import { TooltipTrigger, } from "@databricks/appkit-ui/react"; import { InfoIcon } from "lucide-react"; + import { Timeline } from "./timeline"; import { getStatusBadgeStyle } from "./utils"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/actionable-card.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/actionable-card.tsx index db6a42f5f..a576f0eec 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/actionable-card.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/actionable-card.tsx @@ -9,6 +9,7 @@ import { MapPinIcon, MessageSquareIcon, } from "lucide-react"; + import type { FeedAction } from "../lib/feed-actions"; type Variant = "insight" | "anomaly"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/active-filters.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/active-filters.tsx index f5fe96a2a..3fa5f5896 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/active-filters.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/active-filters.tsx @@ -1,4 +1,5 @@ import { FilterIcon, XIcon } from "lucide-react"; + import type { DashboardFilters } from "../hooks/use-dashboard-data"; interface ActiveFiltersProps { diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/agent-sidebar.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/agent-sidebar.tsx index 0c14b501c..02ffba5bc 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/agent-sidebar.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/agent-sidebar.tsx @@ -1,5 +1,6 @@ import { BrainIcon, Loader2Icon, RefreshCwIcon } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; + import type { Highlight } from "../hooks/use-action-dispatcher"; import { useAgentStream } from "../hooks/use-agent-stream"; import type { DashboardFilters, KPIData } from "../hooks/use-dashboard-data"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/approval-card.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/approval-card.tsx index 47f24b338..e13d47d1b 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/approval-card.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/approval-card.tsx @@ -5,6 +5,7 @@ import { ShieldAlertIcon, } from "lucide-react"; import { useCallback, useState } from "react"; + import type { Highlight } from "../hooks/use-action-dispatcher"; import type { DashboardFilters } from "../hooks/use-dashboard-data"; import { captureDashboardAsDataUrl } from "../lib/capture-dashboard"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/chat-drawer.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/chat-drawer.tsx index 559f5950d..e10961abd 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/chat-drawer.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/chat-drawer.tsx @@ -7,6 +7,7 @@ import { XIcon, } from "lucide-react"; import { useCallback, useEffect, useRef, useState } from "react"; + import type { PendingApproval } from "./approval-card"; export interface ChatMessage { @@ -86,7 +87,6 @@ export function ChatDrawer({ if (pendingApprovals.length > 0) onOpenChange(true); }, [pendingApprovals.length, onOpenChange]); - // biome-ignore lint/correctness/useExhaustiveDependencies: scroll on new messages useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: "smooth" }); }, [messages.length, messages[messages.length - 1]?.content]); diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/fare-chart.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/fare-chart.tsx index 383174aec..e82b2d4ca 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/fare-chart.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/fare-chart.tsx @@ -7,6 +7,7 @@ import { XAxis, YAxis, } from "recharts"; + import { useChartColors } from "../hooks/use-chart-colors"; import type { FareBucket } from "../hooks/use-dashboard-data"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/focusable-chart.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/focusable-chart.tsx index 689145a4b..974dcf809 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/focusable-chart.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/focusable-chart.tsx @@ -1,4 +1,5 @@ import type { ReactNode } from "react"; + import { type FocusableChartId, useFocusable, diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/hourly-heatmap.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/hourly-heatmap.tsx index 51ce98ed8..2866ab09a 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/hourly-heatmap.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/hourly-heatmap.tsx @@ -1,4 +1,5 @@ import { useMemo } from "react"; + import type { HeatmapCell } from "../hooks/use-dashboard-data"; interface HourlyHeatmapProps { diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/inspector-toggle.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/inspector-toggle.tsx index 4a0388b6b..2c84d9211 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/inspector-toggle.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/inspector-toggle.tsx @@ -1,4 +1,5 @@ import { ActivityIcon } from "lucide-react"; + import { toggleInspector, useStreamInspector, diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/kpi-cards.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/kpi-cards.tsx index 8d6ddd843..07677d98d 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/kpi-cards.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/kpi-cards.tsx @@ -1,5 +1,6 @@ import { CarIcon, DollarSignIcon, MapPinIcon, RulerIcon } from "lucide-react"; import { useId, useMemo } from "react"; + import { useChartColors } from "../hooks/use-chart-colors"; import type { KPIData, SparklineRow } from "../hooks/use-dashboard-data"; diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/saved-views-panel.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/saved-views-panel.tsx index b1eb184bf..e39718b7b 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/saved-views-panel.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/saved-views-panel.tsx @@ -59,10 +59,9 @@ export function SavedViewsPanel({ }, []); // Load on mount + whenever the parent bumps refreshToken. The dep on - // refreshToken is intentional — biome flags it because it's an opaque - // number with no direct read inside the effect body, but the whole - // point is that changing it in the parent invalidates the cached list. - // biome-ignore lint/correctness/useExhaustiveDependencies: see above + // refreshToken is intentional — it's an opaque number with no direct + // read inside the effect body, but the whole point is that changing it + // in the parent invalidates the cached list. useEffect(() => { load(); }, [load, refreshToken]); diff --git a/apps/dev-playground/client/src/features/smart-dashboard/components/stream-inspector.tsx b/apps/dev-playground/client/src/features/smart-dashboard/components/stream-inspector.tsx index adf15dccc..3231a8779 100644 --- a/apps/dev-playground/client/src/features/smart-dashboard/components/stream-inspector.tsx +++ b/apps/dev-playground/client/src/features/smart-dashboard/components/stream-inspector.tsx @@ -1,5 +1,6 @@ import { ChevronDownIcon, ChevronRightIcon, XIcon } from "lucide-react"; import { useMemo, useState } from "react"; + import { clearInspectorHistory, closeInspector, @@ -178,8 +179,7 @@ export function StreamInspector() { return ( <> - {/* biome-ignore lint/a11y/noStaticElementInteractions: backdrop dismiss */} - {/* biome-ignore lint/a11y/useKeyWithClickEvents: backdrop dismiss handled globally via Esc */} + {/* oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- backdrop dismiss handled globally via Esc */}
{ messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }); }, [messages]); diff --git a/apps/dev-playground/client/src/routes/ai-search.route.tsx b/apps/dev-playground/client/src/routes/ai-search.route.tsx index b64874167..23a2f857b 100644 --- a/apps/dev-playground/client/src/routes/ai-search.route.tsx +++ b/apps/dev-playground/client/src/routes/ai-search.route.tsx @@ -10,6 +10,7 @@ import { useAiSearchQuery } from "@databricks/appkit-ui/react/beta"; import { createFileRoute } from "@tanstack/react-router"; import { Search } from "lucide-react"; import { useState } from "react"; + import { Header } from "@/components/layout/header"; export const Route = createFileRoute("/ai-search")({ diff --git a/apps/dev-playground/client/src/routes/analytics.route.tsx b/apps/dev-playground/client/src/routes/analytics.route.tsx index d1833107e..61cc41d24 100644 --- a/apps/dev-playground/client/src/routes/analytics.route.tsx +++ b/apps/dev-playground/client/src/routes/analytics.route.tsx @@ -1,6 +1,7 @@ import { useAnalyticsQuery } from "@databricks/appkit-ui/react"; import { createFileRoute, retainSearchParams } from "@tanstack/react-router"; import { useMemo, useState } from "react"; + import { AnalyticsHeader, FilterBar, diff --git a/apps/dev-playground/client/src/routes/arrow-analytics.route.tsx b/apps/dev-playground/client/src/routes/arrow-analytics.route.tsx index 081c83741..803e4fbb4 100644 --- a/apps/dev-playground/client/src/routes/arrow-analytics.route.tsx +++ b/apps/dev-playground/client/src/routes/arrow-analytics.route.tsx @@ -13,6 +13,7 @@ import { PieChart, } from "@databricks/appkit-ui/react"; import { createFileRoute, retainSearchParams } from "@tanstack/react-router"; + import { AnalyticsHeader } from "@/components/analytics"; export const Route = createFileRoute("/arrow-analytics")({ diff --git a/apps/dev-playground/client/src/routes/data-visualization.route.tsx b/apps/dev-playground/client/src/routes/data-visualization.route.tsx index da951da73..9500fb9c9 100644 --- a/apps/dev-playground/client/src/routes/data-visualization.route.tsx +++ b/apps/dev-playground/client/src/routes/data-visualization.route.tsx @@ -16,6 +16,7 @@ import { import { createFileRoute } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { codeToHtml } from "shiki"; + import { Header } from "@/components/layout/header"; export const Route = createFileRoute("/data-visualization")({ diff --git a/apps/dev-playground/client/src/routes/index.tsx b/apps/dev-playground/client/src/routes/index.tsx index 6114c477a..0c36344ed 100644 --- a/apps/dev-playground/client/src/routes/index.tsx +++ b/apps/dev-playground/client/src/routes/index.tsx @@ -5,6 +5,7 @@ import { retainSearchParams, } from "@tanstack/react-router"; import { ArrowRightIcon, SparklesIcon } from "lucide-react"; + import { ThemeSelector } from "@/components/theme-selector"; import { ALL_NAV_ITEMS, NAV_GROUPS, type NavItem } from "@/lib/nav"; diff --git a/apps/dev-playground/client/src/routes/lakebase.route.tsx b/apps/dev-playground/client/src/routes/lakebase.route.tsx index 9ea8117e6..3d2eed56b 100644 --- a/apps/dev-playground/client/src/routes/lakebase.route.tsx +++ b/apps/dev-playground/client/src/routes/lakebase.route.tsx @@ -5,6 +5,7 @@ import { TabsTrigger, } from "@databricks/appkit-ui/react"; import { createFileRoute, retainSearchParams } from "@tanstack/react-router"; + import { ActivityLogsPanel, OboProductsPanel, diff --git a/apps/dev-playground/client/src/routes/metric-views.route.tsx b/apps/dev-playground/client/src/routes/metric-views.route.tsx index f0a28f42a..ac83ce713 100644 --- a/apps/dev-playground/client/src/routes/metric-views.route.tsx +++ b/apps/dev-playground/client/src/routes/metric-views.route.tsx @@ -33,6 +33,7 @@ import { import { createFileRoute } from "@tanstack/react-router"; import { FilterIcon } from "lucide-react"; import { useCallback, useMemo, useState } from "react"; + import { Header } from "@/components/layout/header"; export const Route = createFileRoute("/metric-views")({ diff --git a/apps/dev-playground/client/src/routes/reconnect.route.tsx b/apps/dev-playground/client/src/routes/reconnect.route.tsx index 876c09bcb..bae6473c2 100644 --- a/apps/dev-playground/client/src/routes/reconnect.route.tsx +++ b/apps/dev-playground/client/src/routes/reconnect.route.tsx @@ -1,5 +1,6 @@ import { createFileRoute, retainSearchParams } from "@tanstack/react-router"; import { useState } from "react"; + import { Header } from "@/components/layout/header"; import { ConnectionStatus, diff --git a/apps/dev-playground/client/src/routes/smart-dashboard.route.tsx b/apps/dev-playground/client/src/routes/smart-dashboard.route.tsx index 3817d70f9..fa36eca9b 100644 --- a/apps/dev-playground/client/src/routes/smart-dashboard.route.tsx +++ b/apps/dev-playground/client/src/routes/smart-dashboard.route.tsx @@ -1,6 +1,7 @@ import { createFileRoute } from "@tanstack/react-router"; import { LayoutDashboardIcon } from "lucide-react"; import { useCallback, useMemo, useRef, useState } from "react"; + import { ActionToast } from "@/features/smart-dashboard/components/action-toast"; import { ActiveFilters } from "@/features/smart-dashboard/components/active-filters"; import { AgentSidebar } from "@/features/smart-dashboard/components/agent-sidebar"; diff --git a/apps/dev-playground/client/src/routes/type-safety.route.tsx b/apps/dev-playground/client/src/routes/type-safety.route.tsx index 6962d5d51..115235a9d 100644 --- a/apps/dev-playground/client/src/routes/type-safety.route.tsx +++ b/apps/dev-playground/client/src/routes/type-safety.route.tsx @@ -9,6 +9,7 @@ import { import { createFileRoute, retainSearchParams } from "@tanstack/react-router"; import { useEffect, useState } from "react"; import { codeToHtml } from "shiki"; + import { Header } from "@/components/layout/header"; export const Route = createFileRoute("/type-safety")({ diff --git a/apps/dev-playground/client/tailwind.config.ts b/apps/dev-playground/client/tailwind.config.ts index fad89bf65..03a94ce79 100644 --- a/apps/dev-playground/client/tailwind.config.ts +++ b/apps/dev-playground/client/tailwind.config.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import type { Config } from "tailwindcss"; export default { diff --git a/apps/dev-playground/client/vite.config.ts b/apps/dev-playground/client/vite.config.ts index f892c62f9..43b528a2b 100644 --- a/apps/dev-playground/client/vite.config.ts +++ b/apps/dev-playground/client/vite.config.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import { tanstackRouter } from "@tanstack/router-plugin/vite"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; diff --git a/apps/dev-playground/server/index.ts b/apps/dev-playground/server/index.ts index b30c51684..0435fad4e 100644 --- a/apps/dev-playground/server/index.ts +++ b/apps/dev-playground/server/index.ts @@ -21,6 +21,7 @@ import { tool, } from "@databricks/appkit/beta"; import { z } from "zod"; + import { lakebaseExamples } from "./lakebase-examples-plugin"; import { reconnect } from "./reconnect-plugin"; import { telemetryExamples } from "./telemetry-example-plugin"; diff --git a/apps/dev-playground/server/lakebase-examples-plugin.ts b/apps/dev-playground/server/lakebase-examples-plugin.ts index 57533af4a..bf72973be 100644 --- a/apps/dev-playground/server/lakebase-examples-plugin.ts +++ b/apps/dev-playground/server/lakebase-examples-plugin.ts @@ -5,6 +5,7 @@ import { toPlugin, } from "@databricks/appkit"; import type { IAppRouter } from "shared"; + import * as drizzleExample from "./lakebase-examples/drizzle-example"; import * as rawExample from "./lakebase-examples/raw-driver-example"; import * as sequelizeExample from "./lakebase-examples/sequelize-example"; diff --git a/apps/dev-playground/server/lakebase-examples/sequelize-example.ts b/apps/dev-playground/server/lakebase-examples/sequelize-example.ts index 8792c99c0..07b25929d 100644 --- a/apps/dev-playground/server/lakebase-examples/sequelize-example.ts +++ b/apps/dev-playground/server/lakebase-examples/sequelize-example.ts @@ -24,8 +24,12 @@ interface OrderAttributes { updatedAt: Date; } -interface OrderCreationAttributes - extends Omit {} +// oxlint-disable typescript/no-empty-object-type -- Sequelize creation-attributes interface; empty by design +interface OrderCreationAttributes extends Omit< + OrderAttributes, + "id" | "createdAt" | "updatedAt" +> {} +// oxlint-enable typescript/no-empty-object-type class Order extends Model diff --git a/apps/dev-playground/tests/arrow-analytics.spec.ts b/apps/dev-playground/tests/arrow-analytics.spec.ts index 408c7517e..20e28209b 100644 --- a/apps/dev-playground/tests/arrow-analytics.spec.ts +++ b/apps/dev-playground/tests/arrow-analytics.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from "@playwright/test"; + import { STRICT_MODE_MULTIPLIER, setupMockAPI, diff --git a/apps/dev-playground/tests/data-visualization.spec.ts b/apps/dev-playground/tests/data-visualization.spec.ts index 55d1f4b60..85373bb0e 100644 --- a/apps/dev-playground/tests/data-visualization.spec.ts +++ b/apps/dev-playground/tests/data-visualization.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from "@playwright/test"; + import { STRICT_MODE_MULTIPLIER, setupMockAPI, diff --git a/apps/dev-playground/tests/reconnect.spec.ts b/apps/dev-playground/tests/reconnect.spec.ts index f9a547cc4..3177330b0 100644 --- a/apps/dev-playground/tests/reconnect.spec.ts +++ b/apps/dev-playground/tests/reconnect.spec.ts @@ -1,4 +1,5 @@ import { expect, type Page, test } from "@playwright/test"; + import { setupMockAPI } from "./utils/test-utils"; test.describe("Reconnect Route Tests", () => { diff --git a/apps/dev-playground/tests/sql-helpers.spec.ts b/apps/dev-playground/tests/sql-helpers.spec.ts index 7388d744f..dfa753d55 100644 --- a/apps/dev-playground/tests/sql-helpers.spec.ts +++ b/apps/dev-playground/tests/sql-helpers.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from "@playwright/test"; + import { mockAnalyticsData } from "./utils/mock-data"; import { setupMockAPI } from "./utils/test-utils"; diff --git a/apps/dev-playground/tests/telemetry.spec.ts b/apps/dev-playground/tests/telemetry.spec.ts index 90bd91b33..4cf29de86 100644 --- a/apps/dev-playground/tests/telemetry.spec.ts +++ b/apps/dev-playground/tests/telemetry.spec.ts @@ -1,4 +1,5 @@ import { expect, test } from "@playwright/test"; + import { setupMockAPI, trackApiCalls } from "./utils/test-utils"; test.describe("Telemetry Route Tests", () => { diff --git a/apps/dev-playground/tests/utils/test-utils.ts b/apps/dev-playground/tests/utils/test-utils.ts index f608a0e07..7026a260c 100644 --- a/apps/dev-playground/tests/utils/test-utils.ts +++ b/apps/dev-playground/tests/utils/test-utils.ts @@ -1,5 +1,6 @@ import type { Page, Request } from "@playwright/test"; import { tableFromJSON, tableToIPC } from "apache-arrow"; + import { mockAnalyticsData, mockReconnectMessages, diff --git a/biome.json b/biome.json deleted file mode 100644 index d0e60cae8..000000000 --- a/biome.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.2.6/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": true, - "includes": [ - "**", - "!**/dist", - "!**/tmp", - "!**/*.d.ts", - "!**/build", - "!**/coverage", - "!packages/appkit-ui/src/react/ui", - "!**/routeTree.gen.ts", - "!docs/.docusaurus", - "!**/*.gen.css", - "!**/*.gen.ts", - "!**/typedoc-sidebar.ts", - "!**/template", - "!**/appkit-types/metric-views.ts" - ] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2 - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "complexity": { - "noStaticOnlyClass": "off" - }, - "suspicious": { - "noExplicitAny": "off", - "noUnknownAtRules": "off" - }, - "security": { - "noDangerouslySetInnerHtml": "off" - }, - "style": { - "noRestrictedImports": { - "level": "error", - "options": { - "patterns": [ - { - "group": [ - "@databricks/sdk-experimental", - "@databricks/sdk-experimental/**" - ], - "message": "Import the Databricks SDK only through the wrapper in packages/shared/src/workspace-client. Add a re-export there if you need a new symbol." - } - ] - } - } - } - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - }, - "overrides": [ - { - "includes": [ - "packages/shared/src/workspace-client/**", - "packages/lakebase/**" - ], - "linter": { - "rules": { - "style": { - "noRestrictedImports": "off" - } - } - } - } - ] -} diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 9a890662c..1717a834e 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -1,5 +1,6 @@ import { builtinModules } from "node:module"; import path from "node:path"; + import type * as Preset from "@docusaurus/preset-classic"; import type { Config } from "@docusaurus/types"; import type { PluginOptions } from "@signalwire/docusaurus-plugin-llms-txt/public"; diff --git a/docs/scripts/build-appkit-ui-styles.ts b/docs/scripts/build-appkit-ui-styles.ts index 432d6ac73..1ff478221 100644 --- a/docs/scripts/build-appkit-ui-styles.ts +++ b/docs/scripts/build-appkit-ui-styles.ts @@ -1,6 +1,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises"; import { dirname, resolve } from "node:path"; import { fileURLToPath } from "node:url"; + import tailwindcss from "@tailwindcss/postcss"; import postcss from "postcss"; diff --git a/docs/sidebars.ts b/docs/sidebars.ts index 1dd673a37..3db679e58 100644 --- a/docs/sidebars.ts +++ b/docs/sidebars.ts @@ -1,4 +1,5 @@ import type { SidebarsConfig } from "@docusaurus/plugin-content-docs"; + import typedocSidebar from "./docs/api/appkit/typedoc-sidebar"; // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) diff --git a/docs/src/components/DocExample/IframePreview.tsx b/docs/src/components/DocExample/IframePreview.tsx index 817053c68..c5f85082b 100644 --- a/docs/src/components/DocExample/IframePreview.tsx +++ b/docs/src/components/DocExample/IframePreview.tsx @@ -3,6 +3,7 @@ import type React from "react"; import { type RefObject, useEffect, useRef, useState } from "react"; import { createPortal } from "react-dom"; import { Toaster } from "sonner"; + import { PortalContainerProvider } from "../../../../packages/appkit-ui/src/react/portal-container-context"; // Timing constants for delays and retries diff --git a/docs/src/components/DocExample/index.tsx b/docs/src/components/DocExample/index.tsx index 2b23eb3f9..03f2ed189 100644 --- a/docs/src/components/DocExample/index.tsx +++ b/docs/src/components/DocExample/index.tsx @@ -1,4 +1,5 @@ import CodeBlock from "@theme/CodeBlock"; + import { type AppKitExampleKey, examples } from "./examples.gen"; import { IframePreview } from "./IframePreview"; diff --git a/docs/src/components/HomepageFeatures/index.tsx b/docs/src/components/HomepageFeatures/index.tsx index 7787cd16b..3bfb4bdc5 100644 --- a/docs/src/components/HomepageFeatures/index.tsx +++ b/docs/src/components/HomepageFeatures/index.tsx @@ -1,10 +1,12 @@ import Heading from "@theme/Heading"; import clsx from "clsx"; import type { ReactNode } from "react"; + import CodeIcon from "./icons/code.svg"; import LayersIcon from "./icons/layers.svg"; import PuzzleIcon from "./icons/puzzle.svg"; import SparklesIcon from "./icons/sparkles.svg"; + import styles from "./styles.module.css"; type FeatureItem = { diff --git a/package.json b/package.json index 0d4b86314..da8c1388e 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "size:compare": "tsx tools/bundle-size.ts --compare", "sync:template": "appkit plugin sync --write --silent --plugins-dir packages/appkit/src/plugins --output template/appkit.plugins.json --require-plugins server", "build:watch": "pnpm -r --filter=!dev-playground --filter=!docs build:watch", - "check:fix": "biome check --write .", - "check": "biome check .", + "check:fix": "oxlint --fix && oxfmt", + "check": "oxlint && oxfmt --check", "generate:types": "tsx tools/generate-json-schema.ts && tsx tools/generate-registry-types.ts && tsx tools/generate-plugin-entries.ts && tsx tools/generate-plugin-doc-banners.ts", "generate:plugin-entries": "tsx tools/generate-plugin-entries.ts", "generate:plugin-doc-banners": "tsx tools/generate-plugin-doc-banners.ts", @@ -28,14 +28,14 @@ "docs:build": "pnpm --filter=docs build", "docs:serve": "pnpm --filter=docs serve", "docs:clean": "pnpm --filter=docs clean", - "docs:check:fix": "biome check --write docs/", - "docs:check": "biome check docs/", - "docs:format": "biome format docs/", - "docs:lint": "biome lint docs/", - "format:check": "biome format .", - "format": "biome format --write .", - "lint:fix": "biome lint --write .", - "lint": "biome lint .", + "docs:check:fix": "oxlint docs/ --fix && oxfmt docs/", + "docs:check": "oxlint docs/ && oxfmt --check docs/", + "docs:format": "oxfmt docs/", + "docs:lint": "oxlint docs/", + "format:check": "oxfmt --check", + "format": "oxfmt", + "lint:fix": "oxlint --fix", + "lint": "oxlint", "pack:sdk": "pnpm build && pnpm --filter=docs build && pnpm -r tarball", "pack:prerelease": "pnpm build && pnpm --filter=docs build && pnpm -r --filter='@databricks/*' tarball:prerelease", "prepare": "husky", @@ -50,13 +50,16 @@ "knip:fix": "knip --fix" }, "lint-staged": { - "(*.ts|*.tsx|*.js|*.jsx|*.json|*.md|*.yml|*.yaml|*.css)": [ - "biome check --write --no-errors-on-unmatched" + "*.{ts,tsx,js,jsx}": [ + "oxlint --fix", + "oxfmt --write" + ], + "*.json": [ + "oxfmt --write" ] }, "devDependencies": { "@arethetypeswrong/core": "0.18.4", - "@biomejs/biome": "2.2.6", "@commitlint/cli": "19.8.1", "@commitlint/config-conventional": "19.8.1", "@cyclonedx/cdxgen": "12.1.2", @@ -70,6 +73,8 @@ "jsdom": "27.0.0", "knip": "5.86.0", "lint-staged": "15.5.2", + "oxfmt": "0.62.0", + "oxlint": "1.77.0", "publint": "0.3.15", "release-it": "19.2.0", "tsdown": "0.20.3", diff --git a/packages/appkit-ui/src/js/arrow/arrow-client.test.ts b/packages/appkit-ui/src/js/arrow/arrow-client.test.ts index 8f9771f04..d2d83b93a 100644 --- a/packages/appkit-ui/src/js/arrow/arrow-client.test.ts +++ b/packages/appkit-ui/src/js/arrow/arrow-client.test.ts @@ -1,5 +1,6 @@ import { Table, tableToIPC, Utf8, vectorFromArray } from "apache-arrow"; import { describe, expect, test } from "vitest"; + import { ArrowClient } from "./arrow-client"; /** Build an Arrow IPC stream (2 cols, 2 rows) with the given field names. */ diff --git a/packages/appkit-ui/src/js/arrow/arrow-client.ts b/packages/appkit-ui/src/js/arrow/arrow-client.ts index 4554243f3..b2a4dc90d 100644 --- a/packages/appkit-ui/src/js/arrow/arrow-client.ts +++ b/packages/appkit-ui/src/js/arrow/arrow-client.ts @@ -1,4 +1,5 @@ import type { Field, Table, Vector } from "apache-arrow"; + import { DATE_FIELD_PATTERNS, METADATA_DATE_PATTERNS, diff --git a/packages/appkit-ui/src/js/config.test.ts b/packages/appkit-ui/src/js/config.test.ts index f9441bd2d..6f1f5e7b7 100644 --- a/packages/appkit-ui/src/js/config.test.ts +++ b/packages/appkit-ui/src/js/config.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import { _resetConfigCache, getClientConfig, diff --git a/packages/appkit-ui/src/js/format/index.test.ts b/packages/appkit-ui/src/js/format/index.test.ts index 0bdfaa365..96bf68ad5 100644 --- a/packages/appkit-ui/src/js/format/index.test.ts +++ b/packages/appkit-ui/src/js/format/index.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { formatLabel, formatValue, toD3Format } from "./index"; describe("js/format formatValue", () => { diff --git a/packages/appkit-ui/src/js/metric-filter/index.test.ts b/packages/appkit-ui/src/js/metric-filter/index.test.ts index 767c680b7..4cef6c820 100644 --- a/packages/appkit-ui/src/js/metric-filter/index.test.ts +++ b/packages/appkit-ui/src/js/metric-filter/index.test.ts @@ -6,6 +6,7 @@ import type { MetricPredicate as SharedMetricPredicate, } from "shared"; import { describe, expect, expectTypeOf, test } from "vitest"; + import { type MetricFilter, type MetricFilterOperatorName, diff --git a/packages/appkit-ui/src/react/charts/__tests__/base.test.tsx b/packages/appkit-ui/src/react/charts/__tests__/base.test.tsx index 77978d3cb..06439bee2 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/base.test.tsx +++ b/packages/appkit-ui/src/react/charts/__tests__/base.test.tsx @@ -20,6 +20,7 @@ import { test, vi, } from "vitest"; + import { BaseChart } from "../base"; import type { ChartType } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/__tests__/normalize.test.ts b/packages/appkit-ui/src/react/charts/__tests__/normalize.test.ts index fac3909dd..505265015 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/normalize.test.ts +++ b/packages/appkit-ui/src/react/charts/__tests__/normalize.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { normalizeChartData, normalizeHeatmapData } from "../normalize"; describe("normalizeChartData", () => { diff --git a/packages/appkit-ui/src/react/charts/__tests__/options.test.ts b/packages/appkit-ui/src/react/charts/__tests__/options.test.ts index c37de285f..f111a977d 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/options.test.ts +++ b/packages/appkit-ui/src/react/charts/__tests__/options.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { FALLBACK_UI_TOKENS } from "../constants"; import { applySelectionEmphasis, diff --git a/packages/appkit-ui/src/react/charts/__tests__/theme.test.ts b/packages/appkit-ui/src/react/charts/__tests__/theme.test.ts index e1ae91ffb..6e79eacda 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/theme.test.ts +++ b/packages/appkit-ui/src/react/charts/__tests__/theme.test.ts @@ -1,5 +1,6 @@ import { act, renderHook } from "@testing-library/react"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, diff --git a/packages/appkit-ui/src/react/charts/__tests__/types.test.ts b/packages/appkit-ui/src/react/charts/__tests__/types.test.ts index d6685ce01..b317110af 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/types.test.ts +++ b/packages/appkit-ui/src/react/charts/__tests__/types.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { isArrowTable, isDataProps, isQueryProps } from "../types"; describe("isArrowTable", () => { diff --git a/packages/appkit-ui/src/react/charts/__tests__/utils.test.ts b/packages/appkit-ui/src/react/charts/__tests__/utils.test.ts index fd85c38d4..26518524c 100644 --- a/packages/appkit-ui/src/react/charts/__tests__/utils.test.ts +++ b/packages/appkit-ui/src/react/charts/__tests__/utils.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { createTimeSeriesData, escapeHtml, diff --git a/packages/appkit-ui/src/react/charts/area/index.tsx b/packages/appkit-ui/src/react/charts/area/index.tsx index 9d2dbbcab..f47f4945a 100644 --- a/packages/appkit-ui/src/react/charts/area/index.tsx +++ b/packages/appkit-ui/src/react/charts/area/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { AreaChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/bar/index.tsx b/packages/appkit-ui/src/react/charts/bar/index.tsx index 27bc95456..58b45d306 100644 --- a/packages/appkit-ui/src/react/charts/bar/index.tsx +++ b/packages/appkit-ui/src/react/charts/bar/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { BarChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/base.tsx b/packages/appkit-ui/src/react/charts/base.tsx index 6306d2375..814fd4b67 100644 --- a/packages/appkit-ui/src/react/charts/base.tsx +++ b/packages/appkit-ui/src/react/charts/base.tsx @@ -1,6 +1,13 @@ // Type-only import: erased at compile time, does not pull the full echarts // bundle in. The `ECharts` type is used for the stored ECharts instance ref. import type { ECharts } from "echarts"; +// Import the ESM core build, not `echarts-for-react/lib/core` (CJS). The package +// has no `exports` map, so `/lib/core` resolves to the literal CommonJS file +// whose default export is `module.exports`; under ESM default-import interop a +// consumer's bundler hands back the whole `{ default, __esModule }` object rather +// than the component, so `` renders an object and React throws +// "Element type is invalid". `esm/core` is real ESM with a true `export default`. +import ReactEChartsCore from "echarts-for-react/esm/core"; import { BarChart, HeatmapChart, @@ -19,14 +26,8 @@ import { import * as echarts from "echarts/core"; import { LegacyGridContainLabel } from "echarts/features"; import { CanvasRenderer } from "echarts/renderers"; -// Import the ESM core build, not `echarts-for-react/lib/core` (CJS). The package -// has no `exports` map, so `/lib/core` resolves to the literal CommonJS file -// whose default export is `module.exports`; under ESM default-import interop a -// consumer's bundler hands back the whole `{ default, __esModule }` object rather -// than the component, so `` renders an object and React throws -// "Element type is invalid". `esm/core` is real ESM with a true `export default`. -import ReactEChartsCore from "echarts-for-react/esm/core"; import { useCallback, useMemo, useRef } from "react"; + import { normalizeChartData, normalizeHeatmapData } from "./normalize"; import { applySelectionEmphasis, diff --git a/packages/appkit-ui/src/react/charts/heatmap/index.tsx b/packages/appkit-ui/src/react/charts/heatmap/index.tsx index 62bcb8004..f0c9ed525 100644 --- a/packages/appkit-ui/src/react/charts/heatmap/index.tsx +++ b/packages/appkit-ui/src/react/charts/heatmap/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { HeatmapChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/index.ts b/packages/appkit-ui/src/react/charts/index.ts index 69bf32f99..589a9cd90 100644 --- a/packages/appkit-ui/src/react/charts/index.ts +++ b/packages/appkit-ui/src/react/charts/index.ts @@ -61,11 +61,7 @@ export { // Theme Hooks // ============================================================================ -export { - useAllThemeColors, - useChartUITokens, - useThemeColors, -} from "./theme"; +export { useAllThemeColors, useChartUITokens, useThemeColors } from "./theme"; // ============================================================================ // Utilities diff --git a/packages/appkit-ui/src/react/charts/line/index.tsx b/packages/appkit-ui/src/react/charts/line/index.tsx index 166fb0276..1ef44c082 100644 --- a/packages/appkit-ui/src/react/charts/line/index.tsx +++ b/packages/appkit-ui/src/react/charts/line/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { LineChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/normalize.ts b/packages/appkit-ui/src/react/charts/normalize.ts index 731ce193b..93c624c18 100644 --- a/packages/appkit-ui/src/react/charts/normalize.ts +++ b/packages/appkit-ui/src/react/charts/normalize.ts @@ -1,5 +1,7 @@ import type { Table } from "apache-arrow"; + import { ArrowClient } from "@/js"; + import { DATE_FIELD_PATTERNS, NAME_FIELD_PATTERNS } from "./constants"; import type { ChartData, diff --git a/packages/appkit-ui/src/react/charts/pie/index.tsx b/packages/appkit-ui/src/react/charts/pie/index.tsx index d49bb8bec..828b40a21 100644 --- a/packages/appkit-ui/src/react/charts/pie/index.tsx +++ b/packages/appkit-ui/src/react/charts/pie/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { DonutChartProps, PieChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/radar/index.tsx b/packages/appkit-ui/src/react/charts/radar/index.tsx index d48cb4227..3a2c8d8d8 100644 --- a/packages/appkit-ui/src/react/charts/radar/index.tsx +++ b/packages/appkit-ui/src/react/charts/radar/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { RadarChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/scatter/index.tsx b/packages/appkit-ui/src/react/charts/scatter/index.tsx index 288e49e75..363e8dcad 100644 --- a/packages/appkit-ui/src/react/charts/scatter/index.tsx +++ b/packages/appkit-ui/src/react/charts/scatter/index.tsx @@ -1,4 +1,5 @@ import type { JSX } from "react"; + import { createChart } from "../create-chart"; import type { ScatterChartProps } from "../types"; diff --git a/packages/appkit-ui/src/react/charts/theme.ts b/packages/appkit-ui/src/react/charts/theme.ts index dfc32154f..1572c434c 100644 --- a/packages/appkit-ui/src/react/charts/theme.ts +++ b/packages/appkit-ui/src/react/charts/theme.ts @@ -1,4 +1,5 @@ import { useCallback, useEffect, useRef, useState } from "react"; + import { CHART_COLOR_VARS_CATEGORICAL, CHART_COLOR_VARS_DIVERGING, diff --git a/packages/appkit-ui/src/react/charts/wrapper.tsx b/packages/appkit-ui/src/react/charts/wrapper.tsx index ed4408add..ead715c6c 100644 --- a/packages/appkit-ui/src/react/charts/wrapper.tsx +++ b/packages/appkit-ui/src/react/charts/wrapper.tsx @@ -1,4 +1,5 @@ import type { ReactNode } from "react"; + import type { WarehouseStatus } from "../hooks/types"; import { useChartData } from "../hooks/use-chart-data"; import { ChartErrorBoundary } from "./chart-error-boundary"; diff --git a/packages/appkit-ui/src/react/file-browser/directory-list.tsx b/packages/appkit-ui/src/react/file-browser/directory-list.tsx index a9a22762d..cdb34bdc8 100644 --- a/packages/appkit-ui/src/react/file-browser/directory-list.tsx +++ b/packages/appkit-ui/src/react/file-browser/directory-list.tsx @@ -1,4 +1,5 @@ import { AlertCircle, ArrowLeft, FileIcon } from "lucide-react"; + import { Button } from "../ui/button"; import { Card } from "../ui/card"; import { Skeleton } from "../ui/skeleton"; @@ -6,8 +7,10 @@ import { FileEntry } from "./file-entry"; import type { DirectoryEntry, FileBrowserLabels } from "./types"; /** Props for the DirectoryList component */ -export interface DirectoryListProps - extends Omit, "children"> { +export interface DirectoryListProps extends Omit< + React.ComponentProps<"div">, + "children" +> { /** Directory entries to display */ entries: DirectoryEntry[]; /** Whether the directory is currently loading */ diff --git a/packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx b/packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx index 872d46147..bf20b64e5 100644 --- a/packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx +++ b/packages/appkit-ui/src/react/file-browser/file-breadcrumb.tsx @@ -8,8 +8,10 @@ import { } from "../ui/breadcrumb"; /** Props for the FileBreadcrumb component */ -export interface FileBreadcrumbProps - extends Omit, "children"> { +export interface FileBreadcrumbProps extends Omit< + React.ComponentProps<"nav">, + "children" +> { /** Label for the root breadcrumb item */ rootLabel: string; /** Path segments after the root */ diff --git a/packages/appkit-ui/src/react/file-browser/file-entry.tsx b/packages/appkit-ui/src/react/file-browser/file-entry.tsx index c21caeb3e..4c18591b7 100644 --- a/packages/appkit-ui/src/react/file-browser/file-entry.tsx +++ b/packages/appkit-ui/src/react/file-browser/file-entry.tsx @@ -1,11 +1,14 @@ import { ChevronRight, FileIcon, FolderIcon } from "lucide-react"; + import { formatFileSize } from "../lib/format"; import { cn } from "../lib/utils"; import type { DirectoryEntry } from "./types"; /** Props for the FileEntry component */ -export interface FileEntryProps - extends Omit, "children"> { +export interface FileEntryProps extends Omit< + React.ComponentProps<"button">, + "children" +> { /** The directory entry to render */ entry: DirectoryEntry; /** Resolved full path for this entry */ diff --git a/packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx b/packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx index 2e25e1af6..98a4b2f19 100644 --- a/packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx +++ b/packages/appkit-ui/src/react/file-browser/file-preview-panel.tsx @@ -1,4 +1,5 @@ import { AlertCircle, Download, FileIcon, Loader2, Trash2 } from "lucide-react"; + import { formatFileSize } from "../lib/format"; import { Button } from "../ui/button"; import { Card } from "../ui/card"; @@ -6,8 +7,10 @@ import { Skeleton } from "../ui/skeleton"; import type { FileBrowserLabels, FilePreview } from "./types"; /** Props for the FilePreviewPanel component */ -export interface FilePreviewPanelProps - extends Omit, "children"> { +export interface FilePreviewPanelProps extends Omit< + React.ComponentProps<"div">, + "children" +> { /** Full path of the selected file (null when nothing is selected) */ selectedFile: string | null; /** Preview data for the selected file */ diff --git a/packages/appkit-ui/src/react/file-browser/new-folder-input.tsx b/packages/appkit-ui/src/react/file-browser/new-folder-input.tsx index 258f1c6fd..f14d156a9 100644 --- a/packages/appkit-ui/src/react/file-browser/new-folder-input.tsx +++ b/packages/appkit-ui/src/react/file-browser/new-folder-input.tsx @@ -1,12 +1,15 @@ import { FolderPlus, Loader2, X } from "lucide-react"; import { useEffect, useRef } from "react"; + import { cn } from "../lib/utils"; import { Button } from "../ui/button"; import type { FileBrowserLabels } from "./types"; /** Props for the NewFolderInput component */ -export interface NewFolderInputProps - extends Omit, "children" | "onChange"> { +export interface NewFolderInputProps extends Omit< + React.ComponentProps<"div">, + "children" | "onChange" +> { /** Current folder name value */ value: string; /** Called when folder name changes */ diff --git a/packages/appkit-ui/src/react/genie/__tests__/genie-chart-inference.test.ts b/packages/appkit-ui/src/react/genie/__tests__/genie-chart-inference.test.ts index a2fd1c107..75453fa99 100644 --- a/packages/appkit-ui/src/react/genie/__tests__/genie-chart-inference.test.ts +++ b/packages/appkit-ui/src/react/genie/__tests__/genie-chart-inference.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { getCompatibleChartTypes, inferChartType, diff --git a/packages/appkit-ui/src/react/genie/__tests__/genie-query-transform.test.ts b/packages/appkit-ui/src/react/genie/__tests__/genie-query-transform.test.ts index 82da2ba0a..b7ab70134 100644 --- a/packages/appkit-ui/src/react/genie/__tests__/genie-query-transform.test.ts +++ b/packages/appkit-ui/src/react/genie/__tests__/genie-query-transform.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { classifySqlType, transformGenieData } from "../genie-query-transform"; // --------------------------------------------------------------------------- diff --git a/packages/appkit-ui/src/react/genie/genie-chat-input.tsx b/packages/appkit-ui/src/react/genie/genie-chat-input.tsx index 75fbd7162..ddd64a7bb 100644 --- a/packages/appkit-ui/src/react/genie/genie-chat-input.tsx +++ b/packages/appkit-ui/src/react/genie/genie-chat-input.tsx @@ -1,4 +1,5 @@ import { type KeyboardEvent, useRef, useState } from "react"; + import { cn } from "../lib/utils"; import { Button } from "../ui/button"; diff --git a/packages/appkit-ui/src/react/genie/genie-chat-message-list.tsx b/packages/appkit-ui/src/react/genie/genie-chat-message-list.tsx index 8af90f5c2..016eae8a1 100644 --- a/packages/appkit-ui/src/react/genie/genie-chat-message-list.tsx +++ b/packages/appkit-ui/src/react/genie/genie-chat-message-list.tsx @@ -1,4 +1,5 @@ import { useEffect, useLayoutEffect, useRef } from "react"; + import { cn } from "../lib/utils"; import { ScrollArea } from "../ui/scroll-area"; import { Skeleton } from "../ui/skeleton"; @@ -66,7 +67,6 @@ function useScrollManagement( return () => observer.disconnect(); }, [scrollRef]); - // biome-ignore lint/correctness/useExhaustiveDependencies: react to message count AND status so prevScrollHeightRef stays accurate when the loading indicator appears/disappears useLayoutEffect(() => { const viewport = getViewport(scrollRef); if (!viewport) return; diff --git a/packages/appkit-ui/src/react/genie/genie-chat-message.tsx b/packages/appkit-ui/src/react/genie/genie-chat-message.tsx index d3b87b0ca..ca58669bc 100644 --- a/packages/appkit-ui/src/react/genie/genie-chat-message.tsx +++ b/packages/appkit-ui/src/react/genie/genie-chat-message.tsx @@ -1,6 +1,7 @@ import DOMPurify from "dompurify"; import { marked } from "marked"; import { useMemo } from "react"; + import { cn } from "../lib/utils"; import { Avatar, AvatarFallback } from "../ui/avatar"; import { Card } from "../ui/card"; diff --git a/packages/appkit-ui/src/react/genie/genie-query-visualization.tsx b/packages/appkit-ui/src/react/genie/genie-query-visualization.tsx index f0227f795..93c11f01f 100644 --- a/packages/appkit-ui/src/react/genie/genie-query-visualization.tsx +++ b/packages/appkit-ui/src/react/genie/genie-query-visualization.tsx @@ -1,6 +1,7 @@ import { BarChart3Icon, ChevronDownIcon } from "lucide-react"; import { useMemo, useState } from "react"; import type { GenieStatementResponse } from "shared"; + import { BaseChart } from "../charts/base"; import { ChartErrorBoundary } from "../charts/chart-error-boundary"; import type { ChartType } from "../charts/types"; @@ -99,7 +100,6 @@ export function GenieQueryVisualization({ {displayRows.map((row, i) => ( - // biome-ignore lint/suspicious/noArrayIndexKey: tabular data rows have no unique identifier {columns.map((col) => ( diff --git a/packages/appkit-ui/src/react/genie/use-genie-chat.ts b/packages/appkit-ui/src/react/genie/use-genie-chat.ts index e9bfabde5..7688e2aa9 100644 --- a/packages/appkit-ui/src/react/genie/use-genie-chat.ts +++ b/packages/appkit-ui/src/react/genie/use-genie-chat.ts @@ -1,5 +1,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; + import { connectSSE } from "@/js"; + import { type GenieChatStatus, type GenieMessageItem, diff --git a/packages/appkit-ui/src/react/hooks/__tests__/analytics-sse.test.ts b/packages/appkit-ui/src/react/hooks/__tests__/analytics-sse.test.ts index 6f1757f5e..00459f4b7 100644 --- a/packages/appkit-ui/src/react/hooks/__tests__/analytics-sse.test.ts +++ b/packages/appkit-ui/src/react/hooks/__tests__/analytics-sse.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { type AnalyticsSseHandlerContext, GENERIC_LOAD_ERROR, diff --git a/packages/appkit-ui/src/react/hooks/__tests__/use-analytics-query.test.ts b/packages/appkit-ui/src/react/hooks/__tests__/use-analytics-query.test.ts index 4c5f1dd58..cf9796d00 100644 --- a/packages/appkit-ui/src/react/hooks/__tests__/use-analytics-query.test.ts +++ b/packages/appkit-ui/src/react/hooks/__tests__/use-analytics-query.test.ts @@ -251,7 +251,6 @@ describe("useAnalyticsQuery", () => { test("does not refetch when params object is structurally equal across renders", () => { const { rerender } = renderHook( ({ limit }: { limit: number }) => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any, { limit } as any), { initialProps: { limit: 10 } }, ); @@ -268,7 +267,6 @@ describe("useAnalyticsQuery", () => { test("does refetch when a param value actually changes", () => { const { rerender } = renderHook( ({ limit }: { limit: number }) => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any, { limit } as any), { initialProps: { limit: 10 } }, ); @@ -282,7 +280,6 @@ describe("useAnalyticsQuery", () => { test("does not refetch when params is undefined across renders", () => { const { rerender } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any), ); @@ -296,7 +293,6 @@ describe("useAnalyticsQuery", () => { test("treats two empty object literals as equal", () => { const { rerender } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any, {} as any), ); @@ -321,7 +317,6 @@ describe("useAnalyticsQuery", () => { ); const { result } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any), ); @@ -397,7 +392,6 @@ describe("useAnalyticsQuery", () => { .mockImplementation(() => {}); const { result } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any), ); @@ -419,7 +413,6 @@ describe("useAnalyticsQuery", () => { describe("aborted controller", () => { test("ignores late error envelope after the controller was aborted", async () => { const { result } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any), ); @@ -442,7 +435,6 @@ describe("useAnalyticsQuery", () => { test("ignores late result envelope after the controller was aborted", async () => { const { result } = renderHook(() => - // biome-ignore lint/suspicious/noExplicitAny: typed registry not available in tests useAnalyticsQuery("test_query" as any), ); diff --git a/packages/appkit-ui/src/react/hooks/__tests__/use-metric-view.types.test.ts b/packages/appkit-ui/src/react/hooks/__tests__/use-metric-view.types.test.ts index 22c7a5c08..a183746ea 100644 --- a/packages/appkit-ui/src/react/hooks/__tests__/use-metric-view.types.test.ts +++ b/packages/appkit-ui/src/react/hooks/__tests__/use-metric-view.types.test.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import ts from "typescript"; import { expect, test } from "vitest"; diff --git a/packages/appkit-ui/src/react/hooks/__tests__/use-plugin-config.test.ts b/packages/appkit-ui/src/react/hooks/__tests__/use-plugin-config.test.ts index 97008e827..d32e184c7 100644 --- a/packages/appkit-ui/src/react/hooks/__tests__/use-plugin-config.test.ts +++ b/packages/appkit-ui/src/react/hooks/__tests__/use-plugin-config.test.ts @@ -1,6 +1,8 @@ import { renderHook } from "@testing-library/react"; import { afterEach, describe, expect, test } from "vitest"; + import { _resetConfigCache } from "@/js/config"; + import { usePluginClientConfig } from "../use-plugin-config"; describe("usePluginClientConfig", () => { diff --git a/packages/appkit-ui/src/react/hooks/types.ts b/packages/appkit-ui/src/react/hooks/types.ts index 48bb9b676..92ae9f45a 100644 --- a/packages/appkit-ui/src/react/hooks/types.ts +++ b/packages/appkit-ui/src/react/hooks/types.ts @@ -143,31 +143,34 @@ export type AugmentedRegistry = keyof { }; /** Resolves to registry keys if defined, otherwise string */ -export type QueryKey = AugmentedRegistry extends never - ? string - : AugmentedRegistry; +export type QueryKey = + AugmentedRegistry extends never + ? string + : AugmentedRegistry; /** * Infers result type from QueryRegistry[K]["result"] * Returns the JSON array type for the query. */ -export type InferResult = K extends AugmentedRegistry - ? QueryRegistry[K] extends { result: infer R } - ? R - : T - : T; +export type InferResult = + K extends AugmentedRegistry + ? QueryRegistry[K] extends { result: infer R } + ? R + : T + : T; /** * Infers the row type from a query result array. * Used for TypedArrowTable row typing. */ -export type InferRowType = K extends AugmentedRegistry - ? QueryRegistry[K] extends { result: Array } - ? R extends Record - ? R +export type InferRowType = + K extends AugmentedRegistry + ? QueryRegistry[K] extends { result: Array } + ? R extends Record + ? R + : Record : Record - : Record - : Record; + : Record; /** * Conditionally infers result type based on format. @@ -183,11 +186,12 @@ export type InferResultByFormat = F extends /** * Infers parameters type from QueryRegistry[K]["parameters"] */ -export type InferParams = K extends AugmentedRegistry - ? QueryRegistry[K] extends { parameters: infer P } - ? P - : Record - : Record; +export type InferParams = + K extends AugmentedRegistry + ? QueryRegistry[K] extends { parameters: infer P } + ? P + : Record + : Record; export interface PluginRegistry { [key: string]: Record; @@ -261,7 +265,7 @@ export interface AiSearchResponse< * } * ``` */ -// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty — populated via module augmentation +// oxlint-disable-next-line typescript/no-empty-object-type -- intentionally empty — populated via module augmentation export interface ServingEndpointRegistry {} /** Resolves to registry keys if populated, otherwise string */ @@ -299,63 +303,70 @@ export type InferServingRequest = // ============================================================================ /** Metric view registry for type-safe metric keys */ -// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty — populated via module augmentation (generated metric-views.ts) +// oxlint-disable-next-line typescript/no-empty-object-type -- intentionally empty — populated via module augmentation export interface MetricRegistry {} -export type MetricKey = AugmentedRegistry extends never - ? string - : AugmentedRegistry; +export type MetricKey = + AugmentedRegistry extends never + ? string + : AugmentedRegistry; -export type InferMeasureKeys = K extends AugmentedRegistry - ? MetricRegistry[K] extends { measureKeys: infer M } - ? M - : string - : string; +export type InferMeasureKeys = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { measureKeys: infer M } + ? M + : string + : string; -export type InferDimensionKeys = K extends AugmentedRegistry - ? MetricRegistry[K] extends { dimensionKeys: infer D } - ? D - : string - : string; +export type InferDimensionKeys = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { dimensionKeys: infer D } + ? D + : string + : string; -export type InferTimeGrains = K extends AugmentedRegistry - ? MetricRegistry[K] extends { timeGrains: infer G } - ? G - : string - : string; +export type InferTimeGrains = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { timeGrains: infer G } + ? G + : string + : string; /** * Infers the full row shape (every measure + dimension) from registry * otherwise a total `Record`. */ -export type InferMetricRow = K extends AugmentedRegistry - ? MetricRegistry[K] extends { - measures: infer Meas; - dimensions: infer Dim; - } - ? Meas & Dim - : Record - : Record; +export type InferMetricRow = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { + measures: infer Meas; + dimensions: infer Dim; + } + ? Meas & Dim + : Record + : Record; export type PickMetricRow< K, M extends ReadonlyArray, D extends ReadonlyArray, -> = K extends AugmentedRegistry - ? MetricRegistry[K] extends { - measures: infer Meas; - dimensions: infer Dim; - } - ? Pick> & - Pick> - : Record - : Record; +> = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { + measures: infer Meas; + dimensions: infer Dim; + } + ? Pick> & + Pick> + : Record + : Record; -type MetricDimensionMeta = K extends AugmentedRegistry - ? MetricRegistry[K] extends { metadata: { dimensions: infer DM } } - ? DM - : never - : never; +type MetricDimensionMeta = + K extends AugmentedRegistry + ? MetricRegistry[K] extends { metadata: { dimensions: infer DM } } + ? DM + : never + : never; /** * The dimension keys of K that are TEMPORAL — i.e. carry a `time_grain` tuple in @@ -380,21 +391,19 @@ export type InferTimeDimensionKeys = * the union is exactly the grains applicable to the query. Falls back to the * metric's whole `timeGrains` union (or `string`) for an unknown/degraded key. */ -export type GrainsForSelectedTimeDims< - K, - D extends ReadonlyArray, -> = K extends AugmentedRegistry - ? { - [P in Extract< - D[number], - keyof MetricDimensionMeta - >]: MetricDimensionMeta[P] extends { - time_grain: infer G extends readonly unknown[]; - } - ? G[number] - : never; - }[Extract>] - : string; +export type GrainsForSelectedTimeDims> = + K extends AugmentedRegistry + ? { + [P in Extract< + D[number], + keyof MetricDimensionMeta + >]: MetricDimensionMeta[P] extends { + time_grain: infer G extends readonly unknown[]; + } + ? G[number] + : never; + }[Extract>] + : string; export type { MetricFilter, diff --git a/packages/appkit-ui/src/react/hooks/use-agent-chat.ts b/packages/appkit-ui/src/react/hooks/use-agent-chat.ts index 684284a60..c256adf07 100644 --- a/packages/appkit-ui/src/react/hooks/use-agent-chat.ts +++ b/packages/appkit-ui/src/react/hooks/use-agent-chat.ts @@ -1,4 +1,5 @@ import { useCallback, useEffect, useRef, useState } from "react"; + import { connectSSE } from "@/js"; /** diff --git a/packages/appkit-ui/src/react/hooks/use-ai-search-query.ts b/packages/appkit-ui/src/react/hooks/use-ai-search-query.ts index e15559588..f1b7f2619 100644 --- a/packages/appkit-ui/src/react/hooks/use-ai-search-query.ts +++ b/packages/appkit-ui/src/react/hooks/use-ai-search-query.ts @@ -1,4 +1,5 @@ import { useCallback, useEffect, useRef, useState } from "react"; + import type { AiSearchClientConfig, AiSearchIndexSummary, @@ -111,7 +112,6 @@ export function useAiSearchQuery< // Reset when the target alias changes: abort any in-flight request (its // result would otherwise land under the new alias) and clear stale data + // fetch error. `error` re-derives from the new alias's validation state. - // biome-ignore lint/correctness/useExhaustiveDependencies: `alias` is the intended trigger — the effect runs to reset on every alias change, not because it reads alias. useEffect(() => { abortControllerRef.current?.abort(); setData(null); diff --git a/packages/appkit-ui/src/react/hooks/use-analytics-query.ts b/packages/appkit-ui/src/react/hooks/use-analytics-query.ts index 93b3dba36..58bbfb0ce 100644 --- a/packages/appkit-ui/src/react/hooks/use-analytics-query.ts +++ b/packages/appkit-ui/src/react/hooks/use-analytics-query.ts @@ -6,7 +6,9 @@ import { useRef, useState, } from "react"; + import { ArrowClient, connectSSE } from "@/js"; + import { type AnalyticsSseHandlerContext, GENERIC_LOAD_ERROR, diff --git a/packages/appkit-ui/src/react/hooks/use-analytics-warehouse-status.ts b/packages/appkit-ui/src/react/hooks/use-analytics-warehouse-status.ts index a45559f9f..4ed0b65b3 100644 --- a/packages/appkit-ui/src/react/hooks/use-analytics-warehouse-status.ts +++ b/packages/appkit-ui/src/react/hooks/use-analytics-warehouse-status.ts @@ -1,4 +1,5 @@ import { useCallback, useRef } from "react"; + import type { WarehouseStatus } from "./types"; import { type ResourceSeverity, diff --git a/packages/appkit-ui/src/react/hooks/use-chart-data.ts b/packages/appkit-ui/src/react/hooks/use-chart-data.ts index a19acd040..4f98527b2 100644 --- a/packages/appkit-ui/src/react/hooks/use-chart-data.ts +++ b/packages/appkit-ui/src/react/hooks/use-chart-data.ts @@ -1,5 +1,6 @@ import type { Table } from "apache-arrow"; import { useMemo } from "react"; + import type { ChartData, DataFormat } from "../charts/types"; import type { WarehouseStatus } from "./types"; import { useAnalyticsQuery } from "./use-analytics-query"; diff --git a/packages/appkit-ui/src/react/hooks/use-metric-view.ts b/packages/appkit-ui/src/react/hooks/use-metric-view.ts index 3f95e7193..38d934c7c 100644 --- a/packages/appkit-ui/src/react/hooks/use-metric-view.ts +++ b/packages/appkit-ui/src/react/hooks/use-metric-view.ts @@ -7,7 +7,9 @@ import { useState, } from "react"; import type { MetricViewColumnDisplay } from "shared"; + import { connectSSE } from "@/js"; + import { type AnalyticsSseHandlerContext, getDevMode, diff --git a/packages/appkit-ui/src/react/hooks/use-plugin-config.ts b/packages/appkit-ui/src/react/hooks/use-plugin-config.ts index 84d702be0..fe87d5bf0 100644 --- a/packages/appkit-ui/src/react/hooks/use-plugin-config.ts +++ b/packages/appkit-ui/src/react/hooks/use-plugin-config.ts @@ -1,4 +1,5 @@ import { useMemo } from "react"; + import { getPluginClientConfig } from "@/js"; /** diff --git a/packages/appkit-ui/src/react/hooks/use-serving-invoke.ts b/packages/appkit-ui/src/react/hooks/use-serving-invoke.ts index ea44f2801..cf8e818d0 100644 --- a/packages/appkit-ui/src/react/hooks/use-serving-invoke.ts +++ b/packages/appkit-ui/src/react/hooks/use-serving-invoke.ts @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; + import type { InferServingRequest, InferServingResponse, diff --git a/packages/appkit-ui/src/react/hooks/use-serving-stream.ts b/packages/appkit-ui/src/react/hooks/use-serving-stream.ts index 741bcf974..82f666926 100644 --- a/packages/appkit-ui/src/react/hooks/use-serving-stream.ts +++ b/packages/appkit-ui/src/react/hooks/use-serving-stream.ts @@ -1,5 +1,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react"; + import { connectSSE } from "@/js"; + import type { InferServingChunk, InferServingRequest, diff --git a/packages/appkit-ui/src/react/lib/format.test.ts b/packages/appkit-ui/src/react/lib/format.test.ts index 0c90ba8cd..00c66f99e 100644 --- a/packages/appkit-ui/src/react/lib/format.test.ts +++ b/packages/appkit-ui/src/react/lib/format.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { formatFieldLabel } from "./format"; describe("formatFieldLabel", () => { diff --git a/packages/appkit-ui/src/react/resource-status-indicator.tsx b/packages/appkit-ui/src/react/resource-status-indicator.tsx index 3e7d15656..cff570e8e 100644 --- a/packages/appkit-ui/src/react/resource-status-indicator.tsx +++ b/packages/appkit-ui/src/react/resource-status-indicator.tsx @@ -1,6 +1,7 @@ import type { LucideIcon } from "lucide-react"; import { useEffect, useId, useRef, useState } from "react"; import { type ToasterProps, toast } from "sonner"; + import { type AggregatedResourceStatus, type ResourceStatus, @@ -150,8 +151,7 @@ export function useResourceStatusToaster( } export interface ResourceStatusIndicatorProps - extends ResourceStatusToasterOptions, - Omit { + extends ResourceStatusToasterOptions, Omit { /** Class name applied to the Toaster wrapper. */ className?: string; } diff --git a/packages/appkit-ui/src/react/styles/globals.css b/packages/appkit-ui/src/react/styles/globals.css index 70d15cf46..28516180c 100644 --- a/packages/appkit-ui/src/react/styles/globals.css +++ b/packages/appkit-ui/src/react/styles/globals.css @@ -441,11 +441,8 @@ *, *::before, *::after { - /* biome-ignore lint/complexity/noImportantStyles: !important is intentional for accessibility - forces reduced motion regardless of specificity */ animation-duration: 0.01ms !important; - /* biome-ignore lint/complexity/noImportantStyles: !important is intentional for accessibility - forces reduced motion regardless of specificity */ animation-iteration-count: 1 !important; - /* biome-ignore lint/complexity/noImportantStyles: !important is intentional for accessibility - forces reduced motion regardless of specificity */ transition-duration: 0.01ms !important; } } diff --git a/packages/appkit-ui/src/react/table/data-table.tsx b/packages/appkit-ui/src/react/table/data-table.tsx index 2b7306d03..c89efdc60 100644 --- a/packages/appkit-ui/src/react/table/data-table.tsx +++ b/packages/appkit-ui/src/react/table/data-table.tsx @@ -1,5 +1,6 @@ import { flexRender } from "@tanstack/react-table"; import { ChevronDown } from "lucide-react"; + import { formatFieldLabel } from "../lib/format"; import { Button } from "../ui/button"; import { diff --git a/packages/appkit-ui/src/react/table/table-wrapper.tsx b/packages/appkit-ui/src/react/table/table-wrapper.tsx index c4e28ff8c..4a1e03b8c 100644 --- a/packages/appkit-ui/src/react/table/table-wrapper.tsx +++ b/packages/appkit-ui/src/react/table/table-wrapper.tsx @@ -14,6 +14,7 @@ import { } from "@tanstack/react-table"; import { ArrowUpDown } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; + import { useAnalyticsQuery } from ".."; import { formatChartValue, diff --git a/packages/appkit-ui/src/react/ui-variants/variants.tsx b/packages/appkit-ui/src/react/ui-variants/variants.tsx index c74788a8e..bc44980ca 100644 --- a/packages/appkit-ui/src/react/ui-variants/variants.tsx +++ b/packages/appkit-ui/src/react/ui-variants/variants.tsx @@ -15,6 +15,7 @@ import { useMemo, useState, } from "react"; + import { cn } from "../lib/utils"; import { Variant, type VariantProps } from "./variant"; diff --git a/packages/appkit/skills/appkit-ui-variants/SKILL.md b/packages/appkit/skills/appkit-ui-variants/SKILL.md index 7b498a90e..17e61ce41 100644 --- a/packages/appkit/skills/appkit-ui-variants/SKILL.md +++ b/packages/appkit/skills/appkit-ui-variants/SKILL.md @@ -142,7 +142,7 @@ block yet, they haven't clicked Confirm — ask them to, don't finalize nothing. the chosen ``'s inner JSX** — remove the ``/`` wrapper, drop the now-unused import if nothing else uses it, reconcile surrounding code, then format/lint the file - (`pnpm check:fix`, or `pnpm biome check --write `). + (`pnpm check:fix`, or `pnpm exec oxlint --fix && pnpm exec oxfmt --write `). 4. **Remove the consumed line** for that `blockId` from the choices file. Match the `blockId` structurally (not a loose substring) so a label containing the text can't delete the wrong line: diff --git a/packages/appkit/src/agents/databricks.ts b/packages/appkit/src/agents/databricks.ts index 476de0b85..5b069d29d 100644 --- a/packages/appkit/src/agents/databricks.ts +++ b/packages/appkit/src/agents/databricks.ts @@ -5,6 +5,7 @@ import type { AgentRunContext, AgentToolDefinition, } from "shared"; + import { type StreamBody, stream as servingStream, diff --git a/packages/appkit/src/agents/supervisor-api.ts b/packages/appkit/src/agents/supervisor-api.ts index 07c4d1a79..b635b92f4 100644 --- a/packages/appkit/src/agents/supervisor-api.ts +++ b/packages/appkit/src/agents/supervisor-api.ts @@ -6,6 +6,7 @@ import type { Message, ResponseStreamEvent, } from "shared"; + import { type ApiClientLike, type StreamBody, diff --git a/packages/appkit/src/agents/tests/databricks.test.ts b/packages/appkit/src/agents/tests/databricks.test.ts index c20f74fa5..38615cabe 100644 --- a/packages/appkit/src/agents/tests/databricks.test.ts +++ b/packages/appkit/src/agents/tests/databricks.test.ts @@ -1,5 +1,6 @@ import type { AgentEvent, AgentToolDefinition, Message } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { DatabricksAdapter, type GenerationParams, diff --git a/packages/appkit/src/agents/tests/supervisor-api.test.ts b/packages/appkit/src/agents/tests/supervisor-api.test.ts index 7ff57846c..c9d632825 100644 --- a/packages/appkit/src/agents/tests/supervisor-api.test.ts +++ b/packages/appkit/src/agents/tests/supervisor-api.test.ts @@ -1,5 +1,6 @@ import type { AgentEvent, AgentInput } from "shared"; import { afterEach, describe, expect, test, vi } from "vitest"; + import { fromSupervisorApi, isSupervisorTool, diff --git a/packages/appkit/src/app/index.ts b/packages/appkit/src/app/index.ts index 19a43927a..15f1b55f7 100644 --- a/packages/appkit/src/app/index.ts +++ b/packages/appkit/src/app/index.ts @@ -1,5 +1,6 @@ import fs from "node:fs/promises"; import path from "node:path"; + import { createLogger } from "../logging/logger"; const logger = createLogger("app"); diff --git a/packages/appkit/src/app/tests/app.test.ts b/packages/appkit/src/app/tests/app.test.ts index ef217e224..93485c157 100644 --- a/packages/appkit/src/app/tests/app.test.ts +++ b/packages/appkit/src/app/tests/app.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { DevFileReader } from "../index"; import { AppManager } from "../index"; diff --git a/packages/appkit/src/app/tests/read-config-file.test.ts b/packages/appkit/src/app/tests/read-config-file.test.ts index c08ad5a6d..c231e6741 100644 --- a/packages/appkit/src/app/tests/read-config-file.test.ts +++ b/packages/appkit/src/app/tests/read-config-file.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { DevFileReader } from "../index"; import { AppManager } from "../index"; diff --git a/packages/appkit/src/cache/index.ts b/packages/appkit/src/cache/index.ts index e2b79d04c..a98b7dff4 100644 --- a/packages/appkit/src/cache/index.ts +++ b/packages/appkit/src/cache/index.ts @@ -1,5 +1,7 @@ import { createHash } from "node:crypto"; + import type { CacheConfig, CacheEntry, CacheStorage } from "shared"; + import { createLakebasePool } from "../connectors/lakebase"; import { getClientOptions } from "../context/client-options"; import { AppKitError, ExecutionError, InitializationError } from "../errors"; diff --git a/packages/appkit/src/cache/storage/memory.ts b/packages/appkit/src/cache/storage/memory.ts index 23f36e08a..02c4bb53f 100644 --- a/packages/appkit/src/cache/storage/memory.ts +++ b/packages/appkit/src/cache/storage/memory.ts @@ -1,4 +1,5 @@ import type { CacheConfig, CacheEntry, CacheStorage } from "shared"; + import { inMemoryStorageDefaults } from "./defaults"; /** diff --git a/packages/appkit/src/cache/storage/persistent.ts b/packages/appkit/src/cache/storage/persistent.ts index fb809846d..411dadaeb 100644 --- a/packages/appkit/src/cache/storage/persistent.ts +++ b/packages/appkit/src/cache/storage/persistent.ts @@ -1,6 +1,8 @@ import { createHash } from "node:crypto"; + import type pg from "pg"; import type { CacheConfig, CacheEntry, CacheStorage } from "shared"; + import { InitializationError, ValidationError } from "../../errors"; import { createLogger } from "../../logging/logger"; import { lakebaseStorageDefaults } from "./defaults"; diff --git a/packages/appkit/src/cache/tests/cache-manager.test.ts b/packages/appkit/src/cache/tests/cache-manager.test.ts index 9f6689883..1565978ce 100644 --- a/packages/appkit/src/cache/tests/cache-manager.test.ts +++ b/packages/appkit/src/cache/tests/cache-manager.test.ts @@ -1,5 +1,6 @@ import type { CacheStorage } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../index"; // Mock createLakebasePool diff --git a/packages/appkit/src/cache/tests/memory.test.ts b/packages/appkit/src/cache/tests/memory.test.ts index 5f4f0f23e..4adb3bf3d 100644 --- a/packages/appkit/src/cache/tests/memory.test.ts +++ b/packages/appkit/src/cache/tests/memory.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test } from "vitest"; + import { InMemoryStorage } from "../storage"; describe("InMemoryStorage", () => { diff --git a/packages/appkit/src/cache/tests/persistent.test.ts b/packages/appkit/src/cache/tests/persistent.test.ts index 82706b0df..737498edb 100644 --- a/packages/appkit/src/cache/tests/persistent.test.ts +++ b/packages/appkit/src/cache/tests/persistent.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import { PersistentStorage } from "../storage"; /** Mock pg.Pool for testing */ diff --git a/packages/appkit/src/connectors/files/client.ts b/packages/appkit/src/connectors/files/client.ts index 1d160ee0e..ffdc06dac 100644 --- a/packages/appkit/src/connectors/files/client.ts +++ b/packages/appkit/src/connectors/files/client.ts @@ -1,5 +1,7 @@ import { AsyncLocalStorage } from "node:async_hooks"; + import type { TelemetryOptions } from "shared"; + import { createLogger } from "../../logging/logger"; import type { DirectoryEntry, diff --git a/packages/appkit/src/connectors/files/tests/client.test.ts b/packages/appkit/src/connectors/files/tests/client.test.ts index 4d2b9d070..31ebeb489 100644 --- a/packages/appkit/src/connectors/files/tests/client.test.ts +++ b/packages/appkit/src/connectors/files/tests/client.test.ts @@ -1,5 +1,6 @@ import { createMockTelemetry } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { WorkspaceClient } from "../../../workspace-client"; import { FilesConnector } from "../client"; import { streamFromChunks, streamFromString } from "./utils"; diff --git a/packages/appkit/src/connectors/files/tests/defaults.test.ts b/packages/appkit/src/connectors/files/tests/defaults.test.ts index 64c42ec06..0f2c15d12 100644 --- a/packages/appkit/src/connectors/files/tests/defaults.test.ts +++ b/packages/appkit/src/connectors/files/tests/defaults.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { contentTypeFromPath, isSafeInlineContentType, diff --git a/packages/appkit/src/connectors/genie/poll-waiter.test.ts b/packages/appkit/src/connectors/genie/poll-waiter.test.ts index 3130cdc1d..af3b94bdc 100644 --- a/packages/appkit/src/connectors/genie/poll-waiter.test.ts +++ b/packages/appkit/src/connectors/genie/poll-waiter.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { type Pollable, type PollEvent, pollWaiter } from "./poll-waiter"; function createMockWaiter

(opts: { diff --git a/packages/appkit/src/connectors/genie/tests/client.test.ts b/packages/appkit/src/connectors/genie/tests/client.test.ts index c2f0dbba6..50ae69f2b 100644 --- a/packages/appkit/src/connectors/genie/tests/client.test.ts +++ b/packages/appkit/src/connectors/genie/tests/client.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import type { GenieMessage } from "../../../workspace-client"; import { GenieConnector } from "../client"; import type { GenieStreamEvent } from "../types"; diff --git a/packages/appkit/src/connectors/lakebase/index.ts b/packages/appkit/src/connectors/lakebase/index.ts index 8de651471..a4b6762ec 100644 --- a/packages/appkit/src/connectors/lakebase/index.ts +++ b/packages/appkit/src/connectors/lakebase/index.ts @@ -3,6 +3,7 @@ import { type LakebasePoolConfig, } from "@databricks/lakebase"; import type { Pool } from "pg"; + import { createLogger } from "../../logging/logger"; /** diff --git a/packages/appkit/src/connectors/lakebase/pool-manager.ts b/packages/appkit/src/connectors/lakebase/pool-manager.ts index e48fa70cb..88abb2743 100644 --- a/packages/appkit/src/connectors/lakebase/pool-manager.ts +++ b/packages/appkit/src/connectors/lakebase/pool-manager.ts @@ -1,5 +1,6 @@ import type { LakebasePoolConfig } from "@databricks/lakebase"; import type { Pool } from "pg"; + import { createLakebasePool } from "./index"; /** Interval for removing empty (connectionless) pools from the Map. */ diff --git a/packages/appkit/src/connectors/lakebase/routing-pool.ts b/packages/appkit/src/connectors/lakebase/routing-pool.ts index 55dd74fa0..c62a08957 100644 --- a/packages/appkit/src/connectors/lakebase/routing-pool.ts +++ b/packages/appkit/src/connectors/lakebase/routing-pool.ts @@ -1,4 +1,5 @@ import type { Pool, PoolClient, QueryResult, QueryResultRow } from "pg"; + import { getUserContext } from "../../context/execution-context"; import type { UserContext } from "../../context/user-context"; diff --git a/packages/appkit/src/connectors/lakebase/tests/routing-pool.test.ts b/packages/appkit/src/connectors/lakebase/tests/routing-pool.test.ts index 75b278a41..c19f7c15e 100644 --- a/packages/appkit/src/connectors/lakebase/tests/routing-pool.test.ts +++ b/packages/appkit/src/connectors/lakebase/tests/routing-pool.test.ts @@ -1,5 +1,6 @@ import type { Pool } from "pg"; import { describe, expect, test, vi } from "vitest"; + import { RoutingPool } from "../routing-pool"; vi.mock("../../../cache", () => ({ @@ -45,9 +46,8 @@ describe("RoutingPool", () => { }); test("routes to user pool inside runInUserContext", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const spPool = makeMockPool("sp"); const userPool = makeMockPool("user"); @@ -71,9 +71,8 @@ describe("RoutingPool", () => { }); test("connect() routes to user pool inside runInUserContext", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const spPool = makeMockPool("sp"); const userPool = makeMockPool("user"); @@ -93,9 +92,8 @@ describe("RoutingPool", () => { }); test("forwards query values to user pool inside runInUserContext", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const spPool = makeMockPool("sp"); const userPool = makeMockPool("user"); diff --git a/packages/appkit/src/connectors/mcp/client.ts b/packages/appkit/src/connectors/mcp/client.ts index cbdc82d58..ac6196985 100644 --- a/packages/appkit/src/connectors/mcp/client.ts +++ b/packages/appkit/src/connectors/mcp/client.ts @@ -23,6 +23,7 @@ * transport. */ import type { AgentToolDefinition } from "shared"; + import { APPKIT_USER_AGENT } from "../../context/client-options"; import { createLogger } from "../../logging/logger"; import { diff --git a/packages/appkit/src/connectors/mcp/index.ts b/packages/appkit/src/connectors/mcp/index.ts index 5d0a69d79..90c7d648a 100644 --- a/packages/appkit/src/connectors/mcp/index.ts +++ b/packages/appkit/src/connectors/mcp/index.ts @@ -1,6 +1,3 @@ export { AppKitMcpClient, type McpConnectAllResult } from "./client"; -export { - buildMcpHostPolicy, - type McpHostPolicyConfig, -} from "./host-policy"; +export { buildMcpHostPolicy, type McpHostPolicyConfig } from "./host-policy"; export type { McpEndpointConfig } from "./types"; diff --git a/packages/appkit/src/connectors/mcp/tests/client.test.ts b/packages/appkit/src/connectors/mcp/tests/client.test.ts index 1835d90f3..ffcf70407 100644 --- a/packages/appkit/src/connectors/mcp/tests/client.test.ts +++ b/packages/appkit/src/connectors/mcp/tests/client.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import { APPKIT_USER_AGENT } from "../../../context/client-options"; import { AppKitMcpClient } from "../client"; import type { DnsLookup, McpHostPolicy } from "../host-policy"; diff --git a/packages/appkit/src/connectors/mcp/tests/host-policy.test.ts b/packages/appkit/src/connectors/mcp/tests/host-policy.test.ts index 451536ed5..92b4dedb8 100644 --- a/packages/appkit/src/connectors/mcp/tests/host-policy.test.ts +++ b/packages/appkit/src/connectors/mcp/tests/host-policy.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { assertResolvedHostSafe, buildMcpHostPolicy, diff --git a/packages/appkit/src/connectors/serving/tests/client.test.ts b/packages/appkit/src/connectors/serving/tests/client.test.ts index 34bfd743a..67be06bbe 100644 --- a/packages/appkit/src/connectors/serving/tests/client.test.ts +++ b/packages/appkit/src/connectors/serving/tests/client.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import { Context } from "../../../workspace-client"; import { invoke, stream } from "../client"; diff --git a/packages/appkit/src/connectors/sql-warehouse/client.ts b/packages/appkit/src/connectors/sql-warehouse/client.ts index 6eb78c991..439658cbd 100644 --- a/packages/appkit/src/connectors/sql-warehouse/client.ts +++ b/packages/appkit/src/connectors/sql-warehouse/client.ts @@ -1,4 +1,5 @@ import type { TelemetryOptions } from "shared"; + import { AppKitError, ConfigurationError, diff --git a/packages/appkit/src/connectors/sql-warehouse/tests/arrow-schema.test.ts b/packages/appkit/src/connectors/sql-warehouse/tests/arrow-schema.test.ts index e30b7315a..d8f52f016 100644 --- a/packages/appkit/src/connectors/sql-warehouse/tests/arrow-schema.test.ts +++ b/packages/appkit/src/connectors/sql-warehouse/tests/arrow-schema.test.ts @@ -22,6 +22,7 @@ import { Utf8, } from "apache-arrow"; import { describe, expect, test } from "vitest"; + import { buildEmptyArrowIPCBase64, parseDatabricksType } from "../arrow-schema"; // ============================================================================ diff --git a/packages/appkit/src/connectors/sql-warehouse/tests/client.test.ts b/packages/appkit/src/connectors/sql-warehouse/tests/client.test.ts index 2adcd6e4e..5a945b0cc 100644 --- a/packages/appkit/src/connectors/sql-warehouse/tests/client.test.ts +++ b/packages/appkit/src/connectors/sql-warehouse/tests/client.test.ts @@ -1,5 +1,6 @@ import { tableFromIPC } from "apache-arrow"; import { describe, expect, test, vi } from "vitest"; + import type { sql } from "../../../workspace-client"; vi.mock("../../../telemetry", () => { diff --git a/packages/appkit/src/connectors/tests/context.test.ts b/packages/appkit/src/connectors/tests/context.test.ts index 58eb034fc..040862942 100644 --- a/packages/appkit/src/connectors/tests/context.test.ts +++ b/packages/appkit/src/connectors/tests/context.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; + import { Context } from "../../workspace-client"; import { contextFromAbortSignal } from "../context"; diff --git a/packages/appkit/src/connectors/tests/sql-warehouse.test.ts b/packages/appkit/src/connectors/tests/sql-warehouse.test.ts index 0dad1e0ea..285fa8d0b 100644 --- a/packages/appkit/src/connectors/tests/sql-warehouse.test.ts +++ b/packages/appkit/src/connectors/tests/sql-warehouse.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { SQLWarehouseConnector } from "../sql-warehouse"; // Mock telemetry to pass through span callbacks diff --git a/packages/appkit/src/context/client-options.ts b/packages/appkit/src/context/client-options.ts index 354828993..c4a750d4d 100644 --- a/packages/appkit/src/context/client-options.ts +++ b/packages/appkit/src/context/client-options.ts @@ -1,4 +1,5 @@ import { coerce } from "semver"; + import { name as productName, version as productVersion, diff --git a/packages/appkit/src/context/execution-context.ts b/packages/appkit/src/context/execution-context.ts index 8202b9bd0..1acd569a5 100644 --- a/packages/appkit/src/context/execution-context.ts +++ b/packages/appkit/src/context/execution-context.ts @@ -1,4 +1,5 @@ import { AsyncLocalStorage } from "node:async_hooks"; + import { ConfigurationError } from "../errors"; import { ServiceContext } from "./service-context"; import { diff --git a/packages/appkit/src/context/service-context.ts b/packages/appkit/src/context/service-context.ts index b5840bbc6..5d9ad78fe 100644 --- a/packages/appkit/src/context/service-context.ts +++ b/packages/appkit/src/context/service-context.ts @@ -1,4 +1,5 @@ import { createHash } from "node:crypto"; + import { AuthenticationError, ConfigurationError, diff --git a/packages/appkit/src/context/tests/service-context.test.ts b/packages/appkit/src/context/tests/service-context.test.ts index 26a53b991..f70f85efa 100644 --- a/packages/appkit/src/context/tests/service-context.test.ts +++ b/packages/appkit/src/context/tests/service-context.test.ts @@ -1,5 +1,6 @@ import { setupDatabricksEnv } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { AuthenticationError, ConfigurationError, diff --git a/packages/appkit/src/context/tests/user-agent-wire.integration.test.ts b/packages/appkit/src/context/tests/user-agent-wire.integration.test.ts index 063842c4f..c3cb34158 100644 --- a/packages/appkit/src/context/tests/user-agent-wire.integration.test.ts +++ b/packages/appkit/src/context/tests/user-agent-wire.integration.test.ts @@ -1,4 +1,5 @@ import http, { type Server } from "node:http"; + import { afterAll, beforeAll, @@ -7,6 +8,7 @@ import { expect, test, } from "vitest"; + import { FilesConnector } from "../../connectors/files/client"; import { createWorkspaceClient } from "../../workspace-client"; import { getClientOptions } from "../client-options"; diff --git a/packages/appkit/src/core/agent/build-toolkit.ts b/packages/appkit/src/core/agent/build-toolkit.ts index 6e5a8ad19..d8d94f0ed 100644 --- a/packages/appkit/src/core/agent/build-toolkit.ts +++ b/packages/appkit/src/core/agent/build-toolkit.ts @@ -1,4 +1,5 @@ import type { AgentToolDefinition } from "shared"; + import { applyToolkitOptions } from "./toolkit-options"; import type { ToolRegistry } from "./tools/define-tool"; import { toToolJSONSchema } from "./tools/json-schema"; diff --git a/packages/appkit/src/core/agent/index.ts b/packages/appkit/src/core/agent/index.ts index e35d483d4..d184e13ae 100644 --- a/packages/appkit/src/core/agent/index.ts +++ b/packages/appkit/src/core/agent/index.ts @@ -17,11 +17,7 @@ export { parseFrontmatter, } from "./load-agents"; export { normalizeToolResult } from "./normalize-result"; -export { - type RunAgentInput, - type RunAgentResult, - runAgent, -} from "./run-agent"; +export { type RunAgentInput, type RunAgentResult, runAgent } from "./run-agent"; export { buildBaseSystemPrompt, composeSystemPrompt } from "./system-prompt"; export { resolveToolkitFromProvider } from "./toolkit-resolver"; export { diff --git a/packages/appkit/src/core/agent/load-agents.ts b/packages/appkit/src/core/agent/load-agents.ts index 5f535cafc..9b220a420 100644 --- a/packages/appkit/src/core/agent/load-agents.ts +++ b/packages/appkit/src/core/agent/load-agents.ts @@ -1,8 +1,10 @@ import type { Dirent } from "node:fs"; import fs from "node:fs/promises"; import path from "node:path"; + import yaml from "js-yaml"; import type { AgentAdapter } from "shared"; + import type { GenerationParams } from "../../agents/databricks"; import type { AgentDefinition, diff --git a/packages/appkit/src/core/agent/run-agent.ts b/packages/appkit/src/core/agent/run-agent.ts index 5675edd36..57a659686 100644 --- a/packages/appkit/src/core/agent/run-agent.ts +++ b/packages/appkit/src/core/agent/run-agent.ts @@ -1,4 +1,5 @@ import { randomUUID } from "node:crypto"; + import type { AgentAdapter, AgentEvent, @@ -8,6 +9,7 @@ import type { PluginData, ToolProvider, } from "shared"; + import { isSupervisorTool, SUPERVISOR_EXTENSION_KEY, diff --git a/packages/appkit/src/core/agent/tests/build-toolkit.test.ts b/packages/appkit/src/core/agent/tests/build-toolkit.test.ts index 2ab9eb6c4..bb6705f33 100644 --- a/packages/appkit/src/core/agent/tests/build-toolkit.test.ts +++ b/packages/appkit/src/core/agent/tests/build-toolkit.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "vitest"; import { z } from "zod"; + import { buildToolkitEntries } from "../build-toolkit"; import { defineTool, type ToolRegistry } from "../tools/define-tool"; import { isToolkitEntry } from "../types"; diff --git a/packages/appkit/src/core/agent/tests/consume-adapter-stream.test.ts b/packages/appkit/src/core/agent/tests/consume-adapter-stream.test.ts index 98863a62a..499efcde8 100644 --- a/packages/appkit/src/core/agent/tests/consume-adapter-stream.test.ts +++ b/packages/appkit/src/core/agent/tests/consume-adapter-stream.test.ts @@ -1,5 +1,6 @@ import type { AgentEvent } from "shared"; import { describe, expect, test } from "vitest"; + import { consumeAdapterStream } from "../consume-adapter-stream"; async function* streamOf( diff --git a/packages/appkit/src/core/agent/tests/create-agent.test.ts b/packages/appkit/src/core/agent/tests/create-agent.test.ts index 46668e1a0..638425b8a 100644 --- a/packages/appkit/src/core/agent/tests/create-agent.test.ts +++ b/packages/appkit/src/core/agent/tests/create-agent.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "vitest"; import { z } from "zod"; + import { createAgent } from "../create-agent"; import { tool } from "../tools/tool"; import type { AgentDefinition } from "../types"; @@ -47,7 +48,6 @@ describe("createAgent", () => { test("throws on a direct self-cycle", () => { const a: AgentDefinition = { instructions: "a" }; - // biome-ignore lint/suspicious/noExplicitAny: intentional cycle setup for test (a as any).agents = { self: a }; expect(() => createAgent(a)).toThrow(/cycle/i); }); diff --git a/packages/appkit/src/core/agent/tests/define-tool.test.ts b/packages/appkit/src/core/agent/tests/define-tool.test.ts index 829a29715..670123253 100644 --- a/packages/appkit/src/core/agent/tests/define-tool.test.ts +++ b/packages/appkit/src/core/agent/tests/define-tool.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test, vi } from "vitest"; import { z } from "zod"; + import { defineTool, executeFromRegistry, diff --git a/packages/appkit/src/core/agent/tests/function-tool.test.ts b/packages/appkit/src/core/agent/tests/function-tool.test.ts index 2f8788b3e..aceb4cebb 100644 --- a/packages/appkit/src/core/agent/tests/function-tool.test.ts +++ b/packages/appkit/src/core/agent/tests/function-tool.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { functionToolToDefinition, isFunctionTool, diff --git a/packages/appkit/src/core/agent/tests/hosted-tools.test.ts b/packages/appkit/src/core/agent/tests/hosted-tools.test.ts index d62b266b4..76f9f483f 100644 --- a/packages/appkit/src/core/agent/tests/hosted-tools.test.ts +++ b/packages/appkit/src/core/agent/tests/hosted-tools.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { isHostedTool, resolveHostedTools } from "../tools/hosted-tools"; describe("isHostedTool", () => { diff --git a/packages/appkit/src/core/agent/tests/load-agents.test.ts b/packages/appkit/src/core/agent/tests/load-agents.test.ts index de07e5be9..a25ace024 100644 --- a/packages/appkit/src/core/agent/tests/load-agents.test.ts +++ b/packages/appkit/src/core/agent/tests/load-agents.test.ts @@ -1,8 +1,10 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; import { z } from "zod"; + import { buildToolkitEntries } from "../../../core/agent/build-toolkit"; import { defineTool, diff --git a/packages/appkit/src/core/agent/tests/mcp-server-helper.test.ts b/packages/appkit/src/core/agent/tests/mcp-server-helper.test.ts index 2ee1347a2..0be5c6020 100644 --- a/packages/appkit/src/core/agent/tests/mcp-server-helper.test.ts +++ b/packages/appkit/src/core/agent/tests/mcp-server-helper.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { isHostedTool, mcpServer, diff --git a/packages/appkit/src/core/agent/tests/normalize-result.test.ts b/packages/appkit/src/core/agent/tests/normalize-result.test.ts index 96270f96d..7483291d8 100644 --- a/packages/appkit/src/core/agent/tests/normalize-result.test.ts +++ b/packages/appkit/src/core/agent/tests/normalize-result.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { MAX_TOOL_RESULT_CHARS, normalizeToolResult, diff --git a/packages/appkit/src/core/agent/tests/run-agent.test.ts b/packages/appkit/src/core/agent/tests/run-agent.test.ts index efd3e4202..efaa0356b 100644 --- a/packages/appkit/src/core/agent/tests/run-agent.test.ts +++ b/packages/appkit/src/core/agent/tests/run-agent.test.ts @@ -10,6 +10,7 @@ import type { } from "shared"; import { describe, expect, test, vi } from "vitest"; import { z } from "zod"; + import { createAgent } from "../create-agent"; import { runAgent } from "../run-agent"; import { mcpServer } from "../tools/hosted-tools"; @@ -80,7 +81,7 @@ describe("runAgent", () => { await runAgent(def, { messages: "hi" }); expect(capturedCtx).not.toBeNull(); - // biome-ignore lint/style/noNonNullAssertion: asserted above + // oxlint-disable-next-line typescript/no-non-null-assertion -- asserted above const result = await capturedCtx!.executeTool("get_weather", { city: "NYC", }); @@ -136,7 +137,7 @@ describe("runAgent", () => { await runAgent(def, { messages: "hi", plugins: [pluginData] }); expect(capturedCtx).not.toBeNull(); - // biome-ignore lint/style/noNonNullAssertion: asserted above + // oxlint-disable-next-line typescript/no-non-null-assertion -- asserted above const result = await capturedCtx!.executeTool("ping.ping", {}); expect(result).toBe("pong"); expect(pingExec).toHaveBeenCalled(); @@ -208,7 +209,6 @@ describe("runAgent", () => { // emits a function_call mid-conversation. const def = createAgent({ instructions: "x", - // biome-ignore lint/suspicious/noExplicitAny: stub adapter — we never reach it model: { async *run() {} } as any, tools: { analytics: mcpServer("analytics-mcp", "https://example.com/mcp"), @@ -252,8 +252,8 @@ describe("runAgent", () => { await runAgent(parent, { messages: "go" }); expect(capturedCtx).not.toBeNull(); const result = - await // biome-ignore lint/style/noNonNullAssertion: asserted above - capturedCtx!.executeTool("agent-helper", { input: "say hi" }); + // oxlint-disable-next-line typescript/no-non-null-assertion -- asserted above + await capturedCtx!.executeTool("agent-helper", { input: "say hi" }); expect(result).toBe("child says hi"); }); @@ -441,9 +441,8 @@ describe("runAgent", () => { // gets classified as `hosted-supervisor`; its placeholder def is kept // out of `input.tools` (the spec doesn't expose a callable function) // and the spec is routed via `input.extensions[SUPERVISOR_EXTENSION_KEY]`. - const { supervisorTools, SUPERVISOR_EXTENSION_KEY } = await import( - "../../../agents/supervisor-api" - ); + const { supervisorTools, SUPERVISOR_EXTENSION_KEY } = + await import("../../../agents/supervisor-api"); let captured: AgentInput | null = null; const adapter: AgentAdapter = { @@ -470,7 +469,7 @@ describe("runAgent", () => { expect(result.text).toBe("ok"); expect(captured).not.toBeNull(); - // biome-ignore lint/style/noNonNullAssertion: asserted above + // oxlint-disable-next-line typescript/no-non-null-assertion -- asserted above const inp = captured!; expect(inp.tools).toEqual([]); expect(inp.extensions?.[SUPERVISOR_EXTENSION_KEY]).toEqual({ diff --git a/packages/appkit/src/core/agent/tests/sql-policy.test.ts b/packages/appkit/src/core/agent/tests/sql-policy.test.ts index fb81493ec..d17179b4b 100644 --- a/packages/appkit/src/core/agent/tests/sql-policy.test.ts +++ b/packages/appkit/src/core/agent/tests/sql-policy.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { assertReadOnlySql, classifyReadOnly, diff --git a/packages/appkit/src/core/agent/tests/system-prompt.test.ts b/packages/appkit/src/core/agent/tests/system-prompt.test.ts index 25724259e..2f1f454cd 100644 --- a/packages/appkit/src/core/agent/tests/system-prompt.test.ts +++ b/packages/appkit/src/core/agent/tests/system-prompt.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { buildBaseSystemPrompt, composeSystemPrompt } from "../system-prompt"; const emptyCtx = { diff --git a/packages/appkit/src/core/agent/tests/tool.test.ts b/packages/appkit/src/core/agent/tests/tool.test.ts index be9803782..aecc5b854 100644 --- a/packages/appkit/src/core/agent/tests/tool.test.ts +++ b/packages/appkit/src/core/agent/tests/tool.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "vitest"; import { z } from "zod"; + import { formatZodError, tool } from "../tools/tool"; describe("tool()", () => { diff --git a/packages/appkit/src/core/agent/tests/toolkit-options.test.ts b/packages/appkit/src/core/agent/tests/toolkit-options.test.ts index 763aa4f55..05afacf08 100644 --- a/packages/appkit/src/core/agent/tests/toolkit-options.test.ts +++ b/packages/appkit/src/core/agent/tests/toolkit-options.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { applyToolkitOptions } from "../toolkit-options"; describe("applyToolkitOptions", () => { diff --git a/packages/appkit/src/core/agent/toolkit-resolver.ts b/packages/appkit/src/core/agent/toolkit-resolver.ts index 97d1d9b30..0d1d06abf 100644 --- a/packages/appkit/src/core/agent/toolkit-resolver.ts +++ b/packages/appkit/src/core/agent/toolkit-resolver.ts @@ -1,4 +1,5 @@ import type { ToolProvider } from "shared"; + import { applyToolkitOptions } from "./toolkit-options"; import type { ToolkitEntry, ToolkitOptions } from "./types"; diff --git a/packages/appkit/src/core/agent/tools/define-tool.ts b/packages/appkit/src/core/agent/tools/define-tool.ts index 047eaaf94..997f85955 100644 --- a/packages/appkit/src/core/agent/tools/define-tool.ts +++ b/packages/appkit/src/core/agent/tools/define-tool.ts @@ -1,5 +1,6 @@ import type { AgentToolDefinition, ToolAnnotations } from "shared"; import type { z } from "zod"; + import { toToolJSONSchema } from "./json-schema"; import { formatZodError } from "./tool"; diff --git a/packages/appkit/src/core/agent/tools/tool.ts b/packages/appkit/src/core/agent/tools/tool.ts index 6ebdaa9bb..62092f217 100644 --- a/packages/appkit/src/core/agent/tools/tool.ts +++ b/packages/appkit/src/core/agent/tools/tool.ts @@ -1,5 +1,6 @@ import type { ToolAnnotations } from "shared"; import type { z } from "zod"; + import type { FunctionTool } from "./function-tool"; import { toToolJSONSchema } from "./json-schema"; diff --git a/packages/appkit/src/core/agent/types.ts b/packages/appkit/src/core/agent/types.ts index 572879565..d322c495f 100644 --- a/packages/appkit/src/core/agent/types.ts +++ b/packages/appkit/src/core/agent/types.ts @@ -5,6 +5,7 @@ import type { ThreadStore, ToolAnnotations, } from "shared"; + import type { GenerationParams } from "../../agents/databricks"; import type { McpHostPolicyConfig } from "../../connectors/mcp"; import type { FunctionTool } from "./tools/function-tool"; diff --git a/packages/appkit/src/core/appkit.ts b/packages/appkit/src/core/appkit.ts index 201acf190..0ccfd64e9 100644 --- a/packages/appkit/src/core/appkit.ts +++ b/packages/appkit/src/core/appkit.ts @@ -7,6 +7,7 @@ import type { PluginData, PluginMap, } from "shared"; + import { version as productVersion } from "../../package.json"; import { CacheManager } from "../cache"; import { ServiceContext } from "../context"; diff --git a/packages/appkit/src/core/lifecycle-manager.ts b/packages/appkit/src/core/lifecycle-manager.ts index 8d1811203..84dcb4a9e 100644 --- a/packages/appkit/src/core/lifecycle-manager.ts +++ b/packages/appkit/src/core/lifecycle-manager.ts @@ -1,4 +1,5 @@ import type { BasePlugin } from "shared"; + import { CacheManager } from "../cache"; import { TelemetryReporter } from "../internal-telemetry"; import { createLogger } from "../logging/logger"; diff --git a/packages/appkit/src/core/plugin-context.ts b/packages/appkit/src/core/plugin-context.ts index 4f08dcd91..2a89d33c3 100644 --- a/packages/appkit/src/core/plugin-context.ts +++ b/packages/appkit/src/core/plugin-context.ts @@ -1,5 +1,6 @@ import type express from "express"; import type { BasePlugin, IAppRequest, ToolProvider } from "shared"; + import { createLogger } from "../logging/logger"; import { SpanStatusCode, TelemetryManager } from "../telemetry"; import { forwardAsyncErrors } from "../utils/safe-handler"; diff --git a/packages/appkit/src/core/tests/appkit-as-user-exports.test.ts b/packages/appkit/src/core/tests/appkit-as-user-exports.test.ts index 7cbadcd32..45467625d 100644 --- a/packages/appkit/src/core/tests/appkit-as-user-exports.test.ts +++ b/packages/appkit/src/core/tests/appkit-as-user-exports.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { UserContext } from "../../context/user-context"; /** @@ -83,6 +84,7 @@ vi.mock("../../internal-telemetry", () => ({ // ── Imports (after mocks) ─────────────────────────────────────────── import { createMockRequest, setupDatabricksEnv } from "@tools/test-helpers"; + import { getUserContext } from "../../context/execution-context"; import { ServiceContext } from "../../context/service-context"; import { Plugin } from "../../plugin/plugin"; diff --git a/packages/appkit/src/core/tests/databricks.test.ts b/packages/appkit/src/core/tests/databricks.test.ts index b3abc5bea..f5cce386f 100644 --- a/packages/appkit/src/core/tests/databricks.test.ts +++ b/packages/appkit/src/core/tests/databricks.test.ts @@ -1,6 +1,7 @@ import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import type { BasePlugin } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { ServiceContext } from "../../context/service-context"; import { uiVariants } from "../../plugins/ui-variants"; import type { PluginManifest } from "../../registry/types"; @@ -804,9 +805,8 @@ describe("AppKit", () => { }); test("skips bootstrap when isInternalTelemetryEnabled returns false", async () => { - const { isInternalTelemetryEnabled, TelemetryReporter } = await import( - "../../internal-telemetry" - ); + const { isInternalTelemetryEnabled, TelemetryReporter } = + await import("../../internal-telemetry"); vi.mocked(TelemetryReporter.initialize).mockClear(); mockReporter.sendStartup.mockClear(); vi.mocked(isInternalTelemetryEnabled).mockReturnValue(false); diff --git a/packages/appkit/src/core/tests/plugin-context.test.ts b/packages/appkit/src/core/tests/plugin-context.test.ts index 3f548ec57..194056635 100644 --- a/packages/appkit/src/core/tests/plugin-context.test.ts +++ b/packages/appkit/src/core/tests/plugin-context.test.ts @@ -1,5 +1,6 @@ import type { AgentToolDefinition } from "shared"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { isToolProvider, PluginContext } from "../plugin-context"; /** diff --git a/packages/appkit/src/database/contract/registry.ts b/packages/appkit/src/database/contract/registry.ts index de42f6697..becbc2367 100644 --- a/packages/appkit/src/database/contract/registry.ts +++ b/packages/appkit/src/database/contract/registry.ts @@ -16,7 +16,7 @@ export interface DatabaseRegistryEntry { * CANONICAL augmentation target. Empty by default; the generated `database.d.ts` * augments it via `declare module "@databricks/appkit" { interface DatabaseRegistry { ... } }`. */ -// biome-ignore lint/suspicious/noEmptyInterface: augmentation target, populated by typegen. +// oxlint-disable-next-line typescript/no-empty-object-type -- augmentation target, populated by typegen. export interface DatabaseRegistry {} /** Literal entity keys present after typegen, or `never` before it has run. */ diff --git a/packages/appkit/src/database/contract/tests/column-info.test.ts b/packages/appkit/src/database/contract/tests/column-info.test.ts index 79abdd621..aaae44ef8 100644 --- a/packages/appkit/src/database/contract/tests/column-info.test.ts +++ b/packages/appkit/src/database/contract/tests/column-info.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { type ColumnInfo, type ColumnInfoKind, diff --git a/packages/appkit/src/database/contract/tests/registry.test.ts b/packages/appkit/src/database/contract/tests/registry.test.ts index 30e0c4f6e..8913c5b66 100644 --- a/packages/appkit/src/database/contract/tests/registry.test.ts +++ b/packages/appkit/src/database/contract/tests/registry.test.ts @@ -1,4 +1,5 @@ import { describe, expectTypeOf, it } from "vitest"; + import type { DatabaseRegistryEntry, ReferentialAction, diff --git a/packages/appkit/src/database/contract/tests/wire.test.ts b/packages/appkit/src/database/contract/tests/wire.test.ts index 727f2cf25..ec968ce6a 100644 --- a/packages/appkit/src/database/contract/tests/wire.test.ts +++ b/packages/appkit/src/database/contract/tests/wire.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { DEFAULT_LIMIT, FILTER_OPERATORS, diff --git a/packages/appkit/src/database/schema-builder/engine/relations.ts b/packages/appkit/src/database/schema-builder/engine/relations.ts index 7274b4950..21ae0d280 100644 --- a/packages/appkit/src/database/schema-builder/engine/relations.ts +++ b/packages/appkit/src/database/schema-builder/engine/relations.ts @@ -1,5 +1,6 @@ import { type Relation, relations } from "drizzle-orm"; import type { AnyPgColumn, PgTable } from "drizzle-orm/pg-core"; + import type { AppKitTable } from "../types"; function columnOf(table: PgTable, name: string): AnyPgColumn { diff --git a/packages/appkit/src/database/schema-builder/engine/tables.ts b/packages/appkit/src/database/schema-builder/engine/tables.ts index 7a500be8d..d7d7d8239 100644 --- a/packages/appkit/src/database/schema-builder/engine/tables.ts +++ b/packages/appkit/src/database/schema-builder/engine/tables.ts @@ -17,6 +17,7 @@ import { varchar as pgVarchar, serial, } from "drizzle-orm/pg-core"; + import type { ReferentialAction } from "../../contract"; import { APPKIT_TABLE } from "../private"; import { @@ -95,7 +96,7 @@ function baseColumn( builder = pgJsonb(col); break; case "enum": - // biome-ignore lint/style/noNonNullAssertion: enum metas always carry an enumName. + // oxlint-disable-next-line typescript/no-non-null-assertion -- enum metas always carry an enumName. builder = getEnum(enums, meta.enumName!, meta.enumValues ?? [])(col); break; } diff --git a/packages/appkit/src/database/schema-builder/tests/columns.test.ts b/packages/appkit/src/database/schema-builder/tests/columns.test.ts index 8e2e52c62..e2ef54a01 100644 --- a/packages/appkit/src/database/schema-builder/tests/columns.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/columns.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { bigid, bigint, diff --git a/packages/appkit/src/database/schema-builder/tests/define-schema.test.ts b/packages/appkit/src/database/schema-builder/tests/define-schema.test.ts index c03b6903c..5bf9e2b8c 100644 --- a/packages/appkit/src/database/schema-builder/tests/define-schema.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/define-schema.test.ts @@ -1,5 +1,6 @@ import { getTableConfig, type PgTable } from "drizzle-orm/pg-core"; import { describe, expect, it } from "vitest"; + import { APPKIT_TABLE, type AppKitTable, diff --git a/packages/appkit/src/database/schema-builder/tests/engine-relations.test.ts b/packages/appkit/src/database/schema-builder/tests/engine-relations.test.ts index 70a16e1fa..7e6a7fead 100644 --- a/packages/appkit/src/database/schema-builder/tests/engine-relations.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/engine-relations.test.ts @@ -1,6 +1,7 @@ import { createTableRelationsHelpers, Many, One } from "drizzle-orm"; import type { PgTable } from "drizzle-orm/pg-core"; import { describe, expect, it } from "vitest"; + import { buildEngineRelations, defineSchema, fk, id, text } from "../index"; /** Structural view of a Drizzle `relations()` object (avoids leaning on internals' exact types). */ diff --git a/packages/appkit/src/database/schema-builder/tests/fk.test.ts b/packages/appkit/src/database/schema-builder/tests/fk.test.ts index ae7c1113a..a4f9739cf 100644 --- a/packages/appkit/src/database/schema-builder/tests/fk.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/fk.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { mirrorStorageKind, resolveFkRef } from "../fk"; import { type ColumnRef, fk, type StorageKind } from "../index"; diff --git a/packages/appkit/src/database/schema-builder/tests/private.test.ts b/packages/appkit/src/database/schema-builder/tests/private.test.ts index 634d8e7ac..7fd6b7ead 100644 --- a/packages/appkit/src/database/schema-builder/tests/private.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/private.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { defineSchema, fk, diff --git a/packages/appkit/src/database/schema-builder/tests/relations.test.ts b/packages/appkit/src/database/schema-builder/tests/relations.test.ts index 661032d42..73bb491da 100644 --- a/packages/appkit/src/database/schema-builder/tests/relations.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/relations.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { type AppKitTable, buildRelations, diff --git a/packages/appkit/src/database/schema-builder/tests/validators.test.ts b/packages/appkit/src/database/schema-builder/tests/validators.test.ts index 6fbe56d44..fec5213d6 100644 --- a/packages/appkit/src/database/schema-builder/tests/validators.test.ts +++ b/packages/appkit/src/database/schema-builder/tests/validators.test.ts @@ -1,5 +1,6 @@ import { describe, expect, it } from "vitest"; import type { ZodType } from "zod"; + import { type AppKitTable, bigint, diff --git a/packages/appkit/src/database/schema-builder/validators.ts b/packages/appkit/src/database/schema-builder/validators.ts index 9efe9f206..eda0bb580 100644 --- a/packages/appkit/src/database/schema-builder/validators.ts +++ b/packages/appkit/src/database/schema-builder/validators.ts @@ -1,5 +1,6 @@ import type { ZodType } from "zod"; import { z } from "zod"; + import type { AppKitTable, ColumnMeta } from "./types"; /** Map an engine-neutral ColumnMeta.kind to a Zod base type */ diff --git a/packages/appkit/src/errors/configuration.ts b/packages/appkit/src/errors/configuration.ts index d701adfe1..e1030fd11 100644 --- a/packages/appkit/src/errors/configuration.ts +++ b/packages/appkit/src/errors/configuration.ts @@ -1,4 +1,5 @@ import pc from "picocolors"; + import { AppKitError } from "./base"; function authSetupVerbose(): boolean { diff --git a/packages/appkit/src/errors/tests/errors.test.ts b/packages/appkit/src/errors/tests/errors.test.ts index 347ce1c0d..b16d6fc67 100644 --- a/packages/appkit/src/errors/tests/errors.test.ts +++ b/packages/appkit/src/errors/tests/errors.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { AppKitError, AuthenticationError, diff --git a/packages/appkit/src/internal-telemetry/tests/appkit-log.test.ts b/packages/appkit/src/internal-telemetry/tests/appkit-log.test.ts index 6d419f0f9..8dee82e26 100644 --- a/packages/appkit/src/internal-telemetry/tests/appkit-log.test.ts +++ b/packages/appkit/src/internal-telemetry/tests/appkit-log.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { buildAppkitPayload, wrapAppkitLog } from "../appkit-log"; describe("appkit-log", () => { diff --git a/packages/appkit/src/internal-telemetry/tests/config.test.ts b/packages/appkit/src/internal-telemetry/tests/config.test.ts index 76f3842c9..4140b9033 100644 --- a/packages/appkit/src/internal-telemetry/tests/config.test.ts +++ b/packages/appkit/src/internal-telemetry/tests/config.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import { isInternalTelemetryEnabled } from "../config"; afterEach(() => { diff --git a/packages/appkit/src/internal-telemetry/tests/reporter.test.ts b/packages/appkit/src/internal-telemetry/tests/reporter.test.ts index 01f2b36fd..a571e4d3e 100644 --- a/packages/appkit/src/internal-telemetry/tests/reporter.test.ts +++ b/packages/appkit/src/internal-telemetry/tests/reporter.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import type { WorkspaceClient } from "../../workspace-client"; import { TelemetryReporter } from "../reporter"; diff --git a/packages/appkit/src/logging/logger.ts b/packages/appkit/src/logging/logger.ts index 33aeecaf0..5c6cbc222 100644 --- a/packages/appkit/src/logging/logger.ts +++ b/packages/appkit/src/logging/logger.ts @@ -1,8 +1,10 @@ import { AsyncLocalStorage } from "node:async_hooks"; import { format } from "node:util"; + import { trace } from "@opentelemetry/api"; import type { NextFunction, Request, Response } from "express"; import { createDebug as createObug } from "obug"; + import { DEFAULT_SAMPLING_CONFIG, shouldSample } from "./sampling"; import { WideEvent } from "./wide-event"; import { WideEventEmitter } from "./wide-event-emitter"; diff --git a/packages/appkit/src/logging/tests/logger-with-event.test.ts b/packages/appkit/src/logging/tests/logger-with-event.test.ts index 022419e2a..4f53fb5cc 100644 --- a/packages/appkit/src/logging/tests/logger-with-event.test.ts +++ b/packages/appkit/src/logging/tests/logger-with-event.test.ts @@ -1,5 +1,6 @@ import type { Request, Response } from "express"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { createLogger } from "../logger"; import { WideEvent } from "../wide-event"; diff --git a/packages/appkit/src/logging/tests/logger.test.ts b/packages/appkit/src/logging/tests/logger.test.ts index d17063280..c38813dc2 100644 --- a/packages/appkit/src/logging/tests/logger.test.ts +++ b/packages/appkit/src/logging/tests/logger.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { createLogger } from "../logger"; describe("createLogger", () => { diff --git a/packages/appkit/src/logging/tests/sampling.test.ts b/packages/appkit/src/logging/tests/sampling.test.ts index de87ae143..849b9fba6 100644 --- a/packages/appkit/src/logging/tests/sampling.test.ts +++ b/packages/appkit/src/logging/tests/sampling.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { DEFAULT_SAMPLING_CONFIG, shouldSample } from "../sampling"; import type { WideEventData } from "../wide-event"; diff --git a/packages/appkit/src/logging/tests/wide-event-emitter.test.ts b/packages/appkit/src/logging/tests/wide-event-emitter.test.ts index 22934f3eb..da523773f 100644 --- a/packages/appkit/src/logging/tests/wide-event-emitter.test.ts +++ b/packages/appkit/src/logging/tests/wide-event-emitter.test.ts @@ -1,5 +1,6 @@ import { logs } from "@opentelemetry/api-logs"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import type { WideEventData } from "../wide-event"; import { WideEventEmitter } from "../wide-event-emitter"; diff --git a/packages/appkit/src/logging/tests/wide-event.test.ts b/packages/appkit/src/logging/tests/wide-event.test.ts index 14fa527cd..2411728a8 100644 --- a/packages/appkit/src/logging/tests/wide-event.test.ts +++ b/packages/appkit/src/logging/tests/wide-event.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { WideEvent } from "../wide-event"; describe("WideEvent", () => { diff --git a/packages/appkit/src/logging/wide-event-emitter.ts b/packages/appkit/src/logging/wide-event-emitter.ts index 3c96c0574..b9b0370ff 100644 --- a/packages/appkit/src/logging/wide-event-emitter.ts +++ b/packages/appkit/src/logging/wide-event-emitter.ts @@ -1,4 +1,5 @@ import { logs, SeverityNumber } from "@opentelemetry/api-logs"; + import type { WideEventData } from "./wide-event"; /** diff --git a/packages/appkit/src/plugin/dev-reader.ts b/packages/appkit/src/plugin/dev-reader.ts index 8aa4ba6ad..77d222861 100644 --- a/packages/appkit/src/plugin/dev-reader.ts +++ b/packages/appkit/src/plugin/dev-reader.ts @@ -1,5 +1,7 @@ import { randomUUID } from "node:crypto"; + import type { TunnelConnection } from "shared"; + import { TunnelError } from "../errors"; import { createLogger } from "../logging/logger"; import { isRemoteTunnelAllowedByEnv } from "../plugins/server/remote-tunnel/gate"; diff --git a/packages/appkit/src/plugin/interceptors/cache.ts b/packages/appkit/src/plugin/interceptors/cache.ts index d1637afed..22e2bca51 100644 --- a/packages/appkit/src/plugin/interceptors/cache.ts +++ b/packages/appkit/src/plugin/interceptors/cache.ts @@ -1,4 +1,5 @@ import type { CacheConfig } from "shared"; + import type { CacheManager } from "../../cache"; import type { ExecutionInterceptor, InterceptorContext } from "./types"; diff --git a/packages/appkit/src/plugin/interceptors/retry.ts b/packages/appkit/src/plugin/interceptors/retry.ts index aeddf3d50..3d5acd77b 100644 --- a/packages/appkit/src/plugin/interceptors/retry.ts +++ b/packages/appkit/src/plugin/interceptors/retry.ts @@ -1,4 +1,5 @@ import type { RetryConfig } from "shared"; + import { AppKitError } from "../../errors/base"; import { createLogger } from "../../logging/logger"; import type { ExecutionInterceptor, InterceptorContext } from "./types"; diff --git a/packages/appkit/src/plugin/interceptors/telemetry.ts b/packages/appkit/src/plugin/interceptors/telemetry.ts index 2dd2d6a15..f21bb5517 100644 --- a/packages/appkit/src/plugin/interceptors/telemetry.ts +++ b/packages/appkit/src/plugin/interceptors/telemetry.ts @@ -1,4 +1,5 @@ import type { TelemetryConfig } from "shared"; + import { getCurrentUserId, isInUserContext, diff --git a/packages/appkit/src/plugin/plugin.ts b/packages/appkit/src/plugin/plugin.ts index ee403a924..fbe5fcb1a 100644 --- a/packages/appkit/src/plugin/plugin.ts +++ b/packages/appkit/src/plugin/plugin.ts @@ -13,6 +13,7 @@ import type { StreamExecutionSettings, } from "shared"; import { camelToKebab } from "shared"; + import { AppManager } from "../app"; import { CacheManager } from "../cache"; import { getCurrentUserId, runInUserContext, ServiceContext } from "../context"; @@ -217,8 +218,7 @@ const EXCLUDED_FROM_PROXY = new Set([ */ export abstract class Plugin< TConfig extends BasePluginConfig = BasePluginConfig, -> implements BasePlugin -{ +> implements BasePlugin { protected isReady = false; protected cache!: CacheManager; protected app: AppManager; diff --git a/packages/appkit/src/plugin/tests/asUser-proxy.test.ts b/packages/appkit/src/plugin/tests/asUser-proxy.test.ts index 50d76f980..2566f2869 100644 --- a/packages/appkit/src/plugin/tests/asUser-proxy.test.ts +++ b/packages/appkit/src/plugin/tests/asUser-proxy.test.ts @@ -31,6 +31,7 @@ import { test, vi, } from "vitest"; + import { AppManager } from "../../app"; import { CacheManager } from "../../cache"; import { getUserContext } from "../../context/execution-context"; diff --git a/packages/appkit/src/plugin/tests/cache.test.ts b/packages/appkit/src/plugin/tests/cache.test.ts index 12730f67b..86bf09a39 100644 --- a/packages/appkit/src/plugin/tests/cache.test.ts +++ b/packages/appkit/src/plugin/tests/cache.test.ts @@ -1,5 +1,6 @@ import type { CacheConfig } from "shared"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheInterceptor } from "../interceptors/cache"; import type { InterceptorContext } from "../interceptors/types"; diff --git a/packages/appkit/src/plugin/tests/dev-reader.test.ts b/packages/appkit/src/plugin/tests/dev-reader.test.ts index 28e2f5bfc..bd7de0a0d 100644 --- a/packages/appkit/src/plugin/tests/dev-reader.test.ts +++ b/packages/appkit/src/plugin/tests/dev-reader.test.ts @@ -1,5 +1,6 @@ import type { TunnelConnection } from "shared"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { TunnelError } from "../../errors"; // Mock the gate to allow remote tunnel in tests diff --git a/packages/appkit/src/plugin/tests/plugin.test.ts b/packages/appkit/src/plugin/tests/plugin.test.ts index 2362fb8c8..12108f7c4 100644 --- a/packages/appkit/src/plugin/tests/plugin.test.ts +++ b/packages/appkit/src/plugin/tests/plugin.test.ts @@ -21,6 +21,7 @@ import { test, vi, } from "vitest"; + import { AppManager } from "../../app"; import { CacheManager } from "../../cache"; import { ServiceContext } from "../../context/service-context"; @@ -680,9 +681,8 @@ describe("Plugin", () => { expect(interceptors).toHaveLength(4); // telemetry + timeout + retry + cache // Import interceptor classes dynamically to avoid module resolution issues - const { TelemetryInterceptor } = await import( - "../interceptors/telemetry" - ); + const { TelemetryInterceptor } = + await import("../interceptors/telemetry"); const { TimeoutInterceptor } = await import("../interceptors/timeout"); const { RetryInterceptor } = await import("../interceptors/retry"); const { CacheInterceptor } = await import("../interceptors/cache"); diff --git a/packages/appkit/src/plugin/tests/retry.test.ts b/packages/appkit/src/plugin/tests/retry.test.ts index f6976f114..e1bb61d0f 100644 --- a/packages/appkit/src/plugin/tests/retry.test.ts +++ b/packages/appkit/src/plugin/tests/retry.test.ts @@ -1,5 +1,6 @@ import type { RetryConfig } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { AuthenticationError } from "../../errors/authentication"; import { ConnectionError } from "../../errors/connection"; import { ExecutionError } from "../../errors/execution"; diff --git a/packages/appkit/src/plugin/tests/timeout.test.ts b/packages/appkit/src/plugin/tests/timeout.test.ts index b065bcb64..c1f3a584a 100644 --- a/packages/appkit/src/plugin/tests/timeout.test.ts +++ b/packages/appkit/src/plugin/tests/timeout.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { TimeoutInterceptor } from "../interceptors/timeout"; import type { InterceptorContext } from "../interceptors/types"; diff --git a/packages/appkit/src/plugins/agents/agents.ts b/packages/appkit/src/plugins/agents/agents.ts index 1d9162a96..6f755462d 100644 --- a/packages/appkit/src/plugins/agents/agents.ts +++ b/packages/appkit/src/plugins/agents/agents.ts @@ -1,5 +1,6 @@ import { randomUUID } from "node:crypto"; import path from "node:path"; + import type express from "express"; import pc from "picocolors"; import type { @@ -15,6 +16,7 @@ import type { ToolAnnotations, ToolProvider, } from "shared"; + import { isSupervisorTool, SUPERVISOR_EXTENSION_KEY, @@ -147,7 +149,7 @@ export class AgentsPlugin extends Plugin implements ToolProvider { static manifest = manifest as unknown as PluginManifest; static phase: PluginPhase = "deferred"; - protected declare config: AgentsPluginConfig; + declare protected config: AgentsPluginConfig; private agents = new Map(); private defaultAgentName: string | null = null; diff --git a/packages/appkit/src/plugins/agents/event-translator.ts b/packages/appkit/src/plugins/agents/event-translator.ts index 54d749fb0..ecaa2aab5 100644 --- a/packages/appkit/src/plugins/agents/event-translator.ts +++ b/packages/appkit/src/plugins/agents/event-translator.ts @@ -1,4 +1,5 @@ import { randomUUID } from "node:crypto"; + import type { AgentEvent, ResponseFunctionCallOutput, diff --git a/packages/appkit/src/plugins/agents/tests/agents-plugin.test.ts b/packages/appkit/src/plugins/agents/tests/agents-plugin.test.ts index 7f6b453b4..8eda5e389 100644 --- a/packages/appkit/src/plugins/agents/tests/agents-plugin.test.ts +++ b/packages/appkit/src/plugins/agents/tests/agents-plugin.test.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import type { AgentAdapter, AgentInput, @@ -10,6 +11,7 @@ import type { } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; import { z } from "zod"; + import { CacheManager } from "../../../cache"; import { buildToolkitEntries } from "../../../core/agent/build-toolkit"; import { @@ -95,7 +97,6 @@ beforeEach(async () => { healthCheck: vi.fn(async () => true), close: vi.fn(async () => {}), }; - // biome-ignore lint/suspicious/noExplicitAny: test-only CacheManager wiring await CacheManager.getInstance({ storage: storage as any }); }); @@ -192,13 +193,11 @@ describe("AgentsPlugin", () => { connectAll: vi.fn(async () => ({ connected: [], failed: [] })), getAllToolDefinitions: () => [], }; - // biome-ignore lint/suspicious/noExplicitAny: seeding private mcpClient (plugin as any).mcpClient = fakeClient; await plugin.setup(); await plugin.reload(); expect(closeSpy).not.toHaveBeenCalled(); - // biome-ignore lint/suspicious/noExplicitAny: read private mcpClient expect((plugin as any).mcpClient).toBe(fakeClient); }); @@ -668,9 +667,8 @@ describe("AgentsPlugin", () => { describe("hosted-supervisor tools and capability negotiation", () => { test("indexes supervisorTools.* entries with source 'hosted-supervisor'", async () => { - const { supervisorTools, SUPERVISOR_EXTENSION_KEY } = await import( - "../../../agents/supervisor-api" - ); + const { supervisorTools, SUPERVISOR_EXTENSION_KEY } = + await import("../../../agents/supervisor-api"); const ctx = fakeContext([]); const saAdapter: AgentAdapter = { @@ -702,7 +700,6 @@ describe("AgentsPlugin", () => { await plugin.setup(); const api = plugin.exports() as { - // biome-ignore lint/suspicious/noExplicitAny: structural test access get: (name: string) => any; }; const entry = api.get("assistant").toolIndex.get("nyc"); @@ -714,9 +711,8 @@ describe("AgentsPlugin", () => { }); test("warns at setup when hosted-supervisor tools paired with non-supervisor adapter", async () => { - const { supervisorTools } = await import( - "../../../agents/supervisor-api" - ); + const { supervisorTools } = + await import("../../../agents/supervisor-api"); const warnSpy = vi.spyOn(console, "warn").mockImplementation(() => {}); const ctx = fakeContext([]); diff --git a/packages/appkit/src/plugins/agents/tests/approval-config.test.ts b/packages/appkit/src/plugins/agents/tests/approval-config.test.ts index 855bf716b..3322b83bb 100644 --- a/packages/appkit/src/plugins/agents/tests/approval-config.test.ts +++ b/packages/appkit/src/plugins/agents/tests/approval-config.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../../cache"; import { AgentsPlugin } from "../agents"; diff --git a/packages/appkit/src/plugins/agents/tests/approval-route.test.ts b/packages/appkit/src/plugins/agents/tests/approval-route.test.ts index 61595fcbf..bddd92522 100644 --- a/packages/appkit/src/plugins/agents/tests/approval-route.test.ts +++ b/packages/appkit/src/plugins/agents/tests/approval-route.test.ts @@ -1,5 +1,6 @@ import type express from "express"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../../cache"; import { AgentsPlugin } from "../agents"; diff --git a/packages/appkit/src/plugins/agents/tests/dispatch-tool-call.test.ts b/packages/appkit/src/plugins/agents/tests/dispatch-tool-call.test.ts index 2767766c3..55a03934b 100644 --- a/packages/appkit/src/plugins/agents/tests/dispatch-tool-call.test.ts +++ b/packages/appkit/src/plugins/agents/tests/dispatch-tool-call.test.ts @@ -1,5 +1,6 @@ import type express from "express"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../../cache"; import { AgentsPlugin } from "../agents"; @@ -23,7 +24,6 @@ import { AgentsPlugin } from "../agents"; beforeEach(() => { // dispatchToolCall is exercised without going through setup(), so we // need the cache singleton to be initialised before the plugin reads it. - // biome-ignore lint/suspicious/noExplicitAny: test seam, mirrors other suites (CacheManager as any).instance = { get: vi.fn(), set: vi.fn(), @@ -124,7 +124,6 @@ describe("dispatchToolCall — approval gate honours `effect`", () => { ], ]); - // biome-ignore lint/suspicious/noExplicitAny: stub the gate to simulate user approval (plugin as any).approvalGate.wait = vi.fn().mockResolvedValue("approve"); await callDispatch(plugin, { @@ -134,7 +133,6 @@ describe("dispatchToolCall — approval gate honours `effect`", () => { args: {}, }); - // biome-ignore lint/suspicious/noExplicitAny: gate is private but stubbed above expect((plugin as any).approvalGate.wait).toHaveBeenCalledTimes(1); expect(pushed.length).toBeGreaterThan(0); expect(execute).toHaveBeenCalledTimes(1); @@ -166,7 +164,6 @@ describe("dispatchToolCall — approval gate honours `effect`", () => { ], ]); - // biome-ignore lint/suspicious/noExplicitAny: stub gate (plugin as any).approvalGate.wait = vi.fn(); await callDispatch(plugin, { @@ -176,7 +173,6 @@ describe("dispatchToolCall — approval gate honours `effect`", () => { args: {}, }); - // biome-ignore lint/suspicious/noExplicitAny: assertions on stub expect((plugin as any).approvalGate.wait).toHaveBeenCalledTimes( expectGate ? 1 : 0, ); @@ -204,7 +200,6 @@ describe("dispatchToolCall — approval gate honours `effect`", () => { ], ]); - // biome-ignore lint/suspicious/noExplicitAny: stub deny (plugin as any).approvalGate.wait = vi.fn().mockResolvedValue("deny"); const result = await callDispatch(plugin, { @@ -295,7 +290,6 @@ describe("dispatchToolCall — toolkit timeout plumbing", () => { runState.limits.toolCallTimeoutMs = 90_000; const executeTool = vi.fn().mockResolvedValue("rows"); - // biome-ignore lint/suspicious/noExplicitAny: stub PluginContext shape (plugin as any).context = { executeTool }; const toolIndex = new Map([ @@ -331,7 +325,6 @@ describe("dispatchToolCall — toolkit timeout plumbing", () => { test("resolvedLimits exposes the documented 5-minute default", () => { const plugin = new AgentsPlugin({ dir: false }); - // biome-ignore lint/suspicious/noExplicitAny: read private getter const limits = (plugin as any).resolvedLimits; expect(limits.toolCallTimeoutMs).toBe(300_000); }); @@ -341,7 +334,6 @@ describe("dispatchToolCall — toolkit timeout plumbing", () => { dir: false, limits: { toolCallTimeoutMs: 600_000 }, }); - // biome-ignore lint/suspicious/noExplicitAny: read private const limits = (plugin as any).resolvedLimits; expect(limits.toolCallTimeoutMs).toBe(600_000); }); @@ -374,11 +366,9 @@ describe("runSubAgent — sub-agent event forwarding", () => { instructions: "test", adapter: { run: childRun }, toolIndex: new Map(), - // biome-ignore lint/suspicious/noExplicitAny: minimal stub } as any; await expect( - // biome-ignore lint/suspicious/noExplicitAny: call private (plugin as any).runSubAgent(runState, child, { input: "go" }, 3), ).rejects.toThrow(/Sub-agent depth exceeded \(limit 2\)/); expect(childRun).not.toHaveBeenCalled(); @@ -392,7 +382,6 @@ describe("runSubAgent — sub-agent event forwarding", () => { name: "child", instructions: "test", adapter: { - // biome-ignore lint/suspicious/noExplicitAny: stub adapter shape async *run(): any { yield { type: "metadata", data: { threadId: "child-thread" } }; yield { @@ -406,10 +395,8 @@ describe("runSubAgent — sub-agent event forwarding", () => { }, }, toolIndex: new Map(), - // biome-ignore lint/suspicious/noExplicitAny: minimal stub } as any; - // biome-ignore lint/suspicious/noExplicitAny: call private await (plugin as any).runSubAgent(runState, child, { input: "go" }, 1); const types = pushed.map((e) => (e as { type: string }).type); diff --git a/packages/appkit/src/plugins/agents/tests/dos-limits.test.ts b/packages/appkit/src/plugins/agents/tests/dos-limits.test.ts index 2a4e4a221..2713e50b9 100644 --- a/packages/appkit/src/plugins/agents/tests/dos-limits.test.ts +++ b/packages/appkit/src/plugins/agents/tests/dos-limits.test.ts @@ -1,5 +1,6 @@ import type express from "express"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../../cache"; import { AgentsPlugin } from "../agents"; import { chatRequestSchema, invocationsRequestSchema } from "../schemas"; @@ -57,7 +58,6 @@ beforeEach(() => { fn(), ), generateKey: vi.fn(() => "test-key"), - // biome-ignore lint/suspicious/noExplicitAny: test mock })) as any; process.env.NODE_ENV = "development"; }); @@ -134,14 +134,12 @@ describe("POST /chat — per-user concurrent-stream limit", () => { const plugin = new AgentsPlugin(overrides); // Seed the agents map directly so _handleChat can resolve "hello" // without running setup() (which would require a live model). - // biome-ignore lint/suspicious/noExplicitAny: seeding private state (plugin as any).agents.set("hello", { name: "hello", instructions: "hi", adapter: { async *run() {} }, toolIndex: new Map(), }); - // biome-ignore lint/suspicious/noExplicitAny: seeding private state (plugin as any).defaultAgentName = "hello"; return plugin; } @@ -149,7 +147,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { test("rejects with 429 + Retry-After when user is at-limit (default 5)", async () => { const plugin = seedPlugin(); for (let i = 0; i < 5; i++) { - // biome-ignore lint/suspicious/noExplicitAny: seeding (plugin as any).trackStream(`s${i}`, "alice", new AbortController()); } @@ -172,7 +169,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { test("does not reject when another user is at-limit (per-user, not global)", async () => { const plugin = seedPlugin(); for (let i = 0; i < 5; i++) { - // biome-ignore lint/suspicious/noExplicitAny: seeding (plugin as any).trackStream(`s${i}`, "alice", new AbortController()); } @@ -180,7 +176,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { // Don't bother running the full stream — we assert only that 429 is // not the response status. const { res } = mockRes(); - // biome-ignore lint/suspicious/noExplicitAny: stub _streamAgent to avoid needing a real adapter (plugin as any)._streamAgent = vi.fn(async () => undefined); await ( @@ -198,7 +193,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { limits: { maxConcurrentStreamsPerUser: 2 }, }); for (let i = 0; i < 2; i++) { - // biome-ignore lint/suspicious/noExplicitAny: seeding (plugin as any).trackStream(`s${i}`, "alice", new AbortController()); } @@ -219,7 +213,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { // must mirror the underlying map across track/untrack and across // multiple users. const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: private state probe const t = plugin as any; expect(t.countUserStreams("alice")).toBe(0); @@ -252,7 +245,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { // rate-limit gate that /chat enforces, letting clients bypass the cap. const plugin = seedPlugin(); for (let i = 0; i < 5; i++) { - // biome-ignore lint/suspicious/noExplicitAny: seeding (plugin as any).trackStream(`s${i}`, "alice", new AbortController()); } @@ -279,7 +271,6 @@ describe("POST /chat — per-user concurrent-stream limit", () => { describe("resolvedLimits — default values", () => { test("exposes the documented MVP defaults when unconfigured", () => { const plugin = new AgentsPlugin({ dir: false }); - // biome-ignore lint/suspicious/noExplicitAny: read private getter const limits = (plugin as any).resolvedLimits; expect(limits).toEqual({ maxConcurrentStreamsPerUser: 5, @@ -294,7 +285,6 @@ describe("resolvedLimits — default values", () => { dir: false, limits: { maxToolCalls: 100 }, }); - // biome-ignore lint/suspicious/noExplicitAny: read private const limits = (plugin as any).resolvedLimits; expect(limits.maxToolCalls).toBe(100); expect(limits.maxConcurrentStreamsPerUser).toBe(5); @@ -349,7 +339,6 @@ describe("runSubAgent — depth guard", () => { }); const runState = makeRunState(plugin, { maxSubAgentDepth: 2 }); await expect( - // biome-ignore lint/suspicious/noExplicitAny: call private method directly (plugin as any).runSubAgent( runState, { name: "child", toolIndex: new Map() }, @@ -367,7 +356,6 @@ describe("runSubAgent — depth guard", () => { }); const stubAdapter = { - // biome-ignore lint/suspicious/noExplicitAny: adapter shape not under test async *run(): any { yield { type: "message", content: "hello from depth-3" }; }, @@ -375,13 +363,11 @@ describe("runSubAgent — depth guard", () => { const child = { name: "child", instructions: "test", - // biome-ignore lint/suspicious/noExplicitAny: stub shape adapter: stubAdapter as any, toolIndex: new Map(), }; const runState = makeRunState(plugin, { maxSubAgentDepth: 3 }); - // biome-ignore lint/suspicious/noExplicitAny: call private const result = await (plugin as any).runSubAgent( runState, child, diff --git a/packages/appkit/src/plugins/agents/tests/event-channel.test.ts b/packages/appkit/src/plugins/agents/tests/event-channel.test.ts index d80d788de..e402b6a4a 100644 --- a/packages/appkit/src/plugins/agents/tests/event-channel.test.ts +++ b/packages/appkit/src/plugins/agents/tests/event-channel.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { EventChannel } from "../event-channel"; async function collect(ch: EventChannel): Promise { diff --git a/packages/appkit/src/plugins/agents/tests/event-translator.test.ts b/packages/appkit/src/plugins/agents/tests/event-translator.test.ts index 050af001a..28fd474b3 100644 --- a/packages/appkit/src/plugins/agents/tests/event-translator.test.ts +++ b/packages/appkit/src/plugins/agents/tests/event-translator.test.ts @@ -1,5 +1,6 @@ import type { ResponseStreamEvent } from "shared"; import { describe, expect, test } from "vitest"; + import { AgentEventTranslator } from "../event-translator"; describe("AgentEventTranslator", () => { diff --git a/packages/appkit/src/plugins/agents/tests/route-handler-errors.test.ts b/packages/appkit/src/plugins/agents/tests/route-handler-errors.test.ts index 0e31af4bf..1deacd5c5 100644 --- a/packages/appkit/src/plugins/agents/tests/route-handler-errors.test.ts +++ b/packages/appkit/src/plugins/agents/tests/route-handler-errors.test.ts @@ -1,5 +1,6 @@ import type express from "express"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { CacheManager } from "../../../cache"; import { AgentsPlugin } from "../agents"; @@ -41,7 +42,6 @@ vi.mock("../mlflow", () => ({ beforeEach(() => { linkTraceToRun.mockClear(); mockTraceId = undefined; - // biome-ignore lint/suspicious/noExplicitAny: test seam, mirrors other suites (CacheManager as any).instance = { get: vi.fn(), set: vi.fn(), @@ -84,14 +84,12 @@ function mockRes() { function seedPlugin(adapter: unknown = { async *run() {} }): AgentsPlugin { const plugin = new AgentsPlugin({ dir: false }); - // biome-ignore lint/suspicious/noExplicitAny: seed private state (plugin as any).agents.set("default", { name: "default", instructions: "hi", adapter, toolIndex: new Map(), }); - // biome-ignore lint/suspicious/noExplicitAny: seed private state (plugin as any).defaultAgentName = "default"; return plugin; } @@ -99,7 +97,6 @@ function seedPlugin(adapter: unknown = { async *run() {} }): AgentsPlugin { describe("POST /chat — threadStore failure", () => { test("returns 500 when threadStore.get rejects (existing thread path)", async () => { const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: stub threadStore for failure (plugin as any).threadStore = { get: vi.fn().mockRejectedValue(new Error("DB unreachable")), create: vi.fn(), @@ -119,7 +116,6 @@ describe("POST /chat — threadStore failure", () => { test("returns 500 when threadStore.create rejects (new-thread path)", async () => { const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { get: vi.fn().mockResolvedValue(null), create: vi.fn().mockRejectedValue(new Error("Disk full")), @@ -139,7 +135,6 @@ describe("POST /chat — threadStore failure", () => { test("returns 500 when threadStore.addMessage rejects", async () => { const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { get: vi.fn().mockResolvedValue(null), create: vi.fn().mockResolvedValue({ id: "t-new", messages: [] }), @@ -161,7 +156,6 @@ describe("POST /chat — threadStore failure", () => { describe("POST /invocations — threadStore failure", () => { test("returns 500 when threadStore.create rejects", async () => { const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockRejectedValue(new Error("DB unreachable")), addMessage: vi.fn(), @@ -183,7 +177,6 @@ describe("POST /invocations — threadStore failure", () => { test("returns 500 when threadStore.addMessage rejects mid-loop", async () => { const plugin = seedPlugin(); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockResolvedValue({ id: "t-new", messages: [] }), addMessage: vi @@ -231,14 +224,12 @@ describe("POST /invocations & /responses — HITL pre-flight", () => { annotations: toolAnnotations, }, }); - // biome-ignore lint/suspicious/noExplicitAny: seed private state (plugin as any).agents.set("default", { name: "default", instructions: "hi", adapter: { async *run() {} }, toolIndex, }); - // biome-ignore lint/suspicious/noExplicitAny: seed private state (plugin as any).defaultAgentName = "default"; return plugin; } @@ -305,9 +296,7 @@ describe("POST /invocations & /responses — HITL pre-flight", () => { { effect: "destructive" }, { dir: false, approval: { requireForDestructive: false } }, ); - // biome-ignore lint/suspicious/noExplicitAny: stub the downstream runner to avoid running the adapter (plugin as any)._runAgentNonStreaming = vi.fn(async () => undefined); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockResolvedValue({ id: "t-1", messages: [] }), addMessage: vi.fn(), @@ -324,15 +313,12 @@ describe("POST /invocations & /responses — HITL pre-flight", () => { )._handleInvoke(mockReq({ input: "hi" }), res); expect(res.status).not.toHaveBeenCalledWith(400); - // biome-ignore lint/suspicious/noExplicitAny: assert delegation expect((plugin as any)._runAgentNonStreaming).toHaveBeenCalled(); }); test("passes pre-flight when the agent has only read-only tools", async () => { const plugin = seedPluginWithTools({ effect: "read" }); - // biome-ignore lint/suspicious/noExplicitAny: stub the runner (plugin as any)._runAgentNonStreaming = vi.fn(async () => undefined); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockResolvedValue({ id: "t-1", messages: [] }), addMessage: vi.fn(), @@ -349,7 +335,6 @@ describe("POST /invocations & /responses — HITL pre-flight", () => { )._handleInvoke(mockReq({ input: "hi" }), res); expect(res.status).not.toHaveBeenCalledWith(400); - // biome-ignore lint/suspicious/noExplicitAny: assert delegation expect((plugin as any)._runAgentNonStreaming).toHaveBeenCalled(); }); }); @@ -357,7 +342,6 @@ describe("POST /invocations & /responses — HITL pre-flight", () => { describe("POST /invocations & /responses — successful invoke", () => { test("returns OpenAI Responses-shaped JSON with aggregated assistant text", async () => { const plugin = new AgentsPlugin({ dir: false }); - // biome-ignore lint/suspicious/noExplicitAny: seed (plugin as any).agents.set("default", { name: "default", instructions: "hi", @@ -369,9 +353,7 @@ describe("POST /invocations & /responses — successful invoke", () => { }, toolIndex: new Map(), }); - // biome-ignore lint/suspicious/noExplicitAny: seed (plugin as any).defaultAgentName = "default"; - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockResolvedValue({ id: "t-new", messages: [] }), addMessage: vi.fn(), @@ -420,7 +402,6 @@ describe("POST /invocations & /responses — successful invoke", () => { yield { type: "message_delta", content: "ok" }; }, }); - // biome-ignore lint/suspicious/noExplicitAny: stub (plugin as any).threadStore = { create: vi.fn().mockResolvedValue({ id: "t-new", messages: [] }), addMessage: vi.fn(), @@ -484,9 +465,7 @@ describe("/invocations and /responses are aliases", () => { test("both routes are registered and bound to the same handler", () => { const plugin = new AgentsPlugin({ dir: false }); const addRoute = vi.fn(); - // biome-ignore lint/suspicious/noExplicitAny: inject minimal fake context (plugin as any).context = { addRoute }; - // biome-ignore lint/suspicious/noExplicitAny: invoke private mounter (plugin as any).mountInvokeRoutes(); expect(addRoute).toHaveBeenCalledTimes(2); diff --git a/packages/appkit/src/plugins/agents/tests/thread-store.test.ts b/packages/appkit/src/plugins/agents/tests/thread-store.test.ts index ed4f70bab..2dda38640 100644 --- a/packages/appkit/src/plugins/agents/tests/thread-store.test.ts +++ b/packages/appkit/src/plugins/agents/tests/thread-store.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { InMemoryThreadStore } from "../thread-store"; describe("InMemoryThreadStore", () => { diff --git a/packages/appkit/src/plugins/agents/tests/tool-approval-gate.test.ts b/packages/appkit/src/plugins/agents/tests/tool-approval-gate.test.ts index 1e17ddf63..857841191 100644 --- a/packages/appkit/src/plugins/agents/tests/tool-approval-gate.test.ts +++ b/packages/appkit/src/plugins/agents/tests/tool-approval-gate.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { ToolApprovalGate } from "../tool-approval-gate"; describe("ToolApprovalGate", () => { diff --git a/packages/appkit/src/plugins/agents/thread-store.ts b/packages/appkit/src/plugins/agents/thread-store.ts index 7c4622cd3..aefcdc686 100644 --- a/packages/appkit/src/plugins/agents/thread-store.ts +++ b/packages/appkit/src/plugins/agents/thread-store.ts @@ -1,4 +1,5 @@ import { randomUUID } from "node:crypto"; + import type { Message, Thread, ThreadStore } from "shared"; /** diff --git a/packages/appkit/src/plugins/ai-search/ai-search.ts b/packages/appkit/src/plugins/ai-search/ai-search.ts index fc828bd27..303f8ebb3 100644 --- a/packages/appkit/src/plugins/ai-search/ai-search.ts +++ b/packages/appkit/src/plugins/ai-search/ai-search.ts @@ -1,6 +1,8 @@ import { createHash } from "node:crypto"; + import type express from "express"; import type { CacheConfig, IAppRouter, PluginExecutionSettings } from "shared"; + import { AiSearchConnector } from "../../connectors/ai-search/client"; import type { VsQueryParams, @@ -34,7 +36,7 @@ export class AiSearchPlugin extends Plugin { protected static description = "Query Databricks Vector Search indexes with hybrid search, reranking, and pagination"; - protected declare config: IAiSearchConfig; + declare protected config: IAiSearchConfig; private connector: AiSearchConnector; diff --git a/packages/appkit/src/plugins/ai-search/tests/ai-search.test.ts b/packages/appkit/src/plugins/ai-search/tests/ai-search.test.ts index 4160d13d2..25ad528c9 100644 --- a/packages/appkit/src/plugins/ai-search/tests/ai-search.test.ts +++ b/packages/appkit/src/plugins/ai-search/tests/ai-search.test.ts @@ -4,6 +4,7 @@ import { createMockRouter, } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + import { Context } from "../../../workspace-client"; vi.mock("../../../context", () => ({ diff --git a/packages/appkit/src/plugins/analytics/analytics.ts b/packages/appkit/src/plugins/analytics/analytics.ts index 8ed405a37..782ac33c4 100644 --- a/packages/appkit/src/plugins/analytics/analytics.ts +++ b/packages/appkit/src/plugins/analytics/analytics.ts @@ -10,6 +10,7 @@ import { type ToolProvider, } from "shared"; import { z } from "zod"; + import { SQLWarehouseConnector } from "../../connectors"; import { DEFAULT_WAREHOUSE_STARTUP_TIMEOUT_MS, @@ -112,7 +113,7 @@ export class AnalyticsPlugin extends Plugin implements ToolProvider { static manifest = manifest as PluginManifest<"analytics">; protected static description = "Analytics plugin for data analysis"; - protected declare config: IAnalyticsConfig; + declare protected config: IAnalyticsConfig; // analytics services private SQLClient: SQLWarehouseConnector; diff --git a/packages/appkit/src/plugins/analytics/mv/cache.ts b/packages/appkit/src/plugins/analytics/mv/cache.ts index a96743f6c..82cf4a659 100644 --- a/packages/appkit/src/plugins/analytics/mv/cache.ts +++ b/packages/appkit/src/plugins/analytics/mv/cache.ts @@ -1,4 +1,5 @@ import { createHash } from "node:crypto"; + import { AuthenticationError } from "../../../errors"; import type { MetricFilter, MetricLane, MetricPredicate } from "../types"; import { sortFilterChildren } from "./formatters"; diff --git a/packages/appkit/src/plugins/analytics/mv/constants.ts b/packages/appkit/src/plugins/analytics/mv/constants.ts index 4e311bc4e..6e12b67b9 100644 --- a/packages/appkit/src/plugins/analytics/mv/constants.ts +++ b/packages/appkit/src/plugins/analytics/mv/constants.ts @@ -1,4 +1,5 @@ import type { MetricFilterOperatorName, MetricOrderDirection } from "shared"; + import { METRIC_CONFIG_FILE } from "../../../../../shared/src/schemas/metric-fqn"; import type { MetricLane } from "../types"; diff --git a/packages/appkit/src/plugins/analytics/mv/formatters.ts b/packages/appkit/src/plugins/analytics/mv/formatters.ts index c79c7d325..7b2f3186f 100644 --- a/packages/appkit/src/plugins/analytics/mv/formatters.ts +++ b/packages/appkit/src/plugins/analytics/mv/formatters.ts @@ -1,4 +1,5 @@ import { type SQLTypeMarker, sql as sqlHelpers } from "shared"; + import { isValidColumnName, isValidFqn, diff --git a/packages/appkit/src/plugins/analytics/mv/metadata.ts b/packages/appkit/src/plugins/analytics/mv/metadata.ts index 361d3e096..a1ed7ef77 100644 --- a/packages/appkit/src/plugins/analytics/mv/metadata.ts +++ b/packages/appkit/src/plugins/analytics/mv/metadata.ts @@ -1,4 +1,5 @@ import type { MetricViewColumnDisplay, MetricViewsMetadata } from "shared"; + import { METRIC_METADATA_BUNDLE_VERSION, METRIC_METADATA_FILE, diff --git a/packages/appkit/src/plugins/analytics/mv/registry.ts b/packages/appkit/src/plugins/analytics/mv/registry.ts index 9c236f2ef..858d07eab 100644 --- a/packages/appkit/src/plugins/analytics/mv/registry.ts +++ b/packages/appkit/src/plugins/analytics/mv/registry.ts @@ -1,4 +1,5 @@ import path from "node:path"; + // Canonical metric-source schema — the single source of truth for // `config/metric-views/definitions.json`. Imported from the shared source // directly (matching the type-generator's runtime, which pulls the zod-free diff --git a/packages/appkit/src/plugins/analytics/mv/schemas.ts b/packages/appkit/src/plugins/analytics/mv/schemas.ts index 4e8e30f40..d74084a37 100644 --- a/packages/appkit/src/plugins/analytics/mv/schemas.ts +++ b/packages/appkit/src/plugins/analytics/mv/schemas.ts @@ -1,4 +1,5 @@ import { z } from "zod"; + import { isValidColumnName } from "../../../../../shared/src/schemas/metric-fqn"; import { ValidationError } from "../../../errors"; import type { diff --git a/packages/appkit/src/plugins/analytics/query.ts b/packages/appkit/src/plugins/analytics/query.ts index b98d6199c..bcd77a817 100644 --- a/packages/appkit/src/plugins/analytics/query.ts +++ b/packages/appkit/src/plugins/analytics/query.ts @@ -1,5 +1,7 @@ import { createHash } from "node:crypto"; + import { isSQLTypeMarker, type SQLTypeMarker, sql as sqlHelpers } from "shared"; + import { getWorkspaceId } from "../../context"; import { ValidationError } from "../../errors"; import type { sql } from "../../workspace-client"; diff --git a/packages/appkit/src/plugins/analytics/result-delivery.ts b/packages/appkit/src/plugins/analytics/result-delivery.ts index 46956c8b8..a0435513c 100644 --- a/packages/appkit/src/plugins/analytics/result-delivery.ts +++ b/packages/appkit/src/plugins/analytics/result-delivery.ts @@ -1,5 +1,6 @@ import { type DataType, type Field, Type, tableFromIPC } from "apache-arrow"; import type { SQLTypeMarker } from "shared"; + import { ExecutionError } from "../../errors"; import { createLogger } from "../../logging/logger"; import type { RefreshChunkLink } from "../../stream/arrow-stream-processor"; diff --git a/packages/appkit/src/plugins/analytics/tests/analytics.integration.test.ts b/packages/appkit/src/plugins/analytics/tests/analytics.integration.test.ts index bb50bbc89..e099c8350 100644 --- a/packages/appkit/src/plugins/analytics/tests/analytics.integration.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/analytics.integration.test.ts @@ -1,4 +1,5 @@ import type { Server } from "node:http"; + import { createConfigurableMockWorkspaceClient, createFailedSQLResponse, @@ -17,6 +18,7 @@ import { test, vi, } from "vitest"; + import { AppManager } from "../../../app"; import { ServiceContext } from "../../../context/service-context"; import { createApp } from "../../../core"; diff --git a/packages/appkit/src/plugins/analytics/tests/analytics.test.ts b/packages/appkit/src/plugins/analytics/tests/analytics.test.ts index aff246145..dd14b1d3d 100644 --- a/packages/appkit/src/plugins/analytics/tests/analytics.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/analytics.test.ts @@ -18,6 +18,7 @@ import { } from "apache-arrow"; import { sql } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import { AnalyticsPlugin, analytics, writeChunk } from "../analytics"; import type { IAnalyticsConfig } from "../types"; diff --git a/packages/appkit/src/plugins/analytics/tests/arrow-delivery.integration.test.ts b/packages/appkit/src/plugins/analytics/tests/arrow-delivery.integration.test.ts index 008627b7e..934e83c28 100644 --- a/packages/appkit/src/plugins/analytics/tests/arrow-delivery.integration.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/arrow-delivery.integration.test.ts @@ -1,5 +1,6 @@ import { tableFromIPC } from "apache-arrow"; import { describe, expect, test } from "vitest"; + import { SQLWarehouseConnector } from "../../../connectors"; import { createWorkspaceClient } from "../../../workspace-client"; import { deliverArrowBytes, type QueryExecutor } from "../result-delivery"; diff --git a/packages/appkit/src/plugins/analytics/tests/metric.test.ts b/packages/appkit/src/plugins/analytics/tests/metric.test.ts index eedbac776..a49412ac1 100644 --- a/packages/appkit/src/plugins/analytics/tests/metric.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/metric.test.ts @@ -1,6 +1,7 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs"; import { tmpdir } from "node:os"; import path from "node:path"; + import { createMockRequest, createMockResponse, @@ -10,6 +11,7 @@ import { } from "@tools/test-helpers"; import type { MetricViewsMetadata } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { AppManager } from "../../../app"; import { ServiceContext } from "../../../context/service-context"; import { AuthenticationError } from "../../../errors"; diff --git a/packages/appkit/src/plugins/analytics/tests/query.test.ts b/packages/appkit/src/plugins/analytics/tests/query.test.ts index bbf0a2ce4..401aea7c1 100644 --- a/packages/appkit/src/plugins/analytics/tests/query.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/query.test.ts @@ -1,6 +1,7 @@ import { mockServiceContext } from "@tools/test-helpers"; import { sql } from "shared"; import { afterEach, beforeEach, describe, expect, test } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import { QueryProcessor } from "../query"; diff --git a/packages/appkit/src/plugins/analytics/tests/result-delivery.test.ts b/packages/appkit/src/plugins/analytics/tests/result-delivery.test.ts index 65ffd228f..06438b5a5 100644 --- a/packages/appkit/src/plugins/analytics/tests/result-delivery.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/result-delivery.test.ts @@ -1,5 +1,6 @@ import { Table, tableToIPC, Utf8, vectorFromArray } from "apache-arrow"; import { describe, expect, test, vi } from "vitest"; + import { ExecutionError } from "../../../errors"; import { type ArrowChunkStreamer, diff --git a/packages/appkit/src/plugins/analytics/tests/types.test.ts b/packages/appkit/src/plugins/analytics/tests/types.test.ts index fc116b288..1a28a83ed 100644 --- a/packages/appkit/src/plugins/analytics/tests/types.test.ts +++ b/packages/appkit/src/plugins/analytics/tests/types.test.ts @@ -5,6 +5,7 @@ import type { MetricPredicate as SharedMetricPredicate, } from "shared"; import { describe, expectTypeOf, test } from "vitest"; + import type { METRIC_FILTER_OPERATORS, METRIC_ORDER_DIRECTIONS, diff --git a/packages/appkit/src/plugins/files/helpers.ts b/packages/appkit/src/plugins/files/helpers.ts index 799f871f3..7fbbdc0af 100644 --- a/packages/appkit/src/plugins/files/helpers.ts +++ b/packages/appkit/src/plugins/files/helpers.ts @@ -27,6 +27,6 @@ export function parentDirectory(path: string): string { * HTTP header injection if upstream constraints ever change. */ export function sanitizeFilename(raw: string): string { - // biome-ignore lint/suspicious/noControlCharactersInRegex: intentionally stripping control chars for security + // oxlint-disable-next-line no-control-regex -- filenames must not contain ASCII control characters return raw.replace(/["\\]/g, "\\$&").replace(/[\x00-\x1f]/g, ""); } diff --git a/packages/appkit/src/plugins/files/plugin.ts b/packages/appkit/src/plugins/files/plugin.ts index bec04f249..b770616c4 100644 --- a/packages/appkit/src/plugins/files/plugin.ts +++ b/packages/appkit/src/plugins/files/plugin.ts @@ -1,5 +1,6 @@ import { STATUS_CODES } from "node:http"; import { Readable } from "node:stream"; + import type express from "express"; import type { AgentToolDefinition, @@ -8,6 +9,7 @@ import type { ToolProvider, } from "shared"; import { z } from "zod"; + import { contentTypeFromPath, FILES_MAX_READ_SIZE, @@ -69,7 +71,7 @@ export class FilesPlugin extends Plugin implements ToolProvider { /** Plugin manifest declaring metadata and resource requirements. */ static manifest = manifest as PluginManifest; protected static description = "Files plugin for Databricks file operations"; - protected declare config: IFilesConfig; + declare protected config: IFilesConfig; private volumeConnectors: Record = {}; private volumeConfigs: Record = {}; diff --git a/packages/appkit/src/plugins/files/tests/_test-helpers.ts b/packages/appkit/src/plugins/files/tests/_test-helpers.ts index 298bc157c..1531ce1a4 100644 --- a/packages/appkit/src/plugins/files/tests/_test-helpers.ts +++ b/packages/appkit/src/plugins/files/tests/_test-helpers.ts @@ -1,6 +1,8 @@ import { Readable } from "node:stream"; + import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import { vi } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import type { FilesPlugin } from "../plugin"; import { policy } from "../policy"; diff --git a/packages/appkit/src/plugins/files/tests/delete.test.ts b/packages/appkit/src/plugins/files/tests/delete.test.ts index 54ba4f7b1..1cdaa7e5d 100644 --- a/packages/appkit/src/plugins/files/tests/delete.test.ts +++ b/packages/appkit/src/plugins/files/tests/delete.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { getRouteHandler, diff --git a/packages/appkit/src/plugins/files/tests/download-endpoint.test.ts b/packages/appkit/src/plugins/files/tests/download-endpoint.test.ts index 580723874..e96470e1b 100644 --- a/packages/appkit/src/plugins/files/tests/download-endpoint.test.ts +++ b/packages/appkit/src/plugins/files/tests/download-endpoint.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { getRouteHandler, diff --git a/packages/appkit/src/plugins/files/tests/error-handling.test.ts b/packages/appkit/src/plugins/files/tests/error-handling.test.ts index 6426b3c7f..f02fb8683 100644 --- a/packages/appkit/src/plugins/files/tests/error-handling.test.ts +++ b/packages/appkit/src/plugins/files/tests/error-handling.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { AuthenticationError } from "../../../errors"; import { FilesPlugin } from "../plugin"; import { diff --git a/packages/appkit/src/plugins/files/tests/helpers.test.ts b/packages/appkit/src/plugins/files/tests/helpers.test.ts index 48ae42182..cbf686703 100644 --- a/packages/appkit/src/plugins/files/tests/helpers.test.ts +++ b/packages/appkit/src/plugins/files/tests/helpers.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { contentTypeFromPath, isTextContentType, diff --git a/packages/appkit/src/plugins/files/tests/mkdir.test.ts b/packages/appkit/src/plugins/files/tests/mkdir.test.ts index 3aaf2670e..00623bef5 100644 --- a/packages/appkit/src/plugins/files/tests/mkdir.test.ts +++ b/packages/appkit/src/plugins/files/tests/mkdir.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { getRouteHandler, diff --git a/packages/appkit/src/plugins/files/tests/path-validation.test.ts b/packages/appkit/src/plugins/files/tests/path-validation.test.ts index fdefa075a..7705b4778 100644 --- a/packages/appkit/src/plugins/files/tests/path-validation.test.ts +++ b/packages/appkit/src/plugins/files/tests/path-validation.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { getRouteHandler, diff --git a/packages/appkit/src/plugins/files/tests/plugin.integration.test.ts b/packages/appkit/src/plugins/files/tests/plugin.integration.test.ts index 7832e4828..3be68b315 100644 --- a/packages/appkit/src/plugins/files/tests/plugin.integration.test.ts +++ b/packages/appkit/src/plugins/files/tests/plugin.integration.test.ts @@ -1,4 +1,5 @@ import http, { type Server } from "node:http"; + import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import { afterAll, @@ -9,6 +10,7 @@ import { test, vi, } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import { createApp } from "../../../core"; import { server as serverPlugin } from "../../server"; diff --git a/packages/appkit/src/plugins/files/tests/plugin.test.ts b/packages/appkit/src/plugins/files/tests/plugin.test.ts index 4deb4261e..a9612d47e 100644 --- a/packages/appkit/src/plugins/files/tests/plugin.test.ts +++ b/packages/appkit/src/plugins/files/tests/plugin.test.ts @@ -1,6 +1,8 @@ import { PassThrough, Readable } from "node:stream"; + import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import { createApp } from "../../../core"; import { AuthenticationError } from "../../../errors"; diff --git a/packages/appkit/src/plugins/files/tests/policy.test.ts b/packages/appkit/src/plugins/files/tests/policy.test.ts index dc4771988..0d83eb14b 100644 --- a/packages/appkit/src/plugins/files/tests/policy.test.ts +++ b/packages/appkit/src/plugins/files/tests/policy.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { type FileAction, type FilePolicyUser, diff --git a/packages/appkit/src/plugins/files/tests/raw-endpoint.test.ts b/packages/appkit/src/plugins/files/tests/raw-endpoint.test.ts index 8e5851e09..5614e8b37 100644 --- a/packages/appkit/src/plugins/files/tests/raw-endpoint.test.ts +++ b/packages/appkit/src/plugins/files/tests/raw-endpoint.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { getRouteHandler, diff --git a/packages/appkit/src/plugins/files/tests/shutdown.test.ts b/packages/appkit/src/plugins/files/tests/shutdown.test.ts index 3360686b9..239d92cff 100644 --- a/packages/appkit/src/plugins/files/tests/shutdown.test.ts +++ b/packages/appkit/src/plugins/files/tests/shutdown.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { setupTestEnv, teardownTestEnv, VOLUMES_CONFIG } from "./_test-helpers"; diff --git a/packages/appkit/src/plugins/files/tests/upload.test.ts b/packages/appkit/src/plugins/files/tests/upload.test.ts index 482298f9a..0e893cd59 100644 --- a/packages/appkit/src/plugins/files/tests/upload.test.ts +++ b/packages/appkit/src/plugins/files/tests/upload.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { policy } from "../policy"; import { diff --git a/packages/appkit/src/plugins/files/tests/volume-config.test.ts b/packages/appkit/src/plugins/files/tests/volume-config.test.ts index ed13b7ad9..121bdbe39 100644 --- a/packages/appkit/src/plugins/files/tests/volume-config.test.ts +++ b/packages/appkit/src/plugins/files/tests/volume-config.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { FilesPlugin } from "../plugin"; import { setupTestEnv, teardownTestEnv, VOLUMES_CONFIG } from "./_test-helpers"; diff --git a/packages/appkit/src/plugins/files/types.ts b/packages/appkit/src/plugins/files/types.ts index b50757514..ee58c8c04 100644 --- a/packages/appkit/src/plugins/files/types.ts +++ b/packages/appkit/src/plugins/files/types.ts @@ -1,4 +1,5 @@ import type { BasePluginConfig, IAppRequest } from "shared"; + import type { files } from "../../workspace-client"; import type { FilePolicy } from "./policy"; diff --git a/packages/appkit/src/plugins/genie/genie.ts b/packages/appkit/src/plugins/genie/genie.ts index 1fc5d99c0..845d715ee 100644 --- a/packages/appkit/src/plugins/genie/genie.ts +++ b/packages/appkit/src/plugins/genie/genie.ts @@ -1,4 +1,5 @@ import { randomUUID } from "node:crypto"; + import type express from "express"; import type { AgentToolDefinition, @@ -7,6 +8,7 @@ import type { ToolProvider, } from "shared"; import { z } from "zod"; + import { GenieConnector } from "../../connectors"; import { getWorkspaceClient } from "../../context"; import { buildToolkitEntries } from "../../core/agent/build-toolkit"; @@ -35,7 +37,7 @@ export class GeniePlugin extends Plugin implements ToolProvider { protected static description = "AI/BI Genie space integration for natural language data queries"; - protected declare config: IGenieConfig; + declare protected config: IGenieConfig; private readonly genieConnector: GenieConnector; private tools: ToolRegistry = {}; diff --git a/packages/appkit/src/plugins/genie/tests/genie.test.ts b/packages/appkit/src/plugins/genie/tests/genie.test.ts index 0af6c25b3..7e5afa0fb 100644 --- a/packages/appkit/src/plugins/genie/tests/genie.test.ts +++ b/packages/appkit/src/plugins/genie/tests/genie.test.ts @@ -6,6 +6,7 @@ import { setupDatabricksEnv, } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { genieConnectorDefaults } from "../../../connectors/genie/defaults"; import { ServiceContext } from "../../../context/service-context"; import { Plugin } from "../../../plugin"; diff --git a/packages/appkit/src/plugins/jobs/plugin.ts b/packages/appkit/src/plugins/jobs/plugin.ts index 24585dd5a..4945b5741 100644 --- a/packages/appkit/src/plugins/jobs/plugin.ts +++ b/packages/appkit/src/plugins/jobs/plugin.ts @@ -1,4 +1,5 @@ import { STATUS_CODES } from "node:http"; + import type express from "express"; import type { IAppRouter, @@ -6,6 +7,7 @@ import type { StreamExecutionSettings, } from "shared"; import { toJSONSchema } from "zod"; + import { JobsConnector } from "../../connectors/jobs"; import { getCurrentUserId, getWorkspaceClient } from "../../context"; import { ExecutionError, ValidationError } from "../../errors"; @@ -85,7 +87,7 @@ function abortableSleep(ms: number, signal?: AbortSignal): Promise { class JobsPlugin extends Plugin { static manifest = manifest as PluginManifest; - protected declare config: IJobsConfig; + declare protected config: IJobsConfig; private connector: JobsConnector; private jobIds: Record = {}; private jobConfigs: Record = {}; diff --git a/packages/appkit/src/plugins/jobs/tests/plugin.test.ts b/packages/appkit/src/plugins/jobs/tests/plugin.test.ts index 532cb7024..783debc8a 100644 --- a/packages/appkit/src/plugins/jobs/tests/plugin.test.ts +++ b/packages/appkit/src/plugins/jobs/tests/plugin.test.ts @@ -1,6 +1,7 @@ import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; import { z } from "zod"; + import { ServiceContext } from "../../../context/service-context"; import { ResourceType } from "../../../registry"; import { diff --git a/packages/appkit/src/plugins/jobs/types.ts b/packages/appkit/src/plugins/jobs/types.ts index 0ad101df6..af65f80a8 100644 --- a/packages/appkit/src/plugins/jobs/types.ts +++ b/packages/appkit/src/plugins/jobs/types.ts @@ -1,5 +1,6 @@ import type { BasePluginConfig } from "shared"; import type { z } from "zod"; + import type { ExecutionResult } from "../../plugin"; import type { jobs } from "../../workspace-client"; diff --git a/packages/appkit/src/plugins/lakebase/lakebase.ts b/packages/appkit/src/plugins/lakebase/lakebase.ts index f41ec4f9b..42b383df2 100644 --- a/packages/appkit/src/plugins/lakebase/lakebase.ts +++ b/packages/appkit/src/plugins/lakebase/lakebase.ts @@ -1,6 +1,7 @@ import type { QueryResult, QueryResultRow } from "pg"; import type { AgentToolDefinition, ToolProvider } from "shared"; import { z } from "zod"; + import { createLakebasePool, createLakebasePoolManager, @@ -67,7 +68,7 @@ export class LakebasePlugin extends Plugin implements ToolProvider { /** Plugin manifest declaring metadata and resource requirements */ static manifest = manifest as PluginManifest<"lakebase">; - protected declare config: ILakebaseConfig; + declare protected config: ILakebaseConfig; private pool: RoutingPool | null = null; private oboPoolManager: LakebasePoolManager | null = null; @@ -142,7 +143,7 @@ export class LakebasePlugin extends Plugin implements ToolProvider { text: string, values?: unknown[], ): Promise> { - // biome-ignore lint/style/noNonNullAssertion: pool is guaranteed non-null after setup(), which AppKit always awaits before exposing the plugin API + // oxlint-disable-next-line typescript/no-non-null-assertion -- pool is initialized during setup() return this.pool!.query(text, values); } @@ -164,7 +165,7 @@ export class LakebasePlugin extends Plugin implements ToolProvider { text: string, values?: unknown[], ): Promise { - // biome-ignore lint/style/noNonNullAssertion: pool is guaranteed non-null after setup() + // oxlint-disable-next-line typescript/no-non-null-assertion -- pool is initialized during setup() const client = await this.pool!.connect(); try { await client.query("BEGIN READ ONLY"); @@ -324,7 +325,7 @@ export class LakebasePlugin extends Plugin implements ToolProvider { */ exports() { return { - // biome-ignore lint/style/noNonNullAssertion: pool is guaranteed non-null after setup(), which AppKit always awaits before exposing the plugin API + // oxlint-disable-next-line typescript/no-non-null-assertion -- pool is initialized during setup() pool: this.pool! as LakebasePool, query: this.query.bind(this), getOrmConfig: () => getLakebaseOrmConfig(this.activePoolConfig()), diff --git a/packages/appkit/src/plugins/lakebase/tests/lakebase-agent-tool.test.ts b/packages/appkit/src/plugins/lakebase/tests/lakebase-agent-tool.test.ts index 3386aa597..7e035bdea 100644 --- a/packages/appkit/src/plugins/lakebase/tests/lakebase-agent-tool.test.ts +++ b/packages/appkit/src/plugins/lakebase/tests/lakebase-agent-tool.test.ts @@ -69,6 +69,7 @@ vi.mock("../../../connectors/lakebase", async (importOriginal) => { }); import type { Pool, PoolClient } from "pg"; + import { LakebasePlugin } from "../lakebase"; function makePlugin( @@ -214,9 +215,8 @@ describe("LakebasePlugin — readOnly enforcement", () => { describe("LakebasePlugin — shutdown", () => { test("closes the SP pool and all OBO pools via shutdown()", async () => { - const { createLakebasePool, createLakebasePoolManager } = await import( - "../../../connectors/lakebase" - ); + const { createLakebasePool, createLakebasePoolManager } = + await import("../../../connectors/lakebase"); const plugin = makePlugin({}); await plugin.setup(); @@ -238,9 +238,8 @@ describe("LakebasePlugin — shutdown", () => { }); test("abortActiveOperations() does NOT tear down the pools (teardown is shutdown()'s job)", async () => { - const { createLakebasePool, createLakebasePoolManager } = await import( - "../../../connectors/lakebase" - ); + const { createLakebasePool, createLakebasePoolManager } = + await import("../../../connectors/lakebase"); const plugin = makePlugin({}); await plugin.setup(); @@ -314,9 +313,8 @@ describe("LakebasePlugin — OBO via RoutingPool", () => { userClientQueries.length = 0; clientQueries.length = 0; - const { createLakebasePoolManager } = await import( - "../../../connectors/lakebase" - ); + const { createLakebasePoolManager } = + await import("../../../connectors/lakebase"); vi.mocked(createLakebasePoolManager).mockReturnValue({ getPool: vi.fn(() => makeUserPool() as unknown as Pool), hasPool: vi.fn(() => false), @@ -329,9 +327,8 @@ describe("LakebasePlugin — OBO via RoutingPool", () => { }); test("read-only query routes to user pool inside runInUserContext", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const plugin = makePlugin({ exposeAsAgentTool: {} }); await plugin.setup(); @@ -358,9 +355,8 @@ describe("LakebasePlugin — OBO via RoutingPool", () => { }); test("destructive query routes to user pool inside runInUserContext", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const plugin = makePlugin({ exposeAsAgentTool: { readOnly: false } }); await plugin.setup(); @@ -388,9 +384,8 @@ describe("LakebasePlugin — OBO via RoutingPool", () => { }); test("read-only policy still enforced in user context", async () => { - const { runInUserContext } = await import( - "../../../context/execution-context" - ); + const { runInUserContext } = + await import("../../../context/execution-context"); const plugin = makePlugin({ exposeAsAgentTool: {} }); await plugin.setup(); diff --git a/packages/appkit/src/plugins/lakebase/types.ts b/packages/appkit/src/plugins/lakebase/types.ts index f92d85b75..7d5c82e9b 100644 --- a/packages/appkit/src/plugins/lakebase/types.ts +++ b/packages/appkit/src/plugins/lakebase/types.ts @@ -1,4 +1,5 @@ import type { BasePluginConfig } from "shared"; + import type { LakebasePoolConfig } from "../../connectors/lakebase"; /** diff --git a/packages/appkit/src/plugins/server/base-server.ts b/packages/appkit/src/plugins/server/base-server.ts index 16b333e14..97efa9fa8 100644 --- a/packages/appkit/src/plugins/server/base-server.ts +++ b/packages/appkit/src/plugins/server/base-server.ts @@ -1,4 +1,5 @@ import type express from "express"; + import { getConfigScript, type PluginClientConfigs, diff --git a/packages/appkit/src/plugins/server/client-config-sanitizer.ts b/packages/appkit/src/plugins/server/client-config-sanitizer.ts index d06c03371..a491c3934 100644 --- a/packages/appkit/src/plugins/server/client-config-sanitizer.ts +++ b/packages/appkit/src/plugins/server/client-config-sanitizer.ts @@ -1,4 +1,5 @@ import pc from "picocolors"; + import { createLogger } from "../../logging/logger"; const logger = createLogger("server:config"); @@ -349,7 +350,7 @@ function formatLeakedVarsBanner( `Example: ${pc.dim('PUBLIC_APPKIT_MY_VAR="safe-value"')}`, ]; - // biome-ignore lint: stripping ANSI escape sequences requires matching the ESC control character + // oxlint-disable-next-line no-control-regex -- stripping ANSI escape sequences requires matching the ESC control character const stripAnsi = (str: string) => str.replace(/\x1b\[[0-9;]*m/g, ""); const maxLen = Math.max(...contentLines.map((l) => stripAnsi(l).length)); const border = pc.yellow("=".repeat(maxLen + 4)); diff --git a/packages/appkit/src/plugins/server/index.ts b/packages/appkit/src/plugins/server/index.ts index bf1e58091..b882f6294 100644 --- a/packages/appkit/src/plugins/server/index.ts +++ b/packages/appkit/src/plugins/server/index.ts @@ -1,11 +1,13 @@ import fs from "node:fs"; import type { Server as HTTPServer } from "node:http"; import path from "node:path"; + import dotenv from "dotenv"; import express from "express"; import getPort, { portNumbers } from "get-port"; import type { PluginClientConfigs, PluginPhase } from "shared"; import { camelToKebab } from "shared"; + import { AppKitError, ServerError } from "../../errors"; import { TelemetryReporter } from "../../internal-telemetry"; import { createLogger } from "../../logging/logger"; @@ -71,7 +73,7 @@ export class ServerPlugin extends Plugin { private remoteTunnelController?: RemoteTunnelController; /** Bound listen port after optional dev-time resolution. */ private resolvedListenPort?: number; - protected declare config: ServerConfig; + declare protected config: ServerConfig; private serverExtensions: ((app: express.Application) => void)[] = []; private rawBodyPaths: Set = new Set(); /** diff --git a/packages/appkit/src/plugins/server/react-source-loc-vite-plugin.ts b/packages/appkit/src/plugins/server/react-source-loc-vite-plugin.ts index 863fb7755..8aca4e3b2 100644 --- a/packages/appkit/src/plugins/server/react-source-loc-vite-plugin.ts +++ b/packages/appkit/src/plugins/server/react-source-loc-vite-plugin.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import { Lang, parse, type SgNode } from "@ast-grep/napi"; import MagicString from "magic-string"; import type { Plugin } from "vite"; diff --git a/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-controller.ts b/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-controller.ts index cfd53fbd0..0a149c447 100644 --- a/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-controller.ts +++ b/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-controller.ts @@ -1,5 +1,7 @@ import type { Server as HTTPServer } from "node:http"; + import type express from "express"; + import { createLogger } from "../../../logging/logger"; import type { DevFileReader } from "../../../plugin/dev-reader"; import { diff --git a/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-manager.ts b/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-manager.ts index 1c0050884..7b0334d0c 100644 --- a/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-manager.ts +++ b/packages/appkit/src/plugins/server/remote-tunnel/remote-tunnel-manager.ts @@ -3,9 +3,11 @@ import fs from "node:fs"; import type { Server as HTTPServer } from "node:http"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import type express from "express"; import type { TunnelConnection } from "shared"; import { WebSocketServer } from "ws"; + import { createLogger } from "../../../logging/logger"; import { generateTunnelIdFromEmail, diff --git a/packages/appkit/src/plugins/server/static-server.ts b/packages/appkit/src/plugins/server/static-server.ts index f2aaaa486..08a5016ad 100644 --- a/packages/appkit/src/plugins/server/static-server.ts +++ b/packages/appkit/src/plugins/server/static-server.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; + import type express from "express"; import expressStatic from "express"; + import { BaseServer } from "./base-server"; import type { PluginClientConfigs, PluginEndpoints } from "./utils"; diff --git a/packages/appkit/src/plugins/server/tests/error-middleware.test.ts b/packages/appkit/src/plugins/server/tests/error-middleware.test.ts index 9742e07e3..67335058a 100644 --- a/packages/appkit/src/plugins/server/tests/error-middleware.test.ts +++ b/packages/appkit/src/plugins/server/tests/error-middleware.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import { AuthenticationError, ServerError, diff --git a/packages/appkit/src/plugins/server/tests/react-source-loc-vite-plugin.test.ts b/packages/appkit/src/plugins/server/tests/react-source-loc-vite-plugin.test.ts index 1c35fa7a6..91e192aab 100644 --- a/packages/appkit/src/plugins/server/tests/react-source-loc-vite-plugin.test.ts +++ b/packages/appkit/src/plugins/server/tests/react-source-loc-vite-plugin.test.ts @@ -1,6 +1,8 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; + import { describe, expect, it } from "vitest"; + import { reactSourceLocPlugin } from "../react-source-loc-vite-plugin"; const testDir = path.dirname(fileURLToPath(import.meta.url)); diff --git a/packages/appkit/src/plugins/server/tests/remote-tunnel-gate.test.ts b/packages/appkit/src/plugins/server/tests/remote-tunnel-gate.test.ts index 8ff260c08..69936524e 100644 --- a/packages/appkit/src/plugins/server/tests/remote-tunnel-gate.test.ts +++ b/packages/appkit/src/plugins/server/tests/remote-tunnel-gate.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { hasDevQuery, isLocalDev, diff --git a/packages/appkit/src/plugins/server/tests/request-metrics-middleware.test.ts b/packages/appkit/src/plugins/server/tests/request-metrics-middleware.test.ts index c908a494d..0f3eeb906 100644 --- a/packages/appkit/src/plugins/server/tests/request-metrics-middleware.test.ts +++ b/packages/appkit/src/plugins/server/tests/request-metrics-middleware.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { TelemetryReporter } from "../../../internal-telemetry"; import { requestMetricsMiddleware } from "../index"; diff --git a/packages/appkit/src/plugins/server/tests/server.integration.test.ts b/packages/appkit/src/plugins/server/tests/server.integration.test.ts index b7171fe65..6502af8ee 100644 --- a/packages/appkit/src/plugins/server/tests/server.integration.test.ts +++ b/packages/appkit/src/plugins/server/tests/server.integration.test.ts @@ -1,4 +1,5 @@ import type { Server } from "node:http"; + import { mockServiceContext, setupDatabricksEnv } from "@tools/test-helpers"; import { afterAll, beforeAll, describe, expect, test } from "vitest"; @@ -7,6 +8,7 @@ process.env.DATABRICKS_APP_PORT = "8000"; process.env.FLASK_RUN_HOST = "0.0.0.0"; import type { IAppResponse, IAppRouter, PluginManifest } from "shared"; + import { ServiceContext } from "../../../context/service-context"; import { createApp } from "../../../core"; import { AuthenticationError } from "../../../errors"; diff --git a/packages/appkit/src/plugins/server/tests/server.test.ts b/packages/appkit/src/plugins/server/tests/server.test.ts index df8b6d3f2..90a6b339b 100644 --- a/packages/appkit/src/plugins/server/tests/server.test.ts +++ b/packages/appkit/src/plugins/server/tests/server.test.ts @@ -1,5 +1,6 @@ import type { BasePlugin } from "shared"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { PluginContext } from "../../../core/plugin-context"; // Use vi.hoisted for mocks that need to be available before module loading @@ -191,7 +192,9 @@ vi.mock("../client-config-sanitizer", () => ({ })); import fs from "node:fs"; + import express from "express"; + import { LifecycleManager } from "../../../core/lifecycle-manager"; import { sanitizeClientConfig } from "../client-config-sanitizer"; import { ServerPlugin } from "../index"; diff --git a/packages/appkit/src/plugins/server/tests/static-server.test.ts b/packages/appkit/src/plugins/server/tests/static-server.test.ts index 813fd634c..136399307 100644 --- a/packages/appkit/src/plugins/server/tests/static-server.test.ts +++ b/packages/appkit/src/plugins/server/tests/static-server.test.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; // Mock fs @@ -39,7 +40,9 @@ vi.mock("../utils", () => ({ })); import fs from "node:fs"; + import express from "express"; + import { StaticServer } from "../static-server"; import { getConfigScript } from "../utils"; diff --git a/packages/appkit/src/plugins/server/utils.ts b/packages/appkit/src/plugins/server/utils.ts index aaededd3f..4492e7a5e 100644 --- a/packages/appkit/src/plugins/server/utils.ts +++ b/packages/appkit/src/plugins/server/utils.ts @@ -2,6 +2,7 @@ import crypto from "node:crypto"; import fs from "node:fs"; import type http from "node:http"; import path from "node:path"; + import pc from "picocolors"; import type { PluginClientConfigs, PluginEndpoints } from "shared"; diff --git a/packages/appkit/src/plugins/server/vite-dev-server.ts b/packages/appkit/src/plugins/server/vite-dev-server.ts index 0c1cc30b4..22c29cea0 100644 --- a/packages/appkit/src/plugins/server/vite-dev-server.ts +++ b/packages/appkit/src/plugins/server/vite-dev-server.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; + import type express from "express"; import type { ViteDevServer as ViteDevServerType } from "vite"; + import { ServerError } from "../../errors"; import { createLogger } from "../../logging/logger"; import { appKitServingTypesPlugin } from "../../type-generator/serving/vite-plugin"; diff --git a/packages/appkit/src/plugins/serving/schema-filter.ts b/packages/appkit/src/plugins/serving/schema-filter.ts index 92a25c69f..4e56c40a8 100644 --- a/packages/appkit/src/plugins/serving/schema-filter.ts +++ b/packages/appkit/src/plugins/serving/schema-filter.ts @@ -1,4 +1,5 @@ import fs from "node:fs/promises"; + import { createLogger } from "../../logging/logger"; import { CACHE_VERSION, diff --git a/packages/appkit/src/plugins/serving/serving.ts b/packages/appkit/src/plugins/serving/serving.ts index 37707778e..8acfd4393 100644 --- a/packages/appkit/src/plugins/serving/serving.ts +++ b/packages/appkit/src/plugins/serving/serving.ts @@ -1,8 +1,10 @@ import path from "node:path"; import { Readable } from "node:stream"; import { pipeline } from "node:stream/promises"; + import type express from "express"; import type { IAppRouter } from "shared"; + import * as servingConnector from "../../connectors/serving/client"; import { getWorkspaceClient } from "../../context"; import { createLogger } from "../../logging"; @@ -44,7 +46,7 @@ export class ServingPlugin extends Plugin { protected static description = "Authenticated proxy to Databricks Model Serving endpoints"; - protected declare config: IServingConfig; + declare protected config: IServingConfig; private readonly endpoints: Record; private readonly isNamedMode: boolean; diff --git a/packages/appkit/src/plugins/serving/tests/schema-filter.test.ts b/packages/appkit/src/plugins/serving/tests/schema-filter.test.ts index 4fc030d83..2e956e95b 100644 --- a/packages/appkit/src/plugins/serving/tests/schema-filter.test.ts +++ b/packages/appkit/src/plugins/serving/tests/schema-filter.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { filterRequestBody, loadEndpointSchemas } from "../schema-filter"; vi.mock("node:fs/promises", () => ({ diff --git a/packages/appkit/src/plugins/serving/tests/serving.test.ts b/packages/appkit/src/plugins/serving/tests/serving.test.ts index 216c2b727..c273ff6a1 100644 --- a/packages/appkit/src/plugins/serving/tests/serving.test.ts +++ b/packages/appkit/src/plugins/serving/tests/serving.test.ts @@ -1,4 +1,5 @@ import { PassThrough } from "node:stream"; + import { createMockRequest, createMockResponse, @@ -7,6 +8,7 @@ import { setupDatabricksEnv, } from "@tools/test-helpers"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { ServiceContext } from "../../../context/service-context"; import { ServingPlugin, serving } from "../serving"; import type { IServingConfig } from "../types"; diff --git a/packages/appkit/src/plugins/serving/tests/types.test.ts b/packages/appkit/src/plugins/serving/tests/types.test.ts index e99430cc2..e1f0d7761 100644 --- a/packages/appkit/src/plugins/serving/tests/types.test.ts +++ b/packages/appkit/src/plugins/serving/tests/types.test.ts @@ -1,4 +1,5 @@ import { assertType, describe, expectTypeOf, test } from "vitest"; + import type { ServingEndpointHandle } from "../types"; /** diff --git a/packages/appkit/src/plugins/serving/types.ts b/packages/appkit/src/plugins/serving/types.ts index 9ba4616fd..479673313 100644 --- a/packages/appkit/src/plugins/serving/types.ts +++ b/packages/appkit/src/plugins/serving/types.ts @@ -21,7 +21,7 @@ export interface IServingConfig extends BasePluginConfig { * Empty by default — augmented by the Vite type generator's `.d.ts` output via module augmentation. * When populated, provides autocomplete for alias names and typed request/response/chunk per endpoint. */ -// biome-ignore lint/suspicious/noEmptyInterface: intentionally empty — populated via module augmentation +// oxlint-disable-next-line typescript/no-empty-object-type -- intentionally empty — populated via module augmentation export interface ServingEndpointRegistry {} /** Shape of a single registry entry. */ diff --git a/packages/appkit/src/plugins/ui-variants/index.ts b/packages/appkit/src/plugins/ui-variants/index.ts index c33f2ae3e..9d0ccbfde 100644 --- a/packages/appkit/src/plugins/ui-variants/index.ts +++ b/packages/appkit/src/plugins/ui-variants/index.ts @@ -1,4 +1,5 @@ import type { BasePluginConfig, IAppRouter } from "shared"; + import { createLogger } from "../../logging/logger"; import { Plugin, toPlugin } from "../../plugin"; import type { PluginManifest } from "../../registry"; diff --git a/packages/appkit/src/registry/manifest-loader.ts b/packages/appkit/src/registry/manifest-loader.ts index f1bfc79ae..255dddd70 100644 --- a/packages/appkit/src/registry/manifest-loader.ts +++ b/packages/appkit/src/registry/manifest-loader.ts @@ -1,4 +1,5 @@ import type { PluginConstructor } from "shared"; + import { ConfigurationError } from "../errors"; import { createLogger } from "../logging/logger"; import type { diff --git a/packages/appkit/src/registry/resource-registry.ts b/packages/appkit/src/registry/resource-registry.ts index 489faa536..c9b2396fe 100644 --- a/packages/appkit/src/registry/resource-registry.ts +++ b/packages/appkit/src/registry/resource-registry.ts @@ -11,6 +11,7 @@ */ import type { BasePluginConfig, PluginConstructor, PluginData } from "shared"; + import { ConfigurationError } from "../errors"; import { createLogger } from "../logging/logger"; import { formatWarningBanner } from "../utils/banner"; diff --git a/packages/appkit/src/registry/tests/integration.test.ts b/packages/appkit/src/registry/tests/integration.test.ts index cbc660058..54b4465b0 100644 --- a/packages/appkit/src/registry/tests/integration.test.ts +++ b/packages/appkit/src/registry/tests/integration.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { AnalyticsPlugin } from "../../plugins/analytics/analytics"; import { ServerPlugin } from "../../plugins/server"; import { getPluginManifest, getResourceRequirements } from "../manifest-loader"; diff --git a/packages/appkit/src/registry/tests/manifest-loader.test.ts b/packages/appkit/src/registry/tests/manifest-loader.test.ts index 4e18170e8..145ecd36d 100644 --- a/packages/appkit/src/registry/tests/manifest-loader.test.ts +++ b/packages/appkit/src/registry/tests/manifest-loader.test.ts @@ -1,5 +1,6 @@ import type { PluginConstructor } from "shared"; import { describe, expect, it } from "vitest"; + import { ConfigurationError } from "../../errors"; import { getPluginManifest, diff --git a/packages/appkit/src/registry/tests/resource-registry.test.ts b/packages/appkit/src/registry/tests/resource-registry.test.ts index a7a1dfd4c..58687429d 100644 --- a/packages/appkit/src/registry/tests/resource-registry.test.ts +++ b/packages/appkit/src/registry/tests/resource-registry.test.ts @@ -1,5 +1,6 @@ import type { PluginConstructor, PluginData } from "shared"; import { describe, expect, it, vi } from "vitest"; + import { ResourceRegistry } from "../resource-registry"; import type { ResourceRequirement } from "../types"; import { ResourceType } from "../types"; diff --git a/packages/appkit/src/registry/types.ts b/packages/appkit/src/registry/types.ts index a18a2881e..bfdc14ed2 100644 --- a/packages/appkit/src/registry/types.ts +++ b/packages/appkit/src/registry/types.ts @@ -125,8 +125,10 @@ export type ConfigSchema = JSONSchema7; * @see `packages/shared/src/schemas/manifest.ts` `pluginManifestSchema` — Zod source of truth * @see {@link SharedPluginManifest} — shared re-export with JSONSchema7 config */ -export interface PluginManifest - extends Omit { +export interface PluginManifest extends Omit< + SharedPluginManifest, + "resources" | "config" +> { /** Plugin identifier — the single source of truth for the plugin's name */ name: TName; diff --git a/packages/appkit/src/stream/sse-writer.ts b/packages/appkit/src/stream/sse-writer.ts index 2b49d1dee..202f99536 100644 --- a/packages/appkit/src/stream/sse-writer.ts +++ b/packages/appkit/src/stream/sse-writer.ts @@ -1,4 +1,5 @@ import type { IAppResponse } from "shared"; + import { streamDefaults } from "./defaults"; import { type BufferedEvent, diff --git a/packages/appkit/src/stream/stream-manager.ts b/packages/appkit/src/stream/stream-manager.ts index 09fa87ab8..c68cccbab 100644 --- a/packages/appkit/src/stream/stream-manager.ts +++ b/packages/appkit/src/stream/stream-manager.ts @@ -1,6 +1,8 @@ import { randomUUID } from "node:crypto"; + import { context } from "@opentelemetry/api"; import type { IAppResponse, StreamConfig } from "shared"; + import { AppKitError } from "../errors/base"; import { ExecutionError } from "../errors/execution"; import { createLogger } from "../logging/logger"; diff --git a/packages/appkit/src/stream/tests/arrow-stream-processor.test.ts b/packages/appkit/src/stream/tests/arrow-stream-processor.test.ts index f9586524a..555f87339 100644 --- a/packages/appkit/src/stream/tests/arrow-stream-processor.test.ts +++ b/packages/appkit/src/stream/tests/arrow-stream-processor.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { sql } from "../../workspace-client"; import { ArrowStreamProcessor } from "../arrow-stream-processor"; diff --git a/packages/appkit/src/stream/tests/sse-reader.test.ts b/packages/appkit/src/stream/tests/sse-reader.test.ts index d83ba26f2..d1a327534 100644 --- a/packages/appkit/src/stream/tests/sse-reader.test.ts +++ b/packages/appkit/src/stream/tests/sse-reader.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { readSseEvents, type SseEvent } from "../sse-reader"; function streamOf(chunks: string[]): ReadableStream { diff --git a/packages/appkit/src/stream/tests/stream-registry.test.ts b/packages/appkit/src/stream/tests/stream-registry.test.ts index e503fdf0b..a0dfc185d 100644 --- a/packages/appkit/src/stream/tests/stream-registry.test.ts +++ b/packages/appkit/src/stream/tests/stream-registry.test.ts @@ -1,5 +1,6 @@ import type { Context } from "@opentelemetry/api"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import { EventRingBuffer } from "../buffers"; import { StreamRegistry } from "../stream-registry"; import type { StreamEntry } from "../types"; diff --git a/packages/appkit/src/stream/tests/stream.test.ts b/packages/appkit/src/stream/tests/stream.test.ts index 4086c812f..06917e52b 100644 --- a/packages/appkit/src/stream/tests/stream.test.ts +++ b/packages/appkit/src/stream/tests/stream.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import { StreamManager } from "../index"; function createMockResponse(headers: Record = {}) { diff --git a/packages/appkit/src/stream/types.ts b/packages/appkit/src/stream/types.ts index 5cdb40409..07c771106 100644 --- a/packages/appkit/src/stream/types.ts +++ b/packages/appkit/src/stream/types.ts @@ -1,5 +1,6 @@ import type { Context } from "@opentelemetry/api"; import type { IAppResponse } from "shared"; + import type { EventRingBuffer } from "./buffers"; export const SSEWarningCode = { diff --git a/packages/appkit/src/telemetry/index.ts b/packages/appkit/src/telemetry/index.ts index 26877c0df..f3a841efa 100644 --- a/packages/appkit/src/telemetry/index.ts +++ b/packages/appkit/src/telemetry/index.ts @@ -1,15 +1,8 @@ -export type { - Counter, - Histogram, - Span, -} from "@opentelemetry/api"; +export type { Counter, Histogram, Span } from "@opentelemetry/api"; export { SpanKind, SpanStatusCode } from "@opentelemetry/api"; export { SeverityNumber } from "@opentelemetry/api-logs"; export { normalizeTelemetryOptions } from "./config"; export { instrumentations } from "./instrumentations"; export { TelemetryManager } from "./telemetry-manager"; export { TelemetryProvider } from "./telemetry-provider"; -export type { - ITelemetry, - TelemetryConfig, -} from "./types"; +export type { ITelemetry, TelemetryConfig } from "./types"; diff --git a/packages/appkit/src/telemetry/instrumentations.ts b/packages/appkit/src/telemetry/instrumentations.ts index 581bdc0e5..08f8e71b5 100644 --- a/packages/appkit/src/telemetry/instrumentations.ts +++ b/packages/appkit/src/telemetry/instrumentations.ts @@ -1,6 +1,7 @@ import type { Instrumentation } from "@opentelemetry/instrumentation"; import { ExpressInstrumentation } from "@opentelemetry/instrumentation-express"; import { HttpInstrumentation } from "@opentelemetry/instrumentation-http"; + import { shouldIgnoreRequest } from "../utils/path-exclusions"; /** diff --git a/packages/appkit/src/telemetry/telemetry-manager.ts b/packages/appkit/src/telemetry/telemetry-manager.ts index a2642f2ab..b19cd1a07 100644 --- a/packages/appkit/src/telemetry/telemetry-manager.ts +++ b/packages/appkit/src/telemetry/telemetry-manager.ts @@ -22,6 +22,7 @@ import { ATTR_SERVICE_VERSION, } from "@opentelemetry/semantic-conventions"; import type { TelemetryOptions } from "shared"; + import { createLogger } from "../logging/logger"; import { TelemetryProvider } from "./telemetry-provider"; import { AppKitSampler } from "./trace-sampler"; diff --git a/packages/appkit/src/telemetry/telemetry-provider.ts b/packages/appkit/src/telemetry/telemetry-provider.ts index 37b109cb4..4e17955c6 100644 --- a/packages/appkit/src/telemetry/telemetry-provider.ts +++ b/packages/appkit/src/telemetry/telemetry-provider.ts @@ -3,6 +3,7 @@ import { metrics, trace } from "@opentelemetry/api"; import { type Logger, type LogRecord, logs } from "@opentelemetry/api-logs"; import type { Instrumentation } from "@opentelemetry/instrumentation"; import type { TelemetryOptions } from "shared"; + import { normalizeTelemetryOptions, type TelemetryProviderConfig, diff --git a/packages/appkit/src/telemetry/tests/config.test.ts b/packages/appkit/src/telemetry/tests/config.test.ts index 679a262d3..061a66c65 100644 --- a/packages/appkit/src/telemetry/tests/config.test.ts +++ b/packages/appkit/src/telemetry/tests/config.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { normalizeTelemetryOptions } from "../config"; describe("normalizeTelemetryOptions", () => { diff --git a/packages/appkit/src/telemetry/tests/plugin-telemetry.test.ts b/packages/appkit/src/telemetry/tests/plugin-telemetry.test.ts index 42c310e27..12b0a663e 100644 --- a/packages/appkit/src/telemetry/tests/plugin-telemetry.test.ts +++ b/packages/appkit/src/telemetry/tests/plugin-telemetry.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, test, vi } from "vitest"; + import { NOOP_LOGGER, NOOP_METER, NOOP_TRACER } from "../noop"; import type { TelemetryManager } from "../telemetry-manager"; import { TelemetryProvider } from "../telemetry-provider"; diff --git a/packages/appkit/src/telemetry/tests/telemetry-interceptor.test.ts b/packages/appkit/src/telemetry/tests/telemetry-interceptor.test.ts index d4c78ebf6..fb4327ea3 100644 --- a/packages/appkit/src/telemetry/tests/telemetry-interceptor.test.ts +++ b/packages/appkit/src/telemetry/tests/telemetry-interceptor.test.ts @@ -1,6 +1,7 @@ import { type Span, SpanStatusCode } from "@opentelemetry/api"; import type { TelemetryConfig } from "shared"; import { beforeEach, describe, expect, test, vi } from "vitest"; + import * as executionContext from "../../context/execution-context"; import { TelemetryInterceptor } from "../../plugin/interceptors/telemetry"; import type { InterceptorContext } from "../../plugin/interceptors/types"; diff --git a/packages/appkit/src/telemetry/tests/telemetry-manager.test.ts b/packages/appkit/src/telemetry/tests/telemetry-manager.test.ts index 11b85d9bf..84be228b8 100644 --- a/packages/appkit/src/telemetry/tests/telemetry-manager.test.ts +++ b/packages/appkit/src/telemetry/tests/telemetry-manager.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { TelemetryManager } from "../telemetry-manager"; // Mock only exporters to prevent network calls @@ -156,9 +157,8 @@ describe("TelemetryManager", () => { test("should pass headers to exporters", async () => { process.env.OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4318"; - const { OTLPTraceExporter } = await import( - "@opentelemetry/exporter-trace-otlp-proto" - ); + const { OTLPTraceExporter } = + await import("@opentelemetry/exporter-trace-otlp-proto"); vi.clearAllMocks(); TelemetryManager.initialize({ diff --git a/packages/appkit/src/telemetry/trace-sampler.ts b/packages/appkit/src/telemetry/trace-sampler.ts index 7101d4c11..9be8c7572 100644 --- a/packages/appkit/src/telemetry/trace-sampler.ts +++ b/packages/appkit/src/telemetry/trace-sampler.ts @@ -1,6 +1,7 @@ import type { Attributes, Context, Link } from "@opentelemetry/api"; import type { Sampler, SamplingResult } from "@opentelemetry/sdk-trace-base"; import { SamplingDecision } from "@opentelemetry/sdk-trace-base"; + import { shouldExcludePath } from "../utils/path-exclusions"; /** diff --git a/packages/appkit/src/type-generator/cache.ts b/packages/appkit/src/type-generator/cache.ts index ac320f8bc..eee568dbf 100644 --- a/packages/appkit/src/type-generator/cache.ts +++ b/packages/appkit/src/type-generator/cache.ts @@ -1,6 +1,7 @@ import crypto from "node:crypto"; import fs from "node:fs/promises"; import path from "node:path"; + import { createLogger } from "../logging/logger"; import type { MetricSchema } from "./mv-registry/types"; diff --git a/packages/appkit/src/type-generator/index.ts b/packages/appkit/src/type-generator/index.ts index bbbd7c525..2581add71 100644 --- a/packages/appkit/src/type-generator/index.ts +++ b/packages/appkit/src/type-generator/index.ts @@ -1,8 +1,10 @@ import { existsSync } from "node:fs"; import fs from "node:fs/promises"; import path from "node:path"; + import dotenv from "dotenv"; import pc from "picocolors"; + import { METRIC_METADATA_FILE } from "../../../shared/src/schemas/metric-metadata-bundle"; import { createLogger } from "../logging/logger"; import { diff --git a/packages/appkit/src/type-generator/migration.ts b/packages/appkit/src/type-generator/migration.ts index f44e722a6..ac6dbf675 100644 --- a/packages/appkit/src/type-generator/migration.ts +++ b/packages/appkit/src/type-generator/migration.ts @@ -1,7 +1,9 @@ import fsSync from "node:fs"; import fs from "node:fs/promises"; import path from "node:path"; + import pc from "picocolors"; + import { createLogger } from "../logging/logger"; const logger = createLogger("type-generator:migration"); diff --git a/packages/appkit/src/type-generator/mv-registry/config.ts b/packages/appkit/src/type-generator/mv-registry/config.ts index a204d3317..377130f02 100644 --- a/packages/appkit/src/type-generator/mv-registry/config.ts +++ b/packages/appkit/src/type-generator/mv-registry/config.ts @@ -1,5 +1,6 @@ import fs from "node:fs/promises"; import path from "node:path"; + // Plain, zod-free value imports — single source of truth for the UC object-name // grammar. The Zod schema (packages/shared/src/schemas/metric-source.ts) imports // the SAME UC_FQN_PATTERN for its `source` .regex(...), so the runtime and the diff --git a/packages/appkit/src/type-generator/query-registry.ts b/packages/appkit/src/type-generator/query-registry.ts index 108957915..5ba8df9cf 100644 --- a/packages/appkit/src/type-generator/query-registry.ts +++ b/packages/appkit/src/type-generator/query-registry.ts @@ -1,7 +1,9 @@ import fs from "node:fs/promises"; import path from "node:path"; + import { tableFromIPC } from "apache-arrow"; import pc from "picocolors"; + import { createLogger } from "../logging/logger"; import { createWorkspaceClient } from "../workspace-client"; import { CACHE_VERSION, hashSQL, loadCache, saveCache } from "./cache"; diff --git a/packages/appkit/src/type-generator/serving/cache.ts b/packages/appkit/src/type-generator/serving/cache.ts index dc9bf7e27..48330b988 100644 --- a/packages/appkit/src/type-generator/serving/cache.ts +++ b/packages/appkit/src/type-generator/serving/cache.ts @@ -1,6 +1,7 @@ import crypto from "node:crypto"; import fs from "node:fs/promises"; import path from "node:path"; + import { createLogger } from "../../logging/logger"; const logger = createLogger("type-generator:serving:cache"); diff --git a/packages/appkit/src/type-generator/serving/generator.ts b/packages/appkit/src/type-generator/serving/generator.ts index da23441c3..a58ea2a10 100644 --- a/packages/appkit/src/type-generator/serving/generator.ts +++ b/packages/appkit/src/type-generator/serving/generator.ts @@ -1,6 +1,8 @@ import fs from "node:fs/promises"; import path from "node:path"; + import pc from "picocolors"; + import { createLogger } from "../../logging/logger"; import type { EndpointConfig } from "../../plugins/serving/types"; import { diff --git a/packages/appkit/src/type-generator/serving/server-file-extractor.ts b/packages/appkit/src/type-generator/serving/server-file-extractor.ts index b26b0bf15..96c941734 100644 --- a/packages/appkit/src/type-generator/serving/server-file-extractor.ts +++ b/packages/appkit/src/type-generator/serving/server-file-extractor.ts @@ -1,6 +1,8 @@ import fs from "node:fs"; import path from "node:path"; + import { Lang, parse, type SgNode } from "@ast-grep/napi"; + import { createLogger } from "../../logging/logger"; import type { EndpointConfig } from "../../plugins/serving/types"; diff --git a/packages/appkit/src/type-generator/serving/tests/cache.test.ts b/packages/appkit/src/type-generator/serving/tests/cache.test.ts index 0c99c997f..8090ad421 100644 --- a/packages/appkit/src/type-generator/serving/tests/cache.test.ts +++ b/packages/appkit/src/type-generator/serving/tests/cache.test.ts @@ -1,5 +1,7 @@ import fs from "node:fs/promises"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { CACHE_VERSION, hashSchema, diff --git a/packages/appkit/src/type-generator/serving/tests/converter.test.ts b/packages/appkit/src/type-generator/serving/tests/converter.test.ts index 1be30738a..94fd8f17d 100644 --- a/packages/appkit/src/type-generator/serving/tests/converter.test.ts +++ b/packages/appkit/src/type-generator/serving/tests/converter.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { convertRequestSchema, convertResponseSchema, diff --git a/packages/appkit/src/type-generator/serving/tests/fetcher.test.ts b/packages/appkit/src/type-generator/serving/tests/fetcher.test.ts index 2f977ab4e..5d88d1fa7 100644 --- a/packages/appkit/src/type-generator/serving/tests/fetcher.test.ts +++ b/packages/appkit/src/type-generator/serving/tests/fetcher.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, test, vi } from "vitest"; + import { ApiError } from "../../../workspace-client"; import { fetchOpenApiSchema } from "../fetcher"; diff --git a/packages/appkit/src/type-generator/serving/tests/generator.test.ts b/packages/appkit/src/type-generator/serving/tests/generator.test.ts index 05e224286..0d49db85f 100644 --- a/packages/appkit/src/type-generator/serving/tests/generator.test.ts +++ b/packages/appkit/src/type-generator/serving/tests/generator.test.ts @@ -1,5 +1,7 @@ import fs from "node:fs/promises"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { generateServingTypes } from "../generator"; vi.mock("node:fs/promises"); diff --git a/packages/appkit/src/type-generator/serving/tests/server-file-extractor.test.ts b/packages/appkit/src/type-generator/serving/tests/server-file-extractor.test.ts index 4d1a73c71..835e0c70d 100644 --- a/packages/appkit/src/type-generator/serving/tests/server-file-extractor.test.ts +++ b/packages/appkit/src/type-generator/serving/tests/server-file-extractor.test.ts @@ -1,6 +1,8 @@ import fs from "node:fs"; import path from "node:path"; + import { afterEach, describe, expect, test, vi } from "vitest"; + import { extractServingEndpoints, findServerFile, diff --git a/packages/appkit/src/type-generator/serving/vite-plugin.ts b/packages/appkit/src/type-generator/serving/vite-plugin.ts index 5c2a3b172..f2b4386b5 100644 --- a/packages/appkit/src/type-generator/serving/vite-plugin.ts +++ b/packages/appkit/src/type-generator/serving/vite-plugin.ts @@ -1,5 +1,7 @@ import path from "node:path"; + import type { Plugin } from "vite"; + import { createLogger } from "../../logging/logger"; import type { EndpointConfig } from "../../plugins/serving/types"; import { generateServingTypes, SERVING_TYPES_FILE, TYPES_DIR } from "../index"; diff --git a/packages/appkit/src/type-generator/tests/errors.test.ts b/packages/appkit/src/type-generator/tests/errors.test.ts index a978cde0d..d3d5fd874 100644 --- a/packages/appkit/src/type-generator/tests/errors.test.ts +++ b/packages/appkit/src/type-generator/tests/errors.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { classifyBlockingFailure, classifyEnvironmentalCause } from "../errors"; describe("classifyBlockingFailure", () => { diff --git a/packages/appkit/src/type-generator/tests/expand.test.ts b/packages/appkit/src/type-generator/tests/expand.test.ts index ff773886c..fc13713d4 100644 --- a/packages/appkit/src/type-generator/tests/expand.test.ts +++ b/packages/appkit/src/type-generator/tests/expand.test.ts @@ -1,5 +1,6 @@ import ts from "typescript"; import { describe, expect, test } from "vitest"; + import { expandType } from "../expand"; function createProgramWithSource( diff --git a/packages/appkit/src/type-generator/tests/index.test.ts b/packages/appkit/src/type-generator/tests/index.test.ts index a5d0054b3..64edcf358 100644 --- a/packages/appkit/src/type-generator/tests/index.test.ts +++ b/packages/appkit/src/type-generator/tests/index.test.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { afterAll, beforeAll, @@ -9,6 +10,7 @@ import { test, vi, } from "vitest"; + import type { DatabricksStatementExecutionResponse } from "../types"; const mocks = vi.hoisted(() => ({ @@ -109,7 +111,7 @@ const outputDir = path.join(__dirname, "__output__"); // Strip ANSI SGR escape sequences so warning/error messages assert as plain // text (and match CI logs). The ESC byte is built via String.fromCharCode so -// no control character appears in a regex literal (Biome noControlCharactersInRegex). +// no control character appears in a regex literal (oxlint no-control-regex). const ANSI_SGR = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*m`, "g"); const stripAnsi = (s: string): string => s.replace(ANSI_SGR, ""); diff --git a/packages/appkit/src/type-generator/tests/migration.test.ts b/packages/appkit/src/type-generator/tests/migration.test.ts index 8b9ee82c2..ffca1103f 100644 --- a/packages/appkit/src/type-generator/tests/migration.test.ts +++ b/packages/appkit/src/type-generator/tests/migration.test.ts @@ -1,7 +1,9 @@ import fsp from "node:fs/promises"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test } from "vitest"; + import { _resetMigrationState, migrateProjectConfig } from "../migration"; let tmpDir: string; diff --git a/packages/appkit/src/type-generator/tests/mv-registry.test.ts b/packages/appkit/src/type-generator/tests/mv-registry.test.ts index 8e58ad97c..49d28fee0 100644 --- a/packages/appkit/src/type-generator/tests/mv-registry.test.ts +++ b/packages/appkit/src/type-generator/tests/mv-registry.test.ts @@ -2,7 +2,9 @@ import { readFileSync } from "node:fs"; import fs from "node:fs/promises"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test } from "vitest"; + // `quoteFqnForSql` now lives in the shared zod-free leaf alongside the FQN // grammar (moved so the analytics runtime can reuse it); the describe seam // imports it from there. diff --git a/packages/appkit/src/type-generator/tests/preflight.test.ts b/packages/appkit/src/type-generator/tests/preflight.test.ts index 11d5b6f9e..99e51e265 100644 --- a/packages/appkit/src/type-generator/tests/preflight.test.ts +++ b/packages/appkit/src/type-generator/tests/preflight.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { decidePreflight, type PreflightDecision, diff --git a/packages/appkit/src/type-generator/tests/statement-result.test.ts b/packages/appkit/src/type-generator/tests/statement-result.test.ts index 1a19ae5e5..4221cd705 100644 --- a/packages/appkit/src/type-generator/tests/statement-result.test.ts +++ b/packages/appkit/src/type-generator/tests/statement-result.test.ts @@ -1,6 +1,8 @@ import fs from "node:fs"; import path from "node:path"; + import { describe, expect, test } from "vitest"; + import type { WorkspaceClient } from "../../workspace-client"; import { type DescribeFormatMemo, diff --git a/packages/appkit/src/type-generator/tests/sync-metric-views-types.test.ts b/packages/appkit/src/type-generator/tests/sync-metric-views-types.test.ts index 7ade162e9..a0a4e9995 100644 --- a/packages/appkit/src/type-generator/tests/sync-metric-views-types.test.ts +++ b/packages/appkit/src/type-generator/tests/sync-metric-views-types.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { DescribeFetcher } from "../mv-registry/types"; import type { DatabricksStatementExecutionResponse } from "../types"; diff --git a/packages/appkit/src/type-generator/tests/unreachable-warehouse-gate.test.ts b/packages/appkit/src/type-generator/tests/unreachable-warehouse-gate.test.ts index 6c0b6ecc3..6134f8348 100644 --- a/packages/appkit/src/type-generator/tests/unreachable-warehouse-gate.test.ts +++ b/packages/appkit/src/type-generator/tests/unreachable-warehouse-gate.test.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { afterAll, beforeEach, describe, expect, test, vi } from "vitest"; /** Exercises the blocking fallback gate through the real query path. */ diff --git a/packages/appkit/src/type-generator/tests/vite-plugin.test.ts b/packages/appkit/src/type-generator/tests/vite-plugin.test.ts index 36a89f7b1..d9ab8cb57 100644 --- a/packages/appkit/src/type-generator/tests/vite-plugin.test.ts +++ b/packages/appkit/src/type-generator/tests/vite-plugin.test.ts @@ -1,7 +1,9 @@ import { EventEmitter } from "node:events"; import path from "node:path"; + import type { Plugin, ViteDevServer } from "vite"; import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { WarehouseState } from "../warehouse-status"; const mocks = vi.hoisted(() => ({ diff --git a/packages/appkit/src/type-generator/tests/warehouse-status.test.ts b/packages/appkit/src/type-generator/tests/warehouse-status.test.ts index ab01395d8..882188e34 100644 --- a/packages/appkit/src/type-generator/tests/warehouse-status.test.ts +++ b/packages/appkit/src/type-generator/tests/warehouse-status.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import type { WorkspaceClient } from "../../workspace-client"; import { getWarehouseState, diff --git a/packages/appkit/src/type-generator/vite-plugin.ts b/packages/appkit/src/type-generator/vite-plugin.ts index a9a46e83c..0f528175b 100644 --- a/packages/appkit/src/type-generator/vite-plugin.ts +++ b/packages/appkit/src/type-generator/vite-plugin.ts @@ -1,6 +1,8 @@ import { existsSync } from "node:fs"; import path from "node:path"; + import type { Plugin } from "vite"; + import { METRIC_CONFIG_FILE } from "../../../shared/src/schemas/metric-fqn"; import { createLogger } from "../logging/logger"; import { createWorkspaceClient } from "../workspace-client"; diff --git a/packages/appkit/src/utils/tests/vite-config-merge.test.ts b/packages/appkit/src/utils/tests/vite-config-merge.test.ts index bb3ffa205..aa9ec6635 100644 --- a/packages/appkit/src/utils/tests/vite-config-merge.test.ts +++ b/packages/appkit/src/utils/tests/vite-config-merge.test.ts @@ -1,5 +1,6 @@ import type { Plugin } from "vite"; import { describe, expect, test } from "vitest"; + import { mergeConfigDedup } from "../vite-config-merge"; const plugin = (name: string): Plugin => ({ name, enforce: "pre" }); diff --git a/packages/lakebase/src/__tests__/credentials.test.ts b/packages/lakebase/src/__tests__/credentials.test.ts index 837163b11..3ca9e7930 100644 --- a/packages/lakebase/src/__tests__/credentials.test.ts +++ b/packages/lakebase/src/__tests__/credentials.test.ts @@ -1,6 +1,7 @@ import type { WorkspaceClient } from "@databricks/sdk-experimental"; import { ApiClient, Config } from "@databricks/sdk-experimental"; import { beforeEach, describe, expect, it, vi } from "vitest"; + import { generateDatabaseCredential } from "../credentials"; import { type DatabaseCredential, diff --git a/packages/lakebase/src/__tests__/logger.test.ts b/packages/lakebase/src/__tests__/logger.test.ts index 0de3a2088..ac7738342 100644 --- a/packages/lakebase/src/__tests__/logger.test.ts +++ b/packages/lakebase/src/__tests__/logger.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test, vi } from "vitest"; + import { resolveLogger } from "../logger"; import type { Logger, LoggerConfig } from "../types"; diff --git a/packages/lakebase/src/__tests__/pool.test.ts b/packages/lakebase/src/__tests__/pool.test.ts index 97fb862b6..75456879a 100644 --- a/packages/lakebase/src/__tests__/pool.test.ts +++ b/packages/lakebase/src/__tests__/pool.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest"; + import { createLakebasePool } from "../pool"; // ── Mocks ──────────────────────────────────────────────────────────── diff --git a/packages/lakebase/src/config.ts b/packages/lakebase/src/config.ts index ef055edc1..bca7c9fa9 100644 --- a/packages/lakebase/src/config.ts +++ b/packages/lakebase/src/config.ts @@ -1,5 +1,6 @@ import { WorkspaceClient } from "@databricks/sdk-experimental"; import type pg from "pg"; + import { ConfigurationError, ValidationError } from "./errors"; import type { LakebasePoolConfig } from "./types"; diff --git a/packages/lakebase/src/credentials.ts b/packages/lakebase/src/credentials.ts index 231b92a35..ae1a8c9b6 100644 --- a/packages/lakebase/src/credentials.ts +++ b/packages/lakebase/src/credentials.ts @@ -1,4 +1,5 @@ import type { WorkspaceClient } from "@databricks/sdk-experimental"; + import { ValidationError } from "./errors"; import type { DatabaseCredential, diff --git a/packages/lakebase/src/index.ts b/packages/lakebase/src/index.ts index 452173173..b2b9f5e9c 100644 --- a/packages/lakebase/src/index.ts +++ b/packages/lakebase/src/index.ts @@ -1,10 +1,7 @@ export { getUsernameWithApiLookup, getWorkspaceClient } from "./config"; export { generateDatabaseCredential } from "./credentials"; export { createLakebasePool } from "./pool"; -export { - getLakebaseOrmConfig, - getLakebasePgConfig, -} from "./pool-config"; +export { getLakebaseOrmConfig, getLakebasePgConfig } from "./pool-config"; export type { DriverTelemetry } from "./telemetry"; export type { TokenRefreshDeps } from "./token-refresh"; export { createTokenRefreshCallback } from "./token-refresh"; diff --git a/packages/lakebase/src/pool-config.ts b/packages/lakebase/src/pool-config.ts index a843bc173..0374d6b92 100644 --- a/packages/lakebase/src/pool-config.ts +++ b/packages/lakebase/src/pool-config.ts @@ -1,4 +1,5 @@ import type { PoolConfig } from "pg"; + import { getUsernameSync, parsePoolConfig } from "./config"; import { type DriverTelemetry, initTelemetry } from "./telemetry"; import { createTokenRefreshCallback } from "./token-refresh"; diff --git a/packages/lakebase/src/pool.ts b/packages/lakebase/src/pool.ts index c07c114cf..21e15c71c 100644 --- a/packages/lakebase/src/pool.ts +++ b/packages/lakebase/src/pool.ts @@ -1,4 +1,5 @@ import pg from "pg"; + import { resolveLogger } from "./logger"; import { getLakebasePgConfig } from "./pool-config"; import { diff --git a/packages/lakebase/src/telemetry.ts b/packages/lakebase/src/telemetry.ts index 3a903bb00..5822d374e 100644 --- a/packages/lakebase/src/telemetry.ts +++ b/packages/lakebase/src/telemetry.ts @@ -7,6 +7,7 @@ import { trace, } from "@opentelemetry/api"; import type pg from "pg"; + import type { Logger } from "./types"; export { SpanKind, SpanStatusCode }; diff --git a/packages/lakebase/src/token-refresh.ts b/packages/lakebase/src/token-refresh.ts index 1da75ba38..793e25611 100644 --- a/packages/lakebase/src/token-refresh.ts +++ b/packages/lakebase/src/token-refresh.ts @@ -1,4 +1,5 @@ import type { WorkspaceClient } from "@databricks/sdk-experimental"; + import { getWorkspaceClient } from "./config"; import { generateDatabaseCredential } from "./credentials"; import { type DriverTelemetry, SpanStatusCode } from "./telemetry"; diff --git a/packages/shared/src/cli/commands/codemod/index.ts b/packages/shared/src/cli/commands/codemod/index.ts index 2f9c160d5..1590315f7 100644 --- a/packages/shared/src/cli/commands/codemod/index.ts +++ b/packages/shared/src/cli/commands/codemod/index.ts @@ -1,4 +1,5 @@ import { Command } from "commander"; + import { onPluginsReadyCommand } from "./on-plugins-ready"; /** diff --git a/packages/shared/src/cli/commands/codemod/on-plugins-ready.ts b/packages/shared/src/cli/commands/codemod/on-plugins-ready.ts index 37faeefe8..f63318535 100644 --- a/packages/shared/src/cli/commands/codemod/on-plugins-ready.ts +++ b/packages/shared/src/cli/commands/codemod/on-plugins-ready.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { Lang, parse } from "@ast-grep/napi"; import { Command } from "commander"; diff --git a/packages/shared/src/cli/commands/codemod/tests/on-plugins-ready.test.ts b/packages/shared/src/cli/commands/codemod/tests/on-plugins-ready.test.ts index 299e8f1de..33ecd9571 100644 --- a/packages/shared/src/cli/commands/codemod/tests/on-plugins-ready.test.ts +++ b/packages/shared/src/cli/commands/codemod/tests/on-plugins-ready.test.ts @@ -1,6 +1,8 @@ import fs from "node:fs"; import path from "node:path"; + import { describe, expect, test } from "vitest"; + import { migrateFile } from "../on-plugins-ready"; const fixturesDir = path.join(__dirname, "fixtures"); diff --git a/packages/shared/src/cli/commands/docs.ts b/packages/shared/src/cli/commands/docs.ts index 6b001b72b..fb7d477ed 100644 --- a/packages/shared/src/cli/commands/docs.ts +++ b/packages/shared/src/cli/commands/docs.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import { Command } from "commander"; const __filename = fileURLToPath(import.meta.url); diff --git a/packages/shared/src/cli/commands/doctor/bundle.test.ts b/packages/shared/src/cli/commands/doctor/bundle.test.ts index 6fa9d1535..ff94f7899 100644 --- a/packages/shared/src/cli/commands/doctor/bundle.test.ts +++ b/packages/shared/src/cli/commands/doctor/bundle.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { originForEnvVars, readBundleInfo } from "./bundle"; function tmp(files: Record): string { diff --git a/packages/shared/src/cli/commands/doctor/bundle.ts b/packages/shared/src/cli/commands/doctor/bundle.ts index 73918b9af..a68bd8f30 100644 --- a/packages/shared/src/cli/commands/doctor/bundle.ts +++ b/packages/shared/src/cli/commands/doctor/bundle.ts @@ -13,7 +13,9 @@ import fs from "node:fs"; import path from "node:path"; + import yaml from "js-yaml"; + import { APP_YAML_FILE, bindingTypeOf, diff --git a/packages/shared/src/cli/commands/doctor/checks-existence.test.ts b/packages/shared/src/cli/commands/doctor/checks-existence.test.ts index b5441bd2e..f4adb3fe9 100644 --- a/packages/shared/src/cli/commands/doctor/checks-existence.test.ts +++ b/packages/shared/src/cli/commands/doctor/checks-existence.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; + import { runExistenceProbe, toThreeLevelVolumeName } from "./checks-existence"; import type { ResourceTarget } from "./types"; diff --git a/packages/shared/src/cli/commands/doctor/checks-wiring.test.ts b/packages/shared/src/cli/commands/doctor/checks-wiring.test.ts index 8f2e98f48..f150c7c09 100644 --- a/packages/shared/src/cli/commands/doctor/checks-wiring.test.ts +++ b/packages/shared/src/cli/commands/doctor/checks-wiring.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import type { BundleInfo } from "./bundle"; import { checkWiring } from "./checks-wiring"; import type { ResourceTarget } from "./types"; diff --git a/packages/shared/src/cli/commands/doctor/checks.test.ts b/packages/shared/src/cli/commands/doctor/checks.test.ts index 465447aea..e64b9d41a 100644 --- a/packages/shared/src/cli/commands/doctor/checks.test.ts +++ b/packages/shared/src/cli/commands/doctor/checks.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + import { type ConfigCheckContext, checkAuth, diff --git a/packages/shared/src/cli/commands/doctor/index.test.ts b/packages/shared/src/cli/commands/doctor/index.test.ts index d23027a7e..7b997c2ea 100644 --- a/packages/shared/src/cli/commands/doctor/index.test.ts +++ b/packages/shared/src/cli/commands/doctor/index.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { loadEnvFile } from "./index"; function makeTempDir(): string { diff --git a/packages/shared/src/cli/commands/doctor/index.ts b/packages/shared/src/cli/commands/doctor/index.ts index 654b71538..f02273ed1 100644 --- a/packages/shared/src/cli/commands/doctor/index.ts +++ b/packages/shared/src/cli/commands/doctor/index.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import process from "node:process"; + import { Command } from "commander"; import dotenv from "dotenv"; + import { printReport, printReportJson } from "./report"; import { runDoctor } from "./run"; import type { DoctorOptions } from "./types"; diff --git a/packages/shared/src/cli/commands/doctor/report.test.ts b/packages/shared/src/cli/commands/doctor/report.test.ts index 616e881b6..bf547e65b 100644 --- a/packages/shared/src/cli/commands/doctor/report.test.ts +++ b/packages/shared/src/cli/commands/doctor/report.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; + import { printReport, printReportJson } from "./report"; import type { DoctorReport, ResourceCheckResult } from "./types"; @@ -14,7 +15,7 @@ function report(overrides: Partial = {}): DoctorReport { }; } -// biome-ignore lint/suspicious/noControlCharactersInRegex: matching ANSI escapes +// oxlint-disable-next-line no-control-regex -- matches ANSI SGR escape sequences (ESC control char is intentional) const ANSI = /\x1b\[[0-9;]*m/g; /** Runs `fn` with console.log captured; returns the printed lines with any ANSI diff --git a/packages/shared/src/cli/commands/doctor/report.ts b/packages/shared/src/cli/commands/doctor/report.ts index a5f33a16e..776091ecc 100644 --- a/packages/shared/src/cli/commands/doctor/report.ts +++ b/packages/shared/src/cli/commands/doctor/report.ts @@ -4,6 +4,7 @@ */ import pc from "picocolors"; + import { AUTH_UNAVAILABLE_CODE, BUNDLE_MANAGED_CODE, diff --git a/packages/shared/src/cli/commands/doctor/resolve-targets.test.ts b/packages/shared/src/cli/commands/doctor/resolve-targets.test.ts index 6b3c8d53f..d3b2a01da 100644 --- a/packages/shared/src/cli/commands/doctor/resolve-targets.test.ts +++ b/packages/shared/src/cli/commands/doctor/resolve-targets.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { resolveTargetsFromCwd, targetsFromManifestFile, diff --git a/packages/shared/src/cli/commands/doctor/resolve-targets.ts b/packages/shared/src/cli/commands/doctor/resolve-targets.ts index f48a8b700..98ff7b963 100644 --- a/packages/shared/src/cli/commands/doctor/resolve-targets.ts +++ b/packages/shared/src/cli/commands/doctor/resolve-targets.ts @@ -7,6 +7,7 @@ import fs from "node:fs"; import path from "node:path"; + import { computeOriginFromField } from "../../../schemas/manifest"; import type { ResourceTarget } from "./types"; import { errorMessage } from "./utils"; diff --git a/packages/shared/src/cli/commands/doctor/run.test.ts b/packages/shared/src/cli/commands/doctor/run.test.ts index c7bc026d5..18123f00e 100644 --- a/packages/shared/src/cli/commands/doctor/run.test.ts +++ b/packages/shared/src/cli/commands/doctor/run.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it, vi } from "vitest"; + import { runDoctor } from "./run"; /** diff --git a/packages/shared/src/cli/commands/doctor/run.ts b/packages/shared/src/cli/commands/doctor/run.ts index 8042b8545..745ff144d 100644 --- a/packages/shared/src/cli/commands/doctor/run.ts +++ b/packages/shared/src/cli/commands/doctor/run.ts @@ -2,6 +2,7 @@ import fs from "node:fs"; import path from "node:path"; + import { originForEnvVars, readBundleInfo } from "./bundle"; import { type ConfigCheckContext, diff --git a/packages/shared/src/cli/commands/doctor/utils.test.ts b/packages/shared/src/cli/commands/doctor/utils.test.ts index b17ccdc60..c4d623027 100644 --- a/packages/shared/src/cli/commands/doctor/utils.test.ts +++ b/packages/shared/src/cli/commands/doctor/utils.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; + import { DEFAULT_CHECK_TIMEOUT_MS, errorMessage, diff --git a/packages/shared/src/cli/commands/generate-types.test.ts b/packages/shared/src/cli/commands/generate-types.test.ts index 1c2f5c855..85d3556c1 100644 --- a/packages/shared/src/cli/commands/generate-types.test.ts +++ b/packages/shared/src/cli/commands/generate-types.test.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, diff --git a/packages/shared/src/cli/commands/generate-types.ts b/packages/shared/src/cli/commands/generate-types.ts index f38f323a2..4232307b0 100644 --- a/packages/shared/src/cli/commands/generate-types.ts +++ b/packages/shared/src/cli/commands/generate-types.ts @@ -1,7 +1,9 @@ import { spawn } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; + import { Command, Option } from "commander"; + import { METRIC_CONFIG_FILE } from "../../schemas/metric-fqn"; import { acquireSpawnLock, diff --git a/packages/shared/src/cli/commands/lint.test.ts b/packages/shared/src/cli/commands/lint.test.ts index 958ab65e1..d5f891205 100644 --- a/packages/shared/src/cli/commands/lint.test.ts +++ b/packages/shared/src/cli/commands/lint.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { lintSource } from "./lint"; const RULE = "ai-search-index-requires-columns"; diff --git a/packages/shared/src/cli/commands/lint.ts b/packages/shared/src/cli/commands/lint.ts index 6fa9c4b19..af9d08143 100644 --- a/packages/shared/src/cli/commands/lint.ts +++ b/packages/shared/src/cli/commands/lint.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { Lang, parse, type SgNode } from "@ast-grep/napi"; import { Command } from "commander"; diff --git a/packages/shared/src/cli/commands/plugin/add-resource/add-resource.ts b/packages/shared/src/cli/commands/plugin/add-resource/add-resource.ts index 9bd6ac553..4497723e1 100644 --- a/packages/shared/src/cli/commands/plugin/add-resource/add-resource.ts +++ b/packages/shared/src/cli/commands/plugin/add-resource/add-resource.ts @@ -1,8 +1,10 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { cancel, intro, outro } from "@clack/prompts"; import { Command } from "commander"; + import { promptOneResource } from "../create/prompt-resource"; import { DEFAULT_PERMISSION_BY_TYPE, diff --git a/packages/shared/src/cli/commands/plugin/create/create.test.ts b/packages/shared/src/cli/commands/plugin/create/create.test.ts index 0b4982941..fb47994fc 100644 --- a/packages/shared/src/cli/commands/plugin/create/create.test.ts +++ b/packages/shared/src/cli/commands/plugin/create/create.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; + import { buildResourceFromType, parseResourcesJson, diff --git a/packages/shared/src/cli/commands/plugin/create/create.ts b/packages/shared/src/cli/commands/plugin/create/create.ts index db9e659b4..71badd8cc 100644 --- a/packages/shared/src/cli/commands/plugin/create/create.ts +++ b/packages/shared/src/cli/commands/plugin/create/create.ts @@ -1,6 +1,7 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { cancel, confirm, @@ -13,6 +14,7 @@ import { text, } from "@clack/prompts"; import { Command, Option } from "commander"; + import { PLUGIN_NAME_PATTERN } from "../../../../naming"; import { promptOneResource } from "./prompt-resource"; import { diff --git a/packages/shared/src/cli/commands/plugin/create/prompt-resource.ts b/packages/shared/src/cli/commands/plugin/create/prompt-resource.ts index 3d93e3a41..edae5f787 100644 --- a/packages/shared/src/cli/commands/plugin/create/prompt-resource.ts +++ b/packages/shared/src/cli/commands/plugin/create/prompt-resource.ts @@ -1,4 +1,5 @@ import { isCancel, select, text } from "@clack/prompts"; + import { getDefaultFieldsForType, humanizeResourceType, diff --git a/packages/shared/src/cli/commands/plugin/create/resource-defaults.test.ts b/packages/shared/src/cli/commands/plugin/create/resource-defaults.test.ts index 2c8bfa7bb..d2ba8804a 100644 --- a/packages/shared/src/cli/commands/plugin/create/resource-defaults.test.ts +++ b/packages/shared/src/cli/commands/plugin/create/resource-defaults.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { DEFAULT_FIELDS_BY_TYPE, DEFAULT_PERMISSION_BY_TYPE, diff --git a/packages/shared/src/cli/commands/plugin/create/scaffold.test.ts b/packages/shared/src/cli/commands/plugin/create/scaffold.test.ts index 110b28288..56dde0fb4 100644 --- a/packages/shared/src/cli/commands/plugin/create/scaffold.test.ts +++ b/packages/shared/src/cli/commands/plugin/create/scaffold.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { resolveTargetDir, scaffoldPlugin } from "./scaffold"; import type { CreateAnswers } from "./types"; diff --git a/packages/shared/src/cli/commands/plugin/create/scaffold.ts b/packages/shared/src/cli/commands/plugin/create/scaffold.ts index c5f62b435..91c0c0b74 100644 --- a/packages/shared/src/cli/commands/plugin/create/scaffold.ts +++ b/packages/shared/src/cli/commands/plugin/create/scaffold.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { humanizeResourceType, MANIFEST_SCHEMA_ID } from "./resource-defaults"; import type { CreateAnswers } from "./types"; diff --git a/packages/shared/src/cli/commands/plugin/index.ts b/packages/shared/src/cli/commands/plugin/index.ts index 7b5a96acc..6612d205a 100644 --- a/packages/shared/src/cli/commands/plugin/index.ts +++ b/packages/shared/src/cli/commands/plugin/index.ts @@ -1,4 +1,5 @@ import { Command } from "commander"; + import { pluginAddResourceCommand } from "./add-resource/add-resource"; import { pluginCreateCommand } from "./create/create"; import { pluginListCommand } from "./list/list"; diff --git a/packages/shared/src/cli/commands/plugin/list/list.test.ts b/packages/shared/src/cli/commands/plugin/list/list.test.ts index 1ce35aa92..2f633210f 100644 --- a/packages/shared/src/cli/commands/plugin/list/list.test.ts +++ b/packages/shared/src/cli/commands/plugin/list/list.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { listFromDirectory, listFromManifestFile, diff --git a/packages/shared/src/cli/commands/plugin/list/list.ts b/packages/shared/src/cli/commands/plugin/list/list.ts index 4c591d2d4..104df4875 100644 --- a/packages/shared/src/cli/commands/plugin/list/list.ts +++ b/packages/shared/src/cli/commands/plugin/list/list.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { Command } from "commander"; + import { loadManifestFromFile, resolveManifestInDir, diff --git a/packages/shared/src/cli/commands/plugin/manifest-resolve.test.ts b/packages/shared/src/cli/commands/plugin/manifest-resolve.test.ts index 69a1a868a..00fafe77b 100644 --- a/packages/shared/src/cli/commands/plugin/manifest-resolve.test.ts +++ b/packages/shared/src/cli/commands/plugin/manifest-resolve.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { loadManifestFromFile, resolveManifestInDir } from "./manifest-resolve"; function makeTempDir(prefix: string): string { diff --git a/packages/shared/src/cli/commands/plugin/promote/promote.test.ts b/packages/shared/src/cli/commands/plugin/promote/promote.test.ts index 6beb68b38..007fb00ed 100644 --- a/packages/shared/src/cli/commands/plugin/promote/promote.test.ts +++ b/packages/shared/src/cli/commands/plugin/promote/promote.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; + import { IMPORT_PATH_MAP, isStability, diff --git a/packages/shared/src/cli/commands/plugin/promote/promote.ts b/packages/shared/src/cli/commands/plugin/promote/promote.ts index 6f6506fc7..e2587d5d8 100644 --- a/packages/shared/src/cli/commands/plugin/promote/promote.ts +++ b/packages/shared/src/cli/commands/plugin/promote/promote.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { Command } from "commander"; + import { kebabToCamel } from "../../../../naming"; import { resolveManifestInDir } from "../manifest-resolve"; import { isWithinDirectory } from "../sync/sync"; diff --git a/packages/shared/src/cli/commands/plugin/sync/sync.test.ts b/packages/shared/src/cli/commands/plugin/sync/sync.test.ts index e331e27f3..520bedee9 100644 --- a/packages/shared/src/cli/commands/plugin/sync/sync.test.ts +++ b/packages/shared/src/cli/commands/plugin/sync/sync.test.ts @@ -1,6 +1,8 @@ import path from "node:path"; + import { Lang, parse } from "@ast-grep/napi"; import { describe, expect, it } from "vitest"; + import { templateFieldEntrySchema } from "../../../../schemas/manifest"; import { isWithinDirectory, diff --git a/packages/shared/src/cli/commands/plugin/sync/sync.ts b/packages/shared/src/cli/commands/plugin/sync/sync.ts index 6aab3987b..0571c7ed5 100644 --- a/packages/shared/src/cli/commands/plugin/sync/sync.ts +++ b/packages/shared/src/cli/commands/plugin/sync/sync.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; + import { Lang, parse, type SgNode } from "@ast-grep/napi"; import { Command } from "commander"; + import { TEMPLATE_SCAFFOLDING, templateFieldEntrySchema, diff --git a/packages/shared/src/cli/commands/plugin/validate/validate-manifest.test.ts b/packages/shared/src/cli/commands/plugin/validate/validate-manifest.test.ts index ee448beea..6519b729b 100644 --- a/packages/shared/src/cli/commands/plugin/validate/validate-manifest.test.ts +++ b/packages/shared/src/cli/commands/plugin/validate/validate-manifest.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { RESOURCE_KIND_COMMANDS, scaffoldingDescriptorSchema, diff --git a/packages/shared/src/cli/commands/plugin/validate/validate-manifest.ts b/packages/shared/src/cli/commands/plugin/validate/validate-manifest.ts index 062d9f87b..308d654c8 100644 --- a/packages/shared/src/cli/commands/plugin/validate/validate-manifest.ts +++ b/packages/shared/src/cli/commands/plugin/validate/validate-manifest.ts @@ -1,4 +1,5 @@ import type { StandardSchemaV1 } from "@standard-schema/spec"; + import { pluginManifestSchema, templatePluginsManifestSchema, diff --git a/packages/shared/src/cli/commands/plugin/validate/validate.ts b/packages/shared/src/cli/commands/plugin/validate/validate.ts index fd0a20a86..de028ce74 100644 --- a/packages/shared/src/cli/commands/plugin/validate/validate.ts +++ b/packages/shared/src/cli/commands/plugin/validate/validate.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { Command } from "commander"; + import { loadManifestFromFile, type ResolvedManifest, diff --git a/packages/shared/src/cli/commands/registry/add.test.ts b/packages/shared/src/cli/commands/registry/add.test.ts index 538496e97..80b85505f 100644 --- a/packages/shared/src/cli/commands/registry/add.test.ts +++ b/packages/shared/src/cli/commands/registry/add.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it, vi } from "vitest"; + import { partitionDeps, partitionVerified, diff --git a/packages/shared/src/cli/commands/registry/add.ts b/packages/shared/src/cli/commands/registry/add.ts index dfab2bc12..9db613732 100644 --- a/packages/shared/src/cli/commands/registry/add.ts +++ b/packages/shared/src/cli/commands/registry/add.ts @@ -2,8 +2,10 @@ import { spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; import process from "node:process"; + import { Command } from "commander"; import pc from "picocolors"; + import { fetchRegistryItem, fetchVerifiedNames, diff --git a/packages/shared/src/cli/commands/registry/client.test.ts b/packages/shared/src/cli/commands/registry/client.test.ts index b996fd481..3ee34b34a 100644 --- a/packages/shared/src/cli/commands/registry/client.test.ts +++ b/packages/shared/src/cli/commands/registry/client.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { isValidItemName, stripNamespace } from "./client"; describe("stripNamespace", () => { diff --git a/packages/shared/src/cli/commands/registry/client.ts b/packages/shared/src/cli/commands/registry/client.ts index 9157477be..789fd96b9 100644 --- a/packages/shared/src/cli/commands/registry/client.ts +++ b/packages/shared/src/cli/commands/registry/client.ts @@ -1,4 +1,5 @@ import process from "node:process"; + import { REGISTRY_INDEX_API_URL, REGISTRY_INDEX_URL, diff --git a/packages/shared/src/cli/commands/registry/config-plan.test.ts b/packages/shared/src/cli/commands/registry/config-plan.test.ts index d34d392f5..e230cd950 100644 --- a/packages/shared/src/cli/commands/registry/config-plan.test.ts +++ b/packages/shared/src/cli/commands/registry/config-plan.test.ts @@ -1,10 +1,10 @@ import { describe, expect, it } from "vitest"; + import { buildConfigPlan, collectBindingValueNeeds } from "./config-plan"; import type { ResourceRequirementRow } from "./requirements"; /** A DABs `${var.}` reference (literal bundle syntax, not JS interp). */ function varRef(name: string): string { - // biome-ignore lint/style/useTemplate: template literal would trip noTemplateCurlyInString on literal DABs ${var.…} syntax return "${var." + name + "}"; } diff --git a/packages/shared/src/cli/commands/registry/config-writer.test.ts b/packages/shared/src/cli/commands/registry/config-writer.test.ts index 81d2a278b..9bcf7f04e 100644 --- a/packages/shared/src/cli/commands/registry/config-writer.test.ts +++ b/packages/shared/src/cli/commands/registry/config-writer.test.ts @@ -1,8 +1,10 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; import { parseDocument } from "yaml"; + import { buildConfigPlan } from "./config-plan"; import { writeConfig } from "./config-writer"; import type { ResourceRequirementRow } from "./requirements"; @@ -125,7 +127,6 @@ describe("writeConfig — additive patching", () => { " resources:", " - name: sql-warehouse", " sql_warehouse:", - // biome-ignore lint/suspicious/noTemplateCurlyInString: literal DABs ${var.…} bundle syntax, not a JS template placeholder " id: ${var.sql_warehouse_id}", " permission: CAN_USE", "targets:", diff --git a/packages/shared/src/cli/commands/registry/config-writer.ts b/packages/shared/src/cli/commands/registry/config-writer.ts index 4c58368b1..479d30ed7 100644 --- a/packages/shared/src/cli/commands/registry/config-writer.ts +++ b/packages/shared/src/cli/commands/registry/config-writer.ts @@ -1,8 +1,10 @@ import { type SpawnSyncReturns, spawnSync } from "node:child_process"; import fs from "node:fs"; import path from "node:path"; + import pc from "picocolors"; import { parseDocument, type YAMLMap, type YAMLSeq } from "yaml"; + import { APP_YAML_FILE, type AppYamlEnvEntry, diff --git a/packages/shared/src/cli/commands/registry/env-reconcile.test.ts b/packages/shared/src/cli/commands/registry/env-reconcile.test.ts index 4ccf4bd1e..19646e05a 100644 --- a/packages/shared/src/cli/commands/registry/env-reconcile.test.ts +++ b/packages/shared/src/cli/commands/registry/env-reconcile.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; + import { collectEnvNeeds, type EnvNeed, diff --git a/packages/shared/src/cli/commands/registry/env-reconcile.ts b/packages/shared/src/cli/commands/registry/env-reconcile.ts index 6f2d3715b..02a7865b0 100644 --- a/packages/shared/src/cli/commands/registry/env-reconcile.ts +++ b/packages/shared/src/cli/commands/registry/env-reconcile.ts @@ -1,4 +1,5 @@ import dotenv from "dotenv"; + import { fieldOrigin, isValidEnvName, diff --git a/packages/shared/src/cli/commands/registry/env-writer.test.ts b/packages/shared/src/cli/commands/registry/env-writer.test.ts index a3d9498fa..79c1088fa 100644 --- a/packages/shared/src/cli/commands/registry/env-writer.test.ts +++ b/packages/shared/src/cli/commands/registry/env-writer.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { capChoices, syncEnv } from "./env-writer"; import type { ResourceRequirementRow } from "./requirements"; diff --git a/packages/shared/src/cli/commands/registry/env-writer.ts b/packages/shared/src/cli/commands/registry/env-writer.ts index d6f2073eb..a07a966c1 100644 --- a/packages/shared/src/cli/commands/registry/env-writer.ts +++ b/packages/shared/src/cli/commands/registry/env-writer.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import path from "node:path"; + import { autocomplete, isCancel, select, text } from "@clack/prompts"; import pc from "picocolors"; + import type { BindingValueNeed } from "./config-plan"; import { collectEnvNeeds, diff --git a/packages/shared/src/cli/commands/registry/index.ts b/packages/shared/src/cli/commands/registry/index.ts index 72b69bd02..e1d660e37 100644 --- a/packages/shared/src/cli/commands/registry/index.ts +++ b/packages/shared/src/cli/commands/registry/index.ts @@ -1,4 +1,5 @@ import { Command } from "commander"; + import { registryInfoCommand } from "./info"; import { registryListCommand, registrySearchCommand } from "./list"; diff --git a/packages/shared/src/cli/commands/registry/info.ts b/packages/shared/src/cli/commands/registry/info.ts index a809d368f..f1a37d11b 100644 --- a/packages/shared/src/cli/commands/registry/info.ts +++ b/packages/shared/src/cli/commands/registry/info.ts @@ -1,6 +1,8 @@ import process from "node:process"; + import { Command } from "commander"; import pc from "picocolors"; + import { fetchRegistryItem, isValidItemName, stripNamespace } from "./client"; import { resolveToken } from "./constants"; import { extractRequirements, renderRequirements } from "./requirements"; diff --git a/packages/shared/src/cli/commands/registry/list.ts b/packages/shared/src/cli/commands/registry/list.ts index c9aeef0c0..d380f97a0 100644 --- a/packages/shared/src/cli/commands/registry/list.ts +++ b/packages/shared/src/cli/commands/registry/list.ts @@ -1,6 +1,8 @@ import process from "node:process"; + import { Command } from "commander"; import pc from "picocolors"; + import { registryAuthHeaders } from "./client"; import { REGISTRY_INDEX_API_URL, diff --git a/packages/shared/src/cli/commands/registry/requirements.test.ts b/packages/shared/src/cli/commands/registry/requirements.test.ts index bce47a0e2..59d61bb66 100644 --- a/packages/shared/src/cli/commands/registry/requirements.test.ts +++ b/packages/shared/src/cli/commands/registry/requirements.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import type { RegistryItem } from "./client"; import { extractRequirements, diff --git a/packages/shared/src/cli/commands/registry/requirements.ts b/packages/shared/src/cli/commands/registry/requirements.ts index 371cdecbb..70e08ecba 100644 --- a/packages/shared/src/cli/commands/registry/requirements.ts +++ b/packages/shared/src/cli/commands/registry/requirements.ts @@ -1,5 +1,7 @@ import path from "node:path"; + import pc from "picocolors"; + import { computeOriginFromField } from "../../../schemas/manifest"; import type { RegistryItem } from "./client"; diff --git a/packages/shared/src/cli/commands/registry/server-register.test.ts b/packages/shared/src/cli/commands/registry/server-register.test.ts index 48db1eb4d..0298545c7 100644 --- a/packages/shared/src/cli/commands/registry/server-register.test.ts +++ b/packages/shared/src/cli/commands/registry/server-register.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, describe, expect, it } from "vitest"; + import { registerPluginInServer } from "./server-register"; const tempDirs: string[] = []; diff --git a/packages/shared/src/cli/commands/registry/server-register.ts b/packages/shared/src/cli/commands/registry/server-register.ts index 0dc82a3f6..327b0f4ee 100644 --- a/packages/shared/src/cli/commands/registry/server-register.ts +++ b/packages/shared/src/cli/commands/registry/server-register.ts @@ -1,6 +1,8 @@ import fs from "node:fs"; import path from "node:path"; + import { Lang, parse, type SgNode } from "@ast-grep/napi"; + import { JS_IDENTIFIER } from "./constants"; /** Server entry candidates within the server root, in priority order. */ diff --git a/packages/shared/src/cli/commands/registry/workspace-picker.test.ts b/packages/shared/src/cli/commands/registry/workspace-picker.test.ts index b3546e175..7153e0d96 100644 --- a/packages/shared/src/cli/commands/registry/workspace-picker.test.ts +++ b/packages/shared/src/cli/commands/registry/workspace-picker.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it, vi } from "vitest"; + import { composeResourceId, isFlatListable, diff --git a/packages/shared/src/cli/commands/registry/workspace-picker.ts b/packages/shared/src/cli/commands/registry/workspace-picker.ts index 6228290d1..c2e5e9c49 100644 --- a/packages/shared/src/cli/commands/registry/workspace-picker.ts +++ b/packages/shared/src/cli/commands/registry/workspace-picker.ts @@ -1,4 +1,5 @@ import { spawnSync } from "node:child_process"; + import { createWorkspaceClient, type LegacyWorkspaceClient, diff --git a/packages/shared/src/cli/commands/setup.ts b/packages/shared/src/cli/commands/setup.ts index c72e661eb..2f0c9d4a1 100644 --- a/packages/shared/src/cli/commands/setup.ts +++ b/packages/shared/src/cli/commands/setup.ts @@ -1,5 +1,6 @@ import fs from "node:fs"; import path from "node:path"; + import { Command } from "commander"; const PACKAGES = [ diff --git a/packages/shared/src/cli/commands/spawn-lock.test.ts b/packages/shared/src/cli/commands/spawn-lock.test.ts index 5566d4be4..fef2a45a4 100644 --- a/packages/shared/src/cli/commands/spawn-lock.test.ts +++ b/packages/shared/src/cli/commands/spawn-lock.test.ts @@ -1,7 +1,9 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; + import { afterEach, beforeEach, describe, expect, test } from "vitest"; + import { acquireSpawnLock, getSpawnLockPath, diff --git a/packages/shared/src/cli/index.ts b/packages/shared/src/cli/index.ts index 86db0219d..8c4649419 100644 --- a/packages/shared/src/cli/index.ts +++ b/packages/shared/src/cli/index.ts @@ -3,7 +3,9 @@ import "dotenv/config"; import { readFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; + import { Command } from "commander"; + import { codemodCommand } from "./commands/codemod/index.js"; import { docsCommand } from "./commands/docs.js"; import { doctorCommand } from "./commands/doctor/index.js"; diff --git a/packages/shared/src/plugin.ts b/packages/shared/src/plugin.ts index 46f1186b9..15148895e 100644 --- a/packages/shared/src/plugin.ts +++ b/packages/shared/src/plugin.ts @@ -1,5 +1,6 @@ import type express from "express"; import type { JSONSchema7 } from "json-schema"; + import type { DiscoveryDescriptor, PluginManifest as GeneratedPluginManifest, @@ -95,9 +96,7 @@ export type PluginPhase = "core" | "normal" | "deferred"; export type PluginConstructor< C = BasePluginConfig, I extends BasePlugin = BasePlugin, -> = (new ( - config: C, -) => I) & { +> = (new (config: C) => I) & { DEFAULT_CONFIG?: Record; phase?: PluginPhase; /** @@ -121,25 +120,24 @@ export type PluginConstructor< * @see {@link GeneratedPluginManifest} — Zod-inferred base from `schemas/manifest` * @see `packages/appkit/src/registry/types.ts` `PluginManifest` — strict appkit narrowing (enum types) */ -export interface PluginManifest - extends Omit< - GeneratedPluginManifest, - | "name" - | "config" - | "$schema" - | "resources" - | "displayName" - | "description" - | "author" - | "version" - | "repository" - | "keywords" - | "license" - | "onSetupMessage" - | "hidden" - | "devOnly" - | "stability" - > { +export interface PluginManifest extends Omit< + GeneratedPluginManifest, + | "name" + | "config" + | "$schema" + | "resources" + | "displayName" + | "description" + | "author" + | "version" + | "repository" + | "keywords" + | "license" + | "onSetupMessage" + | "hidden" + | "devOnly" + | "stability" +> { name: TName; resources: { required: Omit[]; @@ -198,9 +196,7 @@ export interface ResourceRequirement { export type ConfigFor = T extends { DEFAULT_CONFIG: infer D } ? D - : T extends new ( - ...args: any[] - ) => { config: infer C } + : T extends new (...args: any[]) => { config: infer C } ? C : BasePluginConfig; diff --git a/packages/shared/src/schemas/manifest.ts b/packages/shared/src/schemas/manifest.ts index b3d886609..f5daff435 100644 --- a/packages/shared/src/schemas/manifest.ts +++ b/packages/shared/src/schemas/manifest.ts @@ -29,6 +29,7 @@ */ import { z } from "zod"; + import { PLUGIN_NAME_PATTERN } from "../naming"; // ── Resource type + per-type permission enums ──────────────────────────── diff --git a/packages/shared/src/schemas/metric-fqn.test.ts b/packages/shared/src/schemas/metric-fqn.test.ts index 86f1e749c..07d8a0e26 100644 --- a/packages/shared/src/schemas/metric-fqn.test.ts +++ b/packages/shared/src/schemas/metric-fqn.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { MAX_UC_OBJECT_NAME_LENGTH, UC_FQN_PATTERN } from "./metric-fqn"; /** diff --git a/packages/shared/src/schemas/metric-fqn.ts b/packages/shared/src/schemas/metric-fqn.ts index d957f7d12..9f23118e0 100644 --- a/packages/shared/src/schemas/metric-fqn.ts +++ b/packages/shared/src/schemas/metric-fqn.ts @@ -49,7 +49,7 @@ export const METRIC_CONFIG_FILE = "definitions.json"; * UC_FQN_PATTERN.test("bad name"); // false (space is prohibited) * UC_FQN_PATTERN.test("a/b"); // false (slash is prohibited) */ -// biome-ignore lint/suspicious/noControlCharactersInRegex: UC explicitly prohibits ASCII control characters in object names; this negated class encodes that rule. +// oxlint-disable-next-line no-control-regex -- UC explicitly prohibits ASCII control characters in object names; this negated class encodes that rule. export const UC_FQN_PATTERN = /^[^\x00-\x20\x7f./]+$/; /** A metric view FQN is exactly three segments: catalog.schema.metric_view. */ diff --git a/packages/shared/src/schemas/metric-metadata-bundle.ts b/packages/shared/src/schemas/metric-metadata-bundle.ts index f6a4f1ad9..f4582548e 100644 --- a/packages/shared/src/schemas/metric-metadata-bundle.ts +++ b/packages/shared/src/schemas/metric-metadata-bundle.ts @@ -1,4 +1,5 @@ import { z } from "zod"; + import { metricKeySchema } from "./metric-source"; // Bundle format version. diff --git a/packages/shared/src/schemas/metric-source.test.ts b/packages/shared/src/schemas/metric-source.test.ts index 4b805c257..a4edc152e 100644 --- a/packages/shared/src/schemas/metric-source.test.ts +++ b/packages/shared/src/schemas/metric-source.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { metricSourceSchema } from "./metric-source"; describe("metricSourceSchema", () => { diff --git a/packages/shared/src/schemas/metric-source.ts b/packages/shared/src/schemas/metric-source.ts index 50595ca0c..87d8b6576 100644 --- a/packages/shared/src/schemas/metric-source.ts +++ b/packages/shared/src/schemas/metric-source.ts @@ -18,6 +18,7 @@ */ import { z } from "zod"; + import { MAX_UC_OBJECT_NAME_LENGTH, UC_FQN_PATTERN } from "./metric-fqn"; /** diff --git a/packages/shared/src/sql/tests/sql-helpers.test.ts b/packages/shared/src/sql/tests/sql-helpers.test.ts index e35dacb07..0cadd41d1 100644 --- a/packages/shared/src/sql/tests/sql-helpers.test.ts +++ b/packages/shared/src/sql/tests/sql-helpers.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from "vitest"; + import { isSQLTypeMarker, sql } from "../helpers"; describe("SQL Helpers", () => { diff --git a/packages/shared/src/sse/analytics.test.ts b/packages/shared/src/sse/analytics.test.ts index cdc8a70e1..c219e81c0 100644 --- a/packages/shared/src/sse/analytics.test.ts +++ b/packages/shared/src/sse/analytics.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "vitest"; + import { AnalyticsSseMessage, makeResultMessage } from "./analytics"; describe("AnalyticsSseMessage schema", () => { diff --git a/packages/shared/src/sse/analytics.ts b/packages/shared/src/sse/analytics.ts index eaff6dd12..483bfaf46 100644 --- a/packages/shared/src/sse/analytics.ts +++ b/packages/shared/src/sse/analytics.ts @@ -1,4 +1,5 @@ import { z } from "zod"; + import type { MetricViewColumnDisplay } from "../metric-metadata"; /** diff --git a/packages/shared/src/workspace-client/index.ts b/packages/shared/src/workspace-client/index.ts index 992be412b..91921efeb 100644 --- a/packages/shared/src/workspace-client/index.ts +++ b/packages/shared/src/workspace-client/index.ts @@ -22,10 +22,4 @@ export { Time, TimeUnits, } from "./legacy"; -export type { - files, - jobs, - serving, - sql, - WorkspaceClient, -} from "./types"; +export type { files, jobs, serving, sql, WorkspaceClient } from "./types"; diff --git a/packages/shared/src/workspace-client/legacy.ts b/packages/shared/src/workspace-client/legacy.ts index 307d87a93..8784fbe57 100644 --- a/packages/shared/src/workspace-client/legacy.ts +++ b/packages/shared/src/workspace-client/legacy.ts @@ -1,6 +1,6 @@ /** * The single module in AppKit allowed to import `@databricks/sdk-experimental` - * directly (enforced by the Biome `noRestrictedImports` boundary rule). Every + * directly (enforced by the oxlint `no-restricted-imports` boundary rule). Every * other AppKit module reaches the SDK through the wrapper's re-exports and the * {@link WorkspaceClient} facade. * diff --git a/packages/shared/src/workspace-client/types.ts b/packages/shared/src/workspace-client/types.ts index 6d4db6ae5..398a4afe0 100644 --- a/packages/shared/src/workspace-client/types.ts +++ b/packages/shared/src/workspace-client/types.ts @@ -17,12 +17,7 @@ import type { LegacyWorkspaceClient } from "./legacy"; // SDK type namespaces, re-exported so AppKit modules import them from the // wrapper rather than the SDK directly. -export type { - files, - jobs, - serving, - sql, -} from "@databricks/sdk-experimental"; +export type { files, jobs, serving, sql } from "@databricks/sdk-experimental"; /** * AppKit's workspace client facade. Mirrors the multi-client shape of the diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61b579dd9..d211162d6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,9 +18,6 @@ importers: '@arethetypeswrong/core': specifier: 0.18.4 version: 0.18.4 - '@biomejs/biome': - specifier: 2.2.6 - version: 2.2.6 '@commitlint/cli': specifier: 19.8.1 version: 19.8.1(@types/node@24.7.2)(typescript@5.9.3) @@ -60,6 +57,12 @@ importers: lint-staged: specifier: 15.5.2 version: 15.5.2 + oxfmt: + specifier: 0.62.0 + version: 0.62.0 + oxlint: + specifier: 1.77.0 + version: 1.77.0 publint: specifier: 0.3.15 version: 0.3.15 @@ -1447,63 +1450,6 @@ packages: resolution: {integrity: sha512-ubmJ6TShyaD69VE9DQrlXcdkvJbmwWPB8qYj0H2kaJi29O7vJT9ajSdBd2W8CG34pwL9pYA74fi7RHC1qbLoVQ==} engines: {node: ^20.19.0 || >=22.12.0} - '@biomejs/biome@2.2.6': - resolution: {integrity: sha512-yKTCNGhek0rL5OEW1jbLeZX8LHaM8yk7+3JRGv08my+gkpmtb5dDE+54r2ZjZx0ediFEn1pYBOJSmOdDP9xtFw==} - engines: {node: '>=14.21.3'} - hasBin: true - - '@biomejs/cli-darwin-arm64@2.2.6': - resolution: {integrity: sha512-UZPmn3M45CjTYulgcrFJFZv7YmK3pTxTJDrFYlNElT2FNnkkX4fsxjExTSMeWKQYoZjvekpH5cvrYZZlWu3yfA==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-x64@2.2.6': - resolution: {integrity: sha512-HOUIquhHVgh/jvxyClpwlpl/oeMqntlteL89YqjuFDiZ091P0vhHccwz+8muu3nTyHWM5FQslt+4Jdcd67+xWQ==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-linux-arm64-musl@2.2.6': - resolution: {integrity: sha512-TjCenQq3N6g1C+5UT3jE1bIiJb5MWQvulpUngTIpFsL4StVAUXucWD0SL9MCW89Tm6awWfeXBbZBAhJwjyFbRQ==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - libc: [musl] - - '@biomejs/cli-linux-arm64@2.2.6': - resolution: {integrity: sha512-BpGtuMJGN+o8pQjvYsUKZ+4JEErxdSmcRD/JG3mXoWc6zrcA7OkuyGFN1mDggO0Q1n7qXxo/PcupHk8gzijt5g==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [linux] - libc: [glibc] - - '@biomejs/cli-linux-x64-musl@2.2.6': - resolution: {integrity: sha512-1ZcBux8zVM3JhWN2ZCPaYf0+ogxXG316uaoXJdgoPZcdK/rmRcRY7PqHdAos2ExzvjIdvhQp72UcveI98hgOog==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - libc: [musl] - - '@biomejs/cli-linux-x64@2.2.6': - resolution: {integrity: sha512-1HaM/dpI/1Z68zp8ZdT6EiBq+/O/z97a2AiHMl+VAdv5/ELckFt9EvRb8hDHpk8hUMoz03gXkC7VPXOVtU7faA==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [linux] - libc: [glibc] - - '@biomejs/cli-win32-arm64@2.2.6': - resolution: {integrity: sha512-h3A88G8PGM1ryTeZyLlSdfC/gz3e95EJw9BZmA6Po412DRqwqPBa2Y9U+4ZSGUAXCsnSQE00jLV8Pyrh0d+jQw==} - engines: {node: '>=14.21.3'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-x64@2.2.6': - resolution: {integrity: sha512-yx0CqeOhPjYQ5ZXgPfu8QYkgBhVJyvWe36as7jRuPrKPO5ylVDfwVtPQ+K/mooNTADW0IhxOZm3aPu16dP8yNQ==} - engines: {node: '>=14.21.3'} - cpu: [x64] - os: [win32] - '@braidai/lang@1.1.2': resolution: {integrity: sha512-qBcknbBufNHlui137Hft8xauQMTZDKdophmLFv05r2eNmdIv/MlPuP4TdUknHG68UdWLgVZwgxVe735HzJNIwA==} @@ -3549,6 +3495,250 @@ packages: cpu: [x64] os: [win32] + '@oxfmt/binding-android-arm-eabi@0.62.0': + resolution: {integrity: sha512-pdsv0C4gPjJ8H1+sd8u0BDx+yLACTL+rgeMIOL1ln4ihSnhw8CWXtYWgvcSkyTfgGBIzFKab+d8rx9Xl4en/Kw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxfmt/binding-android-arm64@0.62.0': + resolution: {integrity: sha512-WC3YQ7uS/KtDrjmqwBviwFKe9qeoi+eXx8aX1z/ffG23Md75myjrJaQqTuJvdOLPoa4EYTjDWH0dHXfwulCVog==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxfmt/binding-darwin-arm64@0.62.0': + resolution: {integrity: sha512-GM8Yf3LjjaR1I8PD0SfeoIlwhsh9GvSF+cQ8sf624Yxnjsyumn95aFzYfKJVefblfDIiOAnZ7QVm2sa21Er/0Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxfmt/binding-darwin-x64@0.62.0': + resolution: {integrity: sha512-d5THp7F8bCxLqNogEXDORRsQD6dosf3EyFtnXfBer6v+8tGdcWIjoDX9WaXrrF/26zOmL8qHpPTKCEvpBDmZkQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxfmt/binding-freebsd-x64@0.62.0': + resolution: {integrity: sha512-1DnrtXGZooOZ0fHgAXZUaDQzBVh1CM2MNW4oBXyQ2aWKvCHjyljvT9fgBkOM0fEOb96X5eqtcfJ0YUVt9jj66g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxfmt/binding-linux-arm-gnueabihf@0.62.0': + resolution: {integrity: sha512-4pQDHOYRH+Huqe0StIaWyvk2CVl/aTaqSrbZpA3/pLS2xH24ME7lBgYprhQF2fRkHBzhGGGKliwxFsDdHwx59g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm-musleabihf@0.62.0': + resolution: {integrity: sha512-X0jAaZJFMCVKhB6YyWVTQ/wN2DLsBcZKSMqTS76bF6riT+XZdtg2FPEdjDvdVbunO9cG+tWiVaEs4Zs38lxYog==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxfmt/binding-linux-arm64-gnu@0.62.0': + resolution: {integrity: sha512-682Z8T5s8T5ATArYtsejKvbIfd8LEAXyyDkKkoZVq8HND7Vx8TYLlrDjDSeYfodMeVwHOgkj13lJYR8cj6vUSg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-arm64-musl@0.62.0': + resolution: {integrity: sha512-lk25fAl7KWaLWVJcW0CHEXB7QlQZtx5eDkjpaGMK0hzXTjUe0Wmlu8IKuFHoviSOcEJedRTs4VE/506VqGxGew==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-ppc64-gnu@0.62.0': + resolution: {integrity: sha512-SFyNqHQLwySceWNLhiSldx7wPXRAzP0L0WcW9GegP3uWrpZGJiZlQO85NbHAFPEfxR9PhZ9qSnZryEh7+v+4Gw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-gnu@0.62.0': + resolution: {integrity: sha512-KYj55C1ywJfHo6+aKDuEmUtVEdJALsC5GwayDGsI6FGz2GxFqNr/mA8nxVsNbJzm7sE5MRqTQ9ziImSzhYXysA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-riscv64-musl@0.62.0': + resolution: {integrity: sha512-BhZDNo5GOU5nC378RhD0/XpvaEBHsH3HLgJp8YZX3A0InC7oivzA63HsRmiXFLtLSHAstEVrDf6fbC7Rs8Jh/A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-linux-s390x-gnu@0.62.0': + resolution: {integrity: sha512-UyAFmyHkgSgUJ/wOM4p3U8AC2yAFvRH5PNBs7TnK0fObTT/XSWcdr/lAzPSWaekHaZFaMeFZyk9n93Joq3J93A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-gnu@0.62.0': + resolution: {integrity: sha512-1iYMP0leytWazFubD/WnINJuIrzRPuoL1aWEJdlGezEzDbTxcd29R4r8IUzP2oWeKst5V02uMJgR2NILlPlG6w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/binding-linux-x64-musl@0.62.0': + resolution: {integrity: sha512-4rA/URtJSTVNVAQz6Q8wf7SaRvOXVy+TizriT9hs/Y1XhLR/R+92uWKRQG8yFWRAIEBbFHJ6WevQcl/G9SXEfw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/binding-openharmony-arm64@0.62.0': + resolution: {integrity: sha512-mSZuFHU2ar1KLUjXpI2QBQcJ1VsOB3mOCgQXuXCpKs19dgh4u+OaovNfrWDfiJb+ihJ2+f7YFcaO9bS2dlTCXA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxfmt/binding-win32-arm64-msvc@0.62.0': + resolution: {integrity: sha512-OfwuhkcjDlqC4EgDojtiV9mzpLqeB9KqTOWPOjLEYBVdDCVSxqW3qzp/xcIxsbtI0UgGCnKvAqYKyY25kf5JZw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxfmt/binding-win32-ia32-msvc@0.62.0': + resolution: {integrity: sha512-P9uDDNFRzghO3X8QAzhkjKhK7JvtABsVn8UYtFX7uor12IAnwNt8nNIctvfWj1JkQU/kE+fmLRPiw7XlrIHsZw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxfmt/binding-win32-x64-msvc@0.62.0': + resolution: {integrity: sha512-dlI5SY7XYQCiCBafntWagCR6HcAJB/NpsLtdlPx8x08+Osz8Ok1HHz1GZuusegCe/VoJ6pAnF5a4pd5OZAq7qQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@oxlint/binding-android-arm-eabi@1.77.0': + resolution: {integrity: sha512-E06sKWS6PiI6HRxS1wyQg22HvApt01hI7fV+T3wUk3OSbaaP4a3hYGY/MIQDmASqCiRjBdpRQYkgMkqH82cWmQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxlint/binding-android-arm64@1.77.0': + resolution: {integrity: sha512-NvsKz0KZxTp9cYWPLf+FXaSZwB3oO3peAjtukpOMBgse2vhQSoIIVqeO1yR0lEo/UcdZIDL18uq+kL0LzQ0ytA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxlint/binding-darwin-arm64@1.77.0': + resolution: {integrity: sha512-bgjTn6nW4bQCFBvSvuHCpDD+sONvmpo4lGI4PxzMt1quBA+xYxhczk6RiCn3GZ9gY8uhaBbwhj9MdKGfu6T9DA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxlint/binding-darwin-x64@1.77.0': + resolution: {integrity: sha512-aotaIttH1R6j1Rwhx0M0htgeZyGtVQqYNTVEYMN/UcgHPquGA6kmk9OyuDc3a2GKUQBC+3C3GVQCcrRPMYqAFA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxlint/binding-freebsd-x64@1.77.0': + resolution: {integrity: sha512-nNx/wta7ksRAdYvq+l4AWjXkLxEXHALhENxjj2cYbQAIR4ybaA5L+hCbE63HOmft5czQ6ks+hb8vmEAnn7YGPg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxlint/binding-linux-arm-gnueabihf@1.77.0': + resolution: {integrity: sha512-tMLLjM7xXtzXisVCzkOTXNCy9bZVId2wteNwjohlFDR/jY6WagpEDA1c1wu4xRc20Hojaxj+V6DSR7gbKxijWA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm-musleabihf@1.77.0': + resolution: {integrity: sha512-MiAFDFaqR0tmHTAyo0YDcZ5hyLREdYw/RQhc2R3cbT+8O3tB+zqPM2th9TTQ+Uo3jn/embS+DO+HyX9ztCPkOQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxlint/binding-linux-arm64-gnu@1.77.0': + resolution: {integrity: sha512-/xqQ3B16i1T4cyt/9Mn+4CpzhUXoBXp7kVpIwzOXNFLj5JmK1bIjsbSnX296Gg8A/o7oDtKWikFgBx0SLwztkw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-arm64-musl@1.77.0': + resolution: {integrity: sha512-LSbwuRKiNCenPDcbARqAZ5RfBy7gmj7vOvfJRLeCDU3gFtSxWbhv/+VTlaUqzUhNj1gFLHB8h7ALnxa/Az6z6g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-ppc64-gnu@1.77.0': + resolution: {integrity: sha512-QWdcH31mXEUe5Nq1s0CfCpceaKjIo9uZtwDjAuL681g1axf+5x8xrg/eXWaw//4NCxYZ4V4e5Hu5tvdR+pTBlg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-gnu@1.77.0': + resolution: {integrity: sha512-GnOfYgJxbcElOiPZaDFDl406ONddwvOWk2jvAAAEjwAl4GofNoHF+/HHUIBYa6bFCArlcGPi0XjC4cU1pkgF/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-riscv64-musl@1.77.0': + resolution: {integrity: sha512-AyEMTUCf0xY+hHF+IxqXFQIX0yQOIR8ykpY0lJNOw9xYqOzUX8dyZfRvlG0RfXwuQn2eonf/8NrMmDSZJjdqsA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxlint/binding-linux-s390x-gnu@1.77.0': + resolution: {integrity: sha512-sPLzEcNvxd/oyVQ5oZo92CiHkFkpBeRop13E/P3TPY+hZfXHKCOWKI70TE2RYwMKFJDc20EMjH16L7NZICtKTw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-gnu@1.77.0': + resolution: {integrity: sha512-1Oh2ssH2L7lwyvkdSqaMUfsGfwU2Wfvew+obBUYjRVqhpBcUpwnsPSEr1IzVi9XqkuY10geiLsNKecqaZC34Dw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxlint/binding-linux-x64-musl@1.77.0': + resolution: {integrity: sha512-0j/2wRgNGO+Qj/M1uu/p57h/hFTTWWcfie0ufkbabeus2s5+/QqkCflnMOwLLN5m2GsNeWp4xdl4cPa4n7QCOQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxlint/binding-openharmony-arm64@1.77.0': + resolution: {integrity: sha512-BJ/j54qS0usEnyDkLYURMj2iiD9h5Cyy+ppzeMSXBGRXaGRNWnj1Mw14NqWMR5E/PzdgB30OOCCzLzbRoduafw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxlint/binding-win32-arm64-msvc@1.77.0': + resolution: {integrity: sha512-Yh8w+g2Lpx7StrvtYkoz9JJvXjB9wxgFChFNb85nrXm/wj/XTwGWS1hve9+900HL7llrntYB3YP+y32E3tRqzA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxlint/binding-win32-ia32-msvc@1.77.0': + resolution: {integrity: sha512-zja5b7+6a7UsRFgAQSrnax5vrzliEyNPLCjfXONu/vTWswaIVZGFajJZptaeRvPE4LghtFdAzVFlexTm7MVTGA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxlint/binding-win32-x64-msvc@1.77.0': + resolution: {integrity: sha512-+teyvPDZ2RjUvo+SuCqS/UhaJl1QtdW5fWT5NJTV61V5MIuIS90Db9LixmtEGvXixyttiK62P96MSu3UlpviBw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@phun-ky/typeof@2.0.3': resolution: {integrity: sha512-oeQJs1aa8Ghke8JIK9yuq/+KjMiaYeDZ38jx7MhkXncXlUKjqQ3wEm2X3qCKyjo+ZZofZj+WsEEiqkTtRuE2xQ==} engines: {node: ^20.9.0 || >=22.0.0, npm: '>=10.8.2'} @@ -9349,6 +9539,32 @@ packages: oxc-resolver@11.19.1: resolution: {integrity: sha512-qE/CIg/spwrTBFt5aKmwe3ifeDdLfA2NESN30E42X/lII5ClF8V7Wt6WIJhcGZjp0/Q+nQ+9vgxGk//xZNX2hg==} + oxfmt@0.62.0: + resolution: {integrity: sha512-vxgGHTmnDU9j4CX7dDBLzxgmHxfda/yPcgJkGCMUSCwRmz+euo/V08xXLNgXTeqAB9Fhf3Pe2nO1RNKLCVgphQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + svelte: ^5.0.0 + vite-plus: '*' + peerDependenciesMeta: + svelte: + optional: true + vite-plus: + optional: true + + oxlint@1.77.0: + resolution: {integrity: sha512-qnGh8XJHaQ0dprrDXNQZgS0FgjI6v+V3+X8DwmaV++5Aamy6jGKfDdQ1TUvhUxtmKFAbEf4/WeO5QZX+5WSngg==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + oxlint-tsgolint: '>=7.0.2001' + vite-plus: '*' + peerDependenciesMeta: + oxlint-tsgolint: + optional: true + vite-plus: + optional: true + p-cancelable@3.0.0: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} @@ -11130,6 +11346,10 @@ packages: resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} + tinypool@2.1.0: + resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} @@ -13177,41 +13397,6 @@ snapshots: '@babel/helper-string-parser': 8.0.0-rc.2 '@babel/helper-validator-identifier': 8.0.0-rc.1 - '@biomejs/biome@2.2.6': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.2.6 - '@biomejs/cli-darwin-x64': 2.2.6 - '@biomejs/cli-linux-arm64': 2.2.6 - '@biomejs/cli-linux-arm64-musl': 2.2.6 - '@biomejs/cli-linux-x64': 2.2.6 - '@biomejs/cli-linux-x64-musl': 2.2.6 - '@biomejs/cli-win32-arm64': 2.2.6 - '@biomejs/cli-win32-x64': 2.2.6 - - '@biomejs/cli-darwin-arm64@2.2.6': - optional: true - - '@biomejs/cli-darwin-x64@2.2.6': - optional: true - - '@biomejs/cli-linux-arm64-musl@2.2.6': - optional: true - - '@biomejs/cli-linux-arm64@2.2.6': - optional: true - - '@biomejs/cli-linux-x64-musl@2.2.6': - optional: true - - '@biomejs/cli-linux-x64@2.2.6': - optional: true - - '@biomejs/cli-win32-arm64@2.2.6': - optional: true - - '@biomejs/cli-win32-x64@2.2.6': - optional: true - '@braidai/lang@1.1.2': {} '@braintree/sanitize-url@7.1.1': {} @@ -16190,6 +16375,120 @@ snapshots: '@oxc-resolver/binding-win32-x64-msvc@11.19.1': optional: true + '@oxfmt/binding-android-arm-eabi@0.62.0': + optional: true + + '@oxfmt/binding-android-arm64@0.62.0': + optional: true + + '@oxfmt/binding-darwin-arm64@0.62.0': + optional: true + + '@oxfmt/binding-darwin-x64@0.62.0': + optional: true + + '@oxfmt/binding-freebsd-x64@0.62.0': + optional: true + + '@oxfmt/binding-linux-arm-gnueabihf@0.62.0': + optional: true + + '@oxfmt/binding-linux-arm-musleabihf@0.62.0': + optional: true + + '@oxfmt/binding-linux-arm64-gnu@0.62.0': + optional: true + + '@oxfmt/binding-linux-arm64-musl@0.62.0': + optional: true + + '@oxfmt/binding-linux-ppc64-gnu@0.62.0': + optional: true + + '@oxfmt/binding-linux-riscv64-gnu@0.62.0': + optional: true + + '@oxfmt/binding-linux-riscv64-musl@0.62.0': + optional: true + + '@oxfmt/binding-linux-s390x-gnu@0.62.0': + optional: true + + '@oxfmt/binding-linux-x64-gnu@0.62.0': + optional: true + + '@oxfmt/binding-linux-x64-musl@0.62.0': + optional: true + + '@oxfmt/binding-openharmony-arm64@0.62.0': + optional: true + + '@oxfmt/binding-win32-arm64-msvc@0.62.0': + optional: true + + '@oxfmt/binding-win32-ia32-msvc@0.62.0': + optional: true + + '@oxfmt/binding-win32-x64-msvc@0.62.0': + optional: true + + '@oxlint/binding-android-arm-eabi@1.77.0': + optional: true + + '@oxlint/binding-android-arm64@1.77.0': + optional: true + + '@oxlint/binding-darwin-arm64@1.77.0': + optional: true + + '@oxlint/binding-darwin-x64@1.77.0': + optional: true + + '@oxlint/binding-freebsd-x64@1.77.0': + optional: true + + '@oxlint/binding-linux-arm-gnueabihf@1.77.0': + optional: true + + '@oxlint/binding-linux-arm-musleabihf@1.77.0': + optional: true + + '@oxlint/binding-linux-arm64-gnu@1.77.0': + optional: true + + '@oxlint/binding-linux-arm64-musl@1.77.0': + optional: true + + '@oxlint/binding-linux-ppc64-gnu@1.77.0': + optional: true + + '@oxlint/binding-linux-riscv64-gnu@1.77.0': + optional: true + + '@oxlint/binding-linux-riscv64-musl@1.77.0': + optional: true + + '@oxlint/binding-linux-s390x-gnu@1.77.0': + optional: true + + '@oxlint/binding-linux-x64-gnu@1.77.0': + optional: true + + '@oxlint/binding-linux-x64-musl@1.77.0': + optional: true + + '@oxlint/binding-openharmony-arm64@1.77.0': + optional: true + + '@oxlint/binding-win32-arm64-msvc@1.77.0': + optional: true + + '@oxlint/binding-win32-ia32-msvc@1.77.0': + optional: true + + '@oxlint/binding-win32-x64-msvc@1.77.0': + optional: true + '@phun-ky/typeof@2.0.3': {} '@pkgjs/parseargs@0.11.0': @@ -22611,6 +22910,52 @@ snapshots: '@oxc-resolver/binding-win32-ia32-msvc': 11.19.1 '@oxc-resolver/binding-win32-x64-msvc': 11.19.1 + oxfmt@0.62.0: + dependencies: + tinypool: 2.1.0 + optionalDependencies: + '@oxfmt/binding-android-arm-eabi': 0.62.0 + '@oxfmt/binding-android-arm64': 0.62.0 + '@oxfmt/binding-darwin-arm64': 0.62.0 + '@oxfmt/binding-darwin-x64': 0.62.0 + '@oxfmt/binding-freebsd-x64': 0.62.0 + '@oxfmt/binding-linux-arm-gnueabihf': 0.62.0 + '@oxfmt/binding-linux-arm-musleabihf': 0.62.0 + '@oxfmt/binding-linux-arm64-gnu': 0.62.0 + '@oxfmt/binding-linux-arm64-musl': 0.62.0 + '@oxfmt/binding-linux-ppc64-gnu': 0.62.0 + '@oxfmt/binding-linux-riscv64-gnu': 0.62.0 + '@oxfmt/binding-linux-riscv64-musl': 0.62.0 + '@oxfmt/binding-linux-s390x-gnu': 0.62.0 + '@oxfmt/binding-linux-x64-gnu': 0.62.0 + '@oxfmt/binding-linux-x64-musl': 0.62.0 + '@oxfmt/binding-openharmony-arm64': 0.62.0 + '@oxfmt/binding-win32-arm64-msvc': 0.62.0 + '@oxfmt/binding-win32-ia32-msvc': 0.62.0 + '@oxfmt/binding-win32-x64-msvc': 0.62.0 + + oxlint@1.77.0: + optionalDependencies: + '@oxlint/binding-android-arm-eabi': 1.77.0 + '@oxlint/binding-android-arm64': 1.77.0 + '@oxlint/binding-darwin-arm64': 1.77.0 + '@oxlint/binding-darwin-x64': 1.77.0 + '@oxlint/binding-freebsd-x64': 1.77.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.77.0 + '@oxlint/binding-linux-arm-musleabihf': 1.77.0 + '@oxlint/binding-linux-arm64-gnu': 1.77.0 + '@oxlint/binding-linux-arm64-musl': 1.77.0 + '@oxlint/binding-linux-ppc64-gnu': 1.77.0 + '@oxlint/binding-linux-riscv64-gnu': 1.77.0 + '@oxlint/binding-linux-riscv64-musl': 1.77.0 + '@oxlint/binding-linux-s390x-gnu': 1.77.0 + '@oxlint/binding-linux-x64-gnu': 1.77.0 + '@oxlint/binding-linux-x64-musl': 1.77.0 + '@oxlint/binding-openharmony-arm64': 1.77.0 + '@oxlint/binding-win32-arm64-msvc': 1.77.0 + '@oxlint/binding-win32-ia32-msvc': 1.77.0 + '@oxlint/binding-win32-x64-msvc': 1.77.0 + p-cancelable@3.0.0: {} p-cancelable@4.0.1: {} @@ -24665,6 +25010,8 @@ snapshots: tinypool@1.1.1: {} + tinypool@2.1.0: {} + tinyrainbow@2.0.0: {} tinyspy@4.0.4: {} diff --git a/tools/bundle-size.ts b/tools/bundle-size.ts index de9a1e9ae..484c7e8d5 100644 --- a/tools/bundle-size.ts +++ b/tools/bundle-size.ts @@ -44,6 +44,7 @@ import path from "node:path"; import { fileURLToPath } from "node:url"; import { parseArgs } from "node:util"; import { gzipSync } from "node:zlib"; + // esbuild ships as a transitive of the build toolchain (tsdown/rolldown) and is // hoisted to the root node_modules (see .npmrc `public-hoist-pattern[]=*`), so // it resolves here without a root devDependency. Declaring it directly would @@ -589,7 +590,10 @@ function renderMarkdown( const pkgExceeded = packageExceedsBudget(pkg, base, bundleDeps); exceeded = exceeded || pkgExceeded; - lines.push(`### \`${pkg.name}\`${pkgExceeded ? " ⚠️ over budget" : ""}`, ""); + lines.push( + `### \`${pkg.name}\`${pkgExceeded ? " ⚠️ over budget" : ""}`, + "", + ); const hasBaseline = Boolean(baseline); lines.push( `**npm tarball (packed): ${cell(pkg.tarball?.packed ?? null, base?.tarball?.packed ?? null, hasBaseline)}** — gzipped download (dist + bin; excludes release-only docs/NOTICE).`, diff --git a/tools/format-generated.ts b/tools/format-generated.ts new file mode 100644 index 000000000..7b8b8c5a7 --- /dev/null +++ b/tools/format-generated.ts @@ -0,0 +1,21 @@ +import { spawnSync } from "node:child_process"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const REPO_ROOT = path.join(__dirname, ".."); + +/** + * Format a generated file with oxfmt so it matches the rest of the repo. + * Without this, every `pnpm build`/`pnpm dev` would leave generated files + * dirty until `pnpm format` is run. + */ +export function formatGenerated(filePath: string): void { + const result = spawnSync("pnpm", ["exec", "oxfmt", "--write", filePath], { + cwd: REPO_ROOT, + stdio: "inherit", + }); + if (result.status !== 0) { + throw new Error(`oxfmt --write failed for ${filePath}`); + } +} diff --git a/tools/format-with-biome.ts b/tools/format-with-biome.ts deleted file mode 100644 index 336e69b84..000000000 --- a/tools/format-with-biome.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { spawnSync } from "node:child_process"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const __dirname = path.dirname(fileURLToPath(import.meta.url)); -const REPO_ROOT = path.join(__dirname, ".."); - -/** - * Run Biome on a generated file so its formatting matches the rest of the - * repo. Without this, every `pnpm build`/`pnpm dev` would leave generated - * files dirty until `pnpm format` is run. - */ -export function formatWithBiome(filePath: string): void { - const result = spawnSync( - "pnpm", - ["exec", "biome", "check", "--write", "--no-errors-on-unmatched", filePath], - { cwd: REPO_ROOT, stdio: "inherit" }, - ); - if (result.status !== 0) { - throw new Error(`biome check --write failed for ${filePath}`); - } -} diff --git a/tools/generate-component-mdx.ts b/tools/generate-component-mdx.ts index 7d8a57126..3730ddde7 100644 --- a/tools/generate-component-mdx.ts +++ b/tools/generate-component-mdx.ts @@ -1,6 +1,7 @@ import * as fs from "node:fs"; import * as path from "node:path"; import { fileURLToPath } from "node:url"; + import * as docgen from "react-docgen-typescript"; type ComponentDoc = docgen.ComponentDoc; diff --git a/tools/generate-json-schema.ts b/tools/generate-json-schema.ts index 25cd7519f..b20adec40 100644 --- a/tools/generate-json-schema.ts +++ b/tools/generate-json-schema.ts @@ -9,13 +9,15 @@ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import { z } from "zod"; + import { pluginManifestSchema, templatePluginsManifestSchema, } from "../packages/shared/src/schemas/manifest"; import { metricSourceSchema } from "../packages/shared/src/schemas/metric-source"; -import { formatWithBiome } from "./format-with-biome"; +import { formatGenerated } from "./format-generated"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = path.join(__dirname, ".."); @@ -83,7 +85,7 @@ function stripTopLevelSchemaKey( function writeJson(outPath: string, value: unknown): void { fs.mkdirSync(path.dirname(outPath), { recursive: true }); fs.writeFileSync(outPath, `${JSON.stringify(value, null, 2)}\n`, "utf-8"); - formatWithBiome(outPath); + formatGenerated(outPath); console.log("Wrote", outPath); } diff --git a/tools/generate-plugin-doc-banners.ts b/tools/generate-plugin-doc-banners.ts index 59812a0bd..b93223dc9 100644 --- a/tools/generate-plugin-doc-banners.ts +++ b/tools/generate-plugin-doc-banners.ts @@ -16,6 +16,7 @@ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import { camelToKebab, PLUGIN_NAME_PATTERN, diff --git a/tools/generate-plugin-entries.ts b/tools/generate-plugin-entries.ts index f0ce6980e..2b461c537 100644 --- a/tools/generate-plugin-entries.ts +++ b/tools/generate-plugin-entries.ts @@ -14,11 +14,12 @@ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import { kebabToCamel, PLUGIN_NAME_PATTERN, } from "../packages/shared/src/naming"; -import { formatWithBiome } from "./format-with-biome.ts"; +import { formatGenerated } from "./format-generated.ts"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = path.join(__dirname, ".."); @@ -154,10 +155,10 @@ function main(): void { fs.writeFileSync(GA_OUT, renderBarrel(ga), "utf-8"); fs.writeFileSync(BETA_OUT, renderBarrel(beta), "utf-8"); // Self-format so a fresh `pnpm build` doesn't leave the generated - // barrels dirty against biome's canonical formatting (matches the + // barrels dirty against oxfmt's canonical formatting (matches the // pattern set by tools/generate-registry-types.ts after PR #324). - formatWithBiome(GA_OUT); - formatWithBiome(BETA_OUT); + formatGenerated(GA_OUT); + formatGenerated(BETA_OUT); console.log( `Wrote ${path.relative(REPO_ROOT, GA_OUT)} (${ga.length} GA plugin${ga.length === 1 ? "" : "s"})`, diff --git a/tools/generate-registry-types.ts b/tools/generate-registry-types.ts index 144c4e61e..08709839c 100644 --- a/tools/generate-registry-types.ts +++ b/tools/generate-registry-types.ts @@ -11,6 +11,7 @@ import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; + import { appPermissionSchema, databasePermissionSchema, @@ -27,7 +28,7 @@ import { vectorSearchIndexPermissionSchema, volumePermissionSchema, } from "../packages/shared/src/schemas/manifest"; -import { formatWithBiome } from "./format-with-biome"; +import { formatGenerated } from "./format-generated"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const REPO_ROOT = path.join(__dirname, ".."); @@ -146,7 +147,7 @@ function main(): void { const out = generate(); fs.mkdirSync(path.dirname(OUT_PATH), { recursive: true }); fs.writeFileSync(OUT_PATH, out, "utf-8"); - formatWithBiome(OUT_PATH); + formatGenerated(OUT_PATH); console.log("Wrote", OUT_PATH); } diff --git a/tools/playground/deploy-playground.ts b/tools/playground/deploy-playground.ts index 81f8f1c55..c8c572590 100644 --- a/tools/playground/deploy-playground.ts +++ b/tools/playground/deploy-playground.ts @@ -3,6 +3,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; import { promisify } from "node:util"; + import ora from "ora"; const exec = promisify(execChildProcess); diff --git a/tools/playground/prepared-files/client-viteconfig.ts b/tools/playground/prepared-files/client-viteconfig.ts index 564f4fafb..8a6831d2c 100644 --- a/tools/playground/prepared-files/client-viteconfig.ts +++ b/tools/playground/prepared-files/client-viteconfig.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import { tanstackRouter } from "@tanstack/router-plugin/vite"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; diff --git a/tools/prepare-template-artifact.ts b/tools/prepare-template-artifact.ts index 8df7cde78..486224bd2 100644 --- a/tools/prepare-template-artifact.ts +++ b/tools/prepare-template-artifact.ts @@ -43,7 +43,7 @@ const { values } = parseArgs({ }); const tarballDir = values["tarball-dir"]; -// biome-ignore lint/style/noNonNullAssertion: default value guarantees this is defined +// oxlint-disable-next-line typescript/no-non-null-assertion -- default value guarantees this is defined const outputDir = values["output-dir"]!; const STAGING_DIR = join(ROOT, outputDir); diff --git a/tools/test-helpers.ts b/tools/test-helpers.ts index 9161a0f67..7f75cff1c 100644 --- a/tools/test-helpers.ts +++ b/tools/test-helpers.ts @@ -1,6 +1,7 @@ import type { Span, SpanOptions } from "@opentelemetry/api"; import type { IAppRouter } from "shared"; import { vi } from "vitest"; + import type { ServiceContextState } from "../packages/appkit/src/context/service-context"; import type { UserContext } from "../packages/appkit/src/context/user-context"; import type { @@ -290,9 +291,8 @@ export function createMockUserContext( export async function mockServiceContext(options: TestContextOptions = {}) { const serviceContext = createMockServiceContext(options); - const contextModule = await import( - "../packages/appkit/src/context/service-context" - ); + const contextModule = + await import("../packages/appkit/src/context/service-context"); const getSpy = vi .spyOn(contextModule.ServiceContext, "get") diff --git a/vitest.config.ts b/vitest.config.ts index 8c2893b01..d466c3a51 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,4 +1,5 @@ import path from "node:path"; + import react from "@vitejs/plugin-react"; import tsconfigPaths from "vite-tsconfig-paths"; import { defineConfig } from "vitest/config";