From e09723dde633584367d2c30b16d77f7b5704ccaf Mon Sep 17 00:00:00 2001 From: Faraazuddin Mohammed Date: Fri, 8 May 2026 23:50:35 -0400 Subject: [PATCH] fix(release): build before bumping versions to avoid stale nested install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `npm version --workspaces` triggers an automatic install that re-resolves each workspace's dependencies. After the bump, packages/cli's dep specifier `"@tokenometer/core": "0.0.2"` no longer satisfies the new workspace version `0.1.0`, so npm fetches the published `0.0.2` from the registry into `packages/cli/node_modules/@tokenometer/core/`. That nested copy shadows the workspace symlink at the root, and TypeScript resolves cli's `@tokenometer/core` import to the stale registry types — which lack the `contextWindow`/`maxOutputTokens` fields added in ec35c5e — producing TS2339 build errors. Reorder the workflow so build/test runs against the committed source before any version bump, and sync cross-package deps after the bump so the published `tokenometer@x.y.z` correctly depends on `@tokenometer/core@x.y.z` instead of the previous version. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/release.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dfaf2d..6f45acf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,14 +23,20 @@ jobs: registry-url: 'https://registry.npmjs.org/' - run: npm ci + - run: npm run build + - run: npm test + - run: npm run benchmarks + - name: Bump versions (if requested) if: ${{ inputs.version != '' }} run: | npm version ${{ inputs.version }} --no-git-tag-version --workspaces - - run: npm run build - - run: npm test - - run: npm run benchmarks + - name: Sync cross-package deps to bumped version + if: ${{ inputs.version != '' }} + run: | + npm pkg set 'dependencies.@tokenometer/core'="${{ inputs.version }}" --workspace=packages/cli + npm pkg set 'dependencies.@tokenometer/core'="${{ inputs.version }}" --workspace=packages/action - name: Publish @tokenometer/core working-directory: packages/core