acquia / waterwheel.js

A generic JavaScript helper library to query and manipulate Drupal 8 via core REST and JSON API
https://github.com/acquia/waterwheel.js
233 stars 26 forks source link

Use postinstall to provide compiled lib for browser #21

Closed infiniteluke closed 7 years ago

infiniteluke commented 7 years ago

Npm provides a prepublish script that allows commands to be run before publishing and upon a local npm i. I suggest adding the build command so that browser users can import dist/waterwheel.js without requiring the manual npm run build. .npmignore is required since dist/waterwheel.js is explicitly ignored in .gitignore (which prepublish falls back to).

Test

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d2e09ab6930d0bd6418c3763313c0a522c581ed5 on infiniteluke:publish-dist into 77cff0ff2f8ce128ebd462b0d79c7ebbd9b93a1b on acquia:0.6.0.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 12fbbd630ddad0e3e6e375ddfd6c13995031d04d on infiniteluke:publish-dist into 77cff0ff2f8ce128ebd462b0d79c7ebbd9b93a1b on acquia:0.6.0.

infiniteluke commented 7 years ago

Switched to postinstall as it provides the dist in the case of npm i waterwheel which prepublish does not.