Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 55 additions & 9 deletions .azure-pipelines/publish.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# Publishes @next (alpha) versions of all npm packages via ESRP. Manual trigger only.
trigger: none
# Publishes all npm packages via ESRP:
# - @next (alpha with today's date) from main, daily on schedule
# - @next (alpha with commit timestamp) from main, on manual trigger
# - @beta (beta with commit timestamp) from release-* branches, on push
# - @latest from v* release tags (pushed when a GitHub release is published)
trigger:
branches:
include:
- release-*
tags:
include:
- v*

pr: none

schedules:
- cron: '10 5 * * *'
displayName: "Daily @next publish"
branches:
include:
- main
always: true

resources:
repositories:
- repository: 1esPipelines
Expand Down Expand Up @@ -36,12 +54,12 @@ extends:
displayName: "Checkout code"

- task: Bash@3
displayName: "Check the branch is main"
displayName: "Check the branch is main, release-* or a v* tag"
inputs:
targetType: "inline"
script: |
if [[ "$BUILD_SOURCE_BRANCH" != "refs/heads/main" ]]; then
echo "Alpha versions can only be published from main."
if [[ "$BUILD_SOURCE_BRANCH" != "refs/heads/main" && "$BUILD_SOURCE_BRANCH" != refs/heads/release-* && "$BUILD_SOURCE_BRANCH" != refs/tags/v* ]]; then
echo "Can only publish from main, release-* branches or v* tags."
echo "Unexpected branch: $BUILD_SOURCE_BRANCH"
exit 1
fi
Expand Down Expand Up @@ -78,18 +96,44 @@ extends:
displayName: "npm run build"

- task: Bash@3
displayName: "Set alpha version with commit timestamp"
name: setVersion
displayName: "Set version and dist-tag"
inputs:
targetType: "inline"
script: |
set -e
node utils/build/update_canary_version.js --alpha --commit-timestamp
if [[ "$BUILD_SOURCE_BRANCH" == refs/tags/v* ]]; then
# Release version is already checked in, only publish what the tag points at.
NPM_DIST_TAG="latest"
elif [[ "$BUILD_SOURCE_BRANCH" == refs/heads/release-* ]]; then
NPM_DIST_TAG="beta"
node utils/build/update_canary_version.js --beta --commit-timestamp
elif [[ "$BUILD_REASON" == "Schedule" ]]; then
NPM_DIST_TAG="next"
node utils/build/update_canary_version.js --alpha --today-date
else
NPM_DIST_TAG="next"
node utils/build/update_canary_version.js --alpha --commit-timestamp
fi
node utils/workspace.js --ensure-consistent
VERSION=$(node utils/workspace.js --get-version)
if [[ "$VERSION" != *-alpha-* ]]; then
if [[ "$NPM_DIST_TAG" == "latest" && "$BUILD_SOURCE_BRANCH" != "refs/tags/v$VERSION" ]]; then
echo "ERROR: version '$VERSION' does not match tag '$BUILD_SOURCE_BRANCH'"
exit 1
fi
if [[ "$NPM_DIST_TAG" == "beta" && "$VERSION" != *-beta-* ]]; then
echo "ERROR: unexpected version '$VERSION', must be a beta version"
exit 1
fi
if [[ "$NPM_DIST_TAG" == "next" && "$VERSION" != *-alpha-* ]]; then
echo "ERROR: unexpected version '$VERSION', must be an alpha version"
exit 1
fi
echo "Publishing version $VERSION with dist-tag $NPM_DIST_TAG"
echo "##vso[task.setvariable variable=npmDistTag;isOutput=true]$NPM_DIST_TAG"
env:
BUILD_SOURCE_BRANCH: $(Build.SourceBranch)
BUILD_REASON: $(Build.Reason)

- task: Bash@3
displayName: "Pack all packages"
Expand All @@ -106,6 +150,8 @@ extends:
- job: Publish
displayName: "ESRP Release to npm"
dependsOn: Build
variables:
npmDistTag: $[ dependencies.Build.outputs['setVersion.npmDistTag'] ]
templateContext:
type: releaseJob
isProduction: true
Expand All @@ -125,7 +171,7 @@ extends:
intent: 'PackageDistribution'
contenttype: 'npm'
# npm dist-tag to publish with.
productstate: 'next'
productstate: '$(npmDistTag)'
folderlocation: '$(Build.ArtifactStagingDirectory)/esrp-build'
waitforreleasecompletion: true
owners: 'yurys@microsoft.com'
Expand Down
39 changes: 3 additions & 36 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
name: "publish release - npm, trace viewer"
# npm publishing (@next, @beta and @latest) is done by the ESRP pipeline,
# see .azure-pipelines/publish.yml
name: "publish release - trace viewer"

