josephg / node-foundationdb

Modern Node.js FoundationDB bindings
Other
116 stars 17 forks source link

Add TypeScript build step before publish? #1

Closed eliot-akira closed 6 years ago

eliot-akira commented 6 years ago

If a project that imports this module doesn't use TypeScript, it results in an error: Cannot find module 'foundationdb'. I believe this is due to the following line in package.json:

  "main": "dist/index.js"

The module foundationdb published on npm doesn't have a dist folder.

Perhaps TypeScript should be compiled in a prepublish script?

  "scripts": {
    "install": "node-gyp rebuild",
    "prepublish": "tsc -p ."
  }

..and add !dist in a new .npmignore (to exclude from repo but include in published module)?

josephg commented 6 years ago

Oh oops, yeah. I had that working in an earlier published version. That’s what I intended I just forgot. I’ll republish in a bit.

josephg commented 6 years ago

You're welcome to make PRs for this sort of stuff. Anyway, fixed and republished.