Yeoman Generator for OWAs

Hello all–

Is the Yeoman Generator for OWAs still our “best practice” for scaffolding OWAs? If so, I was looking to make a slight change it in it to fix an issue I was seeing.

I see it looks like the code still lives in @pascal’s github repo:

Should we migrate this to the OpenMRS repo?

Take care, Mark

2 Likes

I would love for it to be moved over to the OMRS org, and to include the latest stuff that people have been working on.

1 Like

@mogoodrich do you have privs to migrate this, or do you need help from the infra team?

Not sure… I will follow up and either do it or put in a request.

I think there are two steps:

  1. Fork my repo to the OpenMRS org.
  2. Change the package name to include include the org scope and republish (see here).

I’ll give it a quick try.

cool, thanks @pascal, let me know how it goes

Okay, looks like we’re good to go:

For now I’m leaving the old package online in case some people try to install it. If there’s a way to configure a redirect or something we might want to try that.

Also, for you to be able to publish to npm we need to add you to the org. Let me know your npm username and I’ll give you permissions.

Sweet, thanks @pascal!

And meant to add, I just signed up for an npm account, username “mogoodrich”.

I’ve added you as an admin to the OpenMRS npm org, so you should have all the access you need now :ok_hand:

Thanks @pascal! I may try to do a release with the small enhancement I added just to confirm I understand the process…

Take care, Mark

Of course! Sorry I haven’t written up the process, but it should just be:

npm version 1.2.3

which will update the version in package.json to 1.2.3. You should then push to the repo. Then:

npm publish

EDIT: You’ll have to run npm login first.

Thanks @pascal! Everything seems to be working, with one caveat… I see you changed the package to add the org scope of @openmrs. So this has created a new, separate npm “@openmrs/generator-openmrs-owa” which I have to install separately, and then I need to run via “yo @openmrs/openmrs-owa” or it runs the older version. Do you know if there’s any way around this so users can upgrade seamlessly?

(Sorry, I inexperienced with npm and a total newbie to yeoman).

Thanks! Mark

1 Like

I’m getting rid of the old unscoped package. It will be removed and a message will be displayed that says:

The generator-openmrs-owa package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.

Please use the `@openmrs/generator-openmrs-owa` package instead.

I asked NPM if they could simply do a redirect, but they can’t unfortunately. I guess the best we can do is make sure the instructions are correct, and maybe put a prominent warning in the README.

I don’t see your code in GitHub. Have you pushed it? Publishing on NPM and pushing to GitHub need to be done separately.

Whoops, thanks @pascal. I had committed my changes but figured I’d wait to push until I got the release to npm complete and confirmed everything was working… and then I forgot to push… :slight_smile: Just pushed it up now.

Take care, Mark

1 Like