Skip to content

Commit

Permalink
fix: required type annotation typescript error (#705)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->
This commit addresses `The inferred type of 'inngest' cannot be named
without a reference to '../../../node_modules/inngest/types'. This is
likely not portable. A type annotation is necessary. ts (2742)` error
described in #695. Version 3.22.7 hasn't fixed the issue.

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~Added a [docs PR](https://github.com/inngest/website) that
references this PR~ N/A Bug fix
- [x] Added unit/integration tests
- [x] Added changesets if applicable

## Related
<!-- A space for any related links, issues, or PRs. -->
<!-- Linear issues are autolinked. -->
<!-- e.g. - INN-123 -->
<!-- GitHub issues/PRs can be linked using shorthand. -->
<!-- e.g. "- inngest/inngest#123" -->
<!-- Feel free to remove this section if there are no applicable related
links.-->

Fixes: #695

---------

Co-authored-by: Jack Williams <1736957+jpwilliams@users.noreply.github.com>
Co-authored-by: Jack Williams <jack@inngest.com>
  • Loading branch information
3 people authored Sep 7, 2024
1 parent c7db92d commit f229dea
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-colts-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Fix required type annotation typescript errors; `inngest/types` is now exported with a warning within the module covering its usage
5 changes: 3 additions & 2 deletions packages/inngest/jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"./remix": "./src/remix.ts",
"./sveltekit": "./src/sveltekit.ts",
"./deno/fresh": "./src/deno/fresh.ts",
"./hono": "./src/hono.ts"
"./hono": "./src/hono.ts",
"./types": "./src/types.ts"
}
}
}
5 changes: 5 additions & 0 deletions packages/inngest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@
"import": "./hono.js",
"types": "./hono.d.ts"
},
"./types": {
"require": "./types.js",
"import": "./types.js",
"types": "./types.d.ts"
},
"./api/*": "./api/*.js",
"./components/*": "./components/*.js",
"./deno/*": "./deno/*.js",
Expand Down
11 changes: 11 additions & 0 deletions packages/inngest/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/**
* Internal types and schemas used throughout the Inngest SDK.
*
* Note that types intended to be imported and utilized in userland code will be
* exported from the main entrypoint of the SDK, `inngest`; importing types
* directly from this file may result in breaking changes in non-major bumps as
* only those exported from `inngest` are considered stable.
*
* @module
*/

import { z } from "zod";
import { type EventSchemas } from "./components/EventSchemas";
import {
Expand Down

0 comments on commit f229dea

Please sign in to comment.