The SDK is a collection of type definitions for use with typescript. The type definition files also include an API documentation. Developers can use this documentation as a reference when implementing a plugin.
plugin-sdk
├─ wbk-core
│ ├─ plugins <- plugin category interfaces
│ ├─ types
│ └─ ...
├─ wbk-sharedlib
└─ egr-wcf-<version>.tgz
The wbk-core directory contains the interface definitions of the pCon.basket plugin API. For example the interfaces for the different plugin categories can be found under wbk-core/plugins
.
The wbk-sharedlib is an installable npm package. It contains a list of dependencies which are commonly used by plugins and an Webpack DLL. The purpose of the wbk-sharedlib is to reduce the bundle size of plugins and to ensure that every plugin uses the same version of a bundled library. Every plugin is an independent bundle of javascript code and libraries. Typically webpack would bundle all of the plugin dependencies inside the plugin. That would mean that every plugin using for example react
would bundle its own copy of react
. This means that the size of every plugin would be very big. Dependencies part of wbk-sharedlib will not be bundled inside the plugin because they already bundled in the wbk-sharedlib.
wbk-sharedlib has to be added as an dependency in the package.json
of the plugin and the webpack DllPlugin
has to be configured inside the webpack.config.js
. The example plugin can be used as an example for this.
wbk-sharedlib comes in two versions a relase/production build and a debug/development build. For debugging issues with 3rd party libraries it is recommended to use the development build. By default pCon.basket only loads the release build of wbk-sharedlib at runtime. To change this the debug mode of pCon.basket can be enabled. This can be done with the debug=true
url parameter.
Example:
https://www.example-basket.com/?debug=true
W-CF stands for Web Configuration Framework. It provides all core functions which are necessary to communicate with the EAIWS or configure articles. It is provided as an NPM
module @easterngraphics/wcf
and it is referenced by wbk-sharedlib.
Module summary:
More details about these modules can be found in the W-CF documentation.
Generated using TypeDoc