Skip to content

🎥 Make videos programmatically with React

Also use optimized format for `bun run format`

Jonny Burger883ff37418ec
diff --git a/package.json b/package.json
index dc2a593629..41762bb2a9 100644
--- a/package.json
+++ b/package.json
@@ -8,7 +8,7 @@
"ts-build": "tsc -b --verbose --watch",
"stylecheck": "turbo run lint formatting --no-update-notifier",
"formatting": "turbo run formatting --no-update-notifier",
- "format": "bun run --filter '*' format",
+ "format": "bun pre-commit.ts",
"build": "turbo run make --no-update-notifier",
"build-docs": "TURBO_TELEMETRY_DISABLED=1 turbo run build-docs --no-update-notifier",
"testssr": "turbo run testssr --no-update-notifier",
diff --git a/pre-commit.ts b/pre-commit.ts
index 8adabec012..5f01fd5029 100644
--- a/pre-commit.ts
+++ b/pre-commit.ts
@@ -2,16 +2,19 @@ import {readFileSync, existsSync} from 'fs';
import path from 'path';
import {$} from 'bun';
-const result = await $`git diff --cached --name-only --diff-filter=ACMR`.text();
-const stagedFiles = result.trim().split('\n').filter(Boolean);
+const staged = await $`git diff --cached --name-only --diff-filter=ACMR`.text();
+const unstaged = await $`git diff --name-only`.text();
+const changedFiles = [
+ ...new Set([...staged.trim().split('\n'), ...unstaged.trim().split('\n')]),
+].filter(Boolean);
-if (stagedFiles.length === 0) {
+if (changedFiles.length === 0) {
process.exit(0);
}
const packageNames = new Set<string>();
-for (const file of stagedFiles) {
+for (const file of changedFiles) {
const match = file.match(/^packages\/([^/]+)\//);
if (!match) {
continue;