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.4.4"
"ref": "v0.5.0"
}
}
},
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/standard-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Keeps this repository on the latest release of the LVBT repository standard.
# Each day it compares .lvbt/web-platform.json with the newest release of
# repository-tooling. When a release is newer, it applies it with the
# release's own updater and opens one pull request that merges itself once
# Validate passes. It uses only this workflow's own token.
#
# The token may not change workflow files, so this file stays small and the
# work lives in the vendored standard. If a release changes a workflow file,
# the run fails and names the file to copy by hand.
name: Standard update

on:
schedule:
- cron: '23 14 * * *'
workflow_dispatch:

permissions:
actions: write
contents: write
packages: read
pull-requests: write

concurrency:
group: standard-update
cancel-in-progress: false

jobs:
update:
name: Update the standard
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Setup Node + pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Open the update pull request
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ github.token }}
run: node .lvbt/web-platform/standards/self-update.ts
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.4.5",
"commit": "402288c0a379a3eaec3922ed5cdd42395a044b3b",
"contentHash": "77cc0e091ed3560e8608d95ff7efc4542cdb05047a9b9ed381f02ce47646f3b7",
"release": "v0.5.0",
"commit": "cc7458f97c1699ea48633810298e4982d308f0ad",
"contentHash": "13d5ae98e03b50cb5419af95a197efc540d4af3daa0eefed0856806068273895",
"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.4.5"
"ref": "v0.5.0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Keeps this repository on the latest release of the LVBT repository standard.
# Each day it compares .lvbt/web-platform.json with the newest release of
# repository-tooling. When a release is newer, it applies it with the
# release's own updater and opens one pull request that merges itself once
# Validate passes. It uses only this workflow's own token.
#
# The token may not change workflow files, so this file stays small and the
# work lives in the vendored standard. If a release changes a workflow file,
# the run fails and names the file to copy by hand.
name: Standard update

on:
schedule:
- cron: '23 14 * * *'
workflow_dispatch:

permissions:
actions: write
contents: write
packages: read
pull-requests: write

concurrency:
group: standard-update
cancel-in-progress: false

jobs:
update:
name: Update the standard
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Setup Node + pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Open the update pull request
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ github.token }}
run: node .lvbt/web-platform/standards/self-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# boundaries of your repository; omit a scope when a change crosses them.
site
docs
ci
dx
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.4.5",
"@lasvegasfortransit/playwright-config": "0.4.5",
"@lasvegasfortransit/typescript-config": "0.4.5",
"@lasvegasfortransit/vitest-config": "0.4.5",
"@lasvegasfortransit/eslint-config": "0.5.0",
"@lasvegasfortransit/playwright-config": "0.5.0",
"@lasvegasfortransit/typescript-config": "0.5.0",
"@lasvegasfortransit/vitest-config": "0.5.0",
"@playwright/test": "catalog:",
"@types/node": "catalog:",
"eslint": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ git commit
```

The commit hook checks the message. Subjects look like `type(scope): description` where `type` is
one of `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`, `style`, `revert`,
and the optional `scope` is one of the boundaries listed in `.lvbt/commit-scopes.txt`. A `feat` or
`fix` commit also needs a body that says what changed for a person using the product and why. The
hook tells you exactly what to change when it rejects a message.
one of `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `build`, `style`, `revert`, and
the optional `scope` is one of the boundaries listed in `.lvbt/commit-scopes.txt`. A `feat` or `fix`
commit also needs a body that says what changed for a person using the product and why. The hook
tells you exactly what to change when it rejects a message.

## 4. Open a pull request

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.4.5",
"@lasvegasfortransit/prettier-config": "0.4.5",
"@lasvegasfortransit/cli": "0.5.0",
"@lasvegasfortransit/prettier-config": "0.5.0",
"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.4.5"
"ref": "v0.5.0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Keeps this repository on the latest release of the LVBT repository standard.
# Each day it compares .lvbt/web-platform.json with the newest release of
# repository-tooling. When a release is newer, it applies it with the
# release's own updater and opens one pull request that merges itself once
# Validate passes. It uses only this workflow's own token.
#
# The token may not change workflow files, so this file stays small and the
# work lives in the vendored standard. If a release changes a workflow file,
# the run fails and names the file to copy by hand.
name: Standard update

on:
schedule:
- cron: '23 14 * * *'
workflow_dispatch:

permissions:
actions: write
contents: write
packages: read
pull-requests: write

concurrency:
group: standard-update
cancel-in-progress: false

jobs:
update:
name: Update the standard
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0

- name: Setup Node + pnpm
uses: ./.github/actions/setup-node-pnpm

