Package Exports
- piral-debug-utils
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (piral-debug-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Piral Debug Utils ·

This is a utility library that can be used for debugging Piral instances.
What piral-debug-utils offers are utilities to provide reach debugging tools for the browser. This forms the basis for UI tooling such as the Piral Inspector.
Installation
This should only be installed as a dependency (dependencies), but usually guarded to be active (or included in the bundle) only for development / emulation purposes (i.e., when developing pilets).
If you'd love to use yarn:
yarn add piral-debug-utilsAlternatively, npm works reliably, too:
npm i --save piral-debug-utilsUsage
The utilities should be used as follows.
We can use the installPiralDebug function to install the debug helper object globally on window. It is called dbg:piral.
Usually, we'd guard it to make it only accessible under development conditions.
// if we build the debug version of piral (debug and emulator build)
if (process.env.DEBUG_PIRAL !== undefined) {
const { installPiralDebug } = require('piral-debug-utils');
installPiralDebug({
context,
createApi,
getDependencies,
loadPilet,
requestPilets,
});
}We can use the withEmulatorPilets function to modify (or not) the provided PiletRequester, which will be handed over later to the createInstance options or piral-base directly.
Usually, we'd guard it to make it only accessible under emulator conditions.
// if we want to change `fetchPilets` (for an emulator) of the LoadPiletsOptions
if (process.env.DEBUG_PILET !== undefined) {
const { withEmulatorPilets } = require('piral-debug-utils');
fetchPilets = withEmulatorPilets(fetchPilets, {
inject: context.injectPilet,
createApi,
loadPilet,
});
}License
Piral is released using the MIT license. For more information see the license file.
