motia 0.8.2-beta.140-628177 → 0.8.2-beta.140-111855
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/dist/cjs/cli.js +0 -25
- package/dist/cjs/cloud/build/__tests__/infrastructure-serialization.test.d.ts +1 -0
- package/dist/cjs/cloud/build/__tests__/infrastructure-serialization.test.js +322 -0
- package/dist/cjs/cloud/build/__tests__/infrastructure-validation.test.d.ts +1 -0
- package/dist/cjs/cloud/build/__tests__/infrastructure-validation.test.js +571 -0
- package/dist/cjs/cloud/build/build-validation.d.ts +4 -6
- package/dist/cjs/cloud/build/build-validation.js +27 -140
- package/dist/cjs/cloud/build/builder.d.ts +3 -3
- package/dist/cjs/cloud/build/builders/include-static-files.d.ts +3 -3
- package/dist/cjs/cloud/build/builders/include-static-files.js +1 -1
- package/dist/cjs/cloud/build/builders/node/index.d.ts +3 -3
- package/dist/cjs/cloud/build/builders/node/index.js +1 -1
- package/dist/cjs/cloud/build/builders/node/router-template.ts +1 -0
- package/dist/cjs/cloud/build/builders/python/index.d.ts +3 -3
- package/dist/cjs/cloud/build/builders/python/python-data/__tests__/extract-python-data.test.js +2 -2
- package/dist/cjs/cloud/build/builders/python/python-data/__tests__/read-requirements.test.js +2 -2
- package/dist/cjs/cloud/build/builders/python/python-data/__tests__/resolve-dep-name.test.js +1 -1
- package/dist/cjs/cloud/build/builders/python/python-data/extract-python-data.d.ts +1 -1
- package/dist/cjs/cloud/build/builders/python/python-data/get-dependencies-from-file.js +1 -1
- package/dist/cjs/cloud/build/builders/python/python-data/resolve-dep-names.js +1 -1
- package/dist/cjs/cloud/build/validations/__tests__/api-endpoints.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/api-endpoints.validator.test.js +71 -0
- package/dist/cjs/cloud/build/validations/__tests__/build-validation.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/build-validation.test.js +96 -0
- package/dist/cjs/cloud/build/validations/__tests__/cron-expressions.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/cron-expressions.validator.test.js +68 -0
- package/dist/cjs/cloud/build/validations/__tests__/duplicate-step-names.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/duplicate-step-names.validator.test.js +66 -0
- package/dist/cjs/cloud/build/validations/__tests__/router-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/router-bundle-sizes.validator.test.js +71 -0
- package/dist/cjs/cloud/build/validations/__tests__/step-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/step-bundle-sizes.validator.test.js +69 -0
- package/dist/cjs/cloud/build/validations/__tests__/step-name-lengths.validator.test.d.ts +1 -0
- package/dist/cjs/cloud/build/validations/__tests__/step-name-lengths.validator.test.js +68 -0
- package/dist/cjs/cloud/build/validations/api-endpoints.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/api-endpoints.validator.js +36 -0
- package/dist/cjs/cloud/build/validations/constants.d.ts +6 -0
- package/dist/cjs/cloud/build/validations/constants.js +9 -0
- package/dist/cjs/cloud/build/validations/cron-expressions.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/cron-expressions.validator.js +62 -0
- package/dist/cjs/cloud/build/validations/duplicate-step-names.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/duplicate-step-names.validator.js +26 -0
- package/dist/cjs/cloud/build/validations/infrastructure-configs.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/infrastructure-configs.validator.js +32 -0
- package/dist/cjs/cloud/build/validations/router-bundle-sizes.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/router-bundle-sizes.validator.js +31 -0
- package/dist/cjs/cloud/build/validations/step-bundle-sizes.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/step-bundle-sizes.validator.js +36 -0
- package/dist/cjs/cloud/build/validations/step-name-lengths.validator.d.ts +2 -0
- package/dist/cjs/cloud/build/validations/step-name-lengths.validator.js +27 -0
- package/dist/cjs/cloud/build/validations/types.d.ts +7 -0
- package/dist/cjs/cloud/build/validations/types.js +2 -0
- package/dist/cjs/cloud/cli/build.js +2 -2
- package/dist/cjs/cloud/cli-output-manager.js +1 -1
- package/dist/cjs/cloud/config-utils.d.ts +1 -1
- package/dist/cjs/cloud/config-utils.js +0 -2
- package/dist/cjs/cloud/endpoints.d.ts +1 -1
- package/dist/cjs/cloud/endpoints.js +3 -8
- package/dist/cjs/cloud/new-deployment/build.d.ts +1 -1
- package/dist/cjs/cloud/new-deployment/cloud-api/start-deployment.d.ts +1 -1
- package/dist/cjs/cloud/new-deployment/deploy.d.ts +3 -3
- package/dist/cjs/cloud/new-deployment/deploy.js +1 -1
- package/dist/cjs/cloud/new-deployment/listeners/build-printer.d.ts +2 -2
- package/dist/cjs/cloud/new-deployment/listeners/cli-listener.d.ts +5 -5
- package/dist/cjs/cloud/new-deployment/listeners/cli-listener.js +1 -1
- package/dist/cjs/cloud/new-deployment/listeners/listener.types.d.ts +3 -3
- package/dist/cjs/cloud/new-deployment/listeners/print-deployment-status.d.ts +3 -3
- package/dist/cjs/cloud/new-deployment/listeners/printer.d.ts +1 -1
- package/dist/cjs/cloud/new-deployment/listeners/printer.js +1 -1
- package/dist/cjs/cloud/new-deployment/listeners/streaming-deployment-listener.d.ts +5 -5
- package/dist/cjs/cloud/new-deployment/streams/deployment-stream.d.ts +1 -1
- package/dist/cjs/cloud/new-deployment/upload-artifacts.d.ts +2 -2
- package/dist/cjs/cloud/new-deployment/utils/load-env-data.d.ts +1 -1
- package/dist/cjs/cloud/new-deployment/utils/upload.js +1 -1
- package/dist/cjs/create/index.d.ts +1 -1
- package/dist/cjs/create/index.js +5 -2
- package/dist/cjs/create/interactive.d.ts +1 -1
- package/dist/cjs/create/interactive.js +1 -1
- package/dist/cjs/create/pull-rules.d.ts +1 -1
- package/dist/cjs/create/pull-rules.js +1 -1
- package/dist/cjs/create/setup-template.d.ts +1 -1
- package/dist/cjs/create/templates/generate.d.ts +1 -1
- package/dist/cjs/create/templates/generate.js +1 -1
- package/dist/cjs/create/templates/generate.ts +3 -3
- package/dist/cjs/create/templates/index.d.ts +1 -1
- package/dist/cjs/create/templates/index.ts +1 -1
- package/dist/cjs/create/templates/nodejs/motia-workbench.json +1 -1
- package/dist/cjs/create/templates/nodejs/motia.config.ts.txt +9 -0
- package/dist/cjs/create/templates/python/motia.config.ts.txt +9 -0
- package/dist/cjs/create/utils.d.ts +0 -2
- package/dist/cjs/create/utils.js +2 -57
- package/dist/cjs/create-step/getAnswers.d.ts +1 -1
- package/dist/cjs/create-step/getAnswers.js +1 -2
- package/dist/cjs/create-step/index.js +3 -3
- package/dist/cjs/create-step/teamplateUtils.d.ts +1 -1
- package/dist/cjs/create-step/templates/ui/overrides.d.ts +1 -1
- package/dist/cjs/create-step/templates/ui/overrides.ts +1 -1
- package/dist/cjs/create-step/utils.d.ts +1 -1
- package/dist/cjs/cursor-rules/dot-files/opencode.json +1 -3
- package/dist/cjs/dev-watchers.d.ts +1 -1
- package/dist/cjs/dev.js +7 -9
- package/dist/cjs/docker/build.js +3 -3
- package/dist/cjs/docker/run.js +3 -3
- package/dist/cjs/docker/setup.js +2 -2
- package/dist/cjs/generate-locked-data.d.ts +1 -1
- package/dist/cjs/generate-locked-data.js +1 -1
- package/dist/cjs/generate-plugins.d.ts +2 -2
- package/dist/cjs/generate-plugins.js +120 -24
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/install.js +4 -4
- package/dist/cjs/openapi/generate.d.ts +1 -1
- package/dist/cjs/openapi/process-schema.d.ts +1 -1
- package/dist/cjs/start.js +4 -5
- package/dist/cjs/utils/activate-python-env.js +2 -2
- package/dist/cjs/utils/amplitude/enrichment-plugin.d.ts +1 -1
- package/dist/cjs/utils/analytics.js +1 -1
- package/dist/cjs/utils/install-lambda-python-packages.js +1 -2
- package/dist/cjs/utils/python-version-utils.js +0 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/watcher.d.ts +1 -1
- package/dist/cjs/watcher.js +1 -1
- package/dist/esm/cli.js +0 -25
- package/dist/esm/cloud/build/__tests__/infrastructure-serialization.test.d.ts +1 -0
- package/dist/esm/cloud/build/__tests__/infrastructure-serialization.test.js +320 -0
- package/dist/esm/cloud/build/__tests__/infrastructure-validation.test.d.ts +1 -0
- package/dist/esm/cloud/build/__tests__/infrastructure-validation.test.js +569 -0
- package/dist/esm/cloud/build/build-validation.d.ts +4 -6
- package/dist/esm/cloud/build/build-validation.js +27 -104
- package/dist/esm/cloud/build/builder.d.ts +3 -3
- package/dist/esm/cloud/build/builders/include-static-files.d.ts +3 -3
- package/dist/esm/cloud/build/builders/include-static-files.js +1 -1
- package/dist/esm/cloud/build/builders/node/index.d.ts +3 -3
- package/dist/esm/cloud/build/builders/node/index.js +1 -1
- package/dist/esm/cloud/build/builders/node/router-template.ts +1 -0
- package/dist/esm/cloud/build/builders/python/index.d.ts +3 -3
- package/dist/esm/cloud/build/builders/python/python-data/__tests__/extract-python-data.test.js +2 -2
- package/dist/esm/cloud/build/builders/python/python-data/__tests__/read-requirements.test.js +2 -2
- package/dist/esm/cloud/build/builders/python/python-data/__tests__/resolve-dep-name.test.js +1 -1
- package/dist/esm/cloud/build/builders/python/python-data/extract-python-data.d.ts +1 -1
- package/dist/esm/cloud/build/builders/python/python-data/get-dependencies-from-file.js +1 -1
- package/dist/esm/cloud/build/builders/python/python-data/resolve-dep-names.js +1 -1
- package/dist/esm/cloud/build/validations/__tests__/api-endpoints.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/api-endpoints.validator.test.js +69 -0
- package/dist/esm/cloud/build/validations/__tests__/build-validation.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/build-validation.test.js +94 -0
- package/dist/esm/cloud/build/validations/__tests__/cron-expressions.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/cron-expressions.validator.test.js +66 -0
- package/dist/esm/cloud/build/validations/__tests__/duplicate-step-names.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/duplicate-step-names.validator.test.js +64 -0
- package/dist/esm/cloud/build/validations/__tests__/router-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/router-bundle-sizes.validator.test.js +69 -0
- package/dist/esm/cloud/build/validations/__tests__/step-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/step-bundle-sizes.validator.test.js +67 -0
- package/dist/esm/cloud/build/validations/__tests__/step-name-lengths.validator.test.d.ts +1 -0
- package/dist/esm/cloud/build/validations/__tests__/step-name-lengths.validator.test.js +66 -0
- package/dist/esm/cloud/build/validations/api-endpoints.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/api-endpoints.validator.js +29 -0
- package/dist/esm/cloud/build/validations/constants.d.ts +6 -0
- package/dist/esm/cloud/build/validations/constants.js +6 -0
- package/dist/esm/cloud/build/validations/cron-expressions.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/cron-expressions.validator.js +22 -0
- package/dist/esm/cloud/build/validations/duplicate-step-names.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/duplicate-step-names.validator.js +19 -0
- package/dist/esm/cloud/build/validations/infrastructure-configs.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/infrastructure-configs.validator.js +25 -0
- package/dist/esm/cloud/build/validations/router-bundle-sizes.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/router-bundle-sizes.validator.js +24 -0
- package/dist/esm/cloud/build/validations/step-bundle-sizes.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/step-bundle-sizes.validator.js +29 -0
- package/dist/esm/cloud/build/validations/step-name-lengths.validator.d.ts +2 -0
- package/dist/esm/cloud/build/validations/step-name-lengths.validator.js +20 -0
- package/dist/esm/cloud/build/validations/types.d.ts +7 -0
- package/dist/esm/cloud/build/validations/types.js +1 -0
- package/dist/esm/cloud/cli/build.js +2 -2
- package/dist/esm/cloud/cli-output-manager.js +1 -1
- package/dist/esm/cloud/config-utils.d.ts +1 -1
- package/dist/esm/cloud/config-utils.js +0 -2
- package/dist/esm/cloud/endpoints.d.ts +1 -1
- package/dist/esm/cloud/endpoints.js +3 -8
- package/dist/esm/cloud/new-deployment/build.d.ts +1 -1
- package/dist/esm/cloud/new-deployment/cloud-api/start-deployment.d.ts +1 -1
- package/dist/esm/cloud/new-deployment/deploy.d.ts +3 -3
- package/dist/esm/cloud/new-deployment/deploy.js +1 -1
- package/dist/esm/cloud/new-deployment/listeners/build-printer.d.ts +2 -2
- package/dist/esm/cloud/new-deployment/listeners/cli-listener.d.ts +5 -5
- package/dist/esm/cloud/new-deployment/listeners/cli-listener.js +1 -1
- package/dist/esm/cloud/new-deployment/listeners/listener.types.d.ts +3 -3
- package/dist/esm/cloud/new-deployment/listeners/print-deployment-status.d.ts +3 -3
- package/dist/esm/cloud/new-deployment/listeners/printer.d.ts +1 -1
- package/dist/esm/cloud/new-deployment/listeners/printer.js +1 -1
- package/dist/esm/cloud/new-deployment/listeners/streaming-deployment-listener.d.ts +5 -5
- package/dist/esm/cloud/new-deployment/listeners/streaming-deployment-listener.js +1 -1
- package/dist/esm/cloud/new-deployment/streams/deployment-stream.d.ts +1 -1
- package/dist/esm/cloud/new-deployment/upload-artifacts.d.ts +2 -2
- package/dist/esm/cloud/new-deployment/utils/load-env-data.d.ts +1 -1
- package/dist/esm/cloud/new-deployment/utils/upload.js +1 -1
- package/dist/esm/create/index.d.ts +1 -1
- package/dist/esm/create/index.js +6 -3
- package/dist/esm/create/interactive.d.ts +1 -1
- package/dist/esm/create/interactive.js +1 -1
- package/dist/esm/create/pull-rules.d.ts +1 -1
- package/dist/esm/create/pull-rules.js +1 -1
- package/dist/esm/create/setup-template.d.ts +1 -1
- package/dist/esm/create/templates/generate.d.ts +1 -1
- package/dist/esm/create/templates/generate.js +2 -2
- package/dist/esm/create/templates/generate.ts +3 -3
- package/dist/esm/create/templates/index.d.ts +1 -1
- package/dist/esm/create/templates/index.ts +1 -1
- package/dist/esm/create/templates/nodejs/motia-workbench.json +1 -1
- package/dist/esm/create/templates/nodejs/motia.config.ts.txt +9 -0
- package/dist/esm/create/templates/python/motia.config.ts.txt +9 -0
- package/dist/esm/create/utils.d.ts +0 -2
- package/dist/esm/create/utils.js +1 -55
- package/dist/esm/create-step/getAnswers.d.ts +1 -1
- package/dist/esm/create-step/getAnswers.js +1 -2
- package/dist/esm/create-step/index.js +3 -3
- package/dist/esm/create-step/teamplateUtils.d.ts +1 -1
- package/dist/esm/create-step/templates/ui/overrides.d.ts +1 -1
- package/dist/esm/create-step/templates/ui/overrides.ts +1 -1
- package/dist/esm/create-step/utils.d.ts +1 -1
- package/dist/esm/cursor-rules/dot-files/opencode.json +1 -3
- package/dist/esm/dev-watchers.d.ts +1 -1
- package/dist/esm/dev.js +8 -10
- package/dist/esm/docker/build.js +3 -3
- package/dist/esm/docker/run.js +3 -3
- package/dist/esm/docker/setup.js +2 -2
- package/dist/esm/generate-locked-data.d.ts +1 -1
- package/dist/esm/generate-locked-data.js +2 -2
- package/dist/esm/generate-plugins.d.ts +2 -2
- package/dist/esm/generate-plugins.js +115 -22
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/install.js +4 -4
- package/dist/esm/openapi/generate.d.ts +1 -1
- package/dist/esm/openapi/process-schema.d.ts +1 -1
- package/dist/esm/start.js +6 -7
- package/dist/esm/utils/activate-python-env.js +2 -2
- package/dist/esm/utils/amplitude/enrichment-plugin.d.ts +1 -1
- package/dist/esm/utils/analytics.js +2 -2
- package/dist/esm/utils/install-lambda-python-packages.js +1 -2
- package/dist/esm/utils/python-version-utils.js +0 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/watcher.d.ts +1 -1
- package/dist/esm/watcher.js +1 -1
- package/dist/types/cloud/build/__tests__/infrastructure-serialization.test.d.ts +1 -0
- package/dist/types/cloud/build/__tests__/infrastructure-validation.test.d.ts +1 -0
- package/dist/types/cloud/build/build-validation.d.ts +4 -6
- package/dist/types/cloud/build/builder.d.ts +3 -3
- package/dist/types/cloud/build/builders/include-static-files.d.ts +3 -3
- package/dist/types/cloud/build/builders/node/index.d.ts +3 -3
- package/dist/types/cloud/build/builders/python/index.d.ts +3 -3
- package/dist/types/cloud/build/builders/python/python-data/extract-python-data.d.ts +1 -1
- package/dist/types/cloud/build/validations/__tests__/api-endpoints.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/build-validation.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/cron-expressions.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/duplicate-step-names.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/router-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/step-bundle-sizes.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/__tests__/step-name-lengths.validator.test.d.ts +1 -0
- package/dist/types/cloud/build/validations/api-endpoints.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/constants.d.ts +6 -0
- package/dist/types/cloud/build/validations/cron-expressions.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/duplicate-step-names.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/infrastructure-configs.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/router-bundle-sizes.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/step-bundle-sizes.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/step-name-lengths.validator.d.ts +2 -0
- package/dist/types/cloud/build/validations/types.d.ts +7 -0
- package/dist/types/cloud/config-utils.d.ts +1 -1
- package/dist/types/cloud/endpoints.d.ts +1 -1
- package/dist/types/cloud/new-deployment/build.d.ts +1 -1
- package/dist/types/cloud/new-deployment/cloud-api/start-deployment.d.ts +1 -1
- package/dist/types/cloud/new-deployment/deploy.d.ts +3 -3
- package/dist/types/cloud/new-deployment/listeners/build-printer.d.ts +2 -2
- package/dist/types/cloud/new-deployment/listeners/cli-listener.d.ts +5 -5
- package/dist/types/cloud/new-deployment/listeners/listener.types.d.ts +3 -3
- package/dist/types/cloud/new-deployment/listeners/print-deployment-status.d.ts +3 -3
- package/dist/types/cloud/new-deployment/listeners/printer.d.ts +1 -1
- package/dist/types/cloud/new-deployment/listeners/streaming-deployment-listener.d.ts +5 -5
- package/dist/types/cloud/new-deployment/streams/deployment-stream.d.ts +1 -1
- package/dist/types/cloud/new-deployment/upload-artifacts.d.ts +2 -2
- package/dist/types/cloud/new-deployment/utils/load-env-data.d.ts +1 -1
- package/dist/types/create/index.d.ts +1 -1
- package/dist/types/create/interactive.d.ts +1 -1
- package/dist/types/create/pull-rules.d.ts +1 -1
- package/dist/types/create/setup-template.d.ts +1 -1
- package/dist/types/create/templates/generate.d.ts +1 -1
- package/dist/types/create/templates/index.d.ts +1 -1
- package/dist/types/create/utils.d.ts +0 -2
- package/dist/types/create-step/getAnswers.d.ts +1 -1
- package/dist/types/create-step/teamplateUtils.d.ts +1 -1
- package/dist/types/create-step/templates/ui/overrides.d.ts +1 -1
- package/dist/types/create-step/utils.d.ts +1 -1
- package/dist/types/dev-watchers.d.ts +1 -1
- package/dist/types/generate-locked-data.d.ts +1 -1
- package/dist/types/generate-plugins.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/openapi/generate.d.ts +1 -1
- package/dist/types/openapi/process-schema.d.ts +1 -1
- package/dist/types/utils/amplitude/enrichment-plugin.d.ts +1 -1
- package/dist/types/watcher.d.ts +1 -1
- package/package.json +6 -5
- package/dist/cjs/create/templates/nodejs/steps/petstore/api-step.step.test.ts.txt +0 -25
- package/dist/cjs/create/templates/nodejs/steps/petstore/flow-step.step.test.ts.txt +0 -122
- package/dist/cjs/create/templates/nodejs/steps/petstore/my-step.step.test.ts.txt +0 -16
- package/dist/esm/create/templates/nodejs/steps/petstore/api-step.step.test.ts.txt +0 -25
- package/dist/esm/create/templates/nodejs/steps/petstore/flow-step.step.test.ts.txt +0 -122
- package/dist/esm/create/templates/nodejs/steps/petstore/my-step.step.test.ts.txt +0 -16
package/dist/cjs/cli.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
5
4
|
const commander_1 = require("commander");
|
|
6
5
|
require("./cloud");
|
|
7
6
|
const config_utils_1 = require("./cloud/config-utils");
|
|
@@ -20,30 +19,6 @@ commander_1.program
|
|
|
20
19
|
console.log(`Motia CLI v${version_1.version}`);
|
|
21
20
|
process.exit(0);
|
|
22
21
|
});
|
|
23
|
-
commander_1.program
|
|
24
|
-
.command('test')
|
|
25
|
-
.description('Run all tests in your local project')
|
|
26
|
-
.option('-w, --watch', 'Run tests in watch mode')
|
|
27
|
-
.action(async (options) => {
|
|
28
|
-
// CommonJS style
|
|
29
|
-
const execa = require('execa'); // no destructuring
|
|
30
|
-
const projectRoot = process.cwd();
|
|
31
|
-
try {
|
|
32
|
-
await execa('npx', options.watch ? ['jest', '--watch'] : ['jest'], {
|
|
33
|
-
stdio: 'inherit',
|
|
34
|
-
cwd: projectRoot,
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
catch (err) {
|
|
38
|
-
if (err instanceof Error) {
|
|
39
|
-
console.error('Error running tests:', err.message);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
console.error('Unknown error:', err);
|
|
43
|
-
}
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
22
|
commander_1.program
|
|
48
23
|
.command('create [name]')
|
|
49
24
|
.description('Create a new motia project')
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const zod_1 = require("@motiadev/core/node_modules/zod");
|
|
4
|
+
describe('Infrastructure Config Serialization', () => {
|
|
5
|
+
function createMockStepWithInfrastructure() {
|
|
6
|
+
const inputSchema = zod_1.z.object({
|
|
7
|
+
traceId: zod_1.z.string(),
|
|
8
|
+
userId: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
return {
|
|
11
|
+
type: 'node',
|
|
12
|
+
entrypointPath: '/mock/steps/testStep.step.ts',
|
|
13
|
+
filePath: '/mock/project/steps/testStep.step.ts',
|
|
14
|
+
config: {
|
|
15
|
+
type: 'event',
|
|
16
|
+
name: 'testStep',
|
|
17
|
+
description: 'Test step with infrastructure',
|
|
18
|
+
subscribes: ['test.event'],
|
|
19
|
+
emits: [],
|
|
20
|
+
input: inputSchema,
|
|
21
|
+
infrastructure: {
|
|
22
|
+
handler: {
|
|
23
|
+
ram: 2048,
|
|
24
|
+
timeout: 30,
|
|
25
|
+
cpu: 1,
|
|
26
|
+
},
|
|
27
|
+
queue: {
|
|
28
|
+
type: 'fifo',
|
|
29
|
+
visibilityTimeout: 31,
|
|
30
|
+
maxRetries: 5,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function createMockStepWithoutInfrastructure() {
|
|
37
|
+
return {
|
|
38
|
+
type: 'node',
|
|
39
|
+
entrypointPath: '/mock/steps/legacyStep.step.ts',
|
|
40
|
+
filePath: '/mock/project/steps/legacyStep.step.ts',
|
|
41
|
+
config: {
|
|
42
|
+
type: 'event',
|
|
43
|
+
name: 'legacyStep',
|
|
44
|
+
description: 'Legacy step without infrastructure',
|
|
45
|
+
subscribes: ['test.event'],
|
|
46
|
+
emits: [],
|
|
47
|
+
input: {},
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function createMockStepWithPartialInfrastructure() {
|
|
52
|
+
return {
|
|
53
|
+
type: 'node',
|
|
54
|
+
entrypointPath: '/mock/steps/partialStep.step.ts',
|
|
55
|
+
filePath: '/mock/project/steps/partialStep.step.ts',
|
|
56
|
+
config: {
|
|
57
|
+
type: 'event',
|
|
58
|
+
name: 'partialStep',
|
|
59
|
+
description: 'Step with partial infrastructure',
|
|
60
|
+
subscribes: ['test.event'],
|
|
61
|
+
emits: [],
|
|
62
|
+
input: {},
|
|
63
|
+
infrastructure: {
|
|
64
|
+
handler: {
|
|
65
|
+
ram: 4096,
|
|
66
|
+
timeout: 60,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
describe('JSON Serialization', () => {
|
|
73
|
+
it('should serialize step with infrastructure config correctly', () => {
|
|
74
|
+
const step = createMockStepWithInfrastructure();
|
|
75
|
+
const stepsConfig = { testStep: step };
|
|
76
|
+
const stepsFile = {
|
|
77
|
+
steps: stepsConfig,
|
|
78
|
+
streams: {},
|
|
79
|
+
routers: {},
|
|
80
|
+
};
|
|
81
|
+
const json = JSON.stringify(stepsFile, null, 2);
|
|
82
|
+
const parsed = JSON.parse(json);
|
|
83
|
+
expect(parsed.steps.testStep).toBeDefined();
|
|
84
|
+
expect(parsed.steps.testStep.config.infrastructure).toBeDefined();
|
|
85
|
+
expect(parsed.steps.testStep.config.infrastructure.handler).toBeDefined();
|
|
86
|
+
expect(parsed.steps.testStep.config.infrastructure.queue).toBeDefined();
|
|
87
|
+
});
|
|
88
|
+
it('should serialize handler configuration correctly', () => {
|
|
89
|
+
const step = createMockStepWithInfrastructure();
|
|
90
|
+
const stepsConfig = { testStep: step };
|
|
91
|
+
const stepsFile = {
|
|
92
|
+
steps: stepsConfig,
|
|
93
|
+
streams: {},
|
|
94
|
+
routers: {},
|
|
95
|
+
};
|
|
96
|
+
const json = JSON.stringify(stepsFile);
|
|
97
|
+
const parsed = JSON.parse(json);
|
|
98
|
+
const handler = parsed.steps.testStep.config.infrastructure.handler;
|
|
99
|
+
expect(handler.ram).toBe(2048);
|
|
100
|
+
expect(handler.timeout).toBe(30);
|
|
101
|
+
expect(handler.cpu).toBe(1);
|
|
102
|
+
});
|
|
103
|
+
it('should serialize queue configuration correctly', () => {
|
|
104
|
+
const step = createMockStepWithInfrastructure();
|
|
105
|
+
const stepsConfig = { testStep: step };
|
|
106
|
+
const stepsFile = {
|
|
107
|
+
steps: stepsConfig,
|
|
108
|
+
streams: {},
|
|
109
|
+
routers: {},
|
|
110
|
+
};
|
|
111
|
+
const json = JSON.stringify(stepsFile);
|
|
112
|
+
const parsed = JSON.parse(json);
|
|
113
|
+
const queue = parsed.steps.testStep.config.infrastructure.queue;
|
|
114
|
+
expect(queue.type).toBe('fifo');
|
|
115
|
+
expect(queue.visibilityTimeout).toBe(31);
|
|
116
|
+
expect(queue.maxRetries).toBe(5);
|
|
117
|
+
});
|
|
118
|
+
it('should serialize partial infrastructure config correctly', () => {
|
|
119
|
+
const step = createMockStepWithPartialInfrastructure();
|
|
120
|
+
const stepsConfig = { partialStep: step };
|
|
121
|
+
const stepsFile = {
|
|
122
|
+
steps: stepsConfig,
|
|
123
|
+
streams: {},
|
|
124
|
+
routers: {},
|
|
125
|
+
};
|
|
126
|
+
const json = JSON.stringify(stepsFile);
|
|
127
|
+
const parsed = JSON.parse(json);
|
|
128
|
+
expect(parsed.steps.partialStep.config.infrastructure).toBeDefined();
|
|
129
|
+
expect(parsed.steps.partialStep.config.infrastructure.handler).toBeDefined();
|
|
130
|
+
expect(parsed.steps.partialStep.config.infrastructure.queue).toBeUndefined();
|
|
131
|
+
const handler = parsed.steps.partialStep.config.infrastructure.handler;
|
|
132
|
+
expect(handler.ram).toBe(4096);
|
|
133
|
+
expect(handler.timeout).toBe(60);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
describe('Backward Compatibility', () => {
|
|
137
|
+
it('should serialize step without infrastructure config correctly', () => {
|
|
138
|
+
const step = createMockStepWithoutInfrastructure();
|
|
139
|
+
const stepsConfig = { legacyStep: step };
|
|
140
|
+
const stepsFile = {
|
|
141
|
+
steps: stepsConfig,
|
|
142
|
+
streams: {},
|
|
143
|
+
routers: {},
|
|
144
|
+
};
|
|
145
|
+
const json = JSON.stringify(stepsFile, null, 2);
|
|
146
|
+
const parsed = JSON.parse(json);
|
|
147
|
+
expect(parsed.steps.legacyStep).toBeDefined();
|
|
148
|
+
expect(parsed.steps.legacyStep.config.name).toBe('legacyStep');
|
|
149
|
+
expect(parsed.steps.legacyStep.config.type).toBe('event');
|
|
150
|
+
expect(parsed.steps.legacyStep.config.infrastructure).toBeUndefined();
|
|
151
|
+
});
|
|
152
|
+
it('should handle mixed steps (with and without infrastructure)', () => {
|
|
153
|
+
const stepWithInfra = createMockStepWithInfrastructure();
|
|
154
|
+
const stepWithoutInfra = createMockStepWithoutInfrastructure();
|
|
155
|
+
const stepsConfig = {
|
|
156
|
+
testStep: stepWithInfra,
|
|
157
|
+
legacyStep: stepWithoutInfra,
|
|
158
|
+
};
|
|
159
|
+
const stepsFile = {
|
|
160
|
+
steps: stepsConfig,
|
|
161
|
+
streams: {},
|
|
162
|
+
routers: {},
|
|
163
|
+
};
|
|
164
|
+
const json = JSON.stringify(stepsFile);
|
|
165
|
+
const parsed = JSON.parse(json);
|
|
166
|
+
expect(parsed.steps.testStep.config.infrastructure).toBeDefined();
|
|
167
|
+
expect(parsed.steps.legacyStep.config.infrastructure).toBeUndefined();
|
|
168
|
+
});
|
|
169
|
+
it('should maintain all existing step properties when infrastructure is added', () => {
|
|
170
|
+
const step = createMockStepWithInfrastructure();
|
|
171
|
+
const stepsConfig = { testStep: step };
|
|
172
|
+
const stepsFile = {
|
|
173
|
+
steps: stepsConfig,
|
|
174
|
+
streams: {},
|
|
175
|
+
routers: {},
|
|
176
|
+
};
|
|
177
|
+
const json = JSON.stringify(stepsFile);
|
|
178
|
+
const parsed = JSON.parse(json);
|
|
179
|
+
const config = parsed.steps.testStep.config;
|
|
180
|
+
expect(config.type).toBe('event');
|
|
181
|
+
expect(config.name).toBe('testStep');
|
|
182
|
+
expect(config.description).toBe('Test step with infrastructure');
|
|
183
|
+
expect(config.subscribes).toEqual(['test.event']);
|
|
184
|
+
expect(config.emits).toEqual([]);
|
|
185
|
+
});
|
|
186
|
+
it('should not break existing step configs when infrastructure field is absent', () => {
|
|
187
|
+
const apiStep = {
|
|
188
|
+
type: 'node',
|
|
189
|
+
entrypointPath: '/mock/steps/apiStep.step.ts',
|
|
190
|
+
filePath: '/mock/project/steps/apiStep.step.ts',
|
|
191
|
+
config: {
|
|
192
|
+
type: 'api',
|
|
193
|
+
name: 'apiStep',
|
|
194
|
+
description: 'API step without infrastructure',
|
|
195
|
+
path: '/test',
|
|
196
|
+
method: 'GET',
|
|
197
|
+
emits: [],
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
const stepsConfig = { apiStep };
|
|
201
|
+
const stepsFile = {
|
|
202
|
+
steps: stepsConfig,
|
|
203
|
+
streams: {},
|
|
204
|
+
routers: {},
|
|
205
|
+
};
|
|
206
|
+
const json = JSON.stringify(stepsFile);
|
|
207
|
+
const parsed = JSON.parse(json);
|
|
208
|
+
expect(parsed.steps.apiStep.config.type).toBe('api');
|
|
209
|
+
expect(parsed.steps.apiStep.config.path).toBe('/test');
|
|
210
|
+
expect(parsed.steps.apiStep.config.method).toBe('GET');
|
|
211
|
+
expect(parsed.steps.apiStep.config.infrastructure).toBeUndefined();
|
|
212
|
+
});
|
|
213
|
+
it('should not break existing cron step configs', () => {
|
|
214
|
+
const cronStep = {
|
|
215
|
+
type: 'node',
|
|
216
|
+
entrypointPath: '/mock/steps/cronStep.step.ts',
|
|
217
|
+
filePath: '/mock/project/steps/cronStep.step.ts',
|
|
218
|
+
config: {
|
|
219
|
+
type: 'cron',
|
|
220
|
+
name: 'cronStep',
|
|
221
|
+
description: 'Cron step without infrastructure',
|
|
222
|
+
cron: '0 0 * * *',
|
|
223
|
+
emits: [],
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
const stepsConfig = { cronStep };
|
|
227
|
+
const stepsFile = {
|
|
228
|
+
steps: stepsConfig,
|
|
229
|
+
streams: {},
|
|
230
|
+
routers: {},
|
|
231
|
+
};
|
|
232
|
+
const json = JSON.stringify(stepsFile);
|
|
233
|
+
const parsed = JSON.parse(json);
|
|
234
|
+
expect(parsed.steps.cronStep.config.type).toBe('cron');
|
|
235
|
+
expect(parsed.steps.cronStep.config.cron).toBe('0 0 * * *');
|
|
236
|
+
expect(parsed.steps.cronStep.config.infrastructure).toBeUndefined();
|
|
237
|
+
});
|
|
238
|
+
});
|
|
239
|
+
describe('Deserialization', () => {
|
|
240
|
+
it('should deserialize step with infrastructure config correctly', () => {
|
|
241
|
+
const jsonString = JSON.stringify({
|
|
242
|
+
steps: {
|
|
243
|
+
testStep: {
|
|
244
|
+
type: 'node',
|
|
245
|
+
entrypointPath: '/mock/steps/testStep.step.ts',
|
|
246
|
+
filePath: '/mock/project/steps/testStep.step.ts',
|
|
247
|
+
config: {
|
|
248
|
+
type: 'event',
|
|
249
|
+
name: 'testStep',
|
|
250
|
+
subscribes: ['test.event'],
|
|
251
|
+
emits: [],
|
|
252
|
+
infrastructure: {
|
|
253
|
+
handler: {
|
|
254
|
+
ram: 2048,
|
|
255
|
+
timeout: 30,
|
|
256
|
+
},
|
|
257
|
+
queue: {
|
|
258
|
+
type: 'standard',
|
|
259
|
+
visibilityTimeout: 60,
|
|
260
|
+
maxRetries: 3,
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
streams: {},
|
|
267
|
+
routers: {},
|
|
268
|
+
});
|
|
269
|
+
const parsed = JSON.parse(jsonString);
|
|
270
|
+
expect(parsed.steps.testStep).toBeDefined();
|
|
271
|
+
const config = parsed.steps.testStep.config;
|
|
272
|
+
expect(config.infrastructure).toBeDefined();
|
|
273
|
+
const infra = config.infrastructure;
|
|
274
|
+
expect(infra.handler.ram).toBe(2048);
|
|
275
|
+
expect(infra.queue.type).toBe('standard');
|
|
276
|
+
});
|
|
277
|
+
it('should deserialize step without infrastructure config correctly', () => {
|
|
278
|
+
const jsonString = JSON.stringify({
|
|
279
|
+
steps: {
|
|
280
|
+
legacyStep: {
|
|
281
|
+
type: 'node',
|
|
282
|
+
entrypointPath: '/mock/steps/legacyStep.step.ts',
|
|
283
|
+
filePath: '/mock/project/steps/legacyStep.step.ts',
|
|
284
|
+
config: {
|
|
285
|
+
type: 'event',
|
|
286
|
+
name: 'legacyStep',
|
|
287
|
+
subscribes: ['test.event'],
|
|
288
|
+
emits: [],
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
streams: {},
|
|
293
|
+
routers: {},
|
|
294
|
+
});
|
|
295
|
+
const parsed = JSON.parse(jsonString);
|
|
296
|
+
expect(parsed.steps.legacyStep).toBeDefined();
|
|
297
|
+
expect(parsed.steps.legacyStep.config.infrastructure).toBeUndefined();
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
describe('Type Safety', () => {
|
|
301
|
+
it('should maintain type safety with infrastructure config', () => {
|
|
302
|
+
const step = createMockStepWithInfrastructure();
|
|
303
|
+
const config = step.config;
|
|
304
|
+
expect(config.infrastructure).toBeDefined();
|
|
305
|
+
expect(typeof config.infrastructure).toBe('object');
|
|
306
|
+
const infra = config.infrastructure;
|
|
307
|
+
expect(typeof infra.handler).toBe('object');
|
|
308
|
+
expect(typeof infra.queue).toBe('object');
|
|
309
|
+
});
|
|
310
|
+
it('should handle undefined infrastructure gracefully', () => {
|
|
311
|
+
const step = createMockStepWithoutInfrastructure();
|
|
312
|
+
const config = step.config;
|
|
313
|
+
expect(config.infrastructure).toBeUndefined();
|
|
314
|
+
expect(() => {
|
|
315
|
+
const infra = config.infrastructure;
|
|
316
|
+
if (infra) {
|
|
317
|
+
console.log(infra.handler);
|
|
318
|
+
}
|
|
319
|
+
}).not.toThrow();
|
|
320
|
+
});
|
|
321
|
+
});
|
|
322
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|