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 support #487

Closed
elboletaire opened this issue May 23, 2017 · 9 comments
Closed

Yarn support #487

elboletaire opened this issue May 23, 2017 · 9 comments

Comments

@elboletaire
Copy link
Collaborator

The oc client can currently be installed using yarn, as any other npm package. The problem comes when we try to publish a package to a registry; for some reason it complains about dependency issues:

$ yarn global add oc
$ oc add registry https://your.registry.com
$ NODE_ENV=production oc publish my-widgets
Packaging -> ~/src/my-widgets/_package
An error happened when creating the package: oc/template.html compilation failed - Error requiring oc-template: "oc-template-handlebars" not found

I never had an issue before installing a package with yarn, so I'm not really sure why is this happening. For that same reason, I'm not really sure if I should mark this as a bug or as an enhancement.

Anyone has an idea why this is different using yarn?

@mattiaerre
Copy link
Member

@elboletaire thanks for pointing that out. I'll have a look at it and let you know.

@mattiaerre
Copy link
Member

mattiaerre commented May 23, 2017

@elboletaire I've been able to yarn globally install oc and publish a couple of my packages; one that uses handlebars and another one that uses jade. Some more info:

~ yarn global add oc

➜  oc-hub git:(master) ✗ oc publish oc-feedback-form
Packaging -> /Users/mrichetto/projects/oc-hub/oc-feedback-form/_package
(node:3853) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
Compressing -> /Users/mrichetto/projects/oc-hub/oc-feedback-form/package.tar.gz
Publishing -> https://pink-pineapple.herokuapp.com/oc-feedback-form/1.0.3
Published -> https://pink-pineapple.herokuapp.com/oc-feedback-form/1.0.3

node: v6.10.2
oc: v0.37.4

// cc @nickbalestra @matteofigus

@matteofigus
Copy link
Member

I can see a difference. In one case you publish one level down your component, in the other it's /src/component.

This could be a bug for the require wrapper in the cli looking to require the peer template module relative to the component instead of the position of where the command is ran.

@mattiaerre
Copy link
Member

mattiaerre commented May 23, 2017 via email

@matteofigus
Copy link
Member

Let me catchup with @nickbalestra about this. I think we established a couple of days ago that there was a bug relative to the cli looking for the template in the wrong path, so it could be related.

@mattiaerre mattiaerre self-assigned this May 30, 2017
@matteofigus
Copy link
Member

@elboletaire can you try yarn global remove oc and then a yarn global add oc and retry to run the publish command? I think there is something wrong with your install and perhaps a remove+add can fix. Perhaps, it would be useful to ensure yarn is installed with the latest version as well.

@elboletaire
Copy link
Collaborator Author

@matteofigus if you want I try it, but I guess it's gonna fail, because everywhere where I installed oc client (latest friday was the last time I tried) with yarn failed with the same issue (and that includes docker images from latest node version).

BTW, I'll try it when I arrive at the office

@matteofigus
Copy link
Member

Ok... I managed to reproduce. I think #488 is actually a good way to solve it. I'll add my findings there

@elboletaire
Copy link
Collaborator Author

Nice, I was coming here to confirm the issue's still there; glad to see you were able to reproduce it 😃

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

No branches or pull requests

4 participants