@take-out/scripts 0.0.44 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@take-out/scripts",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "type": "module",
5
5
  "main": "./src/run.ts",
6
6
  "sideEffects": false,
@@ -24,7 +24,7 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@take-out/helpers": "0.0.44",
27
+ "@take-out/helpers": "0.0.45",
28
28
  "glob": "^11.0.0"
29
29
  },
30
30
  "devDependencies": {
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env bun
2
+
3
+ /**
4
+ * @description Update changelog.mdx with recent git commits using Claude Code
5
+ *
6
+ * outputs a prompt for claude code to investigate commits and update changelog
7
+ * run: bun tko update-changelog
8
+ */
9
+
10
+ import { execSync } from 'node:child_process'
11
+ import { existsSync, readFileSync } from 'node:fs'
12
+ import { join } from 'node:path'
13
+
14
+ const CHANGELOG_PATH = join(process.cwd(), 'src/features/site/docs/changelog.mdx')
15
+
16
+ function getLastSha(): string | null {
17
+ if (!existsSync(CHANGELOG_PATH)) return null
18
+
19
+ try {
20
+ const content = readFileSync(CHANGELOG_PATH, 'utf-8')
21
+ const match = content.match(/\{\/\* last updated: ([a-f0-9]+) \*\/\}/)
22
+ return match?.[1] || null
23
+ } catch {
24
+ return null
25
+ }
26
+ }
27
+
28
+ function getLatestSha(): string {
29
+ return execSync('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim()
30
+ }
31
+
32
+ function getCommitCount(fromSha: string, toSha: string): number {
33
+ try {
34
+ const result = execSync(`git rev-list --count ${fromSha}..${toSha} --no-merges`, {
35
+ encoding: 'utf-8',
36
+ })
37
+ return parseInt(result.trim(), 10)
38
+ } catch {
39
+ return 0
40
+ }
41
+ }
42
+
43
+ const lastSha = getLastSha()
44
+ const latestSha = getLatestSha()
45
+
46
+ if (!lastSha) {
47
+ console.info(`no last sha found in changelog, defaulting to 4 weeks ago`)
48
+ }
49
+
50
+ const fromRef = lastSha || '$(git log --since="4 weeks ago" --format="%H" | tail -1)'
51
+ const commitCount = lastSha ? getCommitCount(lastSha, latestSha) : '~30'
52
+
53
+ if (commitCount === 0) {
54
+ console.info('no new commits since last update')
55
+ process.exit(0)
56
+ }
57
+
58
+ console.info(`
59
+ Update the changelog at: ${CHANGELOG_PATH}
60
+
61
+ Commit range: ${fromRef}..${latestSha} (${commitCount} commits)
62
+
63
+ Instructions:
64
+ - investigate commits with git log, git show, git diff as needed
65
+ - for vague commits like "cleanups" or "fix Component.tsx", look at the actual diff to understand what changed
66
+ - update the "last updated" comment to: ${latestSha}
67
+ - create new week sections if needed (weeks start monday)
68
+ - format: "## Week of January 20, 2026" with sha in backticks below
69
+ - use ✚ symbol only for new features, no other emoji
70
+ - group small fixes/chores into "Bug fixes and chores (N)"
71
+ - for tamagui/one upgrades, check ~/tamagui or ~/one repos or github for what actually changed
72
+ - write useful descriptions - explain WHY and WHAT improved, not just "fixed X"
73
+ - stop when you reach commits already in the changelog
74
+ `)
@@ -30,6 +30,8 @@ for (const arg of args) {
30
30
  process.exit(1)
31
31
  } else if (arg === '--canary') {
32
32
  globalTag = 'canary'
33
+ } else if (arg === '--rc') {
34
+ globalTag = 'rc'
33
35
  } else {
34
36
  packagePatterns.push(arg)
35
37
  }