Skip to content

chore(publish): prep 15 packages for first npm publish at 0.6.2#82

Merged
telivity-otaip merged 2 commits into
mainfrom
chore/npm-publish-prep
Apr 18, 2026
Merged

chore(publish): prep 15 packages for first npm publish at 0.6.2#82
telivity-otaip merged 2 commits into
mainfrom
chore/npm-publish-prep

Conversation

@telivity-otaip
Copy link
Copy Markdown
Collaborator

Summary

Preparation for the first-ever npm publish of the `@otaip/*` scope. Found two structural blockers during pre-publish audit that would have bricked every consumer on `npm install`; fixed them both.

Blockers fixed

1. Wrong module type on 11 of 15 packages.
`core`, `agents-platform`, `agents-tmc`, and all nested `agents/*` except `lodging` lacked `"type": "module"`. With tsup configured `--format esm --dts`, that produced `dist/index.mjs` + `dist/index.d.mts`, but `package.json` said `main: "./dist/index.js"` and `types: "./dist/index.d.ts"`. Consumers would hit `Cannot find module`.

Fix: add `"type": "module"` to all 15 so tsup emits `index.js` / `index.d.ts` matching the declared fields. Verified each package's `main` and `types` now resolve to a real file.

2. Types exported from src (which doesn't ship).
All 15 packages had `exports["."].types: "./src/index.ts"`. But `files: ["dist"]` excludes `src/` from the tarball, so TypeScript users would get no types.

Fix: point `exports["."].types` at `./dist/index.d.ts`.

Version sync

All 15 workspace packages were still at `0.6.0` while root was `0.6.2`. Bumped them all to `0.6.2` so the first publish is coherent.

Dry-run output

```
$ pnpm -r publish --access public --no-git-checks --dry-run

  • @otaip/adapter-duffel@0.6.2
  • @otaip/agents-booking@0.6.2
  • @otaip/agents-exchange@0.6.2
  • @otaip/agents-lodging@0.6.2
  • @otaip/agents-platform@0.6.2
  • @otaip/agents-pricing@0.6.2
  • @otaip/agents-reconciliation@0.6.2
  • @otaip/agents-reference@0.6.2
  • @otaip/agents-search@0.6.2
  • @otaip/agents-settlement@0.6.2
  • @otaip/agents-ticketing@0.6.2
  • @otaip/agents-tmc@0.6.2
  • @otaip/cli@0.6.2
  • @otaip/connect@0.6.2
  • @otaip/core@0.6.2
    ```

Also inspected the `@otaip/agents-booking` tarball manifest — pnpm correctly rewrote every `workspace:*` dep to `"0.6.2"`.

What is NOT in this PR (you need to do before publishing)

  1. Create the `@otaip` npm org → https://www.npmjs.com/org/create
  2. Generate an automation-type npm token with read+write scope on `@otaip/*`
  3. Add it to the GitHub repo as `NPM_TOKEN` → Settings → Secrets → Actions
  4. Merge this PR
  5. Either tag `v0.6.2` on main (triggers `release.yml` → `publish.yml`) or trigger `publish.yml` manually (workflow_dispatch)

Once published, smoke-test with:
```
npm view @otaip/core
npm view @otaip/agents-search
npm view @otaip/adapter-duffel
```

Test plan

  • `pnpm -r run clean && pnpm -r run build` — all 16 packages Done
  • `main` and `types` resolve to existing files on all 15 packages
  • `pnpm -r publish --dry-run` — 15 @otaip/* packages at 0.6.2
  • Packed tarball dependency manifest uses concrete versions, not `workspace:*`
  • `pnpm test` — 3,092 pass (3 skipped)
  • `pnpm -r run typecheck` — clean
  • `pnpm run lint` — clean

🤖 Generated with Claude Code

Dusan Milicevic and others added 2 commits April 18, 2026 18:05
Two blockers were about to brick every consumer on \`npm install\`:

1. 11 packages lacked \`"type": "module"\`. With tsup configured to emit
   ESM + DTS, that produced \`index.mjs\`/\`index.d.mts\` while the
   \`main\` field said \`./dist/index.js\` — module not found.
   Fix: set \`"type": "module"\` on all 15 packages so tsup emits
   \`index.js\`/\`index.d.ts\` that match the declared \`main\`/\`types\`.

2. All 15 packages had \`exports["."].types\` pointing to
   \`./src/index.ts\`. The \`files\` array is \`["dist"]\`, so \`src/\`
   never ships in the tarball and TypeScript consumers would get no
   types.
   Fix: point \`exports["."].types\` at \`./dist/index.d.ts\`.

Also: bump every workspace package from 0.6.0 to 0.6.2 to match the
root version so the first publish is coherent.

Verification:
- pnpm -r run clean && pnpm -r run build — all 16 packages Done
- every package's \`main\` + \`types\` resolve to an existing file
- \`pnpm -r publish --access public --no-git-checks --dry-run\` lists
  all 15 @otaip/* packages at 0.6.2
- packed @otaip/agents-booking tarball manifest shows \`workspace:*\`
  correctly rewritten to 0.6.2 version ranges
- pnpm test — 3,092 pass (3 skipped), lint + typecheck clean

Does NOT publish anything. The release.yml / publish.yml pipeline
still needs the NPM_TOKEN secret and the @otaip npm org before a
real publish can land.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… dist

The publish-prep change in this PR moved \`exports["."].types\` from
\`./src/index.ts\` to \`./dist/index.d.ts\` on every workspace package,
which is correct for the published tarballs. Side effect: TypeScript
now needs \`dist/\` to exist to resolve cross-package \`@otaip/*\`
imports, and CI ran typecheck before anything built.

Reproduced locally: \`pnpm -r run clean && pnpm -r run typecheck\`
fails in every package that imports from @otaip/core (duffel,
agents-tmc, agents-platform, the nested agents/*).

Fix: add a \`pnpm -r run build\` step in ci.yml before typecheck.
Doubles as a clean-tree build validation — the same config ships
to npm, so this is the right thing to verify on every PR anyway.

Verified locally with clean → install → lint → build → typecheck →
test: all 16 packages Done.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@telivity-otaip telivity-otaip merged commit 6f9c425 into main Apr 18, 2026
1 check passed
@telivity-otaip telivity-otaip deleted the chore/npm-publish-prep branch April 18, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant