question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bring Typescript types into repository

See original GitHub issue

🚀 Feature Proposal

Add Typescript types directly to the packages within this repository

Motivation

This is was discussed in #8 but a lot of has changed since then.

See the pitch section for more information. In short, jest now uses TypeScript internally and relying on types from a none DefinitelyTyped package is a lot more difficult as it needs types to be made available via types-publisher as well.

Example

Going forward we would no longer need to add @types/expect-puppeteer and @types/jest-environment-puppeteer.

Pitch

I’ve just opened a DefinitelyTyped pull request to export the PuppeteerEnvironment default export from jest-environment-puppeteer library. The build is currently failing because it relies on none DefinitelyTyped types since Jest now uses typescript directly within its codebase. The potential solution is another PR to the types-publisher package but even then I have no way of testing if this solution will work until the PRs are merged.

It seems much simpler to just bring the type definitions into this repo.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ifiokjrcommented, Jun 17, 2019

@neoziro thanks!

I’ll create a PR this weekend 😄🤞

EDIT

This week…

1reaction
ifiokjrcommented, Jul 4, 2019

@neoziro I’ll close this for now. It’s been a busy few weeks and likely to be especially busy for the next month or so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sharing TypeScript Types between Backend and Frontend ...
Important — The recommended way to share types. We highly recommend sharing types between your frontend and backend using a component.
Read more >
Make sharing TypeScript code and types quick and easy
Explore the ways you can save time and more easily share the TypeScript code and types you and your team need in this...
Read more >
Documentation - Publishing - TypeScript
If your types are generated by your source code, publish the types with your source code. Both TypeScript and JavaScript projects can generate...
Read more >
The repository for high quality TypeScript type definitions.
You can edit the types directly in node_modules/@types/foo/index.d.ts to validate your changes, then bring the changes to this repo with the steps below....
Read more >
How to use TypeScript definition files from the @types npm ...
You can "import" it with /// reference directive: /// <reference path="./node_modules/@types/lodash/index.d.ts" /> console.log(_);.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found