Skip to content

Commit 6a1a9fe

Browse files
committed
Skip scripts
1 parent 3c5bac8 commit 6a1a9fe

4 files changed

Lines changed: 35 additions & 56 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ COPY packages/shared/package.json ./packages/shared/
1818
COPY scripts/ ./scripts/
1919

2020
# Install dependencies
21-
RUN bun install --frozen-lockfile
21+
RUN bun install --frozen-lockfile --ignore-scripts
2222

2323
# Copy the rest of the source code
2424
COPY . .

bun.lockb

Whitespace-only changes.

lefthook.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,6 @@ pre-commit:
66
- CI: "true"
77

88
commands:
9-
# --- Block stale bun.lockb (Vitest transition cutoff 2025-04-18) ----------
10-
lockfile-check:
11-
skip:
12-
- CI: "true"
13-
run: |
14-
CUTOFF="2025-04-18"
15-
MTIME=$(stat -f "%Sm" -t "%Y-%m-%d" bun.lockb 2>/dev/null \
16-
|| stat -c "%y" bun.lockb 2>/dev/null | cut -d' ' -f1 \
17-
|| echo "1970-01-01")
18-
if [ "$MTIME" \< "$CUTOFF" ]; then
19-
echo ""
20-
echo "[pre-commit] ERROR: bun.lockb is from $MTIME, before $CUTOFF."
21-
echo "The project switched to Vitest. Run: bun install"
22-
echo ""
23-
exit 1
24-
fi
25-
269
# --- Block manually committed migration files ----------------------------
2710
no-migrations:
2811
skip:

scripts/release.ts

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { execSync } from 'node:child_process';
12
import { Octokit } from 'octokit';
23
import { createInterface } from 'node:readline';
34

@@ -62,52 +63,43 @@ async function main() {
6263
process.exit(1);
6364
}
6465

65-
const octokit = new Octokit({ auth: token });
66-
const owner = 'mcowger';
67-
const repo = 'plexus';
68-
69-
// 1. Get current version tags via GitHub API
70-
let currentTag: CalVerTag | null = null;
71-
try {
72-
const { data: tags } = await octokit.request('GET /repos/{owner}/{repo}/tags', {
73-
owner,
74-
repo,
75-
per_page: 100,
76-
});
66+
// 1. Get local tags using git
67+
const tagOutput = execSync('git tag', { encoding: 'utf-8' });
68+
const allTags = tagOutput
69+
.split('\n')
70+
.map((t) => t.trim())
71+
.filter(Boolean);
72+
73+
const calverTags = allTags.map((t) => parseCalVer(t)).filter((t): t is CalVerTag => t !== null);
74+
75+
// Sort: newest date first, then highest counter
76+
calverTags.sort((a, b) => {
77+
const dateA = a.year * 10000 + a.month * 100 + a.day;
78+
const dateB = b.year * 10000 + b.month * 100 + b.day;
79+
if (dateB !== dateA) return dateB - dateA;
80+
return b.counter - a.counter;
81+
});
7782

78-
const calverTags = tags
79-
.map((t) => parseCalVer(t.name))
80-
.filter((t): t is CalVerTag => t !== null);
81-
82-
if (calverTags.length > 0) {
83-
// Sort: newest date first, then highest counter
84-
calverTags.sort((a, b) => {
85-
const dateA = a.year * 10000 + a.month * 100 + a.day;
86-
const dateB = b.year * 10000 + b.month * 100 + b.day;
87-
if (dateB !== dateA) return dateB - dateA;
88-
return b.counter - a.counter;
89-
});
90-
currentTag = calverTags[0]!;
91-
}
92-
} catch (e) {
93-
console.log('Could not fetch tags, starting fresh...\n');
94-
}
83+
const currentTag = calverTags.length > 0 ? calverTags[0]! : null;
9584

9685
// Calculate next version
9786
const now = new Date();
9887
const todayStr = `${now.getFullYear()}.${String(now.getMonth() + 1).padStart(2, '0')}.${String(now.getDate()).padStart(2, '0')}`;
9988

10089
let nextVersion: string;
10190

102-
if (currentTag) {
103-
const currentDateStr = `${currentTag.year}.${String(currentTag.month).padStart(2, '0')}.${String(currentTag.day).padStart(2, '0')}`;
104-
if (currentDateStr === todayStr) {
105-
// Same day, increment counter
106-
nextVersion = `${todayStr}.${currentTag.counter + 1}`;
107-
} else {
108-
// New day, start at .1
109-
nextVersion = `${todayStr}.1`;
110-
}
91+
// Find all tags for today and get the highest counter
92+
const todayCalVerTags = calverTags.filter(
93+
(t) => t.year === now.getFullYear() && t.month === now.getMonth() + 1 && t.day === now.getDate()
94+
);
95+
96+
if (todayCalVerTags.length > 0) {
97+
// Same day, increment from highest counter
98+
const highestCounter = Math.max(...todayCalVerTags.map((t) => t.counter));
99+
nextVersion = `${todayStr}.${highestCounter + 1}`;
100+
} else if (currentTag) {
101+
// New day, start at .1
102+
nextVersion = `${todayStr}.1`;
111103
} else {
112104
// No tags yet
113105
nextVersion = `${todayStr}.1`;
@@ -123,6 +115,10 @@ async function main() {
123115
rl.close();
124116

125117
// 3. GitHub API - create tag on main
118+
const octokit = new Octokit({ auth: token });
119+
const owner = 'mcowger';
120+
const repo = 'plexus';
121+
126122
console.log('\n📦 Creating tag on remote main...');
127123
try {
128124
// Get the latest commit SHA on main

0 commit comments

Comments
 (0)