fix(lib): avoid global type augmentation in is-dev for JSR publish - #9
Merged
Conversation
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.
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
π Release on npm and jsrCI job was failing at the JSR publish step withmodifying global types is not allowed file:///src/lib/is-dev.ts:1:1.src/lib/is-dev.tsuseddeclare globalto augmentImportMeta/ImportMetaEnv, which JSR's publish check rejects.ImportMetaWithEnvtype and a cast (import.meta as ImportMetaWithEnv), preserving identical runtime behavior.Test plan
npm run test:typesnpm run test:lintnpm run test:unitnpm run test:formatnpx jsr publish --dry-run --allow-dirtysucceeds (previously failed with the global-types error)