Converting Meteor s-enum Package to NPM Package (thanks to v1.3)

I have just converted my first Meteoor package to NPM

Now I’m going to try to use it in my projects and hope (fingers crossed) that it works.

Let me know if I did it “right” and if it causes you guys any problems.

@mdgbot what should I do about the old atmosphere package? Will we deprecate those? Do I need to publish a version of that which announces deprecation? What’s the plan?

2 Likes

Hey, this looks great, Alan. It’s going to be a few weeks before I dive into another sprint on the ChecklistManifesto, but I think I’m going to add SEnum as part of the Clinical track and add it in as part of the new factory pattern. So I’ll give it a spin within a month or so.

Question: if we want to alias SEnum as ValueSet, would you accept a PR? Or should I just do the aliasing in its own Atmosphere package that depends on s-enum?

I ask because the FHIR standards specify over a hundred ValueSets:
https://www.hl7.org/fhir/terminologies-valuesets.html

And for an Order (aka Task), the ValueSet looks like this:
https://www.hl7.org/fhir/valueset-order-status.html

Obviously, I’m thinking of using SEnum to manage all of these. Also, have you thought about a tutorial or blog article? I’d be curious to hear what the migration process was like.

SEnum

I’ve been using this lib (in Meteor land) for a while and am super happy with it. (see what I did there?)

A tutorial, article, or bigger docs are a good idea. The readme has a fair bit and the tests are useful. It’s a small problem space, but this fills it well.

Migration

Well, I’m not there yet. Currently the npm fails because babel didn’t convert let to var for cjs

packages/modules.js:107
let _getAutoValue = (obj, list) => {
^^^
SyntaxError: Unexpected strict mode reserved word 

So… I don’t know yet. Help!

1 Like

Update - I think I have the es6 --> cjs on npm working… npm s-enum@1.1.3 – let me know

Yeah, transpiling before publishing is how everyone is doing it, for now.

I think most people are using a setup like http://jamesknelson.com/writing-npm-packages-with-es6-using-the-babel-6-cli/.

In particular, note the use of the prepublish script alias (i.e. transpilation will be done automatically every time you type npm publish before uploading) and the appropriate use of .gitignore and .npmignore for the lib and src directories, respectively.

1 Like