Repository navigation
add package @storybook/addon-knobs - #17399
Conversation
|
types/storybook__addon-knobs/index.d.ts Checklist
|
|
|
||
| // TODO: Once TS2.3 is released, | ||
| // https://github.com/Microsoft/TypeScript/issues/14819 should be fixed. | ||
| // Then, upgrade this package's typescript version to 2.3 and |
There was a problem hiding this comment.
2.3 is released so you can do this TODO.
There was a problem hiding this comment.
Might be nice to do it for @storybook/react too
There was a problem hiding this comment.
@sandersn Is there an example of a scoped package that has done this already? Do you think we can do it as a follow-up and do both packages at once?
There was a problem hiding this comment.
I just tried removing the wrappers, but now get:
/Users/joscha/Development/DefinitelyTyped/types/storybook__addon-knobs/index.d.ts
ERROR: 10:32 expect TypeScript compile error: Cannot find module '@storybook/react'.
/Users/joscha/Development/DefinitelyTyped/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx
ERROR: 2:27 expect TypeScript compile error: Cannot find module '@storybook/react'.
ERROR: 14:8 expect TypeScript compile error: Cannot find module '@storybook/addon-knobs'.
I have used /// <reference types="storybook__react" /> at the top of the file, but for some reason it still is not picked up correctly. Any idea what I might be doing wrong?
There was a problem hiding this comment.
Tried a rm -rf node_modules and clean install to make sure its not an outdated dtslint version.
Full command:
$ npm run lint storybook__addon-knobs
> [email protected] lint /Users/joscha/Development/DefinitelyTyped
> dtslint types "storybook__addon-knobs"
Installing to /Users/joscha/Development/DefinitelyTyped/node_modules/dtslint/typescript-installs/2.3...
npm notice created a lockfile as package-lock.json. You should commit this file.
Installed!
/Users/joscha/Development/DefinitelyTyped/types/storybook__addon-knobs/index.d.ts
ERROR: 8:32 expect TypeScript compile error: Cannot find module '@storybook/react'.
/Users/joscha/Development/DefinitelyTyped/types/storybook__addon-knobs/storybook__addon-knobs-tests.tsx
ERROR: 4:27 expect TypeScript compile error: Cannot find module '@storybook/react'.
ERROR: 16:8 expect TypeScript compile error: Cannot find module '@storybook/addon-knobs'.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint: `dtslint types "storybook__addon-knobs"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/joscha/.npm/_logs/2017-06-22T21_00_18_487Z-debug.log
There was a problem hiding this comment.
The branch with the declare removals diffs as following to this one here: https://github.com/joscha/DefinitelyTyped/compare/joscha/add-@storybook/addon-knobs...joscha:joscha/add-@storybook/addon-knobs-remove-declare?expand=1
There was a problem hiding this comment.
I think @Andy-MS is the better one to ask since I think he made the name-mangling-lookup change.
|
Let's merge this as-is while we figure out the name-mangled lookup on our end. |
|
Thank you @sandersn ❤️ ! |
|
|
||
| function object<T>(name: string, value: T): T; | ||
|
|
||
| function select<T>(name: string, options: { [s: string]: T }, value: string): T; |
There was a problem hiding this comment.
There should be one more argument "groupName"
Use a meaningful title for the pull request. Include the name of the package modified.
Test the change in your own code. (Compile and run.)
Follow the advice from the readme.
Avoid common mistakes.
Run
npm run lint package-name(ortscif notslint.jsonis present).The package does not provide its own types, and you can not add them.It has been decided to move away from providing the types within the package as there is no owner using TS and the types were outdated most of the time, see Typescript Support storybookjs/storybook#1166 and Add typings for links add-on storybookjs/storybook#1154If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
Create it with(Isn't possible at the time, opened Allow scoped packages microsoft/dts-gen#63 which is merged, but has not been released, yet /cc @RyanCavanaugh)dts-gen --dt, not by basing it on an existing project.tslint.jsonshould be present, andtsconfig.jsonshould havenoImplicitAny,noImplicitThis, andstrictNullChecksset totrue./cc @ndelangen
references #16970, storybookjs/storybook#1339