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
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"source": {
"source": "github",
"repo": "LasVegasForTransit/repository-tooling",
"ref": "v0.5.0"
"ref": "v0.5.1"
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions .lvbt/web-platform.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"formatVersion": 1,
"preset": "lvbt-web",
"release": "v0.5.0",
"commit": "cc7458f97c1699ea48633810298e4982d308f0ad",
"contentHash": "13d5ae98e03b50cb5419af95a197efc540d4af3daa0eefed0856806068273895",
"release": "v0.5.1",
"commit": "aeefde198fb9d0833e7355ae1328ded2c7ec0e05",
"contentHash": "9dbbb935bf2a7a8ae7db7af9bf9ea10bad1e66bc4dfc6e85e479e9e0ef16eb6b",
"executables": [
"examples/with-astro/.githooks/commit-msg",
"examples/with-astro/.githooks/pre-commit",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"source": {
"source": "github",
"repo": "LasVegasForTransit/repository-tooling",
"ref": "v0.5.0"
"ref": "v0.5.1"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions .lvbt/web-platform/examples/with-astro/apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
},
"devDependencies": {
"@astrojs/check": "catalog:",
"@lasvegasfortransit/eslint-config": "0.5.0",
"@lasvegasfortransit/playwright-config": "0.5.0",
"@lasvegasfortransit/typescript-config": "0.5.0",
"@lasvegasfortransit/vitest-config": "0.5.0",
"@lasvegasfortransit/eslint-config": "0.5.1",
"@lasvegasfortransit/playwright-config": "0.5.1",
"@lasvegasfortransit/typescript-config": "0.5.1",
"@lasvegasfortransit/vitest-config": "0.5.1",
"@playwright/test": "catalog:",
"@types/node": "catalog:",
"eslint": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions .lvbt/web-platform/examples/with-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"*": "prettier --write --ignore-unknown"
},
"devDependencies": {
"@lasvegasfortransit/cli": "0.5.0",
"@lasvegasfortransit/prettier-config": "0.5.0",
"@lasvegasfortransit/cli": "0.5.1",
"@lasvegasfortransit/prettier-config": "0.5.1",
"lint-staged": "catalog:",
"markdownlint-cli2": "catalog:",
"markdownlint-rule-relative-links": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"source": {
"source": "github",
"repo": "LasVegasForTransit/repository-tooling",
"ref": "v0.5.0"
"ref": "v0.5.1"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"react-dom": "catalog:"
},
"devDependencies": {
"@lasvegasfortransit/eslint-config": "0.5.0",
"@lasvegasfortransit/playwright-config": "0.5.0",
"@lasvegasfortransit/typescript-config": "0.5.0",
"@lasvegasfortransit/vitest-config": "0.5.0",
"@lasvegasfortransit/eslint-config": "0.5.1",
"@lasvegasfortransit/playwright-config": "0.5.1",
"@lasvegasfortransit/typescript-config": "0.5.1",
"@lasvegasfortransit/vitest-config": "0.5.1",
"@playwright/test": "catalog:",
"@tailwindcss/vite": "catalog:",
"@types/node": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions .lvbt/web-platform/examples/with-vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"*": "prettier --write --ignore-unknown"
},
"devDependencies": {
"@lasvegasfortransit/cli": "0.5.0",
"@lasvegasfortransit/prettier-config": "0.5.0",
"@lasvegasfortransit/cli": "0.5.1",
"@lasvegasfortransit/prettier-config": "0.5.1",
"lint-staged": "catalog:",
"markdownlint-cli2": "catalog:",
"markdownlint-rule-relative-links": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/cli",
"version": "0.5.0",
"version": "0.5.1",
"description": "The lvbt command every LVBT repository runs for bootstrap, preflight, and deploy, plus the production platform setup, the shared git hooks, and the lvbt-contributions agent plugin.",
"license": "MIT",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lvbt-contributions",
"version": "0.5.0",
"version": "0.5.1",
"description": "Create readable LVBT GitHub issues and pull requests through the organization workflow.",
"author": {
"name": "Las Vegans for Better Transit",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lvbt-contributions",
"version": "0.5.0",
"version": "0.5.1",
"description": "Create readable LVBT GitHub issues and pull requests through the organization workflow.",
"author": {
"name": "Las Vegans for Better Transit",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/eslint-config",
"version": "0.5.0",
"version": "0.5.1",
"description": "The ESLint configurations every LVBT repository uses.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/playwright-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/playwright-config",
"version": "0.5.0",
"version": "0.5.1",
"description": "The Playwright configuration every LVBT repository spreads into its own: end-to-end tests under tests/e2e, desktop and mobile projects, traces on failure.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/prettier-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/prettier-config",
"version": "0.5.0",
"version": "0.5.1",
"description": "The Prettier configuration every LVBT repository uses.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/typescript-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/typescript-config",
"version": "0.5.0",
"version": "0.5.1",
"description": "TypeScript configurations every LVBT repository extends.",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/vitest-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/vitest-config",
"version": "0.5.0",
"version": "0.5.1",
"description": "The Vitest configuration every LVBT repository spreads into its own.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion .lvbt/web-platform/packages/web-platform/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/web-platform",
"version": "0.5.0",
"version": "0.5.1",
"description": "Provider-neutral deployment, provisioning, and validation primitives for LVBT web repositories.",
"license": "MIT",
"type": "module",
Expand Down
40 changes: 37 additions & 3 deletions .lvbt/web-platform/standards/propose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ function remoteBranchState(
branch: string,
runner: Runner,
): 'absent' | 'current' | 'stale' | 'edited' {
if (!runner('git', ['ls-remote', '--heads', 'origin', branch], target)) return 'absent';
if (!runner('git', ['ls-remote', '--heads', 'origin', branch], target)) {
// A tracking ref left from a branch GitHub has since deleted would make --force-with-lease
// refuse the push, so forget it.
runner('git', ['update-ref', '-d', `refs/remotes/origin/${branch}`], target);
return 'absent';
}
runner(
'git',
['fetch', '--quiet', 'origin', `+refs/heads/${branch}:refs/remotes/origin/${branch}`],
Expand Down Expand Up @@ -136,6 +141,33 @@ function createOrEdit(options: {
return (JSON.parse(runner('node', args, target)) as { number: number }).number;
}

/** The release the repository's default branch vendors, read from GitHub rather than the checkout. */
function defaultBranchRelease(target: string, runner: Runner): string | null {
const manifest = runner(
'gh',
[
'api',
'repos/{owner}/{repo}/contents/.lvbt/web-platform.json',
'-H',
'Accept: application/vnd.github.raw',
],
target,
);
return (JSON.parse(manifest) as { release: string | null }).release;
}

/** Runs Validate on the update branch; a workflow token's push alone starts no workflow. */
function dispatchValidation(target: string, branch: string, runner: Runner): void {
try {
runner('gh', ['workflow', 'run', 'ci.yml', '--ref', branch], target);
} catch {
process.stderr.write(
`Could not run ci.yml on ${branch}. Give ci.yml a workflow_dispatch trigger, as the examples' has, so update pull requests get their Validate check.\n`,
);
process.exitCode = 1;
}
}

/**
* Pushes the update branch, opens or refreshes its pull request, enables auto-merge, and closes
* update pull requests for older releases.
Expand Down Expand Up @@ -166,8 +198,10 @@ export async function proposeRelease(options: {
if (automerge) runner('gh', ['pr', 'merge', String(number), '--auto', '--rebase'], target);
// A push made with a repository's own GITHUB_TOKEN starts no workflow, but a dispatch always
// does, and its Validate check lands on the branch's head commit.
if (pushed) runner('gh', ['workflow', 'run', 'ci.yml', '--ref', updateBranch(tag)], target);
} else {
if (pushed) dispatchValidation(target, updateBranch(tag), runner);
} else if (defaultBranchRelease(target, runner) === tag) {
// Only a default branch that already carries the release makes its update pull request moot;
// a checkout that happens to be on the update branch does not.
superseded.push(...open.filter(({ headRefName }) => headRefName === updateBranch(tag)));
}

Expand Down
Loading