| ... | ... | @@ -195,6 +195,31 @@ const buildCmd = Command.make( |
| 195 | 195 | // publish subcommand |
| 196 | 196 | // --------------------------------------------------------------------------- |
| 197 | 197 | |
| 198 | interface PublishCommandConfig { |
| 199 | readonly access: string; |
| 200 | readonly tag: string; |
| 201 | readonly provenance: boolean; |
| 202 | readonly dryRun: boolean; |
| 203 | } |
| 204 | |
| 205 | const createPnpmPublishArgs = (config: PublishCommandConfig): ReadonlyArray<string> => { |
| 206 | const args = [ |
| 207 | "--filter", |
| 208 | "t3", |
| 209 | "publish", |
| 210 | "--access", |
| 211 | config.access, |
| 212 | "--tag", |
| 213 | config.tag, |
| 214 | "--no-git-checks", |
| 215 | ]; |
| 216 | |
| 217 | if (config.provenance) args.push("--provenance"); |
| 218 | if (config.dryRun) args.push("--dry-run"); |
| 219 | |
| 220 | return args; |
| 221 | }; |
| 222 | |
| 198 | 223 | const publishCmd = Command.make( |
| 199 | 224 | "publish", |
| 200 | 225 | { |
| ... | ... | @@ -260,17 +285,16 @@ const publishCmd = Command.make( |
| 260 | 285 | const iconBackups = yield* applyPublishIconOverrides(repoRoot, serverDir); |
| 261 | 286 | return { iconBackups }; |
| 262 | 287 | }), |
| 263 | | // Use: npm publish |
| 288 | // Use: pnpm publish from the workspace root so pnpm-only workspace |
| 289 | // config, including override selectors, is interpreted correctly. |
| 264 | 290 | () => |
| 265 | 291 | Effect.gen(function* () { |
| 266 | | const args = ["publish", "--access", config.access, "--tag", config.tag]; |
| 267 | | if (config.provenance) args.push("--provenance"); |
| 268 | | if (config.dryRun) args.push("--dry-run"); |
| 292 | const args = createPnpmPublishArgs(config); |
| 269 | 293 | |
| 270 | | yield* Effect.log(`[cli] Running: npm ${args.join(" ")}`); |
| 294 | yield* Effect.log(`[cli] Running: pnpm ${args.join(" ")}`); |
| 271 | 295 | yield* runCommand( |
| 272 | | ChildProcess.make("npm", [...args], { |
| 273 | | cwd: serverDir, |
| 296 | ChildProcess.make("pnpm", [...args], { |
| 297 | cwd: repoRoot, |
| 274 | 298 | stdout: config.verbose ? "inherit" : "ignore", |
| 275 | 299 | stderr: "inherit", |
| 276 | 300 | // Windows needs shell mode to resolve .cmd shims. |