tooling/scripts/README.md
Internal CLI to quickly run repository scripts for the Scalar monorepo.
This tool provides a collection of commands to help manage packages, run tests, update dependencies, and perform various maintenance tasks across the workspace.
This is an internal tool used within the Scalar monorepo. To use it, run commands via pnpm:
pnpm --filter @scalar-internal/build-scripts start <command>
Or use the shorthand script if available:
pnpm scripts <command>
packages formatFormat and validate all package.json files in the workspace.
This command:
package.json files in packages/, integrations/, projects/, and examples/ directoriesUsage:
pnpm --filter @scalar-internal/build-scripts start packages format
packages outdated [packages...]Check for outdated packages in the workspace catalog.
This command checks all packages in the pnpm-workspace.yaml catalogs and reports which ones have newer versions available. You can optionally filter by package name patterns using glob patterns.
Usage:
# Check all packages
pnpm --filter @scalar-internal/build-scripts start packages outdated
# Check specific packages using glob patterns
pnpm --filter @scalar-internal/build-scripts start packages outdated "commander" "prettier*"
The output shows:
packages update <packages...>Update packages in the workspace catalog to their latest versions.
This command updates the specified packages in pnpm-workspace.yaml to their latest available versions. Use glob patterns to match multiple packages.
Usage:
# Update specific packages
pnpm --filter @scalar-internal/build-scripts start packages update "commander" "prettier"
# Update all packages matching a pattern
pnpm --filter @scalar-internal/build-scripts start packages update "prettier*"
After updating, run pnpm install to install the new versions.
wait -p, --ports <ports...>Wait for services to start on specified ports.
This command polls HTTP endpoints on the given ports until they respond successfully, or times out after 30 seconds. Useful for waiting for test servers or other services to be ready.
Usage:
# Wait for a single port
pnpm --filter @scalar-internal/build-scripts start wait -p 3000
# Wait for multiple ports
pnpm --filter @scalar-internal/build-scripts start wait -p 3000 3001 8080
The command will:
update-snapshotsUpdate Playwright test snapshot files.
This command processes Playwright test results and updates snapshot files for the CDN API Reference tests. It's intended to be run in the test-cdn-jsdelvr.yml GitHub Actions workflow.
Usage:
pnpm --filter @scalar-internal/build-scripts start update-snapshots
The command:
playwright/test-results/catTest terminal color output (debugging utility).
This command displays a colorful ASCII art cat and demonstrates all available terminal color outputs. Useful for testing terminal color support and debugging color-related issues.
Usage:
pnpm --filter @scalar-internal/build-scripts start cat
run test-serversRun test servers concurrently.
This command starts both the void-server and proxy-server test servers in parallel using concurrently. Useful for local development and testing.
Usage:
pnpm --filter @scalar-internal/build-scripts start run test-servers
The command runs:
@scalar/void-server on its default portproxy-scalar-com on its default portBoth servers run with CI=1 environment variable set.
update-playwright-dockerUpdate the Playwright Docker images to the latest version.
This command builds and pushes Docker images for Playwright testing. It creates two images:
scalarapi/playwright:${version} - Base Playwright imagescalarapi/playwright-runner:${version} - Runner imageUsage:
pnpm --filter @scalar-internal/build-scripts start update-playwright-docker
Note: This command requires Docker to be installed and configured, and you must have push access to the scalarapi Docker Hub organization.
generate-blogGenerate blog index cards and update scalar.config.json from post files.
Scans documentation/blog/ for markdown files matching YYYY-MM-DD-slug.md, then:
<!-- generated --> / <!-- /generated --> markers) in documentation/blog/index.md. Descriptions between :::scalar-card and ::scalar-fineprint are preserved across runs./blog/posts children in scalar.config.json. Custom titles in the config are preserved.Usage:
pnpm --filter @scalar-internal/build-scripts start generate-blog
generate-readmeGenerate README.md files for packages with readme metadata.
This command scans all packages in packages/ and integrations/ directories, finds those with readme metadata in their package.json, and generates standardized README.md files.
Usage:
pnpm --filter @scalar-internal/build-scripts start generate-readme
The generated README includes:
Package.json metadata format:
{
"readme": {
"title": "Package Name",
"badges": [
{ "type": "npm-version" },
{ "type": "npm-downloads" },
{ "type": "pypi-version", "package": "package-name" }
],
"documentation": "https://docs.example.com",
"image": {
"url": "https://example.com/image.png",
"altText": "Screenshot of the package"
},
"extraContent": {
"headline": "Additional Info",
"content": "Some extra content here"
}
}
}