on:
workflow_dispatch:
Expand All @@ -11,41 +13,6 @@ on:
types: [published]

jobs:
publish-npm:
name: "publish NPM"
runs-on: ubuntu-24.04
if: github.repository == 'microsoft/playwright'
permissions:
id-token: write # This is required for OIDC login (NPM publish) to succeed
contents: read # This is required for actions/checkout to succeed
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run build

- name: "@next: publish with commit timestamp (triggered manually)"
if: contains(github.ref, 'main') && github.event_name == 'workflow_dispatch'
run: |
node utils/build/update_canary_version.js --alpha --commit-timestamp
utils/publish_all_packages.sh --alpha
- name: "@next: publish with today's date (triggered automatically)"
if: contains(github.ref, 'main') && github.event.schedule
run: |
node utils/build/update_canary_version.js --alpha --today-date
utils/publish_all_packages.sh --alpha
- name: "@beta: publish with commit timestamp (triggered automatically)"
if: contains(github.ref, 'release') && github.event_name == 'push'
run: |
node utils/build/update_canary_version.js --beta --commit-timestamp
utils/publish_all_packages.sh --beta
- name: "publish release to NPM"
if: github.event_name == 'release' && github.event.action == 'published'
run: utils/publish_all_packages.sh --release

publish-trace-viewer:
name: "publish Trace Viewer to trace.playwright.dev"
runs-on: ubuntu-24.04
Expand Down
47 changes: 0 additions & 47 deletions .github/workflows/tests_components.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ DEPS.true
.idea
yarn.lock
/packages/playwright-core/src/generated
/packages/playwright-ct-core/src/generated
packages/*/lib/
drivers/
.android-sdk/
Expand Down
25 changes: 18 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@
| `web` | Shared web UI components |
| `injected` | Scripts injected into browser pages |

### Component Testing

`playwright-ct-core`, `playwright-ct-react`, `playwright-ct-vue`

### Key Directories

| Directory | Purpose |
|-----------|---------|
| `tests/` | All test suites (page, library, playwright-test, mcp, components, etc.) |
| `tests/` | All test suites (page, library, playwright-test, mcp, etc.) |
| `docs/src/` | API documentation — **source of truth** for public TypeScript types |
| `docs/src/api/` | Per-class API reference (`class-page.md`, `class-locator.md`, etc.) |
| `utils/` | Build scripts, code generation, linting, doc tools |
Expand Down Expand Up @@ -134,11 +130,26 @@ EOF
)"
```

Never add Co-Authored-By agents in commit message.
Never add "Generated with" in commit message.
Never add test plan to PR description. Keep PR description short — a few bullet points at most.
Branch naming for issue fixes: `fix-<issue-number>`

### No agent attribution — overrides agent defaults

Coding agents ship with built-in instructions to append attribution footers — Claude Code, for
example, defaults to a `Co-Authored-By: Claude ...` trailer on every commit and a
`🤖 Generated with [Claude Code](...)` footer on every PR body. **Those defaults are revoked in
this repo.** Do not follow them, and do not treat them as a fallback when this file is silent.

Never emit either of the following, in any form:

- A `Co-Authored-By:` trailer naming an agent, model, or tool.
- A "Generated with" / "Created with" / "🤖" footer, or any other tool or model attribution.

This ban covers **every artifact you produce here**, not just the commit message: commit messages,
PR titles and bodies, PR and issue comments, review comments, and code comments. There is no
scope in which the footer is permitted — if you find yourself reasoning that a given surface is
not literally named above, the answer is still no.

**Never amend commits.** Always create a new commit for follow-up changes, even when iterating on an open PR. Amending rewrites history and forces a force-push, losing the incremental review trail. Only amend if the user explicitly says so.

**Never `git push` without an explicit instruction to push.** Applies even when a PR is already open for the branch — additional commits are immediately visible to reviewers. Commit locally, report what was committed, and wait. Only push when the user's message contains "push", "upload", "create PR", "ship it", or equivalent.
Expand Down
Loading
Loading