fix: emit type declarations for pg and cf adapters#46
fix: emit type declarations for pg and cf adapters#46techiejd merged 4 commits intotechiejd:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes TypeScript consumer breakage for the @payloadcms-vectorize/pg and @payloadcms-vectorize/cf adapter packages by ensuring their declared dist/index.d.ts files are actually generated during builds.
Changes:
- Update adapter build scripts to run
tsc(declaration emit) before SWC transpilation. - Add adapter-scoped
tsconfig.build.jsonfiles to emit declarations into each adapter’sdist/. - Expand
cleanto remove adapterdist/folders and adapter-level*.tsbuildinfofiles.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Runs tsc -p for each adapter before SWC and cleans adapter tsbuildinfo artifacts. |
| adapters/pg/tsconfig.build.json | Adds an adapter-scoped TS build config to emit declarations into adapters/pg/dist. |
| adapters/cf/tsconfig.build.json | Adds an adapter-scoped TS build config to emit declarations into adapters/cf/dist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
is this package still maintained ? |
|
Hi stevenlafl! Sorry about this. I'm not sure how I missed it. Thank you for your contribution. I'm taking a look. |
Introduce adapters/tsconfig.adapter.json as a single shared build config
and have each adapter's tsconfig.build.json extend it. Uses ${configDir}
(TS 5.5+) so rootDir/outDir/include resolve relative to the extending
adapter without per-adapter duplication.
- CI: add a `build` job that runs `pnpm build` and asserts dist/index.d.ts exists for the main package and both adapters, so a future SWC-only regression is caught before publish. Gate it in the aggregate `test` job. - Changeset: add patch bumps for @payloadcms-vectorize/pg and @payloadcms-vectorize/cf so root and adapter CHANGELOGs are generated automatically on `pnpm changeset:version`.
|
Great job! I'll update here when it's been published. Again, I'm so sorry about how long I took. I even noticed when you forked and am not sure how I missed the PR. |
|
It's not your fault, don't worry. I used npm patches for production, didn't need to wait for it. That's my workflow. If you didn't know about that feature, it's amazing. (been doing this a long time and just found out a month ago) |
|
I'm glad you weren't blocked by this and were able to use patch as a stopgap. I missed the email where you added the PR. I've created a filter that marks Thank you very much for your patience and for following up on it. Your changes are now published! (0.7.2) Thank you for your contribution~ |
The adapter build scripts (
build:adapters:pg,build:adapters:cf) only ran SWC, which does not emit.d.tsfiles. Both adapter packages declare"types": "./dist/index.d.ts"inpackage.json, but the file was never generated — breaking TypeScript consumers.Changes:
tsconfig.build.jsonfor each adapter (extends root tsconfig, scoped to adaptersrc/)tsc -p tsconfig.build.jsonto each adapter build script (types first, then SWC — matching the main package pattern)adapters/*/*.tsbuildinfoto thecleanscript so incremental builds don't skip declaration emit