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
poi: add poi types #34424
poi: add poi types #34424
Conversation
@bolasblack Thank you for submitting this PR! Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes. In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day! |
@bolasblack The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
This is a more detailed list of all the options: https://github.com/egoist/poi/blob/master/core/poi/lib/utils/validateConfig.js |
types/poi/index.d.ts
Outdated
hotEntries?: string[]; | ||
historyApiFallback?: WebpackDevServerConfig["historyApiFallback"]; | ||
open?: boolean; | ||
proxy?: WebpackDevServerConfig["proxy"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxy
can be a string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @egoist, I found proxy also support function, but I can not find the function signature both in poi documention or webpack dev server documention
Can you tell me where introduced the definition of this function?
@egoist Thanks, I will update the Config definition after reading the code |
@bolasblack The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
@bolasblack The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
Finally...It's weird, when I execute
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the poi
package exports a class directly, rather than a module containing the class Poi
.
Therefore, you should use the constructable module template so that the library can be imported without runtime failures.
@bolasblack One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. Thank you! |
Hi @uniqueiniquity, thanks for your reply, do you mean I'd better write all the |
@bolasblack Yes, that's correct. declare class PoiCore {
...
}
declare namespace PoiCore {
...
export interface Babel {
...
}
...
}
export = PoiCore; Then your test should be: import Poi = require("poi");
const poi = new Poi(); or something similar. It would be good to also test the usage of the types you've defined. |
@bolasblack The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
8d262b6
to
0956547
Compare
{ | ||
"private": true, | ||
"dependencies": { | ||
"cac": "~6.4.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @egoist, I found cac@6.5 used the default export of 'event'
, it will make tsc report an error: Module '"events"' has no default export.
Hi @uniqueiniquity, I modified the code according to your suggestion. |
🔔 @uniqueiniquity - Thanks for your review of this PR! Can you please look at the new code and update your review status if appropriate? |
I just published |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If adding a new definition:
.d.ts
files generated via--declaration
dts-gen --dt
, not by basing it on an existing project.tslint.json
should be present, andtsconfig.json
should havenoImplicitAny
,noImplicitThis
,strictNullChecks
, andstrictFunctionTypes
set totrue
.