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(...@@ -195,6 +195,31 @@ const buildCmd = Command.make(
195// publish subcommand195// publish subcommand
196// ---------------------------------------------------------------------------196// ---------------------------------------------------------------------------
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
198const publishCmd = Command.make(223const publishCmd = Command.make(
199 "publish",224 "publish",
200 {225 {
...@@ -260,17 +285,16 @@ const publishCmd = Command.make(...@@ -260,17 +285,16 @@ const publishCmd = Command.make(
260 const iconBackups = yield* applyPublishIconOverrides(repoRoot, serverDir);285 const iconBackups = yield* applyPublishIconOverrides(repoRoot, serverDir);
261 return { iconBackups };286 return { iconBackups };
262 }),287 }),
263 // Use: npm publish288 // Use: pnpm publish from the workspace root so pnpm-only workspace
289 // config, including override selectors, is interpreted correctly.
264 () =>290 () =>
265 Effect.gen(function* () {291 Effect.gen(function* () {
266 const args = ["publish", "--access", config.access, "--tag", config.tag];292 const args = createPnpmPublishArgs(config);
267 if (config.provenance) args.push("--provenance");
268 if (config.dryRun) args.push("--dry-run");
269293
270 yield* Effect.log(`[cli] Running: npm ${args.join(" ")}`);294 yield* Effect.log(`[cli] Running: pnpm ${args.join(" ")}`);
271 yield* runCommand(295 yield* runCommand(
272 ChildProcess.make("npm", [...args], {296 ChildProcess.make("pnpm", [...args], {
273 cwd: serverDir,297 cwd: repoRoot,
274 stdout: config.verbose ? "inherit" : "ignore",298 stdout: config.verbose ? "inherit" : "ignore",
275 stderr: "inherit",299 stderr: "inherit",
276 // Windows needs shell mode to resolve .cmd shims.300 // Windows needs shell mode to resolve .cmd shims.