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.

Feature request: Include TypeScript .d.ts file with the npm package

See original GitHub issue

Expected Behavior

As the project is written in TypeScript, I would expect it to also allow using the tool with it’s typings and to benefit from the defined types when writing migration scripts.

Actual Behavior

The npm package includes only the transpiled code so no types are available.

Possible Solution

Create a separate .d.ts file for the API calls used in the documentation and include it in the npm package.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
ristomatticommented, Sep 19, 2018

@joshmedeski I’m not at the computer right now but try adding – before the -s parameter. We’re using this with the “use as a library” method. I have created a .ts file which imports the cli module similarly as in the JavaScript example. The parameter handling is done by the script though.

I’m pretty sure though I did the initial test with the command from the new documentation though…

@Khaledgarbaya I noticed the changes being applied through commits today. I’ll try to find time tomorrow to do a PR on the improvements on the typings file.

1reaction
ristomatticommented, Sep 20, 2018

@Khaledgarbaya it seems all but one of the changes I’ve done have been added there meanwhile. I don’t bother making a PR from that.

The only change missing was adding | number[] to IValidation.in. I added it as otherwise migration file generated with contentful space generate would not have been valid.

export interface IValidation {
  in?: string[] | number[],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript should auto aquire d.ts files from npm package #9819
ts files in the lib folder of the respective packages? Just way 'require/import' auto resolves the module path. I understand for some modules...
Read more >
Documentation - ECMAScript Modules in Node.js - TypeScript
When TypeScript finds a .d.ts file in package, whether it is treated as an ESM or CommonJS file is based on the containing...
Read more >
ts-node - npm
ts -node is a TypeScript execution engine and REPL for Node.js. It JIT transforms TypeScript into JavaScript, enabling you to directly execute ...
Read more >
TypeScript - Parcel
ts or .tsx file. In addition to stripping the types to convert TypeScript to JavaScript, Parcel also compiles modern language features like classes...
Read more >
Usage of Angular libraries published to npm
Typically, library packages include typings in .d.ts files; see examples in node_modules/@angular/material . If the package of your library does not include ......
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