-
-
Notifications
You must be signed in to change notification settings - Fork 738
@Types are stored as dependencies in package.json causing conflicts #986
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
Comments
We should definitely fix this before the next release. Should be a really simple fix. |
I believe these are actually needed for TypeDoc to be fully typed as a dependency. Blake Embrey, who has done a lot of work around types has been pretty adamant about that. It'd be great if this weren't true because of the conflicts with local types but my understanding is that they need to stay as direct dependencies. Please let me know if there is a better solution. Duplicate of #408 #335 #350 #384 #418, #434, and #600 Please see those issues for discussion. |
The more you know...
I'd like to take a closer look at this. I don't believe anything from |
Another option is to split the package. Have Having typedoc install typings is overly opinionated and have burdensome repercussions for consumers esp when CLI use is desired. |
Those are good points. I agree that it is burdensome and would like to fix it. I'd need to dig into the use cases more but I like the idea of trying to move the non-essential |
I also haven't checked but @types uses package refernces via an xml comment tag |
Just to clarify, I think global typings such as node should be dev dependencies. Those assertions are only true for actual dependencies you may expose transitively and wouldn’t otherwise conflict. Edit: It sounds like a transitive dependency on node here? That’s really unfortunate. I’d try to convince Microsoft/TypeScript that global dependencies shouldn’t be dependencies since that means not even this package can easily be developed against if they conflicted. |
Yeah, we don't have a direct dependency on
So it seems like we need to review what types are actually exposed. I haven't looked thoroughly but just looking at the // MarkedPlugin.ts
import * as FS from 'fs-extra';
import * as Path from 'path';
import * as Marked from 'marked';
import * as HighlightJS from 'highlight.js';
import * as Handlebars from 'handlebars'; // MarkedPlugin.d.ts
import { ContextAwareRendererComponent } from '../components';
import { RendererEvent, MarkdownEvent } from '../events';
export declare class MarkedPlugin extends ContextAwareRendererComponent {
includeSource: string;
mediaSource: string;
private includes?;
private mediaDirectory?;
private includePattern;
private mediaPattern;
initialize(): void;
getHighlighted(text: string, lang?: string): string;
parseMarkdown(text: string, context: any): string;
protected onBeginRenderer(event: RendererEvent): void;
onParseMarkdown(event: MarkdownEvent): void;
} The unfortunate thing is that this would need to be a manual check to find what is actually exposed unless we can come up with a simple test repo. |
RE: Manual testing. Here's a test repo that should work (completely untested): CMD
tsconfig.globalvars.json{
"extends": "./tsconfig",
"include": ["**/*.ts", "./tests/globalVarTest.test"]
} ./tests/globalVarTest.testdefine global{
// use require since it's a common global variable that can have conflicts. Other candidates can include console, jquery, underscore.
var require : string;
} |
Thanks @richardspence. That'd be a good check to have specifically for node. I'm also looking into checking the generated From what I've seen, TypeScript just uses any on any imports that don't have types so it's not easy to figure out what might be missing. 🤔 |
Hi, |
@aciccarello RE: any on any imports that don't have types... Turning on |
@aciccarello Thanks for closing this. Any ETA on the next release? Can we publish this as an alpha version earlier? |
We are working on fixing a bug on master. Then we'll get an alpha release out. Thanks for your patience! |
@types are stored as dependencies in package.json causing conflicts.
These conflicts are due to @types/node being added which may conflict with the locally defined global variables.
They should be moved to the dev dependencies.
The text was updated successfully, but these errors were encountered: