-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Include Definition File in Package Distribution #60
Comments
I've created experimental branch |
Cloning and switching to that branch yields the following on
I'm also not sure that simply exporting the interface names would actually solve anything - wouldn't you need a Would appreciate seeing this released. Like the OP, I'm using this directly in a TS project and currently manually copying over the types to a local .d.ts file. |
@leebenson - if you're using TypeScript 2.5 do you see the same error? I've seen a few unexpected breakages with 2.6 and I wonder if this is another example? |
Hi @piotr-oles , thanks for looking into this. Unfortunately, the new branch continues to have the same problem. I've created an example repository to demonstrate the problem: https://github.com/jambonrose/ts-webpack-fork-type-check-mve . Please note the two branches on the project: To clarify: the project cannot currently be installed directly from Github. I attempted to do so with the command below.
However, this yields a directory without a Instead I cloned the repository and tried to build the project.
I see the same errors as @leebenson, printed below.
However, installing TypeScript 2.5 does circumvent the problem. I cannot speak to whether these are new checks in 2.6 or else errors.
I manually moved the
I believe @leebenson is right, and that the project must have a It would be great if the project were also installable from github, as that would make contributing easier. |
There's just a couple of things needed to fix this on the 1. Peg the Typescript to a working version This is a temporary solution; obviously, it's better to figure out what broke between TS 2.5.3 and 2.6 that is causing the type errors and fix, but for now, just peg the TS version in
After that, 2. Add Alongside the entry for
(I see that you added After that, we should be able to call the lib like this and get type info automatically:
|
For anyone is interested to using it with Of course it would be great if we support |
Looks like this was done as part of #182 and is now available in v1.0.0. |
Regarding the all-too-common "has or is using private name" error, I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822 |
I have a webpack config written in Typescript (
webpack.config.ts
; it allows me to use an interface to ensure I'm not misconfiguring webpack). When I try to import fork-ts-checker-webpack-plugin, however, I'm shown an error about missing Typescript definitions.Given that the package is actually written in Typescript, it would be great if you included the type definitions with distributions.
Note that some work appears to be required. I had no problem downloading the package, installing dependencies with
yarn
and building the package withyarn build
. However, when I add"declaration": true,
to"compilerOptions"
insrc/tsconfig.json
,yarn build
fails unexpectedly:Please note that these errors are show when running TSLint.
$ tslint --project src --type-check
The text was updated successfully, but these errors were encountered: