{
    "name": "altis/accelerate",
    "license": "GPL-2.0-or-later",
    "type": "wordpress-plugin",
    "require": {
        "composer/installers": "^1.7",
        "humanmade/asset-loader": "^0.6.1",
        "markrogoyski/math-php": "^0.51.0",
        "posthog/posthog-php": "^2.0 || ^3.0 || ^4.0",
        "php": ">=7.4",
        "guzzlehttp/guzzle": "^7.3",
        "humanmade/foundry": "^0.0.1"
    },
    "require-dev": {
        "altis/analytics-demo-tools": "*@dev",
        "automattic/vipwpcs": "^2.0",
        "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
        "phpcompatibility/phpcompatibility-wp": "^2.1",
        "squizlabs/php_codesniffer": "^3.4",
        "phpunit/phpunit": "^9.6",
        "wp-phpunit/wp-phpunit": "^6.7",
        "yoast/phpunit-polyfills": "^4.0"
    },
    "config": {
        "allow-plugins": {
            "composer/installers": true,
            "altis/*": true,
            "dealerdirect/phpcodesniffer-composer-installer": true,
            "php-http/discovery": true
        },
        "preferred-install": {
            "altis/*": "source"
        },
        "platform": {
            "php": "7.4.0"
        }
    },
    "scripts": {
        "build-deps": [
            "npm install --legacy-peer-deps && npm run build"
        ],
        "start": [
            "if [ ! -d \".wordpress\" ]; then mkdir .wordpress; fi",
            "docker compose -p accelerate up -d",
            "composer run ch-setup",
            "composer run cli-no-tty -- wp core is-installed || composer run install-wp",
            "docker compose -p accelerate exec wordpress bash -c 'cp wp-config-docker.php wp-config.php'",
            "cat .setup/help-text.txt"
        ],
        "install-wp": [
            "composer run cli-no-tty -- wp core install --url=http://localhost:8081/ --title=Accelerate --admin_user=admin --admin_password=password --skip-email --admin_email=admin@example.com",
            "composer run cli-no-tty -- wp core update --version=6.7",
            "composer run cli-no-tty -- wp plugin activate altis-accelerate",
            "composer run cli-no-tty -- option update altis_analytics_dashboard_access_token 7ROOa4lisBVu",
            "composer run cli-no-tty -- option update altis_config \"eu-central-1:a5fc577ad7104d24bbbe9947585edf71:^WY1cz3C0Amw*G9E3WRumK&OSz6E^(hY\""
        ],
        "stop": [
            "docker compose -p accelerate down"
        ],
        "destroy": [
            "docker compose -p accelerate down -v"
        ],
        "cli": [
            "docker run -it --rm --volumes-from accelerate-wordpress-1 --env-file .wp-env --network accelerate_default --link accelerate-tracker-1:tracker wordpress:cli"
        ],
        "cli-no-tty": [
            "docker run -t --rm --volumes-from accelerate-wordpress-1 --env-file .wp-env --network accelerate_default wordpress:cli"
        ],
        "shell": [
            "docker exec -it accelerate-wordpress-1 /bin/bash"
        ],
        "grafana": [
            "open http://localhost:3600"
        ],
        "ch-setup": [
            "docker exec -t accelerate-clickhouse-1 clickhouse-client --queries-file /.setup/create-analytics-table.sql"
        ],
        "ch-cli": [
            "docker exec -it accelerate-clickhouse-1 clickhouse-client"
        ],
        "ch-query": [
            "docker exec -it accelerate-clickhouse-1 clickhouse-client --query"
        ],
        "phpunit": "docker exec -t accelerate-wordpress-1 /bin/bash -c 'cd wp-content/plugins/altis-accelerate && ./vendor/bin/phpunit \"$@\"' --",
        "playwright": "cd tests/e2e && npx playwright test",
        "php-log": [
            "tail -f .wordpress/wp-content/debug.log"
        ]

    },
    "autoload-dev": {
        "psr-4": {
            "Altis\\Tests\\Unit\\": "tests/unit/"
        }
    },
    "autoload": {
        "psr-4": {
            "Altis\\GlobalBlocks\\REST_API\\": "global-blocks/rest-api/",
            "Altis\\GlobalBlocks\\REST_API\\Relationships\\": "global-blocks/rest-api/relationships/",
            "Altis\\GlobalBlocks\\REST_API\\Search\\": "global-blocks/rest-api/search/"
        },
        "classmap": [
            "inc/"
        ],
        "files": [
            "inc/namespace.php",
            "inc/utils/namespace.php",
            "inc/telemetry/namespace.php",
            "inc/analytics/namespace.php",
            "inc/api/namespace.php",
            "inc/audiences/namespace.php",
            "inc/audiences/rest_api/namespace.php",
            "inc/broadcast/namespace.php",
            "inc/blocks/namespace.php",
            "inc/blocks/rest_api/namespace.php",
            "inc/dashboard/namespace.php",
            "inc/experiments/namespace.php",
            "inc/experiments/migration.php",
            "inc/experiments/rest_api/namespace.php",
            "inc/experiments/titles/namespace.php",
            "inc/experiments/featured-images/namespace.php",
            "inc/export/cron/namespace.php",
            "inc/export/namespace.php",
            "inc/preview/namespace.php",
            "inc/admin/namespace.php",
            "inc/admin/notices.php",
            "inc/admin/rest_api/namespace.php",
            "inc/global-blocks/namespace.php",
            "inc/global-blocks/connections.php",
            "inc/global-blocks/rest-api/namespace.php",
            "inc/global-blocks/variant/namespace.php"
        ]
    },
    "extra": {
        "installer-paths": {
            "plugins/{$name}/": [
                "type:wordpress-plugin"
            ]
        }
    }
}
