authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-06-04 22:16:52-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-06-04 22:16:52-07:00
loge1cb19b55b9a29de03e2a2a7b3542f738f4843cb
tree52381cfe379587c19d3d41fd7ddd952c35ee2973
parent94fc117561bbdea1054a020aab33fbe0227ffd58
signature Signed by PGP key B5690EEEBB952194

Use pnpm for server publish workflow (#2966)


1 files changed, 31 insertions(+), 7 deletions(-)

apps/server/scripts/cli.ts+31-7
......@@ -195,6 +195,31 @@ const buildCmd = Command.make(
195195// publish subcommand
196196// ---------------------------------------------------------------------------
197197
198interface PublishCommandConfig {
199 readonly access: string;
200 readonly tag: string;
201 readonly provenance: boolean;
202 readonly dryRun: boolean;
203}
204
205const 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
198223const publishCmd = Command.make(
199224 "publish",
200225 {
......@@ -260,17 +285,16 @@ const publishCmd = Command.make(
260285 const iconBackups = yield* applyPublishIconOverrides(repoRoot, serverDir);
261286 return { iconBackups };
262287 }),
263 // Use: npm publish
288 // Use: pnpm publish from the workspace root so pnpm-only workspace
289 // config, including override selectors, is interpreted correctly.
264290 () =>
265291 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);
269293
270 yield* Effect.log(`[cli] Running: npm ${args.join(" ")}`);
294 yield* Effect.log(`[cli] Running: pnpm ${args.join(" ")}`);
271295 yield* runCommand(
272 ChildProcess.make("npm", [...args], {
273 cwd: serverDir,
296 ChildProcess.make("pnpm", [...args], {
297 cwd: repoRoot,
274298 stdout: config.verbose ? "inherit" : "ignore",
275299 stderr: "inherit",
276300 // Windows needs shell mode to resolve .cmd shims.