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-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "lvbt-contributions",
"description": "Create readable LVBT GitHub issues and pull requests.",
"version": "0.5.2",
"version": "0.5.3",
"source": "./packages/cli/plugins/lvbt-contributions"
}
]
Expand Down
9 changes: 9 additions & 0 deletions docs/reference/release-0-5-3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Repository tooling 0.5.3

A repository that stores files with Git LFS no longer needs its own step in `.githooks/pre-push`.
The shared pre-push hook now uploads LFS objects with the push, as the hook `git lfs install` writes
would, once `pnpm check` passes. It does this only when `git-lfs` is installed and `.gitattributes`
has a `filter=lfs` rule, so nothing changes for a repository that doesn't use LFS.

If you added `git lfs pre-push` to your repository's `.githooks/pre-push`, remove it after updating;
the file then matches the standard's copy again and `pnpm standards:check` stops warning about it.
2 changes: 1 addition & 1 deletion examples/basic/.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.2"
"ref": "v0.5.3"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"*": "prettier --write --ignore-unknown"
},
"devDependencies": {
"@lasvegasfortransit/cli": "0.5.2",
"@lasvegasfortransit/prettier-config": "0.5.2",
"@lasvegasfortransit/cli": "0.5.3",
"@lasvegasfortransit/prettier-config": "0.5.3",
"lint-staged": "catalog:",
"markdownlint-cli2": "catalog:",
"markdownlint-rule-relative-links": "catalog:",
Expand Down
6 changes: 3 additions & 3 deletions examples/basic/packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"test": "vitest run"
},
"devDependencies": {
"@lasvegasfortransit/eslint-config": "0.5.2",
"@lasvegasfortransit/typescript-config": "0.5.2",
"@lasvegasfortransit/vitest-config": "0.5.2",
"@lasvegasfortransit/eslint-config": "0.5.3",
"@lasvegasfortransit/typescript-config": "0.5.3",
"@lasvegasfortransit/vitest-config": "0.5.3",
"@types/node": "catalog:",
"eslint": "catalog:",
"typescript": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-astro/.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.2"
"ref": "v0.5.3"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions 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.2",
"@lasvegasfortransit/playwright-config": "0.5.2",
"@lasvegasfortransit/typescript-config": "0.5.2",
"@lasvegasfortransit/vitest-config": "0.5.2",
"@lasvegasfortransit/eslint-config": "0.5.3",
"@lasvegasfortransit/playwright-config": "0.5.3",
"@lasvegasfortransit/typescript-config": "0.5.3",
"@lasvegasfortransit/vitest-config": "0.5.3",
"@playwright/test": "catalog:",
"@types/node": "catalog:",
"eslint": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions 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.2",
"@lasvegasfortransit/prettier-config": "0.5.2",
"@lasvegasfortransit/cli": "0.5.3",
"@lasvegasfortransit/prettier-config": "0.5.3",
"lint-staged": "catalog:",
"markdownlint-cli2": "catalog:",
"markdownlint-rule-relative-links": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vite-react/.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.2"
"ref": "v0.5.3"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions examples/with-vite-react/apps/app/package.json
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.2",
"@lasvegasfortransit/playwright-config": "0.5.2",
"@lasvegasfortransit/typescript-config": "0.5.2",
"@lasvegasfortransit/vitest-config": "0.5.2",
"@lasvegasfortransit/eslint-config": "0.5.3",
"@lasvegasfortransit/playwright-config": "0.5.3",
"@lasvegasfortransit/typescript-config": "0.5.3",
"@lasvegasfortransit/vitest-config": "0.5.3",
"@playwright/test": "catalog:",
"@tailwindcss/vite": "catalog:",
"@types/node": "catalog:",
Expand Down
4 changes: 2 additions & 2 deletions 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.2",
"@lasvegasfortransit/prettier-config": "0.5.2",
"@lasvegasfortransit/cli": "0.5.3",
"@lasvegasfortransit/prettier-config": "0.5.3",
"lint-staged": "catalog:",
"markdownlint-cli2": "catalog:",
"markdownlint-rule-relative-links": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lvbt-repository-tooling",
"private": true,
"version": "0.5.2",
"version": "0.5.3",
"type": "module",
"description": "Source of truth for the LVBT repository standard: the shared @lasvegasfortransit packages and the example repositories create-turbo copies.",
"packageManager": "pnpm@11.25.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/hooks/pre-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ while IFS= read -r variable; do
done <<EOF
$LOCAL_ENV_VARS
EOF
# Git passes the refs being pushed on standard input; keep them for Git LFS.
REFS=$(cat)
cd "$ROOT"
pnpm check
# A repository that stores files with Git LFS uploads their objects with the
# push, as the hook `git lfs install` writes would. Only after the check passes.
if command -v git-lfs >/dev/null 2>&1 && grep -qs 'filter=lfs' "$ROOT/.gitattributes"; then
printf '%s\n' "$REFS" | git lfs pre-push "$@"
fi
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lasvegasfortransit/cli",
"version": "0.5.2",
"version": "0.5.3",
"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.2",
"version": "0.5.3",
"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.2",
"version": "0.5.3",
"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 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.2",
"version": "0.5.3",
"description": "The ESLint configurations every LVBT repository uses.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "0.5.3",
"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 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.2",
"version": "0.5.3",
"description": "The Prettier configuration every LVBT repository uses.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "0.5.3",
"description": "TypeScript configurations every LVBT repository extends.",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "0.5.3",
"description": "The Vitest configuration every LVBT repository spreads into its own.",
"license": "MIT",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion 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.2",
"version": "0.5.3",
"description": "Provider-neutral deployment, provisioning, and validation primitives for LVBT web repositories.",
"license": "MIT",
"type": "module",
Expand Down
40 changes: 39 additions & 1 deletion tests/hooks.test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from 'node:assert/strict';
import { chmod, mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises';
import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import path from 'node:path';
import { spawnSync } from 'node:child_process';
Expand Down Expand Up @@ -193,6 +193,44 @@ test('the pre-push hook clears repository-local Git variables before checks', as
assert.equal(await readFile(resultFile, 'utf8'), 'unset|unset');
});

test('the pre-push hook uploads Git LFS objects after the check, only where LFS is used', async (t) => {
const directory = await mkdtemp(path.join(tmpdir(), 'lvbt-pre-push-lfs-'));
t.after(() => rm(directory, { recursive: true, force: true }));
const repository = path.join(directory, 'repository');
const log = path.join(directory, 'log');
spawnSync('git', ['init', '--quiet', repository]);
await writeFile(path.join(directory, 'pnpm'), `#!/bin/sh\necho check >> "${log}"\n`);
await writeFile(path.join(directory, 'git-lfs'), `#!/bin/sh\necho "lfs $* $(cat)" >> "${log}"\n`);
await chmod(path.join(directory, 'pnpm'), 0o755);
await chmod(path.join(directory, 'git-lfs'), 0o755);
const push = () =>
spawnSync(
path.join(repositoryRoot, 'packages/cli/hooks/pre-push.sh'),
['origin', 'git@example.org:repo.git'],
{
cwd: repository,
encoding: 'utf8',
input: 'refs/heads/main abc refs/heads/main def\n',
env: { ...process.env, PATH: `${directory}:${process.env.PATH}` },
},
);

assert.equal(push().status, 0);
assert.equal(await readFile(log, 'utf8'), 'check\n', 'no LFS upload without an LFS rule');

await writeFile(
path.join(repository, '.gitattributes'),
'*.png filter=lfs diff=lfs merge=lfs -text\n',
);
await rm(log);
const result = push();
assert.equal(result.status, 0, result.stderr);
assert.equal(
await readFile(log, 'utf8'),
'check\nlfs pre-push origin git@example.org:repo.git refs/heads/main abc refs/heads/main def\n',
);
});

test('the shared and source repository hooks pass ShellCheck', (context) => {
const available = spawnSync('shellcheck', ['--version'], { encoding: 'utf8' });
if (available.error?.code === 'ENOENT') {
Expand Down
Loading