@dansyuqri/spark-joy 0.1.4 → 0.2.0

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": "@dansyuqri/spark-joy",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Break a huge PR into reviewable chunks and review it batch by batch in a local app.",
5
5
  "keywords": [
6
6
  "code-review",
@@ -29,12 +29,12 @@
29
29
  "files": [
30
30
  "bin",
31
31
  "dist",
32
- "skill",
32
+ "plugin/skills",
33
33
  "README.md",
34
34
  "LICENSE"
35
35
  ],
36
36
  "engines": {
37
- "node": ">=22"
37
+ "node": ">=24"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"
@@ -55,16 +55,16 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@dagrejs/dagre": "1.1.4",
58
- "@types/node": "^22.10.1",
58
+ "@types/node": "^24.19.2",
59
59
  "@types/react": "^18.3.12",
60
60
  "@types/react-dom": "^18.3.1",
61
- "@vitejs/plugin-react": "^4.3.4",
61
+ "@vitejs/plugin-react": "^6.1.1",
62
62
  "playwright-core": "^1.49.1",
63
63
  "react": "^18.3.1",
64
64
  "react-dom": "^18.3.1",
65
- "tsup": "^8.3.5",
65
+ "tsup": "^8.5.1",
66
66
  "typescript": "^5.6.3",
67
- "vite": "^5.4.11",
68
- "vitest": "^2.1.8"
67
+ "vite": "^8.3.2",
68
+ "vitest": "^5.0.3"
69
69
  }
70
70
  }
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: spark-joy
3
- description: Break a large PR/MR into small, ordered chunks and open a local app where a human reviews them one at a time. Use when the user wants help reviewing a big PR, MR or branch, asks to chunk or split a diff for review, or types /spark-joy.
3
+ description: Break a large PR/MR into small, ordered chunks and open a local app where a human reviews them one at a time; or split the user's own staged, uncommitted or branch changes into small stacked PRs. Use when the user wants help reviewing a big PR, MR or branch, asks to chunk or split a diff for review, asks to split their changes into smaller PRs, or types /spark-joy.
4
4
  ---
5
5
 
6
6
  # spark-joy
7
7
 
8
- You group a branch's diff into reviewable chunks; the `spark-joy` CLI does the rest. The reader is a tired human. **Every word you write is load on them. Be terse.**
8
+ You group a diff into reviewable chunks; the `spark-joy` CLI does the rest. Two modes:
9
+ - **Review** (default): someone else's PR, read in chunks. Steps 1–5.
10
+ - **Split**: the user's own changes become stacked PRs. Steps 1–3, then [Split mode](#split-mode). The reader is a tired human. **Every word you write is load on them. Be terse.**
9
11
 
10
12
  Run `spark-joy` inside the repo under review. If it isn't on PATH, ask the user to run `npm install -g @dansyuqri/spark-joy`; don't try other packages. Never edit the code under review.
11
13
 
@@ -113,6 +115,43 @@ Fix every error and re-run until it says `plan ok`. Fix the warnings too.
113
115
 
114
116
  Run `spark-joy serve` in the background. Reply with the URL and one line: what the PR does and the chunk count. Nothing more.
115
117
 
118
+ ## Split mode
119
+
120
+ Use it when the user wants their own changes cut into smaller PRs. Extract what they named:
121
+
122
+ ```
123
+ spark-joy extract --staged # staged only
124
+ spark-joy extract --uncommitted # staged + unstaged
125
+ spark-joy extract [base] # the whole branch
126
+ ```
127
+
128
+ Read the hunks as in step 2, then write the plan with `"mode": "split"` and one strategy, `split`:
129
+
130
+ ```json
131
+ {
132
+ "mode": "split",
133
+ "title": "Team invitations",
134
+ "strategies": [{ "id": "split", "chunks": [
135
+ { "id": "schema", "title": "Invitations table", "intent": "Store pending invites.", "hunks": ["h004", "h005", "h020"] },
136
+ { "id": "api", "title": "Invite endpoint", "intent": "Admins invite by email.", "hunks": ["h007"], "dependsOn": ["schema"] }
137
+ ]}]
138
+ }
139
+ ```
140
+
141
+ - Each chunk is one PR, stacked in order: PR 2 is built on PR 1.
142
+ - Every hunk goes in a PR, lockfiles included: put each with the change that needs it. There is no skim.
143
+ - Each PR must build and pass tests on top of the earlier ones. Never split a function from its callers' update.
144
+ - Same word limits and chunk sizes. The title and intent become the commit message and PR text.
145
+ - Branches default to `<branch>-split/<n>-<title>`; set `"branch"` on a chunk to override.
146
+
147
+ Then:
148
+
149
+ 1. `spark-joy validate` until `plan ok`.
150
+ 2. `spark-joy serve` in the background, so the user can preview the PRs.
151
+ 3. `spark-joy split`: a dry run that checks the PRs add up to exactly the original changes.
152
+ 4. If the repo has a fast test command: `spark-joy split --check "<install && test>"`. Each PR runs in a fresh worktree, so include the install step. Fix the plan if a PR fails.
153
+ 5. Ask the user, then run `spark-joy split --apply`. It creates local branches only and leaves the working tree alone. Reply with the branch list and the path to `prs.md`. Never push.
154
+
116
155
  ## After new commits
117
156
 
118
157
  Re-run `extract`, rewrite the plan from the new `outline`, and validate. The reviewer's progress carries over for unchanged hunks.