Skip to content

fix(lib): avoid global type augmentation in is-dev for JSR publish - #9

Merged
jhnns merged 1 commit into
mainfrom
fix-ci-job-failure
Aug 8, 2026
Merged

fix(lib): avoid global type augmentation in is-dev for JSR publish#9
jhnns merged 1 commit into
mainfrom
fix-ci-job-failure

Conversation

@jhnns

@jhnns jhnns commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

  • The πŸš€ Release on npm and jsr CI job was failing at the JSR publish step with modifying global types is not allowed file:///src/lib/is-dev.ts:1:1.
  • src/lib/is-dev.ts used declare global to augment ImportMeta/ImportMetaEnv, which JSR's publish check rejects.
  • Replaced the global augmentation with a local ImportMetaWithEnv type and a cast (import.meta as ImportMetaWithEnv), preserving identical runtime behavior.

Test plan

  • npm run test:types
  • npm run test:lint
  • npm run test:unit
  • npm run test:format
  • npx jsr publish --dry-run --allow-dirty succeeds (previously failed with the global-types error)

JSR rejects packages that use `declare global` to modify global types,
which broke the jsr publish step in CI. Replace the global ImportMeta
augmentation with a local type and cast, keeping the same behavior.
@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@peerigon/typescript-toolkit@9

commit: 3e6bce0

@jhnns
jhnns merged commit 9d11f69 into main Aug 8, 2026
3 checks passed
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