{
    "$schema": "../../node_modules/nx/schemas/project-schema.json",
    "projectType": "library",
    "root": "packages/playwright-common",
    "targets": {
        "build:playwright": {
            "cache": true,
            "command": "tsc",
            "inputs": ["src"],
            "outputs": ["{projectRoot}/lib"],
            "options": { "cwd": "packages/playwright-common" },
            "dependsOn": ["^build"]
        },
        "lint:types": {
            "command": "pnpm exec tsc --noEmit",
            "options": { "cwd": "packages/playwright-common" },
            "dependsOn": ["^build"]
        },
        "docker:prebuild": {
            "cache": true,
            "command": "echo PLAYWRIGHT_VERSION=$(pnpm --silent -- playwright --version | awk '{print $2}') > .env.docker:build",
            "inputs": [{ "runtime": "pnpm --silent -- playwright --version" }],
            "outputs": ["{projectRoot}/.env.docker:build"],
            "options": { "cwd": "packages/playwright-common" }
        },
        "docker:build": {
            "executor": "@nx-tools/nx-container:build",
            "dependsOn": ["docker:prebuild"],
            "options": {
                "load": true,
                "engine": "docker",
                "platforms": ["linux/amd64", "linux/arm64"],
                "provenance": "true",
                "sbom": true,
                "build-args": ["PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION"],
                "context": "{projectRoot}",
                "metadata": {
                    "images": ["ghcr.io/element-hq/element-web/playwright-server"],
                    "tags": ["type=ref,event=branch", "type=raw,enable={{is_default_branch}},value=$PLAYWRIGHT_VERSION"]
                }
            }
        }
    }
}
