@inluxc/propmaster 0.0.0-stage → 1.0.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/LICENSE +21 -0
- package/README.md +696 -2
- package/dist/src/annotations/index.d.ts +11 -0
- package/dist/src/annotations/index.d.ts.map +1 -0
- package/dist/src/annotations/index.js +11 -0
- package/dist/src/annotations/index.js.map +1 -0
- package/dist/src/annotations/recorder.d.ts +57 -0
- package/dist/src/annotations/recorder.d.ts.map +1 -0
- package/dist/src/annotations/recorder.js +100 -0
- package/dist/src/annotations/recorder.js.map +1 -0
- package/dist/src/annotations/truncation.d.ts +34 -0
- package/dist/src/annotations/truncation.d.ts.map +1 -0
- package/dist/src/annotations/truncation.js +54 -0
- package/dist/src/annotations/truncation.js.map +1 -0
- package/dist/src/auth/apply.d.ts +15 -0
- package/dist/src/auth/apply.d.ts.map +1 -0
- package/dist/src/auth/apply.js +21 -0
- package/dist/src/auth/apply.js.map +1 -0
- package/dist/src/auth/setup.d.ts +56 -0
- package/dist/src/auth/setup.d.ts.map +1 -0
- package/dist/src/auth/setup.js +79 -0
- package/dist/src/auth/setup.js.map +1 -0
- package/dist/src/auth/state-file.d.ts +8 -0
- package/dist/src/auth/state-file.d.ts.map +1 -0
- package/dist/src/auth/state-file.js +13 -0
- package/dist/src/auth/state-file.js.map +1 -0
- package/dist/src/auth/token-manager.d.ts +61 -0
- package/dist/src/auth/token-manager.d.ts.map +1 -0
- package/dist/src/auth/token-manager.js +200 -0
- package/dist/src/auth/token-manager.js.map +1 -0
- package/dist/src/cli/banner.d.ts +23 -0
- package/dist/src/cli/banner.d.ts.map +1 -0
- package/dist/src/cli/banner.js +67 -0
- package/dist/src/cli/banner.js.map +1 -0
- package/dist/src/cli/check-tests.d.ts +143 -0
- package/dist/src/cli/check-tests.d.ts.map +1 -0
- package/dist/src/cli/check-tests.js +541 -0
- package/dist/src/cli/check-tests.js.map +1 -0
- package/dist/src/cli/coverage.d.ts +14 -0
- package/dist/src/cli/coverage.d.ts.map +1 -0
- package/dist/src/cli/coverage.js +97 -0
- package/dist/src/cli/coverage.js.map +1 -0
- package/dist/src/cli/doctor.d.ts +82 -0
- package/dist/src/cli/doctor.d.ts.map +1 -0
- package/dist/src/cli/doctor.js +656 -0
- package/dist/src/cli/doctor.js.map +1 -0
- package/dist/src/cli/env.d.ts +76 -0
- package/dist/src/cli/env.d.ts.map +1 -0
- package/dist/src/cli/env.js +344 -0
- package/dist/src/cli/env.js.map +1 -0
- package/dist/src/cli/failures.d.ts +29 -0
- package/dist/src/cli/failures.d.ts.map +1 -0
- package/dist/src/cli/failures.js +114 -0
- package/dist/src/cli/failures.js.map +1 -0
- package/dist/src/cli/fixture-catalog.d.ts +83 -0
- package/dist/src/cli/fixture-catalog.d.ts.map +1 -0
- package/dist/src/cli/fixture-catalog.js +773 -0
- package/dist/src/cli/fixture-catalog.js.map +1 -0
- package/dist/src/cli/fixture.d.ts +149 -0
- package/dist/src/cli/fixture.d.ts.map +1 -0
- package/dist/src/cli/fixture.js +742 -0
- package/dist/src/cli/fixture.js.map +1 -0
- package/dist/src/cli/flaky.d.ts +25 -0
- package/dist/src/cli/flaky.d.ts.map +1 -0
- package/dist/src/cli/flaky.js +96 -0
- package/dist/src/cli/flaky.js.map +1 -0
- package/dist/src/cli/generate.d.ts +37 -0
- package/dist/src/cli/generate.d.ts.map +1 -0
- package/dist/src/cli/generate.js +230 -0
- package/dist/src/cli/generate.js.map +1 -0
- package/dist/src/cli/init.d.ts +36 -0
- package/dist/src/cli/init.d.ts.map +1 -0
- package/dist/src/cli/init.js +1039 -0
- package/dist/src/cli/init.js.map +1 -0
- package/dist/src/cli/json-edit.d.ts +58 -0
- package/dist/src/cli/json-edit.d.ts.map +1 -0
- package/dist/src/cli/json-edit.js +250 -0
- package/dist/src/cli/json-edit.js.map +1 -0
- package/dist/src/cli/layout.d.ts +31 -0
- package/dist/src/cli/layout.d.ts.map +1 -0
- package/dist/src/cli/layout.js +175 -0
- package/dist/src/cli/layout.js.map +1 -0
- package/dist/src/cli/mcp-setup.d.ts +141 -0
- package/dist/src/cli/mcp-setup.d.ts.map +1 -0
- package/dist/src/cli/mcp-setup.js +548 -0
- package/dist/src/cli/mcp-setup.js.map +1 -0
- package/dist/src/cli/organize.d.ts +136 -0
- package/dist/src/cli/organize.d.ts.map +1 -0
- package/dist/src/cli/organize.js +467 -0
- package/dist/src/cli/organize.js.map +1 -0
- package/dist/src/cli/prompts.d.ts +102 -0
- package/dist/src/cli/prompts.d.ts.map +1 -0
- package/dist/src/cli/prompts.js +346 -0
- package/dist/src/cli/prompts.js.map +1 -0
- package/dist/src/cli/standards.d.ts +160 -0
- package/dist/src/cli/standards.d.ts.map +1 -0
- package/dist/src/cli/standards.js +389 -0
- package/dist/src/cli/standards.js.map +1 -0
- package/dist/src/cli/style.d.ts +28 -0
- package/dist/src/cli/style.d.ts.map +1 -0
- package/dist/src/cli/style.js +57 -0
- package/dist/src/cli/style.js.map +1 -0
- package/dist/src/config/env-loader.d.ts +33 -0
- package/dist/src/config/env-loader.d.ts.map +1 -0
- package/dist/src/config/env-loader.js +72 -0
- package/dist/src/config/env-loader.js.map +1 -0
- package/dist/src/config/index.d.ts +10 -0
- package/dist/src/config/index.d.ts.map +1 -0
- package/dist/src/config/index.js +10 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/loader.d.ts +66 -0
- package/dist/src/config/loader.d.ts.map +1 -0
- package/dist/src/config/loader.js +810 -0
- package/dist/src/config/loader.js.map +1 -0
- package/dist/src/config/schema.d.ts +596 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +9 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/containers/container-manager.d.ts +157 -0
- package/dist/src/containers/container-manager.d.ts.map +1 -0
- package/dist/src/containers/container-manager.js +627 -0
- package/dist/src/containers/container-manager.js.map +1 -0
- package/dist/src/coverage/code-coverage.d.ts +89 -0
- package/dist/src/coverage/code-coverage.d.ts.map +1 -0
- package/dist/src/coverage/code-coverage.js +395 -0
- package/dist/src/coverage/code-coverage.js.map +1 -0
- package/dist/src/coverage/inventory.d.ts +80 -0
- package/dist/src/coverage/inventory.d.ts.map +1 -0
- package/dist/src/coverage/inventory.js +417 -0
- package/dist/src/coverage/inventory.js.map +1 -0
- package/dist/src/coverage/languages.d.ts +34 -0
- package/dist/src/coverage/languages.d.ts.map +1 -0
- package/dist/src/coverage/languages.js +156 -0
- package/dist/src/coverage/languages.js.map +1 -0
- package/dist/src/coverage/report.d.ts +128 -0
- package/dist/src/coverage/report.d.ts.map +1 -0
- package/dist/src/coverage/report.js +472 -0
- package/dist/src/coverage/report.js.map +1 -0
- package/dist/src/errors.d.ts +164 -0
- package/dist/src/errors.d.ts.map +1 -0
- package/dist/src/errors.js +267 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/fixtures/amqp.fixture.d.ts +163 -0
- package/dist/src/fixtures/amqp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/amqp.fixture.js +494 -0
- package/dist/src/fixtures/amqp.fixture.js.map +1 -0
- package/dist/src/fixtures/appium.fixture.d.ts +112 -0
- package/dist/src/fixtures/appium.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/appium.fixture.js +309 -0
- package/dist/src/fixtures/appium.fixture.js.map +1 -0
- package/dist/src/fixtures/aws.d.ts +44 -0
- package/dist/src/fixtures/aws.d.ts.map +1 -0
- package/dist/src/fixtures/aws.js +93 -0
- package/dist/src/fixtures/aws.js.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts +179 -0
- package/dist/src/fixtures/cassandra.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/cassandra.fixture.js +489 -0
- package/dist/src/fixtures/cassandra.fixture.js.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts +171 -0
- package/dist/src/fixtures/clickhouse.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/clickhouse.fixture.js +514 -0
- package/dist/src/fixtures/clickhouse.fixture.js.map +1 -0
- package/dist/src/fixtures/database.fixture.d.ts +63 -0
- package/dist/src/fixtures/database.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/database.fixture.js +407 -0
- package/dist/src/fixtures/database.fixture.js.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts +243 -0
- package/dist/src/fixtures/dynamodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/dynamodb.fixture.js +580 -0
- package/dist/src/fixtures/dynamodb.fixture.js.map +1 -0
- package/dist/src/fixtures/graphql.fixture.d.ts +107 -0
- package/dist/src/fixtures/graphql.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/graphql.fixture.js +158 -0
- package/dist/src/fixtures/graphql.fixture.js.map +1 -0
- package/dist/src/fixtures/grpc.fixture.d.ts +167 -0
- package/dist/src/fixtures/grpc.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/grpc.fixture.js +635 -0
- package/dist/src/fixtures/grpc.fixture.js.map +1 -0
- package/dist/src/fixtures/inbox.fixture.d.ts +136 -0
- package/dist/src/fixtures/inbox.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/inbox.fixture.js +239 -0
- package/dist/src/fixtures/inbox.fixture.js.map +1 -0
- package/dist/src/fixtures/index.d.ts +174 -0
- package/dist/src/fixtures/index.d.ts.map +1 -0
- package/dist/src/fixtures/index.js +379 -0
- package/dist/src/fixtures/index.js.map +1 -0
- package/dist/src/fixtures/kafka-driver.d.ts +108 -0
- package/dist/src/fixtures/kafka-driver.d.ts.map +1 -0
- package/dist/src/fixtures/kafka-driver.js +113 -0
- package/dist/src/fixtures/kafka-driver.js.map +1 -0
- package/dist/src/fixtures/kafka.fixture.d.ts +75 -0
- package/dist/src/fixtures/kafka.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/kafka.fixture.js +188 -0
- package/dist/src/fixtures/kafka.fixture.js.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts +142 -0
- package/dist/src/fixtures/mock-server.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mock-server.fixture.js +271 -0
- package/dist/src/fixtures/mock-server.fixture.js.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts +121 -0
- package/dist/src/fixtures/mongodb.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/mongodb.fixture.js +258 -0
- package/dist/src/fixtures/mongodb.fixture.js.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts +72 -0
- package/dist/src/fixtures/neo4j.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/neo4j.fixture.js +202 -0
- package/dist/src/fixtures/neo4j.fixture.js.map +1 -0
- package/dist/src/fixtures/openapi.fixture.d.ts +101 -0
- package/dist/src/fixtures/openapi.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/openapi.fixture.js +266 -0
- package/dist/src/fixtures/openapi.fixture.js.map +1 -0
- package/dist/src/fixtures/optional-package.d.ts +54 -0
- package/dist/src/fixtures/optional-package.d.ts.map +1 -0
- package/dist/src/fixtures/optional-package.js +79 -0
- package/dist/src/fixtures/optional-package.js.map +1 -0
- package/dist/src/fixtures/otp.fixture.d.ts +60 -0
- package/dist/src/fixtures/otp.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/otp.fixture.js +101 -0
- package/dist/src/fixtures/otp.fixture.js.map +1 -0
- package/dist/src/fixtures/realtime.fixture.d.ts +205 -0
- package/dist/src/fixtures/realtime.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/realtime.fixture.js +606 -0
- package/dist/src/fixtures/realtime.fixture.js.map +1 -0
- package/dist/src/fixtures/redis.fixture.d.ts +55 -0
- package/dist/src/fixtures/redis.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/redis.fixture.js +209 -0
- package/dist/src/fixtures/redis.fixture.js.map +1 -0
- package/dist/src/fixtures/s3.fixture.d.ts +126 -0
- package/dist/src/fixtures/s3.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/s3.fixture.js +296 -0
- package/dist/src/fixtures/s3.fixture.js.map +1 -0
- package/dist/src/fixtures/search.fixture.d.ts +178 -0
- package/dist/src/fixtures/search.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/search.fixture.js +472 -0
- package/dist/src/fixtures/search.fixture.js.map +1 -0
- package/dist/src/fixtures/sqs.fixture.d.ts +172 -0
- package/dist/src/fixtures/sqs.fixture.d.ts.map +1 -0
- package/dist/src/fixtures/sqs.fixture.js +428 -0
- package/dist/src/fixtures/sqs.fixture.js.map +1 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +48 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/guards.d.ts +21 -0
- package/dist/src/mcp/guards.d.ts.map +1 -0
- package/dist/src/mcp/guards.js +118 -0
- package/dist/src/mcp/guards.js.map +1 -0
- package/dist/src/mcp/project-tools.d.ts +14 -0
- package/dist/src/mcp/project-tools.d.ts.map +1 -0
- package/dist/src/mcp/project-tools.js +252 -0
- package/dist/src/mcp/project-tools.js.map +1 -0
- package/dist/src/mcp/protocol.d.ts +116 -0
- package/dist/src/mcp/protocol.d.ts.map +1 -0
- package/dist/src/mcp/protocol.js +199 -0
- package/dist/src/mcp/protocol.js.map +1 -0
- package/dist/src/mcp/server.d.ts +43 -0
- package/dist/src/mcp/server.d.ts.map +1 -0
- package/dist/src/mcp/server.js +244 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/test-tools.d.ts +65 -0
- package/dist/src/mcp/test-tools.d.ts.map +1 -0
- package/dist/src/mcp/test-tools.js +380 -0
- package/dist/src/mcp/test-tools.js.map +1 -0
- package/dist/src/mcp/tools.d.ts +49 -0
- package/dist/src/mcp/tools.d.ts.map +1 -0
- package/dist/src/mcp/tools.js +726 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/network-error.d.ts +11 -0
- package/dist/src/network-error.d.ts.map +1 -0
- package/dist/src/network-error.js +34 -0
- package/dist/src/network-error.js.map +1 -0
- package/dist/src/openapi/contract.d.ts +98 -0
- package/dist/src/openapi/contract.d.ts.map +1 -0
- package/dist/src/openapi/contract.js +407 -0
- package/dist/src/openapi/contract.js.map +1 -0
- package/dist/src/openapi/generate.d.ts +89 -0
- package/dist/src/openapi/generate.d.ts.map +1 -0
- package/dist/src/openapi/generate.js +607 -0
- package/dist/src/openapi/generate.js.map +1 -0
- package/dist/src/openapi/load.d.ts +8 -0
- package/dist/src/openapi/load.d.ts.map +1 -0
- package/dist/src/openapi/load.js +26 -0
- package/dist/src/openapi/load.js.map +1 -0
- package/dist/src/package-manager.d.ts +58 -0
- package/dist/src/package-manager.d.ts.map +1 -0
- package/dist/src/package-manager.js +137 -0
- package/dist/src/package-manager.js.map +1 -0
- package/dist/src/reporter/history.d.ts +85 -0
- package/dist/src/reporter/history.d.ts.map +1 -0
- package/dist/src/reporter/history.js +147 -0
- package/dist/src/reporter/history.js.map +1 -0
- package/dist/src/reporter/index.d.ts +59 -0
- package/dist/src/reporter/index.d.ts.map +1 -0
- package/dist/src/reporter/index.js +201 -0
- package/dist/src/reporter/index.js.map +1 -0
- package/dist/src/reporter/last-run.d.ts +88 -0
- package/dist/src/reporter/last-run.d.ts.map +1 -0
- package/dist/src/reporter/last-run.js +133 -0
- package/dist/src/reporter/last-run.js.map +1 -0
- package/dist/src/reporter/quarantine.d.ts +62 -0
- package/dist/src/reporter/quarantine.d.ts.map +1 -0
- package/dist/src/reporter/quarantine.js +148 -0
- package/dist/src/reporter/quarantine.js.map +1 -0
- package/dist/src/secrets/index.d.ts +4 -0
- package/dist/src/secrets/index.d.ts.map +1 -0
- package/dist/src/secrets/index.js +3 -0
- package/dist/src/secrets/index.js.map +1 -0
- package/dist/src/secrets/provider.interface.d.ts +30 -0
- package/dist/src/secrets/provider.interface.d.ts.map +1 -0
- package/dist/src/secrets/provider.interface.js +2 -0
- package/dist/src/secrets/provider.interface.js.map +1 -0
- package/dist/src/secrets/providers/aws.provider.d.ts +33 -0
- package/dist/src/secrets/providers/aws.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/aws.provider.js +88 -0
- package/dist/src/secrets/providers/aws.provider.js.map +1 -0
- package/dist/src/secrets/providers/azure.provider.d.ts +26 -0
- package/dist/src/secrets/providers/azure.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/azure.provider.js +71 -0
- package/dist/src/secrets/providers/azure.provider.js.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts +29 -0
- package/dist/src/secrets/providers/env-file.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/env-file.provider.js +56 -0
- package/dist/src/secrets/providers/env-file.provider.js.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts +26 -0
- package/dist/src/secrets/providers/gitlab.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/gitlab.provider.js +67 -0
- package/dist/src/secrets/providers/gitlab.provider.js.map +1 -0
- package/dist/src/secrets/providers/index.d.ts +52 -0
- package/dist/src/secrets/providers/index.d.ts.map +1 -0
- package/dist/src/secrets/providers/index.js +81 -0
- package/dist/src/secrets/providers/index.js.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts +28 -0
- package/dist/src/secrets/providers/openbao.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/openbao.provider.js +29 -0
- package/dist/src/secrets/providers/openbao.provider.js.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts +140 -0
- package/dist/src/secrets/providers/vault-compatible.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault-compatible.js +405 -0
- package/dist/src/secrets/providers/vault-compatible.js.map +1 -0
- package/dist/src/secrets/providers/vault.provider.d.ts +27 -0
- package/dist/src/secrets/providers/vault.provider.d.ts.map +1 -0
- package/dist/src/secrets/providers/vault.provider.js +23 -0
- package/dist/src/secrets/providers/vault.provider.js.map +1 -0
- package/dist/src/secrets/secrets-manager.d.ts +67 -0
- package/dist/src/secrets/secrets-manager.d.ts.map +1 -0
- package/dist/src/secrets/secrets-manager.js +255 -0
- package/dist/src/secrets/secrets-manager.js.map +1 -0
- package/dist/src/steps/amqp.steps.d.ts +37 -0
- package/dist/src/steps/amqp.steps.d.ts.map +1 -0
- package/dist/src/steps/amqp.steps.js +86 -0
- package/dist/src/steps/amqp.steps.js.map +1 -0
- package/dist/src/steps/appium.steps.d.ts +53 -0
- package/dist/src/steps/appium.steps.d.ts.map +1 -0
- package/dist/src/steps/appium.steps.js +109 -0
- package/dist/src/steps/appium.steps.js.map +1 -0
- package/dist/src/steps/aws.steps.d.ts +47 -0
- package/dist/src/steps/aws.steps.d.ts.map +1 -0
- package/dist/src/steps/aws.steps.js +116 -0
- package/dist/src/steps/aws.steps.js.map +1 -0
- package/dist/src/steps/browser.steps.d.ts +54 -0
- package/dist/src/steps/browser.steps.d.ts.map +1 -0
- package/dist/src/steps/browser.steps.js +102 -0
- package/dist/src/steps/browser.steps.js.map +1 -0
- package/dist/src/steps/cassandra.steps.d.ts +32 -0
- package/dist/src/steps/cassandra.steps.d.ts.map +1 -0
- package/dist/src/steps/cassandra.steps.js +81 -0
- package/dist/src/steps/cassandra.steps.js.map +1 -0
- package/dist/src/steps/clickhouse.steps.d.ts +30 -0
- package/dist/src/steps/clickhouse.steps.d.ts.map +1 -0
- package/dist/src/steps/clickhouse.steps.js +73 -0
- package/dist/src/steps/clickhouse.steps.js.map +1 -0
- package/dist/src/steps/database.steps.d.ts +43 -0
- package/dist/src/steps/database.steps.d.ts.map +1 -0
- package/dist/src/steps/database.steps.js +79 -0
- package/dist/src/steps/database.steps.js.map +1 -0
- package/dist/src/steps/dynamodb.steps.d.ts +32 -0
- package/dist/src/steps/dynamodb.steps.d.ts.map +1 -0
- package/dist/src/steps/dynamodb.steps.js +89 -0
- package/dist/src/steps/dynamodb.steps.js.map +1 -0
- package/dist/src/steps/graphql.steps.d.ts +60 -0
- package/dist/src/steps/graphql.steps.d.ts.map +1 -0
- package/dist/src/steps/graphql.steps.js +76 -0
- package/dist/src/steps/graphql.steps.js.map +1 -0
- package/dist/src/steps/grpc.steps.d.ts +29 -0
- package/dist/src/steps/grpc.steps.d.ts.map +1 -0
- package/dist/src/steps/grpc.steps.js +68 -0
- package/dist/src/steps/grpc.steps.js.map +1 -0
- package/dist/src/steps/inbox.steps.d.ts +30 -0
- package/dist/src/steps/inbox.steps.d.ts.map +1 -0
- package/dist/src/steps/inbox.steps.js +72 -0
- package/dist/src/steps/inbox.steps.js.map +1 -0
- package/dist/src/steps/index.d.ts +43 -0
- package/dist/src/steps/index.d.ts.map +1 -0
- package/dist/src/steps/index.js +26 -0
- package/dist/src/steps/index.js.map +1 -0
- package/dist/src/steps/kafka.steps.d.ts +56 -0
- package/dist/src/steps/kafka.steps.d.ts.map +1 -0
- package/dist/src/steps/kafka.steps.js +61 -0
- package/dist/src/steps/kafka.steps.js.map +1 -0
- package/dist/src/steps/mock-server.steps.d.ts +21 -0
- package/dist/src/steps/mock-server.steps.d.ts.map +1 -0
- package/dist/src/steps/mock-server.steps.js +45 -0
- package/dist/src/steps/mock-server.steps.js.map +1 -0
- package/dist/src/steps/mongodb.steps.d.ts +107 -0
- package/dist/src/steps/mongodb.steps.d.ts.map +1 -0
- package/dist/src/steps/mongodb.steps.js +117 -0
- package/dist/src/steps/mongodb.steps.js.map +1 -0
- package/dist/src/steps/openapi.steps.d.ts +49 -0
- package/dist/src/steps/openapi.steps.d.ts.map +1 -0
- package/dist/src/steps/openapi.steps.js +113 -0
- package/dist/src/steps/openapi.steps.js.map +1 -0
- package/dist/src/steps/otp.steps.d.ts +43 -0
- package/dist/src/steps/otp.steps.d.ts.map +1 -0
- package/dist/src/steps/otp.steps.js +83 -0
- package/dist/src/steps/otp.steps.js.map +1 -0
- package/dist/src/steps/realtime.steps.d.ts +40 -0
- package/dist/src/steps/realtime.steps.d.ts.map +1 -0
- package/dist/src/steps/realtime.steps.js +116 -0
- package/dist/src/steps/realtime.steps.js.map +1 -0
- package/dist/src/steps/redis.steps.d.ts +54 -0
- package/dist/src/steps/redis.steps.d.ts.map +1 -0
- package/dist/src/steps/redis.steps.js +89 -0
- package/dist/src/steps/redis.steps.js.map +1 -0
- package/dist/src/steps/search.steps.d.ts +23 -0
- package/dist/src/steps/search.steps.d.ts.map +1 -0
- package/dist/src/steps/search.steps.js +54 -0
- package/dist/src/steps/search.steps.js.map +1 -0
- package/dist/src/test-data/factory.d.ts +82 -0
- package/dist/src/test-data/factory.d.ts.map +1 -0
- package/dist/src/test-data/factory.js +116 -0
- package/dist/src/test-data/factory.js.map +1 -0
- package/dist/src/test-data/index.d.ts +4 -0
- package/dist/src/test-data/index.d.ts.map +1 -0
- package/dist/src/test-data/index.js +4 -0
- package/dist/src/test-data/index.js.map +1 -0
- package/dist/src/test-data/registry.d.ts +37 -0
- package/dist/src/test-data/registry.d.ts.map +1 -0
- package/dist/src/test-data/registry.js +51 -0
- package/dist/src/test-data/registry.js.map +1 -0
- package/dist/src/test-data/tracking.d.ts +47 -0
- package/dist/src/test-data/tracking.d.ts.map +1 -0
- package/dist/src/test-data/tracking.js +166 -0
- package/dist/src/test-data/tracking.js.map +1 -0
- package/environments.json +263 -0
- package/package.json +299 -5
|
@@ -0,0 +1,656 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `propmaster doctor`: finds what's wrong with a project's setup before a
|
|
3
|
+
* test run does, says how to fix each problem, and with `--fix` applies the
|
|
4
|
+
* safe fixes (installing a missing driver, adding a missing config block,
|
|
5
|
+
* keeping .env files out of git, matching the CI image to Playwright).
|
|
6
|
+
*
|
|
7
|
+
* Each check returns findings: ok, warn (works, but look at it), fail (tests
|
|
8
|
+
* will break) or skip. The exit code is 1 while a failure remains.
|
|
9
|
+
*/
|
|
10
|
+
import { spawnSync } from 'node:child_process';
|
|
11
|
+
import * as fs from 'node:fs';
|
|
12
|
+
import { createRequire } from 'node:module';
|
|
13
|
+
import * as net from 'node:net';
|
|
14
|
+
import * as os from 'node:os';
|
|
15
|
+
import * as path from 'node:path';
|
|
16
|
+
import { checkQuarantine, collect, findProjectRoot } from './check-tests.js';
|
|
17
|
+
import { FIXTURE_CATALOG, PLACEHOLDER } from './fixture-catalog.js';
|
|
18
|
+
import { COMPOSE_FILE, ENVIRONMENTS_FILE, applyPlan, hasService, inheritRunner, installedPackages, packageCommand, packageManager, planAdd, testFixtures, } from './fixture.js';
|
|
19
|
+
import { gitIgnores, isProduction } from './env.js';
|
|
20
|
+
import { valueAt } from './json-edit.js';
|
|
21
|
+
import { adaptCommands, bunRuntimeProblem, execCommand, installedPackageDir, rebuildCommand } from '../package-manager.js';
|
|
22
|
+
import { ConfigLoader } from '../config/loader.js';
|
|
23
|
+
import { styleFor } from './style.js';
|
|
24
|
+
/** Drivers with a native binding their install script builds or downloads, and where it ends up. */
|
|
25
|
+
const NATIVE_BINDINGS = {
|
|
26
|
+
'@confluentinc/kafka-javascript': 'build/Release/confluent-kafka-javascript.node',
|
|
27
|
+
};
|
|
28
|
+
/** Propmaster's own Node.js requirement. */
|
|
29
|
+
export const MIN_NODE = '22.12.0';
|
|
30
|
+
const ok = (check, message) => ({ check, status: 'ok', message });
|
|
31
|
+
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
32
|
+
function compareVersions(a, b) {
|
|
33
|
+
const pa = a.split('.').map((n) => parseInt(n, 10) || 0);
|
|
34
|
+
const pb = b.split('.').map((n) => parseInt(n, 10) || 0);
|
|
35
|
+
for (let i = 0; i < 3; i++)
|
|
36
|
+
if ((pa[i] ?? 0) !== (pb[i] ?? 0))
|
|
37
|
+
return (pa[i] ?? 0) - (pb[i] ?? 0);
|
|
38
|
+
return 0;
|
|
39
|
+
}
|
|
40
|
+
/** Whether `pkg` is installed in the project's node_modules (not just listed in package.json). */
|
|
41
|
+
export function packageResolvable(root, pkg) {
|
|
42
|
+
return fs.existsSync(path.join(root, 'node_modules', ...pkg.split('/'), 'package.json'));
|
|
43
|
+
}
|
|
44
|
+
function readJson(file) {
|
|
45
|
+
try {
|
|
46
|
+
return JSON.parse(fs.readFileSync(file, 'utf-8'));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** The config block a catalog entry lives under (e.g. `aws` for s3). */
|
|
53
|
+
const blockOf = (entry) => entry.variants[0].config[0].path[0];
|
|
54
|
+
/** The variant the config asks for: database by `type`, kafka by `driver`, search by its service. */
|
|
55
|
+
function variantFor(entry, config) {
|
|
56
|
+
const block = config?.[blockOf(entry)];
|
|
57
|
+
if (entry.id === 'database' && block?.type)
|
|
58
|
+
return entry.variants.find((v) => v.id === block.type) ?? entry.variants[0];
|
|
59
|
+
if (entry.id === 'kafka' && block?.driver)
|
|
60
|
+
return entry.variants.find((v) => v.id === block.driver) ?? entry.variants[0];
|
|
61
|
+
return entry.variants[0];
|
|
62
|
+
}
|
|
63
|
+
/** Every value that's still CHANGE_ME in `block`, as dotted paths. */
|
|
64
|
+
export function placeholdersIn(block, at = '') {
|
|
65
|
+
if (block === PLACEHOLDER)
|
|
66
|
+
return [at];
|
|
67
|
+
if (Array.isArray(block))
|
|
68
|
+
return block.flatMap((v, i) => placeholdersIn(v, `${at}[${i}]`));
|
|
69
|
+
if (block && typeof block === 'object')
|
|
70
|
+
return Object.entries(block).flatMap(([k, v]) => placeholdersIn(v, at ? `${at}.${k}` : k));
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
const DEFAULT_PORTS = {
|
|
74
|
+
'http:': 80, 'https:': 443, 'ws:': 80, 'wss:': 443, 'bolt:': 7687, 'neo4j:': 7687, 'bolt+s:': 7687, 'neo4j+s:': 7687,
|
|
75
|
+
'amqp:': 5672, 'amqps:': 5671, 'mongodb:': 27017, 'grpc:': 443, 'grpcs:': 443, 'redis:': 6379,
|
|
76
|
+
};
|
|
77
|
+
function fromUrl(url) {
|
|
78
|
+
try {
|
|
79
|
+
const u = new URL(url);
|
|
80
|
+
const port = u.port ? parseInt(u.port, 10) : DEFAULT_PORTS[u.protocol];
|
|
81
|
+
return u.hostname && port ? { host: u.hostname.replace(/^\[|\]$/g, ''), port } : null;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function fromHostPort(value, defaultPort) {
|
|
88
|
+
const m = /^\[?([^\]]+?)\]?(?::(\d+))?$/.exec(value.trim());
|
|
89
|
+
return { host: m?.[1] ?? value, port: m?.[2] ? parseInt(m[2], 10) : defaultPort };
|
|
90
|
+
}
|
|
91
|
+
const DB_PORTS = { postgresql: 5432, mysql: 3306, mssql: 1433 };
|
|
92
|
+
/** Where each configured backend listens, by config block. Blocks with placeholders, or none (real AWS, sqlite), are left out. */
|
|
93
|
+
export function backendAddresses(config) {
|
|
94
|
+
const c = config;
|
|
95
|
+
const out = [];
|
|
96
|
+
const add = (block, address) => {
|
|
97
|
+
if (address && address.host !== PLACEHOLDER && !address.host.includes(PLACEHOLDER))
|
|
98
|
+
out.push({ block, ...address });
|
|
99
|
+
};
|
|
100
|
+
const str = (v) => (typeof v === 'string' && v && v !== PLACEHOLDER ? v : undefined);
|
|
101
|
+
const db = c.database;
|
|
102
|
+
if (db && db.type !== 'sqlite' && str(db.host))
|
|
103
|
+
add('database', { host: String(db.host), port: Number(db.port) || DB_PORTS[String(db.type)] || 5432 });
|
|
104
|
+
if (c.redis && str(c.redis.host))
|
|
105
|
+
add('redis', { host: String(c.redis.host), port: Number(c.redis.port) || 6379 });
|
|
106
|
+
const mongo = c.mongodb;
|
|
107
|
+
if (mongo) {
|
|
108
|
+
if (str(mongo.uri) && !String(mongo.uri).startsWith('mongodb+srv:'))
|
|
109
|
+
add('mongodb', fromUrl(String(mongo.uri).split(',')[0]));
|
|
110
|
+
else if (str(mongo.host) && !mongo.srv)
|
|
111
|
+
add('mongodb', { host: String(mongo.host), port: Number(mongo.port) || 27017 });
|
|
112
|
+
}
|
|
113
|
+
if (c.neo4j && str(c.neo4j.uri))
|
|
114
|
+
add('neo4j', fromUrl(String(c.neo4j.uri)));
|
|
115
|
+
if (c.cassandra && Array.isArray(c.cassandra.contactPoints) && str(c.cassandra.contactPoints[0])) {
|
|
116
|
+
add('cassandra', fromHostPort(String(c.cassandra.contactPoints[0]), Number(c.cassandra.port) || 9042));
|
|
117
|
+
}
|
|
118
|
+
if (c.clickhouse && str(c.clickhouse.url))
|
|
119
|
+
add('clickhouse', fromUrl(String(c.clickhouse.url)));
|
|
120
|
+
if (c.kafka && Array.isArray(c.kafka.brokers) && str(c.kafka.brokers[0]))
|
|
121
|
+
add('kafka', fromHostPort(String(c.kafka.brokers[0]), 9092));
|
|
122
|
+
if (c.amqp) {
|
|
123
|
+
if (str(c.amqp.url))
|
|
124
|
+
add('amqp', fromUrl(String(c.amqp.url)));
|
|
125
|
+
else if (str(c.amqp.host))
|
|
126
|
+
add('amqp', { host: String(c.amqp.host), port: Number(c.amqp.port) || 5672 });
|
|
127
|
+
}
|
|
128
|
+
if (c.aws && str(c.aws.endpoint))
|
|
129
|
+
add('aws', fromUrl(String(c.aws.endpoint)));
|
|
130
|
+
for (const [block, key] of [['search', 'url'], ['realtime', 'url'], ['inbox', 'url'], ['mock', 'url'], ['openapi', 'baseUrl'], ['graphql', 'endpoint'], ['appium', 'serverUrl']]) {
|
|
131
|
+
const value = str(c[block]?.[key]);
|
|
132
|
+
if (value)
|
|
133
|
+
add(block, fromUrl(value));
|
|
134
|
+
}
|
|
135
|
+
if (c.grpc && str(c.grpc.address)) {
|
|
136
|
+
const address = String(c.grpc.address);
|
|
137
|
+
add('grpc', /^grpcs?:\/\//.test(address) ? fromUrl(address) : fromHostPort(address, 443));
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
/** Whether a TCP connection to host:port opens within `timeoutMs`. */
|
|
142
|
+
export function tcpReachable(host, port, timeoutMs = 1500) {
|
|
143
|
+
return new Promise((resolve) => {
|
|
144
|
+
const socket = net.connect({ host, port });
|
|
145
|
+
const done = (result) => {
|
|
146
|
+
socket.destroy();
|
|
147
|
+
resolve(result);
|
|
148
|
+
};
|
|
149
|
+
socket.setTimeout(timeoutMs, () => done(false));
|
|
150
|
+
socket.once('connect', () => done(true));
|
|
151
|
+
socket.once('error', () => done(false));
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function checkNode(ctx) {
|
|
155
|
+
const version = (ctx.options.nodeVersion ?? process.versions.node).replace(/^v/, '');
|
|
156
|
+
if (compareVersions(version, MIN_NODE) < 0) {
|
|
157
|
+
return [{ check: 'node', status: 'fail', message: `Node.js ${version} is too old: Propmaster needs ${MIN_NODE} or newer.`, fix: { text: `Install Node.js ${MIN_NODE}+ (e.g. \`nvm install 24\`)`, safe: false } }];
|
|
158
|
+
}
|
|
159
|
+
return [ok('node', `Node.js ${version}`)];
|
|
160
|
+
}
|
|
161
|
+
function checkConfig(ctx) {
|
|
162
|
+
const file = path.join(ctx.root, ENVIRONMENTS_FILE);
|
|
163
|
+
if (!fs.existsSync(file)) {
|
|
164
|
+
return [{ check: 'config', status: 'fail', message: `${ENVIRONMENTS_FILE} not found.`, fix: { text: 'npx propmaster init (or create it: { "environments": { "local": {} } })', safe: false } }];
|
|
165
|
+
}
|
|
166
|
+
if (ctx.configError)
|
|
167
|
+
return [{ check: 'config', status: 'fail', message: ctx.configError }];
|
|
168
|
+
const findings = [];
|
|
169
|
+
const text = fs.readFileSync(file, 'utf-8');
|
|
170
|
+
const block = valueAt(text, ['environments', ctx.environment]);
|
|
171
|
+
if (block === undefined) {
|
|
172
|
+
const names = Object.keys(valueAt(text, ['environments']) ?? {});
|
|
173
|
+
findings.push({
|
|
174
|
+
check: 'config',
|
|
175
|
+
status: 'fail',
|
|
176
|
+
message: `environment "${ctx.environment}" isn't in ${ENVIRONMENTS_FILE} (it has ${names.join(', ') || 'none'}).`,
|
|
177
|
+
fix: { text: `npx propmaster env add ${ctx.environment}, or set PW_ENVIRONMENT to one of those`, safe: false },
|
|
178
|
+
});
|
|
179
|
+
return findings;
|
|
180
|
+
}
|
|
181
|
+
findings.push(ok('config', `environment "${ctx.environment}"${isProduction(ctx.environment, block) ? ' (production)' : ''} loads`));
|
|
182
|
+
// Every fixture the tests use needs its block (otp works without one).
|
|
183
|
+
for (const entry of ctx.entries) {
|
|
184
|
+
if (entry.id === 'otp')
|
|
185
|
+
continue;
|
|
186
|
+
const key = blockOf(entry);
|
|
187
|
+
if (ctx.config[key] !== undefined)
|
|
188
|
+
continue;
|
|
189
|
+
const fixture = entry.fixtures.find((f) => ctx.used.has(f));
|
|
190
|
+
findings.push({
|
|
191
|
+
check: 'config',
|
|
192
|
+
status: 'fail',
|
|
193
|
+
message: `tests use ${fixture}, but "${ctx.environment}" has no ${key} config.`,
|
|
194
|
+
fix: {
|
|
195
|
+
text: `add the ${key} block to every environment (\`propmaster fixture add ${entry.id} --no-test --no-service --no-install\`)`,
|
|
196
|
+
safe: true,
|
|
197
|
+
apply: () => {
|
|
198
|
+
const variant = variantFor(entry, ctx.config);
|
|
199
|
+
applyPlan(ctx.root, planAdd(ctx.root, [{ id: entry.id, variant: variant.id }], { service: false, test: false }), { install: false });
|
|
200
|
+
return true;
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
const placeholders = placeholdersIn(block);
|
|
206
|
+
if (placeholders.length) {
|
|
207
|
+
findings.push({
|
|
208
|
+
check: 'config',
|
|
209
|
+
status: 'warn',
|
|
210
|
+
message: `${placeholders.length} value${placeholders.length > 1 ? 's' : ''} in "${ctx.environment}" still ${PLACEHOLDER}: ${placeholders.slice(0, 6).join(', ')}${placeholders.length > 6 ? ', ...' : ''}`,
|
|
211
|
+
fix: { text: `fill them in, in ${ENVIRONMENTS_FILE} or .env.${ctx.environment}`, safe: false },
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
return findings;
|
|
215
|
+
}
|
|
216
|
+
function checkDrivers(ctx) {
|
|
217
|
+
const findings = [];
|
|
218
|
+
const installedOk = [];
|
|
219
|
+
const listed = installedPackages(ctx.root);
|
|
220
|
+
for (const entry of ctx.entries) {
|
|
221
|
+
const variant = variantFor(entry, ctx.config);
|
|
222
|
+
const fixture = entry.fixtures.find((f) => ctx.used.has(f));
|
|
223
|
+
const missing = variant.packages.filter((p) => !packageResolvable(ctx.root, p));
|
|
224
|
+
if (!variant.packages.length)
|
|
225
|
+
continue;
|
|
226
|
+
if (!missing.length) {
|
|
227
|
+
const unbuilt = variant.packages.filter((p) => NATIVE_BINDINGS[p] && !fs.existsSync(path.join(ctx.root, 'node_modules', ...p.split('/'), NATIVE_BINDINGS[p])));
|
|
228
|
+
if (unbuilt.length) {
|
|
229
|
+
const pm = packageManager(ctx.root);
|
|
230
|
+
const command = rebuildCommand(pm, unbuilt);
|
|
231
|
+
findings.push({
|
|
232
|
+
check: 'drivers',
|
|
233
|
+
status: 'fail',
|
|
234
|
+
message: `${unbuilt.join(', ')} ${unbuilt.length > 1 ? 'are' : 'is'} installed without ${unbuilt.length > 1 ? 'their' : 'its'} native binding: ${unbuilt.length > 1 ? 'their install scripts' : 'its install script'} didn't run${pm === 'bun' ? ' (Bun runs only the scripts of trusted packages)' : ''}.`,
|
|
235
|
+
fix: { text: command.join(' '), safe: true, apply: () => ctx.runner(command, ctx.root).ok },
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
installedOk.push(...variant.packages.filter((p) => !unbuilt.includes(p)));
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
const notListed = missing.filter((p) => !listed.has(p));
|
|
242
|
+
const command = notListed.length ? packageCommand(packageManager(ctx.root), 'install', notListed) : [packageManager(ctx.root), 'install'];
|
|
243
|
+
findings.push({
|
|
244
|
+
check: 'drivers',
|
|
245
|
+
status: 'fail',
|
|
246
|
+
message: notListed.length
|
|
247
|
+
? `tests use ${fixture}, but ${notListed.join(', ')} ${notListed.length > 1 ? "aren't" : "isn't"} installed${variant.id !== 'default' ? ` (${variant.label})` : ''}.`
|
|
248
|
+
: `${missing.join(', ')} ${missing.length > 1 ? 'are' : 'is'} in package.json but not in node_modules.`,
|
|
249
|
+
fix: { text: command.join(' '), safe: true, apply: () => ctx.runner(command, ctx.root).ok },
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
if (installedOk.length)
|
|
253
|
+
findings.unshift(ok('drivers', `installed for the fixtures the tests use: ${installedOk.join(', ')}`));
|
|
254
|
+
return findings;
|
|
255
|
+
}
|
|
256
|
+
async function checkBackends(ctx) {
|
|
257
|
+
if (!ctx.config)
|
|
258
|
+
return [];
|
|
259
|
+
if (ctx.options.offline)
|
|
260
|
+
return [{ check: 'backends', status: 'skip', message: 'not checked (--offline)' }];
|
|
261
|
+
const reachable = ctx.options.reachable ?? ((h, p) => tcpReachable(h, p));
|
|
262
|
+
const usedBlocks = new Set(ctx.entries.map(blockOf));
|
|
263
|
+
const addresses = backendAddresses(ctx.config);
|
|
264
|
+
const compose = fs.existsSync(path.join(ctx.root, COMPOSE_FILE)) ? fs.readFileSync(path.join(ctx.root, COMPOSE_FILE), 'utf-8') : null;
|
|
265
|
+
const results = await Promise.all(addresses.map(async (a) => ({ ...a, up: await reachable(a.host, a.port) })));
|
|
266
|
+
const answering = results.filter((r) => r.up).map((r) => `${r.block} (${r.host}:${r.port})`);
|
|
267
|
+
const head = answering.length ? [ok('backends', `answering: ${answering.join(', ')}`)] : [];
|
|
268
|
+
return head.concat(results.filter((r) => !r.up).map(({ block, host, port }) => {
|
|
269
|
+
const services = FIXTURE_CATALOG.filter((e) => blockOf(e) === block)
|
|
270
|
+
.flatMap((e) => e.variants.flatMap((v) => v.services.map((s) => s.name)))
|
|
271
|
+
.filter((name, i, all) => all.indexOf(name) === i && hasService(compose, name));
|
|
272
|
+
return {
|
|
273
|
+
check: 'backends',
|
|
274
|
+
status: usedBlocks.has(block) ? 'fail' : 'warn',
|
|
275
|
+
message: `${block} at ${host}:${port} doesn't answer${usedBlocks.has(block) ? '' : ' (no test uses it yet)'}.`,
|
|
276
|
+
fix: { text: services.length ? `docker compose -f ${COMPOSE_FILE} up -d --wait ${services.join(' ')}` : `start it, or point ${block} in ${ENVIRONMENTS_FILE} at where it runs`, safe: false },
|
|
277
|
+
};
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
280
|
+
function checkPlaywright(ctx) {
|
|
281
|
+
const findings = [];
|
|
282
|
+
const configFile = fs.readdirSync(ctx.root).find((f) => /^playwright\.config\.(?:c|m)?[jt]s$/.test(f));
|
|
283
|
+
if (!configFile) {
|
|
284
|
+
return [{ check: 'playwright', status: 'fail', message: 'no playwright.config.ts.', fix: { text: 'npx propmaster init', safe: false } }];
|
|
285
|
+
}
|
|
286
|
+
const text = fs.readFileSync(path.join(ctx.root, configFile), 'utf-8');
|
|
287
|
+
findings.push(ok('playwright', configFile));
|
|
288
|
+
// Tests run on Bun's runtime (`--bun`): Bun 1.4.3 and Playwright 1.65 or later.
|
|
289
|
+
const onBun = bunRuntimeLines(ctx.root);
|
|
290
|
+
if (onBun.length) {
|
|
291
|
+
const bun = ctx.options.bunVersion === undefined ? installedBun() : ctx.options.bunVersion;
|
|
292
|
+
const playwright = readJson(path.join(ctx.root, 'node_modules', '@playwright', 'test', 'package.json'))?.version;
|
|
293
|
+
const where = onBun.map((l) => l.split(': ')[0]).join(', ');
|
|
294
|
+
const problem = bun ? bunRuntimeProblem(bun, playwright) : `Bun isn't installed, but ${where} run${onBun.length > 1 ? '' : 's'} the tests with --bun.`;
|
|
295
|
+
findings.push(problem
|
|
296
|
+
? { check: 'playwright', status: 'warn', message: problem, fix: { text: bun ? 'bun upgrade, or drop --bun to run on Node.js' : 'install Bun (https://bun.sh), or drop --bun', safe: false } }
|
|
297
|
+
: ok('playwright', `tests run on Bun ${bun}${playwright ? ` with Playwright ${playwright}` : ''} (${where})`));
|
|
298
|
+
const kafkaDriver = (ctx.config?.kafka?.driver ?? (ctx.options.env ?? process.env).PW_KAFKA_DRIVER);
|
|
299
|
+
if (kafkaDriver === 'confluent') {
|
|
300
|
+
findings.push({
|
|
301
|
+
check: 'playwright',
|
|
302
|
+
status: 'warn',
|
|
303
|
+
message: `the Kafka driver is Confluent's client, which doesn't load on Bun (its native binding is built for Node.js), and ${where} run${onBun.length > 1 ? '' : 's'} the tests with --bun.`,
|
|
304
|
+
fix: { text: "use the kafkajs driver (driver: 'kafkajs'), or run the Kafka tests without --bun (on Node.js)", safe: false },
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (!/propmaster\/reporter|src\/reporter/.test(text)) {
|
|
309
|
+
findings.push({
|
|
310
|
+
check: 'playwright',
|
|
311
|
+
status: 'warn',
|
|
312
|
+
message: `${configFile} doesn't use the Propmaster reporter, so there's no test history for \`propmaster flaky\` and quarantine.json is ignored.`,
|
|
313
|
+
fix: { text: "add ['@inluxc/propmaster/reporter'] to reporter in playwright.config.ts", safe: false },
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
if (!fs.existsSync(path.join(ctx.root, 'tsconfig.json'))) {
|
|
317
|
+
findings.push({ check: 'playwright', status: 'warn', message: 'no tsconfig.json: editors and `tsc --noEmit` won\'t type-check the tests.', fix: { text: 'npx propmaster init adds one', safe: false } });
|
|
318
|
+
}
|
|
319
|
+
// Browsers, when tests use one.
|
|
320
|
+
if (['page', 'context', 'browser', 'browserName'].some((f) => ctx.used.has(f))) {
|
|
321
|
+
const browsers = ['chromium', ...(/firefox/i.test(text) ? ['firefox'] : []), ...(/webkit|safari/i.test(text) ? ['webkit'] : [])];
|
|
322
|
+
try {
|
|
323
|
+
const coreDir = installedPackageDir(ctx.root, 'playwright-core');
|
|
324
|
+
if (!coreDir)
|
|
325
|
+
throw new Error('playwright-core is not installed');
|
|
326
|
+
const require = createRequire(path.join(coreDir, 'package.json'));
|
|
327
|
+
const core = require(coreDir);
|
|
328
|
+
const missing = browsers.filter((b) => {
|
|
329
|
+
try {
|
|
330
|
+
return !fs.existsSync(core[b].executablePath());
|
|
331
|
+
}
|
|
332
|
+
catch {
|
|
333
|
+
return true;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
findings.push(missing.length
|
|
337
|
+
? { check: 'playwright', status: 'fail', message: `browser${missing.length > 1 ? 's' : ''} not installed: ${missing.join(', ')}.`, fix: { text: execCommand(packageManager(ctx.root), 'playwright', ['install', ...missing]).join(' '), safe: false } }
|
|
338
|
+
: ok('playwright', `browsers installed: ${browsers.join(', ')}`));
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
findings.push({ check: 'playwright', status: 'fail', message: '@playwright/test isn\'t installed.', fix: { text: `${packageManager(ctx.root)} install`, safe: false } });
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return findings;
|
|
345
|
+
}
|
|
346
|
+
/** `bun --version`, or null when Bun isn't installed. */
|
|
347
|
+
function installedBun() {
|
|
348
|
+
const result = spawnSync('bun', ['--version'], { encoding: 'utf-8', shell: process.platform === 'win32' });
|
|
349
|
+
return result.status === 0 ? result.stdout.trim() : null;
|
|
350
|
+
}
|
|
351
|
+
/** Lines in package.json scripts and CI files that run commands on Bun's runtime (`bun --bun`, `bunx --bun`). */
|
|
352
|
+
export function bunRuntimeLines(root) {
|
|
353
|
+
const found = [];
|
|
354
|
+
for (const file of ['package.json', ...ciFiles(root)]) {
|
|
355
|
+
let text;
|
|
356
|
+
try {
|
|
357
|
+
text = fs.readFileSync(path.join(root, file), 'utf-8');
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
text.split('\n').forEach((line, i) => {
|
|
363
|
+
if (/\bbunx? (?:[^\s]+ )*--bun\b/.test(line))
|
|
364
|
+
found.push(`${file}:${i + 1}: ${line.trim()}`);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
return found;
|
|
368
|
+
}
|
|
369
|
+
/** CI files that may name the Playwright image. */
|
|
370
|
+
function ciFiles(root) {
|
|
371
|
+
const files = ['.gitlab-ci.yml', 'Jenkinsfile', 'azure-pipelines.yml', '.circleci/config.yml', 'bitbucket-pipelines.yml'].filter((f) => fs.existsSync(path.join(root, f)));
|
|
372
|
+
const workflows = path.join(root, '.github', 'workflows');
|
|
373
|
+
if (fs.existsSync(workflows))
|
|
374
|
+
for (const f of fs.readdirSync(workflows))
|
|
375
|
+
if (/\.ya?ml$/.test(f))
|
|
376
|
+
files.push(`.github/workflows/${f}`);
|
|
377
|
+
return files;
|
|
378
|
+
}
|
|
379
|
+
function checkCiImage(ctx) {
|
|
380
|
+
const installed = readJson(path.join(ctx.root, 'node_modules', '@playwright', 'test', 'package.json'))?.version;
|
|
381
|
+
if (!installed)
|
|
382
|
+
return [];
|
|
383
|
+
const findings = [];
|
|
384
|
+
for (const file of ciFiles(ctx.root)) {
|
|
385
|
+
const full = path.join(ctx.root, file);
|
|
386
|
+
const text = fs.readFileSync(full, 'utf-8');
|
|
387
|
+
const tags = [...new Set([...text.matchAll(/mcr\.microsoft\.com\/playwright:v(\d+\.\d+\.\d+)/g)].map((m) => m[1]))];
|
|
388
|
+
const stale = tags.filter((t) => t !== installed);
|
|
389
|
+
if (!tags.length)
|
|
390
|
+
continue;
|
|
391
|
+
if (!stale.length) {
|
|
392
|
+
findings.push(ok('ci', `${file}: Playwright image v${installed}`));
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
findings.push({
|
|
396
|
+
check: 'ci',
|
|
397
|
+
status: 'warn',
|
|
398
|
+
message: `${file} runs the Playwright image v${stale.join(', v')}, but @playwright/test is ${installed}: the browsers won't match.`,
|
|
399
|
+
fix: {
|
|
400
|
+
text: `use mcr.microsoft.com/playwright:v${installed} in ${file}`,
|
|
401
|
+
safe: true,
|
|
402
|
+
apply: () => {
|
|
403
|
+
const current = fs.readFileSync(full, 'utf-8');
|
|
404
|
+
fs.writeFileSync(full, current.replace(/(mcr\.microsoft\.com\/playwright:v)\d+\.\d+\.\d+/g, `$1${installed}`));
|
|
405
|
+
return true;
|
|
406
|
+
},
|
|
407
|
+
},
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
return findings;
|
|
411
|
+
}
|
|
412
|
+
function checkEnvFiles(ctx) {
|
|
413
|
+
const isGit = fs.existsSync(path.join(ctx.root, '.git'));
|
|
414
|
+
if (!isGit)
|
|
415
|
+
return [];
|
|
416
|
+
const envFiles = fs.readdirSync(ctx.root).filter((f) => (f === '.env' || f.startsWith('.env.')) && !f.endsWith('.example'));
|
|
417
|
+
if (!envFiles.length)
|
|
418
|
+
return [];
|
|
419
|
+
const gitignorePath = path.join(ctx.root, '.gitignore');
|
|
420
|
+
const gitignore = fs.existsSync(gitignorePath) ? fs.readFileSync(gitignorePath, 'utf-8') : '';
|
|
421
|
+
const findings = [];
|
|
422
|
+
const exposed = envFiles.filter((f) => !gitIgnores(gitignore, f));
|
|
423
|
+
if (exposed.length) {
|
|
424
|
+
findings.push({
|
|
425
|
+
check: 'secrets',
|
|
426
|
+
status: 'fail',
|
|
427
|
+
message: `${exposed.join(', ')} ${exposed.length > 1 ? "aren't" : "isn't"} in .gitignore: secrets in ${exposed.length > 1 ? 'them' : 'it'} could be committed.`,
|
|
428
|
+
fix: {
|
|
429
|
+
text: `add ${exposed.join(', ')} to .gitignore`,
|
|
430
|
+
safe: true,
|
|
431
|
+
apply: () => {
|
|
432
|
+
const current = fs.existsSync(gitignorePath) ? fs.readFileSync(gitignorePath, 'utf-8') : '';
|
|
433
|
+
fs.writeFileSync(gitignorePath, `${current}${current && !current.endsWith('\n') ? '\n' : ''}${exposed.join('\n')}\n`);
|
|
434
|
+
return true;
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
const tracked = spawnSync('git', ['ls-files', '--', ...envFiles], { cwd: ctx.root, encoding: 'utf-8' });
|
|
440
|
+
const committed = tracked.status === 0 ? tracked.stdout.split('\n').filter(Boolean) : [];
|
|
441
|
+
if (committed.length) {
|
|
442
|
+
findings.push({
|
|
443
|
+
check: 'secrets',
|
|
444
|
+
status: 'fail',
|
|
445
|
+
message: `${committed.join(', ')} ${committed.length > 1 ? 'are' : 'is'} committed to git.`,
|
|
446
|
+
fix: { text: `git rm --cached ${committed.join(' ')}, and change any secret ${committed.length > 1 ? 'they' : 'it'} held`, safe: false },
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
if (!exposed.length && !committed.length)
|
|
450
|
+
findings.push(ok('secrets', `${envFiles.join(', ')} kept out of git`));
|
|
451
|
+
return findings;
|
|
452
|
+
}
|
|
453
|
+
async function checkMcp(ctx) {
|
|
454
|
+
const findings = [];
|
|
455
|
+
const { applyChange, checkServer, clientById, configuredServers, detectClients, planSetup, selfServer } = await import('./mcp-setup.js');
|
|
456
|
+
const setup = { root: ctx.root, home: ctx.options.home ?? os.homedir() };
|
|
457
|
+
const configured = configuredServers(setup);
|
|
458
|
+
if (configured.length) {
|
|
459
|
+
findings.push(ok('mcp', `the propmaster server is set up in ${configured.map((c) => c.file).join(', ')}`));
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
const editors = detectClients(setup).filter((id) => !clientById(id).global);
|
|
463
|
+
const ids = editors.length ? editors : ['claude'];
|
|
464
|
+
findings.push({
|
|
465
|
+
check: 'mcp',
|
|
466
|
+
status: 'warn',
|
|
467
|
+
message: 'no editor is set up to start the propmaster MCP server, so agents can\'t see the backends.',
|
|
468
|
+
fix: {
|
|
469
|
+
text: `npx propmaster mcp setup --client ${ids.join(',')}`,
|
|
470
|
+
safe: true,
|
|
471
|
+
apply: () => {
|
|
472
|
+
for (const id of ids)
|
|
473
|
+
applyChange(planSetup(clientById(id), setup, {}));
|
|
474
|
+
return true;
|
|
475
|
+
},
|
|
476
|
+
},
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
if (ctx.options.skipMcp || !ctx.config)
|
|
480
|
+
return findings;
|
|
481
|
+
// Started as an editor starts it: a separate process, spoken to over stdio.
|
|
482
|
+
const result = await checkServer(selfServer(ctx.root, { environment: ctx.environment }), ctx.root);
|
|
483
|
+
findings.push(result.ok
|
|
484
|
+
? ok('mcp', `the server starts for "${ctx.environment}" with ${result.tools.length} tools`)
|
|
485
|
+
: { check: 'mcp', status: 'fail', message: `the MCP server doesn't start: ${result.error}${result.stderr.length ? ` (${result.stderr.at(-1)})` : ''}` });
|
|
486
|
+
return findings;
|
|
487
|
+
}
|
|
488
|
+
function checkTests(ctx) {
|
|
489
|
+
const { violations, ids, warnings } = collect(ctx.root);
|
|
490
|
+
const findings = [];
|
|
491
|
+
findings.push(violations.length
|
|
492
|
+
? {
|
|
493
|
+
check: 'tests',
|
|
494
|
+
status: 'fail',
|
|
495
|
+
message: `${violations.length} test convention violation${violations.length > 1 ? 's' : ''}, first: ${violations[0].file}:${violations[0].line} ${violations[0].message}`,
|
|
496
|
+
fix: { text: 'npx propmaster check (lists each one with its fix)', safe: false },
|
|
497
|
+
}
|
|
498
|
+
: ok('tests', `test conventions OK (${new Set(ids.filter((i) => !i.reserved).map((i) => i.id)).size} TestCaseIDs)`));
|
|
499
|
+
if (warnings.length) {
|
|
500
|
+
findings.push({
|
|
501
|
+
check: 'tests',
|
|
502
|
+
status: 'warn',
|
|
503
|
+
message: `${warnings.length} standards warning${warnings.length > 1 ? 's' : ''}, first: ${warnings[0].file}:${warnings[0].line} [${warnings[0].rule}] ${warnings[0].message}`,
|
|
504
|
+
fix: { text: 'npx propmaster check (lists each one)', safe: false },
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
const quarantine = checkQuarantine(ctx.root, ids);
|
|
508
|
+
for (const v of quarantine.violations)
|
|
509
|
+
findings.push({ check: 'tests', status: 'fail', message: `${v.file}: ${v.message}` });
|
|
510
|
+
for (const w of quarantine.warnings)
|
|
511
|
+
findings.push({ check: 'tests', status: 'warn', message: w, fix: { text: 'fix the test and remove its quarantine entry, or update the entry', safe: false } });
|
|
512
|
+
return findings;
|
|
513
|
+
}
|
|
514
|
+
// ─── Running ────────────────────────────────────────────────────────────────
|
|
515
|
+
function context(root, options) {
|
|
516
|
+
const env = options.env ?? process.env;
|
|
517
|
+
const environment = options.environment ?? env.PW_ENVIRONMENT ?? 'local';
|
|
518
|
+
const used = new Set(testFixtures(root));
|
|
519
|
+
const entries = FIXTURE_CATALOG.filter((e) => e.fixtures.some((f) => used.has(f)));
|
|
520
|
+
const ctx = { root, environment, options, runner: options.runner ?? inheritRunner, used, entries };
|
|
521
|
+
if (fs.existsSync(path.join(root, ENVIRONMENTS_FILE))) {
|
|
522
|
+
try {
|
|
523
|
+
ctx.config = new ConfigLoader(root).load(environment);
|
|
524
|
+
}
|
|
525
|
+
catch (error) {
|
|
526
|
+
ctx.configError = error instanceof Error ? error.message : String(error);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
return ctx;
|
|
530
|
+
}
|
|
531
|
+
/** Runs every check on the project at `root`. */
|
|
532
|
+
export async function diagnose(root, options = {}) {
|
|
533
|
+
const ctx = context(root, options);
|
|
534
|
+
const findings = [
|
|
535
|
+
...checkNode(ctx),
|
|
536
|
+
...checkConfig(ctx),
|
|
537
|
+
...checkDrivers(ctx),
|
|
538
|
+
...(await checkBackends(ctx)),
|
|
539
|
+
...checkPlaywright(ctx),
|
|
540
|
+
...checkCiImage(ctx),
|
|
541
|
+
...checkEnvFiles(ctx),
|
|
542
|
+
...(await checkMcp(ctx)),
|
|
543
|
+
...checkTests(ctx),
|
|
544
|
+
];
|
|
545
|
+
// Commands in the fixes, for the project's package manager (bunx, bun add -d, ...).
|
|
546
|
+
const pm = packageManager(root);
|
|
547
|
+
for (const f of findings)
|
|
548
|
+
if (f.fix)
|
|
549
|
+
f.fix.text = adaptCommands(f.fix.text, pm);
|
|
550
|
+
return { environment: ctx.environment, findings };
|
|
551
|
+
}
|
|
552
|
+
/** Applies every safe fix, in order. Returns the findings fixed and those whose fix failed. */
|
|
553
|
+
export async function applyFixes(findings) {
|
|
554
|
+
const fixed = [];
|
|
555
|
+
const failed = [];
|
|
556
|
+
for (const f of findings) {
|
|
557
|
+
if (f.status === 'ok' || f.status === 'skip' || !f.fix?.safe || !f.fix.apply)
|
|
558
|
+
continue;
|
|
559
|
+
try {
|
|
560
|
+
((await f.fix.apply()) ? fixed : failed).push(f);
|
|
561
|
+
}
|
|
562
|
+
catch {
|
|
563
|
+
failed.push(f);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
return { fixed, failed };
|
|
567
|
+
}
|
|
568
|
+
export function summarize(findings) {
|
|
569
|
+
const problems = findings.filter((f) => f.status === 'fail' || f.status === 'warn');
|
|
570
|
+
return { fail: findings.filter((f) => f.status === 'fail').length, warn: findings.filter((f) => f.status === 'warn').length, fixable: problems.filter((f) => f.fix?.safe && f.fix.apply).length };
|
|
571
|
+
}
|
|
572
|
+
/** The findings as lines of text. */
|
|
573
|
+
export function formatFindings(findings, color = false, verbose = true) {
|
|
574
|
+
const s = styleFor({ isTTY: color }, color ? { FORCE_COLOR: '1' } : { NO_COLOR: '1' });
|
|
575
|
+
const mark = { ok: s.green('✔'), warn: s.yellow('!'), fail: s.red('✖'), skip: s.dim('·') };
|
|
576
|
+
const out = [];
|
|
577
|
+
for (const f of findings) {
|
|
578
|
+
if (!verbose && f.status === 'ok')
|
|
579
|
+
continue;
|
|
580
|
+
out.push(`${mark[f.status]} ${s.dim(f.check.padEnd(9))} ${f.status === 'ok' || f.status === 'skip' ? s.dim(f.message) : f.message}`);
|
|
581
|
+
if (f.fix && f.status !== 'ok')
|
|
582
|
+
out.push(` ${' '.repeat(10)}${s.cyan('→')} ${f.fix.text}${f.fix.safe && f.fix.apply ? s.dim(' (--fix)') : ''}`);
|
|
583
|
+
}
|
|
584
|
+
return out;
|
|
585
|
+
}
|
|
586
|
+
const HELP = `
|
|
587
|
+
Usage:
|
|
588
|
+
npx propmaster doctor [-e <env>] [--fix] [--offline] [--json] [--problems]
|
|
589
|
+
|
|
590
|
+
Checks the project's setup and says how to fix each problem: Node.js, the
|
|
591
|
+
environment's config, drivers and config for the fixtures the tests use,
|
|
592
|
+
whether the backends answer, the Playwright config and browsers, the CI
|
|
593
|
+
image, .env files kept out of git, the MCP server, and test conventions.
|
|
594
|
+
Exits 1 while a problem (✖) remains; warnings (!) don't fail it.
|
|
595
|
+
|
|
596
|
+
Options:
|
|
597
|
+
-e, --environment <env> the environment to check (default: PW_ENVIRONMENT, else local)
|
|
598
|
+
--fix apply the safe fixes (marked --fix), then check again
|
|
599
|
+
--offline don't try to reach the backends
|
|
600
|
+
--problems show only the problems
|
|
601
|
+
--json findings as JSON
|
|
602
|
+
--root <dir> the project (default: the nearest package.json)
|
|
603
|
+
`;
|
|
604
|
+
function option(argv, ...names) {
|
|
605
|
+
for (const name of names) {
|
|
606
|
+
const i = argv.indexOf(name);
|
|
607
|
+
if (i !== -1)
|
|
608
|
+
return argv[i + 1];
|
|
609
|
+
const eq = argv.find((a) => a.startsWith(`${name}=`));
|
|
610
|
+
if (eq)
|
|
611
|
+
return eq.slice(name.length + 1);
|
|
612
|
+
}
|
|
613
|
+
return undefined;
|
|
614
|
+
}
|
|
615
|
+
/** `propmaster doctor ...` */
|
|
616
|
+
export async function runDoctor(argv, log = console.log, options = {}) {
|
|
617
|
+
if (argv.includes('--help')) {
|
|
618
|
+
log(HELP);
|
|
619
|
+
return 0;
|
|
620
|
+
}
|
|
621
|
+
const root = option(argv, '--root') ? path.resolve(option(argv, '--root')) : findProjectRoot();
|
|
622
|
+
const opts = { ...options, environment: option(argv, '-e', '--environment') ?? options.environment, offline: argv.includes('--offline') || options.offline };
|
|
623
|
+
let { environment, findings } = await diagnose(root, opts);
|
|
624
|
+
const s = styleFor();
|
|
625
|
+
const fixedNow = [];
|
|
626
|
+
if (argv.includes('--fix')) {
|
|
627
|
+
const { fixed, failed } = await applyFixes(findings);
|
|
628
|
+
fixedNow.push(...fixed);
|
|
629
|
+
if (fixed.length || failed.length)
|
|
630
|
+
({ environment, findings } = await diagnose(root, opts));
|
|
631
|
+
if (failed.length && !argv.includes('--json'))
|
|
632
|
+
for (const f of failed)
|
|
633
|
+
log(` ${s.red('✖')} couldn't fix: ${f.message}`);
|
|
634
|
+
}
|
|
635
|
+
const { fail, warn, fixable } = summarize(findings);
|
|
636
|
+
if (argv.includes('--json')) {
|
|
637
|
+
log(JSON.stringify({ environment, ok: fail === 0, fixed: fixedNow.map((f) => f.message), findings: findings.map(({ fix, ...f }) => ({ ...f, ...(fix ? { fix: fix.text, autoFix: !!(fix.safe && fix.apply) } : {}) })) }, null, 2));
|
|
638
|
+
return fail ? 1 : 0;
|
|
639
|
+
}
|
|
640
|
+
log('');
|
|
641
|
+
log(` ${s.bold('Doctor')} ${s.dim('·')} environment ${s.cyan(environment)} ${s.dim(`· ${root}`)}`);
|
|
642
|
+
log('');
|
|
643
|
+
for (const f of fixedNow)
|
|
644
|
+
log(` ${s.green('✔')} ${s.dim('fixed'.padEnd(9))} ${f.fix.text}`);
|
|
645
|
+
for (const line of formatFindings(findings, s.enabled, !argv.includes('--problems')))
|
|
646
|
+
log(` ${line}`);
|
|
647
|
+
log('');
|
|
648
|
+
if (!fail && !warn)
|
|
649
|
+
log(` ${s.green('All good.')}`);
|
|
650
|
+
else {
|
|
651
|
+
const parts = [fail ? s.red(`${fail} problem${fail > 1 ? 's' : ''}`) : '', warn ? s.yellow(`${warn} warning${warn > 1 ? 's' : ''}`) : ''].filter(Boolean).join(', ');
|
|
652
|
+
log(` ${parts}.${fixable ? ` \`propmaster doctor --fix\` fixes ${fixable} of them.` : ''}`);
|
|
653
|
+
}
|
|
654
|
+
return fail ? 1 : 0;
|
|
655
|
+
}
|
|
656
|
+
//# sourceMappingURL=doctor.js.map
|