@zuplo/cli 7.10.0 → 7.11.1
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/common/worker-output.d.ts +7 -0
- package/dist/common/worker-output.d.ts.map +1 -1
- package/dist/common/worker-output.js +39 -0
- package/dist/common/worker-output.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@hono/node-server/README.md +2 -0
- package/node_modules/@hono/node-server/dist/index.cjs +1 -1
- package/node_modules/@hono/node-server/dist/index.mjs +1 -1
- package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
- package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
- package/node_modules/@hono/node-server/package.json +1 -1
- package/node_modules/@posthog/core/dist/metrics/index.d.ts +9 -0
- package/node_modules/@posthog/core/dist/metrics/index.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/metrics/index.js +38 -3
- package/node_modules/@posthog/core/dist/metrics/index.mjs +38 -3
- package/node_modules/@posthog/core/dist/metrics/types.d.ts +7 -2
- package/node_modules/@posthog/core/dist/metrics/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/traces/ids.d.ts.map +1 -1
- package/node_modules/@posthog/core/dist/traces/ids.js +2 -2
- package/node_modules/@posthog/core/dist/traces/ids.mjs +2 -2
- package/node_modules/@posthog/core/dist/types.d.ts +1 -1
- package/node_modules/@posthog/core/dist/types.d.ts.map +1 -1
- package/node_modules/@posthog/core/package.json +4 -3
- package/node_modules/@posthog/core/src/metrics/index.spec.ts +75 -0
- package/node_modules/@posthog/core/src/metrics/index.ts +60 -0
- package/node_modules/@posthog/core/src/metrics/types.ts +7 -1
- package/node_modules/@posthog/core/src/traces/ids.ts +4 -2
- package/node_modules/@posthog/core/src/types.ts +1 -1
- package/node_modules/@posthog/types/dist/capture-metric.d.ts +10 -0
- package/node_modules/@posthog/types/dist/capture-metric.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/capture.d.ts +1 -1
- package/node_modules/@posthog/types/dist/capture.d.ts.map +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts +1 -1
- package/node_modules/@posthog/types/dist/index.d.ts.map +1 -1
- package/node_modules/@posthog/types/package.json +1 -1
- package/node_modules/@posthog/types/src/capture-metric.ts +11 -0
- package/node_modules/@posthog/types/src/capture.ts +1 -1
- package/node_modules/@posthog/types/src/index.ts +1 -0
- package/node_modules/@zuplo/core/customer.cli.minified.js +272 -261
- package/node_modules/@zuplo/core/index.minified.js +276 -265
- package/node_modules/@zuplo/core/package.json +1 -1
- package/node_modules/@zuplo/graphql/package.json +1 -1
- package/node_modules/@zuplo/openapi-tools/package.json +5 -2
- package/node_modules/@zuplo/otel/package.json +1 -1
- package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js → chunk-CDEAY3VY.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js +37 -0
- package/node_modules/@zuplo/runtime/out/esm/chunk-LVSZ3WTO.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js → chunk-NUVXDVLJ.js} +2 -2
- package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js → chunk-RHU3Z7DA.js} +108 -108
- package/node_modules/@zuplo/runtime/out/esm/chunk-RHU3Z7DA.js.map +1 -0
- package/node_modules/@zuplo/runtime/out/esm/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/internal/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mcp-gateway/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/mocks/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/esm/sdks/aws/index.js +1 -1
- package/node_modules/@zuplo/runtime/out/types/index.d.ts +15 -24
- package/node_modules/@zuplo/runtime/out/types/internal/index.d.ts +14 -0
- package/node_modules/@zuplo/runtime/package.json +1 -1
- package/package.json +15 -12
- package/dist/__tests__/archive-utils.test.d.ts +0 -2
- package/dist/__tests__/archive-utils.test.d.ts.map +0 -1
- package/dist/__tests__/archive-utils.test.js +0 -50
- package/dist/__tests__/archive-utils.test.js.map +0 -1
- package/dist/__tests__/import-openapi.test.d.ts +0 -2
- package/dist/__tests__/import-openapi.test.d.ts.map +0 -1
- package/dist/__tests__/import-openapi.test.js +0 -251
- package/dist/__tests__/import-openapi.test.js.map +0 -1
- package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/confirm-linked-config.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js +0 -202
- package/dist/__tests__/integration/confirm-linked-config.integration.test.js.map +0 -1
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.js +0 -184
- package/dist/__tests__/integration/confirm-production-deploy.integration.test.js.map +0 -1
- package/dist/__tests__/integration/custom-domain.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/custom-domain.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/custom-domain.integration.test.js +0 -563
- package/dist/__tests__/integration/custom-domain.integration.test.js.map +0 -1
- package/dist/__tests__/integration/delete.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/delete.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/delete.integration.test.js +0 -262
- package/dist/__tests__/integration/delete.integration.test.js.map +0 -1
- package/dist/__tests__/integration/deploy.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/deploy.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/deploy.integration.test.js +0 -519
- package/dist/__tests__/integration/deploy.integration.test.js.map +0 -1
- package/dist/__tests__/integration/get-project-param.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/get-project-param.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/get-project-param.integration.test.js +0 -305
- package/dist/__tests__/integration/get-project-param.integration.test.js.map +0 -1
- package/dist/__tests__/integration/info.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/info.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/info.integration.test.js +0 -293
- package/dist/__tests__/integration/info.integration.test.js.map +0 -1
- package/dist/__tests__/integration/jest-mocks-setup.d.ts +0 -2
- package/dist/__tests__/integration/jest-mocks-setup.d.ts.map +0 -1
- package/dist/__tests__/integration/jest-mocks-setup.js +0 -104
- package/dist/__tests__/integration/jest-mocks-setup.js.map +0 -1
- package/dist/__tests__/integration/jest-setup.d.ts +0 -2
- package/dist/__tests__/integration/jest-setup.d.ts.map +0 -1
- package/dist/__tests__/integration/jest-setup.js +0 -12
- package/dist/__tests__/integration/jest-setup.js.map +0 -1
- package/dist/__tests__/integration/link.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/link.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/link.integration.test.js +0 -395
- package/dist/__tests__/integration/link.integration.test.js.map +0 -1
- package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/linked-config-cascade.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/linked-config-cascade.integration.test.js +0 -179
- package/dist/__tests__/integration/linked-config-cascade.integration.test.js.map +0 -1
- package/dist/__tests__/integration/list.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/list.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/list.integration.test.js +0 -300
- package/dist/__tests__/integration/list.integration.test.js.map +0 -1
- package/dist/__tests__/integration/source-upgrade.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/source-upgrade.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/source-upgrade.integration.test.js +0 -100
- package/dist/__tests__/integration/source-upgrade.integration.test.js.map +0 -1
- package/dist/__tests__/integration/test-utils.d.ts +0 -30
- package/dist/__tests__/integration/test-utils.d.ts.map +0 -1
- package/dist/__tests__/integration/test-utils.js +0 -82
- package/dist/__tests__/integration/test-utils.js.map +0 -1
- package/dist/__tests__/integration/tunnel.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/tunnel.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/tunnel.integration.test.js +0 -486
- package/dist/__tests__/integration/tunnel.integration.test.js.map +0 -1
- package/dist/__tests__/integration/variable.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/variable.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/variable.integration.test.js +0 -258
- package/dist/__tests__/integration/variable.integration.test.js.map +0 -1
- package/dist/__tests__/integration/whoami.integration.test.d.ts +0 -2
- package/dist/__tests__/integration/whoami.integration.test.d.ts.map +0 -1
- package/dist/__tests__/integration/whoami.integration.test.js +0 -116
- package/dist/__tests__/integration/whoami.integration.test.js.map +0 -1
- package/dist/__tests__/outdated.test.d.ts +0 -2
- package/dist/__tests__/outdated.test.d.ts.map +0 -1
- package/dist/__tests__/outdated.test.js +0 -67
- package/dist/__tests__/outdated.test.js.map +0 -1
- package/dist/__tests__/populate.test.d.ts +0 -2
- package/dist/__tests__/populate.test.d.ts.map +0 -1
- package/dist/__tests__/populate.test.js +0 -445
- package/dist/__tests__/populate.test.js.map +0 -1
- package/dist/__tests__/tsconfig-upgrader.test.d.ts +0 -2
- package/dist/__tests__/tsconfig-upgrader.test.d.ts.map +0 -1
- package/dist/__tests__/tsconfig-upgrader.test.js +0 -31
- package/dist/__tests__/tsconfig-upgrader.test.js.map +0 -1
- package/dist/ca-certificate/validation.test.d.ts +0 -2
- package/dist/ca-certificate/validation.test.d.ts.map +0 -1
- package/dist/ca-certificate/validation.test.js +0 -131
- package/dist/ca-certificate/validation.test.js.map +0 -1
- package/dist/common/analytics/cli-invocation.test.d.ts +0 -2
- package/dist/common/analytics/cli-invocation.test.d.ts.map +0 -1
- package/dist/common/analytics/cli-invocation.test.js +0 -51
- package/dist/common/analytics/cli-invocation.test.js.map +0 -1
- package/dist/common/analytics/package-manager.test.d.ts +0 -2
- package/dist/common/analytics/package-manager.test.d.ts.map +0 -1
- package/dist/common/analytics/package-manager.test.js +0 -163
- package/dist/common/analytics/package-manager.test.js.map +0 -1
- package/dist/common/cli-dispatcher.test.d.ts +0 -2
- package/dist/common/cli-dispatcher.test.d.ts.map +0 -1
- package/dist/common/cli-dispatcher.test.js +0 -80
- package/dist/common/cli-dispatcher.test.js.map +0 -1
- package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts +0 -2
- package/dist/common/middleware/check-pnpm-lifecycle.test.d.ts.map +0 -1
- package/dist/common/middleware/check-pnpm-lifecycle.test.js +0 -125
- package/dist/common/middleware/check-pnpm-lifecycle.test.js.map +0 -1
- package/dist/common/middleware/get-environment-param.test.d.ts +0 -2
- package/dist/common/middleware/get-environment-param.test.d.ts.map +0 -1
- package/dist/common/middleware/get-environment-param.test.js +0 -57
- package/dist/common/middleware/get-environment-param.test.js.map +0 -1
- package/dist/common/read-linked-config.test.d.ts +0 -2
- package/dist/common/read-linked-config.test.d.ts.map +0 -1
- package/dist/common/read-linked-config.test.js +0 -363
- package/dist/common/read-linked-config.test.js.map +0 -1
- package/dist/common/terminal.test.d.ts +0 -2
- package/dist/common/terminal.test.d.ts.map +0 -1
- package/dist/common/terminal.test.js +0 -101
- package/dist/common/terminal.test.js.map +0 -1
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts +0 -2
- package/dist/common/utils/build-environment-prompt-choices.test.d.ts.map +0 -1
- package/dist/common/utils/build-environment-prompt-choices.test.js +0 -97
- package/dist/common/utils/build-environment-prompt-choices.test.js.map +0 -1
- package/dist/common/utils/format-environment-type.test.d.ts +0 -2
- package/dist/common/utils/format-environment-type.test.d.ts.map +0 -1
- package/dist/common/utils/format-environment-type.test.js +0 -32
- package/dist/common/utils/format-environment-type.test.js.map +0 -1
- package/dist/common/utils/pnpm-lifecycle.test.d.ts +0 -2
- package/dist/common/utils/pnpm-lifecycle.test.d.ts.map +0 -1
- package/dist/common/utils/pnpm-lifecycle.test.js +0 -196
- package/dist/common/utils/pnpm-lifecycle.test.js.map +0 -1
- package/dist/common/utils/pretty-print-environment-prompt.test.d.ts +0 -2
- package/dist/common/utils/pretty-print-environment-prompt.test.d.ts.map +0 -1
- package/dist/common/utils/pretty-print-environment-prompt.test.js +0 -42
- package/dist/common/utils/pretty-print-environment-prompt.test.js.map +0 -1
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts +0 -2
- package/dist/common/utils/sort-environments-for-prompt.test.d.ts.map +0 -1
- package/dist/common/utils/sort-environments-for-prompt.test.js +0 -82
- package/dist/common/utils/sort-environments-for-prompt.test.js.map +0 -1
- package/dist/common/utils/stringify-config.test.d.ts +0 -2
- package/dist/common/utils/stringify-config.test.d.ts.map +0 -1
- package/dist/common/utils/stringify-config.test.js +0 -80
- package/dist/common/utils/stringify-config.test.js.map +0 -1
- package/dist/common/validators/argument-validators.spec.d.ts +0 -2
- package/dist/common/validators/argument-validators.spec.d.ts.map +0 -1
- package/dist/common/validators/argument-validators.spec.js +0 -181
- package/dist/common/validators/argument-validators.spec.js.map +0 -1
- package/dist/deploy/archive.local-registry.test.d.ts +0 -2
- package/dist/deploy/archive.local-registry.test.d.ts.map +0 -1
- package/dist/deploy/archive.local-registry.test.js +0 -100
- package/dist/deploy/archive.local-registry.test.js.map +0 -1
- package/dist/deploy/archive.test.d.ts +0 -2
- package/dist/deploy/archive.test.d.ts.map +0 -1
- package/dist/deploy/archive.test.js +0 -248
- package/dist/deploy/archive.test.js.map +0 -1
- package/dist/deploy/classify-build-probe.test.d.ts +0 -2
- package/dist/deploy/classify-build-probe.test.d.ts.map +0 -1
- package/dist/deploy/classify-build-probe.test.js +0 -51
- package/dist/deploy/classify-build-probe.test.js.map +0 -1
- package/dist/deploy/poll-deployment.test.d.ts +0 -2
- package/dist/deploy/poll-deployment.test.d.ts.map +0 -1
- package/dist/deploy/poll-deployment.test.js +0 -158
- package/dist/deploy/poll-deployment.test.js.map +0 -1
- package/dist/dev/zuplo-local-gitignore.test.d.ts +0 -2
- package/dist/dev/zuplo-local-gitignore.test.d.ts.map +0 -1
- package/dist/dev/zuplo-local-gitignore.test.js +0 -58
- package/dist/dev/zuplo-local-gitignore.test.js.map +0 -1
- package/dist/editor/e2e/editor.spec.d.ts +0 -2
- package/dist/editor/e2e/editor.spec.d.ts.map +0 -1
- package/dist/editor/e2e/editor.spec.js +0 -44
- package/dist/editor/e2e/editor.spec.js.map +0 -1
- package/dist/link/project-type.test.d.ts +0 -2
- package/dist/link/project-type.test.d.ts.map +0 -1
- package/dist/link/project-type.test.js +0 -225
- package/dist/link/project-type.test.js.map +0 -1
- package/dist/lint/resolve-binary.test.d.ts +0 -2
- package/dist/lint/resolve-binary.test.d.ts.map +0 -1
- package/dist/lint/resolve-binary.test.js +0 -155
- package/dist/lint/resolve-binary.test.js.map +0 -1
- package/dist/open-api/convert/handler.spec.d.ts +0 -2
- package/dist/open-api/convert/handler.spec.d.ts.map +0 -1
- package/dist/open-api/convert/handler.spec.js +0 -301
- package/dist/open-api/convert/handler.spec.js.map +0 -1
- package/dist/open-api/merge/handler.spec.d.ts +0 -2
- package/dist/open-api/merge/handler.spec.d.ts.map +0 -1
- package/dist/open-api/merge/handler.spec.js +0 -673
- package/dist/open-api/merge/handler.spec.js.map +0 -1
- package/dist/open-api/overlay/handler.spec.d.ts +0 -2
- package/dist/open-api/overlay/handler.spec.d.ts.map +0 -1
- package/dist/open-api/overlay/handler.spec.js +0 -346
- package/dist/open-api/overlay/handler.spec.js.map +0 -1
- package/dist/source/ai-gateway/files.test.d.ts +0 -2
- package/dist/source/ai-gateway/files.test.d.ts.map +0 -1
- package/dist/source/ai-gateway/files.test.js +0 -135
- package/dist/source/ai-gateway/files.test.js.map +0 -1
- package/dist/source/ai-gateway/handler.test.d.ts +0 -2
- package/dist/source/ai-gateway/handler.test.d.ts.map +0 -1
- package/dist/source/ai-gateway/handler.test.js +0 -113
- package/dist/source/ai-gateway/handler.test.js.map +0 -1
- package/dist/source/ai-gateway/package.test.d.ts +0 -2
- package/dist/source/ai-gateway/package.test.d.ts.map +0 -1
- package/dist/source/ai-gateway/package.test.js +0 -30
- package/dist/source/ai-gateway/package.test.js.map +0 -1
- package/dist/source/ai-gateway/planner.test.d.ts +0 -2
- package/dist/source/ai-gateway/planner.test.d.ts.map +0 -1
- package/dist/source/ai-gateway/planner.test.js +0 -330
- package/dist/source/ai-gateway/planner.test.js.map +0 -1
- package/dist/source/ai-gateway/release.test.d.ts +0 -2
- package/dist/source/ai-gateway/release.test.d.ts.map +0 -1
- package/dist/source/ai-gateway/release.test.js +0 -62
- package/dist/source/ai-gateway/release.test.js.map +0 -1
- package/dist/test/invoke-test.test.d.ts +0 -2
- package/dist/test/invoke-test.test.d.ts.map +0 -1
- package/dist/test/invoke-test.test.js +0 -150
- package/dist/test/invoke-test.test.js.map +0 -1
- package/dist/test/test-files.test.d.ts +0 -2
- package/dist/test/test-files.test.d.ts.map +0 -1
- package/dist/test/test-files.test.js +0 -57
- package/dist/test/test-files.test.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js +0 -289
- package/node_modules/@zuplo/openapi-tools/dist/file-format.spec.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js +0 -181
- package/node_modules/@zuplo/openapi-tools/dist/merge-fixtures.spec.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/merge.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js +0 -399
- package/node_modules/@zuplo/openapi-tools/dist/merge.spec.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js +0 -779
- package/node_modules/@zuplo/openapi-tools/dist/overlay.spec.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js +0 -269
- package/node_modules/@zuplo/openapi-tools/dist/path-transform.spec.js.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts +0 -2
- package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.d.ts.map +0 -1
- package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js +0 -93
- package/node_modules/@zuplo/openapi-tools/dist/url-utils.spec.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-6YPRGG62.js.map +0 -1
- package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js +0 -37
- package/node_modules/@zuplo/runtime/out/esm/chunk-PBDT4FDO.js.map +0 -1
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-YJ2BHVUH.js.map → chunk-CDEAY3VY.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-PBDT4FDO.js.LEGAL.txt → chunk-LVSZ3WTO.js.LEGAL.txt} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-VTO3F6DK.js.map → chunk-NUVXDVLJ.js.map} +0 -0
- /package/node_modules/@zuplo/runtime/out/esm/{chunk-6YPRGG62.js.LEGAL.txt → chunk-RHU3Z7DA.js.LEGAL.txt} +0 -0
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { spawn } from "node:child_process";
|
|
2
|
-
import { access, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
3
|
-
import os from "node:os";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { describe, it } from "node:test";
|
|
6
|
-
import { expect } from "chai";
|
|
7
|
-
import { TEST_OUT_FOLDER } from "../common/constants.js";
|
|
8
|
-
import { supportsTestSkipPattern } from "./invoke-test.js";
|
|
9
|
-
describe("runTests", () => {
|
|
10
|
-
it("runs every compiled test file serially after a failure", async () => {
|
|
11
|
-
const testDir = await mkdtemp(path.join(os.tmpdir(), "zuplo-run-tests-serial-"));
|
|
12
|
-
try {
|
|
13
|
-
const compiledTestDir = path.join(testDir, TEST_OUT_FOLDER);
|
|
14
|
-
const secondTestMarker = path.join(testDir, "second-test-ran");
|
|
15
|
-
await mkdir(compiledTestDir, { recursive: true });
|
|
16
|
-
await writeFile(path.join(compiledTestDir, "a-first.test.mjs"), [
|
|
17
|
-
'import test from "node:test";',
|
|
18
|
-
'test("Moonshot first", () => {',
|
|
19
|
-
' throw new Error("expected failure");',
|
|
20
|
-
"});",
|
|
21
|
-
].join("\n"));
|
|
22
|
-
await writeFile(path.join(compiledTestDir, "b-second.test.mjs"), [
|
|
23
|
-
'import { writeFileSync } from "node:fs";',
|
|
24
|
-
'import test from "node:test";',
|
|
25
|
-
'test("Moonshot second", () => {',
|
|
26
|
-
` writeFileSync(${JSON.stringify(secondTestMarker)}, "ran");`,
|
|
27
|
-
"});",
|
|
28
|
-
].join("\n"));
|
|
29
|
-
const environment = { ...process.env };
|
|
30
|
-
delete environment.NODE_TEST_CONTEXT;
|
|
31
|
-
const invokeTestUrl = new URL("./invoke-test.js", import.meta.url).href;
|
|
32
|
-
const script = [
|
|
33
|
-
`import { runTests } from ${JSON.stringify(invokeTestUrl)};`,
|
|
34
|
-
`const result = await runTests(${JSON.stringify({
|
|
35
|
-
dir: testDir,
|
|
36
|
-
endpoint: "http://localhost",
|
|
37
|
-
filter: "Moonshot",
|
|
38
|
-
testConcurrency: 1,
|
|
39
|
-
})});`,
|
|
40
|
-
"process.exitCode = result.exitCode;",
|
|
41
|
-
].join("\n");
|
|
42
|
-
const exitCode = await new Promise((resolve, reject) => {
|
|
43
|
-
const child = spawn(process.execPath, ["--input-type=module", "--eval", script], {
|
|
44
|
-
env: environment,
|
|
45
|
-
stdio: "ignore",
|
|
46
|
-
});
|
|
47
|
-
child.once("error", reject);
|
|
48
|
-
child.once("exit", resolve);
|
|
49
|
-
});
|
|
50
|
-
expect(exitCode).not.to.equal(0);
|
|
51
|
-
await access(secondTestMarker);
|
|
52
|
-
}
|
|
53
|
-
finally {
|
|
54
|
-
await rm(testDir, { recursive: true, force: true });
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
describe("runTests --only", () => {
|
|
59
|
-
const writeOnlyFixture = async (testDir) => {
|
|
60
|
-
const compiledTestDir = path.join(testDir, TEST_OUT_FOLDER);
|
|
61
|
-
const markedMarker = path.join(testDir, "marked-ran");
|
|
62
|
-
const unmarkedMarker = path.join(testDir, "unmarked-ran");
|
|
63
|
-
await mkdir(compiledTestDir, { recursive: true });
|
|
64
|
-
await writeFile(path.join(compiledTestDir, "marked.test.mjs"), [
|
|
65
|
-
'import { writeFileSync } from "node:fs";',
|
|
66
|
-
'import test from "node:test";',
|
|
67
|
-
'test.only("marked", () => {',
|
|
68
|
-
` writeFileSync(${JSON.stringify(markedMarker)}, "ran");`,
|
|
69
|
-
"});",
|
|
70
|
-
].join("\n"));
|
|
71
|
-
await writeFile(path.join(compiledTestDir, "unmarked.test.mjs"), [
|
|
72
|
-
'import { writeFileSync } from "node:fs";',
|
|
73
|
-
'import test from "node:test";',
|
|
74
|
-
'test("unmarked", () => {',
|
|
75
|
-
` writeFileSync(${JSON.stringify(unmarkedMarker)}, "ran");`,
|
|
76
|
-
"});",
|
|
77
|
-
].join("\n"));
|
|
78
|
-
return { markedMarker, unmarkedMarker };
|
|
79
|
-
};
|
|
80
|
-
const invoke = async (testDir, only) => {
|
|
81
|
-
const environment = { ...process.env };
|
|
82
|
-
delete environment.NODE_TEST_CONTEXT;
|
|
83
|
-
const invokeTestUrl = new URL("./invoke-test.js", import.meta.url).href;
|
|
84
|
-
const script = [
|
|
85
|
-
`import { runTests } from ${JSON.stringify(invokeTestUrl)};`,
|
|
86
|
-
`const result = await runTests(${JSON.stringify({
|
|
87
|
-
dir: testDir,
|
|
88
|
-
endpoint: "http://localhost",
|
|
89
|
-
only,
|
|
90
|
-
})});`,
|
|
91
|
-
"process.exitCode = result.exitCode;",
|
|
92
|
-
].join("\n");
|
|
93
|
-
return await new Promise((resolve, reject) => {
|
|
94
|
-
const child = spawn(process.execPath, ["--input-type=module", "--eval", script], { env: environment, stdio: "ignore" });
|
|
95
|
-
child.once("error", reject);
|
|
96
|
-
child.once("exit", resolve);
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
const ran = async (marker) => {
|
|
100
|
-
try {
|
|
101
|
-
await access(marker);
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
it("runs only the marked test when --only is passed", async () => {
|
|
109
|
-
const testDir = await mkdtemp(path.join(os.tmpdir(), "zuplo-only-on-"));
|
|
110
|
-
try {
|
|
111
|
-
const { markedMarker, unmarkedMarker } = await writeOnlyFixture(testDir);
|
|
112
|
-
const exitCode = await invoke(testDir, true);
|
|
113
|
-
expect(exitCode, "runner exit code").to.equal(0);
|
|
114
|
-
expect(await ran(markedMarker), "marked test ran").to.equal(true);
|
|
115
|
-
expect(await ran(unmarkedMarker), "unmarked test ran").to.equal(false);
|
|
116
|
-
}
|
|
117
|
-
finally {
|
|
118
|
-
await rm(testDir, { recursive: true, force: true });
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
it("runs everything when --only is absent, which is why .only alone is a trap", async () => {
|
|
122
|
-
const testDir = await mkdtemp(path.join(os.tmpdir(), "zuplo-only-off-"));
|
|
123
|
-
try {
|
|
124
|
-
const { markedMarker, unmarkedMarker } = await writeOnlyFixture(testDir);
|
|
125
|
-
const exitCode = await invoke(testDir, false);
|
|
126
|
-
expect(exitCode, "runner exit code").to.equal(0);
|
|
127
|
-
expect(await ran(markedMarker), "marked test ran").to.equal(true);
|
|
128
|
-
expect(await ran(unmarkedMarker), "unmarked test ran").to.equal(true);
|
|
129
|
-
}
|
|
130
|
-
finally {
|
|
131
|
-
await rm(testDir, { recursive: true, force: true });
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
describe("supportsTestSkipPattern", () => {
|
|
136
|
-
it("rejects release lines that never shipped the flag", () => {
|
|
137
|
-
for (const version of ["20.17.0", "20.20.2", "21.7.3", "22.0.0"]) {
|
|
138
|
-
expect(supportsTestSkipPattern(version), version).to.equal(false);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
it("accepts v22.1.0 and later", () => {
|
|
142
|
-
for (const version of ["22.1.0", "22.22.1", "23.0.0", "24.1.0"]) {
|
|
143
|
-
expect(supportsTestSkipPattern(version), version).to.equal(true);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
it("assumes support when the version string is unparseable", () => {
|
|
147
|
-
expect(supportsTestSkipPattern("not-a-version")).to.equal(true);
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
//# sourceMappingURL=invoke-test.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invoke-test.test.js","sourceRoot":"","sources":["../../src/test/invoke-test.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,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,GAAG,EAAE;QAC3D,KAAK,MAAM,OAAO,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;YACjE,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACnC,KAAK,MAAM,OAAO,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;YAChE,MAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAG,EAAE;QAGhE,MAAM,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { spawn } from \"node:child_process\";\nimport { access, mkdir, mkdtemp, rm, writeFile } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { describe, it } from \"node:test\";\nimport { expect } from \"chai\";\nimport { TEST_OUT_FOLDER } from \"../common/constants.js\";\nimport { supportsTestSkipPattern } from \"./invoke-test.js\";\n\ndescribe(\"runTests\", () => {\n it(\"runs every compiled test file serially after a failure\", async () => {\n const testDir = await mkdtemp(\n path.join(os.tmpdir(), \"zuplo-run-tests-serial-\")\n );\n\n try {\n const compiledTestDir = path.join(testDir, TEST_OUT_FOLDER);\n const secondTestMarker = path.join(testDir, \"second-test-ran\");\n await mkdir(compiledTestDir, { recursive: true });\n await writeFile(\n path.join(compiledTestDir, \"a-first.test.mjs\"),\n [\n 'import test from \"node:test\";',\n 'test(\"Moonshot first\", () => {',\n ' throw new Error(\"expected failure\");',\n \"});\",\n ].join(\"\\n\")\n );\n await writeFile(\n path.join(compiledTestDir, \"b-second.test.mjs\"),\n [\n 'import { writeFileSync } from \"node:fs\";',\n 'import test from \"node:test\";',\n 'test(\"Moonshot second\", () => {',\n ` writeFileSync(${JSON.stringify(secondTestMarker)}, \"ran\");`,\n \"});\",\n ].join(\"\\n\")\n );\n\n const environment = { ...process.env };\n delete environment.NODE_TEST_CONTEXT;\n const invokeTestUrl = new URL(\"./invoke-test.js\", import.meta.url).href;\n const script = [\n `import { runTests } from ${JSON.stringify(invokeTestUrl)};`,\n `const result = await runTests(${JSON.stringify({\n dir: testDir,\n endpoint: \"http://localhost\",\n filter: \"Moonshot\",\n testConcurrency: 1,\n })});`,\n \"process.exitCode = result.exitCode;\",\n ].join(\"\\n\");\n const exitCode = await new Promise<number | null>((resolve, reject) => {\n const child = spawn(\n process.execPath,\n [\"--input-type=module\", \"--eval\", script],\n {\n env: environment,\n stdio: \"ignore\",\n }\n );\n child.once(\"error\", reject);\n child.once(\"exit\", resolve);\n });\n\n expect(exitCode).not.to.equal(0);\n await access(secondTestMarker);\n } finally {\n await rm(testDir, { recursive: true, force: true });\n }\n });\n});\n\ndescribe(\"runTests --only\", () => {\n // Without `--test-only`, Node IGNORES the `.only` modifier and runs every\n // test anyway — so `describe.only` used to run the marked suite AND all the\n // others, the silent opposite of the intent. This drives the real runner\n // rather than asserting on the argv we build, because the argv is not the\n // claim: the claim is that the unmarked test does not execute.\n const writeOnlyFixture = async (testDir: string) => {\n const compiledTestDir = path.join(testDir, TEST_OUT_FOLDER);\n const markedMarker = path.join(testDir, \"marked-ran\");\n const unmarkedMarker = path.join(testDir, \"unmarked-ran\");\n await mkdir(compiledTestDir, { recursive: true });\n await writeFile(\n path.join(compiledTestDir, \"marked.test.mjs\"),\n [\n 'import { writeFileSync } from \"node:fs\";',\n 'import test from \"node:test\";',\n 'test.only(\"marked\", () => {',\n ` writeFileSync(${JSON.stringify(markedMarker)}, \"ran\");`,\n \"});\",\n ].join(\"\\n\")\n );\n await writeFile(\n path.join(compiledTestDir, \"unmarked.test.mjs\"),\n [\n 'import { writeFileSync } from \"node:fs\";',\n 'import test from \"node:test\";',\n 'test(\"unmarked\", () => {',\n ` writeFileSync(${JSON.stringify(unmarkedMarker)}, \"ran\");`,\n \"});\",\n ].join(\"\\n\")\n );\n return { markedMarker, unmarkedMarker };\n };\n\n const invoke = async (testDir: string, only: boolean) => {\n const environment = { ...process.env };\n delete environment.NODE_TEST_CONTEXT;\n const invokeTestUrl = new URL(\"./invoke-test.js\", import.meta.url).href;\n const script = [\n `import { runTests } from ${JSON.stringify(invokeTestUrl)};`,\n `const result = await runTests(${JSON.stringify({\n dir: testDir,\n endpoint: \"http://localhost\",\n only,\n })});`,\n \"process.exitCode = result.exitCode;\",\n ].join(\"\\n\");\n return await new Promise<number | null>((resolve, reject) => {\n const child = spawn(\n process.execPath,\n [\"--input-type=module\", \"--eval\", script],\n { env: environment, stdio: \"ignore\" }\n );\n child.once(\"error\", reject);\n child.once(\"exit\", resolve);\n });\n };\n\n const ran = async (marker: string) => {\n try {\n await access(marker);\n return true;\n } catch {\n return false;\n }\n };\n\n it(\"runs only the marked test when --only is passed\", async () => {\n const testDir = await mkdtemp(path.join(os.tmpdir(), \"zuplo-only-on-\"));\n try {\n const { markedMarker, unmarkedMarker } = await writeOnlyFixture(testDir);\n const exitCode = await invoke(testDir, true);\n expect(exitCode, \"runner exit code\").to.equal(0);\n expect(await ran(markedMarker), \"marked test ran\").to.equal(true);\n expect(await ran(unmarkedMarker), \"unmarked test ran\").to.equal(false);\n } finally {\n await rm(testDir, { recursive: true, force: true });\n }\n });\n\n it(\"runs everything when --only is absent, which is why .only alone is a trap\", async () => {\n const testDir = await mkdtemp(path.join(os.tmpdir(), \"zuplo-only-off-\"));\n try {\n const { markedMarker, unmarkedMarker } = await writeOnlyFixture(testDir);\n const exitCode = await invoke(testDir, false);\n expect(exitCode, \"runner exit code\").to.equal(0);\n expect(await ran(markedMarker), \"marked test ran\").to.equal(true);\n expect(await ran(unmarkedMarker), \"unmarked test ran\").to.equal(true);\n } finally {\n await rm(testDir, { recursive: true, force: true });\n }\n });\n});\n\ndescribe(\"supportsTestSkipPattern\", () => {\n // `--skip-filter` maps to Node's `--test-skip-pattern`, which landed in\n // v22.1.0 and was never backported. engines.node is \">=24.0.0\", so the gap is\n // no longer reachable by a supported user; these cases pin the guard's\n // behaviour so the boundary stays correct if the floor ever moves down.\n it(\"rejects release lines that never shipped the flag\", () => {\n for (const version of [\"20.17.0\", \"20.20.2\", \"21.7.3\", \"22.0.0\"]) {\n expect(supportsTestSkipPattern(version), version).to.equal(false);\n }\n });\n\n it(\"accepts v22.1.0 and later\", () => {\n for (const version of [\"22.1.0\", \"22.22.1\", \"23.0.0\", \"24.1.0\"]) {\n expect(supportsTestSkipPattern(version), version).to.equal(true);\n }\n });\n\n it(\"assumes support when the version string is unparseable\", () => {\n // Better to let Node itself reject an unknown flag than to block a valid\n // run because we could not read a version string.\n expect(supportsTestSkipPattern(\"not-a-version\")).to.equal(true);\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-files.test.d.ts","sourceRoot":"","sources":["../../src/test/test-files.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { after, afterEach, before, beforeEach, describe, it } from "node:test";
|
|
5
|
-
import { expect } from "chai";
|
|
6
|
-
import sinon from "sinon";
|
|
7
|
-
import { TEST_IN_FOLDER } from "../common/constants.js";
|
|
8
|
-
import { findTestFiles } from "./test-files.js";
|
|
9
|
-
function createTestFile(filePath) {
|
|
10
|
-
const dir = path.dirname(filePath);
|
|
11
|
-
if (!fs.existsSync(dir)) {
|
|
12
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
13
|
-
}
|
|
14
|
-
fs.writeFileSync(filePath, "// test file");
|
|
15
|
-
}
|
|
16
|
-
describe("findTestFiles", () => {
|
|
17
|
-
const testDir = path.join(os.tmpdir(), "findTestFilesTest");
|
|
18
|
-
const testSubDir = path.join(testDir, TEST_IN_FOLDER);
|
|
19
|
-
const testFilePath = path.join(testSubDir, "example.test.ts");
|
|
20
|
-
before(() => {
|
|
21
|
-
createTestFile(testFilePath);
|
|
22
|
-
});
|
|
23
|
-
after(() => {
|
|
24
|
-
fs.rmSync(testDir, { recursive: true, force: true });
|
|
25
|
-
});
|
|
26
|
-
it("should find test files in the specified directory", () => {
|
|
27
|
-
const result = findTestFiles(testDir);
|
|
28
|
-
const normalizedResult = result.map((p) => path.normalize(p));
|
|
29
|
-
const normalizedExpected = path.normalize(testFilePath);
|
|
30
|
-
expect(normalizedResult).to.include(normalizedExpected);
|
|
31
|
-
});
|
|
32
|
-
it("should return an empty array if no test files are found", () => {
|
|
33
|
-
const emptyDir = path.join(os.tmpdir(), "emptyTestDir");
|
|
34
|
-
fs.mkdirSync(emptyDir, { recursive: true });
|
|
35
|
-
const result = findTestFiles(emptyDir);
|
|
36
|
-
expect(result).to.be.an("array").that.is.empty;
|
|
37
|
-
fs.rmdirSync(emptyDir);
|
|
38
|
-
});
|
|
39
|
-
describe("on Windows", () => {
|
|
40
|
-
let platformStub;
|
|
41
|
-
beforeEach(() => {
|
|
42
|
-
platformStub = sinon.stub(process, "platform").get(() => "win32");
|
|
43
|
-
});
|
|
44
|
-
afterEach(() => {
|
|
45
|
-
platformStub.restore();
|
|
46
|
-
});
|
|
47
|
-
it("should handle Windows paths correctly", () => {
|
|
48
|
-
const windowsPath = testDir.replace(/\//g, "\\");
|
|
49
|
-
expect(windowsPath).to.include("\\");
|
|
50
|
-
const result = findTestFiles(windowsPath);
|
|
51
|
-
const normalizedResult = result.map((p) => path.normalize(p));
|
|
52
|
-
const normalizedExpected = path.normalize(testFilePath);
|
|
53
|
-
expect(normalizedResult).to.include(normalizedExpected);
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=test-files.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-files.test.js","sourceRoot":"","sources":["../../src/test/test-files.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,SAAS,cAAc,CAAC,QAAgB;IACtC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IACD,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC7C,CAAC;AAED,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC;IAE5D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACtD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU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A6B,CAAC;QAElC,UAAU,CAAC,GAAG,EAAE;YACd,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACb,YAAY,CAAC,OAAO,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;YAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACjD,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAErC,MAAM,MAAM,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;YAE1C,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9D,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YACxD,MAAM,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { after, afterEach, before, beforeEach, describe, it } from \"node:test\";\nimport { expect } from \"chai\";\nimport sinon from \"sinon\";\nimport { TEST_IN_FOLDER } from \"../common/constants.js\";\nimport { findTestFiles } from \"./test-files.js\";\n\n// Helper function to create test files for testing\nfunction createTestFile(filePath: string) {\n const dir = path.dirname(filePath);\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n fs.writeFileSync(filePath, \"// test file\");\n}\n\ndescribe(\"findTestFiles\", () => {\n const testDir = path.join(os.tmpdir(), \"findTestFilesTest\");\n // Use the constant for test folder from constants\n const testSubDir = path.join(testDir, TEST_IN_FOLDER);\n const testFilePath = path.join(testSubDir, \"example.test.ts\");\n\n before(() => {\n createTestFile(testFilePath);\n });\n\n after(() => {\n fs.rmSync(testDir, { recursive: true, force: true });\n });\n\n it(\"should find test files in the specified directory\", () => {\n const result = findTestFiles(testDir);\n // Compare using normalized paths to handle platform differences\n const normalizedResult = result.map((p) => path.normalize(p));\n const normalizedExpected = path.normalize(testFilePath);\n expect(normalizedResult).to.include(normalizedExpected);\n });\n\n it(\"should return an empty array if no test files are found\", () => {\n const emptyDir = path.join(os.tmpdir(), \"emptyTestDir\");\n fs.mkdirSync(emptyDir, { recursive: true });\n\n const result = findTestFiles(emptyDir);\n expect(result).to.be.an(\"array\").that.is.empty;\n\n fs.rmdirSync(emptyDir);\n });\n\n // `findTestFiles` picks its path/glob helpers from `process.platform` on\n // every call, so the Windows behaviour is reachable from any runner by\n // stubbing the platform — no real Windows kernel needed. What is actually\n // Windows-specific here is string handling: a backslash-separated directory\n // has to survive `path.win32.normalize` + `fg.win32.convertPathToPattern`\n // and come back out as a forward-slash glob that fast-glob can match. That\n // round trip lands back on forward slashes, so the glob resolves against\n // the POSIX filesystem the test just wrote to and we can assert on real\n // results rather than on the pattern string alone.\n describe(\"on Windows\", () => {\n let platformStub: sinon.SinonStub;\n\n beforeEach(() => {\n platformStub = sinon.stub(process, \"platform\").get(() => \"win32\");\n });\n\n afterEach(() => {\n platformStub.restore();\n });\n\n it(\"should handle Windows paths correctly\", () => {\n const windowsPath = testDir.replace(/\\//g, \"\\\\\");\n expect(windowsPath).to.include(\"\\\\\");\n\n const result = findTestFiles(windowsPath);\n\n const normalizedResult = result.map((p) => path.normalize(p));\n const normalizedExpected = path.normalize(testFilePath);\n expect(normalizedResult).to.include(normalizedExpected);\n });\n });\n});\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-format.spec.d.ts","sourceRoot":"","sources":["../src/file-format.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert";
|
|
2
|
-
import { describe, it } from "node:test";
|
|
3
|
-
import { convertDocument, detectFormatFromContent, detectFormatFromExtension, generateOutputPath, parseContent, serializeContent, } from "./file-format.js";
|
|
4
|
-
describe("File Format Utilities", () => {
|
|
5
|
-
describe("detectFormatFromExtension", () => {
|
|
6
|
-
it("should detect JSON format from .json extension", () => {
|
|
7
|
-
assert.strictEqual(detectFormatFromExtension("api.json"), "json");
|
|
8
|
-
assert.strictEqual(detectFormatFromExtension("/path/to/openapi.json"), "json");
|
|
9
|
-
assert.strictEqual(detectFormatFromExtension("FILE.JSON"), "json");
|
|
10
|
-
});
|
|
11
|
-
it("should detect YAML format from .yaml extension", () => {
|
|
12
|
-
assert.strictEqual(detectFormatFromExtension("api.yaml"), "yaml");
|
|
13
|
-
assert.strictEqual(detectFormatFromExtension("/path/to/openapi.yaml"), "yaml");
|
|
14
|
-
assert.strictEqual(detectFormatFromExtension("FILE.YAML"), "yaml");
|
|
15
|
-
});
|
|
16
|
-
it("should detect YAML format from .yml extension", () => {
|
|
17
|
-
assert.strictEqual(detectFormatFromExtension("api.yml"), "yaml");
|
|
18
|
-
assert.strictEqual(detectFormatFromExtension("/path/to/openapi.yml"), "yaml");
|
|
19
|
-
assert.strictEqual(detectFormatFromExtension("FILE.YML"), "yaml");
|
|
20
|
-
});
|
|
21
|
-
it("should return null for unknown extensions", () => {
|
|
22
|
-
assert.strictEqual(detectFormatFromExtension("api.txt"), null);
|
|
23
|
-
assert.strictEqual(detectFormatFromExtension("api"), null);
|
|
24
|
-
assert.strictEqual(detectFormatFromExtension("api.xml"), null);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
describe("detectFormatFromContent", () => {
|
|
28
|
-
it("should detect JSON content", () => {
|
|
29
|
-
const content = '{"openapi": "3.1.0"}';
|
|
30
|
-
assert.strictEqual(detectFormatFromContent(content), "json");
|
|
31
|
-
});
|
|
32
|
-
it("should detect YAML content", () => {
|
|
33
|
-
const content = "openapi: 3.1.0\ninfo:\n title: Test";
|
|
34
|
-
assert.strictEqual(detectFormatFromContent(content), "yaml");
|
|
35
|
-
});
|
|
36
|
-
it("should throw error for invalid content", () => {
|
|
37
|
-
const content = "not valid json or yaml: : :";
|
|
38
|
-
assert.throws(() => detectFormatFromContent(content), /Failed to parse content/);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
describe("parseContent", () => {
|
|
42
|
-
it("should parse JSON content", () => {
|
|
43
|
-
const content = '{"openapi": "3.1.0", "info": {"title": "Test"}}';
|
|
44
|
-
const result = parseContent(content, "json");
|
|
45
|
-
assert.deepStrictEqual(result, {
|
|
46
|
-
openapi: "3.1.0",
|
|
47
|
-
info: { title: "Test" },
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
it("should parse YAML content", () => {
|
|
51
|
-
const content = `openapi: 3.1.0
|
|
52
|
-
info:
|
|
53
|
-
title: Test
|
|
54
|
-
version: 1.0.0`;
|
|
55
|
-
const result = parseContent(content, "yaml");
|
|
56
|
-
assert.deepStrictEqual(result, {
|
|
57
|
-
openapi: "3.1.0",
|
|
58
|
-
info: { title: "Test", version: "1.0.0" },
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
it("should throw error for invalid JSON", () => {
|
|
62
|
-
const content = "{invalid json}";
|
|
63
|
-
assert.throws(() => parseContent(content, "json"), {
|
|
64
|
-
name: "SyntaxError",
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
it("should throw error for invalid YAML", () => {
|
|
68
|
-
const content = ":\ninvalid: : yaml";
|
|
69
|
-
assert.throws(() => parseContent(content, "yaml"));
|
|
70
|
-
});
|
|
71
|
-
it("should handle arrays", () => {
|
|
72
|
-
const jsonContent = "[1, 2, 3]";
|
|
73
|
-
const yamlContent = "- 1\n- 2\n- 3";
|
|
74
|
-
assert.deepStrictEqual(parseContent(jsonContent, "json"), [1, 2, 3]);
|
|
75
|
-
assert.deepStrictEqual(parseContent(yamlContent, "yaml"), [1, 2, 3]);
|
|
76
|
-
});
|
|
77
|
-
it("should handle nested structures", () => {
|
|
78
|
-
const content = {
|
|
79
|
-
openapi: "3.1.0",
|
|
80
|
-
paths: {
|
|
81
|
-
"/users": {
|
|
82
|
-
get: {
|
|
83
|
-
summary: "Get users",
|
|
84
|
-
parameters: [{ name: "limit", in: "query" }],
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
};
|
|
89
|
-
const jsonContent = JSON.stringify(content);
|
|
90
|
-
const result = parseContent(jsonContent, "json");
|
|
91
|
-
assert.deepStrictEqual(result, content);
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
describe("serializeContent", () => {
|
|
95
|
-
const testDocument = {
|
|
96
|
-
openapi: "3.1.0",
|
|
97
|
-
info: {
|
|
98
|
-
title: "Test API",
|
|
99
|
-
version: "1.0.0",
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
it("should serialize to JSON with proper formatting", () => {
|
|
103
|
-
const result = serializeContent(testDocument, "json");
|
|
104
|
-
assert.strictEqual(typeof result, "string");
|
|
105
|
-
assert.strictEqual(result.includes('"openapi": "3.1.0"'), true);
|
|
106
|
-
assert.strictEqual(result.includes('"title": "Test API"'), true);
|
|
107
|
-
assert.strictEqual(result.endsWith("\n"), true);
|
|
108
|
-
// Verify it's valid JSON
|
|
109
|
-
const parsed = JSON.parse(result);
|
|
110
|
-
assert.deepStrictEqual(parsed, testDocument);
|
|
111
|
-
});
|
|
112
|
-
it("should serialize to YAML with proper formatting", () => {
|
|
113
|
-
const result = serializeContent(testDocument, "yaml");
|
|
114
|
-
assert.strictEqual(typeof result, "string");
|
|
115
|
-
assert.strictEqual(result.includes("openapi: 3.1.0"), true);
|
|
116
|
-
assert.strictEqual(result.includes("title: Test API"), true);
|
|
117
|
-
assert.strictEqual(result.includes("version: 1.0.0"), true);
|
|
118
|
-
});
|
|
119
|
-
it("should handle arrays in JSON", () => {
|
|
120
|
-
const doc = { items: [1, 2, 3] };
|
|
121
|
-
const result = serializeContent(doc, "json");
|
|
122
|
-
assert.strictEqual(result.includes('"items": [\n'), true);
|
|
123
|
-
const parsed = JSON.parse(result);
|
|
124
|
-
assert.deepStrictEqual(parsed, doc);
|
|
125
|
-
});
|
|
126
|
-
it("should handle arrays in YAML", () => {
|
|
127
|
-
const doc = { items: [1, 2, 3] };
|
|
128
|
-
const result = serializeContent(doc, "yaml");
|
|
129
|
-
assert.strictEqual(result.includes("items:"), true);
|
|
130
|
-
assert.strictEqual(result.includes("- 1"), true);
|
|
131
|
-
});
|
|
132
|
-
it("should handle special characters in YAML", () => {
|
|
133
|
-
const doc = {
|
|
134
|
-
description: 'This has a colon: and quotes "test"',
|
|
135
|
-
};
|
|
136
|
-
const result = serializeContent(doc, "yaml");
|
|
137
|
-
assert.strictEqual(typeof result, "string");
|
|
138
|
-
// Should be properly escaped
|
|
139
|
-
assert.strictEqual(result.includes("description:"), true);
|
|
140
|
-
});
|
|
141
|
-
it("should handle null values", () => {
|
|
142
|
-
const doc = { value: null };
|
|
143
|
-
const jsonResult = serializeContent(doc, "json");
|
|
144
|
-
const yamlResult = serializeContent(doc, "yaml");
|
|
145
|
-
assert.strictEqual(jsonResult.includes('"value": null'), true);
|
|
146
|
-
assert.strictEqual(yamlResult.includes("value:"), true);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
describe("convertDocument", () => {
|
|
150
|
-
const testDocument = {
|
|
151
|
-
openapi: "3.1.0",
|
|
152
|
-
info: {
|
|
153
|
-
title: "Test API",
|
|
154
|
-
version: "1.0.0",
|
|
155
|
-
},
|
|
156
|
-
paths: {},
|
|
157
|
-
};
|
|
158
|
-
it("should convert from JSON to YAML", () => {
|
|
159
|
-
const jsonContent = JSON.stringify(testDocument);
|
|
160
|
-
const result = convertDocument(jsonContent, "json", "yaml");
|
|
161
|
-
assert.strictEqual(result.format, "yaml");
|
|
162
|
-
assert.strictEqual(typeof result.content, "string");
|
|
163
|
-
assert.strictEqual(result.content.includes("openapi: 3.1.0"), true);
|
|
164
|
-
assert.strictEqual(result.content.includes("title: Test API"), true);
|
|
165
|
-
});
|
|
166
|
-
it("should convert from YAML to JSON", () => {
|
|
167
|
-
const yamlContent = `openapi: 3.1.0
|
|
168
|
-
info:
|
|
169
|
-
title: Test API
|
|
170
|
-
version: 1.0.0
|
|
171
|
-
paths: {}`;
|
|
172
|
-
const result = convertDocument(yamlContent, "yaml", "json");
|
|
173
|
-
assert.strictEqual(result.format, "json");
|
|
174
|
-
assert.strictEqual(typeof result.content, "string");
|
|
175
|
-
const parsed = JSON.parse(result.content);
|
|
176
|
-
assert.strictEqual(parsed.openapi, "3.1.0");
|
|
177
|
-
assert.strictEqual(parsed.info.title, "Test API");
|
|
178
|
-
});
|
|
179
|
-
it("should preserve data through JSON to YAML to JSON conversion", () => {
|
|
180
|
-
const originalJson = JSON.stringify(testDocument);
|
|
181
|
-
// JSON -> YAML
|
|
182
|
-
const yamlResult = convertDocument(originalJson, "json", "yaml");
|
|
183
|
-
// YAML -> JSON
|
|
184
|
-
const jsonResult = convertDocument(yamlResult.content, "yaml", "json");
|
|
185
|
-
const finalDocument = JSON.parse(jsonResult.content);
|
|
186
|
-
assert.deepStrictEqual(finalDocument, testDocument);
|
|
187
|
-
});
|
|
188
|
-
it("should preserve data through YAML to JSON to YAML conversion", () => {
|
|
189
|
-
const originalYaml = `openapi: 3.1.0
|
|
190
|
-
info:
|
|
191
|
-
title: Test API
|
|
192
|
-
version: 1.0.0
|
|
193
|
-
paths: {}`;
|
|
194
|
-
// Parse original to compare
|
|
195
|
-
const originalDoc = parseContent(originalYaml, "yaml");
|
|
196
|
-
// YAML -> JSON
|
|
197
|
-
const jsonResult = convertDocument(originalYaml, "yaml", "json");
|
|
198
|
-
// JSON -> YAML
|
|
199
|
-
const yamlResult = convertDocument(jsonResult.content, "json", "yaml");
|
|
200
|
-
const finalDocument = parseContent(yamlResult.content, "yaml");
|
|
201
|
-
assert.deepStrictEqual(finalDocument, originalDoc);
|
|
202
|
-
});
|
|
203
|
-
it("should handle complex nested structures", () => {
|
|
204
|
-
const complexDoc = {
|
|
205
|
-
openapi: "3.1.0",
|
|
206
|
-
paths: {
|
|
207
|
-
"/users/{id}": {
|
|
208
|
-
get: {
|
|
209
|
-
parameters: [
|
|
210
|
-
{ name: "id", in: "path", required: true },
|
|
211
|
-
{ name: "fields", in: "query", required: false },
|
|
212
|
-
],
|
|
213
|
-
responses: {
|
|
214
|
-
"200": {
|
|
215
|
-
description: "Success",
|
|
216
|
-
content: {
|
|
217
|
-
"application/json": {
|
|
218
|
-
schema: {
|
|
219
|
-
type: "object",
|
|
220
|
-
properties: {
|
|
221
|
-
id: { type: "string" },
|
|
222
|
-
name: { type: "string" },
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
const jsonContent = JSON.stringify(complexDoc);
|
|
234
|
-
const yamlResult = convertDocument(jsonContent, "json", "yaml");
|
|
235
|
-
const backToJson = convertDocument(yamlResult.content, "yaml", "json");
|
|
236
|
-
const finalDoc = JSON.parse(backToJson.content);
|
|
237
|
-
assert.deepStrictEqual(finalDoc, complexDoc);
|
|
238
|
-
});
|
|
239
|
-
it("should handle empty objects and arrays", () => {
|
|
240
|
-
const doc = {
|
|
241
|
-
empty_object: {},
|
|
242
|
-
empty_array: [],
|
|
243
|
-
nested: {
|
|
244
|
-
also_empty: {},
|
|
245
|
-
},
|
|
246
|
-
};
|
|
247
|
-
const jsonContent = JSON.stringify(doc);
|
|
248
|
-
const yamlResult = convertDocument(jsonContent, "json", "yaml");
|
|
249
|
-
const backToJson = convertDocument(yamlResult.content, "yaml", "json");
|
|
250
|
-
const finalDoc = JSON.parse(backToJson.content);
|
|
251
|
-
assert.deepStrictEqual(finalDoc, doc);
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
describe("generateOutputPath", () => {
|
|
255
|
-
it("should replace .json with .yaml", () => {
|
|
256
|
-
assert.strictEqual(generateOutputPath("api.json", "yaml"), "api.yaml");
|
|
257
|
-
});
|
|
258
|
-
it("should replace .yaml with .json", () => {
|
|
259
|
-
assert.strictEqual(generateOutputPath("api.yaml", "json"), "api.json");
|
|
260
|
-
});
|
|
261
|
-
it("should replace .yml with .json", () => {
|
|
262
|
-
assert.strictEqual(generateOutputPath("api.yml", "json"), "api.json");
|
|
263
|
-
});
|
|
264
|
-
it("should handle paths with directories", () => {
|
|
265
|
-
assert.strictEqual(generateOutputPath("/path/to/api.json", "yaml"), "/path/to/api.yaml");
|
|
266
|
-
assert.strictEqual(generateOutputPath("/path/to/api.yaml", "json"), "/path/to/api.json");
|
|
267
|
-
});
|
|
268
|
-
it("should handle relative paths", () => {
|
|
269
|
-
assert.strictEqual(generateOutputPath("./docs/api.json", "yaml"), "./docs/api.yaml");
|
|
270
|
-
assert.strictEqual(generateOutputPath("../specs/api.yaml", "json"), "../specs/api.json");
|
|
271
|
-
});
|
|
272
|
-
it("should handle files with multiple dots in name", () => {
|
|
273
|
-
assert.strictEqual(generateOutputPath("api.v1.0.json", "yaml"), "api.v1.0.yaml");
|
|
274
|
-
assert.strictEqual(generateOutputPath("my.api.spec.yaml", "json"), "my.api.spec.json");
|
|
275
|
-
});
|
|
276
|
-
it("should append extension if file has no extension", () => {
|
|
277
|
-
assert.strictEqual(generateOutputPath("api", "json"), "api.json");
|
|
278
|
-
assert.strictEqual(generateOutputPath("openapi", "yaml"), "openapi.yaml");
|
|
279
|
-
});
|
|
280
|
-
it("should handle Windows-style paths", () => {
|
|
281
|
-
assert.strictEqual(generateOutputPath("C:\\Users\\docs\\api.json", "yaml"), "C:\\Users\\docs\\api.yaml");
|
|
282
|
-
});
|
|
283
|
-
it("should always use .yaml extension (not .yml) for yaml output", () => {
|
|
284
|
-
assert.strictEqual(generateOutputPath("api.yml", "yaml"), "api.yaml");
|
|
285
|
-
assert.strictEqual(generateOutputPath("api.json", "yaml"), "api.yaml");
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
});
|
|
289
|
-
//# sourceMappingURL=file-format.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-format.spec.js","sourceRoot":"","sources":["../src/file-format.spec.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACzC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,CAAC,WAAW,CAChB,yBAAyB,CAAC,uBAAuB,CAAC,EAClD,MAAM,CACP,CAAC;YACF,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,CAAC,WAAW,CAChB,yBAAyB,CAAC,uBAAuB,CAAC,EAClD,MAAM,CACP,CAAC;YACF,MAAM,CAAC,WAAW,CAAC,yBAAyB,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC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