@salsita-ai/sdk 0.50.0-develop.24077d65e6 → 0.50.0-develop.257ef311fd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -14
- package/dist/admin/default-admin-elements.d.ts +9 -0
- package/dist/admin/default-admin-elements.js +1 -0
- package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-entity-element.js +1 -0
- package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-layout-element.js +1 -0
- package/dist/admin/default-elements/index.d.ts +2 -0
- package/dist/admin/default-elements/index.js +1 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/application-spec/caching/content-diff.js +1 -1
- package/dist/application-spec/core/application-file.d.ts +0 -2
- package/dist/application-spec/core/application-file.js +1 -1
- package/dist/application-spec/errors/diagnostic-codes.d.ts +5 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +5 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
- package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
- package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
- package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
- package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +15 -14
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/story-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
- package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +6 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +59 -63
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +13 -13
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
- package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
- package/dist/application-spec/generate-application/code/templates/gitignore.js +0 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +31 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +24 -44
- package/dist/application-spec/generate-application/code/templates/index.d.ts +3 -3
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
- package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
- package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
- package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +24 -7
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
- package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
- package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
- package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
- package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
- package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
- package/dist/application-spec/generate-application/index.d.ts +2 -0
- package/dist/application-spec/generate-application/index.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +6 -4
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +8 -3
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +19 -5
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +6 -4
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -2
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +3 -0
- package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +7 -4
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +3 -3
- package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
- package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
- package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
- package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
- package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
- package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +34 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
- package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
- package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
- package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +6 -2
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
- package/dist/client/phoenix-api.d.ts +367 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +36 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +7 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +21 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/index.d.ts +3 -1
- package/dist/configurator/common/index.js +1 -1
- package/dist/configurator/common/use-finalize-action.d.ts +31 -0
- package/dist/configurator/common/use-finalize-action.js +1 -0
- package/dist/configurator/common/use-reset-camera.d.ts +6 -0
- package/dist/configurator/common/use-reset-camera.js +1 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
- package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
- package/dist/configurator/configuration-not-found-page/index.js +1 -0
- package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
- package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/pages/RootPage.js +1 -1
- package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
- package/dist/configurator/pages/configurator-layout-name.js +1 -0
- package/dist/configurator/pages/default-configurator-elements.d.ts +9 -0
- package/dist/configurator/pages/default-configurator-elements.js +1 -0
- package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
- package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
- package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
- package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
- package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
- package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
- package/dist/configurator/pages/default-elements/index.d.ts +4 -0
- package/dist/configurator/pages/default-elements/index.js +1 -0
- package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
- package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
- package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
- package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
- package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
- package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
- package/dist/configurator/pages/index.d.ts +1 -0
- package/dist/configurator/pages/index.js +1 -1
- package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
- package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +1 -1
- package/dist/configurator/ui/assistant/entity-link/index.d.ts +0 -1
- package/dist/configurator/ui/assistant/entity-link/index.js +1 -1
- package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
- package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
- package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
- package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
- package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
- package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
- package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
- package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
- package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
- package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
- package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
- package/dist/configurator/ui/assistant/form/form-model.js +1 -0
- package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
- package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
- package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
- package/dist/configurator/ui/assistant/form/form-state.js +1 -0
- package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/form/index.js +1 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
- package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
- package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
- package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
- package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
- package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
- package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
- package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
- package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
- package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
- package/dist/docs/fabs/basic.mdx +2 -2
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-layout.mdx +1471 -200
- package/dist/docs/other-features/not-found-404.mdx +1 -1
- package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
- package/dist/docs/phoenix/components.mdx +6 -0
- package/dist/docs/phoenix/configurator-interface.mdx +99 -21
- package/dist/docs/phoenix/deployments.mdx +2 -6
- package/dist/docs/phoenix/domain-model.mdx +2 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +6 -3
- package/dist/docs/phoenix/layout-slots.mdx +12 -10
- package/dist/docs/phoenix/localization.mdx +10 -6
- package/dist/docs/phoenix/migration-guide.mdx +24 -11
- package/dist/docs/phoenix/phoenix-cli.mdx +67 -20
- package/dist/docs/phoenix/project-structure.mdx +70 -33
- package/dist/docs/phoenix/quickstart.mdx +7 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +7 -7
- package/dist/docs/phoenix/testing.mdx +8 -0
- package/dist/docs/phoenix/webhooks.mdx +21 -4
- package/dist/domain/application/application-config.d.ts +3 -1
- package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
- package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +2 -0
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
- package/dist/domain/application/configurator-builder.d.ts +4 -1
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/core/schema/extended-schema-validator.js +1 -1
- package/dist/domain/domain-context/index.d.ts +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +28 -1
- package/dist/domain/domain-context/undo-system.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
- package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
- package/dist/editor/Editor.d.ts +7 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/mocks/CreateMockYaml.js +2 -2
- package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
- package/dist/editor/mocks/EditorMockContext.js +1 -1
- package/dist/globals/index.d.ts +2 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +79 -80
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +15 -14
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +14 -13
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
- package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
- package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
- package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
- package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
- package/dist/phoenix/application-spec/project-files.js +1 -1
- package/dist/phoenix/bin.d.ts +2 -0
- package/dist/phoenix/bin.js +2 -0
- package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
- package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
- package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
- package/dist/phoenix/check-configs/eslint-config.js +1 -0
- package/dist/phoenix/check-configs/index.d.ts +8 -0
- package/dist/phoenix/check-configs/index.js +1 -0
- package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
- package/dist/phoenix/check-configs/typescript-project.js +1 -0
- package/dist/phoenix/cli.d.ts +0 -1
- package/dist/phoenix/cli.js +1 -2
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/check.js +1 -1
- package/dist/phoenix/commands/clean.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/deps/deps.d.ts +73 -0
- package/dist/phoenix/commands/deps/deps.js +3 -0
- package/dist/phoenix/commands/deps/index.d.ts +1 -0
- package/dist/phoenix/commands/deps/index.js +1 -0
- package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
- package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/fix.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/init.d.ts +17 -5
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/link.js +1 -1
- package/dist/phoenix/commands/prettier.js +1 -1
- package/dist/phoenix/commands/sync.js +1 -1
- package/dist/phoenix/commands/unlink.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -2
- package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
- package/dist/phoenix/services/lingui.d.ts +8 -0
- package/dist/phoenix/services/lingui.js +1 -1
- package/dist/phoenix/services/swc.js +1 -1
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/index.d.ts +4 -2
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/node-version/index.d.ts +1 -0
- package/dist/phoenix/utils/node-version/index.js +1 -0
- package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
- package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
- package/dist/phoenix/utils/package-info.d.ts +0 -9
- package/dist/phoenix/utils/package-info.js +1 -1
- package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
- package/dist/phoenix/utils/package-manager/index.js +1 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
- package/dist/phoenix/utils/run-command.d.ts +11 -0
- package/dist/phoenix/utils/run-command.js +1 -1
- package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
- package/dist/phoenix/utils/sdk-tool/index.js +1 -0
- package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
- package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
- package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +2 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/package.json +46 -35
- package/schema/domain-spec.json +86 -8
- package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
- package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
- package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +0 -5
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +0 -1
- package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
- package/dist/phoenix/commands/generate-project-files.js +0 -1
- /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +0 -0
- /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.js +0 -0
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import type { CommandContext } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The versions of the tools the SDK runs itself and editors load from the project, taken from the SDK's own
|
|
4
|
+
* `dependencies`, so the editor and `phoenix check` use the same release.
|
|
5
|
+
*/
|
|
6
|
+
export interface EditorToolVersions {
|
|
7
|
+
readonly eslint: string;
|
|
8
|
+
readonly prettier: string;
|
|
9
|
+
}
|
|
2
10
|
export interface InitCommandProps {
|
|
3
11
|
readonly sdkVersion: string;
|
|
12
|
+
readonly editorToolVersions: EditorToolVersions;
|
|
4
13
|
/** Directory to initialize; defaults to the working directory. */
|
|
5
14
|
readonly projectRoot?: string;
|
|
6
15
|
}
|
|
7
16
|
/**
|
|
8
|
-
* Starts a Phoenix project: writes a `package.json` that depends on this CLI's SDK version when the folder has none
|
|
9
|
-
* the starter spec and the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
17
|
+
* Starts a Phoenix project: writes a `package.json` that depends on this CLI's SDK version when the folder has none
|
|
18
|
+
* and the starter spec, and switches the project to the application-spec pipeline. The project's `package.json` gains
|
|
19
|
+
* what it does not have yet: the SDK's required peers, ESLint and Prettier, and the `dev`, `build`, `deploy`, `check`
|
|
20
|
+
* and `fix` scripts. An entry the project already has stays as it is. It writes no package-manager settings or
|
|
21
|
+
* `packageManager` field: the project installs with any package manager, and its maintainer owns those settings.
|
|
22
|
+
* The next steps it prints name the package manager that ran it. It touches no server and asks nothing: the starter
|
|
23
|
+
* spec names the default project of whichever workspace the developer signs in to, and everything else is generated
|
|
24
|
+
* by sync or the build.
|
|
13
25
|
*
|
|
14
26
|
* Refuses when a `spec/` folder exists, and when an existing `package.json` does not depend on the SDK.
|
|
15
27
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as e}from"fs";import{mkdir as
|
|
1
|
+
import{existsSync as e}from"fs";import{mkdir as t,readFile as i,writeFile as n}from"fs/promises";import{basename as o,dirname as r,join as a}from"path";import{findPackageManagerCommands as s}from"../utils/index.js";import{addMissingDependencies as p,addMissingSdkPeers as c}from"./deps/index.js";import{starterSpecFiles as d}from"./init-starter-spec.js";let l="@salsita-ai/sdk",h={dev:"phoenix dev",build:"phoenix build",deploy:"phoenix deploy",check:"phoenix check",fix:"phoenix fix"},f=(e,t)=>void 0===e?`\`phoenix ${t}\` through your package manager`:`\`${e.phoenix(t)}\``,u=async(e,t)=>{let n=void 0===t?`add ${l} with your package manager`:`\`${t.add(l)}\``,o=`Install the SDK first (${n}), then rerun ${f(t,"init")}.`,r=JSON.parse(await i(e,"utf-8"));if("object"!=typeof r||null===r||Array.isArray(r))throw Error(`phoenix init could not read package.json because it is not a JSON object. ${o}`);if(!["dependencies","devDependencies"].some(e=>{let t=Reflect.get(r,e);return"object"==typeof t&&null!==t&&l in t}))throw Error(`phoenix init found no ${l} dependency in package.json. ${o}`);return{...r}},m=async e=>{for(let i of d){let o=a(e,i.path);await t(r(o),{recursive:!0}),await n(o,i.content)}},x=async(e,t,i)=>{let o=t.phoenix,r=t.scripts,a="object"==typeof r&&null!==r?r:{},s=Object.fromEntries(Object.entries(h).filter(([e])=>!(e in a))),d=p(c({...t,scripts:{...a,...s}},{useClerk:!1}),Object.entries(i).map(([e,t])=>({name:e,version:t,field:"devDependencies"})));await n(e,JSON.stringify({...d,phoenix:{..."object"==typeof o&&null!==o?o:{},applicationFlow:!0}},null,2)+"\n")};export const runInitCommand=async(i,{logger:n})=>{var r,p;let c,d,h=i.projectRoot??process.cwd(),g=a(h,"package.json"),j=s(process.env.npm_config_user_agent);if(e(a(h,"spec")))throw Error(`phoenix init found an existing spec/ folder. init only starts new projects, and writing a starter spec would overwrite or mix with the existing one. To update an existing project, run ${f(j,"sync")}; to start over, run init in an empty project folder.`);let y=e(g)?await u(g,j):(r=h,p=i.sdkVersion,{name:(c=o(r).toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^[._-]+|[-]+$/g,"")).length>0?c:"phoenix-configurator",private:!0,type:"module",scripts:{},dependencies:{[l]:p}});n.step(`Writing the starter project to ${h}`),await t(h,{recursive:!0}),await m(h),await x(g,y,i.editorToolVersions),n.success(`Phoenix project created in ${h}.`),n.info(["",...(d=["sync","login <workspace>","dev","deploy"],void 0===j?["Next steps, in the project folder, through your package manager:"," install the dependencies",...d.map(e=>` phoenix ${e}`)]:["Next steps, in the project folder:",` ${j.install}`,...d.map(e=>` ${j.phoenix(e)}`)]),"","Developing against a Studio development environment instead? Paste its .env block into .env before phoenix dev."].join("\n"))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as e,resolve as t}from"path";import{addWorkspaceOverrides as
|
|
1
|
+
import{relative as e,resolve as t}from"path";import{addWorkspaceOverrides as o,assertPnpmProject as r,getSdkPackages as a,getWorkspaceDir as n}from"../utils/index.js";export const runLinkCommand=async(s,i)=>{let{logger:c}=i,l=s.sdkPath??"../configurator-phoenix";try{r({projectRoot:process.cwd(),command:"link"})}catch(e){throw c.error(e instanceof Error?e.message:String(e)),e}try{c.step("Linking local SDK packages");let r=t(l);c.debug(`SDK path: ${r}`);let s=a(r);c.debug(`Found ${s.length} packages to link`);let i=n(),p={};s.forEach(({name:t,path:o})=>{let r=e(i,o);p[t]=`file:${r}`,c.debug(` ${t} -> ${r}`)}),o(p),c.success(`Linked ${s.length} SDK packages`),c.info("\nNext steps:\n pnpm install --config.optimistic-repeat-install=false\n phoenix dev")}catch(e){throw c.error(`Failed to link SDK packages: ${e instanceof Error?e.message:String(e)}. The SDK path must contain a packages/libs directory. Use --sdk-path flag to specify correct SDK location.`,e),e}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile as t,writeFile as
|
|
1
|
+
import{readFile as t,writeFile as o}from"fs/promises";import{globby as e}from"globby";import{resolve as r}from"path";import*as i from"prettier";import{prettierrc as a}from"@salsita-ai/common/prettier";let n=["**/node_modules/**","**/dist/**","**/.git/**","**/.phoenix/**","**/locales/*/*.ts","pnpm-lock.yaml","pnpm-workspace.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock",".yarnrc.yml","bun.lock","bun.lockb",".linguirc"];export const formatFiles=async(l,f)=>{let{logger:c}=f,s=await e("."===l?"**/*":l,{gitignore:!0,ignore:n}),m=0;for(let e of s)try{let n=r(e),l=await t(n,"utf-8"),f=await i.resolveConfig(n)??a;if((await i.getFileInfo(n)).ignored)continue;let c=await i.format(l,{...f,filepath:n});c!==l&&(await o(n,c,"utf-8"),m++)}catch(t){}m>0&&c.info(`Formatted ${m} file${1!==m?"s":""}`)};export const checkFiles=async(o,l)=>{let{logger:f}=l,c=await e("."===o?"**/*":o,{gitignore:!0,ignore:n}),s=[];for(let o of c)try{let e=r(o),n=await t(e,"utf-8"),l=await i.resolveConfig(e)??a;if((await i.getFileInfo(e)).ignored)continue;await i.check(n,{...l,filepath:e})||s.push(o)}catch(t){}return!(s.length>0)||(f.error(`Found ${s.length} unformatted file${1!==s.length?"s":""}:`),s.forEach(t=>{console.error(` - ${t}`)}),!1)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{generateProjectFiles as e}from"../application-spec/index.js";export const runSyncCommand=async(s,c)=>{let{logger:i}=c,{sdkVersion:r,projectSlug:t,environmentSlug:n,cliUseWorkspace:o,enableEditor:l,force:p=!1,analyze:a=!1}=s;try{i.step("Syncing Phoenix project files"),i.step("Building project files"),await e({sdkVersion:r,projectSlug:t,environmentSlug:n,cliUseWorkspace:o,enableEditor:l,inlineTemplates:!0,force:p,analyze:a},c),i.success("Project files built successfully"),i.success("Sync completed successfully!")}catch(e){i.error(`Sync failed: ${e instanceof Error?e.message:String(e)}`,e),process.exit(1)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{assertPnpmProject as n,getLocalOverrides as e,removeWorkspaceOverrides as r}from"../utils/index.js";export const runUnlinkCommand=async o=>{let{logger:i}=o;try{n({projectRoot:process.cwd(),command:"unlink"})}catch(n){throw i.error(n instanceof Error?n.message:String(n)),n}try{i.step("Unlinking local SDK packages");let n=e();if(0===n.length)return void i.info("No linked SDK packages found");i.debug(`Found ${n.length} linked packages`),n.forEach(n=>{i.debug(` Unlinked ${n}`)}),r(n),i.success(`Unlinked ${n.length} SDK packages`),i.info("\nNext steps:\n pnpm install --config.optimistic-repeat-install=false\n phoenix dev")}catch(n){throw i.error(`Failed to unlink SDK packages: ${n instanceof Error?n.message:String(n)}. pnpm-workspace.yaml may be missing or invalid. Check that an overrides section exists in pnpm-workspace.yaml.`),n}};
|
|
@@ -2,6 +2,8 @@ import { type ViteDevServer } from 'vite';
|
|
|
2
2
|
import type { Logger } from '../utils/index.js';
|
|
3
3
|
import type { PhoenixPubSub } from './phoenix-pubsub.js';
|
|
4
4
|
import type { VariantFileEdit } from './variant-file-session.js';
|
|
5
|
+
export declare const WATCH_PATTERNS: string[];
|
|
6
|
+
export declare const IGNORED_PATTERNS: string[];
|
|
5
7
|
/** Configuration for {@link ApplicationSpecProjectWatcher}. */
|
|
6
8
|
export interface ApplicationSpecProjectWatcherConfig {
|
|
7
9
|
readonly pubsub: PhoenixPubSub;
|
|
@@ -12,8 +14,6 @@ export interface ApplicationSpecProjectWatcherConfig {
|
|
|
12
14
|
readonly projectSlug: string;
|
|
13
15
|
readonly environmentSlug: string;
|
|
14
16
|
readonly cliUseWorkspace?: boolean;
|
|
15
|
-
readonly name?: string;
|
|
16
|
-
readonly description?: string;
|
|
17
17
|
readonly enableEditor: boolean;
|
|
18
18
|
readonly inlineTemplates: boolean;
|
|
19
19
|
readonly useServer: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
📝 Detected ${e}: ${t}`),this.changeSubject$.next(t)}})}setupRebuildSubscription(){let e=this.changeSubject$.pipe(
|
|
1
|
+
import{mkdirSync as e}from"fs";import{resolve as t}from"path";import i from"promise-queue";import{Subject as s,buffer as r,debounceTime as o}from"rxjs";import{createServer as n,normalizePath as l}from"vite";import{watch as h}from"#package/watch";import{ApplicationSpecBuilder as a}from"../application-spec/application-spec-builder.js";import{logDiagnostics as c}from"../application-spec/metrics/index.js";import{syncTemplateFiles as u}from"../application-spec/template-files.js";import{buildWebhooks as p}from"../webhooks/index.js";import{getViteDevConfig as g}from"./vite-config.js";export const WATCH_PATTERNS=["spec/**/*.{yaml,yml}","src/**/*.{ts,tsx,yaml,yml,json,html,css}","templates/*.html",".env",".env.generated",".phoenix/.env.generated"];export const IGNORED_PATTERNS=["src/locales/**/*.{ts,tsx}",".phoenix/!(.env.generated)/**"];export class ApplicationSpecProjectWatcher{watcher=null;subscription=null;rebuildQueue=new i(1,1/0);changeSubject$=new s;viteServer=null;pubsub;logger;onRebuilt;onViteServerChange;builder;useServer;isShuttingDown=!1;suspended=!1;heldChanges=new Set;constructor(e){this.pubsub=e.pubsub,this.logger=e.logger,this.onRebuilt=e.onRebuilt,this.onViteServerChange=e.onViteServerChange,this.builder=new a({logger:e.logger,sdkVersion:e.sdkVersion,projectSlug:e.projectSlug,environmentSlug:e.environmentSlug,cliUseWorkspace:e.cliUseWorkspace,enableEditor:e.enableEditor,inlineTemplates:e.inlineTemplates}),this.useServer=e.useServer}start(e){this.viteServer=e,this.setupFileWatcher(),this.setupRebuildSubscription()}applyVariantFiles(e){this.rebuildQueue.add(async()=>{this.isShuttingDown||await this.rebuild(new Set(e.map(e=>e.fileName)),!1,!0)})}suspend(){this.suspended=!0}resume(){for(let e of(this.suspended=!1,this.heldChanges))this.changeSubject$.next(e);this.heldChanges.clear()}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){e(t(process.cwd(),"src"),{recursive:!0}),this.watcher=h(WATCH_PATTERNS,{ignored:IGNORED_PATTERNS,cwd:process.cwd(),persistent:!0,ignoreInitial:!1}),this.watcher.on("all",(e,t)=>{if("change"===e||"add"===e||"unlink"===e){if(this.suspended)return void this.heldChanges.add(t);this.logger.info(`
|
|
2
|
+
📝 Detected ${e}: ${t}`),this.changeSubject$.next(t)}})}setupRebuildSubscription(){let e=this.changeSubject$.pipe(o(10));this.subscription=this.changeSubject$.pipe(r(e)).subscribe(e=>{let t=new Set(e),i=t.has(".env");this.rebuildQueue.add(async()=>{this.isShuttingDown||(this.logger.info(`
|
|
3
3
|
🔨 Rebuilding spec files...
|
|
4
|
-
`),await this.rebuild(t,i,!1))})})}async rebuild(
|
|
4
|
+
`),await this.rebuild(t,i,!1))})})}async rebuild(e,i,s){try{let r=this.viteServer;if(!r)throw Error("Cannot rebuild the project: the watcher has no Vite server yet, because it was not started. Start the watcher before applying files");let o=await u();if(this.isShuttingDown)return;let h=await this.builder.build({compile:!s});if(this.isShuttingDown)return;if(c(h.diagnostics,this.logger),!h.ok){for(let e of h.errors)this.logger.error(`[${e.code}] ${e.message}${e.file?` (${e.file})`:""}`);this.pubsub.specFile$.next({rawProjectFiles:h.rawProjectFiles,projectRoot:process.cwd()});return}this.onRebuilt?.();let{application:a,changedFiles:d}=h,w=r.moduleGraph,b=Date.now(),f=new Set,S=process.cwd(),m=e=>{let t=w.getModulesByFile(l(e));if(t)for(let e of t)w.invalidateModule(e,f,b,!0)};for(let i of e)m(t(S,i));for(let e of d)m(t(S,`.phoenix/${e.path}`));if(this.pubsub.specFile$.next({rawProjectFiles:a.rawProjectFiles,projectRoot:process.cwd(),configurationSchemaHash:a.applicationSpec.configurator.configurationSchema.hash}),this.isShuttingDown)return;if(i){if(await r.close(),this.isShuttingDown)return;let e=await g({templateFiles:o});if(this.isShuttingDown)return;let t=await n(e);if(this.isShuttingDown||(await t.listen(),this.isShuttingDown))return void await t.close();this.viteServer=t,this.onViteServerChange?.(t),this.logger.success("Vite server restarted (env changed)")}if(this.useServer&&!s){if(this.logger.step("Building webhooks"),await p({experimental:!0,skipNodeEnvOverride:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js",preserveExistingOutput:!0}),this.isShuttingDown)return;this.logger.success("Webhooks rebuilt successfully")}this.logger.success("Project files rebuilt successfully")}catch(e){this.logger.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e)}}}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { type Logger } from '../utils/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The project's Lingui configuration, which sync generates, relative to the project root. The Lingui
|
|
4
|
+
* CLI, the Lingui Vite plugin and the Lingui macros in the Vite builds are always given this path, so a
|
|
5
|
+
* `.linguirc` that earlier SDK versions left in the project root is not read. Lingui searches the
|
|
6
|
+
* working directory instead only when the named file is missing; generation writes it with the rest of
|
|
7
|
+
* `.phoenix/` before Phoenix runs Lingui or Vite.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LINGUI_CONFIG_PATH = ".phoenix/.linguirc";
|
|
2
10
|
interface LinguiCommandContext {
|
|
3
11
|
readonly logger: Logger;
|
|
4
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{runSdkTool as i}from"../utils/index.js";export const LINGUI_CONFIG_PATH=".phoenix/.linguirc";let n=async n=>{await i({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["extract","--config",LINGUI_CONFIG_PATH],description:"Extracting i18n messages",quiet:!0,extraEnv:{LC_ALL:"en_US.UTF-8"}},n)};export const compileLingui=async n=>{await i({tool:{packageName:"@lingui/cli",binName:"lingui"},args:["compile","--config",LINGUI_CONFIG_PATH],description:"Compiling i18n messages",quiet:!0},n)};export const extractAndCompileLingui=async i=>{await n(i),await compileLingui(i)};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{transform as e}from"@swc/core";import{remove as t}from"fs-extra";import{copyFile as s,mkdir as o,readFile as a,writeFile as
|
|
1
|
+
import{transform as e}from"@swc/core";import{remove as t}from"fs-extra";import{copyFile as s,mkdir as o,readFile as a,writeFile as r}from"fs/promises";import{globby as i}from"globby";import{createRequire as c}from"node:module";import{dirname as l,relative as n,resolve as p}from"path";import{Subject as m}from"rxjs";import{watch as w}from"#package/watch";import{createLogger as d}from"../utils/index.js";let u=()=>({sourceMaps:!0,module:{type:"es6"},jsc:{target:"es2022",parser:{syntax:"typescript",tsx:!0},transform:{react:{runtime:"automatic"}},keepClassNames:!0,experimental:{plugins:[[c(import.meta.url).resolve("@lingui/swc-plugin"),{}]]}}}),f=async(e,t,a)=>{let r=process.cwd(),c=p(r,e),m=p(r,t),w=await i(["**/*.{html,css,json,txt,md}","**/.env*"],{cwd:c,ignore:["**/*.{spec,test}.{html,css,json,txt,md}","**/__tests__/**","**/__mocks__/**","**/tsconfig.json",".env.generated"],absolute:!1}),d=0,u=0;for(let e of w)try{let t=p(c,e),a=p(m,e);await o(l(a),{recursive:!0}),await s(t,a),d++}catch(t){u++,console.error(`Failed to copy ${n(r,p(c,e))}:`,t)}if(u>0)throw Error(`Failed to copy ${u} file(s)`);d>0&&a.debug(`Copied ${d} non-compilable file(s)`)};export const compileWithSwc=async(s,c)=>{let{sourceDir:m="src",outDir:w="./node_modules/.phoenix"}=s??{},g=c?.logger??d(),h=process.cwd(),x=p(h,m),_=p(h,w);await t(_);let y=await i(["**/*.{ts,tsx}"],{cwd:x,ignore:["**/*.{spec,test}.{ts,tsx}","**/__tests__/**","**/__mocks__/**"],absolute:!1}),b=u(),$=0,j=0;for(let t of y)try{let s=p(x,t),i=p(_,t.replace(/\.tsx?$/,".js")),c=await a(s,"utf-8"),n=await e(c,{...b,filename:s,sourceMaps:!0,outputPath:i});await o(l(i),{recursive:!0}),await r(i,n.code,"utf-8"),n.map&&await r(`${i}.map`,n.map,"utf-8"),$++}catch(e){j++,console.error(`Failed to compile ${n(h,p(x,t))}:`,e)}if(j>0)throw Error(`Failed to compile ${j} file(s)`);g.isDebug&&g.debug(`Compiled ${$} file(s) with swc`),await f(m,w,g)};let g=async(t,s,i)=>{let c=process.cwd(),n=p(c,s),m=p(c,i),w=u(),d=p(n,t),f=p(m,t.replace(/\.tsx?$/,".js")),g=await a(d,"utf-8"),h=await e(g,{...w,filename:d,sourceMaps:!0,outputPath:f});await o(l(f),{recursive:!0}),await r(f,h.code,"utf-8"),h.map&&await r(`${f}.map`,h.map,"utf-8")},h=async(e,t,a)=>{let r=process.cwd(),i=p(r,t),c=p(r,a),n=p(i,e),m=p(c,e);await o(l(m),{recursive:!0}),await s(n,m)};export const watchWithSwc=async(e,t)=>{let{sourceDir:s="src",outDir:o="./node_modules/.phoenix"}=e??{},a=t?.logger??d(),r=p(process.cwd(),s);a.isDebug&&a.step("Running initial SWC compilation"),await compileWithSwc({sourceDir:s,outDir:o},t),a.isDebug&&a.success("Initial compilation complete");let i=new m,c=w(["**/*.{ts,tsx,html,css,json,txt,md}","../.env*"],{cwd:r,ignored:["**/*.{spec,test}.{ts,tsx}","**/__tests__/**","**/cache.json"],persistent:!0,ignoreInitial:!0});return c.on("all",(e,t)=>{("change"===e||"add"===e)&&i.next({file:t,type:e})}),i.subscribe(async({file:e})=>{let t=n(r,p(r,e));try{e.match(/\.tsx?$/)?(await g(t,s,o),a.fileChanged(t)):(e.match(/\.(html|css|json|txt|md)$/)||e.match(/\.env/))&&(await h(t,s,o),a.fileChanged(t))}catch(e){a.error(`Failed to process ${t}`),a.isDebug&&console.error(e)}}),a.isDebug&&console.log(`
|
|
2
2
|
👀 Watching ${s} for changes...
|
|
3
3
|
`),{stop:async()=>{await c.close(),a.isDebug&&a.info("SWC watcher stopped")}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getConfig as e}from"@lingui/conf";import{lingui as i}from"@lingui/vite-plugin";import t from"@vitejs/plugin-react";import{mkdir as n,readFile as r,writeFile as o}from"fs/promises";import a from"lodash-es/camelCase.js";import{createRequire as s}from"node:module";import{dirname as l,resolve as m}from"path";import{createLogger as f}from"vite";import p from"vite-plugin-css-injected-by-js";import{isUsingLocalSdk as d}from"../utils/package-info.js";import{loadFrontendConfigModule as c}from"./frontend-config.js";import{LINGUI_CONFIG_PATH as g}from"./lingui.js";import{phxBannerPlugin as u}from"./phx-banner-plugin.js";import{phxCspNoncePlugin as h}from"./phx-csp-nonce-plugin.js";import{phxGlobalIsolationPlugin as b}from"./phx-global-isolation-plugin.js";import{phxLicensesPlugin as S}from"./phx-licenses-plugin.js";import{phxVariantPreviewsPlugin as y}from"./phx-variant-previews-plugin.js";let O=null;export const setViteLogSink=(e,i={})=>{O={sink:e,echo:i.echo??!1}};let x=["react","react-dom","three","@react-three/fiber","@react-three/drei","@react-three/postprocessing","its-fine","@emotion/react","@emotion/styled","@mui/material","@mui/system","@tanstack/react-query","rxjs"],D=()=>[s(import.meta.url).resolve("@lingui/babel-plugin-lingui-macro"),{linguiConfig:e({configPath:g})}],E=e=>{let i=e.DEPLOYMENT_ID;if("string"!=typeof i)throw Error("DEPLOYMENT_ID is required in runtime config");return i};export const getViteDevConfig=async e=>{var n,r;let o,a,p=d(),u=c(),h=u.readRuntimeConfig(),S=u.frontendBuildConfig,v=D(),j=Object.fromEntries((e?.templateFiles??[]).map(e=>[e,`.phoenix/${e}`]));return{...O&&{customLogger:(n=O.sink,r=O.echo,o=f(),{get hasWarned(){return o.hasWarned},info:(e,i)=>{n("info",e),r&&o.info(e,i)},warn:(e,i)=>{n("warn",e),r&&o.warn(e,i)},warnOnce:(e,i)=>{n("warn",e),r&&o.warnOnce(e,i)},error:(e,i)=>{n("error",e),r&&o.error(e,i)},clearScreen:e=>{r&&o.clearScreen(e)},hasErrorLogged:e=>o.hasErrorLogged(e)}),...O.echo?{}:{clearScreen:!1}},mode:"development",optimizeDeps:{exclude:["@swc/wasm-web"],...p&&{entries:["index.html","admin.html",...e?.templateFiles??[]],force:!0}},...p&&{resolve:{alias:(a=s(m(process.cwd(),"package.json")),x.flatMap(e=>{try{let i=l(a.resolve(`${e}/package.json`));return[{find:RegExp(`^${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(/|$)`),replacement:`${i}$1`}]}catch{return[]}}))}},plugins:[t({babel:{plugins:[v]}}),i({configPath:g}),{name:"vite:runtime-config",apply:(e,i)=>"build"===i.command||"development"===i.mode,config:e=>{let i=u.readRuntimeConfig(),t=u.frontendBuildConfig;return{...e,define:{...e.define,"phx.frontendEnv":JSON.stringify(i),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(t.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(t.gltfDecoder)}}}},b({getDeploymentId:()=>E(u.readRuntimeConfig())}),y()],define:{"process.env":{},"import.meta.env.DEV":!0,"import.meta.env.PROD":!1,"phx.frontendEnv":JSON.stringify(h),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(S.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(S.gltfDecoder)},build:{rollupOptions:{input:{index:".phoenix/index.html",admin:".phoenix/admin.html",...j}}},root:m(process.cwd(),"./.phoenix"),server:{watch:{ignored:["./**/*.{ts,tsx}","./.swc/**","../spec/**","../src/**"]}}}};export const getViteBuildConfigs=async e=>{let s=c(),f=s.readRuntimeConfig(),d=s.frontendBuildConfig,y=D(),O=S(),x=u({sdkVersion:e.sdkVersion,banner:e.banner}),v=[{name:"salsita-configurator",entryFile:"./configurator.ts",mainScriptPath:"./configurator.ts",htmlFiles:["./index.html",...{templateFiles:e.templateFiles}.templateFiles],main:!0,format:"iife"},{name:"salsita-admin",entryFile:"./admin.ts",mainScriptPath:"./admin.ts",htmlFiles:["./admin.html"],main:!1,format:"iife"},{name:"salsita-embedded-admin",entryFile:"./embedded-admin.ts",mainScriptPath:"./embedded-admin.ts",htmlFiles:[],main:!1,format:"es"},{name:"salsita-embedded-configurator",entryFile:"./embedded-configurator.ts",mainScriptPath:"./embedded-configurator.ts",htmlFiles:[],main:!1,format:"es"}].map(c=>({plugins:[t({babel:{plugins:[y]}}),i({configPath:g}),p({useStrictCSP:!0}),h(),b({getDeploymentId:()=>E(s.readRuntimeConfig())}),{name:"vite:lib-index",writeBundle:async()=>{if(!c.htmlFiles.length)return;let i="iife"===c.format?`${c.name}.iife.js`:`${c.name}.js`;for(let t of c.htmlFiles){if(c.main&&e.enableEditor&&"./index.html"===t)continue;let a=m("./.phoenix",t),s=m("./.phoenix/dist/frontend",t);await n(l(s),{recursive:!0});let f=(await r(a,"utf-8")).replace(c.mainScriptPath,i);await o(s,f,"utf-8")}}},O,x],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,lib:{entry:c.entryFile,name:a(c.name),formats:[c.format],fileName:()=>"iife"===c.format?`${c.name}.iife.js`:`${c.name}.js`},rollupOptions:{external:[],output:{assetFileNames:`${c.name}.[ext]`}},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(d.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(d.gltfDecoder)}}));return e.enableEditor?[...v,{plugins:[t({babel:{plugins:[y]}}),i({configPath:g}),p({useStrictCSP:!0}),h(),O,x],build:{outDir:"./dist/frontend",chunkSizeWarningLimit:4e3,rollupOptions:{external:[]},minify:!0,emptyOutDir:!1},root:m(process.cwd(),"./.phoenix"),define:{"process.env":{},"process.env.NODE_ENV":JSON.stringify("production"),"phx.frontendEnv":JSON.stringify(f),"globalThis.PHX_SCHEMA_VALIDATOR":JSON.stringify(d.jsonSchemaValidator),"globalThis.PHX_GLTF_DECODER":JSON.stringify(d.gltfDecoder)}}]:v};
|
|
@@ -6,8 +6,10 @@ export { createDirectoryFromYaml, exists, scanFolderForFiles, syncChangedFiles,
|
|
|
6
6
|
export { FileLogger } from './file-logger.js';
|
|
7
7
|
export { isInsideGitRepository } from './git/index.js';
|
|
8
8
|
export { type Logger, type CreateLoggerOptions, createLogger } from './logger.js';
|
|
9
|
-
export { addWorkspaceOverrides,
|
|
9
|
+
export { addWorkspaceOverrides, getLocalOverrides, getSdkPackages, getWorkspaceDir, hasLocalOverrides, readPackageJson, removeWorkspaceOverrides, } from './package-info.js';
|
|
10
|
+
export { naturalCompare } from './natural-compare.js';
|
|
11
|
+
export { type PackageManagerCommands, assertPnpmProject, findPackageManagerCommands } from './package-manager/index.js';
|
|
10
12
|
export { toPascalCase } from './pascal-case.js';
|
|
11
13
|
export { readGitCommit } from './read-git-commit.js';
|
|
12
|
-
export { type RunCommandProps, runCommand } from './run-command.js';
|
|
14
|
+
export { type RunCommandProps, type RunSdkToolProps, runCommand, runSdkTool } from './run-command.js';
|
|
13
15
|
export { type FileUploadInfo, type UploadLinksData, uploadFilesWithPresignedUrls, readUploadLinks, } from './upload-utils.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{isInsideGitRepository}from"./git/index.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,
|
|
1
|
+
export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{isInsideGitRepository}from"./git/index.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,getLocalOverrides,getSdkPackages,getWorkspaceDir,hasLocalOverrides,readPackageJson,removeWorkspaceOverrides}from"./package-info.js";export{naturalCompare}from"./natural-compare.js";export{assertPnpmProject,findPackageManagerCommands}from"./package-manager/index.js";export{toPascalCase}from"./pascal-case.js";export{readGitCommit}from"./read-git-commit.js";export{runCommand,runSdkTool}from"./run-command.js";export{uploadFilesWithPresignedUrls,readUploadLinks}from"./upload-utils.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { assertSupportedNodeVersion, findUnsupportedNodeVersionMessage } from './supported-node-version.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{assertSupportedNodeVersion,findUnsupportedNodeVersionMessage}from"./supported-node-version.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Explains why the SDK cannot run on the given Node.js version, or returns `undefined` when the version satisfies the
|
|
3
|
+
* SDK's `engines.node` range.
|
|
4
|
+
*/
|
|
5
|
+
export declare const findUnsupportedNodeVersionMessage: (version: string) => string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Stops the process with a non-zero exit code when the running Node.js does not satisfy the SDK's `engines.node`
|
|
8
|
+
* range. The `phoenix` binary's entry module (`bin.ts`) calls it and only then loads `cli.ts` with a dynamic import:
|
|
9
|
+
* static imports are evaluated before the importing module's body, so on an older Node.js the CLI's own imports could
|
|
10
|
+
* fail with an unrelated error before a check in its body ran.
|
|
11
|
+
*/
|
|
12
|
+
export declare const assertSupportedNodeVersion: () => void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{readFileSync as e}from"node:fs";import{satisfies as o}from"semver";import{z as s}from"zod";let r=s.object({name:s.string(),engines:s.object({node:s.string()})});export const findUnsupportedNodeVersionMessage=s=>{let{name:t,engines:n}=r.parse(JSON.parse(e(new URL("../../../../package.json",import.meta.url),"utf-8")));if(!o(s,n.node,{includePrerelease:!0}))return`${t} requires Node.js ${n.node}, but this is Node.js ${s}.
|
|
2
|
+
The SDK and the tools it runs use Node.js features that older versions do not have, so a command would fail part way through.
|
|
3
|
+
Switch to a Node.js version that satisfies ${n.node} and run the command again.`};export const assertSupportedNodeVersion=()=>{let e=findUnsupportedNodeVersionMessage(process.version);void 0!==e&&(process.stderr.write(`${e}
|
|
4
|
+
`),process.exit(1))};
|
|
@@ -10,15 +10,6 @@ export declare const readPackageJson: (path?: string) => PackageJson;
|
|
|
10
10
|
export declare const getWorkspaceDir: () => string;
|
|
11
11
|
export declare const addWorkspaceOverrides: (entries: Record<string, string>) => void;
|
|
12
12
|
export declare const removeWorkspaceOverrides: (names: readonly string[]) => void;
|
|
13
|
-
/**
|
|
14
|
-
* Makes a standalone project installable with pnpm 11: its `pnpm-workspace.yaml` decides the build scripts of the
|
|
15
|
-
* SDK's dependencies and exempts the SDK's own packages from the minimum release age. Only missing answers are
|
|
16
|
-
* added, so a value the project set stays, and the file travels with a deploy so the server-side install follows it.
|
|
17
|
-
*
|
|
18
|
-
* A project inside a monorepo is left alone: the workspace root owns these settings, and a file in the project
|
|
19
|
-
* folder would turn it into a workspace root of its own.
|
|
20
|
-
*/
|
|
21
|
-
export declare const ensureWorkspaceInstallSettings: (projectRoot: string) => void;
|
|
22
13
|
export declare const hasLocalOverrides: () => boolean;
|
|
23
14
|
export declare const getLocalOverrides: () => string[];
|
|
24
15
|
export declare const hasLocalSymlinks: () => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as e,lstatSync as t,readFileSync as r,readdirSync as s,writeFileSync as o}from"fs";import{dirname as a,join as i,resolve as
|
|
1
|
+
import{existsSync as e,lstatSync as t,readFileSync as r,readdirSync as s,writeFileSync as o}from"fs";import{dirname as a,join as i,resolve as n}from"path";import{isMap as c,parse as l,parseDocument as p}from"yaml";let m="pnpm-workspace.yaml",d="@salsita-ai/";export const readPackageJson=(t=".")=>{let s=n(t,"package.json");if(!e(s))throw Error(`package.json not found at ${s}`);return JSON.parse(r(s,"utf8"))};let f=(t=process.cwd())=>{let r=n(t);for(;;){let t=i(r,m);if(e(t))return t;let s=a(r);if(s===r)return;r=s}},k=()=>f()??i(process.cwd(),m),h=()=>{try{let e=f();if(!e)return{};let t=l(r(e,"utf8"));return t?.overrides??{}}catch{return{}}};export const getWorkspaceDir=()=>a(k());export const addWorkspaceOverrides=t=>{let s=k(),a=p(e(s)?r(s,"utf8"):"");Object.entries(t).forEach(([e,t])=>{a.setIn(["overrides",e],t)}),a.setIn(["optimisticRepeatInstall"],!1),o(s,a.toString())};export const removeWorkspaceOverrides=e=>{let t=f();if(!t)return;let s=p(r(t,"utf8"));e.forEach(e=>{s.deleteIn(["overrides",e])});let a=s.getIn(["overrides"]);c(a)&&0===a.items.length&&s.delete("overrides"),s.delete("optimisticRepeatInstall"),o(t,s.toString())};export const hasLocalOverrides=()=>Object.keys(h()).some(e=>e.startsWith(d));export const getLocalOverrides=()=>Object.keys(h()).filter(e=>e.startsWith(d));let u=["@salsita-ai/common","@salsita-ai/contracts","@salsita-ai/sdk"];export const hasLocalSymlinks=()=>u.some(e=>{let r=n("node_modules",e);try{return t(r).isSymbolicLink()}catch{return!1}});export const isUsingLocalSdk=()=>hasLocalOverrides()||hasLocalSymlinks();export const getSdkPackages=t=>{let r=n(t,"packages/libs");if(!e(r))throw Error(`SDK libs directory not found at ${r}`);return s(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).map(e=>{let t=i(r,e),s=readPackageJson(t);if(!s.name)throw Error(`Package at ${t} has no name in package.json`);return{name:s.name,path:t}})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{findPackageManagerCommands}from"./package-manager-commands.js";export{assertPnpmProject}from"./pnpm-project.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commands of a package manager the CLI names in the next steps it prints, so a developer can copy the one for
|
|
3
|
+
* the package manager they use. Phoenix works with any package manager; these only phrase the hints.
|
|
4
|
+
*/
|
|
5
|
+
export interface PackageManagerCommands {
|
|
6
|
+
/** Installs the project's dependencies, such as `npm install`. */
|
|
7
|
+
readonly install: string;
|
|
8
|
+
/** Adds a package to the project's dependencies, such as `npm install @salsita-ai/sdk`. */
|
|
9
|
+
readonly add: (packageName: string) => string;
|
|
10
|
+
/** Runs a `phoenix` command from the project's install, such as `npx phoenix sync`. */
|
|
11
|
+
readonly phoenix: (args: string) => string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The commands of the package manager that started the CLI, read from the `npm_config_user_agent` value npm, pnpm,
|
|
15
|
+
* Yarn and Bun set for the binaries they run (`pnpm/11.1.3 npm/? node/v22.13.0 linux x64`). `undefined` when the CLI
|
|
16
|
+
* was started some other way, such as straight from `node_modules/.bin`, or by a package manager it does not know;
|
|
17
|
+
* the hint then names no package manager.
|
|
18
|
+
*/
|
|
19
|
+
export declare const findPackageManagerCommands: (userAgent: string | undefined) => PackageManagerCommands | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let n=new Map([["pnpm",{install:"pnpm install",add:n=>`pnpm add ${n}`,phoenix:n=>`pnpm phoenix ${n}`}],["npm",{install:"npm install",add:n=>`npm install ${n}`,phoenix:n=>`npx phoenix ${n}`}],["yarn",{install:"yarn install",add:n=>`yarn add ${n}`,phoenix:n=>`yarn phoenix ${n}`}],["bun",{install:"bun install",add:n=>`bun add ${n}`,phoenix:n=>`bunx phoenix ${n}`}]]);export const findPackageManagerCommands=a=>{let p=a?.split("/")[0]?.trim();return void 0===p?void 0:n.get(p)};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stops a pnpm-only command in a project that clearly installs with another package manager: one with another
|
|
3
|
+
* package manager's lockfile and no `pnpm-lock.yaml`. A project without any lockfile is let through, as it has not
|
|
4
|
+
* installed yet. Only the project folder is looked at.
|
|
5
|
+
*/
|
|
6
|
+
export declare const assertPnpmProject: (props: {
|
|
7
|
+
readonly projectRoot: string;
|
|
8
|
+
readonly command: string;
|
|
9
|
+
}) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as o}from"fs";import{join as t}from"path";let n=["package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"];export const assertPnpmProject=r=>{if(o(t(r.projectRoot,"pnpm-lock.yaml")))return;let a=n.find(n=>o(t(r.projectRoot,n)));if(void 0!==a)throw Error(`phoenix ${r.command} works with pnpm only, and this project installs with another package manager: it has ${a} and no pnpm-lock.yaml. It is an internal tool for linking a local SDK checkout through the overrides in pnpm-workspace.yaml. Use it in a project that installs with pnpm.`)};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Logger } from './logger.js';
|
|
2
|
+
import { type SdkTool } from './sdk-tool/index.js';
|
|
2
3
|
export interface RunCommandProps {
|
|
3
4
|
readonly command: string;
|
|
4
5
|
readonly args: readonly string[];
|
|
@@ -7,6 +8,16 @@ export interface RunCommandProps {
|
|
|
7
8
|
readonly cwd?: string;
|
|
8
9
|
readonly extraEnv?: Record<string, string>;
|
|
9
10
|
}
|
|
11
|
+
export interface RunSdkToolProps extends Omit<RunCommandProps, 'command'> {
|
|
12
|
+
readonly tool: SdkTool;
|
|
13
|
+
}
|
|
10
14
|
export declare const runCommand: (props: RunCommandProps, context?: {
|
|
11
15
|
readonly logger: Logger;
|
|
12
16
|
}) => Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Runs a tool from the SDK's own installation with the Node.js that runs the CLI. It starts no shell, so paths
|
|
19
|
+
* with spaces reach the tool unchanged.
|
|
20
|
+
*/
|
|
21
|
+
export declare const runSdkTool: (props: RunSdkToolProps, context?: {
|
|
22
|
+
readonly logger: Logger;
|
|
23
|
+
}) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{spawn as e}from"node:child_process";import{createLogger as r}from"./logger.js";
|
|
1
|
+
import{spawn as e}from"node:child_process";import{createLogger as r}from"./logger.js";import{resolveSdkToolBin as o}from"./sdk-tool/index.js";let t=async(o,t)=>{let s=t?.logger??r(),{command:n,file:i,shell:a,startFailureHint:l,args:c,description:d,quiet:m=!1,cwd:u,extraEnv:f}=o;m?s.isDebug&&s.debug(`Running: ${n} ${c.join(" ")}`):s.step(d);let g=s.isDebug?"inherit":m?"pipe":"inherit";await new Promise((r,o)=>{let t=e(i,c,{stdio:g,shell:a,cwd:u,env:f?{...process.env,...f}:void 0}),m=[],p=[],h=!1;t.stdout?.on("data",e=>m.push(Buffer.from(e))),t.stderr?.on("data",e=>p.push(Buffer.from(e))),t.once("error",e=>{h=!0,s.error(`${d} failed to execute`),s.error(`Error: ${e.message}`),o(Error(`Failed to execute command '${n}': ${e.message}. ${l}`))}),t.once("close",(e,t)=>{if(!h){if(0!==e){let r=null!==e?`exit code ${e}`:"unknown error (process was terminated or failed to start)";s.error(`${d} failed with ${r}`),t&&s.error(`Process was killed with signal: ${t}`),m.length>0&&console.error(Buffer.concat(m).toString()),p.length>0&&console.error(Buffer.concat(p).toString()),o(Error(`${d} failed with ${r}`));return}r()}})}),(!m||s.isDebug)&&s.success(`${d} completed`)};export const runCommand=async(e,r)=>{await t({...e,file:e.command,shell:!0,startFailureHint:"Ensure the command is installed and available in PATH."},r)};export const runSdkTool=async(e,r)=>{let{tool:s,args:n,...i}=e;await t({...i,command:s.binName,file:process.execPath,args:[o(s),...n],shell:!1,startFailureHint:"Ensure Node.js can start this process."},r)};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { type SdkTool, resolveSdkToolBin } from './resolve-sdk-tool-bin.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{resolveSdkToolBin}from"./resolve-sdk-tool-bin.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A command-line tool the CLI runs, such as `tsc` for `phoenix check`. The SDK installs every such tool as one of
|
|
3
|
+
* its own `dependencies` and runs that copy, so the versions a project installs do not decide them.
|
|
4
|
+
*/
|
|
5
|
+
export interface SdkTool {
|
|
6
|
+
/** The name the SDK's `package.json` lists the package under, the alias where the SDK installs it under one */
|
|
7
|
+
readonly packageName: string;
|
|
8
|
+
/** The name of the binary in the package's `bin` field */
|
|
9
|
+
readonly binName: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Returns the absolute path of a tool's binary in the SDK's own installation. It never looks at `PATH` or the
|
|
13
|
+
* project's `node_modules`, so the CLI runs the same tool in every project.
|
|
14
|
+
*/
|
|
15
|
+
export declare const resolveSdkToolBin: (tool: SdkTool) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{existsSync as e,readFileSync as o}from"node:fs";import{createRequire as t}from"node:module";import{join as n,resolve as i}from"node:path";import{z as a}from"zod";let r=a.object({name:a.string(),bin:a.union([a.string(),a.record(a.string())]).optional()}),s=t(import.meta.url);export const resolveSdkToolBin=t=>{var a,p;let d=(o=>{let t=(s.resolve.paths(o)??[]).map(e=>n(e,o)).find(o=>e(n(o,"package.json")));if(void 0===t)throw Error(`Cannot find the package '${o}' in the installation of @salsita-ai/sdk. The SDK runs its own copy of it, so it is one of the SDK's dependencies. Reinstall the project's dependencies.`);return t})(t.packageName),l=(a=r.parse(JSON.parse(o(n(d,"package.json"),"utf-8"))),p=t.binName,"string"==typeof a.bin?a.name.replace(/^@[^/]+\//,"")===p?a.bin:void 0:a.bin?.[p]);if(void 0===l)throw Error(`The package '${t.packageName}' in the installation of @salsita-ai/sdk has no binary '${t.binName}'. The SDK expects it there to run it. Reinstall the project's dependencies.`);return i(d,l)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./analytics-service.js";export*from"./domain-controls-analytics.js";
|
|
1
|
+
export*from"./analytics-service.js";export*from"./domain-controls-analytics.js";export*from"./frontend-analytics.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useEffect as n,useRef as a}from"react";import{useApplicationRuntime as r,useApplicationRuntimeSelector as o,useLogger as s}from"../application-runtime/index.js";import{ConfigurationPersistSystemFailureHandler as d}from"./ConfigurationPersistSystemFailureHandler.js";import{IsUndoableRegistration as
|
|
1
|
+
import{jsx as i,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useEffect as n,useRef as a}from"react";import{useApplicationRuntime as r,useApplicationRuntimeSelector as o,useLogger as s}from"../application-runtime/index.js";import{ConfigurationPersistSystemFailureHandler as d}from"./ConfigurationPersistSystemFailureHandler.js";import{IsUndoableRegistration as m}from"./IsUndoableHandler.js";export const DomainLifecycleBoundary=l=>{let u,c,f,g,p,y,h,{children:b,type:x}=l,j=(f=(c=(u=r()).selectors.domainContext[x]).getDomainContext(),g=s(),p=o(c.getInitializationState),y=o(c.getSchemaCoherence),h=a(null),n(()=>{"schema-mismatch"===y&&g.debug("Loaded domain data belongs to a different schema identity, so initialization is paused."),"missing-stamp"===y&&g.debug("Loaded domain data has no schema identity, so initialization is paused.")},[g,y]),n(()=>{if(null===p.identity)return;if(h.current!==p.identity){let i=c.getInitializationState().identity;null!==i&&h.current!==i&&(f.initialize(),h.current=i)}let i=u.subscribe(f.reconcile);return()=>{i()}},[u,f,c,p.identity]),p);return j.isCurrent?t(e,{children:["configurator"===x&&i(m,{}),"admin"===x&&i(d,{disabled:j.isViewMode}),b]}):null};
|
|
@@ -7,6 +7,9 @@ import type { $DomainEntity, DomainEntity, EntityViolation, ViolationTypesOf$Ent
|
|
|
7
7
|
* apart. `text` is the violation's message, or its type when it has none; `entityId` names the entity.
|
|
8
8
|
* - `sideEffect`: a committed change carried a hint, for example from a transformer that adjusted another field.
|
|
9
9
|
* - `error`: an error was thrown while the changed state was validated; `text` is a generic message for the user.
|
|
10
|
+
* - `saveError`: saving the configuration failed; `error` is what the save rejected with, `text` a generic message
|
|
11
|
+
* for the user. The configurator keeps saving later changes.
|
|
12
|
+
* - `saveRecovery`: a save succeeded after a `saveError`; `text` says the configuration was updated.
|
|
10
13
|
*/
|
|
11
14
|
export type ConfiguratorMessage<ENTITIES extends DomainEntity<string> = DomainEntity<string>, VIOLATION_TYPE extends string = string> = ({
|
|
12
15
|
readonly kind: 'violation';
|
|
@@ -18,13 +21,21 @@ export type ConfiguratorMessage<ENTITIES extends DomainEntity<string> = DomainEn
|
|
|
18
21
|
readonly kind: 'error';
|
|
19
22
|
readonly error: Error;
|
|
20
23
|
readonly text: string;
|
|
24
|
+
} | {
|
|
25
|
+
readonly kind: 'saveError';
|
|
26
|
+
readonly error: unknown;
|
|
27
|
+
readonly text: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly kind: 'saveRecovery';
|
|
30
|
+
readonly text: string;
|
|
21
31
|
};
|
|
22
32
|
export type UseConfiguratorMessages<ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = Record<ENTITIES['type'], $DomainEntity<ENTITIES>>> = (onMessage: (message: ConfiguratorMessage<ENTITIES, ViolationTypesOf$Entity<$MAP[ENTITIES['type']]>>) => void) => void;
|
|
23
33
|
/**
|
|
24
|
-
* Calls `onMessage` once for every violation, side-effect hint and
|
|
25
|
-
* change, the hints of a committed change
|
|
26
|
-
*
|
|
27
|
-
*
|
|
34
|
+
* Calls `onMessage` once for every violation, side-effect hint, validation error and save failure: the violations of a
|
|
35
|
+
* rejected change, the hints of a committed change, an error thrown while a change was validated, a failed save and the
|
|
36
|
+
* first successful save after it. Hints committed before the component mounted are not delivered, nor is a save that
|
|
37
|
+
* failed before it mounted; when the most recent change was rejected or threw, its messages are delivered again on
|
|
38
|
+
* mount, because the store keeps that emission. `onMessage` may be a new function on every
|
|
28
39
|
* render; the latest one is called.
|
|
29
40
|
*/
|
|
30
41
|
export declare const useConfiguratorMessages: (onMessage: (message: ConfiguratorMessage) => void) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useSubscription as e}from"observable-hooks";import{useMemo as
|
|
1
|
+
import{useSubscription as e}from"observable-hooks";import{useMemo as r}from"react";import{distinctUntilChanged as t,map as i,pairwise as o,skip as s}from"rxjs";import{useDomainApplication as a}from"../../application-runtime/index.js";import{useResolveLocalizable as n}from"../../localizable/index.js";import{useDomain as d}from"./use-domain-context.js";let m={id:"sdk.messages.validation.uncaughtError.message",message:"Oops, something went wrong"},p={id:"sdk.persist.system.error.message",message:"An error occured when trying to update a configuration"},l={id:"sdk.persist.system.error.recovered",message:"Configuration updated"};export const useConfiguratorMessages=u=>{let{storeSystem:c}=d(),{configurationPersistSystem:f}=a(),g=n(),v=r(()=>c.stateSlices.potentiallyInvalid.pipe(i(e=>e.validity)),[c]),x=r(()=>c.stateSlices.committed.pipe(s(1),t(),i(e=>"updates"in e?e.updates.flatMap(e=>e.hint?[e.hint]:[]):[])),[c]),h=r(()=>f.failure$.pipe(o()),[f]);e(v,e=>{if(!e.valid){if("uncaught"===e.severity)return void u({kind:"error",error:e.error,text:g(m)});e.entityViolations.forEach(({entityId:e,violation:r})=>{u({kind:"violation",entityId:e,violation:r,text:g(r.message??r.type)})})}}),e(x,e=>{e.forEach(e=>{u({kind:"sideEffect",text:g(e)})})}),e(h,([e,r])=>{null!==r?u({kind:"saveError",error:r.error,text:g(p)}):null!==e&&u({kind:"saveRecovery",text:g(l)})})};
|
|
@@ -8,8 +8,9 @@ export { useCommittedState, useCommittedSlice, useRenderedSlice, useRenderedStat
|
|
|
8
8
|
export { useDomainEntityState, useDomainEntityRenderedState, type UseDomainEntityState, } from './entity-hooks/use-domain-entity-state.js';
|
|
9
9
|
export { useEntityPrice, useRootEntityPrice, type UseEntityPrice, type UseRootEntityPrice, } from './entity-hooks/use-entity-price.js';
|
|
10
10
|
export { useSelectEntity, type UseSelectEntity, useSelectedEntity, type UseSelectedEntity, useSelectedEntityId, type UseSelectedEntityId, useSelectedDomainEntityId, type UseSelectedDomainEntityId, useDeselect, type UseDeselect, useSelectParent, type UseSelectParent, } from './system-hooks/selection-hooks.js';
|
|
11
|
-
export { useActiveNavigationState, type UseActiveNavigationState, useActiveViewState, type UseActiveViewState, useActiveToolState, type UseActiveToolState, useIsFullscreenActive, type UseIsFullscreenActive, useSetFullscreen, type UseSetFullscreen, useActiveViewports, type UseActiveViewports, useDraggedDomainEntityId, type UseDraggedDomainEntityId, useNavigate, type UseNavigate, usePushNavigate, type UsePushNavigate, usePopNavigate, type UsePopNavigate, } from './system-hooks/navigation-hooks.js';
|
|
11
|
+
export { useActiveNavigationState, type UseActiveNavigationState, useActiveViewState, type UseActiveViewState, useSetViewState, type UseSetViewState, useActiveToolState, type UseActiveToolState, useIsFullscreenActive, type UseIsFullscreenActive, useSetFullscreen, type UseSetFullscreen, useActiveViewports, type UseActiveViewports, useDraggedDomainEntityId, type UseDraggedDomainEntityId, useNavigate, type UseNavigate, usePushNavigate, type UsePushNavigate, usePopNavigate, type UsePopNavigate, } from './system-hooks/navigation-hooks.js';
|
|
12
12
|
export { useComposition, type UseComposition } from './system-hooks/composition-hooks.js';
|
|
13
|
+
export { useUndoRedo, type UseUndoRedo, type UseUndoRedoResult } from './system-hooks/undo-redo-hooks.js';
|
|
13
14
|
export { useHoveredDomainEntityId, useHoveredEntity, useHoveredEntityId, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, } from './system-hooks/hover-hooks.js';
|
|
14
15
|
export { type UseRootEntityState, useRootEntityState, useRootEntityRenderedState, } from './entity-hooks/use-root-entity-state.js';
|
|
15
16
|
export { type UseRootEntityId, useRootEntityId, useRootEntityRenderedId } from './entity-hooks/use-root-entity-id.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
|
|
1
|
+
export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useSetViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useUndoRedo}from"./system-hooks/undo-redo-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
|
|
@@ -9,6 +9,11 @@ export type UseActiveViewState<VIEW_STATE extends string> = () => VIEW_STATE;
|
|
|
9
9
|
* Get the currently active view state
|
|
10
10
|
*/
|
|
11
11
|
export declare const useActiveViewState: () => string;
|
|
12
|
+
export type UseSetViewState<VIEW_STATE extends string> = () => (state: VIEW_STATE) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Hook to make the given view state the active one. Setting the state that is already active keeps it
|
|
15
|
+
*/
|
|
16
|
+
export declare const useSetViewState: () => (state: string) => void;
|
|
12
17
|
export type UseActiveToolState<TOOL_STATE extends string> = () => TOOL_STATE;
|
|
13
18
|
/**
|
|
14
19
|
* Get the currently active tool state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{useDomain as e}from"../common-hooks/use-domain-context.js";import{useStoreSelector as o}from"../common-hooks/use-store-selector.js";export const useActiveNavigationState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveNavigationState(e.state),[t])};export const useActiveViewState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveViewState(e.state),[t])};export const useActiveToolState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveToolState(e.state),[t])};export const useIsFullscreenActive=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveFullscreenState(e.state),[t])};export const useSetFullscreen=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getFullscreenUpdate(t)])},[o,s])};export const useDraggedDomainEntityId=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveDragState(e.state),[t])};export const useActiveViewports=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveViewportState(e.state),[t])};export const useNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getNavigationUpdate(t)])},[o,s])};export const usePushNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getPushNavigationUpdate(t,o.stateSlices.committed.value.state)])},[o,s])};export const usePopNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(()=>{let t=s.getPopNavigationUpdate(o.stateSlices.committed.value.state);t&&o.stageAndCommit([t])},[o,s])};
|
|
1
|
+
import{useCallback as t}from"react";import{useDomain as e}from"../common-hooks/use-domain-context.js";import{useStoreSelector as o}from"../common-hooks/use-store-selector.js";export const useActiveNavigationState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveNavigationState(e.state),[t])};export const useActiveViewState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveViewState(e.state),[t])};export const useSetViewState=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getViewUpdate(t)])},[o,s])};export const useActiveToolState=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveToolState(e.state),[t])};export const useIsFullscreenActive=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveFullscreenState(e.state),[t])};export const useSetFullscreen=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getFullscreenUpdate(t)])},[o,s])};export const useDraggedDomainEntityId=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveDragState(e.state),[t])};export const useActiveViewports=()=>{let{navigationSystem:t}=e();return o(e=>t.getActiveViewportState(e.state),[t])};export const useNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getNavigationUpdate(t)])},[o,s])};export const usePushNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(t=>{o.stageAndCommit([s.getPushNavigationUpdate(t,o.stateSlices.committed.value.state)])},[o,s])};export const usePopNavigate=()=>{let{storeSystem:o,navigationSystem:s}=e();return t(()=>{let t=s.getPopNavigationUpdate(o.stateSlices.committed.value.state);t&&o.stageAndCommit([t])},[o,s])};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a project layout needs to offer undo and redo.
|
|
3
|
+
* - `canUndo` and `canRedo`: whether the undo history has a step to go back or forward to; they follow every change.
|
|
4
|
+
* - `undo`: returns to the previous step and pushes the undo-button analytics event; does nothing while `canUndo`
|
|
5
|
+
* is false.
|
|
6
|
+
* - `redo`: returns to the next step and pushes the redo-button analytics event; does nothing while `canRedo` is
|
|
7
|
+
* false.
|
|
8
|
+
*/
|
|
9
|
+
export interface UseUndoRedoResult {
|
|
10
|
+
readonly canUndo: boolean;
|
|
11
|
+
readonly canRedo: boolean;
|
|
12
|
+
readonly undo: () => void;
|
|
13
|
+
readonly redo: () => void;
|
|
14
|
+
}
|
|
15
|
+
export type UseUndoRedo = () => UseUndoRedoResult;
|
|
16
|
+
/**
|
|
17
|
+
* Hook to undo and redo changes of the configuration, as the built-in toolbar's undo and redo buttons do. It does
|
|
18
|
+
* not check read mode; a layout hides undo and redo for a viewer.
|
|
19
|
+
*/
|
|
20
|
+
export declare const useUndoRedo: UseUndoRedo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback as o}from"react";import{FrontendAnalyticsFactory as e,useAnalyticsService as n}from"../../application-runtime/index.js";import{useDomain as t}from"../common-hooks/use-domain-context.js";import{useEagerObservableValue as r}from"../common-hooks/use-observable-selector.js";export const useUndoRedo=()=>{let d=n(),{undoSystem:m}=t(),{canUndo:s,canRedo:c}=r(m.can$);return{canUndo:s,canRedo:c,undo:o(()=>{m.canUndo()&&(d.push(e.UndoButtonClicked()),m.undo())},[d,m]),redo:o(()=>{m.canRedo()&&(d.push(e.RedoButtonClicked()),m.redo())},[d,m])}};
|