@supatype/cli 0.9.1 → 0.10.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/CHANGELOG.md +499 -91
- package/bin/node-version.js +28 -0
- package/bin/supatype.js +8 -4
- package/dist/api-config-cache.d.ts +22 -8
- package/dist/api-config-cache.d.ts.map +1 -1
- package/dist/api-config-cache.js +82 -19
- package/dist/api-config-cache.js.map +1 -1
- package/dist/api-config-stack.d.ts +23 -0
- package/dist/api-config-stack.d.ts.map +1 -0
- package/dist/api-config-stack.js +63 -0
- package/dist/api-config-stack.js.map +1 -0
- package/dist/api-url.d.ts +12 -0
- package/dist/api-url.d.ts.map +1 -0
- package/dist/api-url.js +17 -0
- package/dist/api-url.js.map +1 -0
- package/dist/app/framework.d.ts +18 -2
- package/dist/app/framework.d.ts.map +1 -1
- package/dist/app/framework.js +26 -3
- package/dist/app/framework.js.map +1 -1
- package/dist/app/port-holder.d.ts +33 -0
- package/dist/app/port-holder.d.ts.map +1 -0
- package/dist/app/port-holder.js +66 -0
- package/dist/app/port-holder.js.map +1 -0
- package/dist/app/proxy-dev-app.d.ts +27 -3
- package/dist/app/proxy-dev-app.d.ts.map +1 -1
- package/dist/app/proxy-dev-app.js +100 -46
- package/dist/app/proxy-dev-app.js.map +1 -1
- package/dist/app/vite-dev-args.d.ts +33 -0
- package/dist/app/vite-dev-args.d.ts.map +1 -0
- package/dist/app/vite-dev-args.js +90 -0
- package/dist/app/vite-dev-args.js.map +1 -0
- package/dist/app-config.d.ts +2 -0
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +27 -8
- package/dist/app-config.js.map +1 -1
- package/dist/applied-ast-artifacts.d.ts +7 -2
- package/dist/applied-ast-artifacts.d.ts.map +1 -1
- package/dist/applied-ast-artifacts.js +8 -3
- package/dist/applied-ast-artifacts.js.map +1 -1
- package/dist/archive-extract.d.ts +21 -2
- package/dist/archive-extract.d.ts.map +1 -1
- package/dist/archive-extract.js +30 -11
- package/dist/archive-extract.js.map +1 -1
- package/dist/augmentation-generator.d.ts +9 -0
- package/dist/augmentation-generator.d.ts.map +1 -1
- package/dist/augmentation-generator.js +75 -8
- package/dist/augmentation-generator.js.map +1 -1
- package/dist/auth-answer.d.ts +1 -1
- package/dist/auth-answer.js +1 -1
- package/dist/auth-config-validate.d.ts +3 -0
- package/dist/auth-config-validate.d.ts.map +1 -0
- package/dist/auth-config-validate.js +85 -0
- package/dist/auth-config-validate.js.map +1 -0
- package/dist/auth-groups-env.d.ts +14 -0
- package/dist/auth-groups-env.d.ts.map +1 -0
- package/dist/auth-groups-env.js +53 -0
- package/dist/auth-groups-env.js.map +1 -0
- package/dist/auth-providers.d.ts +6 -14
- package/dist/auth-providers.d.ts.map +1 -1
- package/dist/auth-providers.js +6 -36
- package/dist/auth-providers.js.map +1 -1
- package/dist/auth-settings-push.d.ts +29 -0
- package/dist/auth-settings-push.d.ts.map +1 -0
- package/dist/auth-settings-push.js +176 -0
- package/dist/auth-settings-push.js.map +1 -0
- package/dist/binary-cache.d.ts +4 -1
- package/dist/binary-cache.d.ts.map +1 -1
- package/dist/binary-cache.js +33 -63
- package/dist/binary-cache.js.map +1 -1
- package/dist/binary-download-lock.d.ts.map +1 -1
- package/dist/binary-download-lock.js +2 -10
- package/dist/binary-download-lock.js.map +1 -1
- package/dist/browser-login.d.ts +42 -0
- package/dist/browser-login.d.ts.map +1 -0
- package/dist/browser-login.js +111 -0
- package/dist/browser-login.js.map +1 -0
- package/dist/build-public-env.d.ts +29 -0
- package/dist/build-public-env.d.ts.map +1 -0
- package/dist/build-public-env.js +97 -0
- package/dist/build-public-env.js.map +1 -0
- package/dist/build-refused.d.ts +9 -0
- package/dist/build-refused.d.ts.map +1 -0
- package/dist/build-refused.js +9 -0
- package/dist/build-refused.js.map +1 -0
- package/dist/cache-provider.d.ts +17 -2
- package/dist/cache-provider.d.ts.map +1 -1
- package/dist/cache-provider.js +28 -3
- package/dist/cache-provider.js.map +1 -1
- package/dist/cdn-fetch.d.ts +36 -0
- package/dist/cdn-fetch.d.ts.map +1 -0
- package/dist/cdn-fetch.js +175 -0
- package/dist/cdn-fetch.js.map +1 -0
- package/dist/channel-extractor.d.ts +51 -0
- package/dist/channel-extractor.d.ts.map +1 -0
- package/dist/channel-extractor.js +485 -0
- package/dist/channel-extractor.js.map +1 -0
- package/dist/cli-launcher.d.ts.map +1 -1
- package/dist/cli-launcher.js +3 -2
- package/dist/cli-launcher.js.map +1 -1
- package/dist/cli-release-check.d.ts +34 -0
- package/dist/cli-release-check.d.ts.map +1 -0
- package/dist/cli-release-check.js +79 -0
- package/dist/cli-release-check.js.map +1 -0
- package/dist/cli-standalone.d.ts +16 -0
- package/dist/cli-standalone.d.ts.map +1 -1
- package/dist/cli-standalone.js +92 -47
- package/dist/cli-standalone.js.map +1 -1
- package/dist/cli-version-embedded.d.ts.map +1 -1
- package/dist/cli-version-embedded.js +1 -1
- package/dist/cli-version-embedded.js.map +1 -1
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +12 -1
- package/dist/cli.js.map +1 -1
- package/dist/client-generator.d.ts.map +1 -1
- package/dist/client-generator.js +9 -3
- package/dist/client-generator.js.map +1 -1
- package/dist/cloud-admin.d.ts +55 -0
- package/dist/cloud-admin.d.ts.map +1 -0
- package/dist/cloud-admin.js +99 -0
- package/dist/cloud-admin.js.map +1 -0
- package/dist/cloud-credentials.d.ts +24 -9
- package/dist/cloud-credentials.d.ts.map +1 -1
- package/dist/cloud-credentials.js +57 -47
- package/dist/cloud-credentials.js.map +1 -1
- package/dist/cloud-saml-key.d.ts +9 -0
- package/dist/cloud-saml-key.d.ts.map +1 -0
- package/dist/cloud-saml-key.js +44 -0
- package/dist/cloud-saml-key.js.map +1 -0
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +79 -24
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +22 -2
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/build.d.ts +3 -2
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +10 -13
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/cache.d.ts.map +1 -1
- package/dist/commands/cache.js +16 -5
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/cloud.d.ts +2 -0
- package/dist/commands/cloud.d.ts.map +1 -1
- package/dist/commands/cloud.js +96 -23
- package/dist/commands/cloud.js.map +1 -1
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/db.js +2 -1
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/deploy.d.ts +21 -2
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +97 -97
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +31 -4
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +261 -77
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +16 -4
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/functions.d.ts.map +1 -1
- package/dist/commands/functions.js +163 -54
- package/dist/commands/functions.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/hooks.d.ts.map +1 -1
- package/dist/commands/hooks.js +40 -9
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/init.d.ts +20 -8
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +358 -137
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys.d.ts +6 -0
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.js +17 -10
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/link-helpers.d.ts +4 -1
- package/dist/commands/link-helpers.d.ts.map +1 -1
- package/dist/commands/link-helpers.js +64 -12
- package/dist/commands/link-helpers.js.map +1 -1
- package/dist/commands/login.d.ts +3 -2
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +99 -57
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/migrate.d.ts +17 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +22 -4
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/push.d.ts +35 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +117 -21
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/seed.d.ts +31 -45
- package/dist/commands/seed.d.ts.map +1 -1
- package/dist/commands/seed.js +93 -215
- package/dist/commands/seed.js.map +1 -1
- package/dist/commands/self-host.d.ts +3 -3
- package/dist/commands/self-host.d.ts.map +1 -1
- package/dist/commands/self-host.js +88 -270
- package/dist/commands/self-host.js.map +1 -1
- package/dist/commands/site.d.ts +42 -0
- package/dist/commands/site.d.ts.map +1 -0
- package/dist/commands/site.js +100 -0
- package/dist/commands/site.js.map +1 -0
- package/dist/commands/sso.d.ts +13 -3
- package/dist/commands/sso.d.ts.map +1 -1
- package/dist/commands/sso.js +58 -16
- package/dist/commands/sso.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +161 -68
- package/dist/commands/update.js.map +1 -1
- package/dist/compose-auth-settings.d.ts +12 -0
- package/dist/compose-auth-settings.d.ts.map +1 -0
- package/dist/compose-auth-settings.js +39 -0
- package/dist/compose-auth-settings.js.map +1 -0
- package/dist/compose-db-roles.d.ts.map +1 -1
- package/dist/compose-db-roles.js +6 -0
- package/dist/compose-db-roles.js.map +1 -1
- package/dist/compose-kong.d.ts +5 -1
- package/dist/compose-kong.d.ts.map +1 -1
- package/dist/compose-kong.js +8 -4
- package/dist/compose-kong.js.map +1 -1
- package/dist/compose-rename.d.ts.map +1 -1
- package/dist/compose-rename.js +5 -0
- package/dist/compose-rename.js.map +1 -1
- package/dist/compose-render-mode.d.ts +8 -3
- package/dist/compose-render-mode.d.ts.map +1 -1
- package/dist/compose-render-mode.js +22 -13
- package/dist/compose-render-mode.js.map +1 -1
- package/dist/compose-services.d.ts.map +1 -1
- package/dist/compose-services.js +3 -2
- package/dist/compose-services.js.map +1 -1
- package/dist/config-mailer-env.d.ts +6 -2
- package/dist/config-mailer-env.d.ts.map +1 -1
- package/dist/config-mailer-env.js +11 -13
- package/dist/config-mailer-env.js.map +1 -1
- package/dist/config-version-pin.d.ts +42 -0
- package/dist/config-version-pin.d.ts.map +1 -0
- package/dist/config-version-pin.js +64 -0
- package/dist/config-version-pin.js.map +1 -0
- package/dist/config.d.ts +5 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/cors-origins-push.d.ts +16 -0
- package/dist/cors-origins-push.d.ts.map +1 -0
- package/dist/cors-origins-push.js +37 -0
- package/dist/cors-origins-push.js.map +1 -0
- package/dist/database-url-owner.d.ts.map +1 -1
- package/dist/database-url-owner.js +2 -1
- package/dist/database-url-owner.js.map +1 -1
- package/dist/db-port.d.ts +3 -1
- package/dist/db-port.d.ts.map +1 -1
- package/dist/db-port.js +1 -1
- package/dist/db-port.js.map +1 -1
- package/dist/destructive-consent.d.ts.map +1 -1
- package/dist/destructive-consent.js +23 -1
- package/dist/destructive-consent.js.map +1 -1
- package/dist/dev-compose.d.ts +9 -4
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +112 -71
- package/dist/dev-compose.js.map +1 -1
- package/dist/dev-functions-watch.d.ts +25 -4
- package/dist/dev-functions-watch.d.ts.map +1 -1
- package/dist/dev-functions-watch.js +78 -13
- package/dist/dev-functions-watch.js.map +1 -1
- package/dist/dev-initial-push.d.ts.map +1 -1
- package/dist/dev-initial-push.js +6 -0
- package/dist/dev-initial-push.js.map +1 -1
- package/dist/dev-ports.d.ts +7 -2
- package/dist/dev-ports.d.ts.map +1 -1
- package/dist/dev-ports.js +44 -22
- package/dist/dev-ports.js.map +1 -1
- package/dist/dev-ready-panel.d.ts +26 -3
- package/dist/dev-ready-panel.d.ts.map +1 -1
- package/dist/dev-ready-panel.js +37 -5
- package/dist/dev-ready-panel.js.map +1 -1
- package/dist/dev-schema-watch.d.ts +6 -0
- package/dist/dev-schema-watch.d.ts.map +1 -1
- package/dist/dev-schema-watch.js +9 -0
- package/dist/dev-schema-watch.js.map +1 -1
- package/dist/dev-self-start.d.ts +16 -0
- package/dist/dev-self-start.d.ts.map +1 -0
- package/dist/dev-self-start.js +31 -0
- package/dist/dev-self-start.js.map +1 -0
- package/dist/dev-session-lock.d.ts +71 -2
- package/dist/dev-session-lock.d.ts.map +1 -1
- package/dist/dev-session-lock.js +105 -5
- package/dist/dev-session-lock.js.map +1 -1
- package/dist/dev-session.d.ts +6 -1
- package/dist/dev-session.d.ts.map +1 -1
- package/dist/dev-session.js +9 -3
- package/dist/dev-session.js.map +1 -1
- package/dist/dev-shutdown.d.ts +11 -2
- package/dist/dev-shutdown.d.ts.map +1 -1
- package/dist/dev-shutdown.js +23 -9
- package/dist/dev-shutdown.js.map +1 -1
- package/dist/diff-access.d.ts.map +1 -1
- package/dist/diff-access.js +17 -1
- package/dist/diff-access.js.map +1 -1
- package/dist/diff-channels.d.ts +14 -0
- package/dist/diff-channels.d.ts.map +1 -0
- package/dist/diff-channels.js +38 -0
- package/dist/diff-channels.js.map +1 -0
- package/dist/docker-exec.d.ts +25 -4
- package/dist/docker-exec.d.ts.map +1 -1
- package/dist/docker-exec.js +88 -8
- package/dist/docker-exec.js.map +1 -1
- package/dist/docker-postgres.d.ts +11 -0
- package/dist/docker-postgres.d.ts.map +1 -1
- package/dist/docker-postgres.js +9 -1
- package/dist/docker-postgres.js.map +1 -1
- package/dist/docker-runtime.d.ts +31 -7
- package/dist/docker-runtime.d.ts.map +1 -1
- package/dist/docker-runtime.js +104 -36
- package/dist/docker-runtime.js.map +1 -1
- package/dist/engine-answers.d.ts.map +1 -1
- package/dist/engine-answers.js +2 -1
- package/dist/engine-answers.js.map +1 -1
- package/dist/engine-client.d.ts +28 -0
- package/dist/engine-client.d.ts.map +1 -1
- package/dist/engine-client.js +4 -4
- package/dist/engine-client.js.map +1 -1
- package/dist/engine-columns.d.ts +26 -0
- package/dist/engine-columns.d.ts.map +1 -0
- package/dist/engine-columns.js +67 -0
- package/dist/engine-columns.js.map +1 -0
- package/dist/engine-floor.d.ts +35 -0
- package/dist/engine-floor.d.ts.map +1 -1
- package/dist/engine-floor.js +67 -0
- package/dist/engine-floor.js.map +1 -1
- package/dist/engine-ownership-gate.d.ts +11 -1
- package/dist/engine-ownership-gate.d.ts.map +1 -1
- package/dist/engine-ownership-gate.js +32 -0
- package/dist/engine-ownership-gate.js.map +1 -1
- package/dist/engine-push-output.d.ts +12 -4
- package/dist/engine-push-output.d.ts.map +1 -1
- package/dist/engine-push-output.js.map +1 -1
- package/dist/env-file.d.ts +36 -3
- package/dist/env-file.d.ts.map +1 -1
- package/dist/env-file.js +82 -11
- package/dist/env-file.js.map +1 -1
- package/dist/env-lines.d.ts +5 -2
- package/dist/env-lines.d.ts.map +1 -1
- package/dist/env-lines.js +18 -3
- package/dist/env-lines.js.map +1 -1
- package/dist/env-managed-record.d.ts +20 -0
- package/dist/env-managed-record.d.ts.map +1 -0
- package/dist/env-managed-record.js +56 -0
- package/dist/env-managed-record.js.map +1 -0
- package/dist/error-message.d.ts.map +1 -1
- package/dist/error-message.js +7 -3
- package/dist/error-message.js.map +1 -1
- package/dist/frontend-env.d.ts +3 -2
- package/dist/frontend-env.d.ts.map +1 -1
- package/dist/frontend-env.js +4 -5
- package/dist/frontend-env.js.map +1 -1
- package/dist/frontend-values-linked.d.ts +3 -0
- package/dist/frontend-values-linked.d.ts.map +1 -1
- package/dist/frontend-values-linked.js +3 -2
- package/dist/frontend-values-linked.js.map +1 -1
- package/dist/frontend-values.d.ts +2 -1
- package/dist/frontend-values.d.ts.map +1 -1
- package/dist/frontend-values.js +2 -1
- package/dist/frontend-values.js.map +1 -1
- package/dist/functions-context-refresh.d.ts.map +1 -1
- package/dist/functions-context-refresh.js +5 -2
- package/dist/functions-context-refresh.js.map +1 -1
- package/dist/functions-deno-types.d.ts +6 -0
- package/dist/functions-deno-types.d.ts.map +1 -1
- package/dist/functions-deno-types.js +43 -35
- package/dist/functions-deno-types.js.map +1 -1
- package/dist/functions-env-local.d.ts +7 -2
- package/dist/functions-env-local.d.ts.map +1 -1
- package/dist/functions-env-local.js +8 -3
- package/dist/functions-env-local.js.map +1 -1
- package/dist/functions-worker-files.d.ts.map +1 -1
- package/dist/functions-worker-files.js +2 -13
- package/dist/functions-worker-files.js.map +1 -1
- package/dist/generated/functions-worker-source.d.ts.map +1 -1
- package/dist/generated/functions-worker-source.js +6 -3
- package/dist/generated/functions-worker-source.js.map +1 -1
- package/dist/generated/release-images.d.ts +6 -6
- package/dist/generated/release-images.js +3 -3
- package/dist/generated-files-engine.d.ts +9 -0
- package/dist/generated-files-engine.d.ts.map +1 -1
- package/dist/generated-files-engine.js +23 -0
- package/dist/generated-files-engine.js.map +1 -1
- package/dist/gitignore.d.ts +29 -2
- package/dist/gitignore.d.ts.map +1 -1
- package/dist/gitignore.js +86 -21
- package/dist/gitignore.js.map +1 -1
- package/dist/hooks-generator.d.ts.map +1 -1
- package/dist/hooks-generator.js +32 -10
- package/dist/hooks-generator.js.map +1 -1
- package/dist/hooks-worker-reload.d.ts +18 -0
- package/dist/hooks-worker-reload.d.ts.map +1 -0
- package/dist/hooks-worker-reload.js +19 -0
- package/dist/hooks-worker-reload.js.map +1 -0
- package/dist/host-database.d.ts +6 -2
- package/dist/host-database.d.ts.map +1 -1
- package/dist/host-database.js +10 -2
- package/dist/host-database.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init-dependency-versions.d.ts +2 -3
- package/dist/init-dependency-versions.d.ts.map +1 -1
- package/dist/init-dependency-versions.js +12 -9
- package/dist/init-dependency-versions.js.map +1 -1
- package/dist/init-example.d.ts.map +1 -1
- package/dist/init-example.js +13 -1
- package/dist/init-example.js.map +1 -1
- package/dist/init-expo-runtime-env.d.ts +25 -0
- package/dist/init-expo-runtime-env.d.ts.map +1 -0
- package/dist/init-expo-runtime-env.js +112 -0
- package/dist/init-expo-runtime-env.js.map +1 -0
- package/dist/init-next-runtime-env.d.ts +14 -1
- package/dist/init-next-runtime-env.d.ts.map +1 -1
- package/dist/init-next-runtime-env.js +116 -35
- package/dist/init-next-runtime-env.js.map +1 -1
- package/dist/init-package-json.d.ts +12 -3
- package/dist/init-package-json.d.ts.map +1 -1
- package/dist/init-package-json.js +35 -15
- package/dist/init-package-json.js.map +1 -1
- package/dist/init-port-registry.d.ts +19 -0
- package/dist/init-port-registry.d.ts.map +1 -0
- package/dist/init-port-registry.js +57 -0
- package/dist/init-port-registry.js.map +1 -0
- package/dist/init-project-detect.d.ts +20 -0
- package/dist/init-project-detect.d.ts.map +1 -1
- package/dist/init-project-detect.js +41 -8
- package/dist/init-project-detect.js.map +1 -1
- package/dist/init-setup-steps.d.ts +32 -4
- package/dist/init-setup-steps.d.ts.map +1 -1
- package/dist/init-setup-steps.js +114 -18
- package/dist/init-setup-steps.js.map +1 -1
- package/dist/init-vite-node.d.ts +21 -0
- package/dist/init-vite-node.d.ts.map +1 -0
- package/dist/init-vite-node.js +75 -0
- package/dist/init-vite-node.js.map +1 -0
- package/dist/jsx-first-child.d.ts +18 -0
- package/dist/jsx-first-child.d.ts.map +1 -0
- package/dist/jsx-first-child.js +53 -0
- package/dist/jsx-first-child.js.map +1 -0
- package/dist/keyspace-password-file.d.ts +46 -0
- package/dist/keyspace-password-file.d.ts.map +1 -0
- package/dist/keyspace-password-file.js +128 -0
- package/dist/keyspace-password-file.js.map +1 -0
- package/dist/keyspace-port.d.ts +14 -0
- package/dist/keyspace-port.d.ts.map +1 -0
- package/dist/keyspace-port.js +35 -0
- package/dist/keyspace-port.js.map +1 -0
- package/dist/kong-config.d.ts +6 -0
- package/dist/kong-config.d.ts.map +1 -1
- package/dist/kong-config.js +119 -20
- package/dist/kong-config.js.map +1 -1
- package/dist/link.d.ts +30 -0
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +70 -16
- package/dist/link.js.map +1 -1
- package/dist/local-gateway.d.ts +11 -3
- package/dist/local-gateway.d.ts.map +1 -1
- package/dist/local-gateway.js +16 -7
- package/dist/local-gateway.js.map +1 -1
- package/dist/local-secrets.d.ts +22 -0
- package/dist/local-secrets.d.ts.map +1 -1
- package/dist/local-secrets.js +29 -0
- package/dist/local-secrets.js.map +1 -1
- package/dist/local-stack-guard.d.ts +8 -0
- package/dist/local-stack-guard.d.ts.map +1 -1
- package/dist/local-stack-guard.js +44 -3
- package/dist/local-stack-guard.js.map +1 -1
- package/dist/local-stack.d.ts +2 -0
- package/dist/local-stack.d.ts.map +1 -1
- package/dist/local-stack.js +14 -8
- package/dist/local-stack.js.map +1 -1
- package/dist/local-storage.d.ts +3 -5
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/local-storage.js +10 -10
- package/dist/local-storage.js.map +1 -1
- package/dist/mailer-autoconfirm.d.ts +29 -24
- package/dist/mailer-autoconfirm.d.ts.map +1 -1
- package/dist/mailer-autoconfirm.js +47 -43
- package/dist/mailer-autoconfirm.js.map +1 -1
- package/dist/mailer-env.d.ts +8 -1
- package/dist/mailer-env.d.ts.map +1 -1
- package/dist/mailer-env.js +52 -8
- package/dist/mailer-env.js.map +1 -1
- package/dist/model-hooks.d.ts +6 -4
- package/dist/model-hooks.d.ts.map +1 -1
- package/dist/model-hooks.js +14 -8
- package/dist/model-hooks.js.map +1 -1
- package/dist/model-versioning.d.ts +6 -0
- package/dist/model-versioning.d.ts.map +1 -1
- package/dist/model-versioning.js +12 -0
- package/dist/model-versioning.js.map +1 -1
- package/dist/native-dev-env.d.ts +38 -3
- package/dist/native-dev-env.d.ts.map +1 -1
- package/dist/native-dev-env.js +98 -7
- package/dist/native-dev-env.js.map +1 -1
- package/dist/native-keyspace.d.ts +31 -6
- package/dist/native-keyspace.d.ts.map +1 -1
- package/dist/native-keyspace.js +70 -20
- package/dist/native-keyspace.js.map +1 -1
- package/dist/native-leftover-postgres.d.ts +23 -0
- package/dist/native-leftover-postgres.d.ts.map +1 -0
- package/dist/native-leftover-postgres.js +55 -0
- package/dist/native-leftover-postgres.js.map +1 -0
- package/dist/native-leftover-services.d.ts +17 -0
- package/dist/native-leftover-services.d.ts.map +1 -0
- package/dist/native-leftover-services.js +93 -0
- package/dist/native-leftover-services.js.map +1 -0
- package/dist/native-pg-auth.d.ts.map +1 -1
- package/dist/native-pg-auth.js +2 -1
- package/dist/native-pg-auth.js.map +1 -1
- package/dist/native-port-lock.d.ts +37 -0
- package/dist/native-port-lock.d.ts.map +1 -0
- package/dist/native-port-lock.js +78 -0
- package/dist/native-port-lock.js.map +1 -0
- package/dist/native-realtime.d.ts +6 -3
- package/dist/native-realtime.d.ts.map +1 -1
- package/dist/native-realtime.js +65 -24
- package/dist/native-realtime.js.map +1 -1
- package/dist/native-roles-sql.d.ts.map +1 -1
- package/dist/native-roles-sql.js +2 -1
- package/dist/native-roles-sql.js.map +1 -1
- package/dist/native-stale-session.d.ts +17 -0
- package/dist/native-stale-session.d.ts.map +1 -0
- package/dist/native-stale-session.js +42 -0
- package/dist/native-stale-session.js.map +1 -0
- package/dist/native-storage-import.d.ts.map +1 -1
- package/dist/native-storage-import.js +6 -5
- package/dist/native-storage-import.js.map +1 -1
- package/dist/native-storage.d.ts +42 -7
- package/dist/native-storage.d.ts.map +1 -1
- package/dist/native-storage.js +196 -50
- package/dist/native-storage.js.map +1 -1
- package/dist/native-worker.d.ts +15 -0
- package/dist/native-worker.d.ts.map +1 -1
- package/dist/native-worker.js +26 -0
- package/dist/native-worker.js.map +1 -1
- package/dist/open-browser.d.ts +7 -0
- package/dist/open-browser.d.ts.map +1 -0
- package/dist/open-browser.js +26 -0
- package/dist/open-browser.js.map +1 -0
- package/dist/parent-watch.d.ts.map +1 -1
- package/dist/parent-watch.js +4 -8
- package/dist/parent-watch.js.map +1 -1
- package/dist/personal-access-token.d.ts +7 -0
- package/dist/personal-access-token.d.ts.map +1 -0
- package/dist/personal-access-token.js +11 -0
- package/dist/personal-access-token.js.map +1 -0
- package/dist/plan-sql.d.ts +30 -0
- package/dist/plan-sql.d.ts.map +1 -0
- package/dist/plan-sql.js +65 -0
- package/dist/plan-sql.js.map +1 -0
- package/dist/platform-settings-push.d.ts +15 -0
- package/dist/platform-settings-push.d.ts.map +1 -0
- package/dist/platform-settings-push.js +100 -0
- package/dist/platform-settings-push.js.map +1 -0
- package/dist/platform-settings.d.ts +81 -0
- package/dist/platform-settings.d.ts.map +1 -0
- package/dist/platform-settings.js +164 -0
- package/dist/platform-settings.js.map +1 -0
- package/dist/postgres-ctl.d.ts +45 -5
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +59 -21
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/postgres-image.d.ts +27 -2
- package/dist/postgres-image.d.ts.map +1 -1
- package/dist/postgres-image.js +58 -13
- package/dist/postgres-image.js.map +1 -1
- package/dist/postgrest-release.d.ts +1 -1
- package/dist/postgrest-release.d.ts.map +1 -1
- package/dist/postgrest-release.js +3 -1
- package/dist/postgrest-release.js.map +1 -1
- package/dist/process-info.d.ts +14 -0
- package/dist/process-info.d.ts.map +1 -0
- package/dist/process-info.js +41 -0
- package/dist/process-info.js.map +1 -0
- package/dist/process-manager.d.ts +78 -4
- package/dist/process-manager.d.ts.map +1 -1
- package/dist/process-manager.js +128 -46
- package/dist/process-manager.js.map +1 -1
- package/dist/process-tree.d.ts +48 -0
- package/dist/process-tree.d.ts.map +1 -0
- package/dist/process-tree.js +141 -0
- package/dist/process-tree.js.map +1 -0
- package/dist/project-config.d.ts +121 -10
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +62 -1
- package/dist/project-config.js.map +1 -1
- package/dist/release-images.d.ts +21 -0
- package/dist/release-images.d.ts.map +1 -1
- package/dist/release-images.js +24 -0
- package/dist/release-images.js.map +1 -1
- package/dist/required-host-components.d.ts.map +1 -1
- package/dist/required-host-components.js +3 -5
- package/dist/required-host-components.js.map +1 -1
- package/dist/resolve-target.d.ts +42 -2
- package/dist/resolve-target.d.ts.map +1 -1
- package/dist/resolve-target.js +115 -21
- package/dist/resolve-target.js.map +1 -1
- package/dist/rest-cache-admin.d.ts +13 -0
- package/dist/rest-cache-admin.d.ts.map +1 -1
- package/dist/rest-cache-admin.js +36 -1
- package/dist/rest-cache-admin.js.map +1 -1
- package/dist/rest-ready.d.ts +6 -0
- package/dist/rest-ready.d.ts.map +1 -1
- package/dist/rest-ready.js +18 -2
- package/dist/rest-ready.js.map +1 -1
- package/dist/route-manifest.d.ts +24 -0
- package/dist/route-manifest.d.ts.map +1 -1
- package/dist/route-manifest.js +60 -2
- package/dist/route-manifest.js.map +1 -1
- package/dist/run-captured.d.ts +3 -1
- package/dist/run-captured.d.ts.map +1 -1
- package/dist/run-captured.js.map +1 -1
- package/dist/run-until-stopped.d.ts +3 -0
- package/dist/run-until-stopped.d.ts.map +1 -1
- package/dist/run-until-stopped.js +25 -11
- package/dist/run-until-stopped.js.map +1 -1
- package/dist/runtime-routes.d.ts +5 -0
- package/dist/runtime-routes.d.ts.map +1 -1
- package/dist/runtime-routes.js +10 -5
- package/dist/runtime-routes.js.map +1 -1
- package/dist/schema-ast-v2.d.ts +38 -0
- package/dist/schema-ast-v2.d.ts.map +1 -1
- package/dist/schema-ast-v2.js +2 -0
- package/dist/schema-ast-v2.js.map +1 -1
- package/dist/schema-reset.d.ts.map +1 -1
- package/dist/schema-reset.js +2 -0
- package/dist/schema-reset.js.map +1 -1
- package/dist/secret-sql.d.ts +13 -0
- package/dist/secret-sql.d.ts.map +1 -0
- package/dist/secret-sql.js +13 -0
- package/dist/secret-sql.js.map +1 -0
- package/dist/seed-default-export.d.ts +12 -0
- package/dist/seed-default-export.d.ts.map +1 -0
- package/dist/seed-default-export.js +44 -0
- package/dist/seed-default-export.js.map +1 -0
- package/dist/seed-ir.d.ts +8 -1
- package/dist/seed-ir.d.ts.map +1 -1
- package/dist/seed-ir.js +92 -6
- package/dist/seed-ir.js.map +1 -1
- package/dist/seed-prepare.d.ts +60 -0
- package/dist/seed-prepare.d.ts.map +1 -0
- package/dist/seed-prepare.js +115 -0
- package/dist/seed-prepare.js.map +1 -0
- package/dist/seed-remote.d.ts +22 -0
- package/dist/seed-remote.d.ts.map +1 -0
- package/dist/seed-remote.js +203 -0
- package/dist/seed-remote.js.map +1 -0
- package/dist/seed-report.d.ts +65 -0
- package/dist/seed-report.d.ts.map +1 -0
- package/dist/seed-report.js +98 -0
- package/dist/seed-report.js.map +1 -0
- package/dist/seed.d.ts +15 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/self-host-compose.d.ts +21 -1
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +349 -78
- package/dist/self-host-compose.js.map +1 -1
- package/dist/site-build-env.d.ts +31 -0
- package/dist/site-build-env.d.ts.map +1 -0
- package/dist/site-build-env.js +29 -0
- package/dist/site-build-env.js.map +1 -0
- package/dist/site-deploy.d.ts +52 -0
- package/dist/site-deploy.d.ts.map +1 -0
- package/dist/site-deploy.js +230 -0
- package/dist/site-deploy.js.map +1 -0
- package/dist/site-public-env.d.ts +67 -0
- package/dist/site-public-env.d.ts.map +1 -0
- package/dist/site-public-env.js +124 -0
- package/dist/site-public-env.js.map +1 -0
- package/dist/sso-admin.d.ts +15 -0
- package/dist/sso-admin.d.ts.map +1 -1
- package/dist/sso-admin.js +32 -9
- package/dist/sso-admin.js.map +1 -1
- package/dist/stack-exit-watch.d.ts +15 -0
- package/dist/stack-exit-watch.d.ts.map +1 -1
- package/dist/stack-exit-watch.js +41 -13
- package/dist/stack-exit-watch.js.map +1 -1
- package/dist/stack-folder.d.ts +28 -0
- package/dist/stack-folder.d.ts.map +1 -0
- package/dist/stack-folder.js +123 -0
- package/dist/stack-folder.js.map +1 -0
- package/dist/stack-running.d.ts +13 -0
- package/dist/stack-running.d.ts.map +1 -0
- package/dist/stack-running.js +44 -0
- package/dist/stack-running.js.map +1 -0
- package/dist/stack-setting-warnings.d.ts +8 -1
- package/dist/stack-setting-warnings.d.ts.map +1 -1
- package/dist/stack-setting-warnings.js +21 -1
- package/dist/stack-setting-warnings.js.map +1 -1
- package/dist/storage-provision.d.ts +12 -2
- package/dist/storage-provision.d.ts.map +1 -1
- package/dist/storage-provision.js +36 -11
- package/dist/storage-provision.js.map +1 -1
- package/dist/studio-admin-roles.d.ts +4 -4
- package/dist/studio-admin-roles.d.ts.map +1 -1
- package/dist/studio-admin-roles.js +6 -4
- package/dist/studio-admin-roles.js.map +1 -1
- package/dist/target-client.d.ts +13 -1
- package/dist/target-client.d.ts.map +1 -1
- package/dist/target-client.js +83 -17
- package/dist/target-client.js.map +1 -1
- package/dist/target-request.d.ts +5 -0
- package/dist/target-request.d.ts.map +1 -1
- package/dist/target-request.js +11 -2
- package/dist/target-request.js.map +1 -1
- package/dist/type-extractor.d.ts.map +1 -1
- package/dist/type-extractor.js +102 -10
- package/dist/type-extractor.js.map +1 -1
- package/dist/ui/clack-api.d.ts +2 -1
- package/dist/ui/clack-api.d.ts.map +1 -1
- package/dist/ui/clack-api.js +4 -4
- package/dist/ui/clack-api.js.map +1 -1
- package/dist/ui/clack.d.ts.map +1 -1
- package/dist/ui/clack.js +5 -2
- package/dist/ui/clack.js.map +1 -1
- package/dist/ui/dev/DevReadyPanelView.js +1 -1
- package/dist/ui/dev/DevReadyPanelView.js.map +1 -1
- package/dist/valkey-sidecar.d.ts +34 -13
- package/dist/valkey-sidecar.d.ts.map +1 -1
- package/dist/valkey-sidecar.js +65 -39
- package/dist/valkey-sidecar.js.map +1 -1
- package/dist/windows-processes.d.ts +7 -0
- package/dist/windows-processes.d.ts.map +1 -0
- package/dist/windows-processes.js +31 -0
- package/dist/windows-processes.js.map +1 -0
- package/dist/write-if-changed.d.ts +12 -0
- package/dist/write-if-changed.d.ts.map +1 -0
- package/dist/write-if-changed.js +32 -0
- package/dist/write-if-changed.js.map +1 -0
- package/package.json +7 -5
- package/releases/deno/VERSION +1 -1
- package/dist/commands/deploy-types.d.ts +0 -14
- package/dist/commands/deploy-types.d.ts.map +0 -1
- package/dist/commands/deploy-types.js +0 -38
- package/dist/commands/deploy-types.js.map +0 -1
- package/dist/systemd.d.ts +0 -26
- package/dist/systemd.d.ts.map +0 -1
- package/dist/systemd.js +0 -117
- package/dist/systemd.js.map +0 -1
package/dist/dev-compose.js
CHANGED
|
@@ -5,18 +5,18 @@ import { setTimeout as sleep } from "node:timers/promises";
|
|
|
5
5
|
import { projectOutputPaths, writeAstDerivedOutputs, writeSeedBuilder } from "./type-generation.js";
|
|
6
6
|
import { errorMessage } from "./error-message.js";
|
|
7
7
|
import { printRoleAccess } from "./diff-access.js";
|
|
8
|
-
import {
|
|
8
|
+
import { printChannelChanges } from "./diff-channels.js";
|
|
9
|
+
import { postApplyFailed } from "./post-apply.js";
|
|
9
10
|
import { FRONTEND_URL_KEYS, frontendEnv, writeFrontendEnv } from "./frontend-env.js";
|
|
10
11
|
import { withPublishing } from "./model-versioning.js";
|
|
11
12
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
12
|
-
import { homedir } from "node:os";
|
|
13
13
|
import { dirname, join } from "node:path";
|
|
14
14
|
import { askDocker, askDockerSync, DOCKER_EXEC_TIMEOUT_MS, DOCKER_QUERY_TIMEOUT_MS } from "./docker-exec.js";
|
|
15
|
-
import {
|
|
15
|
+
import { appPanelLinks, startProxyDevApp } from "./app/proxy-dev-app.js";
|
|
16
16
|
import { loadSchemaAst, projectNameInFile } from "./config.js";
|
|
17
17
|
import { withComposeSchemaPushLock } from "./schema-push-lock.js";
|
|
18
18
|
import { recordDatabaseTier, sameApiSurface } from "./recorded-field-masking-tier.js";
|
|
19
|
-
import { connectionString, pgSchema, projectRootFromConfig, resolveRuntimeProvider, schemaPathFromProject, selfHostTlsEnabled, usesExternalDatabase, } from "./project-config.js";
|
|
19
|
+
import { connectionString, nativeStateRoot, pgSchema, projectRootFromConfig, resolveRuntimeProvider, schemaPathFromProject, selfHostTlsEnabled, usesExternalDatabase, } from "./project-config.js";
|
|
20
20
|
import { rowCacheChangeNote } from "./model-cache.js";
|
|
21
21
|
import { writeAppliedAstArtifacts } from "./applied-ast-artifacts.js";
|
|
22
22
|
import { anonKeyEnvUpdates } from "./commands/keys.js";
|
|
@@ -26,7 +26,8 @@ import { astRelatesToAuthUsers } from "./byo-preflight.js";
|
|
|
26
26
|
import { ensureDevDbPort, ensureKongPort } from "./dev-ports.js";
|
|
27
27
|
import { applyForThisRun, splitShellPortUpdates } from "./shell-ports.js";
|
|
28
28
|
import { handleComposeProjectRename } from "./compose-rename.js";
|
|
29
|
-
import { devSessionLockFor, recoverStaleDevSession, writeDevSessionLock } from "./dev-session-lock.js";
|
|
29
|
+
import { devSessionLockFor, enterLocalStack, recoverStaleDevSession, writeDevSessionLock } from "./dev-session-lock.js";
|
|
30
|
+
import { recordStackFolder, refuseOtherFoldersStack } from "./stack-folder.js";
|
|
30
31
|
import { endDevSession, showDevStep, startDevSession, withSavePushOutput } from "./dev-session.js";
|
|
31
32
|
import { ensureDevApiConfig } from "./ensure-dev-api-config.js";
|
|
32
33
|
import { cacheSeedingNotes } from "./api-config-cache.js";
|
|
@@ -40,16 +41,16 @@ import { ENGINE_FALLBACK, generatedFilesEngine } from "./generated-files-engine.
|
|
|
40
41
|
import { DEV_DESTRUCTIVE_POLICY, consentDepsFromDiff, pushConsentingToDestructive } from "./destructive-consent.js";
|
|
41
42
|
import { auditFlags, auditWhenSupported } from "./push-audit.js";
|
|
42
43
|
import { consentRefusal, reportDevPushFailure } from "./push-refusal.js";
|
|
43
|
-
import { COMPOSE_PINNED_IMAGE_ENV_KEYS, composeDockerImageEnv, composeProjectName, exitComposeFailed, noteUnpinnedImages, publishesDbToHost, runDockerCompose, runDockerComposeQuietly, settleComposeRuns, schemaEngineImageForPush, writeSelfHostCompose, composeFieldMaskingTier, selfHostComposePaths, } from "./self-host-compose.js";
|
|
44
|
+
import { COMPOSE_PINNED_IMAGE_ENV_KEYS, composeDockerImageEnv, composeProjectName, exitComposeFailed, noteUnpinnedImages, publishesDbToHost, runDockerCompose, runDockerComposeQuietly, settleComposeRuns, schemaEngineImageForPush, writeSelfHostCompose, composeFieldMaskingTier, selfHostComposePaths, COMPOSE_UP_DETACHED, } from "./self-host-compose.js";
|
|
44
45
|
import { composeServiceIsRunning } from "./compose-kong.js";
|
|
45
46
|
import { requireStackDatabase } from "./local-stack-guard.js";
|
|
46
|
-
import { hasEngineOverride } from "./binary-cache.js";
|
|
47
|
+
import { hasEngineOverride, pinnedVersion } from "./binary-cache.js";
|
|
47
48
|
import { STUDIO_DEV_PORT, startStudioViteDevServer } from "./studio-dev-server.js";
|
|
48
49
|
import { ensureLocalServerDockerImage, usesLocalServerImage, LOCAL_SERVER_DOCKER_IMAGE, } from "./compose-local-server-image.js";
|
|
49
50
|
import { ensureEngine, enginePush, engineRequest } from "./engine-client.js";
|
|
50
51
|
import { isAdoptOutcome, isAnyAnswer, isDiffResult, isEnginePushResult, isGenerateAnswer, } from "./engine-answers.js";
|
|
51
52
|
import { writeSchemaSourcePushArtifacts } from "./schema-sources.js";
|
|
52
|
-
import { readEnvFile, readEnvValue, upsertEnvFile } from "./env-file.js";
|
|
53
|
+
import { readEnvFile, readEnvValue, upsertEnvFile, warnHandEditedValues } from "./env-file.js";
|
|
53
54
|
import { warnMissingStackSettings } from "./stack-setting-warnings.js";
|
|
54
55
|
import { devDatabaseIdentity, devDatabaseUrl, seedMissingDatabaseIdentity, seedMissingLocalSecrets, } from "./local-secrets.js";
|
|
55
56
|
import { writeLocalEnvironment } from "./link.js";
|
|
@@ -57,13 +58,13 @@ import { registerDevShutdown, waitForDevShutdown } from "./dev-shutdown.js";
|
|
|
57
58
|
import { filterComposeNoise, parseEngineJsonOutput, parseEnginePushOutput, reportAppliedPush, } from "./engine-push-output.js";
|
|
58
59
|
import { withAdminRoles } from "./studio-admin-roles.js";
|
|
59
60
|
import { restoreSystemRelationTargets } from "./restore-system-relation-targets.js";
|
|
60
|
-
import { provisionBucketsFromAst, unprovisionedBuckets } from "./storage-provision.js";
|
|
61
|
+
import { provisionBucketsFromAst, unprovisionedBuckets, warnBucketsLeft } from "./storage-provision.js";
|
|
61
62
|
import { ensureFirstAdminUserForProject } from "./commands/admin.js";
|
|
62
63
|
import { demoDataHint, publishDevReady } from "./dev-ready-panel.js";
|
|
63
64
|
import { pushInitialSchema, settleInitialPush } from "./dev-initial-push.js";
|
|
64
65
|
import { offerAdoption, targetAdoptionSteps } from "./adopt-walkthrough.js";
|
|
65
66
|
import { resetDevDatabase } from "./dev-db-reset.js";
|
|
66
|
-
import { adoptKeysNeed, assertSupported, engineCapabilities,
|
|
67
|
+
import { adoptKeysNeed, assertSupported, engineCapabilities, schemaFeatureNeeds, OVERWRITE_DRIFT_NEED, checkedCapabilities, } from "./engine-ownership-gate.js";
|
|
67
68
|
import { devPushConsentingToDrift } from "./drift-consent.js";
|
|
68
69
|
import { capabilitiesCache, rememberCapabilitiesSync } from "@supatype/shared";
|
|
69
70
|
import { waitForDatabaseAfterUp } from "./dev-db-ready.js";
|
|
@@ -74,9 +75,10 @@ import { spawnComposeEngine, spawnComposeEngineSync } from "./compose-engine-run
|
|
|
74
75
|
import { waitForRestReady } from "./rest-ready.js";
|
|
75
76
|
import { claimDevRenderMode, composeRenderMode, composeRenderOptions, runningStackMode } from "./compose-render-mode.js";
|
|
76
77
|
import { configMailerEnv } from "./config-mailer-env.js";
|
|
78
|
+
import { retireCliMailerAutoconfirm } from "./mailer-autoconfirm.js";
|
|
77
79
|
import { fetchWithin } from "./fetch-within.js";
|
|
78
80
|
import { composeStackWatch, exitedServiceFailure } from "./stack-exit-watch.js";
|
|
79
|
-
import { assertEngineVersionSupported, engineImageVersion } from "./engine-floor.js";
|
|
81
|
+
import { assertEngineSupportsSchema, assertEngineVersionSupported, engineImageVersion } from "./engine-floor.js";
|
|
80
82
|
/**
|
|
81
83
|
* The image pins config asks for, once the engine's is known not to be older than this CLI needs.
|
|
82
84
|
* Checked before `.env` is written: a push refused the engine after writing its pin there as a
|
|
@@ -98,6 +100,7 @@ export function syncComposeImagePins(cwd, config) {
|
|
|
98
100
|
upsertEnvFile(cwd, imagePins, {
|
|
99
101
|
removeManaged: removeImageKeys,
|
|
100
102
|
managed: COMPOSE_PINNED_IMAGE_ENV_KEYS,
|
|
103
|
+
onHandEdited: warnHandEditedValues,
|
|
101
104
|
});
|
|
102
105
|
}
|
|
103
106
|
/** In-compose Postgres URL (SCRAM; not published to the host). */
|
|
@@ -182,8 +185,8 @@ export async function projectComposeEngine(cwd, config) {
|
|
|
182
185
|
return undefined;
|
|
183
186
|
if (config.connection?.trim())
|
|
184
187
|
return undefined;
|
|
188
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
185
189
|
const paths = writeSelfHostCompose(cwd, config, composeRenderOptions(cwd, config.project.name));
|
|
186
|
-
const project = composeProjectName(config.project.name);
|
|
187
190
|
const engineImage = await schemaEngineImageForPush(config, cwd);
|
|
188
191
|
return {
|
|
189
192
|
target: { cwd, project, composePath: paths.composePath, engineImage },
|
|
@@ -219,10 +222,14 @@ async function startComposeDatabase(config, paths, cwd, project, brand, timeoutM
|
|
|
219
222
|
}
|
|
220
223
|
await waitComposeHealthy(paths, cwd, timeoutMs, project);
|
|
221
224
|
}
|
|
225
|
+
/**
|
|
226
|
+
* Write dev's values into `.env`, and return those held for this run only (DR9): built from a port
|
|
227
|
+
* only the shell gave, and set in this process's environment instead. The dev session records them.
|
|
228
|
+
*/
|
|
222
229
|
export function upsertDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPort, devDbPort) {
|
|
223
230
|
const apiUrl = `http://localhost:${kongPort}`;
|
|
224
231
|
const imagePins = checkedImagePins(config);
|
|
225
|
-
const mailer = configMailerEnv(
|
|
232
|
+
const mailer = configMailerEnv(config);
|
|
226
233
|
// `POSTGRES_PASSWORD` and `JWT_SECRET` are deliberately absent.
|
|
227
234
|
//
|
|
228
235
|
// They used to be pinned here to published constants on every `dev` run, against the same
|
|
@@ -248,9 +255,9 @@ export function upsertDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPo
|
|
|
248
255
|
SUPATYPE_KONG_PORT: String(kongPort),
|
|
249
256
|
API_EXTERNAL_URL: apiUrl,
|
|
250
257
|
SITE_URL: apiUrl,
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
//
|
|
258
|
+
// email.provider and its settings, which the compose file passes to the server. The compose path
|
|
259
|
+
// used to carry none of them, so a project that asked for smtp, Resend or SES got the noop
|
|
260
|
+
// mailer. Email confirmation is not written here: the compose file falls back to the config.
|
|
254
261
|
...mailer.updates,
|
|
255
262
|
...imagePins,
|
|
256
263
|
};
|
|
@@ -286,13 +293,14 @@ export function upsertDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPo
|
|
|
286
293
|
removeManaged: [...removeImageKeys, ...mailer.removeManaged],
|
|
287
294
|
managed: [...managedImageKeys, ...mailer.managed],
|
|
288
295
|
remove: [...retiredKeys, ...staleLocalServerImage(dotEnv["SUPATYPE_SERVER_IMAGE"], wantsLocalServer, imagePins)],
|
|
296
|
+
onHandEdited: warnHandEditedValues,
|
|
289
297
|
});
|
|
290
298
|
// The front end's copies go where a development build reads them, not .env, which a production
|
|
291
299
|
// build reads (frontend-env.ts). The URL only when it is the project's port, not the shell's.
|
|
292
300
|
writeFrontendEnv(cwd, { anonKey, ...(urlsKept && { apiUrl }) }, { local: true });
|
|
293
|
-
if (devDbPort
|
|
294
|
-
|
|
295
|
-
}
|
|
301
|
+
if (devDbPort === undefined || usesExternalDatabase(config))
|
|
302
|
+
return runOnly;
|
|
303
|
+
return { ...runOnly, ...writeDevStackDatabaseUrl(cwd, devDbPort, runOnly.SUPATYPE_DEV_DB_PORT !== undefined) };
|
|
296
304
|
}
|
|
297
305
|
/** `persist` less the front-end URL names, and whether they were among what is kept. */
|
|
298
306
|
function takeFrontendUrls(persist) {
|
|
@@ -315,18 +323,22 @@ function staleLocalServerImage(current, wantsLocalServer, imagePins) {
|
|
|
315
323
|
* Docker dev's DATABASE_URL: the stack's database at `devDbPort`, with the project's own user and
|
|
316
324
|
* database, not hardcoded ones, which on a project not named "supatype" named a database that does
|
|
317
325
|
* not exist. Written over a URL the CLI owns, for this run only when the port is the shell's; one
|
|
318
|
-
* that is yours always wins (database-url-owner.ts).
|
|
326
|
+
* that is yours always wins (database-url-owner.ts). The URL when it was set for this run only.
|
|
319
327
|
*/
|
|
320
328
|
function writeDevStackDatabaseUrl(cwd, devDbPort, runOnly) {
|
|
321
329
|
const url = hostComposeDbUrl(cwd, devDbPort);
|
|
322
|
-
if (runOnly)
|
|
323
|
-
setCliDatabaseUrlForRun(databaseUrlState(cwd), url);
|
|
324
|
-
else
|
|
330
|
+
if (!runOnly) {
|
|
325
331
|
writeCliDatabaseUrl(cwd, url);
|
|
332
|
+
return {};
|
|
333
|
+
}
|
|
334
|
+
return setCliDatabaseUrlForRun(databaseUrlState(cwd), url) ? { DATABASE_URL: url } : {};
|
|
326
335
|
}
|
|
327
|
-
/**
|
|
336
|
+
/**
|
|
337
|
+
* Keep compose + Studio on the same freshly signed dev JWTs; sync optional image pins from config.
|
|
338
|
+
* The values held for this run only, as {@link upsertDevComposeEnv} returns them.
|
|
339
|
+
*/
|
|
328
340
|
function ensureDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPort, devDbPort) {
|
|
329
|
-
upsertDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPort, devDbPort);
|
|
341
|
+
return upsertDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPort, devDbPort);
|
|
330
342
|
}
|
|
331
343
|
/**
|
|
332
344
|
* The dev `.env` a push to a dev stack keeps current: the dev database port and the dev values.
|
|
@@ -513,15 +525,16 @@ async function waitStorageApiReady(kongPort, serviceRoleKey, maxSec) {
|
|
|
513
525
|
console.warn(`[supatype] Storage API at ${url} did not become ready within ${maxSec}s, bucket provisioning may fail.`);
|
|
514
526
|
}
|
|
515
527
|
/**
|
|
516
|
-
* The schema's buckets on the
|
|
517
|
-
*
|
|
518
|
-
*
|
|
528
|
+
* The schema's buckets on the stack: the line naming those the service did not take, or null when it
|
|
529
|
+
* took them all. Each caller decides what that means: dev and `compose up` carry on and warn
|
|
530
|
+
* ({@link warnBucketsLeft}), a push ends non-zero (0.9.1 release test FF2).
|
|
519
531
|
*/
|
|
520
532
|
async function provisionDockerStorageBuckets(ast, kongPort, serviceRoleKey) {
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
console.warn(`[supatype] ⚠ ${left}; uploads to them fail until a later push takes them.`);
|
|
533
|
+
const storageApi = `${loopbackBase(kongPort)}/storage/v1`;
|
|
534
|
+
return unprovisionedBuckets(await provisionBucketsFromAst(ast, storageApi, serviceRoleKey, { storageLogs: STORAGE_LOGS }));
|
|
524
535
|
}
|
|
536
|
+
/** The command that shows the storage container's log, named when it is not answering (N-FF11). */
|
|
537
|
+
const STORAGE_LOGS = "supatype self-host compose logs --service storage";
|
|
525
538
|
let _lastPushedAst = null;
|
|
526
539
|
let _lastFailedAst = null;
|
|
527
540
|
/** The schema the last push read, whether it applied, was refused or failed. */
|
|
@@ -535,7 +548,7 @@ let _composePushQueued = false;
|
|
|
535
548
|
* image only when that cannot be fetched (generated-files-engine.ts).
|
|
536
549
|
*/
|
|
537
550
|
async function refreshSchemaArtifacts(cwd, config, ast) {
|
|
538
|
-
writeAstDerivedArtifacts(cwd, config, ast);
|
|
551
|
+
await writeAstDerivedArtifacts(cwd, config, ast);
|
|
539
552
|
// The client and augmentation need no engine, so no engine problem keeps them from being written.
|
|
540
553
|
writeDevAstOutputs(cwd, ast, config, "");
|
|
541
554
|
let choice;
|
|
@@ -552,7 +565,7 @@ async function refreshSchemaArtifacts(cwd, config, ast) {
|
|
|
552
565
|
degraded(ENGINE_FALLBACK, choice.fellBack);
|
|
553
566
|
}
|
|
554
567
|
/** The files read straight off the applied AST, written whatever happens with the generator afterwards. */
|
|
555
|
-
function writeAstDerivedArtifacts(cwd, config, ast) {
|
|
568
|
+
async function writeAstDerivedArtifacts(cwd, config, ast) {
|
|
556
569
|
// Before the generator: these are read straight off the AST, so an applied push whose engine
|
|
557
570
|
// cannot generate still leaves the server the right maps. The server watches this file, so a
|
|
558
571
|
// hook or validator added to the schema takes effect without restarting the stack.
|
|
@@ -575,7 +588,7 @@ function writeAstDerivedArtifacts(cwd, config, ast) {
|
|
|
575
588
|
// `cache` block declared and nothing switched on: `.cache({ server: true })` answered BYPASS,
|
|
576
589
|
// and the only way to find out why was to open Studio and tick a box the schema had already
|
|
577
590
|
// justified.
|
|
578
|
-
for (const note of cacheSeedingNotes(cwd, ast))
|
|
591
|
+
for (const note of await cacheSeedingNotes(cwd, ast))
|
|
579
592
|
console.log(`[supatype] ${note}`);
|
|
580
593
|
}
|
|
581
594
|
/**
|
|
@@ -690,10 +703,10 @@ export async function runComposeSchemaPush(cwd, config, paths, schemaPath, compo
|
|
|
690
703
|
console.log("[supatype] Schema unchanged since the last push, nothing to apply.");
|
|
691
704
|
return;
|
|
692
705
|
}
|
|
693
|
-
// Identity and generated columns only to an engine that reads them (the
|
|
694
|
-
// asked by `engineRequest`).
|
|
706
|
+
// Identity and generated columns, and realtime channels, only to an engine that reads them (the
|
|
707
|
+
// override's binary is asked by `engineRequest`).
|
|
695
708
|
if (!hasEngineOverride(config))
|
|
696
|
-
await requireDockerFeatures(cwd, config,
|
|
709
|
+
await requireDockerFeatures(cwd, config, schemaFeatureNeeds(ast));
|
|
697
710
|
if (opts.access === "plan")
|
|
698
711
|
await printPlannedAccess(cwd, config);
|
|
699
712
|
try {
|
|
@@ -719,8 +732,10 @@ export async function runComposeSchemaPush(cwd, config, paths, schemaPath, compo
|
|
|
719
732
|
async function printPlannedAccess(cwd, config) {
|
|
720
733
|
try {
|
|
721
734
|
const diff = await dockerDiff(cwd, config);
|
|
722
|
-
if (diff
|
|
723
|
-
|
|
735
|
+
if (diff === undefined)
|
|
736
|
+
return;
|
|
737
|
+
printRoleAccess(diff);
|
|
738
|
+
printChannelChanges(diff);
|
|
724
739
|
}
|
|
725
740
|
catch (err) {
|
|
726
741
|
console.log(`[supatype] Could not read each role's access before the push: ${errorMessage(err)}`);
|
|
@@ -733,6 +748,8 @@ function appliedAccess(opts) {
|
|
|
733
748
|
/** The schema on disk as a push sends it, and that AST serialized for comparing pushes. */
|
|
734
749
|
function readSchemaToPush(schemaPath, cwd, config) {
|
|
735
750
|
const ast = withPublishing(loadSchemaAst(schemaPath, cwd), config);
|
|
751
|
+
// The check `supatype push` makes: a pinned engine too old to read part of the schema drops it silently.
|
|
752
|
+
assertEngineSupportsSchema(ast, pinnedVersion("engine", config));
|
|
736
753
|
return { ast, astJson: JSON.stringify(ast) };
|
|
737
754
|
}
|
|
738
755
|
/**
|
|
@@ -828,7 +845,7 @@ async function runComposeSchemaPushQueued(cwd, config, paths, schemaPath, compos
|
|
|
828
845
|
export async function followRecordedTier(cwd, config, opts) {
|
|
829
846
|
if (usesExternalDatabase(config))
|
|
830
847
|
return;
|
|
831
|
-
const project =
|
|
848
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
832
849
|
const paths = selfHostComposePaths(cwd);
|
|
833
850
|
const served = composeFieldMaskingTier(cwd, config);
|
|
834
851
|
const recorded = await recordDatabaseTier(cwd, { project, composePath: paths.composePath });
|
|
@@ -869,11 +886,11 @@ async function runDevSchemaPush(cwd, config, paths, schemaPath, composeProject,
|
|
|
869
886
|
* may be renames. Reads the AST the push wrote, so it is the schema that was refused.
|
|
870
887
|
*/
|
|
871
888
|
export async function dockerDiff(cwd, config) {
|
|
889
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
872
890
|
if (hasEngineOverride(config)) {
|
|
873
891
|
const ast = JSON.parse(readFileSync(join(cwd, ".supatype", "schema.ast.json"), "utf8"));
|
|
874
892
|
return engineRequest("/diff", { ast, database_url: projectDatabaseUrl(cwd, config), schema: pgSchema(config) }, isDiffResult);
|
|
875
893
|
}
|
|
876
|
-
const project = composeProjectName(config.project.name);
|
|
877
894
|
const result = await runComposeEngineDiff(selfHostComposePaths(cwd), cwd, project, config);
|
|
878
895
|
return result.diff ?? undefined;
|
|
879
896
|
}
|
|
@@ -907,11 +924,12 @@ async function runComposeEnginePush(paths, cwd, composeProject, config, sources,
|
|
|
907
924
|
export async function dockerEngineCapabilities(cwd, config) {
|
|
908
925
|
if (hasEngineOverride(config))
|
|
909
926
|
return engineCapabilities();
|
|
927
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
910
928
|
const engineImage = await schemaEngineImageForPush(config, cwd);
|
|
911
929
|
// An image Docker could not pull throws with the daemon's sentence, and is asked again next time.
|
|
912
930
|
const probe = () => {
|
|
913
931
|
const paths = writeSelfHostCompose(cwd, config, composeRenderOptions(cwd, config.project.name));
|
|
914
|
-
const target = { cwd, project
|
|
932
|
+
const target = { cwd, project, composePath: paths.composePath, engineImage };
|
|
915
933
|
return checkedCapabilities((args) => {
|
|
916
934
|
const run = spawnComposeEngineSync(target, args, { runFlags: ["--no-deps"] });
|
|
917
935
|
return { status: run.status, stdout: run.stdout, stderr: run.error ?? run.stderr };
|
|
@@ -1032,7 +1050,7 @@ export function dockerAdoptionSteps(cwd, config) {
|
|
|
1032
1050
|
* which it is whenever a push has just been refused by it.
|
|
1033
1051
|
*/
|
|
1034
1052
|
export async function adoptSchemaDocker(cwd, config, yes, keys) {
|
|
1035
|
-
const project =
|
|
1053
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
1036
1054
|
// Only these conflicts, or none for an empty list: never sent to an engine that would read
|
|
1037
1055
|
// either as "every conflict".
|
|
1038
1056
|
if (keys !== undefined)
|
|
@@ -1048,7 +1066,7 @@ export async function adoptSchemaDocker(cwd, config, yes, keys) {
|
|
|
1048
1066
|
...(keys !== undefined && { keys }),
|
|
1049
1067
|
}, isAdoptOutcome);
|
|
1050
1068
|
}
|
|
1051
|
-
await requireDockerFeatures(cwd, config,
|
|
1069
|
+
await requireDockerFeatures(cwd, config, schemaFeatureNeeds(withPublishing(loadSchemaAst(schemaPathFromProject(config, cwd), cwd), config)));
|
|
1052
1070
|
const paths = writeSelfHostCompose(cwd, config, composeRenderOptions(cwd, config.project.name));
|
|
1053
1071
|
const command = adoptCommand(yes, keys);
|
|
1054
1072
|
const result = await runComposeEngineCommand(paths, cwd, project, config, command);
|
|
@@ -1070,7 +1088,7 @@ export async function diffSchemaDocker(cwd, config) {
|
|
|
1070
1088
|
if (resolveRuntimeProvider(config) !== "docker") {
|
|
1071
1089
|
throw new Error("diffSchemaDocker requires provider: docker");
|
|
1072
1090
|
}
|
|
1073
|
-
const project =
|
|
1091
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
1074
1092
|
if (hasEngineOverride(config)) {
|
|
1075
1093
|
ensureDockerDbPublishedForHostEngine(cwd, config, "diff");
|
|
1076
1094
|
return diffWithHostEngine(cwd, config);
|
|
@@ -1097,7 +1115,7 @@ async function diffWithHostEngine(cwd, config) {
|
|
|
1097
1115
|
/** The diff from the compose schema-engine, which reads the AST written beside the compose file. */
|
|
1098
1116
|
async function diffWithComposeEngine(cwd, config, paths, project) {
|
|
1099
1117
|
const ast = withPublishing(loadSchemaAst(schemaPathFromProject(config, cwd), cwd), config);
|
|
1100
|
-
await requireDockerFeatures(cwd, config,
|
|
1118
|
+
await requireDockerFeatures(cwd, config, schemaFeatureNeeds(ast));
|
|
1101
1119
|
const supatypeDir = join(cwd, ".supatype");
|
|
1102
1120
|
mkdirSync(supatypeDir, { recursive: true });
|
|
1103
1121
|
writeFileSync(join(supatypeDir, "schema.ast.json"), JSON.stringify(ast));
|
|
@@ -1139,7 +1157,7 @@ export async function pushSchemaDocker(cwd, config, opts = {}) {
|
|
|
1139
1157
|
if (resolveRuntimeProvider(config) !== "docker") {
|
|
1140
1158
|
throw new Error("pushSchemaDocker requires provider: docker");
|
|
1141
1159
|
}
|
|
1142
|
-
const project =
|
|
1160
|
+
const project = enterLocalStack(cwd, config.project.name);
|
|
1143
1161
|
const running = pushStackMode(cwd, config);
|
|
1144
1162
|
const mode = running ?? "standalone";
|
|
1145
1163
|
const kongPort = await resolveKongPort(cwd, project);
|
|
@@ -1156,9 +1174,9 @@ export async function pushSchemaDocker(cwd, config, opts = {}) {
|
|
|
1156
1174
|
await followRecordedTier(cwd, config, { recreate: false });
|
|
1157
1175
|
if (running === undefined) {
|
|
1158
1176
|
console.log("[supatype] Schema pushed. The local stack isn't running, so nothing else was started.");
|
|
1159
|
-
return;
|
|
1177
|
+
return false;
|
|
1160
1178
|
}
|
|
1161
|
-
|
|
1179
|
+
return bringUpAfterApply(() => bringPushedStackUp(cwd, config, stack, ast, devApiKeys(cwd)));
|
|
1162
1180
|
}
|
|
1163
1181
|
/**
|
|
1164
1182
|
* The mode of the stack a push goes to, or undefined for an external database with no stack
|
|
@@ -1174,17 +1192,20 @@ function pushStackMode(cwd, config) {
|
|
|
1174
1192
|
}
|
|
1175
1193
|
/**
|
|
1176
1194
|
* What a push does on a running stack after it applied: `up -d` for what the schema changed, then
|
|
1177
|
-
* the buckets, the first admin and the REST wait.
|
|
1178
|
-
*
|
|
1195
|
+
* the buckets, the first admin and the REST wait. `bringUp` answers with the buckets the stack did
|
|
1196
|
+
* not take, or null. The schema is in by then and stays in (issue 41), but a step that failed ends
|
|
1197
|
+
* the push non-zero with no success line, as a push to a linked server does: it was warned about
|
|
1198
|
+
* and exited 0, so a pipeline passed with buckets missing (0.9.1 release test FF2, issue 301).
|
|
1199
|
+
* True when a step failed.
|
|
1179
1200
|
*/
|
|
1180
1201
|
async function bringUpAfterApply(bringUp) {
|
|
1181
|
-
|
|
1182
|
-
|
|
1202
|
+
const failure = await bringUp().catch((err) => `a step after it failed: ${errorMessage(err)}`);
|
|
1203
|
+
if (failure === null) {
|
|
1183
1204
|
console.log("[supatype] Schema pushed.");
|
|
1205
|
+
return false;
|
|
1184
1206
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
}
|
|
1207
|
+
postApplyFailed(failure);
|
|
1208
|
+
return true;
|
|
1188
1209
|
}
|
|
1189
1210
|
/**
|
|
1190
1211
|
* The host port the stack's gateway answers plain HTTP on. A standalone stack with TLS publishes
|
|
@@ -1202,7 +1223,8 @@ export class StackNotServing extends Error {
|
|
|
1202
1223
|
* What a started stack needs once it answers: the gateway and storage waited for, then the schema's
|
|
1203
1224
|
* declared buckets and the first admin user. A push to a running stack runs it after its `up -d`,
|
|
1204
1225
|
* and `self-host compose up` after its own, so no command depends on a push to start the stack and
|
|
1205
|
-
* create them (issue 41).
|
|
1226
|
+
* create them (issue 41). Answers with the buckets the stack did not take, or null, for the caller
|
|
1227
|
+
* to warn about or fail on.
|
|
1206
1228
|
*/
|
|
1207
1229
|
export async function provisionStartedStack(cwd, config, stack, ast, serviceRoleKey) {
|
|
1208
1230
|
const { composePath, project, gatewayPort } = stack;
|
|
@@ -1213,23 +1235,26 @@ export async function provisionStartedStack(cwd, config, stack, ast, serviceRole
|
|
|
1213
1235
|
throw new StackNotServing(errorMessage(err), { cause: err });
|
|
1214
1236
|
}
|
|
1215
1237
|
await waitStorageApiReady(gatewayPort, serviceRoleKey, 90);
|
|
1216
|
-
await provisionDockerStorageBuckets(ast, gatewayPort, serviceRoleKey);
|
|
1238
|
+
const left = await provisionDockerStorageBuckets(ast, gatewayPort, serviceRoleKey);
|
|
1217
1239
|
await ensureFirstAdminUserForProject(cwd, config, { compose: { project, composePath } });
|
|
1240
|
+
return left;
|
|
1218
1241
|
}
|
|
1219
1242
|
/**
|
|
1220
1243
|
* After a compose push: the rest of the stack up, then what the schema asks of it once it answers
|
|
1221
|
-
* (buckets, the first admin), then REST, which is the last to catch up with the new schema.
|
|
1244
|
+
* (buckets, the first admin), then REST, which is the last to catch up with the new schema. Answers
|
|
1245
|
+
* with the buckets the stack did not take, or null.
|
|
1222
1246
|
*/
|
|
1223
1247
|
async function bringPushedStackUp(cwd, config, stack, ast, keys) {
|
|
1224
1248
|
const { paths, project, gatewayPort, brand } = stack;
|
|
1225
|
-
const upGateway = runDockerCompose(paths.composePath, [
|
|
1249
|
+
const upGateway = runDockerCompose(paths.composePath, [...COMPOSE_UP_DETACHED], cwd, project, { quiet: true, brand });
|
|
1226
1250
|
// Thrown, not exited: the schema is applied by now (bringUpAfterApply).
|
|
1227
1251
|
if (upGateway !== 0)
|
|
1228
1252
|
throw new Error(`docker compose up exited with status ${upGateway}`);
|
|
1229
|
-
await provisionStartedStack(cwd, config, { composePath: paths.composePath, project, gatewayPort }, ast, keys.serviceRoleKey);
|
|
1253
|
+
const left = await provisionStartedStack(cwd, config, { composePath: paths.composePath, project, gatewayPort }, ast, keys.serviceRoleKey);
|
|
1230
1254
|
// Last, so the admin user and the buckets are not held up by it. `supatype dev` never comes
|
|
1231
1255
|
// through here: it pushes before PostgREST starts, so PostgREST finds the schemas on its first try.
|
|
1232
1256
|
await waitForRestReady(loopbackBase(gatewayPort), keys.anonKey);
|
|
1257
|
+
return left;
|
|
1233
1258
|
}
|
|
1234
1259
|
/**
|
|
1235
1260
|
* The first push of a `dev` session. A retry only ever brings Postgres back up: it never removes
|
|
@@ -1303,6 +1328,9 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1303
1328
|
// Per-project compose name + port isolate this project from any other Supatype
|
|
1304
1329
|
// stack on the machine (own containers, volumes, network, and gateway port).
|
|
1305
1330
|
const project = composeProjectName(config.project.name);
|
|
1331
|
+
// Before anything is rendered or started: the stack of that name may be another folder's (RB-2).
|
|
1332
|
+
refuseOtherFoldersStack(cwd, project);
|
|
1333
|
+
recordStackFolder(cwd, project);
|
|
1306
1334
|
const kongPort = await resolveKongPort(cwd, project);
|
|
1307
1335
|
// No dev db port for an external database: `ensureDevDbPort` allocates a host port for the `db`
|
|
1308
1336
|
// container *and persists a matching DATABASE_URL*, which overwrote the operator's own URL, the
|
|
@@ -1312,10 +1340,14 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1312
1340
|
// with a database on 54329 and a URL still saying 5432.
|
|
1313
1341
|
// Only dev moves the port off something else that holds it.
|
|
1314
1342
|
const devDbPort = await devStackDbPort(cwd, config, project);
|
|
1343
|
+
// Before .env is written and handed to compose: a SUPATYPE_MAILER_AUTOCONFIRM an earlier CLI wrote
|
|
1344
|
+
// there would otherwise win over the config as if the developer had set it (FF7).
|
|
1345
|
+
retireCliMailerAutoconfirm(cwd);
|
|
1315
1346
|
const { anonKey, serviceRoleKey } = devApiKeys(cwd);
|
|
1316
1347
|
const devBrand = { intro: "Local development" };
|
|
1317
1348
|
const localServerImage = await ensureLocalServerDockerImage(cwd, config, devBrand);
|
|
1318
|
-
|
|
1349
|
+
// Recorded in the session's lock, so a later command from another shell runs this stack as it runs.
|
|
1350
|
+
const runEnv = ensureDevComposeEnv(cwd, config, anonKey, serviceRoleKey, kongPort, devDbPort);
|
|
1319
1351
|
warnMissingStackSettings(cwd, config);
|
|
1320
1352
|
console.log(`[supatype] provider docker, starting self-host Compose stack (project ${project}, gateway :${kongPort})...`);
|
|
1321
1353
|
await showDevStep("Preparing the Docker stack");
|
|
@@ -1330,9 +1362,12 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1330
1362
|
schemaWatcher: null,
|
|
1331
1363
|
functionsWatcher: null,
|
|
1332
1364
|
};
|
|
1365
|
+
// As the start begins, so the stack comes down however dev ends. Until the start is done a Ctrl+C
|
|
1366
|
+
// is a stopped start, as on native dev (FF11).
|
|
1333
1367
|
registerDevShutdown(() => stopDevComposeStack(shutdownState, { project, composePath: paths.composePath }, cwd), {
|
|
1334
1368
|
cwd,
|
|
1335
1369
|
compose: { cwd, composePath: paths.composePath, composeProject: project },
|
|
1370
|
+
duringStart: true,
|
|
1336
1371
|
});
|
|
1337
1372
|
await recoverStaleDevSession(cwd);
|
|
1338
1373
|
await handleComposeProjectRename(cwd, projectNameInFile(config), paths);
|
|
@@ -1371,7 +1406,7 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1371
1406
|
await followRecordedTier(cwd, config, { recreate: false });
|
|
1372
1407
|
console.log("[supatype] Bringing up Docker Compose services...");
|
|
1373
1408
|
await showDevStep("Starting services (the first start downloads their images)");
|
|
1374
|
-
const upStatus = await runDockerComposeQuietly(paths.composePath, [
|
|
1409
|
+
const upStatus = await runDockerComposeQuietly(paths.composePath, [...COMPOSE_UP_DETACHED], cwd, project, devBrand);
|
|
1375
1410
|
if (upStatus !== 0) {
|
|
1376
1411
|
endDevSession();
|
|
1377
1412
|
exitComposeFailed(upStatus, "Could not start the local Compose stack.", devBrand);
|
|
@@ -1435,14 +1470,21 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1435
1470
|
kongPort,
|
|
1436
1471
|
provider: "docker",
|
|
1437
1472
|
});
|
|
1438
|
-
writeDevSessionLock(cwd, devSessionLockFor(config, {
|
|
1473
|
+
writeDevSessionLock(cwd, devSessionLockFor(config, {
|
|
1474
|
+
provider: "docker",
|
|
1475
|
+
composeProject: project,
|
|
1476
|
+
composePath: paths.composePath,
|
|
1477
|
+
kongPort,
|
|
1478
|
+
...(devDbPort !== undefined && { dbPort: devDbPort }),
|
|
1479
|
+
runEnv,
|
|
1480
|
+
}));
|
|
1439
1481
|
// Only for a schema the database took, as a save does: a refused one may not even load, and its
|
|
1440
1482
|
// buckets belong to fields that do not exist yet. The save that applies it provisions them.
|
|
1441
1483
|
if (schemaApplied) {
|
|
1442
1484
|
const ast = withPublishing(loadSchemaAst(schemaPath, cwd), config);
|
|
1443
|
-
await provisionDockerStorageBuckets(ast, kongPort, serviceRoleKey);
|
|
1485
|
+
warnBucketsLeft(await provisionDockerStorageBuckets(ast, kongPort, serviceRoleKey));
|
|
1444
1486
|
}
|
|
1445
|
-
const pidDir = join(
|
|
1487
|
+
const pidDir = join(nativeStateRoot(config), "pid");
|
|
1446
1488
|
mkdirSync(pidDir, { recursive: true });
|
|
1447
1489
|
startDevSession();
|
|
1448
1490
|
let studioProc = null;
|
|
@@ -1470,15 +1512,14 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1470
1512
|
{ label: "Storage", url: `http://localhost:${kongPort}/storage/v1/` },
|
|
1471
1513
|
{ label: "Realtime", url: `ws://localhost:${kongPort}/realtime/v1/` },
|
|
1472
1514
|
];
|
|
1473
|
-
|
|
1474
|
-
links.push({ label: "App", url: `http://localhost:${kongPort}/` });
|
|
1475
|
-
}
|
|
1515
|
+
links.push(...appPanelLinks(config, `http://localhost:${kongPort}`));
|
|
1476
1516
|
links.push({ label: "Studio", url: studioUrlAt(`http://localhost:${kongPort}`) });
|
|
1477
1517
|
const hints = [];
|
|
1478
1518
|
const demoData = demoDataHint(cwd);
|
|
1479
1519
|
if (demoData !== undefined)
|
|
1480
1520
|
hints.push(demoData);
|
|
1481
1521
|
publishDevReady({
|
|
1522
|
+
cwd,
|
|
1482
1523
|
title: `Services running (Docker · ${project})`,
|
|
1483
1524
|
links,
|
|
1484
1525
|
anonKey,
|
|
@@ -1499,7 +1540,7 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1499
1540
|
console.log(`\n[supatype] ${why}, pushing schema...`);
|
|
1500
1541
|
try {
|
|
1501
1542
|
await runComposeSchemaPushQueued(cwd, config, paths, schemaPath, project, pushOptions);
|
|
1502
|
-
await provisionDockerStorageBuckets(loadSchemaAst(schemaPath, cwd), kongPort, serviceRoleKey);
|
|
1543
|
+
warnBucketsLeft(await provisionDockerStorageBuckets(loadSchemaAst(schemaPath, cwd), kongPort, serviceRoleKey));
|
|
1503
1544
|
}
|
|
1504
1545
|
catch (err) {
|
|
1505
1546
|
reportDevPushFailure(err);
|
|
@@ -1508,7 +1549,7 @@ export async function runDevCompose(cwd, config, opts) {
|
|
|
1508
1549
|
},
|
|
1509
1550
|
});
|
|
1510
1551
|
// The worker imports its handlers once; without this an edited function kept its old code.
|
|
1511
|
-
const worker = { composePath: paths.composePath, cwd, project };
|
|
1552
|
+
const worker = { composePath: paths.composePath, cwd, project, baseUrl: loopbackBase(kongPort), anonKey };
|
|
1512
1553
|
shutdownState.functionsWatcher = watchFunctionSources(cwd, () => restartComposeFunctionsWorker(worker));
|
|
1513
1554
|
}
|
|
1514
1555
|
// Until Ctrl+C or a signal: the shutdown hook takes the stack down and exits.
|