hackerati / generator-lambda-cd

Tool to help developers quickly create skills for text- and voice-based chatbots
MIT License
0 stars 0 forks source link

Publish to NPM #9

Open funkymonkeymonk opened 7 years ago

funkymonkeymonk commented 7 years ago

Allow CD pipeline to publish to npm

funkymonkeymonk commented 7 years ago

Addressing in #10

thomkrillis commented 7 years ago

Travis passed but it appears the deployment to npm failed

Deploying application
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 48
npm WARN prepublish-on-install As of npm@5, `prepublish` scripts are deprecated.
npm WARN prepublish-on-install Use `prepare` for build steps and `prepublishOnly` for upload-only.
npm WARN prepublish-on-install See the deprecation note in `npm help scripts` for more information.
> generator-lambda-cd@0.0.0 prepublish .
> nsp check
sh: 1: nsp: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! generator-lambda-cd@0.0.0 prepublish: `nsp check`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the generator-lambda-cd@0.0.0 prepublish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2017-09-11T17_18_30_988Z-debug.log
Already up-to-date!
HEAD detached at 72cd942
nothing to commit, working tree clean
Dropped refs/stash@{0} (c35a2d79139554b60e8b6350d972c979f94d5be6)
after_script
1.16s$ cat ./coverage/lcov.info | coveralls
Done. Your build exited with 0.
thomkrillis commented 7 years ago

Seems like a weird interaction between deploying to npm (.travis.yml) and prepublish (package.json).

I think one solution could be to change "prepublish": "nsp check", to "prepublishOnly": "npm install && nsp check", (prepublishOnly because prepublish is called by npm install and would cause infinite recursion).

A better solution would probably be to replace "scripts" in package.json with a Makefile.

funkymonkeymonk commented 7 years ago

So I've backed out all the code to do this since I pushed it manually. We can automate this when it makes sense.

thomkrillis commented 7 years ago

Remaining work on this is to look at industry standards and determine if it's appropriate to implement some automated version-bumping and deployment to npm or if this should remain a manual process.