Skip to content

fix: match package.json script order to Speakeasy output - #1102

Merged
sunwrobert merged 1 commit into
mainfrom
devin/1790253447-package-scripts-order
Sep 24, 2026
Merged

sunwrobert merged 1 commit into
mainfrom
devin/1790253447-package-scripts-order

Conversation

@sunwrobert

@sunwrobert sunwrobert commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This unblocks the nightly Generate workflow. Run 35939188224 failed with could not apply persistent edits for "typescript": merge conflicts detected in 1 file(s) (both modified: package.json).

The conflict comes from #1095. That PR edited the build and compile lines in package.json by hand and moved build into additionalScripts in gen.yaml. On the next regen, Speakeasy produced the same commands but wrote the scripts block in a new order. The committed file and the generated file then disagreed on the same lines, so the 3-way merge stopped with a conflict.

This PR reorders the scripts block to match Speakeasy's output, taken from refs/speakeasy/gen/212a8ac8-0d2c-4924-bdb8-24c73935fd2d (the ref the failed run pushed). No script values change.

   "prepublishOnly": "npm run build",
-  "compile": "tsc && node scripts/unbarrel-imports.js",
+  "prepare": "npm run build",
+  "test": "vitest --run --project unit",
   ...
+  "compile": "tsc && node scripts/unbarrel-imports.js",
   ...
-  "postinstall": "...",
-  "prepare": "npm run build",
-  "test": "vitest --run --project unit"
+  "postinstall": "..."

After this PR, the scripts block is the same as the generated one. The only other differences from the generated file are the version bump and the whitespace in peerDependencies. Both of those were already present in the runs that passed before #1095.

Searched existing PRs and found none that match.

After merge, the Generate workflow needs a manual rerun, or it will run on its own tonight.

Link to Devin session: https://openrouter.devinenterprise.com/sessions/a07494c1b0f84282bc49206285c9b5b8
Open in Devin Desktop: https://openrouter.devinenterprise.com/desktop/session/a07494c1b0f84282bc49206285c9b5b8?variant=devin
Requested by: @sunwrobert


Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'DevinAI' or '@devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Robert

whyd this fail? https://github.com/OpenRouterTeam/typescript-sdk/actions/runs/35939188224/job/107443068816

@sunwrobert
sunwrobert merged commit cacd3f9 into main Sep 24, 2026
1 of 2 checks passed
@sunwrobert
sunwrobert deleted the devin/1790253447-package-scripts-order branch September 24, 2026 12:38

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

sunwrobert added a commit that referenced this pull request Sep 24, 2026
… 1.3.22) (#1103)

## Summary
Nightly Generate has failed since
[#1095](#1095) with
`both modified: package.json`. The hand-edited scripts block differed
from Speakeasy's pristine base, and Speakeasy emits the scripts in a
different order each run, so the 3-way merge overlapped every time.
Reordering to match one run
([#1102](#1102))
could not stick.

This PR applies Speakeasy's documented resolution with the pinned CLI
(1.787.0):
1. `speakeasy run -t openrouter` reproduced the conflict locally.
2. Took the generated side of package.json. It already contains the
`additionalScripts` from gen.yaml, so `build`/`compile` stay `tsc &&
node scripts/unbarrel-imports.js`.
3. `speakeasy run --skip-versioning` recorded that output as the new
pristine base (`refs/speakeasy/gen/50695a38…`, pushed to origin).

Committed package.json now equals the pristine blob (`2f282a2`), so
future regens merge cleanly regardless of script order, as long as
scripts are changed only through `additionalScripts` in gen.yaml.

The diff also carries the pending spec regen and the version bump to
1.3.22, which is exactly what the failed Generate runs would have
produced. **Merging changes `.speakeasy/gen.lock` on main, which
triggers Publish for 1.3.22.**

Earlier revision of this PR set `build` to plain `tsc` and broke the
unbarrel compiled-output test. That is fixed here.

Verified locally: `pnpm run build` (unbarrel rewrote 211 files), `pnpm
run lint`, `vitest --run --exclude 'tests/e2e/**'` 211/211.

Existing PR search: continuing this PR, which supersedes
[#1102](#1102).

Link to Devin session:
https://openrouter.devinenterprise.com/sessions/a07494c1b0f84282bc49206285c9b5b8
Open in Devin Desktop:
https://openrouter.devinenterprise.com/desktop/session/a07494c1b0f84282bc49206285c9b5b8?variant=devin
Requested by: @sunwrobert
<!-- devin-review-badge-begin -->

---

<a
href="https://openrouter.devinenterprise.com/review/openrouterteam/typescript-sdk/pull/1103"
target="_blank"><picture><source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img
src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4"
alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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