- name: Open the update pull request
env:
GH_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ github.token }}
run: node .lvbt/web-platform/standards/self-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
# boundaries of your repository; omit a scope when a change crosses them.
app
docs
ci
dx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"react-dom": "catalog:"
},
"devDependencies": {
"@lasvegasfortransit/eslint-config": "0.4.5",
"@lasvegasfortransit/playwright-config": "0.4.5",
"@lasvegasfortransit/typescript-config": "0.4.5",
"@lasvegasfortransit/vitest-config": "0.4.5",
"@lasvegasfortransit/eslint-config": "0.5.0",
"@lasvegasfortransit/playwright-config": "0.5.0",
"@lasvegasfortransit/typescript-config": "0.5.0",
"@lasvegasfortransit/vitest-config": "0.5.0",
"@playwright/test": "catalog:",
"@tailwindcss/vite": "catalog:",
"@types/node": "catalog:",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ git commit
```

The commit hook checks the message. Subjects look like `type(scope): description` where `type` is
one of `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `ci`, `build`, `style`, `revert`,
and the optional `scope` is one of the boundaries listed in `.lvbt/commit-scopes.txt`. A `feat` or
`fix` commit also needs a body that says what changed for a person using the product and why. The
hook tells you exactly what to change when it rejects a message.
one of `feat`, `fix`, `docs`, `refactor`, `test`, `chore`, `perf`, `build`, `style`, `revert`, and
the optional `scope` is one of the boundaries listed in `.lvbt/commit-scopes.txt`. A `feat` or `fix`
commit also needs a body that says what changed for a person using the product and why. The hook
tells you exactly what to change when it rejects a message.

## 4. Open a pull request

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.4.5",
"@lasvegasfortransit/prettier-config": "0.4.5",
"@lasvegasfortransit/cli": "0.5.0",
"@lasvegasfortransit/prettier-config": "0.5.0",
"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.4.5",
"version": "0.5.0",
"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.4.5",
"version": "0.5.0",
"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.4.5",
"version": "0.5.0",
"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,7 +1,7 @@
import { readFileSync, realpathSync } from 'node:fs';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { commitSubjectError } from './validate-commit-subject.mjs';
import { commitSubjectError, commitSubjectWarning } from './validate-commit-subject.mjs';

/**
* The whole-message rules, applied by the commit-msg hook after the subject
Expand Down Expand Up @@ -132,7 +132,10 @@ if (isDirectInvocation()) {
process.stderr.write('Usage: validate-commit-message.mjs <commit-message-file>\n');
process.exitCode = 2;
} else {
const errors = commitMessageErrors(readFileSync(file, 'utf8'));
const message = readFileSync(file, 'utf8');
const warning = commitSubjectWarning(message.split(/\r?\n/)[0] ?? '');
if (warning) process.stderr.write(`warning: ${warning}\n`);
const errors = commitMessageErrors(message);
if (errors.length > 0) {
process.stderr.write(`Commit blocked:\n${errors.map((error) => ` ${error}`).join('\n')}\n`);
process.exitCode = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ export const commitTypes = Object.freeze(

const subjectPattern = /^(?<type>[a-z]+)(?:\((?<scope>[a-z0-9-]+)\))?: \S.*$/;

/**
* Names on their way out: neither a kind of change nor a boundary of a repository. `ci` behaved
* exactly like `chore` in every changelog and release tool, so it only added a choice to argue about.
* They still pass, with a warning, until the release that retires them.
*/
export const deprecatedNames = Object.freeze({
ci: 'Use `chore` for workflow and CI configuration changes; from standard v0.6.0 the commit hook rejects `ci`.',
});

/** A warning for a subject that uses a deprecated type or scope, or undefined. */
export function commitSubjectWarning(subject) {
const { type, scope } = subjectPattern.exec(subject)?.groups ?? {};
for (const [kind, name] of [
['Type', type],
['Scope', scope],
]) {
if (name && Object.hasOwn(deprecatedNames, name))
return `${kind} \`${name}\` is deprecated. ${deprecatedNames[name]}`;
}
return undefined;
}

function choices(values) {
return values.map((value) => `\`${value}\``).join(', ');
}
Expand Down Expand Up @@ -98,6 +120,8 @@ function isDirectInvocation() {

if (isDirectInvocation()) {
const error = commitSubjectError(process.argv[2] ?? '');
const warning = commitSubjectWarning(process.argv[2] ?? '');
if (warning) process.stderr.write(`warning: ${warning}\n`);
if (error) {
process.stderr.write(`Commit blocked: ${error}\n`);
process.exitCode = 1;
Expand Down
Loading
Loading