microsoft / dts-gen

dts-gen creates starter TypeScript definition files for any module or library.
MIT License
2.43k stars 102 forks source link

Allow scoped packages #63

Closed joscha closed 7 years ago

joscha commented 7 years ago

Local identifiers for scoped packages follow a specific pattern. @some/module becomes some__module.

Currently this fails:

➜  DefinitelyTyped git:(master) ✗ dts-gen --dt --name "@storybook/addon-actions" --template module
Unexpected crash! Please log a bug with the commandline you specified.
/Users/joscha/.config/yarn/global/node_modules/dts-gen/bin/lib/run.js:130
        throw e;
        ^

Error: ENOENT: no such file or directory, mkdir 'types/@storybook/addon-actions'
    at Object.fs.mkdirSync (fs.js:855:18)
    at Object.writeDefinitelyTypedPackage [as default] (/Users/joscha/.config/yarn/global/node_modules/dts-gen/bin/lib/definitely-typed.js:24:14)
    at Object.<anonymous> (/Users/joscha/.config/yarn/global/node_modules/dts-gen/bin/lib/run.js:92:35)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)

closes #55 references https://github.com/Microsoft/dtslint/pull/47, https://github.com/DefinitelyTyped/dt-review-tool/pull/11 detected whilst working on https://github.com/storybooks/storybook/issues/1166

msftclas commented 7 years ago

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. Thanks, Microsoft Pull Request Bot

joscha commented 7 years ago

references https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16970

joscha commented 7 years ago

would be awesome if we could get this change in a release @RyanCavanaugh