@markjaquith/agency 1.9.3 → 1.9.4

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": "@markjaquith/agency",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Manages personal agents files",
5
5
  "keywords": [
6
6
  "agents",
@@ -115,6 +115,39 @@ describe("push command", () => {
115
115
  expect(remoteBranches).toContain("feature")
116
116
  })
117
117
 
118
+ test("forwards verbose output from emit step", async () => {
119
+ const originalLog = console.log
120
+ const logMessages: string[] = []
121
+ console.log = (msg: string) => {
122
+ logMessages.push(msg)
123
+ }
124
+
125
+ try {
126
+ await runTestEffect(
127
+ push({
128
+ baseBranch: "main",
129
+ verbose: true,
130
+ skipFilter: true,
131
+ }),
132
+ )
133
+ } finally {
134
+ console.log = originalLog
135
+ }
136
+
137
+ expect(logMessages).toContain("Step 1: Emitting...")
138
+ expect(
139
+ logMessages.some(
140
+ (msg) => msg.includes("Using base branch:") && msg.includes("main"),
141
+ ),
142
+ ).toBe(true)
143
+ expect(
144
+ logMessages.some((msg) =>
145
+ msg.includes("Skipping git-filter-repo (skipFilter=true)"),
146
+ ),
147
+ ).toBe(true)
148
+ expect(logMessages.some((msg) => msg.includes("Emitted"))).toBe(true)
149
+ })
150
+
118
151
  test("works with custom branch name", async () => {
119
152
  await runTestEffect(
120
153
  push({
@@ -122,41 +122,36 @@ const pushCore = (gitRoot: string, options: PushOptions) =>
122
122
  verboseLog(`Starting push workflow from ${highlight.branch(sourceBranch)}`)
123
123
 
124
124
  // Step 1: Create emit branch (agency emit)
125
- let emitHadIgnorableFailure = false
126
-
127
- if (!options.skipFilter) {
128
- verboseLog("Step 1: Emitting...")
129
- // Use emit command - prefer emit option, fallback to branch for backward compatibility
130
- const prEffectWithOptions = emit({
131
- baseBranch: options.baseBranch,
132
- emit: options.emit || options.branch,
133
- silent: true, // Suppress emit command output, we'll provide our own
134
- force: options.force,
135
- verbose: options.verbose,
136
- skipFilter: options.skipFilter,
137
- })
138
-
139
- const prResult = yield* Effect.either(prEffectWithOptions)
140
- if (Either.isLeft(prResult)) {
141
- const error =
142
- prResult.left instanceof Error
143
- ? prResult.left
144
- : new Error(String(prResult.left))
145
- const message = error.message || ""
146
- const ignorable =
147
- message === "" ||
148
- message.includes("already exists") ||
149
- message.includes("check if branch exists")
150
-
151
- if (!ignorable) {
152
- return yield* Effect.fail(
153
- new Error(`Failed to create emit branch: ${message}`),
154
- )
155
- }
156
-
157
- emitHadIgnorableFailure = true
158
- verboseLog("Emit reported existing branch; continuing")
125
+ verboseLog("Step 1: Emitting...")
126
+ // Use the emit command for the entire emit step so push and emit stay in sync.
127
+ const prEffectWithOptions = emit({
128
+ baseBranch: options.baseBranch,
129
+ emit: options.emit || options.branch,
130
+ silent: options.silent,
131
+ force: options.force,
132
+ verbose: options.verbose,
133
+ skipFilter: options.skipFilter,
134
+ })
135
+
136
+ const prResult = yield* Effect.either(prEffectWithOptions)
137
+ if (Either.isLeft(prResult)) {
138
+ const error =
139
+ prResult.left instanceof Error
140
+ ? prResult.left
141
+ : new Error(String(prResult.left))
142
+ const message = error.message || ""
143
+ const ignorable =
144
+ message === "" ||
145
+ message.includes("already exists") ||
146
+ message.includes("check if branch exists")
147
+
148
+ if (!ignorable) {
149
+ return yield* Effect.fail(
150
+ new Error(`Failed to create emit branch: ${message}`),
151
+ )
159
152
  }
153
+
154
+ verboseLog("Emit reported existing branch; continuing")
160
155
  }
161
156
 
162
157
  // Compute the emit branch name (emit() command now stays on source branch)
@@ -164,15 +159,6 @@ const pushCore = (gitRoot: string, options: PushOptions) =>
164
159
  const emitBranchName =
165
160
  options.emit || options.branch || branchInfo.emitBranch
166
161
 
167
- // If skipFilter, we skipped emit() so we must create the emit branch manually
168
- if (options.skipFilter) {
169
- yield* git.createOrResetBranch(gitRoot, emitBranchName, sourceBranch)
170
- // Switch back to source branch for consistency
171
- yield* git.checkoutBranch(gitRoot, sourceBranch)
172
- }
173
-
174
- log(done(`Emitted ${highlight.branch(emitBranchName)}`))
175
-
176
162
  // Step 2: Push to remote (git push)
177
163
  const remote = yield* getRemoteName(gitRoot)
178
164
  verboseLog(