@cosmicdrift/kumiko-framework 0.369.0 → 0.371.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +14 -1
- package/agents/examples/apex-surface-auth.md +2 -1
- package/agents/examples/app-config.md +98 -0
- package/agents/examples/auth-mfa.md +72 -0
- package/agents/examples/chat-channels.md +1 -1
- package/agents/examples/compose-stacks.md +188 -0
- package/agents/examples/env-composition.md +278 -0
- package/agents/examples/host-routing.md +181 -0
- package/agents/examples/inbound-mail-triage.md +1 -1
- package/agents/examples/legal-pages.md +52 -3
- package/agents/examples/managed-config.md +1 -0
- package/agents/examples/managed-pages.md +1 -0
- package/agents/examples/prod-boot-options.md +180 -0
- package/agents/examples/relations.md +4 -0
- package/agents/examples/secrets-demo.md +4 -2
- package/agents/examples/security-baseline.md +20 -17
- package/agents/examples.md +6 -1
- package/agents/features.md +14 -2
- package/dist/api/anonymous-cookie.d.ts +1 -1
- package/dist/api/anonymous-live-entities.d.ts +1 -1
- package/dist/api/auth-middleware.d.ts +2 -2
- package/dist/api/auth-routes.d.ts +7 -7
- package/dist/api/extra-route.d.ts +2 -2
- package/dist/api/index.d.ts +37 -37
- package/dist/api/jwt.d.ts +1 -1
- package/dist/api/observability-middleware.d.ts +1 -1
- package/dist/api/readiness.d.ts +1 -1
- package/dist/api/redis-sse-broker.d.ts +2 -2
- package/dist/api/request-context.d.ts +1 -1
- package/dist/api/request-id-middleware.d.ts +3 -3
- package/dist/api/route-registrars.d.ts +4 -4
- package/dist/api/routes.d.ts +1 -1
- package/dist/api/server.d.ts +16 -16
- package/dist/api/sse-broker.d.ts +1 -1
- package/dist/api/sse-route.d.ts +1 -1
- package/dist/api/websocket-route.d.ts +3 -3
- package/dist/auth/index.d.ts +2 -2
- package/dist/compliance/duration-spec.d.ts +2 -2
- package/dist/compliance/index.d.ts +6 -6
- package/dist/compliance/profiles.d.ts +1 -1
- package/dist/config/index.d.ts +44 -0
- package/dist/config/index.js +61 -0
- package/dist/crypto/blind-index.d.ts +1 -1
- package/dist/crypto/event-pii.d.ts +1 -1
- package/dist/crypto/in-memory-kms-adapter.d.ts +1 -1
- package/dist/crypto/index.d.ts +11 -11
- package/dist/crypto/is-self-pii-field.d.ts +1 -1
- package/dist/crypto/kms-wiring.d.ts +2 -2
- package/dist/crypto/owner-transition-rekey.d.ts +1 -1
- package/dist/crypto/pg-kms-adapter.d.ts +1 -1
- package/dist/crypto/pii-field-encryption.d.ts +4 -4
- package/dist/crypto/request-kms-cache.d.ts +1 -1
- package/dist/crypto/subject-resolver.d.ts +3 -3
- package/dist/db/apply-entity-event.d.ts +4 -4
- package/dist/db/assert-exists-in.d.ts +4 -4
- package/dist/db/blind-index-cleanup.d.ts +2 -2
- package/dist/db/collect-table-metas.d.ts +2 -2
- package/dist/db/compound-types.d.ts +1 -1
- package/dist/db/config-seed.d.ts +5 -5
- package/dist/db/connection.d.ts +1 -6
- package/dist/db/connection.js +15 -4
- package/dist/db/dialect.d.ts +1 -1
- package/dist/db/eagerload.d.ts +3 -3
- package/dist/db/entity-field-encryption.d.ts +3 -3
- package/dist/db/entity-field-encryption.js +3 -1
- package/dist/db/entity-table-from-registry.d.ts +3 -3
- package/dist/db/entity-table-meta.d.ts +3 -3
- package/dist/db/event-store-executor-context.d.ts +9 -9
- package/dist/db/event-store-executor-read.d.ts +2 -2
- package/dist/db/event-store-executor-write.d.ts +2 -2
- package/dist/db/event-store-executor.d.ts +8 -8
- package/dist/db/feature-table-sources.d.ts +1 -1
- package/dist/db/index.d.ts +39 -39
- package/dist/db/located-timestamp.d.ts +1 -1
- package/dist/db/lock-guard.d.ts +2 -2
- package/dist/db/migrate-generator.d.ts +2 -2
- package/dist/db/migrate-runner.d.ts +1 -1
- package/dist/db/money.d.ts +1 -1
- package/dist/db/parent-ref-clause.d.ts +4 -4
- package/dist/db/projection-registry-binding.d.ts +1 -1
- package/dist/db/queries/advisory-lock.d.ts +1 -1
- package/dist/db/queries/backfill-pii.d.ts +2 -2
- package/dist/db/queries/ddl.d.ts +1 -1
- package/dist/db/queries/entity-read.d.ts +1 -1
- package/dist/db/queries/es-ops.d.ts +1 -1
- package/dist/db/queries/event-consumer.d.ts +2 -2
- package/dist/db/queries/event-store-admin.d.ts +1 -1
- package/dist/db/queries/event-store-transfer.d.ts +1 -1
- package/dist/db/queries/event-store.d.ts +1 -1
- package/dist/db/queries/pii-backfill-state.d.ts +1 -1
- package/dist/db/queries/projection-rebuild.d.ts +1 -1
- package/dist/db/queries/raw-sql.d.ts +1 -1
- package/dist/db/queries/seed-context.d.ts +2 -2
- package/dist/db/queries/shadow-swap.d.ts +3 -3
- package/dist/db/queries/table-ops.d.ts +1 -1
- package/dist/db/queries/test-stack.d.ts +2 -2
- package/dist/db/query.d.ts +3 -3
- package/dist/db/rebuild-marker.d.ts +1 -1
- package/dist/db/reference-data.d.ts +3 -3
- package/dist/db/render-ddl.d.ts +1 -1
- package/dist/db/replay-migration-sql.d.ts +1 -1
- package/dist/db/retired-framework-tables.d.ts +1 -1
- package/dist/db/schema-inspection.d.ts +1 -1
- package/dist/db/table-builder.d.ts +4 -4
- package/dist/db/table-push.d.ts +3 -3
- package/dist/db/tenant-db-runner.d.ts +2 -2
- package/dist/db/tenant-db.d.ts +7 -9
- package/dist/db/tenant-db.js +2 -12
- package/dist/derivatives/derivatives-context.d.ts +3 -3
- package/dist/derivatives/field-variants.d.ts +1 -1
- package/dist/derivatives/index.d.ts +6 -6
- package/dist/engine/access.d.ts +1 -1
- package/dist/engine/active-membership.d.ts +2 -2
- package/dist/engine/boot-validator/access-declarations.d.ts +1 -1
- package/dist/engine/boot-validator/access-roles.d.ts +1 -1
- package/dist/engine/boot-validator/action-wiring.d.ts +1 -1
- package/dist/engine/boot-validator/api-ext.d.ts +1 -1
- package/dist/engine/boot-validator/boot-check.d.ts +1 -1
- package/dist/engine/boot-validator/card-meta-overflow.d.ts +1 -1
- package/dist/engine/boot-validator/config-deps.d.ts +1 -1
- package/dist/engine/boot-validator/detail-screens.d.ts +2 -2
- package/dist/engine/boot-validator/entity-handler.d.ts +1 -1
- package/dist/engine/boot-validator/entity-list-screens.d.ts +1 -1
- package/dist/engine/boot-validator/gdpr-storage.d.ts +1 -1
- package/dist/engine/boot-validator/global-tenancy.d.ts +1 -1
- package/dist/engine/boot-validator/handler-field-references.d.ts +1 -1
- package/dist/engine/boot-validator/i18n-keys.d.ts +1 -1
- package/dist/engine/boot-validator/index.d.ts +7 -7
- package/dist/engine/boot-validator/nav.d.ts +1 -1
- package/dist/engine/boot-validator/ownership.d.ts +2 -2
- package/dist/engine/boot-validator/parent-ref.d.ts +1 -1
- package/dist/engine/boot-validator/pii-retention.d.ts +2 -2
- package/dist/engine/boot-validator/projection-list-screens.d.ts +1 -1
- package/dist/engine/boot-validator/query-output-columns.d.ts +1 -1
- package/dist/engine/boot-validator/query-refs.d.ts +1 -1
- package/dist/engine/boot-validator/record-owned.d.ts +1 -1
- package/dist/engine/boot-validator/screens.d.ts +2 -2
- package/dist/engine/boot-validator/security-baseline.d.ts +1 -1
- package/dist/engine/boot-validator/selector-owner-panels.d.ts +1 -1
- package/dist/engine/boot-validator/transfer-graph.d.ts +2 -2
- package/dist/engine/boot-validator/url-prefill-fields.d.ts +1 -1
- package/dist/engine/boot-validator/workspaces.d.ts +1 -1
- package/dist/engine/boot-validator.d.ts +1 -1
- package/dist/engine/bridge-stub.d.ts +1 -1
- package/dist/engine/build-app-schema.d.ts +2 -2
- package/dist/engine/build-config-feature-schema.d.ts +5 -5
- package/dist/engine/build-target.d.ts +2 -2
- package/dist/engine/changeset-changes.d.ts +1 -1
- package/dist/engine/codemod/index.d.ts +2 -2
- package/dist/engine/config-helpers.d.ts +1 -1
- package/dist/engine/constants.d.ts +1 -1
- package/dist/engine/create-app.d.ts +2 -2
- package/dist/engine/cross-tenant.d.ts +2 -2
- package/dist/engine/dedupe-features.d.ts +1 -1
- package/dist/engine/define-feature.d.ts +1 -1
- package/dist/engine/define-feature.js +2 -2
- package/dist/engine/define-handler.d.ts +4 -4
- package/dist/engine/define-step.d.ts +1 -1
- package/dist/engine/define-workflow.d.ts +2 -2
- package/dist/engine/effective-features.d.ts +1 -1
- package/dist/engine/embedded-derived.d.ts +1 -1
- package/dist/engine/entity-handlers.d.ts +6 -5
- package/dist/engine/entity-handlers.js +6 -3
- package/dist/engine/event-def.d.ts +15 -0
- package/dist/engine/event-def.js +123 -0
- package/dist/engine/event-helpers.d.ts +1 -1
- package/dist/engine/extension-names.d.ts +8 -8
- package/dist/engine/extension-selector-plugins.d.ts +2 -2
- package/dist/engine/extensions/escape-hatch-usage.d.ts +1 -1
- package/dist/engine/extensions/storage-provider.d.ts +1 -1
- package/dist/engine/extensions/tenant-data.d.ts +3 -3
- package/dist/engine/extensions/tenant-resource.d.ts +2 -2
- package/dist/engine/extensions/user-data.d.ts +2 -2
- package/dist/engine/factories.d.ts +1 -1
- package/dist/engine/feature-ast/extractors/ai-steps.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/events.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/handlers.d.ts +4 -4
- package/dist/engine/feature-ast/extractors/hooks.d.ts +5 -5
- package/dist/engine/feature-ast/extractors/index.d.ts +14 -14
- package/dist/engine/feature-ast/extractors/jobs-routes.d.ts +3 -3
- package/dist/engine/feature-ast/extractors/projections-screens.d.ts +3 -3
- package/dist/engine/feature-ast/extractors/round1.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/round2.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/round3.d.ts +4 -4
- package/dist/engine/feature-ast/extractors/round5.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/round6.d.ts +2 -2
- package/dist/engine/feature-ast/extractors/shared.d.ts +2 -2
- package/dist/engine/feature-ast/index.d.ts +16 -16
- package/dist/engine/feature-ast/parse.d.ts +2 -2
- package/dist/engine/feature-ast/patch.d.ts +1 -1
- package/dist/engine/feature-ast/patcher.d.ts +15 -15
- package/dist/engine/feature-ast/pattern-change-schema.d.ts +10 -10
- package/dist/engine/feature-ast/patterns.d.ts +15 -15
- package/dist/engine/feature-ast/render.d.ts +1 -1
- package/dist/engine/feature-builder-state.d.ts +5 -5
- package/dist/engine/feature-config-events-jobs.d.ts +3 -3
- package/dist/engine/feature-config-events-jobs.js +8 -130
- package/dist/engine/feature-entity-handlers.d.ts +4 -4
- package/dist/engine/feature-entity-handlers.js +11 -5
- package/dist/engine/feature-manifest.d.ts +1 -1
- package/dist/engine/feature-ui-extensions.d.ts +7 -7
- package/dist/engine/feature-ui-extensions.js +2 -2
- package/dist/engine/field-access.d.ts +1 -1
- package/dist/engine/field-helpers.d.ts +1 -1
- package/dist/engine/handler-helpers.d.ts +1 -1
- package/dist/engine/index.d.ts +89 -88
- package/dist/engine/index.js +1 -0
- package/dist/engine/instruction-fields.d.ts +1 -1
- package/dist/engine/object-form.d.ts +1 -1
- package/dist/engine/object-form.js +5 -6
- package/dist/engine/ownership.d.ts +3 -3
- package/dist/engine/pattern-library/index.d.ts +2 -2
- package/dist/engine/pattern-library/library.d.ts +2 -2
- package/dist/engine/pattern-library/mixed-schemas.d.ts +1 -1
- package/dist/engine/pattern-library/opaque-schemas.d.ts +1 -1
- package/dist/engine/pattern-library/shared-fields.d.ts +1 -1
- package/dist/engine/pattern-library/static-schemas.d.ts +1 -1
- package/dist/engine/pattern-library/types.d.ts +1 -1
- package/dist/engine/personal-data-fields.d.ts +2 -2
- package/dist/engine/pipeline.d.ts +2 -2
- package/dist/engine/project-app-schema-for-roles.d.ts +1 -1
- package/dist/engine/projection-helpers.d.ts +4 -4
- package/dist/engine/read-claim.d.ts +1 -1
- package/dist/engine/registry-facade.d.ts +2 -2
- package/dist/engine/registry-ingest.d.ts +2 -2
- package/dist/engine/registry-state.d.ts +2 -2
- package/dist/engine/registry-validate.d.ts +3 -3
- package/dist/engine/registry.d.ts +1 -1
- package/dist/engine/resolve-config-or-param.d.ts +2 -2
- package/dist/engine/role-assignment.d.ts +1 -1
- package/dist/engine/run-in.d.ts +1 -1
- package/dist/engine/run-pipeline.d.ts +3 -3
- package/dist/engine/schema-builder.d.ts +1 -1
- package/dist/engine/screen-filter-ops.d.ts +1 -1
- package/dist/engine/screen-helpers.d.ts +2 -2
- package/dist/engine/soft-delete-cleanup.d.ts +2 -2
- package/dist/engine/steps/_event-match.d.ts +1 -1
- package/dist/engine/steps/_no-return-guard.d.ts +1 -1
- package/dist/engine/steps/_read-source.d.ts +4 -4
- package/dist/engine/steps/_resolver-utils.d.ts +1 -1
- package/dist/engine/steps/aggregate-append-event.d.ts +1 -1
- package/dist/engine/steps/aggregate-create.d.ts +2 -2
- package/dist/engine/steps/aggregate-update.d.ts +3 -3
- package/dist/engine/steps/branch.d.ts +1 -1
- package/dist/engine/steps/call-feature.d.ts +2 -2
- package/dist/engine/steps/compute.d.ts +1 -1
- package/dist/engine/steps/for-each.d.ts +1 -1
- package/dist/engine/steps/mail-send.d.ts +1 -1
- package/dist/engine/steps/read-find-many.d.ts +2 -2
- package/dist/engine/steps/read-find-one.d.ts +2 -2
- package/dist/engine/steps/retry.d.ts +1 -1
- package/dist/engine/steps/return.d.ts +2 -2
- package/dist/engine/steps/unsafe-projection-delete.d.ts +2 -2
- package/dist/engine/steps/unsafe-projection-upsert.d.ts +1 -1
- package/dist/engine/steps/wait-for-event.d.ts +1 -1
- package/dist/engine/steps/wait.d.ts +1 -1
- package/dist/engine/steps/webhook-send.d.ts +1 -1
- package/dist/engine/strip-disabled-features-from-app-schema.d.ts +4 -4
- package/dist/engine/system-user.d.ts +2 -2
- package/dist/engine/template-variables.d.ts +1 -1
- package/dist/engine/tier-resolver-extension.d.ts +4 -4
- package/dist/engine/transfer-adjacency.d.ts +1 -1
- package/dist/engine/types/index.d.ts +6 -6
- package/dist/engine/validate-projection-allowlist.d.ts +1 -1
- package/dist/engine/validation.d.ts +1 -1
- package/dist/entrypoint/index.d.ts +12 -12
- package/dist/env/dry-run.d.ts +14 -1
- package/dist/env/dry-run.js +50 -0
- package/dist/env/index.d.ts +54 -16
- package/dist/env/index.js +76 -7
- package/dist/errors/classes.d.ts +3 -3
- package/dist/errors/docs-url.d.ts +1 -1
- package/dist/errors/index.d.ts +18 -18
- package/dist/errors/member-resolution.d.ts +1 -1
- package/dist/errors/serialize.d.ts +2 -2
- package/dist/errors/subject-erased.d.ts +1 -1
- package/dist/errors/to-kumiko-error.d.ts +1 -1
- package/dist/errors/write-error-info.d.ts +1 -1
- package/dist/errors/zod-bridge.d.ts +1 -1
- package/dist/es-ops/context.d.ts +4 -4
- package/dist/es-ops/index.d.ts +4 -4
- package/dist/es-ops/operations-schema.d.ts +1 -1
- package/dist/es-ops/runner.d.ts +3 -3
- package/dist/es-ops/runner.js +9 -1
- package/dist/es-ops/types.d.ts +2 -2
- package/dist/event-store/admin-api.d.ts +3 -3
- package/dist/event-store/archive.d.ts +2 -2
- package/dist/event-store/event-store.d.ts +2 -2
- package/dist/event-store/events-schema.d.ts +1 -1
- package/dist/event-store/index.d.ts +15 -15
- package/dist/event-store/provenance-append.d.ts +3 -3
- package/dist/event-store/rebuild-dead-letter.d.ts +2 -2
- package/dist/event-store/row-to-stored-event.d.ts +2 -2
- package/dist/event-store/snapshot.d.ts +2 -2
- package/dist/event-store/tenant-db-append.d.ts +2 -2
- package/dist/event-store/transfer.d.ts +3 -3
- package/dist/event-store/upcaster-dead-letter.d.ts +2 -2
- package/dist/event-store/upcaster.d.ts +3 -3
- package/dist/files/assert-file-refs-belong-to-tenant.d.ts +2 -2
- package/dist/files/bind-pending-file-refs.d.ts +3 -3
- package/dist/files/create-file-ref-from-bytes.d.ts +4 -4
- package/dist/files/create-file-ref.d.ts +3 -3
- package/dist/files/dispose-removed-file-refs.d.ts +2 -2
- package/dist/files/feature.d.ts +3 -3
- package/dist/files/file-handle.d.ts +1 -1
- package/dist/files/file-ref-entity.d.ts +1 -1
- package/dist/files/file-ref-table.d.ts +1 -1
- package/dist/files/file-routes.d.ts +5 -5
- package/dist/files/in-memory-provider.d.ts +1 -1
- package/dist/files/index.d.ts +20 -20
- package/dist/files/load-save-file-refs.d.ts +2 -2
- package/dist/files/local-provider.d.ts +1 -1
- package/dist/files/provider-resolver.d.ts +5 -5
- package/dist/files/purge-expired-file-ref-bytes.d.ts +2 -2
- package/dist/files/record-read-check.d.ts +1 -1
- package/dist/files/record-write-check.d.ts +3 -3
- package/dist/files/storage-tracking.d.ts +2 -2
- package/dist/files/types.d.ts +1 -1
- package/dist/files/zip-stream.d.ts +1 -1
- package/dist/i18n/index.d.ts +4 -4
- package/dist/i18n/mail-registry.d.ts +1 -1
- package/dist/i18n/required-surface-keys.d.ts +1 -1
- package/dist/i18n/settings-hub-keys.d.ts +1 -1
- package/dist/internal/stack-support.d.ts +12 -12
- package/dist/internal/testing.d.ts +4 -4
- package/dist/jobs/index.d.ts +2 -2
- package/dist/jobs/job-runner.d.ts +1 -1
- package/dist/jobs/max-per-tenant.d.ts +1 -1
- package/dist/lifecycle/index.d.ts +2 -2
- package/dist/lifecycle/lifecycle.d.ts +1 -1
- package/dist/lifecycle/signal-handlers.d.ts +1 -1
- package/dist/logging/index.d.ts +4 -4
- package/dist/logging/pino-logger.d.ts +1 -1
- package/dist/logging/utils.d.ts +1 -1
- package/dist/migrations/index.d.ts +4 -4
- package/dist/migrations/kumiko-drift.d.ts +1 -1
- package/dist/migrations/pending-rebuilds.d.ts +5 -5
- package/dist/migrations/pii-event-backfill.d.ts +4 -4
- package/dist/migrations/projection-table-index.d.ts +1 -1
- package/dist/observability/console-provider.d.ts +1 -1
- package/dist/observability/context.d.ts +1 -1
- package/dist/observability/escape-hatch-report.d.ts +3 -3
- package/dist/observability/fallback.d.ts +1 -1
- package/dist/observability/index.d.ts +16 -16
- package/dist/observability/metric-validator.d.ts +1 -1
- package/dist/observability/metrics-handle.d.ts +1 -1
- package/dist/observability/metrics-wiring.d.ts +2 -2
- package/dist/observability/noop-provider.d.ts +1 -1
- package/dist/observability/prometheus-meter.d.ts +1 -1
- package/dist/observability/recording-meter.d.ts +1 -1
- package/dist/observability/recording-tracer.d.ts +1 -1
- package/dist/observability/redis-wrapper.d.ts +1 -1
- package/dist/observability/sensitive-filter.d.ts +1 -1
- package/dist/observability/standard-metrics.d.ts +1 -1
- package/dist/pipeline/active-membership.d.ts +4 -4
- package/dist/pipeline/append-event-core.d.ts +3 -3
- package/dist/pipeline/auth-claims-resolver.d.ts +2 -2
- package/dist/pipeline/cascade-handler.d.ts +3 -3
- package/dist/pipeline/dispatch-batch.d.ts +2 -2
- package/dist/pipeline/dispatch-query.d.ts +4 -4
- package/dist/pipeline/dispatch-shared.d.ts +17 -17
- package/dist/pipeline/dispatch-stream.d.ts +2 -2
- package/dist/pipeline/dispatch-write.d.ts +4 -4
- package/dist/pipeline/dispatcher-utils.d.ts +2 -2
- package/dist/pipeline/dispatcher.d.ts +12 -12
- package/dist/pipeline/event-consumer-state.d.ts +1 -1
- package/dist/pipeline/event-dispatcher-admin.d.ts +1 -1
- package/dist/pipeline/event-dispatcher-delivery.d.ts +7 -7
- package/dist/pipeline/event-dispatcher.d.ts +7 -7
- package/dist/pipeline/event-retention.d.ts +1 -1
- package/dist/pipeline/handler-access-error.d.ts +2 -2
- package/dist/pipeline/index.d.ts +42 -42
- package/dist/pipeline/irreversible-operation-gate.d.ts +1 -1
- package/dist/pipeline/lifecycle-pipeline.d.ts +2 -2
- package/dist/pipeline/member-read-only-transaction.d.ts +2 -2
- package/dist/pipeline/member-reader.d.ts +5 -5
- package/dist/pipeline/msp-rebuild.d.ts +4 -4
- package/dist/pipeline/multi-stream-apply-context.d.ts +3 -3
- package/dist/pipeline/notify-scope.d.ts +3 -3
- package/dist/pipeline/pending-gap-ranges.d.ts +2 -2
- package/dist/pipeline/pre-handler-gates.d.ts +3 -3
- package/dist/pipeline/pre-transaction-reservations.d.ts +4 -4
- package/dist/pipeline/projection-rebuild.d.ts +3 -3
- package/dist/pipeline/projection-state.d.ts +1 -1
- package/dist/pipeline/projections-runner.d.ts +3 -3
- package/dist/pipeline/projections-runner.js +3 -4
- package/dist/pipeline/system-hooks.d.ts +4 -4
- package/dist/pipeline/system-identity-switch.d.ts +3 -3
- package/dist/pipeline/tenant-timezone-cache.d.ts +1 -1
- package/dist/pipeline/write-origin.d.ts +3 -3
- package/dist/pipeline/write-result-masking.d.ts +2 -2
- package/dist/random/index.d.ts +2 -2
- package/dist/rate-limit/bucket.d.ts +1 -1
- package/dist/rate-limit/index.d.ts +3 -3
- package/dist/rate-limit/middleware.d.ts +3 -3
- package/dist/redis/cache-sync-bus.d.ts +2 -2
- package/dist/redis/cache-sync-topics.d.ts +1 -1
- package/dist/redis/index.d.ts +8 -8
- package/dist/redis/pubsub-signal.d.ts +1 -1
- package/dist/schema-cli.d.ts +1 -1
- package/dist/schema-cli.js +21 -2
- package/dist/search/derive-search-adapter-config.d.ts +2 -2
- package/dist/search/in-memory-adapter.d.ts +1 -1
- package/dist/search/index.d.ts +6 -6
- package/dist/search/meilisearch-adapter.d.ts +2 -2
- package/dist/search/purge-subject.d.ts +4 -4
- package/dist/search/reindex-entity.d.ts +3 -3
- package/dist/secrets/dek-cache.d.ts +1 -1
- package/dist/secrets/env-master-key-provider.d.ts +1 -1
- package/dist/secrets/env-master-key-provider.js +26 -11
- package/dist/secrets/envelope-cipher.d.ts +2 -2
- package/dist/secrets/envelope.d.ts +1 -1
- package/dist/secrets/index.d.ts +9 -9
- package/dist/secrets/rotation.d.ts +1 -1
- package/dist/secrets/stored-envelope.d.ts +1 -1
- package/dist/seeding/entity-seed.d.ts +1 -1
- package/dist/seeding/index.d.ts +3 -3
- package/dist/seeding/seed-users.d.ts +1 -1
- package/dist/time/index.d.ts +6 -6
- package/dist/ui-types/app-schema.d.ts +5 -5
- package/dist/ui-types/index.d.ts +23 -23
- package/dist/upgrade-cli.js +13 -3
- package/dist/utils/index.d.ts +9 -9
- package/package.json +19 -66
- package/presets/biome-app.json +80 -0
- package/presets/tsconfig.app.json +19 -0
- package/src/changes.json +84 -2
- package/src/scripts/codemod/README.md +18 -0
- package/src/scripts/codemod/codemod-support.ts +1 -1
- package/src/scripts/codemod/db-factory.ts +1 -1
- package/src/scripts/codemod/feature-factory.ts +1 -1
- package/src/scripts/codemod/import-extensions.ts +118 -0
- package/src/scripts/codemod/migrate-cross-tenant.ts +2 -2
- package/src/scripts/codemod/migrate-db-raw.ts +1 -1
- package/src/scripts/codemod/migrate-open-to-all.ts +1 -1
- package/src/scripts/codemod/object-form.ts +1 -1
- package/src/scripts/codemod/s3-imports.ts +1 -1
- package/src/scripts/codemod/tenant-db-options.ts +1 -1
- package/src/scripts/codemod/testing-move.ts +2 -2
- package/dist/db/bun-db-deprecated.d.ts +0 -10
- package/dist/db/bun-db-deprecated.js +0 -5
- package/dist/stack/index.d.ts +0 -10
- package/dist/stack/index.js +0 -11
- package/dist/testing/e2e-generator.d.ts +0 -5
- package/dist/testing/e2e-generator.js +0 -5
- package/dist/testing/handler-context.d.ts +0 -5
- package/dist/testing/handler-context.js +0 -5
- package/dist/testing/index.d.ts +0 -10
- package/dist/testing/index.js +0 -10
- package/dist/testing/real-providers.d.ts +0 -5
- package/dist/testing/real-providers.js +0 -5
package/src/changes.json
CHANGED
|
@@ -1,4 +1,86 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.371.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Dry-run env table and boot check respect required overrides and the fileStorage default",
|
|
6
|
+
"detail": "The env table of KUMIKO_DRY_RUN_ENV=boot shows a variable as required when the app schema overlays required() on an optional field, and the error says required. The schema-cli boot check applies runProdApp's fileStorage default instead of demanding FILE_STORAGE_PROVIDER."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.370.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "inspectEnv, renderEnvInspection and the dry-run mode parser",
|
|
12
|
+
"detail": "inspectEnv(schema, env, { sources }) checks each field on its own and returns its status (set, unset, missing, invalid) without the value; renderEnvInspection renders those rows as the boot table. parseDryRunEnvMode reads KUMIKO_DRY_RUN_ENV (1, true, human, json, pulumi, k8s, boot) and isDryRunEnvActive tells module-level code whether a dry run is running. DRY_RUN_ENV_VAR names the variable."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"version": "0.370.0",
|
|
16
|
+
"type": "improvement",
|
|
17
|
+
"title": "createEnvMasterKeyProvider defers the keyring check in a dry run",
|
|
18
|
+
"detail": "While KUMIKO_DRY_RUN_ENV is set, createEnvMasterKeyProvider no longer throws at construction on a missing or malformed keyring; the first key operation throws instead. Apps that build the provider at module load can run the boot dry run on an empty env. Outside a dry run the check still runs at construction, and the boot probe for encrypted entity fields forces it in both cases."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"version": "0.370.0",
|
|
22
|
+
"type": "improvement",
|
|
23
|
+
"title": "composeEnvSchema returns a typed schema",
|
|
24
|
+
"detail": "composeEnvSchema infers the merged shape from core, extend and every feature typed with featureWithEnvSchema(feature, schema), so parseEnv(composed.schema, …) returns typed values instead of a string record. optionalFeatures types those fields optional. A feature list widened to FeatureDefinition[] still compiles and contributes no keys to the type. extend may now repeat a feature's field when it is the same instance, so an app can spread a block such as stripeEnvSchema next to the mounted feature; a different field under that key still throws."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"version": "0.370.0",
|
|
28
|
+
"type": "breaking",
|
|
29
|
+
"title": "import-extensions codemod and tsconfig options for .ts import specifiers",
|
|
30
|
+
"detail": "The import-extensions codemod rewrites relative import and export specifiers that end in .js or .jsx to the .ts or .tsx file next to the importer (import, export from, import type, import() and mock.module). It leaves a specifier alone and reports it when no such file exists. The framework repo itself now imports with .ts endings; its published dist is unchanged. tsc writes .js into the dist, and the .d.ts files keep .ts specifiers, which TypeScript resolves to the sibling .d.ts. An app tsconfig needs allowImportingTsExtensions: true, because the framework packages now ship sources with .ts specifiers and tsc checks them (the preset @cosmicdrift/kumiko-framework/tsconfig.app.json sets it). A tsconfig that emits JS also needs rewriteRelativeImportExtensions (TypeScript 5.7 or newer); a project that only type-checks code from another project reference needs rewriteRelativeImportExtensions false plus emitDeclarationOnly. Consumer code with .js endings keeps running once the option is set.",
|
|
31
|
+
"migration": "Add `allowImportingTsExtensions: true` to the app tsconfig (or extend @cosmicdrift/kumiko-framework/tsconfig.app.json), then run the codemod (bun node_modules/@cosmicdrift/kumiko-framework/src/scripts/codemod/import-extensions.ts . --write); the guard import-extensions reports remaining .js specifiers.",
|
|
32
|
+
"codemod": "scripts/codemod/import-extensions.ts"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"version": "0.370.0",
|
|
36
|
+
"type": "improvement",
|
|
37
|
+
"title": "defineAppConfig in @cosmicdrift/kumiko-framework/config, plus biome and tsconfig presets for apps",
|
|
38
|
+
"detail": "kumiko.config.ts default-exports defineAppConfig({ features, prodFeatures?, client: { entries }, ports: { dev, e2e, infra? } }). defineAppConfig throws on ports outside 1..65535, a port claimed twice within the app, an empty client.entries list and entries that leave the app. allAppFeatures(config) returns features plus prodFeatures. New exports @cosmicdrift/kumiko-framework/biome (Biome 2.5.7 preset with vcs.useIgnoreFile false) and @cosmicdrift/kumiko-framework/tsconfig.app.json; an app's biome.json and tsconfig.json extend them and keep their own overrides next to extends."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"version": "0.370.0",
|
|
42
|
+
"type": "breaking",
|
|
43
|
+
"title": "createDbConnection takes only the options object, the bun-db subpath is gone",
|
|
44
|
+
"detail": "The positional createDbConnection(url, options) overload and the deprecated @cosmicdrift/kumiko-framework/bun-db subpath are removed. createDbConnection({ url, ...options }) and the query helpers come from @cosmicdrift/kumiko-framework/db. Removed from /bun-db: DeleteManyBatchedOptions, DeleteManyBatchedResult, IncrementCounterOptions, InnerJoinRow, InnerJoinSpec, InsertOnConflictDoNothingOptions, JoinColumnPair, JsonTextMatch, SelectOptions, TableInfo, UpsertOnConflictOptions, WhereObject, WhereOperator, WhereValue, aggregateWhere, asEntityTableMeta, asRawClient, countWhere, deleteMany, deleteManyBatched, extractTableInfo, fetchOne, incrementCounter, insertMany, insertOnConflictDoNothing, insertOne, instantToTimestamptzParam, isTimestamptzType, requireEntityTableMeta, runInSavepoint, runInSavepointIfSupported, runnerCanBeginTransaction, selectInnerJoin, selectMany, transaction, unsafeReadRetrying, updateMany, upsertByPk, upsertOnConflict.",
|
|
45
|
+
"migration": "Run bun kumiko-upgrade --apply. It rewrites positional calls to createDbConnection({ url, ... }) and moves bun-db imports to @cosmicdrift/kumiko-framework/db.",
|
|
46
|
+
"codemod": "scripts/codemod/db-factory.ts"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"version": "0.370.0",
|
|
50
|
+
"type": "breaking",
|
|
51
|
+
"title": "DB_PROVIDER other than postgres fails at boot",
|
|
52
|
+
"detail": "dbConnectionOptionsFromEnv used to ignore DB_PROVIDER, so DB_PROVIDER=bun booted postgres-js while the deployment still claimed Bun.SQL. Any value other than empty or \"postgres\" now throws with a hint to remove the variable.",
|
|
53
|
+
"migration": "Remove DB_PROVIDER from the environment, Helm values and Pulumi config. postgres-js is the only driver."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"version": "0.370.0",
|
|
57
|
+
"type": "breaking",
|
|
58
|
+
"title": "createTenantDb takes only the options object",
|
|
59
|
+
"detail": "The positional createTenantDb(db, tenantId, ...) overload is removed. createTenantDb({ db, tenantId, ... }) is the only form.",
|
|
60
|
+
"migration": "Run bun kumiko-upgrade --apply. It rewrites positional calls to createTenantDb({ db, tenantId, ... }).",
|
|
61
|
+
"codemod": "scripts/codemod/tenant-db-options.ts"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"version": "0.370.0",
|
|
65
|
+
"type": "breaking",
|
|
66
|
+
"title": "The test stack is no longer re-exported from the framework",
|
|
67
|
+
"detail": "The subpaths @cosmicdrift/kumiko-framework/stack, /testing, /testing/handler-context, /testing/real-providers and /testing/e2e-generator are removed, and so is the optional peer dependency on @cosmicdrift/kumiko-testing. The test stack and helpers live only in @cosmicdrift/kumiko-testing. Removed from /stack: CreateTestDbOptions, EventCollector, RequestHelper, TestDb, TestRedis, TestStack, TestStackOptions, TestUsers, createEventCollector, createRequestHelper, createTestDb, createTestRedis, createTestUser, drainEventConsumers, pushEntityProjectionTables, resetEventStore, setupTestStack, testTenantId, testUserId, unsafeCreateEntityTable, unsafeEnsureEntityTable, unsafePushTables. Removed from /testing and its subpaths: ClearableTable, E2EGeneratorOptions, E2ETestSpec, EditFillOp, LateBoundHolder, ManualClock, MutableMasterKeyProvider, ParsedSetCookie, REAL_PROVIDERS_ENV, RecordingProvider, bridgeStub, buildMultipartBody, captureClosedConnectionError, clearTables, createLateBoundHolder, createManualClock, createMutableMasterKeyProvider, createRecordingProvider, createTestEnvelopeCipher, createTestMasterKeyProvider, deleteRows, describeFileProviderContract, expectError, expectErrorIncludes, expectSuccess, generateE2ESpec, generateZodFixture, getSetCookieRaw, getSetCookieValue, getSetCookies, isRealProviderRun, patchFileInstanceofForBunTest, requireRealProviders, resetBlindIndexKeyForTests, resetEntityFieldEncryptionCacheForTests, resetEventPiiCatalogForTests, resetPiiSubjectKmsForTests, resetTestTables, rolesOf, seedRow, seedRows, sharedItemEntity, sharedItemTable, sharedUserEntity, sharedUserTable, sharedWidgetEntity, sharedWidgetTable, sleep, updateRows, waitFor, withBootValidatorFixture, withoutAmbientTemporal, zipWithEntries.",
|
|
68
|
+
"migration": "Run bun kumiko-upgrade --apply. It moves the imports to the matching @cosmicdrift/kumiko-testing subpaths. Add @cosmicdrift/kumiko-testing to devDependencies if it is not there yet.",
|
|
69
|
+
"codemod": "scripts/codemod/testing-move.ts"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"version": "0.370.0",
|
|
73
|
+
"type": "improvement",
|
|
74
|
+
"title": "createEventDef builds an EventDef without a registrar",
|
|
75
|
+
"detail": "createEventDef({ feature, name, schema, version?, piiFields? }) from @cosmicdrift/kumiko-framework/engine returns the same EventDef that r.defineEvent returns, including the PII field validation, so shared event definitions can live outside a defineFeature callback."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"version": "0.370.0",
|
|
79
|
+
"type": "breaking",
|
|
80
|
+
"title": "escapeHatch on a spread entity query handler requires SystemAdmin access",
|
|
81
|
+
"detail": "A query handler that spreads defineEntityListHandler or defineEntityDetailHandler and adds escapeHatch afterwards skipped the SystemAdmin-only access check that the factory option enforces. Registration now applies the same check and throws for any other access.",
|
|
82
|
+
"migration": "Pass escapeHatch as an option of defineEntityListHandler or defineEntityDetailHandler with access { roles: access.systemAdmin }, or write a plain r.queryHandler that does not reuse the entity convention handler when a tenant-scoped query needs a raw lookup."
|
|
83
|
+
},
|
|
2
84
|
{
|
|
3
85
|
"version": "0.369.0",
|
|
4
86
|
"type": "fix",
|
|
@@ -52,8 +134,8 @@
|
|
|
52
134
|
"version": "0.368.0",
|
|
53
135
|
"type": "breaking",
|
|
54
136
|
"title": "HandlerContext and AppContext no longer expose _userId and _handlerType",
|
|
55
|
-
"detail": "The dispatcher no longer sets _userId and _handlerType on the context of write handlers, query handlers and hooks. The caller identity is ctx.user.id. requireSecretsContext reads ctx._userId first and falls back to ctx.user.id, so passing a handler context to it keeps the same audit identity. Provider contexts (FileProviderContext, MailTransportContext, InboundMailContext) keep their own _userId. JobContext._userId is unchanged.",
|
|
56
|
-
"migration": "Replace ctx._userId with ctx.user.id in write
|
|
137
|
+
"detail": "The dispatcher no longer sets _userId and _handlerType on the context of write handlers, query handlers and hooks. The caller identity is ctx.user.id in handlers and result.event.createdBy in postSave and postDelete hooks. requireSecretsContext reads ctx._userId first and falls back to ctx.user.id, so passing a handler context to it keeps the same audit identity. Provider contexts (FileProviderContext, MailTransportContext, InboundMailContext) keep their own _userId. JobContext._userId is unchanged.",
|
|
138
|
+
"migration": "Replace ctx._userId with ctx.user.id in write and query handlers. postSave and postDelete hooks get an AppContext without user; read the caller there from result.event.createdBy. Known sites: one file each in money-horse, offlot-app, phronexsis and kumiko-enterprise. _handlerType had no readers."
|
|
57
139
|
},
|
|
58
140
|
{
|
|
59
141
|
"version": "0.368.0",
|
|
@@ -100,3 +100,21 @@ bun node_modules/@cosmicdrift/kumiko-framework/src/scripts/codemod/tenant-db-opt
|
|
|
100
100
|
|
|
101
101
|
Runs automatically via `bun kumiko-upgrade --apply`. Without a mode flag it writes, then formats the
|
|
102
102
|
changed files with Biome. `--check` exits 1 while any rewritable or manual site is left.
|
|
103
|
+
|
|
104
|
+
## import-extensions
|
|
105
|
+
|
|
106
|
+
Relative imports name the TypeScript source file: `./foo.js` becomes `./foo.ts`, `./Comp.jsx`
|
|
107
|
+
becomes `./Comp.tsx`. Covers `import`, `export ... from`, `import type`, `import()` and
|
|
108
|
+
`mock.module`. A specifier is rewritten only when the target exists with the new extension next to
|
|
109
|
+
the importer; otherwise it is reported as `manual` and left alone.
|
|
110
|
+
|
|
111
|
+
The tsconfig that compiles the code needs `allowImportingTsExtensions` and
|
|
112
|
+
`rewriteRelativeImportExtensions` (TypeScript 5.7 or newer) first.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bun node_modules/@cosmicdrift/kumiko-framework/src/scripts/codemod/import-extensions.ts <dir> [--check | --dry-run | --write] [--no-format]
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Runs via `bun kumiko-upgrade --apply`. Without a mode flag it writes. `--check` exits 1 while any
|
|
119
|
+
rewritable or manual site is left. The `import-extensions` guard (`kumiko check guards`) reports
|
|
120
|
+
sites that are still on `.js`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join, relative, resolve } from "node:path";
|
|
3
3
|
import { type ImportDeclaration, type ImportSpecifier, Node, type SourceFile } from "ts-morph";
|
|
4
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
4
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
5
5
|
|
|
6
6
|
export interface CodemodSite {
|
|
7
7
|
readonly file: string;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type SourceFile,
|
|
20
20
|
SyntaxKind,
|
|
21
21
|
} from "ts-morph";
|
|
22
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
22
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
23
23
|
|
|
24
24
|
export interface DbFactorySite {
|
|
25
25
|
readonly file: string;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// import-extensions — relative imports name the TypeScript source file:
|
|
3
|
+
// import { x } from "./foo.js" -> "./foo.ts"
|
|
4
|
+
// import { C } from "./Comp.jsx" -> "./Comp.tsx"
|
|
5
|
+
// Covers import/export ... from, import type, import("..."), import types and mock.module. A site
|
|
6
|
+
// is rewritten only when the target file exists with the new extension next to the importer;
|
|
7
|
+
// otherwise it is reported as manual and left alone.
|
|
8
|
+
//
|
|
9
|
+
// Needs `allowImportingTsExtensions` and `rewriteRelativeImportExtensions` in the tsconfig that
|
|
10
|
+
// compiles the code, otherwise tsc rejects the `.ts` specifiers.
|
|
11
|
+
//
|
|
12
|
+
// Usage:
|
|
13
|
+
// bun scripts/codemod/import-extensions.ts <targetDir...> [--check | --dry-run | --write] [--no-format]
|
|
14
|
+
// Without a mode flag it writes (kumiko-upgrade --apply calls it that way). --check exits 1
|
|
15
|
+
// while any rewritable or manual site is left; --dry-run only reports.
|
|
16
|
+
|
|
17
|
+
import { existsSync } from "node:fs";
|
|
18
|
+
import { dirname, resolve } from "node:path";
|
|
19
|
+
import { Node, Project, SyntaxKind } from "ts-morph";
|
|
20
|
+
import { type CodemodResult, runCodemodCli, type SiteLists } from "./codemod-support.ts";
|
|
21
|
+
|
|
22
|
+
const CHEAP_PREFILTER = /\.jsx?["'`]/;
|
|
23
|
+
|
|
24
|
+
const RELATIVE_JS_SPECIFIER = /^(\.{1,2}\/.*)\.(jsx?)$/;
|
|
25
|
+
|
|
26
|
+
function candidateExtensions(oldExtension: string): readonly string[] {
|
|
27
|
+
return oldExtension === "jsx" ? ["tsx"] : ["ts", "tsx"];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function sourceExtensionFor(
|
|
31
|
+
importerPath: string,
|
|
32
|
+
base: string,
|
|
33
|
+
oldExtension: string,
|
|
34
|
+
): string | undefined {
|
|
35
|
+
return candidateExtensions(oldExtension).find((extension) =>
|
|
36
|
+
existsSync(resolve(dirname(importerPath), `${base}.${extension}`)),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
interface TextEdit {
|
|
41
|
+
readonly start: number;
|
|
42
|
+
readonly end: number;
|
|
43
|
+
readonly text: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function specifierLiterals(project: Project, source: string, filePath: string): Node[] {
|
|
47
|
+
const sourceFile = project.createSourceFile(filePath, source, { overwrite: true });
|
|
48
|
+
const literals: Node[] = [];
|
|
49
|
+
for (const declaration of [
|
|
50
|
+
...sourceFile.getImportDeclarations(),
|
|
51
|
+
...sourceFile.getExportDeclarations(),
|
|
52
|
+
]) {
|
|
53
|
+
const literal = declaration.getModuleSpecifier();
|
|
54
|
+
if (literal !== undefined) literals.push(literal);
|
|
55
|
+
}
|
|
56
|
+
for (const importType of sourceFile.getDescendantsOfKind(SyntaxKind.ImportType)) {
|
|
57
|
+
const argument = importType.getArgument();
|
|
58
|
+
if (Node.isLiteralTypeNode(argument)) literals.push(argument.getLiteral());
|
|
59
|
+
}
|
|
60
|
+
for (const call of sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression)) {
|
|
61
|
+
const callee = call.getExpression();
|
|
62
|
+
const isModuleLoad =
|
|
63
|
+
callee.getKind() === SyntaxKind.ImportKeyword || callee.getText() === "mock.module";
|
|
64
|
+
const first = call.getArguments()[0];
|
|
65
|
+
if (isModuleLoad && first !== undefined && Node.isStringLiteral(first)) literals.push(first);
|
|
66
|
+
}
|
|
67
|
+
return literals;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function transformImportExtensionsSource(
|
|
71
|
+
source: string,
|
|
72
|
+
filePath = "source.ts",
|
|
73
|
+
): CodemodResult {
|
|
74
|
+
const result: SiteLists = { rewrites: [], manual: [] };
|
|
75
|
+
if (!CHEAP_PREFILTER.test(source)) return { output: source, ...result };
|
|
76
|
+
const project = new Project({
|
|
77
|
+
useInMemoryFileSystem: true,
|
|
78
|
+
skipAddingFilesFromTsConfig: true,
|
|
79
|
+
skipFileDependencyResolution: true,
|
|
80
|
+
});
|
|
81
|
+
const edits: TextEdit[] = [];
|
|
82
|
+
for (const literal of specifierLiterals(project, source, filePath)) {
|
|
83
|
+
if (!Node.isStringLiteral(literal) && !Node.isNoSubstitutionTemplateLiteral(literal)) continue;
|
|
84
|
+
const current = literal.getLiteralValue();
|
|
85
|
+
const match = RELATIVE_JS_SPECIFIER.exec(current);
|
|
86
|
+
if (match === null) continue;
|
|
87
|
+
const [, base = "", oldExtension = ""] = match;
|
|
88
|
+
const line = literal.getStartLineNumber();
|
|
89
|
+
const newExtension = sourceExtensionFor(filePath, base, oldExtension);
|
|
90
|
+
if (newExtension === undefined) {
|
|
91
|
+
result.manual.push({
|
|
92
|
+
file: filePath,
|
|
93
|
+
line,
|
|
94
|
+
description: `${current}: no .${candidateExtensions(oldExtension).join("/.")} file next to the importer`,
|
|
95
|
+
});
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const next = `${base}.${newExtension}`;
|
|
99
|
+
result.rewrites.push({ file: filePath, line, description: `${current} -> ${next}` });
|
|
100
|
+
edits.push({ start: literal.getStart() + 1, end: literal.getEnd() - 1, text: next });
|
|
101
|
+
}
|
|
102
|
+
let output = source;
|
|
103
|
+
for (const edit of edits.sort((a, b) => b.start - a.start)) {
|
|
104
|
+
output = output.slice(0, edit.start) + edit.text + output.slice(edit.end);
|
|
105
|
+
}
|
|
106
|
+
return { output, ...result };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (import.meta.main) {
|
|
110
|
+
await runCodemodCli(
|
|
111
|
+
{
|
|
112
|
+
name: "import-extensions",
|
|
113
|
+
transform: transformImportExtensionsSource,
|
|
114
|
+
isSkippedPath: () => false,
|
|
115
|
+
},
|
|
116
|
+
process.argv.slice(2),
|
|
117
|
+
);
|
|
118
|
+
}
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
type PropertyAssignment,
|
|
16
16
|
SyntaxKind,
|
|
17
17
|
} from "ts-morph";
|
|
18
|
-
import { CODEMOD_PLACEHOLDER_REASON_MARKER } from "../../engine/escape-hatch-reason.
|
|
19
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
18
|
+
import { CODEMOD_PLACEHOLDER_REASON_MARKER } from "../../engine/escape-hatch-reason.ts";
|
|
19
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
20
20
|
|
|
21
21
|
export interface Rewrite {
|
|
22
22
|
readonly file: string;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { Node, Project, type SourceFile, SyntaxKind, VariableDeclarationKind } from "ts-morph";
|
|
12
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
12
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
13
13
|
|
|
14
14
|
const DEFAULT_GLOBAL_TABLES: ReadonlySet<string> = new Set([
|
|
15
15
|
"userTable",
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type PropertyAssignment,
|
|
15
15
|
SyntaxKind,
|
|
16
16
|
} from "ts-morph";
|
|
17
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
17
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
18
18
|
|
|
19
19
|
const DEFAULT_TEST_REASON = "test handler callable by any signed-in test user";
|
|
20
20
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
runCodemodCli,
|
|
22
22
|
type SiteLists,
|
|
23
23
|
sourceRelativeModule,
|
|
24
|
-
} from "./codemod-support.
|
|
24
|
+
} from "./codemod-support.ts";
|
|
25
25
|
|
|
26
26
|
const BUNDLED_PACKAGE = "@cosmicdrift/kumiko-bundled-features";
|
|
27
27
|
const BUNDLED_SRC_MARKER = "/packages/bundled-features/src/";
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { dirname, join, relative, resolve } from "node:path";
|
|
12
12
|
import { type CallExpression, Node, Project, type SourceFile, SyntaxKind } from "ts-morph";
|
|
13
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
13
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
14
14
|
|
|
15
15
|
export interface TenantDbOptionsSite {
|
|
16
16
|
readonly file: string;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type SourceFile,
|
|
20
20
|
SyntaxKind,
|
|
21
21
|
} from "ts-morph";
|
|
22
|
-
import { collectSourceFiles } from "./collect-source-files.
|
|
22
|
+
import { collectSourceFiles } from "./collect-source-files.ts";
|
|
23
23
|
import {
|
|
24
24
|
classifyPackageSpecifier,
|
|
25
25
|
classifyRelativeSpecifier,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
moduleSpecifierFor,
|
|
30
30
|
type OldModule,
|
|
31
31
|
targetForName,
|
|
32
|
-
} from "./testing-move-targets.
|
|
32
|
+
} from "./testing-move-targets.ts";
|
|
33
33
|
|
|
34
34
|
export interface TestingMoveSite {
|
|
35
35
|
readonly file: string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/db`. Run `bun kumiko-upgrade --apply`
|
|
3
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
4
|
-
*/
|
|
5
|
-
export type { DeleteManyBatchedOptions, DeleteManyBatchedResult, IncrementCounterOptions, InnerJoinRow, InnerJoinSpec, InsertOnConflictDoNothingOptions, JoinColumnPair, JsonTextMatch, SelectOptions, TableInfo, UpsertOnConflictOptions, WhereObject, WhereOperator, WhereValue, } from "./query.js";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/db`. Run `bun kumiko-upgrade --apply`
|
|
8
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
9
|
-
*/
|
|
10
|
-
export { aggregateWhere, asEntityTableMeta, asRawClient, countWhere, deleteMany, deleteManyBatched, extractTableInfo, fetchOne, incrementCounter, insertMany, insertOnConflictDoNothing, insertOne, instantToTimestamptzParam, isTimestamptzType, requireEntityTableMeta, runInSavepoint, runInSavepointIfSupported, runnerCanBeginTransaction, selectInnerJoin, selectMany, transaction, unsafeReadRetrying, updateMany, upsertByPk, upsertOnConflict, } from "./query.js";
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/db`. Run `bun kumiko-upgrade --apply`
|
|
3
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
4
|
-
*/
|
|
5
|
-
export { aggregateWhere, asEntityTableMeta, asRawClient, countWhere, deleteMany, deleteManyBatched, extractTableInfo, fetchOne, incrementCounter, insertMany, insertOnConflictDoNothing, insertOne, instantToTimestamptzParam, isTimestamptzType, requireEntityTableMeta, runInSavepoint, runInSavepointIfSupported, runnerCanBeginTransaction, selectInnerJoin, selectMany, transaction, unsafeReadRetrying, updateMany, upsertByPk, upsertOnConflict, } from "./query.js";
|
package/dist/stack/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-testing/stack`. Run `bun kumiko-upgrade --apply`
|
|
3
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
4
|
-
*/
|
|
5
|
-
export * from "@cosmicdrift/kumiko-testing/stack";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/seeding`. Run `bun kumiko-upgrade --apply`
|
|
8
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
9
|
-
*/
|
|
10
|
-
export { createTestUser, TestUsers, testTenantId, testUserId } from "../seeding/seed-users.js";
|
package/dist/stack/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// @runtime test
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-testing/stack`. Run `bun kumiko-upgrade --apply`
|
|
4
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
5
|
-
*/
|
|
6
|
-
export * from "@cosmicdrift/kumiko-testing/stack";
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/seeding`. Run `bun kumiko-upgrade --apply`
|
|
9
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
10
|
-
*/
|
|
11
|
-
export { createTestUser, TestUsers, testTenantId, testUserId } from "../seeding/seed-users.js";
|
package/dist/testing/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-testing/helpers`. Run `bun kumiko-upgrade --apply`
|
|
3
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
4
|
-
*/
|
|
5
|
-
export * from "@cosmicdrift/kumiko-testing/helpers";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/engine`. Run `bun kumiko-upgrade --apply`
|
|
8
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
9
|
-
*/
|
|
10
|
-
export { bridgeStub } from "../engine/bridge-stub.js";
|
package/dist/testing/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-testing/helpers`. Run `bun kumiko-upgrade --apply`
|
|
3
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
4
|
-
*/
|
|
5
|
-
export * from "@cosmicdrift/kumiko-testing/helpers";
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated Moved to `@cosmicdrift/kumiko-framework/engine`. Run `bun kumiko-upgrade --apply`
|
|
8
|
-
* to rewrite imports. Removed in the first release after 2026-10-29.
|
|
9
|
-
*/
|
|
10
|
-
export { bridgeStub } from "../engine/bridge-stub.js";
|