Skip to content

fix: global types support for jsr.io#1409

Open
CodeMaverick-143 wants to merge 1 commit intogoogle:mainfrom
CodeMaverick-143:main
Open

fix: global types support for jsr.io#1409
CodeMaverick-143 wants to merge 1 commit intogoogle:mainfrom
CodeMaverick-143:main

Conversation

@CodeMaverick-143
Copy link

Fixes JSR global types support (addresses TODO in src/globals.ts).

Previously, proper type definitions for globals like $, fs, and path were missing when importing from JSR, causing type errors in consumer projects and failures during jsr publish. I've added the missing declare global block to src/globals-jsr.ts, adjusted tsconfig.json to avoid duplicate identifier conflicts during the build, and updated the JSR integration tests to allow global augmentations (which are necessary but flagged as "slow types" by JSR).

// Now works correctly in JSR-compatible environments (e.g. Deno)
import 'jsr:@webpod/zx/globals'

await $`echo "Global types are now working!"`
  • Build: I’ve run npm build before committing and verified the bundle updates correctly.
  • Tests: I’ve run test and confirmed all tests succeed (specifically npm run test:types and npm run test:jsr).
  • Docs: I’ve added or updated relevant documentation as needed.
  • Sign Commits have verified signatures and follow conventional commits spec
  • CoC: My changes follow the project’s coding guidelines and Code of Conduct.
  • Review: This PR represents original work and is not solely generated by AI tools.

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