Skip to content

build: fix release pipeline so first publish can ship#5

Merged
amix merged 1 commit into
mainfrom
amix/fix-release-process
May 21, 2026
Merged

build: fix release pipeline so first publish can ship#5
amix merged 1 commit into
mainfrom
amix/fix-release-process

Conversation

@amix
Copy link
Copy Markdown
Member

@amix amix commented May 21, 2026

Context

Release and Deploy Docs to Pages are both failing on main. Three issues; this PR handles one, the others are noted below.

What was changed

  • tsconfig.cjs.json / tsconfig.esm.json now exclude **/*.test.ts. The build was compiling tests into dist/ only for files to filter them back out.
  • package.json files cleaned up to match todoist-sdk-typescript: drop dead !dist/testUtils / !dist/scratch.*, keep !dist/**/*.test.js + !dist/**/*.test.d.ts.

Done outside this PR

  • Pages enabled on the repo (build_type=workflow, matches todoist-sdk-typescript). Failed Deploy Docs to Pages rerun now passes.

Still to do

Release fails EINVALIDNPMTOKEN because @doist/comms-sdk doesn't exist on npm yet — trusted publishing can't bootstrap a new package. Fix: npm publish once locally, then enable Trusted Publisher on npmjs.com for this repo's release.yml. After that the existing tokenless workflow works the same way @doist/todoist-sdk does.

`tsconfig.cjs.json` and `tsconfig.esm.json` were inheriting only the
root `exclude` and so were compiling every `*.test.ts` into
`dist/cjs/` and `dist/esm/`. The tarball then filtered them back out
via `files`, but the build itself was doing wasted work and the
glob list in `package.json` was carrying dead patterns
(`!dist/testUtils`, `!dist/scratch.*`) that didn't match anything.

Matched `todoist-sdk-typescript`'s pattern: exclude
`**/*.test.ts` in both tsconfigs and keep the tarball filter to
`!dist/**/*.test.js` + `!dist/**/*.test.d.ts`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@amix amix requested a review from scottlovegrove May 21, 2026 11:15
@amix amix added the 👀 Show PR PR must be reviewed before or after merging label May 21, 2026
@amix amix marked this pull request as ready for review May 21, 2026 11:15
@amix amix merged commit 9781eb0 into main May 21, 2026
4 checks passed
@scottlovegrove scottlovegrove deleted the amix/fix-release-process branch May 21, 2026 11:19
Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR thoughtfully cleans up the TypeScript build configuration and package exclusions to prevent test files from being compiled into the release. These adjustments nicely refine the publishing pipeline to ensure a leaner final package. There are just a few minor suggestions noted for further refinement, including moving the duplicated exclusions into the base configuration, ensuring the test helpers in testUtils are also excluded, and introducing a packaging smoke test in CI to verify the tarball contents moving forward.

Share FeedbackReview Logs

Comment thread tsconfig.cjs.json
@@ -1,5 +1,6 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "dist", "**/testData", "**/*.test.ts"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Because src/testUtils contains .ts files that don't end in .test.ts, they will still be compiled into dist/cjs/testUtils (and esm/types). Consider adding "**/testUtils" to the exclude list here and in tsconfig.esm.json to prevent test helpers from being published to npm.

Comment thread tsconfig.cjs.json
@@ -1,5 +1,6 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "dist", "**/testData", "**/*.test.ts"],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This exclude array is now duplicated in both build tsconfigs and also repeats entries already defined in tsconfig.json. Since tsconfig.test.json already overrides exclude to [], you can move **/*.test.ts into the shared base tsconfig.json exclude list and drop these per-target copies to keep a single source of truth.

Comment thread package.json
"!dist/**/*.test.*",
"!dist/testUtils",
"!dist/scratch.*"
"!dist/**/*.test.js",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] This changes the package contents to fix a release failure, but there’s still no regression test for the tarball contents. prepublishOnly builds and runs ATTW, yet nothing asserts that npm pack omits compiled *.test.* files, so a future tsconfig/files drift can silently reintroduce the same breakage. Add a small packaging smoke test in CI that inspects npm pack --json output or the packed file list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

👀 Show PR PR must be reviewed before or after merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants