tsdown.config.ts
This file
Path
apps/cli/tsdown.config.ts
55 lines · 1.6 KiB · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
The walk stopped after 200 commits: lines older than 678c8b8 point at it.
Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 1–3why, one step back1import { defineConfig } from "tsdown";2import type { UserConfig } from "tsdown";3Merge build/1104 into mainoscabrielbefore adoption82cc398
lines 4–9why, one step back4export const UNSTAMPED = "0.0.0";56export const versionDefine = (version: string) => ({7 "import.meta.env.CLI_BUILD_VERSION": JSON.stringify(version),8});9Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 10–17why, one step back10export const library = {11 protocol: "src/entries/protocol.ts",12 rules: "src/entries/rules.ts",13} as const;1415const shared = {16 deps: {17 alwaysBundle: [/^@repo\//u],Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042
line 18why, one step back18 // pi's adapter takes it as an optional peer: never inlined.Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 19–28why, one step back19 neverBundle: [/^@earendil-works\/pi-coding-agent(?:\/|$)/u],20 },21 // `.js` and `.d.ts`: the package is ESM by its `type`.22 fixedExtension: false,23 format: "esm",24 outDir: "dist",25 platform: "node",26} as const satisfies UserConfig;2728/**Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
lines 29–30why, one step back29 * Bundled from tsgo's declarations: tsdown's own step declares no file30 * reached through node_modules, so workspace packages would be missing.Merge build/614-env-service: deciders set write-only values for @sensitive items, the public sees the env shape, and checks see only placeholdersoscabrielbefore adoption678c8b8
lines 31–42why, one step back31 */32export const declarations = (33 entry: Readonly<Record<keyof typeof library, string>>,34 tsconfig: string35) =>36 ({37 ...shared,38 clean: false,39 dts: { dtsInput: true, emitDtsOnly: true, tsconfig },40 entry,41 }) satisfies UserConfig;42Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
line 43why, one step back43// Only the first entry cleans `dist/`.Merge build/1104 into mainoscabrielbefore adoption82cc398
lines 44–55why, one step back44export const npm = (version: string) => {45 const stamped = { ...shared, define: versionDefine(version), dts: false };4647 return [48 { ...stamped, entry: { bin: "src/bin.ts" } },49 { ...stamped, clean: false, entry: library },50 // The pi extension, which the publish manifest's `"pi"` key names.51 { ...stamped, clean: false, entry: { pi: "src/pi.ts" } },52 ] satisfies UserConfig[];53};5455export default defineConfig(npm(UNSTAMPED));