Skip to content
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

yarn create @scope doesnt work as expected #6233

Closed
iamstarkov opened this issue Aug 6, 2018 · 6 comments · Fixed by #6239
Closed

yarn create @scope doesnt work as expected #6233

iamstarkov opened this issue Aug 6, 2018 · 6 comments · Fixed by #6239
Assignees
Labels

Comments

@iamstarkov
Copy link
Contributor

What is the current behavior? it is also steps to reproduce

## create doesnt recognise scope without "/"
☯ yarn create @scope
yarn create v1.9.4
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/create-: Not found".

## create recognise scope with "/", but adds unnecessary "-" in the end
☯ yarn create @scope/
yarn create v1.9.4
[1/4] 🔍  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@scope%2fcreate-: Not found".

What is the expected behavior? npm's one is an expected behaviour

☯ npm init @scope
npm ERR! code E404
npm ERR! 404 Not Found: @scope/create@latest

Please mention your node.js, yarn and operating system version.

darwin 17.7.0
Node.js v8.11.3
yarn 1.9.4
@ghost ghost assigned torifat Aug 6, 2018
@ghost ghost added the triaged label Aug 6, 2018
@arcanis
Copy link
Member

arcanis commented Aug 6, 2018

I don't think we ever supported @scope/create, but I agree it would make sense. Want to open a PR? It should be fairly easy to change the logic in src/cli/commands/create.js 🙂

@iamstarkov
Copy link
Contributor Author

@iamstarkov
Copy link
Contributor Author

@arcanis sure, pull-request is almost ready

@iamstarkov
Copy link
Contributor Author

iamstarkov commented Aug 6, 2018

@arcanis unfortunately there are no existing tests for "create" command. is it okay to submit fix without tests?

@arcanis
Copy link
Member

arcanis commented Aug 6, 2018

That should be fine for create - iirc the reason there is none is that it was a pain to test it since it's spawning another process.

iamstarkov added a commit to iamstarkov/yarn that referenced this issue Aug 6, 2018
This one works as it should:
yarn create @scope/name => @scope/create-name

There were problems when name was omitted:

Before:
yarn create @scope => create-
yarn create @scope/ => @scope/create-

After:
yarn create @scope => @scope/create
yarn create @scope/ => @scope/create

Fixes yarnpkg#6233
iamstarkov added a commit to iamstarkov/yarn that referenced this issue Aug 6, 2018
This one works as it should:
yarn create @scope/name => @scope/create-name

There were problems when name was omitted:

Before:
yarn create @scope => create-
yarn create @scope/ => @scope/create-

After:
yarn create @scope => @scope/create
yarn create @scope/ => @scope/create

Fixes yarnpkg#6233
@iamstarkov
Copy link
Contributor Author

@arcanis PR is ready for review #6239

iamstarkov added a commit to iamstarkov/yarn that referenced this issue Aug 6, 2018
This one works as it should:
yarn create @scope/name => @scope/create-name

There were problems when name was omitted:

Before:
yarn create @scope => create-
yarn create @scope/ => @scope/create-

After:
yarn create @scope => @scope/create
yarn create @scope/ => @scope/create

Fixes yarnpkg#6233
arcanis pushed a commit that referenced this issue Aug 13, 2018
* fix(cli-create): fix scoped creation

This one works as it should:
yarn create @scope/name => @scope/create-name

There were problems when name was omitted:

Before:
yarn create @scope => create-
yarn create @scope/ => @scope/create-

After:
yarn create @scope => @scope/create
yarn create @scope/ => @scope/create

Fixes #6233

* refactor(cli-create): make parsePackageName more robust and add tests

* refactor(cli-create): add missing typyings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants