Use these webcomponents to make your Goodshuffle inventory available on a website.
You will need a recent installation of an LTS version of Node.js (12.18.3).
On MacOS X, you can install this using
brew install node
If you anticipate working on multiple projects that use Node.js it may be helpful to install nodenv.
Anyone familiar with sdkman, rbenv, or pyenv should feel right at home. Other solutions for managing multiple versions of Node.js can be used, but
nodenv is recommended.
After cloning the project, run the following command to install project dependencies.
Run a local server.
npm run start
After running this command, your system's default browser should be opened and the content of
./src/index.html displayed. This page is used to do some live exerimentation during development. If a valid data source is not available, you will see the message "Categories temporarily unavailable."
By default, the project will reference a locally running version of an HTTP service that provides wishlist data. Typically, that project will be configured to reference remote deployments services (RabbitMQ, Elasticsearch, and PostgreSQL). Please see https://github.com/goodshuffle/gspro-data-api/blob/master/README.md for more info.
You may also change
./src/index.html to reference a test, demo, or even production URL for data if you do not wish to configure the wishlist HTTP services. Look for the following tag, and set the content like such. Just be aware that if you're doing local development that you should be referencing an http (not https) URL.
<meta name="gspro-config" content="https://test.goodshuffle.com/vendor/:public-website-key:" />
Before releasing a new version of the library, you should stop your local development server. This should prevent potential development build artifacts from appearing in production builds.
This project uses Semantic Versioning 2.0.0
Update the release version in:
Note: once the release is finalized, you will need to update several other places with the new version:
- goodshuffle-developer-site - update the changelog, update all references to previous versions in setup instructions
- wp-gspro-gallery - update the version of the that npm is using to construct the wishlist gallery
Next, run the build.
npm run build
Finally, you can publish the new version to NPM. Please be aware that you may need to run
npm login if you haven't already.
You will need an NPM account and be authorized to publish projects to the @goodshuffle organization. Two factor authentication is required to publish changes to the project.
We suggest that wishlist customers use UNPKG to retrieve the library. This is a reliable and high-performance CDN that makes it trivial to include the library on websites. At the time of writing, UNPKG provided approximately 88 billion downloads in the previous month. Please refer to the documentation to understand how ambiguous versions (e.g. 2.0) are resolved to the latest matching version.