Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Allow scoped packages #63

Merged
merged 1 commit into from
Jun 5, 2017
Merged

Allow scoped packages #63

merged 1 commit into from
Jun 5, 2017

Conversation

joscha
Copy link
Contributor

@joscha joscha commented Jun 5, 2017

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 microsoft/dtslint#47, DefinitelyTyped/dt-review-tool#11
detected whilst working on storybookjs/storybook#1166

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

msftclas commented Jun 5, 2017

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 added a commit to joscha/dtslint that referenced this pull request Jun 5, 2017
Currently when running `npm run lint @bla/foo` in https://github.com/DefinitelyTyped/DefinitelyTyped it errors with:

```
➜  DefinitelyTyped git:(add-@storybook__react) ✗ npm run lint @storybook/react

> definitely-typed@0.0.1 lint /Users/joscha/Development/DefinitelyTyped
> dtslint types "@storybook/react"

ENOENT: no such file or directory, open '/Users/joscha/Development/DefinitelyTyped/types/@storybook/react/index.d.ts'

npm ERR! Darwin 16.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lint" "@storybook/react"
npm ERR! node v7.5.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! definitely-typed@0.0.1 lint: `dtslint types "@storybook/react"`
npm ERR! Exit status 1
```

for scoped packages.

references microsoft/dts-gen#63
@joscha
Copy link
Contributor Author

joscha commented Jun 5, 2017

references DefinitelyTyped/DefinitelyTyped#16970

@RyanCavanaugh RyanCavanaugh merged commit 0d907db into microsoft:master Jun 5, 2017
@joscha joscha deleted the patch-1 branch June 5, 2017 22:23
joscha added a commit to joscha/dts-gen that referenced this pull request Jun 5, 2017
This is not a problem right now, as there are no other transformations on `s`, but if the code changes in the future and this is overlooked, it might cause problems.

follow-up to microsoft#63
@joscha
Copy link
Contributor Author

joscha commented Jun 22, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Module names with @ symbol
3 participants